Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: data/branches/Shader_HS18/programs/GLSL120/DualQuaternion_ShadowCaster.glsl @ 12115

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

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

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