#ifdef GL_ES #extension GL_OES_texture_3D : enable precision mediump int; precision mediump float; precision mediump sampler3D; #endif #define USE_OGRE_FROM_FUTURE #include SAMPLER2D(RT, 0); SAMPLER3D(noise, 1); OGRE_UNIFORMS( uniform vec2 numTiles; uniform vec2 iNumTiles; uniform vec2 iNumTiles2; uniform vec4 lum; ) MAIN_PARAMETERS IN(vec2 oUv0, TEXCOORD0) MAIN_DECLARATION { vec3 local; local.xy = mod(oUv0, iNumTiles); vec2 middle = oUv0 - local.xy; local.xy = local.xy * numTiles; middle += iNumTiles2; local.z = dot(texture2D(RT, middle), lum); vec4 c = vec4_splat(texture3D(noise, local).r); gl_FragColor = c; }