Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: data/branches/Shader_HS18/programs/Example/GLSL150/DualQuaternion_ShadowCaster.glsl @ 12083

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

Reorganised shader programs

File size: 756 bytes
Line 
1#version 150
2
3mat2x4 blendTwoWeightsAntipod(vec4 blendWgt, vec4 blendIdx, vec4 dualQuaternions[24]);
4vec3 calculateBlendPosition(vec3 position, mat2x4 blendDQ);
5
6uniform vec4 worldDualQuaternion2x4Array[24];
7uniform mat4x4 viewProjectionMatrix;
8uniform vec4 ambient;
9
10in vec4 vertex;
11in vec4 blendIndices;
12in vec4 blendWeights;
13
14out vec4 ambientColour;
15
16//Shadow caster pass
17void main()
18{
19        mat2x4 blendDQ = blendTwoWeightsAntipod(blendWeights, blendIndices, worldDualQuaternion2x4Array);
20
21        float len = length(blendDQ[0]);
22        blendDQ /= len;
23
24        vec3 blendPosition = calculateBlendPosition(vertex.xyz, blendDQ);
25
26        // view / projection
27        gl_Position = viewProjectionMatrix * vec4(blendPosition, 1.0);
28       
29        ambientColour = ambient;
30}
31
Note: See TracBrowser for help on using the repository browser.