sinisterchipmunk / jax

Framework for creating rich WebGL-enabled applications using JavaScript and Ruby
http://jaxgl.com
MIT License
96 stars 16 forks source link

Cube map targets must be explicitly specified #44

Closed sinisterchipmunk closed 12 years ago

sinisterchipmunk commented 12 years ago

An instance of Jax.Texture which represents a cube map can be auto-detected by virtue of having an array of 6 paths instead of a single path. Jax.Texture tries to do this, but actually fails because the target option defaults to GL_TEXTURE_2D and is never automatically switched to GL_TEXTURE_CUBE_MAP. This has the unfortunate side effect of not working at all, producing instead just a black texture in the fragment shader.

There's no reason Jax.Texture can't be smart enough to set target appropriately. Since it's an abstraction layer, by definition the user should not have to deal with this, so I'm marking it as a bug.