Skip to content

Commit

Permalink
UPBGE: Don't sort object for transparency object in shadow render.
Browse files Browse the repository at this point in the history
Previously the transparent object render for simple shadow was using
a sort. But sorting object for the shadow render is useless because
only alpha clip will have effect on the shadows, and alpha clip is
order independant.

Removing the object sort optimize by two the render time of a transparent
object.
  • Loading branch information
panzergame committed Oct 24, 2016
1 parent 92fc14d commit 6ffd24a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions source/gameengine/Rasterizer/RAS_BucketManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ void RAS_BucketManager::Renderbuckets(const MT_Transform& cameratrans, RAS_IRast
if (GetNumActiveMeshSlots(ALPHA_SHADOW_BUCKET) != 0) {
rasty->SetOverrideShader(RAS_IRasterizer::RAS_OVERRIDE_SHADER_SHADOW_VARIANCE);
}
RenderSortedBuckets(cameratrans, rasty, ALPHA_SHADOW_BUCKET);
RenderBasicBuckets(cameratrans, rasty, ALPHA_SHADOW_BUCKET);

rasty->SetOverrideShader(RAS_IRasterizer::RAS_OVERRIDE_SHADER_NONE);
}
Expand All @@ -277,7 +277,7 @@ void RAS_BucketManager::Renderbuckets(const MT_Transform& cameratrans, RAS_IRast

RenderBasicBuckets(cameratrans, rasty, ALPHA_SHADOW_INSTANCING_BUCKET);
// Render alpha shadow regular materials with ordering.
RenderSortedBuckets(cameratrans, rasty, ALPHA_SHADOW_BUCKET);
RenderBasicBuckets(cameratrans, rasty, ALPHA_SHADOW_BUCKET);
}

break;
Expand Down

0 comments on commit 6ffd24a

Please sign in to comment.