src/video/windowsrt/SimpleVertexShader.hlsl
author David Ludwig <dludwig@pobox.com>
Sun, 28 Oct 2012 20:47:33 -0400
changeset 8332 ea83d191cc17
parent 8322 839cd578a474
child 8346 a15d524f1d2e
permissions -rw-r--r--
WinRT: added mouse button event support
dludwig@8322
     1
cbuffer ModelViewProjectionConstantBuffer : register(b0)
dludwig@8322
     2
{
dludwig@8322
     3
	matrix model;
dludwig@8322
     4
	matrix view;
dludwig@8322
     5
	matrix projection;
dludwig@8322
     6
};
dludwig@8322
     7
dludwig@8322
     8
struct VertexShaderInput
dludwig@8322
     9
{
dludwig@8322
    10
	float3 pos : POSITION;
dludwig@8322
    11
	float3 color : COLOR0;
dludwig@8322
    12
};
dludwig@8322
    13
dludwig@8322
    14
struct VertexShaderOutput
dludwig@8322
    15
{
dludwig@8322
    16
	float4 pos : SV_POSITION;
dludwig@8322
    17
	float3 color : COLOR0;
dludwig@8322
    18
};
dludwig@8322
    19
dludwig@8322
    20
VertexShaderOutput main(VertexShaderInput input)
dludwig@8322
    21
{
dludwig@8322
    22
	VertexShaderOutput output;
dludwig@8322
    23
	float4 pos = float4(input.pos, 1.0f);
dludwig@8322
    24
dludwig@8322
    25
	// Transform the vertex position into projected space.
dludwig@8322
    26
	pos = mul(pos, model);
dludwig@8322
    27
	pos = mul(pos, view);
dludwig@8322
    28
	pos = mul(pos, projection);
dludwig@8322
    29
	output.pos = pos;
dludwig@8322
    30
dludwig@8322
    31
	// Pass through the color without modification.
dludwig@8322
    32
	output.color = input.color;
dludwig@8322
    33
dludwig@8322
    34
	return output;
dludwig@8322
    35
}