Cleanup and render-to-texture tweaks.

Added two new debug render modes
Fixed bizarre issue with line-widths being sporadically inconsistent in ui. (needs glFlush for some reason)
This commit is contained in:
Shyotl
2011-04-12 16:40:23 -05:00
parent 15a8a86b15
commit c6fa0be39b
5 changed files with 203 additions and 88 deletions

View File

@@ -2883,6 +2883,16 @@ public:
renderBoundingBox(drawable); renderBoundingBox(drawable);
} }
if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_BUILD_QUEUE))
{
if (drawable->isState(LLDrawable::IN_REBUILD_Q2))
{
gGL.color4f(0.6f, 0.6f, 0.1f, 1.f);
const LLVector3* ext = drawable->getSpatialExtents();
drawBoxOutline((ext[0]+ext[1])*0.5f, (ext[1]-ext[0])*0.5f);
}
}
if (drawable->getVOVolume() && gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_TEXTURE_PRIORITY)) if (drawable->getVOVolume() && gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_TEXTURE_PRIORITY))
{ {
renderTexturePriority(drawable); renderTexturePriority(drawable);
@@ -2902,6 +2912,10 @@ public:
{ {
renderRaycast(drawable); renderRaycast(drawable);
} }
if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_UPDATE_TYPE))
{
renderUpdateType(drawable);
}
LLVOAvatar* avatar = dynamic_cast<LLVOAvatar*>(drawable->getVObj().get()); LLVOAvatar* avatar = dynamic_cast<LLVOAvatar*>(drawable->getVObj().get());
@@ -3060,13 +3074,15 @@ void LLSpatialPartition::renderDebug()
LLPipeline::RENDER_DEBUG_OCCLUSION | LLPipeline::RENDER_DEBUG_OCCLUSION |
LLPipeline::RENDER_DEBUG_LIGHTS | LLPipeline::RENDER_DEBUG_LIGHTS |
LLPipeline::RENDER_DEBUG_BATCH_SIZE | LLPipeline::RENDER_DEBUG_BATCH_SIZE |
LLPipeline::RENDER_DEBUG_UPDATE_TYPE |
LLPipeline::RENDER_DEBUG_BBOXES | LLPipeline::RENDER_DEBUG_BBOXES |
LLPipeline::RENDER_DEBUG_POINTS | LLPipeline::RENDER_DEBUG_POINTS |
LLPipeline::RENDER_DEBUG_TEXTURE_PRIORITY | LLPipeline::RENDER_DEBUG_TEXTURE_PRIORITY |
LLPipeline::RENDER_DEBUG_TEXTURE_ANIM | LLPipeline::RENDER_DEBUG_TEXTURE_ANIM |
LLPipeline::RENDER_DEBUG_RAYCAST | LLPipeline::RENDER_DEBUG_RAYCAST |
LLPipeline::RENDER_DEBUG_AVATAR_VOLUME | LLPipeline::RENDER_DEBUG_AVATAR_VOLUME |
LLPipeline::RENDER_DEBUG_AGENT_TARGET)) LLPipeline::RENDER_DEBUG_AGENT_TARGET |
LLPipeline::RENDER_DEBUG_BUILD_QUEUE))
{ {
return; return;
} }

View File

