77 lines
1.6 KiB
HLSL
77 lines
1.6 KiB
HLSL
matrix WorldMatrix : WorldMatrix;
|
|
matrix ViewMatrix : ViewMatrix;
|
|
matrix ProjectionMatrix : ProjectionMatrix;
|
|
|
|
Texture2D Diffuse : Diffuse;
|
|
SamplerState samLinear
|
|
{
|
|
Filter = ANISOTROPIC;
|
|
AddressU = Wrap;
|
|
AddressV = Wrap;
|
|
};
|
|
|
|
DepthStencilState RenderWithStencilState
|
|
{
|
|
StencilEnable = false;
|
|
DepthEnable = TRUE;
|
|
DepthWriteMask = ALL;
|
|
DepthFunc = Equal;
|
|
};
|
|
|
|
RasterizerState EnableCulling
|
|
{
|
|
CullMode = Back;
|
|
};
|
|
|
|
BlendState AlphaBlending
|
|
{
|
|
AlphaToCoverageEnable = FALSE;
|
|
BlendEnable[0] = TRUE;
|
|
SrcBlend = SRC_ALPHA;
|
|
DestBlend = INV_SRC_ALPHA;
|
|
BlendOp = ADD;
|
|
SrcBlendAlpha = SRC_ALPHA;
|
|
DestBlendAlpha = INV_SRC_ALPHA;
|
|
BlendOpAlpha = ADD;
|
|
};
|
|
|
|
|
|
struct VS_OUTPUT
|
|
{
|
|
float4 Pos : SV_POSITION;
|
|
float2 Tex : TEXCOORD0;
|
|
};
|
|
|
|
|
|
VS_OUTPUT VS(float4 Pos : POSITION, float2 Tex : TEXCOORD)
|
|
{
|
|
VS_OUTPUT output = (VS_OUTPUT)0;
|
|
output.Pos = mul( Pos, WorldMatrix );
|
|
output.Pos = mul( output.Pos, ViewMatrix );
|
|
output.Pos = mul( output.Pos, ProjectionMatrix );
|
|
output.Tex = Tex;
|
|
return output;
|
|
}
|
|
|
|
|
|
float4 PS( VS_OUTPUT input) : SV_Target
|
|
{
|
|
return float4(0.0, 1.0, 1.0, 0.25);
|
|
}
|
|
|
|
//--------------------------------------------------------------------------------------
|
|
technique10 Render
|
|
{
|
|
pass P0
|
|
{
|
|
SetVertexShader( CompileShader( vs_4_0, VS() ) );
|
|
SetGeometryShader( NULL );
|
|
SetPixelShader( CompileShader( ps_4_0, PS() ) );
|
|
|
|
SetDepthStencilState( RenderWithStencilState, 0 );
|
|
SetBlendState( AlphaBlending, float4( 0.0f, 0.0f, 0.0f, 0.0f ), 0xFFFFFFFF );
|
|
SetRasterizerState( EnableCulling );
|
|
}
|
|
}
|
|
|