Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: data/branches/Shader_HS18/programs/Example/GLSLES/GrassFp.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: 559 bytes
Line 
1#version 100
2
3precision mediump int;
4precision mediump float;
5
6////////////////////////////// MOVING GRASS
7// Vertex program to wave some grass about
8// Assumes UV texture coords of v==0 indicates the top of the grass
9uniform sampler2D diffuseMap;
10
11varying vec4 oUv0;
12varying vec4 oColour;
13
14void main()
15{       
16    vec4 texColor = texture2D(diffuseMap, oUv0.xy);
17
18    // Do manual alpha rejection because it is not built into OpenGL ES 2
19    if (texColor.a < 0.588)
20    {
21        discard;
22    }
23
24    gl_FragColor = vec4(texColor.rgb * oColour.rgb, texColor.a);
25}
Note: See TracBrowser for help on using the repository browser.