THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 01/07/2010 at 21:49, xxxxxxxx wrote:
Cinema 4D Version: 11.5
Platform: Windows ;
Language(s) : C++ ;
I am working on a shader that will randomly choose pixels and color them white.
I know that sd->p is the pixel , but if I try to do something like this,
if(sd->p.x = frand(0, 100))
I never choose the pixel because the sd->p is never the same as the random function. In fact the likelihood of that ever happening is pretty slim.
so I am looking for a way to randomly choose pixels in a shader and to output that pixel as Vector(1,1,1) (White).
Is there an index for each pixel, or a way to find the pixel count? Saying that out loud sound crazy to me because it seems like there would be way too many pixel to iterate through and it would be excruciatingly slow. But is there a way to choose a random pixel and then if the current pixel is equal to that number output the vector (1,1,1)
Hopefully that makes sense..