src/jax/webgl/material.js in jax-0.0.0.5 vs src/jax/webgl/material.js in jax-0.0.0.6
- old
+ new
@@ -81,10 +81,24 @@
this.addLayer(instantiate_layer(options.layers[i]));
}
}
},
+ /**
+ * Jax.Material#supportsLighting() -> Boolean
+ *
+ * Returns true if this material supports lighting effects.
+ **/
+ supportsLighting: function() {
+ if (this.getName() == "lighting")
+ return true;
+ for (var i = 0; i < this.layers.length; i++)
+ if (this.layers[i].getName() == "lighting")
+ return true;
+ return false;
+ },
+
getName: function() { return this.name; },
addTextureLayer: function(tex) {
var mat;
switch(tex.options.type) {
@@ -367,10 +381,12 @@
//= require "../../../builtin/shaders/normal_map/material"
//= require "../../../builtin/shaders/shadow_map/material"
//= require "../../../builtin/shaders/depthmap/material"
//= require "../../../builtin/shaders/paraboloid/material"
//= require "../../../builtin/shaders/fog/material"
+//= require "../../../builtin/shaders/picking/material"
Jax.Material.create("basic");
Jax.Material.create("default", {default_shader:'basic'});
Jax.Material.create("depthmap", {default_shader:"depthmap"});
Jax.Material.create("paraboloid-depthmap", {type:"Paraboloid",default_shader:"paraboloid",layers:[{type:"Depthmap"}]});
+Jax.Material.create("picking", {type:"Picking"});