/////////////////////////////////////////////////////////////////////////////// // // ## ###### // ###### ### // ## ############### Shark 3D Engine (www.shark3d.com) // ########## # # # // ######## Copyright (c) 1996-2006 Spinor GmbH. // ######### # # # All rights reserved. // ## ########## // ## // /////////////////////////////////////////////////////////////////////////////// #include \ /////////////////////////////////////////////////////////////////////////////// struct VS_INPUT { float4 posObj: POSITION; S3D_BONE_DECL_STD(boneWgh, boneSubscr) }; struct VS_OUTPUT { float4 posScr: POSITION; float4 lightProjCoord: TEXCOORD0; float4 lightShmapCoord: TEXCOORD1; }; /////////////////////////////////////////////////////////////////////////////// const float4x4 projMat; S3D_MATBONE_DECL_STD(matBone) const float4x4 lightProjMat; const float4x4 lightShmapMat; /////////////////////////////////////////////////////////////////////////////// // Vertexshader // Profile: 1x1 VS_OUTPUT main(VS_INPUT input) { VS_OUTPUT output = (VS_OUTPUT)0; float4x4 matBoneFinal; S3D_BONE_TRANSF_STD( matBoneFinal, matBone, input.boneWgh, input.boneSubscr); // Transform vectors by matBoneFinal float4 posView = mul(input.posObj, matBoneFinal); output.posScr = mul(posView, projMat); output.lightProjCoord = mul(posView, lightProjMat); output.lightShmapCoord = mul(posView, lightShmapMat); return output; } ///////////////////////////////////////////////////////////////////////////////