Skip to content

Commit

Permalink
Add Renderable#ignorePreZ. Fix skinned mesh not rendered after preZ
Browse files Browse the repository at this point in the history
  • Loading branch information
pissang committed Sep 12, 2017
1 parent decc9a4 commit c646437
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
4 changes: 4 additions & 0 deletions src/Renderable.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,10 @@ define(function(require) {
* @type {boolean}
*/
ignorePicking: false,
/**
* @type {boolean}
*/
ignorePreZ: false,

/**
* @return {boolean}
Expand Down
7 changes: 4 additions & 3 deletions src/Renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -707,6 +707,7 @@ define(function(require) {
_gl.enable(_gl.DEPTH_TEST);
for (var i = 0; i < queue.length; i++) {
var renderable = queue[i];
// PENDING
if (!this.ifRenderObject(renderable)) {
continue;
}
Expand All @@ -723,7 +724,8 @@ define(function(require) {
continue;
}
}
if (renderable.skeleton) { // FIXME skinned mesh
culledRenderQueue.push(renderable);
if (renderable.skeleton || renderable.ignorePreZ) { // FIXME skinned mesh and custom vertex shader material.
continue;
}

Expand All @@ -747,11 +749,10 @@ define(function(require) {

// PENDING If invoke beforeRender hook
renderable.render(_gl, preZPassMaterial.shader);
culledRenderQueue.push(renderable);
}
_gl.depthFunc(_gl.LEQUAL);
_gl.colorMask(true, true, true, true);
_gl.depthMask(false);
_gl.depthMask(true);

return culledRenderQueue;
},
Expand Down

0 comments on commit c646437

Please sign in to comment.