dx11test

diff shader.hlsl @ 0:647ba0689512

initial commit
author John Tsiombikas <nuclear@member.fsf.org>
date Fri, 21 Jun 2013 07:33:06 +0300
parents
children aa1497adac80
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/shader.hlsl	Fri Jun 21 07:33:06 2013 +0300
     1.3 @@ -0,0 +1,31 @@
     1.4 +cbuffer RenderState : register(b0) {
     1.5 +	matrix modelview_matrix : packoffset(c0);
     1.6 +	matrix projection_matrix : packoffset(c4);
     1.7 +};
     1.8 +
     1.9 +struct VSInput {
    1.10 +	float4 pos : POSITION;
    1.11 +	float4 color : COLOR;
    1.12 +};
    1.13 +
    1.14 +struct VSOutput {
    1.15 +	float4 pos : SV_POSITION;
    1.16 +	float4 color : COLOR0;
    1.17 +};
    1.18 +
    1.19 +VSOutput vertex_main(VSInput input)
    1.20 +{
    1.21 +	VSOutput res;
    1.22 +
    1.23 +	float4 vpos = mul(input.pos, modelview_matrix);
    1.24 +
    1.25 +	res.pos = mul(vpos, projection_matrix);
    1.26 +	res.color = input.color;
    1.27 +	return res;
    1.28 +}
    1.29 +
    1.30 +
    1.31 +float4 pixel_main(VSOutput input) : SV_TARGET
    1.32 +{
    1.33 +	return input.color;
    1.34 +}
    1.35 \ No newline at end of file