Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: data/branches/Shader_HS18/programs/GLSL150/GrassCasterFp.glsl @ 12115

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

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

File size: 519 bytes
Line 
1#version 150
2
3uniform sampler2D diffuseMap;
4
5in vec4 oUv0;
6in vec2 oDepth;
7
8out vec4 fragColour;
9
10//////////////////////// GRASS SHADOW CASTER
11void main()
12{       
13        float alpha = texture(diffuseMap, oUv0.xy).a;
14        if (alpha > 0.001)
15    {
16       fragColour = vec4(1.0, 1.0, 1.0, 0.0);
17    }
18    else
19    {
20        float finalDepth = oDepth.x / oDepth.y;
21        // just smear across all components
22        // therefore this one needs high individual channel precision
23        fragColour = vec4(vec3(finalDepth), 1.0);
24    }
25}
Note: See TracBrowser for help on using the repository browser.