summaryrefslogtreecommitdiffstats
path: root/Projects/Asteroids/src/skybox_vs.hlsl
blob: acefcd5dd589fa7ea5e9924518b729c1b8c8da61 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
cbuffer SkyboxConstantBuffer// : register(b0)
{
    float4x4 mViewProjection;
};

struct Skybox_VSOut
{
	float3 coords   : UVFACE;
};

void skybox_vs(	in float3 in_position : ATTRIB0,
            	in float3 uvFace   : ATTRIB1,
                out float4 position : SV_Position,
                out Skybox_VSOut vsoutput)
{
    // NOTE: Don't translate skybox and make sure depth == 1 (no clipping)
    position = mul(mViewProjection, float4(in_position, 0.0f)).xyww;
    position.z = 0.0f; // 1-z
    vsoutput.coords = in_position.xyz;
}