diff options
Diffstat (limited to 'indra/newview')
| -rw-r--r-- | indra/newview/app_settings/settings.xml | 22 | ||||
| -rw-r--r-- | indra/newview/lldrawpoolalpha.cpp | 34 | 
2 files changed, 40 insertions, 16 deletions
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 088bc3dfac..c0dcafdd51 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -8558,6 +8558,28 @@      </array>    </map> +    <key>RenderAlphaBatchFullbrights</key> +    <map> +      <key>Comment</key> +      <string>Render fullbright alpha content more efficiently, but with possible visual differences from prev viewers.</string> +      <key>Persist</key> +      <integer>1</integer> +      <key>Type</key> +      <string>Boolean</string> +      <key>Value</key> +      <integer>0</integer> +    </map> +    <key>RenderAlphaBatchEmissives</key> +    <map> +      <key>Comment</key> +      <string>Render emissive alpha content more efficiently, but with possible visual differences from prev viewers.</string> +      <key>Persist</key> +      <integer>1</integer> +      <key>Type</key> +      <string>Boolean</string> +      <key>Value</key> +      <integer>0</integer> +    </map>      <key>RenderAnisotropic</key>      <map>        <key>Comment</key> diff --git a/indra/newview/lldrawpoolalpha.cpp b/indra/newview/lldrawpoolalpha.cpp index 9f65a70a86..2efa208017 100644 --- a/indra/newview/lldrawpoolalpha.cpp +++ b/indra/newview/lldrawpoolalpha.cpp @@ -49,10 +49,6 @@  #include "llspatialpartition.h"  #include "llglcommonfunc.h" -// These optimizations can and will induce lighting, texturing, and/or GL state bugs -#define BATCH_FULLBRIGHTS 0 -#define BATCH_EMISSIVES   0 -  BOOL LLDrawPoolAlpha::sShowDebugAlpha = FALSE;  static BOOL deferred_render = FALSE; @@ -612,6 +608,8 @@ void LLDrawPoolAlpha::renderEmissives(U32 mask, std::vector<LLDrawInfo*>& emissi  void LLDrawPoolAlpha::renderAlpha(U32 mask, S32 pass)  { +    BOOL batch_fullbrights = gSavedSettings.getBOOL("RenderAlphaBatchFullbrights"); +    BOOL batch_emissives   = gSavedSettings.getBOOL("RenderAlphaBatchEmissives");  	BOOL initialized_lighting = FALSE;  	BOOL light_enabled = TRUE; @@ -671,13 +669,11 @@ void LLDrawPoolAlpha::renderAlpha(U32 mask, S32 pass)  					}  				} -            #if BATCH_FULLBRIGHTS -                if (params.mFullbright) +                if (params.mFullbright && batch_fullbrights)  				{                      fullbrights.push_back(¶ms);                      continue;  				} -            #endif  				LLRenderPass::applyModelMatrix(params); @@ -812,11 +808,15 @@ void LLDrawPoolAlpha::renderAlpha(U32 mask, S32 pass)  					params.mVertexBuffer->hasDataType(LLVertexBuffer::TYPE_EMISSIVE))  				{                      LL_RECORD_BLOCK_TIME(FTM_RENDER_ALPHA_EMISSIVE); -                #if BATCH_EMISSIVES -                    emissives.push_back(¶ms); -                #else -                    drawEmissiveInline(mask, ¶ms); -                #endif + +                    if (batch_emissives) +                    { +                        emissives.push_back(¶ms); +                    } +                    else +                    { +                        drawEmissiveInline(mask, ¶ms); +                    }   				}  				if (tex_setup) @@ -828,15 +828,17 @@ void LLDrawPoolAlpha::renderAlpha(U32 mask, S32 pass)  				}  			} -            #if BATCH_FULLBRIGHTS +            if (batch_fullbrights) +            {                  light_enabled = false;                  renderFullbrights(mask, fullbrights); -            #endif +            } -            #if BATCH_EMISSIVES +            if (batch_emissives) +            {                  light_enabled = true;                  renderEmissives(mask, emissives); -            #endif +            }              if (current_shader)              {  | 
