Original Post
Thanks for help!
Quote:
Original post by Armadon
For a simple random value in the pixle shader. You can easily set a global such as int random; and then from your application calculate a random value and set the global from within your application ID3DXBaseEffect::SetInt()...
I hope this helps.
Take care.
Quote:
Original post by smitty1276
Create a texture full of random numbers, then use it to texture whatever your polygon is. The trick then is to randomly generate TEXTURE COORDINATES to randomly index into the random texture.
It's much faster than generating random numbers every pass for every fragment.
Quote:If you randomly index into a randomly generated texture, you won't see any pattern at all, let alone a moving one. I used this technique for a recent project, and it looks like TV static. I would make the texture as large as is feasible, though. You called it an "offset"... it isn't an offset. It is actually randomly generated texture coordinates.
but it seems only offsetting coordinates might give a non-random feel at times (you can see the pattern moving)?
Quote:
Original post by smitty1276
If you randomly index into a randomly generated texture, you won't see any pattern at all, let alone a moving one.
Quote:
Original post by Jonas B
Hmm... With carefully chosen random numbers, and a large enough texture, it could work.
The problem in its simplest form is what happens if your offset (what's wrong with that word?) happens to be the same on two consecutive frames? Or two frames apart? Or almost the same?
The patterns that can give a feeling of non-randomness are many.
Or did I miss something in the technique?
This topic has been locked by a moderator. New replies are not allowed.
GameDev.net uses cookies to ensure you have the best experience on our platform. Learn more