From 5bc8f90c38981045515bab04d26687f929f62ec1 Mon Sep 17 00:00:00 2001 From: quou Date: Sat, 21 Dec 2024 21:25:22 +1100 Subject: render a triangle --- intermediate/triangle.glsl | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'intermediate/triangle.glsl') 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 -- cgit v1.2.3-54-g00ecf