Skip to content

Commit

Permalink
fix alpha sort
Browse files Browse the repository at this point in the history
  • Loading branch information
guycalledfrank committed May 31, 2015
1 parent 4cf8796 commit 9699c72
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/scene/scene_forwardrenderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -569,6 +569,7 @@ pc.extend(pc, function () {
for (i = 0; i < drawCallsCount; i++) {
drawCall = drawCalls[i];
visible = true;
meshPos = null;
if (!drawCall.command) {
if (drawCall._hidden) continue; // use _hidden property to quickly hide/show meshInstances
meshInstance = drawCall;
Expand All @@ -592,7 +593,7 @@ pc.extend(pc, function () {
|| btype === pc.BLEND_PREMULTIPLIED
|| btype === pc.BLEND_ADDITIVEALPHA) {
// alpha sort
if (! meshPos) meshPos = meshInstance.aabb.center;
if (!meshPos) meshPos = meshInstance.aabb.center;
var tempx = meshPos.x - camPos.x;
var tempy = meshPos.y - camPos.y;
var tempz = meshPos.z - camPos.z;
Expand Down

0 comments on commit 9699c72

Please sign in to comment.