aboutsummaryrefslogtreecommitdiff
path: root/src/shaders/shader.slang
diff options
context:
space:
mode:
Diffstat (limited to 'src/shaders/shader.slang')
-rw-r--r--src/shaders/shader.slang9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/shaders/shader.slang b/src/shaders/shader.slang
index 37041c6..24d9946 100644
--- a/src/shaders/shader.slang
+++ b/src/shaders/shader.slang
@@ -3,6 +3,12 @@ struct VertexInput {
float3 col;
};
+struct UniformBuffer {
+ float4x4 model, view, proj;
+};
+
+ConstantBuffer<UniformBuffer> ubo;
+
struct VertexOutput {
float4 pos : SV_Position;
float3 col;
@@ -11,7 +17,8 @@ struct VertexOutput {
[shader("vertex")]
VertexOutput vert_main(VertexInput vi) {
VertexOutput vo;
- vo.pos = float4(vi.pos, 0., 1.);
+ // vo.pos = float4(vi.pos, 0., 1.);
+ vo.pos = mul(ubo.proj, mul(ubo.view, mul(ubo.model, float4(vi.pos, 0., 1.))));
vo.col = vi.col;
return vo;
}