Changeset 12091 for data/branches/Shader_HS18/programs/Example/GLSL150/HardwareMorphAnimationWithNormalsVp.glsl
- Timestamp:
- Nov 9, 2018, 1:06:05 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
data/branches/Shader_HS18/programs/Example/GLSL150/HardwareMorphAnimationWithNormalsVp.glsl
r12083 r12091 7 7 in vec4 uv2; // normal2 8 8 9 out vec2 oUv;10 9 out vec4 colour; 10 // out vec2 oUv; 11 11 12 12 uniform mat4 worldViewProj; … … 18 18 void main() 19 19 { 20 21 20 // interpolate position 21 vec4 posinterp = vec4(vertex.xyz + anim_t.x*(uv1.xyz - vertex.xyz), 1.0); 22 22 23 23 // nlerp normal 24 25 24 vec3 ninterp = normal + anim_t.x*(uv2.xyz - normal); 25 ninterp = normalize(ninterp); 26 26 27 28 27 gl_Position = worldViewProj * posinterp; 28 // oUv = uv0.xy; 29 29 30 31 30 vec3 lightDir = normalize( 31 objSpaceLightPos.xyz - (posinterp.xyz * objSpaceLightPos.w)); 32 32 33 34 35 33 // Colour it red to make it easy to identify 34 float lit = clamp(dot(lightDir, ninterp), 0.0, 1.0); 35 colour = vec4((ambient.rgb + vec3(lit,lit,lit)) * vec3(1.0,0.0,0.0), 1.0); 36 36 }
Note: See TracChangeset
for help on using the changeset viewer.