Kaydet (Commit) 04352b48 authored tarafından Tor Lillqvist's avatar Tor Lillqvist

Now I understand why that multiplication by 10 was there originally

I was suffering from one basic misunderstanding: I did not get it that
samplers are indexed with normalized texture coordinates, i.e. 0..1.
(Note that multiplying a coordinate by any number does not break
anything horribly for this use case, looking up a pseudo-random
number, because textures by default repeat as a coordinate wraps.)

We multiply by 10 so that neighbouring pixels that map to close index
into the permTexture don't get clumped together with close sn values,
and thus same behaviour.

(Sure, the multiplication by 256 that I had changed it to worked, too,
but not the way my initial reasoning went... So let's use the original
10 to avoid somebody else thinking that we need to multiply by 256
because permTexture is built from a 256x256 array.)

(See 1877228a)

Change-Id: I1d350446460fe2fdd3e55f00053a5ce01d2d117c
üst bfc9619f
......@@ -40,7 +40,7 @@ float snoise(vec2 P) {
}
void main() {
float sn = snoise(256*v_texturePosition);
float sn = snoise(10.0*v_texturePosition);
if( sn < time)
gl_FragColor = texture2D(enteringSlideTexture, v_texturePosition);
else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment