35 lines
507 B
Plaintext
35 lines
507 B
Plaintext
|
|
struct Vertex {
|
|
float3 point;
|
|
float3 color;
|
|
};
|
|
|
|
struct VSIn {
|
|
Vertex vertex;
|
|
};
|
|
|
|
struct VSOut
|
|
{
|
|
float4 Pos : SV_POSITION;
|
|
float3 Color : COLOR0;
|
|
};
|
|
|
|
[shader("vertex")]
|
|
VSOut vsmain(VSIn input) {
|
|
VSOut output;
|
|
output.Pos = float4(input.vertex.point, 1.0f);
|
|
output.Color = input.vertex.color;
|
|
|
|
return output;
|
|
}
|
|
|
|
struct FSOut {
|
|
float4 Color;
|
|
};
|
|
|
|
[shader("fragment")]
|
|
FSOut fsmain(VSOut input) {
|
|
FSOut outp;
|
|
outp.Color = float4(input.Color, 1.0);
|
|
return outp;
|
|
} |