Skip to content

Commit 183e685

Browse files
committed
Fixed dirty flag reset
1 parent bd25dbc commit 183e685

3 files changed

Lines changed: 10 additions & 10 deletions

File tree

src/gameobjects/layer3d/Layer3D.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -524,9 +524,6 @@ var Layer3D = new Class({
524524
model.preUpdate(time, delta);
525525
}
526526
}
527-
528-
camera.dirtyView = false;
529-
camera.dirtyProjection = false;
530527
},
531528

532529
/**
@@ -540,10 +537,13 @@ var Layer3D = new Class({
540537
*/
541538
resetDirtyFlags: function ()
542539
{
543-
this.camera.dirty = false;
540+
this.camera.dirtyView = false;
541+
this.camera.dirtyProjection = false;
542+
544543
this.light.ambient.dirty = false;
545544
this.light.diffuse.dirty = false;
546545
this.light.specular.dirty = false;
546+
547547
this.fogColor.dirty = false;
548548
},
549549

src/geom/mesh/Model.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -387,8 +387,6 @@ var Model = new Class({
387387
// If the model isn't dirty we can bail out and save lots of math
388388
if (this.isDirty())
389389
{
390-
console.log('model.update');
391-
392390
var normalMatrix = this.normalMatrix;
393391
var transformMatrix = this.transformMatrix;
394392

src/renderer/webgl/pipelines/MeshPipeline.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ var MeshPipeline = new Class({
153153
{
154154
var camera = mesh.camera;
155155

156-
if (camera.dirty)
156+
if (camera.dirtyView || camera.dirtyProjection)
157157
{
158158
this.setMatrix4fv('uViewProjectionMatrix', false, camera.viewProjectionMatrix.val);
159159

@@ -268,11 +268,13 @@ var MeshPipeline = new Class({
268268
// All the uniforms are finally bound, so let's buffer our data
269269
var gl = this.gl;
270270

271-
if (model.cullMode !== this.cullMode)
271+
var cullMode = model.cullMode;
272+
273+
if (cullMode !== this.cullMode)
272274
{
273-
this.cullMode = model.cullMode;
275+
this.cullMode = cullMode;
274276

275-
gl.cullFace(model.cullMode);
277+
gl.cullFace(cullMode);
276278
}
277279

278280
// STATIC because the buffer data doesn't change, the uniforms do

0 commit comments

Comments
 (0)