Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: data/branches/Shader_HS18/programs/Example/GLSL120/DualQuaternion_ShadowCaster.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: 721 bytes
RevLine 
[12091]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.