Files
2020-02-05 20:51:54 +00:00

44 lines
623 B
HLSL

cbuffer ConstantBuffer : register(b0)
{
matrix View;
matrix World;
}
struct VS_IN
{
float2 pos : POSITION;
float4 col : COLOR;
};
struct PS_IN
{
float4 pos : SV_POSITION;
float4 col : COLOR;
};
PS_IN VS( VS_IN input )
{
PS_IN output = (PS_IN)0;
float4x4 wv = mul(View, World);
output.pos = mul(wv, float4(input.pos, 0.5f, 1.0f));
output.col = input.col;
return output;
}
float4 PS( PS_IN input ) : SV_Target
{
return input.col;
}
technique10 Render
{
pass P0
{
SetGeometryShader( 0 );
SetVertexShader( CompileShader( vs_4_0, VS() ) );
SetPixelShader( CompileShader( ps_4_0, PS() ) );
}
}