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:
651 bytes
|
Rev | Line | |
---|
[12091] | 1 | #version 100 |
---|
| 2 | precision mediump int; |
---|
| 3 | precision mediump float; |
---|
| 4 | |
---|
| 5 | /* Cel shading fragment program for single-pass rendering */ |
---|
| 6 | uniform vec4 diffuse; |
---|
| 7 | uniform vec4 specular; |
---|
| 8 | uniform sampler2D diffuseRamp; |
---|
| 9 | uniform sampler2D specularRamp; |
---|
| 10 | uniform sampler2D edgeRamp; |
---|
| 11 | |
---|
| 12 | varying float diffuseIn; |
---|
| 13 | varying float specularIn; |
---|
| 14 | varying float edge; |
---|
| 15 | |
---|
| 16 | void main() |
---|
| 17 | { |
---|
| 18 | // Step functions from textures |
---|
| 19 | vec4 diffuseStep = texture2D(diffuseRamp, vec2(diffuseIn)); |
---|
| 20 | vec4 specularStep = texture2D(specularRamp, vec2(specularIn)); |
---|
| 21 | vec4 edgeStep = texture2D(edgeRamp, vec2(edge)); |
---|
| 22 | |
---|
| 23 | gl_FragColor = edgeStep.x * ((diffuse * diffuseStep.x) + |
---|
| 24 | (specular * specularStep.x)); |
---|
| 25 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.