#ifdef GL_ES precision mediump int; precision mediump float; #endif #define USE_OGRE_FROM_FUTURE #include SAMPLER2D(RT, 0); MAIN_PARAMETERS IN(vec2 oUv0, TEXCOORD0) MAIN_DECLARATION { float nColors = 8.0; float gamma = 0.6; vec4 texCol = texture2D(RT, oUv0); vec3 tc = texCol.xyz; tc = pow(tc, vec3_splat(gamma)); tc = tc * vec3_splat(nColors); tc = floor(tc); tc = tc / vec3_splat(nColors); tc = pow(tc, vec3_splat(1.0/gamma)); gl_FragColor = vec4(tc, texCol.w); }