Skip to content

Commit

Permalink
Merge pull request #380 from guycalledfrank/instfix
Browse files Browse the repository at this point in the history
Fix instancing when dynamically changing instance count
  • Loading branch information
guycalledfrank committed Aug 19, 2015
2 parents ee29f40 + a6a6388 commit 9cb66ae
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/scene/scene_forwardrenderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -951,13 +951,13 @@ pc.extend(pc, function () {
}

if (material !== prevMaterial) {

if (!meshInstance._shader) {
if (!meshInstance._shader || meshInstance._shaderDefs !== objDefs) {
meshInstance._shader = material.variants[objDefs];
if (!meshInstance._shader) {
material.updateShader(device, scene, objDefs);
meshInstance._shader = material.variants[objDefs] = material.shader;
}
meshInstance._shaderDefs = objDefs;
}
device.setShader(meshInstance._shader);

Expand Down

0 comments on commit 9cb66ae

Please sign in to comment.