Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: data/branches/Shader_HS18/programs/GLSL150/GrassAmbientVp.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: 847 bytes
RevLine 
[12115]1#version 150
2
3
4uniform mat4 worldViewProj;
5uniform vec4 ambient;
6uniform vec4 offset;
7
8in vec4 position;
9in vec4 normal;
10in vec4 uv0;
11
12out vec4 oUv0;
13out vec4 oColour;
14
15/// grass_vp ambient
16void main()
17{       
18     // Position
19        vec4 mypos = position;
20        vec4 factor = vec4(1.0, 1.0, 1.0, 1.0) - uv0.yyyy;
21        mypos = mypos + offset * factor;
22        gl_Position = worldViewProj * mypos;
23    // Texture Coord
24        oUv0.xy = uv0.xy;     
25    /*
26    // Normal
27    // Make vec from vertex to camera
28    vec4 EyeVec = camObjPos - mypos;
29    // Dot the v to eye and the normal to see if they point
30    //  in the same direction or opposite
31    float aligned = dot(normal, EyeVec); // -1..1
32    // If aligned is negative, we need to flip the normal
33    if (aligned < 0) 
34        normal = -normal; 
35    //oNormal = normal;
36    */
37    // Color   
38        oColour = ambient; 
39}
Note: See TracBrowser for help on using the repository browser.