From 978990c469d5891bd57e2a144b719dfea2747174 Mon Sep 17 00:00:00 2001 From: sandyx Date: Sat, 15 Feb 2025 20:27:45 -0600 Subject: [PATCH] attrib --- index.html | 4 +++- webgl.js | 9 +++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/index.html b/index.html index 1e27da9..221bbd3 100644 --- a/index.html +++ b/index.html @@ -11,8 +11,10 @@ diff --git a/webgl.js b/webgl.js index ab3e59c..180cae6 100644 --- a/webgl.js +++ b/webgl.js @@ -60,6 +60,15 @@ function main() { ]; program = buildShaderProgram(shaderSet); + + var a_Position = gl.getAttribLocation(program, 'a_Position'); + if (a_Position < 0) { + console.log('couldnt get position'); + return; + } + + gl.vertexAttrib3f(a_Position, 0.0, 0.5, 0.0); + gl.useProgram(program); gl.clearColor(0.5, 0.0, 0.0, 1.0);