Changeset 12096 for data/branches/Shader_HS18/programs/OLD
- Timestamp:
- Nov 11, 2018, 5:37:35 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
data/branches/Shader_HS18/programs/OLD/skinningTwoWeightsVp.glsl
r12083 r12096 16 16 vec3 blendPos = vec3(0,0,0); 17 17 vec3 blendNorm = vec3(0,0,0); 18 18 19 19 for (int bone = 0; bone < 2; ++bone) 20 20 { … … 30 30 worldMatrix[2] = worldMatrix3x4Array[idx + 2]; 31 31 worldMatrix[3] = vec4(0); 32 // now weight this into final 32 // now weight this into final 33 33 float weight = blendWeights[bone]; 34 34 blendPos += (gl_Vertex * worldMatrix).xyz * weight; 35 35 36 36 mat3 worldRotMatrix = mat3(worldMatrix[0].xyz, worldMatrix[1].xyz, worldMatrix[2].xyz); 37 37 blendNorm += (gl_Normal * worldRotMatrix) * weight; … … 47 47 vec3 lightDir1 = normalize( 48 48 lightPos[1].xyz - (blendPos.xyz * lightPos[1].w)); 49 49 50 50 gl_FrontSecondaryColor = vec4(0); 51 gl_FrontColor = vec4(0.5, 0.5, 0.5, 1.0) 51 gl_FrontColor = vec4(0.5, 0.5, 0.5, 1.0) 52 52 + clamp(dot(lightDir0, blendNorm), 0.0, 1.0) * lightDiffuseColour[0] 53 53 + clamp(dot(lightDir1, blendNorm), 0.0, 1.0) * lightDiffuseColour[1]; 54 54 55 55 gl_TexCoord[0] = gl_MultiTexCoord0; 56 56 57 57 }
Note: See TracChangeset
for help on using the changeset viewer.