summaryrefslogtreecommitdiff
path: root/slideshow/opengl
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2015-11-08 16:52:39 +0200
committerTor Lillqvist <tml@collabora.com>2015-11-08 17:31:39 +0200
commit04352b481cc711dd2f9c345f69fb6a22a585cd29 (patch)
tree044c4f2fbf6bfe71f32bbcc604489582cedf465d /slideshow/opengl
parentbfc9619fccd17c5059949afc06953695222dea3b (diff)
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 1877228ae8e7cc298cf4e45d061ee54774aa1d08) Change-Id: I1d350446460fe2fdd3e55f00053a5ce01d2d117c
Diffstat (limited to 'slideshow/opengl')
-rw-r--r--slideshow/opengl/dissolveFragmentShader.glsl2
1 files changed, 1 insertions, 1 deletions
diff --git a/slideshow/opengl/dissolveFragmentShader.glsl b/slideshow/opengl/dissolveFragmentShader.glsl
index 6ce3d539d114..c0fdbf441ed9 100644
--- a/slideshow/opengl/dissolveFragmentShader.glsl
+++ b/slideshow/opengl/dissolveFragmentShader.glsl
@@ -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