Avoid needless second pass on non-glow particles.
This commit is contained in:
@@ -598,6 +598,7 @@ void LLDrawPoolAlpha::renderAlpha(U32 mask, S32 pass)
|
|||||||
// If this alpha mesh has glow, then draw it a second time to add the destination-alpha (=glow). Interleaving these state-changing calls could be expensive, but glow must be drawn Z-sorted with alpha.
|
// If this alpha mesh has glow, then draw it a second time to add the destination-alpha (=glow). Interleaving these state-changing calls could be expensive, but glow must be drawn Z-sorted with alpha.
|
||||||
if (current_shader &&
|
if (current_shader &&
|
||||||
draw_glow_for_this_partition &&
|
draw_glow_for_this_partition &&
|
||||||
|
params.mHasGlow && //only do this second pass for batches that actually have glow
|
||||||
params.mVertexBuffer->hasDataType(LLVertexBuffer::TYPE_EMISSIVE))
|
params.mVertexBuffer->hasDataType(LLVertexBuffer::TYPE_EMISSIVE))
|
||||||
{
|
{
|
||||||
// install glow-accumulating blend mode
|
// install glow-accumulating blend mode
|
||||||
|
|||||||
@@ -716,7 +716,8 @@ void LLVOPartGroup::getGeometry(S32 idx,
|
|||||||
*colorsp++ = color;
|
*colorsp++ = color;
|
||||||
*colorsp++ = color;
|
*colorsp++ = color;
|
||||||
|
|
||||||
//if (pglow.mV[3] || part.mGlow.mV[3])
|
//Only add emissive attributes if glowing (doing it for all particles is INCREDIBLY inefficient as it leads to a second, slower, render pass.)
|
||||||
|
if (pglow.mV[3] > F_ALMOST_ZERO || part.mGlow.mV[3] > F_ALMOST_ZERO)
|
||||||
{ //only write glow if it is not zero
|
{ //only write glow if it is not zero
|
||||||
*emissivep++ = pglow;
|
*emissivep++ = pglow;
|
||||||
*emissivep++ = pglow;
|
*emissivep++ = pglow;
|
||||||
|
|||||||
Reference in New Issue
Block a user