www.pudn.com > Samples-latest.zip > MeshToCubeMap.fx


//-----------------------------------------------------------------------------
// File: MeshToCubeMap.fx
//
// Desc: The effect file for the rendering of a mesh to a cube map.
//-----------------------------------------------------------------------------


//-----------------------------------------------------------------------------
// Global variables
//-----------------------------------------------------------------------------
float4x4	g_mWorld;					// World matrix for object
float4x4	g_mWorldViewProjection;		// World * View * Projection matrix

//-----------------------------------------------------------------------------
// Vertex shader output structure
//-----------------------------------------------------------------------------
struct VS_OUTPUT
{
    float4 Position   : POSITION;   // vertex position 
};


//-----------------------------------------------------------------------------
// Name: RenderSceneVS
// Type: Vertex shader                                      
// Desc: This shader computes standard transform
//-----------------------------------------------------------------------------
VS_OUTPUT RenderSceneVS( float4 vPos : POSITION,
                         float3 vNormal : NORMAL )
{
    VS_OUTPUT Output;
  
    Output.Position = mul( vPos , g_mWorldViewProjection );

    return Output;
}

//-----------------------------------------------------------------------------
// Name: RenderScene
// Type: Technique                                     
// Desc: Renders scene to render target
//-----------------------------------------------------------------------------
technique RenderScene
{
    pass P0
    {   
		Cullmode = CCW;
    
        VertexShader = compile vs_1_1 RenderSceneVS();
        //PixelShader  = compile ps_1_1 RenderScenePS();
        
        TextureFactor = 0x00000000;
        
        ColorArg1[0] = TFactor;
        ColorOp[0] = SELECTARG1;
    }
}