44 lines
1.1 KiB
Plaintext
44 lines
1.1 KiB
Plaintext
struct Vertex {
|
|
float3 position;
|
|
float3 color;
|
|
};
|
|
|
|
static float4x4 model = {
|
|
{ 1.00000, 0.00000, 0.00000, 0.00000},
|
|
{ 0.00000, 1.00000, 0.00000, 0.00000},
|
|
{ 0.00000, 0.00000, 1.00000, 0.00000},
|
|
{ 0.00000, 0.00000, 0.00000, 1.00000},
|
|
};
|
|
|
|
static float4x4 view = {
|
|
{ 0.80000, 0.00000, -0.60000, -0.00000},
|
|
{ 0.22283, 0.92848, 0.29711, -0.00000},
|
|
{ 0.55709, -0.37139, 0.74278, -5.38516},
|
|
{ 0.00000, 0.00000, 0.00000, 1.00000},
|
|
};
|
|
|
|
static float4x4 proj = {
|
|
{ 1.81066, 0.00000, 0.00000, 0.00000},
|
|
{ 0.00000, 2.41421, 0.00000, 0.00000},
|
|
{ 0.00000, 0.00000, -1.02020, -0.20202},
|
|
{ 0.00000, 0.00000, -1.00000, 0.00000},
|
|
};
|
|
|
|
struct VertexOutput {
|
|
float3 color;
|
|
float4 sv_position : SV_Position;
|
|
};
|
|
|
|
[shader("vertex")]
|
|
VertexOutput vertMain(Vertex vertex) {
|
|
VertexOutput output;
|
|
output.color = vertex.color;
|
|
output.sv_position = mul(proj, mul(view, mul(model, float4(vertex.position, 1.0))));
|
|
return output;
|
|
}
|
|
|
|
[shader("fragment")]
|
|
float4 fragMain(VertexOutput inVert) : SV_Target {
|
|
return float4(inVert.color, 1.0);
|
|
}
|