diff options
| author | quou <quou@disroot.org> | 2024-12-21 21:25:22 +1100 | 
|---|---|---|
| committer | quou <quou@disroot.org> | 2024-12-21 21:25:22 +1100 | 
| commit | 5bc8f90c38981045515bab04d26687f929f62ec1 (patch) | |
| tree | d1d603ded306ae218e75f7eff4b69807f2a14e26 /intermediate | |
| parent | 3283c6c8c32f980bd01591e441acd9c712c650ef (diff) | |
render a triangle
Diffstat (limited to 'intermediate')
| -rw-r--r-- | intermediate/triangle.glsl | 13 | 
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 |