//=====================================
// My first Effect file
//=====================================
//Variabeles
float4x4 g_mWorldViewProjection;
texture g_MeshTexture;
//structures
struct VS_OUTPUT
{
float4 Position : POSITION;
float2 TextureCoords: TEXCOORD1;
};
struct PS_OUTPUT
{
float4 Color : COLOR0;
};
//--------------------------------------------------------------------------------------
// Texture samplers
//--------------------------------------------------------------------------------------
sampler MeshTextureSampler =
sampler_state
{
Texture = <g_MeshTexture>;
MipFilter = LINEAR;
MinFilter = LINEAR;
MagFilter = LINEAR;
};
VS_OUTPUT VS_Function( float4 vPos : POSITION,
float2 vTexCoord0 : TEXCOORD0 )
{
VS_OUTPUT Output;
OutPut.Position = Mul( vPos, g_mWorldViewProjection );
OutPut.TextureCoords = vTexCoord0;
return Output;
}
PS_OUTPUT PS_Function(VS_OUTPUT in)
{
PS_OUTPUT Output;
Output.RGBColor = tex2D(MeshTextureSampler, In.TextureCoords);
Return Output;
}
//my first technique
Technique MyTechnique
{
Pass FirstPass
{
VertexShader = compile vs_2_0 VS_function();
PixelShader = compile ps_2_0 PS_function();
}
}
Bookmarks