Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: data/data_extern/programs/GLSL/DepthShadowmapReceiverVp.glsl @ 12302

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

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

File size: 660 bytes
Line 
1#version 120
2
3uniform mat4 world;
4uniform mat4 worldIT;
5uniform mat4 worldViewProj;
6uniform mat4 texViewProj;
7uniform vec4 lightPosition;
8uniform vec4 lightColour;
9
10attribute vec4 vertex;
11attribute vec3 normal;
12
13varying vec4 oUv;
14varying vec4 outColor;
15
16void main()
17{
18        gl_Position = worldViewProj * vertex;
19       
20        vec4 worldPos = world * vertex;
21
22        vec3 worldNorm = (worldIT * vec4(normal, 1.0)).xyz;
23
24        // calculate lighting (simple vertex lighting)
25        vec3 lightDir = normalize(
26                lightPosition.xyz - (worldPos.xyz * lightPosition.w));
27
28        outColor = lightColour * max(dot(lightDir, worldNorm), 0.0);
29
30        // calculate shadow map coords
31        oUv = texViewProj * worldPos;
32}
33
Note: See TracBrowser for help on using the repository browser.