I am trying to run the following simple shader with three.js
mat = new THREE.ShaderMaterial({
uniforms: {
color: { type: 'v3', value: new THREE.Color(0xcccccc) }
},
vertexShader: 'attribute vec3 vert;\n'
+ 'void main() {\n'
+ ' gl_Position = vec4(vert, 1.0);\n'
+ '}',
fragmentShader: 'uniform vec3 color;\n'
+ 'void main() {\n'
+ ' gl_FragColor = vec4(color,1);\n'
+ '}'
})
The shaders compile but the object that has this material is invisible.
This should display the object in a constant light grey color.
When I run this with kick.js shader editor it works as expected.
Predefined materials all work great.
Am I missing something?