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
|
Rev | Line | |
---|
[12091] | 1 | #version 120 |
---|
| 2 | |
---|
| 3 | mat2x4 blendTwoWeightsAntipod(vec4 blendWgt, vec4 blendIdx, vec4 dualQuaternions[24]); |
---|
| 4 | vec3 calculateBlendPosition(vec3 position, mat2x4 blendDQ); |
---|
| 5 | |
---|
| 6 | uniform vec4 worldDualQuaternion2x4Array[24]; |
---|
| 7 | uniform mat4 viewProjectionMatrix; |
---|
| 8 | uniform vec4 ambient; |
---|
| 9 | |
---|
| 10 | attribute vec4 vertex; |
---|
| 11 | attribute vec4 blendIndices; |
---|
| 12 | attribute vec4 blendWeights; |
---|
| 13 | |
---|
| 14 | //Shadow caster pass |
---|
| 15 | void 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.