#ifdef GL_ES precision mediump int; precision highp float; #endif #define USE_OGRE_FROM_FUTURE #include SAMPLER2D(accumTexture, 0); SAMPLER2D(revealageTexture, 1); MAIN_PARAMETERS IN(vec2 oUv0, TEXCOORD0) MAIN_DECLARATION { // Weighted Blended Order-Independent Transparency, Listing 4 vec4 accum = texture2D(accumTexture, oUv0); float ra = accum.a; accum.a = texture2D(revealageTexture, oUv0).r; gl_FragColor = vec4(accum.rgb / vec3_splat(clamp(accum.a, 1e-4, 5e4)), ra); }