0

I'm getting Uncaught SyntaxError: Unexpected identifier at attribute vec3 aVertexPosition;

    <script id="shader-vs" type="text/javascript">
       attribute vec3 aVertexPosition;
       uniform mat4 uMVMatrix;
       uniform mat4 uPMatrix;
       void main(void) {
       gl_Position = uPMatrix * uMVMatrix * vec4(aVertexPosition, 1.0);
   }

Anyone knows how to fix it ? I'm pretty noob in webgl and I got more and more confused.

1
  • Please indicate what library / API / thefile.js you are using... Commented Jul 29, 2015 at 3:03

1 Answer 1

1

Change type="text/javascript" to anything else, such as type="x-shader/x-fragment". Otherwise your GLSL will be interpreted as javascript.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.