sinisterchipmunk / jax

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

Using a missing texture/normal map should raise an error #32

Closed sinisterchipmunk closed 12 years ago

sinisterchipmunk commented 12 years ago

Materials that use a normal map or texture shader, but whose paths point to missing or otherwise un-loadable files, should raise an error when rendering.

Currently, no error is raised, and this simply produces a black or un-rendered mesh. (The texture is null, which means when it is bound to the texture slot that no texture is bound at all, and the RGBA color in the shader is 0,0,0,0, which gets multiplied against lighting and basic shaders to produce no model.) This is a very confusing situation, especially for beginners.

sinisterchipmunk commented 12 years ago

Textures now throw errors when their paths can't be found. This isn't an issue of the texture and normal map materials, but rather belongs to Jax.Texture itself. Now, such errors should appear in the console like any other.