summaryrefslogtreecommitdiff
path: root/intermediate
diff options
context:
space:
mode:
authorquou <quou@disroot.org>2024-12-29 13:40:55 +1100
committerquou <quou@disroot.org>2024-12-29 13:41:56 +1100
commit928eba3845d6017d133048cf04c1f816d87941b0 (patch)
tree50f8c52b6f6eb0adbde2666c50ff10dd3920616a /intermediate
parent7383cfcbe8ade4dce057608e971e8cb7d4b1feb7 (diff)
model hierarchy support
Diffstat (limited to 'intermediate')
-rw-r--r--intermediate/monkey.glbbin69720 -> 80692 bytes
-rw-r--r--intermediate/surface.glsl16
2 files changed, 8 insertions, 8 deletions
diff --git a/intermediate/monkey.glb b/intermediate/monkey.glb
index d7b3665..d199545 100644
--- a/intermediate/monkey.glb
+++ b/intermediate/monkey.glb
Binary files differ
diff --git a/intermediate/surface.glsl b/intermediate/surface.glsl
index 681ec3f..18c13a3 100644
--- a/intermediate/surface.glsl
+++ b/intermediate/surface.glsl
@@ -25,17 +25,17 @@ name: normal
type: vec3
[struct]
-name: Config
+name: MVP
[variable]
-name: transform
+name: model
type: mat4
[variable]
-name: projection
+name: view_projection
type: mat4
[cbuffer]
-name: config_buffer
-type: Config
+name: c_mvp
+type: MVP
stage: vertex
[target]
@@ -48,10 +48,10 @@ type: vec4
void main() {
interpolator.uv = uv;
- interpolator.normal = mat3(config_buffer.transform) * normal;
+ interpolator.normal = mat3(c_mvp.model) * normal;
gl_Position =
- config_buffer.projection *
- config_buffer.transform *
+ c_mvp.view_projection *
+ c_mvp.model *
vec4(position, 1.0);
}