summaryrefslogtreecommitdiff
path: root/intermediate
diff options
context:
space:
mode:
Diffstat (limited to 'intermediate')
-rw-r--r--intermediate/surface.glsl22
-rw-r--r--intermediate/surface_depthonly.glsl18
2 files changed, 28 insertions, 12 deletions
diff --git a/intermediate/surface.glsl b/intermediate/surface.glsl
index 17ddd06..9fc1c48 100644
--- a/intermediate/surface.glsl
+++ b/intermediate/surface.glsl
@@ -31,10 +31,13 @@ name: tbn
type: mat3
[struct]
-name: MVP
+name: Model
[variable]
name: model
type: mat4
+
+[struct]
+name: VP
[variable]
name: view_projection
type: mat4
@@ -73,8 +76,13 @@ name: colour
type: vec3
[cbuffer]
-name: c_mvp
-type: MVP
+name: c_vp
+type: VP
+stage: vertex
+
+[cbuffer]
+name: c_model
+type: Model
stage: vertex
[cbuffer]
@@ -121,15 +129,15 @@ type: vec4
#ifdef VERTEX_SHADER
void main() {
- vec4 pos = c_mvp.model * vec4(position, 1.0);
- vec3 t = normalize((c_mvp.model * vec4(tangent, 0.0)).xyz);
- vec3 n = normalize((c_mvp.model * vec4(normal, 0.0)).xyz);
+ vec4 pos = c_model.model * vec4(position, 1.0);
+ vec3 t = normalize((c_model.model * vec4(tangent, 0.0)).xyz);
+ vec3 n = normalize((c_model.model * vec4(normal, 0.0)).xyz);
vec3 b = cross(t, n);
interpolator.tbn = mat3(t, b, n);
interpolator.uv = uv;
interpolator.position = pos;
interpolator.tbn = mat3(t, b, n);
- gl_Position = c_mvp.view_projection * pos;
+ gl_Position = c_vp.view_projection * pos;
}
#endif
diff --git a/intermediate/surface_depthonly.glsl b/intermediate/surface_depthonly.glsl
index f53a937..2db5e96 100644
--- a/intermediate/surface_depthonly.glsl
+++ b/intermediate/surface_depthonly.glsl
@@ -12,17 +12,25 @@ name: position
type: vec3
[struct]
-name: MVP
+name: Model
[variable]
name: model
type: mat4
+
+[struct]
+name: VP
[variable]
name: view_projection
type: mat4
[cbuffer]
-name: c_mvp
-type: MVP
+name: c_vp
+type: VP
+stage: vertex
+
+[cbuffer]
+name: c_model
+type: Model
stage: vertex
#endif
@@ -30,8 +38,8 @@ stage: vertex
#ifdef VERTEX_SHADER
void main() {
- vec4 pos = c_mvp.model * vec4(position, 1.0);
- gl_Position = c_mvp.view_projection * pos;
+ vec4 pos = c_model.model * vec4(position, 1.0);
+ gl_Position = c_vp.view_projection * pos;
}
#endif