1
0
Fork 0

mod() for argument of sine function in surface light shader to make sure it falls between 0 and 2 pi

This commit is contained in:
Thorsten Renk 2014-10-16 10:24:27 +03:00
parent 6d9456c7cc
commit 5c0a0d2305
3 changed files with 4 additions and 4 deletions

View file

@ -73,8 +73,8 @@
<wrap-t><use>texture[0]/wrap-t</use></wrap-t>
</texture-unit>
<program>
<vertex-shader>Shaders/surface-light-lightfield.vert</vertex-shader>
<fragment-shader>Shaders/surface-light-lightfield.frag</fragment-shader>
<vertex-shader>Shaders/surface-light-ALS.vert</vertex-shader>
<fragment-shader>Shaders/surface-light-ALS.frag</fragment-shader>
<fragment-shader>Shaders/noise.frag</fragment-shader>
</program>
<uniform>

View file

@ -54,10 +54,10 @@ float r = length(coord);
if (pixelSize<1.3) {return vec4 (1.0,1.0,1.0,1.0) * 0.08;}
float angle = noise * 6.28;
float angle = noise * 6.2832;
float sinphi = dot(vec2 (sin(angle),cos(angle)), normalize(coord));
float ray = clamp(pow(sin((sinphi-3.0) * (sinphi-3.0)),10.0),0.0,1.0);
float ray = clamp(pow(sin(mod((sinphi-3.0) * (sinphi-3.0),6.2832)),10.0),0.0,1.0);
float fogEffect = (1.0-smoothstep(0.4,0.8,transmission));