random() in scene module?

is there a random function available in the scene module?

Comments

  • The usual way is to use a hash function that looks random enough although being deterministic. Well there really isn’t a way to produce a truly random number using a a computer, by definition, since it will always be using some kind of formula, but that’s not the point. What you have to realize is that shaders need a random function that is “persistent” so each pixel can reproduce the same random value. So there is no way each pixel would get its own random value like when computing on cpu

    So no there isn’t, but check the myriad of hash functions that simulate that in shaders.

    Actually @giku mentioned at some point he could possibly introduce a random function for the _scene module_ but again that’s not really necessary because with hash pseudo-random you can have a random enough function in practice

  • edited August 23

    i thought, because i read, there was a " processing.org" kind of "layer" above the shader code in the scene module.

    so besides the drawing functions, what else do we have?

  • Not sure I understand your question. The scene module is like processing in the sense you draw shapes in 2 or 3D so you can compose a scene.

    processing does have a random function but like I said it’s faked as well, and with an hash function you get the same results.

    if you want to know what the scene module can do, check the presets, or the specific threads here about it

    glad to help if you get stuck, as I’m sure others will

Sign In or Register to comment.