Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: data/branches/Shader_HS18/programs/Example/GLSLES/Example_CelShadingFp.glsles @ 12091

Last change on this file since 12091 was 12091, checked in by wiesep, 5 years ago

Updated programs and adjusted Material to work with GLSL>150

File size: 651 bytes
Line 
1#version 100
2precision mediump int;
3precision mediump float;
4
5/* Cel shading fragment program for single-pass rendering */
6uniform vec4 diffuse;
7uniform vec4 specular;
8uniform sampler2D diffuseRamp;
9uniform sampler2D specularRamp;
10uniform sampler2D edgeRamp;
11
12varying float diffuseIn;
13varying float specularIn;
14varying float edge;
15
16void 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.