Announcement

Collapse
No announcement yet.

Random number in GLSL?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Random number in GLSL?

    Hi all,

    Is there a function or another method in GLSL that will give me a different random number every time it is called?

    Thanks!
    Rens
    Rens Heeren
    Generalist
    WEBSITE - IMDB - LINKEDIN - OSL SHADERS

  • #2
    .. with a uniform distribution? : )
    Rens Heeren
    Generalist
    WEBSITE - IMDB - LINKEDIN - OSL SHADERS

    Comment


    • #3
      I'm not sure, I have to check. What do you want to do with it?

      Best regards,
      Vlado
      I only act like I know everything, Rogers.

      Comment


      • #4
        I want to query a gradient texture (u only) n times, but it has to work for both a high and low amount of samples, and that after a large amount of samples it would not be biased in any direction.
        However I think I can use some kind of evenly spaced recursive subdivision so the sampling distances get smaller the more samples there are, that might actually be a better option! Or what would be a better way to get a good representation of a gradient with both a low and high number of samples?
        Rens Heeren
        Generalist
        WEBSITE - IMDB - LINKEDIN - OSL SHADERS

        Comment

        Working...
        X