Skip to content

Commit

Permalink
edit gltf.js to accommodate removal of setMaterialParams method
Browse files Browse the repository at this point in the history
  • Loading branch information
peteroupc committed Feb 18, 2017
1 parent 0eab5fa commit 8c96a03
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions extras/gltf.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,12 +167,14 @@
};
/** @private */
GltfState._makeShape = function(mesh) {
return new H3DU.Shape(mesh).setMaterialParams({
var sh = new H3DU.Shape(mesh);
sh.getMaterial().setParams({
"albedo":[0, 0, 0],
"emission":[0.5, 0.5, 0.5],
"metalness":0.0,
"roughness":1.0
});
return sh;
};
/** @private */
GltfState.prototype.preparePrograms = function() {
Expand Down Expand Up @@ -794,7 +796,7 @@
if(typeof shader === "undefined" || shader === null) {
return null;
}
shape.setMaterialParams({"shader":shader});
shape.getMaterial().setParams({"shader":shader});
}
this.materials[prim.material] = shape.getMaterial();
}
Expand Down

0 comments on commit 8c96a03

Please sign in to comment.