Comment 16 for bug 1731788

Revision history for this message
Ruslan (b7-10110111) wrote :

> Does the statement "random(vec4(gl_FragCoord.xyy,i))" return a float?

Yes, the `random` function is defined to return `float`. But this by itself isn't a problem. The problem is the usage of `gl_FragCoord` inside the expression used to calculate `index`.

> Would some other mechanism to select a random int from [0..63] be applicable and deliver equal or better results?

I'm not sure what else limitations GLES/ANGLE has (I've only used desktop OpenGL), but a surefire method would be to convert `poissonDisk` from array to a `sampler2D`, and sample it as a texture instead of indexing. This will allow to achieve exactly the same results, provided the texture filter is set to `GL_NEAREST`.