Home | History | Annotate | Download | only in Post
      1 #import "Common/ShaderLib/MultiSample.glsllib"
      2  
      3 uniform COLORTEXTURE m_Texture;
      4 in vec2 texCoord;
      5  
      6 uniform int m_NumColors;
      7 uniform float m_Gamma;
      8 uniform float m_Strength;
      9  
     10 void main() {
     11     vec4 texVal = getColor(m_Texture, texCoord);
     12  
     13     texVal = pow(texVal, vec4(m_Gamma));
     14     texVal = texVal * m_NumColors;
     15     texVal = floor(texVal);
     16     texVal = texVal / m_NumColors;
     17     texVal = pow(texVal, vec4(1.0/m_Gamma));
     18  
     19     gl_FragColor = mix(getColor(m_Texture, texCoord), texVal, m_Strength);
     20 }