summaryrefslogtreecommitdiff
path: root/intermediate/triangle.glsl
diff options
context:
space:
mode:
Diffstat (limited to 'intermediate/triangle.glsl')
-rw-r--r--intermediate/triangle.glsl13
1 files changed, 12 insertions, 1 deletions
diff --git a/intermediate/triangle.glsl b/intermediate/triangle.glsl
index ed6052f..04f66d3 100644
--- a/intermediate/triangle.glsl
+++ b/intermediate/triangle.glsl
@@ -4,9 +4,19 @@ type: graphics
vertex: main
fragment: main
+[binding]
+name: verts
+rate: vertex
[attribute]
name: position
type: vec2
+[attribute]
+name: colour
+type: vec3
+
+[interpolator]
+name: colour
+type: vec3
[target]
name: colour
@@ -16,6 +26,7 @@ type: vec4
#ifdef VERTEX_SHADER
void main() {
+ interpolator.colour = vec3(colour);
gl_Position = vec4(position, 0.0, 1.0);
}
@@ -24,7 +35,7 @@ void main() {
#ifdef FRAGMENT_SHADER
void main() {
- colour = 1.0.xxxx;
+ colour = vec4(interpolator.colour, 1.0);
}
#endif