Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: data/branches/Shader_HS18/programs/Example/GLSL/DepthShadowmapReceiverVp.glsl @ 12096

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

Updated programs and adjusted Material to work with GLSL>150

File size: 660 bytes
RevLine 
[12091]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.