aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/scenegraph/d3d12/shaders/vertexcolor.hlsl
blob: a0569bb5c100eeb2077a37e4283829e881bb15ac (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
struct VSInput
{
    float4 position : POSITION;
    float4 color : COLOR;
};

cbuffer ConstantBuffer : register(b0)
{
    float4x4 mvp;
    float opacity;
};

struct PSInput
{
    float4 position : SV_POSITION;
    float4 color : COLOR;
};

PSInput VS_VertexColor(VSInput input)
{
    PSInput result;

    result.position = mul(mvp, input.position);
    result.color = input.color * opacity;

    return result;
}

float4 PS_VertexColor(PSInput input) : SV_TARGET
{
    return input.color;
}