Currently, I am in the process of learning three.js by following this tutorial: . Despite the tutorial working well, I have encountered errors in my own code which seem like this:
ERROR: 0:26: 'nuniform' : syntax error Three.js:325
precision highp float;
#define MAX_DIR_LIGHTS 0
...
uniform vec3 cameraPosition;
uniform sampler2D tDiffuse;nuniform sampler2D tGlow;nvarying vec2 vUv;nvoid main() {nvec4 texel = texture2D( tDiffuse, vUv );nvec4 glow = texture2D( tGlow, vUv );ngl_FragColor = texel + vec4(0.5, 0.75, 1.0, 1.0) * glow * 2.0;n}
ERROR: 0:62: 'nvoid' : syntax error Three.js:325
precision highp float;
#define VERTEX_TEXTURES
...
varying vec2 vUv;nvoid main() {nvUv = vec2( uv.x, 1.0 - uv.y );ngl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );n}
and so on.
Upon inspection, it seems like the browser (in this case, Google Chrome) is not parsing the strings with shaders correctly. The errors are originating from the minified version of the code in the three.js sources.
Initially, the code appears to be correct.
I must be overlooking something, but I am unsure of exactly what it is.
Any suggestions or assistance would be greatly appreciated?