#ifdef GL_ES precision mediump int; precision highp float; #endif #define USE_OGRE_FROM_FUTURE #include SAMPLER2D(alphaTexture, 0); OGRE_UNIFORMS( uniform vec4 materialColor; uniform vec4 slicePlane; ) MAIN_PARAMETERS IN(vec4 oUv0, TEXCOORD0) IN(vec4 oWp, TEXCOORD1) MAIN_DECLARATION { if(((slicePlane.x + slicePlane.y + slicePlane.z) != 0.0) && (slicePlane.x * oWp.x + slicePlane.y * oWp.y + slicePlane.z * oWp.z + slicePlane.w > 0.0)) discard; float alpha = texture2D(alphaTexture, oUv0.xy).a * materialColor.a; float finalDepth = oUv0.z / oUv0.w; gl_FragColor = vec4(finalDepth, alpha, finalDepth, finalDepth); }