提交 c1d87e3d 编写于 作者: R Rich Tibbett 提交者: Mr.doob

Add default material technique support to glTFLoader.js (#9726)

上级 eaf04aab
......@@ -987,13 +987,36 @@ THREE.glTFLoader.prototype.load = function( url, callback ) {
values[prop] = khr_material.values[prop];
}
}
else if (material.technique === undefined) {
materialType = THREE.MeshPhongMaterial;
if (material.doubleSided)
{
params.side = THREE.DoubleSide;
}
if (material.transparent)
{
params.transparent = true;
}
values = {};
for (var prop in material.values) {
values[prop] = material.values[prop];
}
}
else {
var technique = material.technique ?
this.resources.getEntry(material.technique) :
null;
values = material.values;
var technique = this.resources.getEntry(material.technique);
values = {};
for (var prop in material.values) {
values[prop] = material.values[prop];
}
var description = technique.description;
if (++description.refCount > 1) {
......@@ -1008,6 +1031,7 @@ THREE.glTFLoader.prototype.load = function( url, callback ) {
if (loadshaders) {
materialType = Material;
}
}
if (values.diffuse && typeof(values.diffuse) == 'string') {
......@@ -1876,16 +1900,16 @@ THREE.glTFLoader.prototype.load = function( url, callback ) {
var self = this;
var loader = Object.create(ThreeGLTFLoader);
loader.initWithPath(url);
loader.load(new Context(rootObj,
this.callback = callback;
this.rootObj = rootObj;
this.loader = Object.create(ThreeGLTFLoader);
this.loader.initWithPath(url);
this.loader.load(new Context(rootObj,
function(obj) {
}),
null);
this.loader = loader;
this.callback = callback;
this.rootObj = rootObj;
return rootObj;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册