Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: data/branches/Shader_HS18/programs/Example/GLSLES/PosterizeFP.glsles @ 12092

Last change on this file since 12092 was 12091, checked in by wiesep, 6 years ago

Updated programs and adjusted Material to work with GLSL>150

File size: 382 bytes
Line 
1#version 100
2
3precision mediump int;
4precision mediump float;
5
6uniform sampler2D RT;
7varying vec2 oUv0;
8
9void main()
10{
11        float nColors = 8.0;
12        float gamma = 0.6;
13
14        vec4 texCol = vec4(texture2D(RT, oUv0));
15        vec3 tc = texCol.xyz;
16        tc = pow(tc, vec3(gamma));
17        tc = tc * nColors;
18        tc = floor(tc);
19        tc = tc / nColors;
20        tc = pow(tc, vec3(1.0/gamma));
21        gl_FragColor = vec4(tc, texCol.w);
22}
Note: See TracBrowser for help on using the repository browser.