Last change
on this file since 12302 was
12115,
checked in by wiesep, 6 years ago
|
Changed folder structure, deletet some unused files and cleaned up code
|
File size:
822 bytes
|
Line | |
---|
1 | #version 150 |
---|
2 | |
---|
3 | /* Cel shading fragment program for single-pass rendering */ |
---|
4 | uniform vec4 diffuse; |
---|
5 | uniform vec4 specular; |
---|
6 | uniform sampler1D diffuseRamp; |
---|
7 | uniform sampler1D specularRamp; |
---|
8 | uniform sampler1D edgeRamp; |
---|
9 | |
---|
10 | in float diffuseIn; |
---|
11 | in float specularIn; |
---|
12 | in float edge; |
---|
13 | |
---|
14 | out vec4 fragColour; |
---|
15 | |
---|
16 | /*uniform lighting |
---|
17 | { |
---|
18 | vec4 diffuse; |
---|
19 | vec4 specular; |
---|
20 | } LightingParams;*/ |
---|
21 | |
---|
22 | void main() |
---|
23 | { |
---|
24 | // Step functions from textures |
---|
25 | float diffuseStep = texture(diffuseRamp, diffuseIn).x; |
---|
26 | float specularStep = texture(specularRamp, specularIn).x; |
---|
27 | float edgeStep = texture(edgeRamp, edge).x; |
---|
28 | |
---|
29 | fragColour = edgeStep * ((diffuse * diffuseStep) + |
---|
30 | (specular * specularStep)); |
---|
31 | // fragColour = edgeStep * ((LightingParams.diffuse * diffuseStep) + |
---|
32 | // (LightingParams.specular * specularStep)); |
---|
33 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.