//**************************************************************************/ // Copyright (c) 2012 Autodesk, Inc. // All rights reserved. // // These coded instructions, statements, and computer programs contain // unpublished proprietary information written by Autodesk, Inc., and are // protected by Federal copyright law. They may not be disclosed to third // parties or copied or duplicated in any form, in whole or in part, without // the prior written consent of Autodesk, Inc. //**************************************************************************/ // World-view-projection transformation. float4x4 gWVPXf : WorldViewProjection < string UIWidget = "None"; >; // Vertex shader input structure. struct VS_INPUT { float4 Pos : POSITION; float4 Norm : NORMAL; float4 Tang : TANGENT; float4 Binorm : BINORMAL; }; // Vertex shader output structure. struct VS_TO_PS { float4 HPos : POSITION; float4 Norm : TEXCOORD0; float4 Tang : TEXCOORD1; float4 Binorm : TEXCOORD2; }; // Vertex shader. VS_TO_PS VS(VS_INPUT In) { VS_TO_PS Out; // Transform the position from object space to clip space for output. Out.HPos = mul(gWVPXf, In.Pos); Out.Norm = In.Norm; Out.Tang = In.Tang; Out.Binorm = In.Binorm; return Out; } // Pixel shader. float4 PS0(VS_TO_PS In) : COLOR0 { return In.Norm; } float4 PS1(VS_TO_PS In) : COLOR0 { return In.Tang; } float4 PS2(VS_TO_PS In) : COLOR0 { return In.Binorm; } // Techniques. technique Normal4AsColor { pass P0 { VertexProgram = compile vp40 VS(); FragmentProgram = compile fp40 PS0(); } } technique Tangent4AsColor { pass P0 { VertexProgram = compile vp40 VS(); FragmentProgram = compile fp40 PS1(); } } technique Binormal4AsColor { pass P0 { VertexProgram = compile vp40 VS(); FragmentProgram = compile fp40 PS2(); } }