Hi there,
I am having problems trying to use different programs for different models, the problem is that I cannot see models using program2.
CODE (important fragments):
program: [{
id: 'default',
path: 'shaders/',
vs: 'frag-lighting.vs.glsl',
fs: 'frag-lighting.fs.glsl',
from: 'uris'
},{
id: 'program2',
path: 'shaders/',
from: 'uris',
vs: 'vertex.glsl',
fs: 'fragment.glsl'
}],
...
model1.program = "default"
model2.program = "program2"
...
scene.add(model1)
scene.add(model2)
fragment.glsl
#ifdef GL_ES
precision highp float;
#endif
void main(void) {
gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);
}
vertex.glsl
attribute vec3 aVertexPosition;
uniform mat4 uMVMatrix;
uniform mat4 uPMatrix;
void main(void) {
gl_Position = uPMatrix * uMVMatrix * vec4(aVertexPosition, 1.0);
}
I can see any object with the default program, but none with the program2.
Here is an example of a model:
{
"id" : "Tile",
"vertices" : [0.4395443797111511,-0.4705709218978882,0.09121588617563248,0.3404826521873474,-0.4705709218978882,0.09121588617563248,0.3404826521873474,-0.5696326494216919,0.09121588617563248,0.4395443797111511,-0.5696326494216919,0.09121588617563248,0.4395443797111511,-0.4705709218978882,0.09121588617563248,0.3404826521873474,-0.5696326494216919,0.09121588617563248],
"indices" : [0,1,2,3,4,5],
}
Any suggestions?