Changeset 2404 for GTP/trunk/App/Demos/Illum/Ogre/Media/MORIA/trollvs.cg
- Timestamp:
- 06/05/07 01:57:13 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Illum/Ogre/Media/MORIA/trollvs.cg
r2386 r2404 5 5 float2 uv : TEXCOORD0, 6 6 float3 tangent : TANGENT, 7 float blendIdx : BLENDINDICES, 7 float4 blendIdx : BLENDINDICES, 8 float4 blendWgt : BLENDWEIGHT, 8 9 out float4 oPosition : POSITION, 9 10 out float2 oUv : TEXCOORD0, 10 out float3 oTangent: TEXCOORD1,11 out float3 oBinormal: TEXCOORD2,11 //out float3 oTangent: TEXCOORD1, 12 //out float3 oBinormal: TEXCOORD2, 12 13 out float3 oNormal : TEXCOORD3, 13 14 out float3 V: TEXCOORD4, 14 15 out float3 L: TEXCOORD5, 15 uniform float3x4 worldMatrix3x4Array[6 7],16 uniform float3x4 worldMatrix3x4Array[69], 16 17 uniform float4x4 viewProjectionMatrix, 17 18 uniform float4 lightPos, … … 19 20 { 20 21 // transform by indexed matrix 21 float4 blendPos = float4(mul(worldMatrix3x4Array[blendIdx], position).xyz, 1.0); 22 float4 blendPos = float4(0,0,0,1); 23 blendPos.xyz += mul(worldMatrix3x4Array[blendIdx[0]], position).xyz * blendWgt[0]; 24 blendPos.xyz += mul(worldMatrix3x4Array[blendIdx[1]], position).xyz * blendWgt[1]; 25 22 26 // view / projection 23 27 oPosition = mul(viewProjectionMatrix, blendPos); 24 28 // transform normal 25 oNormal = mul((float3x3)worldMatrix3x4Array[blendIdx], normal);26 oTangent = mul((float3x3)worldMatrix3x4Array[blendIdx], tangent);29 //oNormal = mul((float3x3)worldMatrix3x4Array[blendIdx], normal); 30 //oTangent = mul((float3x3)worldMatrix3x4Array[blendIdx], tangent); 27 31 oNormal = normalize(oNormal); 28 oTangent = normalize(oTangent);29 oBinormal = cross(oTangent, oNormal);32 // oTangent = normalize(oTangent); 33 // oBinormal = cross(oTangent, oNormal); 30 34 // Lighting - support point and directional 31 35 L = lightPos.xyz - blendPos.xyz * lightPos.w; … … 38 42 void trollSkinning_SMGen_One_Weight_vp( 39 43 float4 position : POSITION, 40 float blendIdx : BLENDINDICES, 44 float4 blendIdx : BLENDINDICES, 45 float4 blendWgt : BLENDWEIGHT, 41 46 out float4 oPosition : POSITION, 42 47 out float3 cPos:TEXCOORD0, … … 48 53 { 49 54 // transform by indexed matrix 50 float4 blendPos = float4(mul(worldMatrix3x4Array[blendIdx], position).xyz, 1.0); 55 float4 blendPos = float4(0,0,0,1); 56 blendPos.xyz += mul(worldMatrix3x4Array[blendIdx[0]], position).xyz * blendWgt[0]; 57 blendPos.xyz += mul(worldMatrix3x4Array[blendIdx[1]], position).xyz * blendWgt[1]; 58 51 59 // view / projection 52 60 cPos = mul(viewMatrix, blendPos).xyz;
Note: See TracChangeset
for help on using the changeset viewer.