@@ -119,7 +119,6 @@ void render_hud_attachments();
void render_ui_3d(); void render_ui_3d();
void render_ui_2d(); void render_ui_2d();
void render_disconnected_background(); void render_disconnected_background();
void render_hud_elements();
void display_startup() void display_startup()
{ {
@@ -681,9 +680,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot)
LLGLState::checkTextureChannels(); LLGLState::checkTextureChannels();
LLGLState::checkClientArrays(); LLGLState::checkClientArrays();
BOOL to_texture = !for_snapshot && BOOL to_texture = gPipeline.canUseVertexShaders() && (LLPipeline::sRenderDeferred || LLPipeline::sRenderGlow);
gPipeline.canUseVertexShaders() &&
LLPipeline::sRenderGlow;
LLAppViewer::instance()->pingMainloopTimeout("Display:Swap"); LLAppViewer::instance()->pingMainloopTimeout("Display:Swap");

View File

@@ -1478,7 +1478,13 @@ void init_debug_rendering_menu(LLMenuGL* menu)
sub_menu->append(new LLMenuItemCheckGL("Sculpt", &LLPipeline::toggleRenderDebug, NULL, sub_menu->append(new LLMenuItemCheckGL("Sculpt", &LLPipeline::toggleRenderDebug, NULL,
&LLPipeline::toggleRenderDebugControl, &LLPipeline::toggleRenderDebugControl,
(void*)LLPipeline::RENDER_DEBUG_SCULPTED)); (void*)LLPipeline::RENDER_DEBUG_SCULPTED));
sub_menu->append(new LLMenuItemCheckGL("Build Queue", &LLPipeline::toggleRenderDebug, NULL,
&LLPipeline::toggleRenderDebugControl,
(void*)LLPipeline::RENDER_DEBUG_BUILD_QUEUE));
sub_menu->append(new LLMenuItemCheckGL("Update Types", &LLPipeline::toggleRenderDebug, NULL,
&LLPipeline::toggleRenderDebugControl,
(void*)LLPipeline::RENDER_DEBUG_UPDATE_TYPE));
sub_menu->append(new LLMenuItemCallGL("Vectorize Perf Test", &run_vectorize_perf_test)); sub_menu->append(new LLMenuItemCallGL("Vectorize Perf Test", &run_vectorize_perf_test));
sub_menu = new LLMenuGL("Render Tests"); sub_menu = new LLMenuGL("Render Tests");

View File

@@ -146,6 +146,7 @@ const LLMatrix4* gGLLastMatrix = NULL;
std::string gPoolNames[] = std::string gPoolNames[] =
{ {
// Correspond to LLDrawpool enum render type // Correspond to LLDrawpool enum render type
"NONE",
"POOL_SIMPLE", "POOL_SIMPLE",
"POOL_TERRAIN", "POOL_TERRAIN",
"POOL_BUMP", "POOL_BUMP",
@@ -380,6 +381,7 @@ void LLPipeline::init()
LLViewerShaderMgr::instance()->setShaders(); LLViewerShaderMgr::instance()->setShaders();
stop_glerror(); stop_glerror();
setLightingDetail(-1);
} }
LLPipeline::~LLPipeline() LLPipeline::~LLPipeline()
@@ -452,8 +454,6 @@ void LLPipeline::cleanup()
releaseGLBuffers(); releaseGLBuffers();
mBloomImagep = NULL;
mBloomImage2p = NULL;
mFaceSelectImagep = NULL; mFaceSelectImagep = NULL;
mMovedBridge.clear(); mMovedBridge.clear();
@@ -558,13 +558,12 @@ void LLPipeline::allocateScreenBuffer(U32 resX, U32 resY)
//static //static
void LLPipeline::updateRenderDeferred() void LLPipeline::updateRenderDeferred()
{ {
BOOL deferred = (gSavedSettings.getBOOL("RenderDeferred") && sRenderDeferred = (gSavedSettings.getBOOL("RenderDeferred") &&
LLRenderTarget::sUseFBO && LLRenderTarget::sUseFBO &&
gSavedSettings.getBOOL("VertexShaderEnable") && gSavedSettings.getBOOL("VertexShaderEnable") &&
gSavedSettings.getBOOL("RenderAvatarVP") && gSavedSettings.getBOOL("RenderAvatarVP") &&
gSavedSettings.getBOOL("WindLightUseAtmosShaders")) ? TRUE : FALSE; gSavedSettings.getBOOL("WindLightUseAtmosShaders") &&
!gUseWireframe);
sRenderDeferred = deferred;
} }
void LLPipeline::releaseGLBuffers() void LLPipeline::releaseGLBuffers()
@@ -1398,6 +1397,7 @@ void LLPipeline::updateCull(LLCamera& camera, LLCullResult& result, S32 water_cl
gGLLastMatrix = NULL; gGLLastMatrix = NULL;
glLoadMatrixd(gGLLastModelView); glLoadMatrixd(gGLLastModelView);
LLVertexBuffer::unbind(); LLVertexBuffer::unbind();
LLGLDisable blend(GL_BLEND); LLGLDisable blend(GL_BLEND);
LLGLDisable test(GL_ALPHA_TEST); LLGLDisable test(GL_ALPHA_TEST);
@@ -1475,10 +1475,10 @@ void LLPipeline::updateCull(LLCamera& camera, LLCullResult& result, S32 water_cl
{ {
mScreen.flush(); mScreen.flush();
} }
/*else if (LLPipeline::sUseOcclusion > 1) else if (LLPipeline::sUseOcclusion > 1)
{ {
glFlush(); glFlush();
}*/ }
} }
void LLPipeline::markNotCulled(LLSpatialGroup* group, LLCamera& camera) void LLPipeline::markNotCulled(LLSpatialGroup* group, LLCamera& camera)
@@ -2372,6 +2372,7 @@ void LLPipeline::postSort(LLCamera& camera)
assertInitialized(); assertInitialized();
llpushcallstacks ;
//rebuild drawable geometry //rebuild drawable geometry
for (LLCullResult::sg_list_t::iterator i = sCull->beginDrawableGroups(); i != sCull->endDrawableGroups(); ++i) for (LLCullResult::sg_list_t::iterator i = sCull->beginDrawableGroups(); i != sCull->endDrawableGroups(); ++i)
{ {
@@ -2382,7 +2383,7 @@ void LLPipeline::postSort(LLCamera& camera)
group->rebuildGeom(); group->rebuildGeom();
} }
} }
llpushcallstacks ;
//rebuild groups //rebuild groups
sCull->assertDrawMapsEmpty(); sCull->assertDrawMapsEmpty();
@@ -2400,10 +2401,10 @@ void LLPipeline::postSort(LLCamera& camera)
} }
LLSpatialGroup::sNoDelete = TRUE;*/ LLSpatialGroup::sNoDelete = TRUE;*/
rebuildPriorityGroups(); rebuildPriorityGroups();
llpushcallstacks ;
const S32 bin_count = 1024*8; const S32 bin_count = 1024*8;
static LLCullResult::drawinfo_list_t alpha_bins[bin_count]; static LLCullResult::drawinfo_list_t alpha_bins[bin_count];
@@ -2504,7 +2505,7 @@ void LLPipeline::postSort(LLCamera& camera)
std::sort(sCull->beginAlphaGroups(), sCull->endAlphaGroups(), LLSpatialGroup::CompareDepthGreater()); std::sort(sCull->beginAlphaGroups(), sCull->endAlphaGroups(), LLSpatialGroup::CompareDepthGreater());
} }
llpushcallstacks ;
// only render if the flag is set. The flag is only set if we are in edit mode or the toggle is set in the menus // only render if the flag is set. The flag is only set if we are in edit mode or the toggle is set in the menus
static const LLCachedControl<bool> beacon_always_on("BeaconAlwaysOn",false); static const LLCachedControl<bool> beacon_always_on("BeaconAlwaysOn",false);
if (beacon_always_on && !sShadowRender) if (beacon_always_on && !sShadowRender)
@@ -2553,7 +2554,7 @@ void LLPipeline::postSort(LLCamera& camera)
forAllVisibleDrawables(renderSoundHighlights); forAllVisibleDrawables(renderSoundHighlights);
} }
} }
llpushcallstacks ;
// If managing your telehub, draw beacons at telehub and currently selected spawnpoint. // If managing your telehub, draw beacons at telehub and currently selected spawnpoint.
if (LLFloaterTelehub::renderBeacons()) if (LLFloaterTelehub::renderBeacons())
{ {
@@ -2583,6 +2584,7 @@ void LLPipeline::postSort(LLCamera& camera)
} }
//LLSpatialGroup::sNoDelete = FALSE; //LLSpatialGroup::sNoDelete = FALSE;
llpushcallstacks ;
} }
@@ -2615,7 +2617,12 @@ void render_hud_elements()
// Render debugging beacons. // Render debugging beacons.
//gObjectList.renderObjectBeacons(); //gObjectList.renderObjectBeacons();
//LLHUDObject::renderAll();
//TO-DO:
//V2 moved this line from LLPipeline::renderGeom
//Uncomment once multisample z-buffer issues are figured out on ati cards.
// LLHUDObject::renderAll();
//gObjectList.resetObjectBeacons(); //gObjectList.resetObjectBeacons();
} }
else if (gForceRenderLandFence) else if (gForceRenderLandFence)
@@ -2938,6 +2945,9 @@ void LLPipeline::renderGeom(LLCamera& camera, BOOL forceVBOUpdate)
{ {
// Render debugging beacons. // Render debugging beacons.
gObjectList.renderObjectBeacons(); gObjectList.renderObjectBeacons();
//TO-DO:
//V2 moved this line to LLPipeline::render_hud_elements
//Migrate once multisample z-buffer issues are figured out on ati cards.
LLHUDObject::renderAll(); LLHUDObject::renderAll();
gObjectList.resetObjectBeacons(); gObjectList.resetObjectBeacons();
} }
@@ -3167,26 +3177,32 @@ void LLPipeline::renderGeomPostDeferred(LLCamera& camera)
gGLLastMatrix = NULL; gGLLastMatrix = NULL;
glLoadMatrixd(gGLModelView); glLoadMatrixd(gGLModelView);
renderHighlights(); //TO-DO:
mHighlightFaces.clear(); //V2 moved block to LLPipeline::renderDeferredLighting
//Migrate once multisample z-buffer issues are figured out on ati cards.
renderDebug();
LLVertexBuffer::unbind();
if (gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_UI))
{ {
// Render debugging beacons. renderHighlights();
gObjectList.renderObjectBeacons(); mHighlightFaces.clear();
LLHUDObject::renderAll();
gObjectList.resetObjectBeacons();
}
else
{
// Make sure particle effects disappear
LLHUDObject::renderAllForTimer();
}
renderDebug();
LLVertexBuffer::unbind();
if (gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_UI))
{
// Render debugging beacons.
gObjectList.renderObjectBeacons();
LLHUDObject::renderAll();
gObjectList.resetObjectBeacons();
}
else
{
// Make sure particle effects disappear
LLHUDObject::renderAllForTimer();
}
}
//END
if (occlude) if (occlude)
{ {
occlude = FALSE; occlude = FALSE;
@@ -3282,6 +3298,9 @@ void LLPipeline::renderDebug()
{ {
LLMemType mt(LLMemType::MTYPE_PIPELINE); LLMemType mt(LLMemType::MTYPE_PIPELINE);
if(!mRenderDebugMask)
return;
assertInitialized(); assertInitialized();
gGL.color4f(1,1,1,1); gGL.color4f(1,1,1,1);
@@ -3446,6 +3465,55 @@ void LLPipeline::renderDebug()
} }
} }
if (mRenderDebugMask & LLPipeline::RENDER_DEBUG_BUILD_QUEUE)
{
U32 count = 0;
U32 size = mBuildQ2.size();
LLColor4 col;
LLGLEnable blend(GL_BLEND);
LLGLDepthTest depth(GL_TRUE, GL_FALSE);
gGL.getTexUnit(0)->bind(LLViewerImage::sWhiteImagep.get());
for (LLSpatialGroup::sg_vector_t::iterator iter = mGroupQ2.begin(); iter != mGroupQ2.end(); ++iter)
{
LLSpatialGroup* group = *iter;
if (group->isDead())
{
continue;
}
LLSpatialBridge* bridge = group->mSpatialPartition->asBridge();
if (bridge && (!bridge->mDrawable || bridge->mDrawable->isDead()))
{
continue;
}
if (bridge)
{
gGL.pushMatrix();
glMultMatrixf((F32*)bridge->mDrawable->getRenderMatrix().mMatrix);
}
F32 alpha = (F32) (size-count)/size;
LLVector2 c(1.f-alpha, alpha);
c.normVec();
++count;
col.set(c.mV[0], c.mV[1], 0, alpha*0.5f+0.1f);
group->drawObjectBox(col);
if (bridge)
{
gGL.popMatrix();
}
}
}
gGL.flush(); gGL.flush();
} }
@@ -4257,32 +4325,28 @@ void LLPipeline::setupHWLights(LLDrawPool* pool)
LLVector4 light_pos_gl(light_pos, 1.0f); LLVector4 light_pos_gl(light_pos, 1.0f);
F32 light_radius = llmax(light->getLightRadius(), 0.001f); F32 light_radius = llmax(light->getLightRadius(), 0.001f);
F32 atten, quad;
#if 0 //1.9.1 F32 x = (3.f * (1.f + light->getLightFalloff())); // why this magic? probably trying to match a historic behavior.
if (pool->getVertexShaderLevel() > 0) float linatten = x / (light_radius); // % of brightness at radius
{
atten = light_radius;
quad = llmax(light->getLightFalloff(), 0.0001f);
}
else
#endif
{
F32 x = (3.f * (1.f + light->getLightFalloff()));
atten = x / (light_radius); // % of brightness at radius
quad = 0.0f;
}
mHWLightColors[cur_light] = light_color; mHWLightColors[cur_light] = light_color;
S32 gllight = GL_LIGHT0+cur_light; S32 gllight = GL_LIGHT0+cur_light;
glLightfv(gllight, GL_POSITION, light_pos_gl.mV); glLightfv(gllight, GL_POSITION, light_pos_gl.mV);
glLightfv(gllight, GL_DIFFUSE, light_color.mV); glLightfv(gllight, GL_DIFFUSE, light_color.mV);
glLightfv(gllight, GL_AMBIENT, LLColor4::black.mV); glLightfv(gllight, GL_AMBIENT, LLColor4::black.mV);
glLightfv(gllight, GL_SPECULAR, LLColor4::black.mV);
glLightf (gllight, GL_CONSTANT_ATTENUATION, 0.0f); glLightf (gllight, GL_CONSTANT_ATTENUATION, 0.0f);
glLightf (gllight, GL_LINEAR_ATTENUATION, atten); glLightf (gllight, GL_LINEAR_ATTENUATION, linatten);
glLightf (gllight, GL_QUADRATIC_ATTENUATION, quad); glLightf (gllight, GL_QUADRATIC_ATTENUATION, 0.0f);
glLightf (gllight, GL_SPOT_EXPONENT, 0.0f); //Point lights
glLightf (gllight, GL_SPOT_CUTOFF, 180.0f); {
glLightf (gllight, GL_SPOT_EXPONENT, 0.0f);
glLightf (gllight, GL_SPOT_CUTOFF, 180.0f);
// we use specular.w = 1.0 as a cheap hack for the shaders to know that this is omnidirectional rather than a spotlight
const float specular[] = {0.f, 0.f, 0.f, 1.f};
glLightfv(gllight, GL_SPECULAR, specular);
//llinfos << "boring light" << llendl;
}
cur_light++; cur_light++;
if (cur_light >= 8) if (cur_light >= 8)
{ {
@@ -4299,7 +4363,7 @@ void LLPipeline::setupHWLights(LLDrawPool* pool)
glLightfv(gllight, GL_SPECULAR, LLColor4::black.mV); glLightfv(gllight, GL_SPECULAR, LLColor4::black.mV);
} }
if (gAgent.getAvatarObject() && if (isAgentAvatarValid() &&
gAgent.getAvatarObject()->mSpecialRenderMode == 3) gAgent.getAvatarObject()->mSpecialRenderMode == 3)
{ {
LLColor4 light_color = LLColor4::white; LLColor4 light_color = LLColor4::white;
@@ -4309,13 +4373,10 @@ void LLPipeline::setupHWLights(LLDrawPool* pool)
LLVector4 light_pos_gl(light_pos, 1.0f); LLVector4 light_pos_gl(light_pos, 1.0f);
F32 light_radius = 16.f; F32 light_radius = 16.f;
F32 atten, quad;
{
F32 x = 3.f; F32 x = 3.f;
atten = x / (light_radius); // % of brightness at radius float linatten = x / (light_radius); // % of brightness at radius
quad = 0.0f;
}
mHWLightColors[2] = light_color; mHWLightColors[2] = light_color;
S32 gllight = GL_LIGHT2; S32 gllight = GL_LIGHT2;
glLightfv(gllight, GL_POSITION, light_pos_gl.mV); glLightfv(gllight, GL_POSITION, light_pos_gl.mV);
@@ -4323,8 +4384,8 @@ void LLPipeline::setupHWLights(LLDrawPool* pool)
glLightfv(gllight, GL_AMBIENT, LLColor4::black.mV); glLightfv(gllight, GL_AMBIENT, LLColor4::black.mV);
glLightfv(gllight, GL_SPECULAR, LLColor4::black.mV); glLightfv(gllight, GL_SPECULAR, LLColor4::black.mV);
glLightf (gllight, GL_CONSTANT_ATTENUATION, 0.0f); glLightf (gllight, GL_CONSTANT_ATTENUATION, 0.0f);
glLightf (gllight, GL_LINEAR_ATTENUATION, atten); glLightf (gllight, GL_LINEAR_ATTENUATION, linatten);
glLightf (gllight, GL_QUADRATIC_ATTENUATION, quad); glLightf (gllight, GL_QUADRATIC_ATTENUATION, 0.0f);
glLightf (gllight, GL_SPOT_EXPONENT, 0.0f); glLightf (gllight, GL_SPOT_EXPONENT, 0.0f);
glLightf (gllight, GL_SPOT_CUTOFF, 180.0f); glLightf (gllight, GL_SPOT_CUTOFF, 180.0f);
} }
@@ -4341,6 +4402,7 @@ void LLPipeline::setupHWLights(LLDrawPool* pool)
void LLPipeline::enableLights(U32 mask) void LLPipeline::enableLights(U32 mask)
{ {
assertInitialized(); assertInitialized();
if (mLightingDetail == 0) if (mLightingDetail == 0)
{ {
mask &= 0xf003; // sun and backlight only (and fullbright bit) mask &= 0xf003; // sun and backlight only (and fullbright bit)
@@ -5528,6 +5590,14 @@ void LLPipeline::renderBloom(BOOL for_snapshot, F32 zoom_factor, int subfield)
gGL.getTexUnit(0)->activate(); gGL.getTexUnit(0)->activate();
gGL.getTexUnit(0)->setTextureBlendType(LLTexUnit::TB_MULT); gGL.getTexUnit(0)->setTextureBlendType(LLTexUnit::TB_MULT);
//TO-DO:
//V2 requires this for hover text and such since they have been pulled out of geom render.
//Do this when multisample z-buffer issues are figured out
/*if (LLRenderTarget::sUseFBO)
{ //copy depth buffer from mScreen to framebuffer
LLRenderTarget::copyContentsToFramebuffer(mScreen, 0, 0, mScreen.getWidth(), mScreen.getHeight(),
0, 0, mScreen.getWidth(), mScreen.getHeight(), GL_DEPTH_BUFFER_BIT, GL_NEAREST);
}*/
} }
@@ -5836,6 +5906,9 @@ void LLPipeline::renderDeferredLighting()
{ {
LLGLDisable blend(GL_BLEND); LLGLDisable blend(GL_BLEND);
//TO-DO:
//V2 changed to LLGLDepthTest depth(GL_TRUE, GL_FALSE, GL_ALWAYS);
//Do this when multisample z-buffer issues are figured out
LLGLDepthTest depth(GL_FALSE); LLGLDepthTest depth(GL_FALSE);
stop_glerror(); stop_glerror();
glDrawArrays(GL_TRIANGLE_STRIP, 0, 3); glDrawArrays(GL_TRIANGLE_STRIP, 0, 3);
@@ -5852,6 +5925,9 @@ void LLPipeline::renderDeferredLighting()
{ {
LLGLDisable blend(GL_BLEND); LLGLDisable blend(GL_BLEND);
//TO-DO:
//V2 changed to LLGLDepthTest depth(GL_TRUE, GL_FALSE, GL_ALWAYS);
//Do this when multisample z-buffer issues are figured out
LLGLDepthTest depth(GL_FALSE); LLGLDepthTest depth(GL_FALSE);
stop_glerror(); stop_glerror();
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
@@ -6088,6 +6164,26 @@ void LLPipeline::renderDeferredLighting()
popRenderTypeMask(); popRenderTypeMask();
} }
//TO-DO:
//V2 moved block from LLPipeline::renderGeomPostDeferred
//Migrate once multisample z-buffer issues are figured out on ati cards.
/*{
//render highlights, etc.
renderHighlights();
mHighlightFaces.clear();
renderDebug();
LLVertexBuffer::unbind();
if (gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_UI))
{
// Render debugging beacons.
gObjectList.renderObjectBeacons();
gObjectList.resetObjectBeacons();
}
}*/
mScreen.flush(); mScreen.flush();
} }
@@ -6251,48 +6347,47 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in)
gPipeline.popRenderTypeMask(); gPipeline.popRenderTypeMask();
} }
gPipeline.pushRenderTypeMask();
clearRenderTypeMask(LLPipeline::RENDER_TYPE_WATER,
LLPipeline::RENDER_TYPE_VOIDWATER,
LLPipeline::RENDER_TYPE_GROUND,
LLPipeline::RENDER_TYPE_SKY,
LLPipeline::RENDER_TYPE_CLASSIC_CLOUDS,
LLPipeline::RENDER_TYPE_WL_CLOUDS,
LLPipeline::END_RENDER_TYPES);
if (gSavedSettings.getBOOL("RenderWaterReflections")) if (gSavedSettings.getBOOL("RenderWaterReflections"))
{ //mask out selected geometry based on reflection detail { //mask out selected geometry based on reflection detail
S32 detail = gSavedSettings.getS32("RenderReflectionDetail"); S32 detail = gSavedSettings.getS32("RenderReflectionDetail");
if (detail > 0) //if (detail > 0)
{ //mask out selected geometry based on reflection detail { //mask out selected geometry based on reflection detail
{ {
if (detail < 4) gPipeline.pushRenderTypeMask();
{
clearRenderTypeMask(LLPipeline::RENDER_TYPE_PARTICLES, END_RENDER_TYPES);
if (detail < 3) if (detail < 3)
{ {
clearRenderTypeMask(LLPipeline::RENDER_TYPE_AVATAR, END_RENDER_TYPES); clearRenderTypeMask(LLPipeline::RENDER_TYPE_PARTICLES, END_RENDER_TYPES);
if (detail < 2) if (detail < 2)
{ {
clearRenderTypeMask(LLPipeline::RENDER_TYPE_AVATAR, END_RENDER_TYPES);
if (detail < 1)
{
clearRenderTypeMask(LLPipeline::RENDER_TYPE_VOLUME, END_RENDER_TYPES); clearRenderTypeMask(LLPipeline::RENDER_TYPE_VOLUME, END_RENDER_TYPES);
} }
} }
} }
clearRenderTypeMask(LLPipeline::RENDER_TYPE_WATER,
LLPipeline::RENDER_TYPE_VOIDWATER,
LLPipeline::RENDER_TYPE_GROUND,
LLPipeline::RENDER_TYPE_SKY,
LLPipeline::RENDER_TYPE_CLASSIC_CLOUDS,
LLPipeline::RENDER_TYPE_WL_CLOUDS,
LLPipeline::END_RENDER_TYPES);
static LLCachedControl<bool> skip_distortion_updates("SkipReflectOcclusionUpdates",false); static LLCachedControl<bool> skip_distortion_updates("SkipReflectOcclusionUpdates",false);
LLPipeline::sSkipUpdate = skip_distortion_updates; LLPipeline::sSkipUpdate = skip_distortion_updates;
LLGLUserClipPlane clip_plane(plane, mat, projection); LLGLUserClipPlane clip_plane(plane, mat, projection);
LLGLDisable cull(GL_CULL_FACE); LLGLDisable cull(GL_CULL_FACE);
updateCull(camera, ref_result, 1); updateCull(camera, ref_result, 1);
stateSort(camera, ref_result); stateSort(camera, ref_result);
gPipeline.grabReferences(ref_result);
renderGeom(camera);
LLPipeline::sSkipUpdate = FALSE;
gPipeline.popRenderTypeMask();
} }
gPipeline.grabReferences(ref_result);
LLGLUserClipPlane clip_plane(plane, mat, projection);
renderGeom(camera);
LLPipeline::sSkipUpdate = FALSE;
} }
} }
gPipeline.popRenderTypeMask();
} }
glCullFace(GL_BACK); glCullFace(GL_BACK);
glPopMatrix(); glPopMatrix();

