check out the following test:
http://binks.knobbits.org/webgl/texture3.html
It’s a simple test of cube textures. It also has a 2D texture in there for good measure.
I discovered that in some browsers (so far, chrome) The image is not displayed properly if I re-use the same texture unit for drawing the cube texture as for the 2D texture.
There is a checkbox at the bottom marked “Use separate texture units for the cube texture on the sphere and the 2D texture on the floor” that shows this.
Is this a bug in chrome or in my code?
I have ordered a bit the code of the drawing functions and now are working.
Square:
Sphere:
Both of them are using now
TEXTURE0. Please check WebGL states and uniform values.Original code is a bit hard for me, sorry. But I think the problem is that
texture1andcubeTexture0uniforms are been setted with the same value.