source:
data/branches/Shader_HS18/programs/Example/GLSL150/PosterizeFP.glsl
@
12083
Last change on this file since 12083 was 12083, checked in by wiesep, 5 years ago | |
---|---|
File size: 365 bytes |
Line | |
---|---|
1 | #version 150 |
2 | |
3 | uniform sampler2D RT; |
4 | in vec2 oUv0; |
5 | out vec4 fragColour; |
6 | |
7 | void main() |
8 | { |
9 | float nColors = 8.0; |
10 | float gamma = 0.6; |
11 | |
12 | vec4 texCol = vec4(texture(RT, oUv0)); |
13 | vec3 tc = texCol.xyz; |
14 | tc = pow(tc, vec3(gamma)); |
15 | tc = tc * nColors; |
16 | tc = floor(tc); |
17 | tc = tc / nColors; |
18 | tc = pow(tc, vec3(1.0/gamma)); |
19 | fragColour = vec4(tc, texCol.w); |
20 | } |
Note: See TracBrowser
for help on using the repository browser.