Graphics Reference
In-Depth Information
//
struct DS_OUTPUT
{ float4 position : SV_Position;
float3 normal
: NORMAL;
float3 light
: LIGHT;
float2 tex
: TEXCOORDS;
};
//
VS_OUTPUT VSMAIN( in VS_INPUT input )
{
VS_OUTPUT output;
// Calculate the output position of the vertex
output.position = (mul( float4( input.position, l.ef ),
SkinMatrices[input.bone. x] )
* input.weights. x);
output.position += (mul( float4( input.position, l.ef ),
SkinMatrices[input.bone.y] )
* input.weights. y);
output.position += (mul( float4( input.position, l.ef ),
SkinMatrices[input.bone.z] )
* input.weights. z);
output.position += (mul( float4( input.position, l.ef ),
SkinMatricesfinput.bone. w] )
* input.weights. w);
// Calculate the world space normal vector
output.normal = (mul( input.normal, (float3x3)SkinNormalMatrices[input.
bone.x] )
* input.weights.x).xyz;
output.normal += (mul( input.normal, (float3x3)SkinNormalMatrices[input.
bone.y] )
* input.weights. y) .xyz;
output.normal += (mul( input.normal, (float3x3)SkinNormalMatrices[input.
bone.z] )
* input.weights. z) .xyz;
output.normal += (mul( input.normal, (float3x3)SkinNormalMatrices[input,
bone.w] )
* input.weights. w) .xyz;
// Calculate the world space light vector
output.light = LightPositionWS - output.position.xyz;
// Pass the texture coordinates through
output.tex = input.tex;
return output;
}
//
HS_PATCH_OUTPUT HSPATCH( InputPatch<VS_OUTPUT, 3> ip, uint PatchID : SV_PrimitiveID )
{
HS_PATCH_OUTPUT output;
Search WWH ::




Custom Search