#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(Input, 0); SAMPLER3D(NoiseMap, 1); SAMPLER2D(HeatLookup, 2); OGRE_UNIFORMS( uniform vec4 heatBiasScale; uniform vec4 depth_modulator; uniform float time; ) MAIN_PARAMETERS IN(vec2 oUv0, TEXCOORD0) MAIN_DECLARATION { float depth, heat, interference; // Output constant color: depth = texture2D(Input, oUv0).x; depth *= (depth * depth_modulator).x; heat = (depth * heatBiasScale.y); // if (depth > 0) { interference = -0.5 + 0.2 * (texture3D(NoiseMap, vec3(oUv0 * vec2_splat(5.0), time))).x; interference *= interference; interference *= 1.0 - heat; heat += interference + heatBiasScale.x; } // Clamp UVs heat = max(0.005, min(0.995, heat)); gl_FragColor = texture2D(HeatLookup, vec2(heat, 0.0)); }