Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: data/branches/Shader_HS18/programs/GLSL150/Example_CelShadingFp.glsl @ 12232

Last change on this file since 12232 was 12115, checked in by wiesep, 6 years ago

Changed folder structure, deletet some unused files and cleaned up code

File size: 822 bytes
RevLine 
[12115]1#version 150
2
3/* Cel shading fragment program for single-pass rendering */
4uniform vec4 diffuse;
5uniform vec4 specular;
6uniform sampler1D diffuseRamp;
7uniform sampler1D specularRamp;
8uniform sampler1D edgeRamp;
9
10in float diffuseIn;
11in float specularIn;
12in float edge;
13
14out vec4 fragColour;
15
16/*uniform lighting
17{
18        vec4 diffuse;
19        vec4 specular;
20} LightingParams;*/
21
22void 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.