Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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