Last change
on this file since 12091 was
12091,
checked in by wiesep, 6 years ago
|
Updated programs and adjusted Material to work with GLSL>150
|
File size:
382 bytes
|
Rev | Line | |
---|
[12091] | 1 | #version 100 |
---|
| 2 | |
---|
| 3 | precision mediump int; |
---|
| 4 | precision mediump float; |
---|
| 5 | |
---|
| 6 | uniform sampler2D RT; |
---|
| 7 | varying vec2 oUv0; |
---|
| 8 | |
---|
| 9 | void 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.