View File

@@ -397,7 +397,9 @@ public:
RENDER_DEBUG_SHADOW_FRUSTA = 0x0040000, RENDER_DEBUG_SHADOW_FRUSTA = 0x0040000,
RENDER_DEBUG_SCULPTED = 0x0080000, RENDER_DEBUG_SCULPTED = 0x0080000,
RENDER_DEBUG_AVATAR_VOLUME = 0x0100000, RENDER_DEBUG_AVATAR_VOLUME = 0x0100000,
RENDER_DEBUG_AGENT_TARGET = 0x0200000, RENDER_DEBUG_BUILD_QUEUE = 0x0200000,
RENDER_DEBUG_AGENT_TARGET = 0x0400000,
RENDER_DEBUG_UPDATE_TYPE = 0x0800000,
}; };
public: public:
@@ -602,8 +604,6 @@ protected:
std::vector<LLFace*> mSelectedFaces; std::vector<LLFace*> mSelectedFaces;
LLPointer<LLViewerImage> mFaceSelectImagep; LLPointer<LLViewerImage> mFaceSelectImagep;
LLPointer<LLViewerImage> mBloomImagep;
LLPointer<LLViewerImage> mBloomImage2p;
U32 mLightMask; U32 mLightMask;
U32 mLightMovingMask; U32 mLightMovingMask;
@@ -620,6 +620,7 @@ public:
}; };
void render_bbox(const LLVector3 &min, const LLVector3 &max); void render_bbox(const LLVector3 &min, const LLVector3 &max);
void render_hud_elements();
extern LLPipeline gPipeline; extern LLPipeline gPipeline;
extern BOOL gRenderForSelect; extern BOOL gRenderForSelect;