I have a simple fragment shader to simulate "falling water". I'm using Ogre3D and opengles2, this is my code:
#version 130
uniform sampler2D valveTex;
uniform sampler2D noiseTex;
uniform float time;
uniform vec3 sprayColor;
varying vec2 uv;
varying float rand;
void main()
{
gl_FragColor.w = texture2D(valveTex, uv).w;
float noiseW = texture2D(noiseTex, uv + vec2(rand, -time)).x;
gl_FragColor.w *= noiseW + noiseW;
gl_FragColor.xyz = sprayColor;
}
The shader works well and I see the animation happening, but after some time running the animation stops like if the variable time
stopped updating, and the water stream looks still. What can be causing this?
Edit1: variable time
is derived from Ogre's time_0_1
.
tex_address_mode wrap wrap
\$\endgroup\$