From 1c6f53aa6cec5e65cb7b29b0156640f9d5d1a99c Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Mon, 17 Dec 2012 15:11:36 -0600 Subject: MAINT-2136 Add "RenderDepthOfFieldInEditMode" to control whether or not to leave DoF enabled while editing --- indra/newview/pipeline.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'indra/newview/pipeline.cpp') diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 2bcbc0b083..7255f8ec21 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -162,6 +162,7 @@ S32 LLPipeline::RenderGlowIterations; F32 LLPipeline::RenderGlowWidth; F32 LLPipeline::RenderGlowStrength; BOOL LLPipeline::RenderDepthOfField; +BOOL LLPipeline::RenderDepthOfFieldInEditMode; F32 LLPipeline::CameraFocusTransitionTime; F32 LLPipeline::CameraFNumber; F32 LLPipeline::CameraFocalLength; @@ -589,6 +590,7 @@ void LLPipeline::init() connectRefreshCachedSettingsSafe("RenderGlowWidth"); connectRefreshCachedSettingsSafe("RenderGlowStrength"); connectRefreshCachedSettingsSafe("RenderDepthOfField"); + connectRefreshCachedSettingsSafe("RenderDepthOfFieldInEditMode"); connectRefreshCachedSettingsSafe("CameraFocusTransitionTime"); connectRefreshCachedSettingsSafe("CameraFNumber"); connectRefreshCachedSettingsSafe("CameraFocalLength"); @@ -1061,6 +1063,7 @@ void LLPipeline::refreshCachedSettings() RenderGlowWidth = gSavedSettings.getF32("RenderGlowWidth"); RenderGlowStrength = gSavedSettings.getF32("RenderGlowStrength"); RenderDepthOfField = gSavedSettings.getBOOL("RenderDepthOfField"); + RenderDepthOfFieldInEditMode = gSavedSettings.getBOOL("RenderDepthOfFieldInEditMode"); CameraFocusTransitionTime = gSavedSettings.getF32("CameraFocusTransitionTime"); CameraFNumber = gSavedSettings.getF32("CameraFNumber"); CameraFocalLength = gSavedSettings.getF32("CameraFocalLength"); @@ -7121,7 +7124,7 @@ void LLPipeline::renderBloom(BOOL for_snapshot, F32 zoom_factor, int subfield) { bool dof_enabled = !LLViewerCamera::getInstance()->cameraUnderWater() && - !LLToolMgr::getInstance()->inBuildMode() && + (RenderDepthOfFieldInEditMode || !LLToolMgr::getInstance()->inBuildMode()) && RenderDepthOfField; -- cgit v1.2.3 From b8f74b42a7a2d08e9c7a2dcebec58dbd07ec0328 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Fri, 25 Jan 2013 17:29:44 -0600 Subject: MAINT-2268 Add right-click->"Mute Particle Owner" feature --- indra/newview/pipeline.cpp | 78 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) (limited to 'indra/newview/pipeline.cpp') diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 75f5e16452..a7e8fdc43c 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -5023,6 +5023,42 @@ void LLPipeline::renderDebug() gUIProgram.bind(); } + if (hasRenderDebugMask(LLPipeline::RENDER_DEBUG_RAYCAST) && !hud_only) + { //draw crosshairs on particle intersection + if (gDebugRaycastParticle) + { + if (LLGLSLShader::sNoFixedFunction) + { //this debug display requires shaders + gDebugProgram.bind(); + + gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); + + LLVector3 center = gDebugRaycastParticleIntersection; + LLVector3 size(0.1f, 0.1f, 0.1f); + + LLVector3 p[6]; + + p[0] = center + size.scaledVec(LLVector3(1,0,0)); + p[1] = center + size.scaledVec(LLVector3(-1,0,0)); + p[2] = center + size.scaledVec(LLVector3(0,1,0)); + p[3] = center + size.scaledVec(LLVector3(0,-1,0)); + p[4] = center + size.scaledVec(LLVector3(0,0,1)); + p[5] = center + size.scaledVec(LLVector3(0,0,-1)); + + gGL.begin(LLRender::LINES); + gGL.diffuseColor3f(1.f, 1.f, 0.f); + for (U32 i = 0; i < 6; i++) + { + gGL.vertex3fv(p[i].mV); + } + gGL.end(); + gGL.flush(); + + gDebugProgram.unbind(); + } + } + } + if (hasRenderDebugMask(LLPipeline::RENDER_DEBUG_SHADOW_FRUSTA)) { LLVertexBuffer::unbind(); @@ -6600,6 +6636,48 @@ BOOL LLPipeline::getRenderHighlights(void*) return sRenderHighlight; } +LLVOPartGroup* LLPipeline::lineSegmentIntersectParticle(const LLVector3& start, const LLVector3& end, LLVector3* intersection, + S32* face_hit) +{ + LLVector3 local_end = end; + + LLVector3 position; + + LLDrawable* drawable = NULL; + + for (LLWorld::region_list_t::const_iterator iter = LLWorld::getInstance()->getRegionList().begin(); + iter != LLWorld::getInstance()->getRegionList().end(); ++iter) + { + LLViewerRegion* region = *iter; + + LLSpatialPartition* part = region->getSpatialPartition(LLViewerRegion::PARTITION_PARTICLE); + if (part && hasRenderType(part->mDrawableType)) + { + LLDrawable* hit = part->lineSegmentIntersect(start, local_end, TRUE, face_hit, &position, NULL, NULL, NULL); + if (hit) + { + drawable = hit; + local_end = position; + } + } + } + + LLVOPartGroup* ret = NULL; + if (drawable) + { + //make sure we're returning an LLVOPartGroup + llassert(drawable->getVObj()->getPCode() == LLViewerObject::LL_VO_PART_GROUP); + ret = (LLVOPartGroup*) drawable->getVObj().get(); + } + + if (intersection) + { + *intersection = position; + } + + return ret; +} + LLViewerObject* LLPipeline::lineSegmentIntersectInWorld(const LLVector3& start, const LLVector3& end, BOOL pick_transparent, S32* face_hit, -- cgit v1.2.3 From 4dfd99069f4f44c2ef970eb41f9e1b66e9bb564d Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Tue, 29 Jan 2013 16:10:58 -0600 Subject: MAINT-2288 Fix for physics shapes not showing up on "active" objects. --- indra/newview/pipeline.cpp | 12 ------------ 1 file changed, 12 deletions(-) (limited to 'indra/newview/pipeline.cpp') diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index a7e8fdc43c..4306b3da12 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -4586,18 +4586,6 @@ void LLPipeline::renderPhysicsDisplay() } } - for (LLCullResult::bridge_iterator i = sCull->beginVisibleBridge(); i != sCull->endVisibleBridge(); ++i) - { - LLSpatialBridge* bridge = *i; - if (!bridge->isDead() && hasRenderType(bridge->mDrawableType)) - { - gGL.pushMatrix(); - gGL.multMatrix((F32*)bridge->mDrawable->getRenderMatrix().mMatrix); - bridge->renderPhysicsShapes(); - gGL.popMatrix(); - } - } - gGL.flush(); if (LLGLSLShader::sNoFixedFunction) -- cgit v1.2.3 From 1e3060f6d5658946395a618201fc6b9788c8f0be Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Thu, 20 Jun 2013 16:56:10 -0500 Subject: Merge cleanup --- indra/newview/pipeline.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'indra/newview/pipeline.cpp') diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 7bab06c868..9afb74bb52 100755 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -5210,7 +5210,7 @@ void LLPipeline::renderDebug() gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); - LLVector3 center = gDebugRaycastParticleIntersection; + LLVector3 center(gDebugRaycastParticleIntersection.getF32ptr()); LLVector3 size(0.1f, 0.1f, 0.1f); LLVector3 p[6]; @@ -6916,12 +6916,12 @@ void LLPipeline::setRenderHighlightTextureChannel(LLRender::eTexIndex channel) sRenderHighlightTextureChannel = channel; } -LLVOPartGroup* LLPipeline::lineSegmentIntersectParticle(const LLVector3& start, const LLVector3& end, LLVector3* intersection, +LLVOPartGroup* LLPipeline::lineSegmentIntersectParticle(const LLVector4a& start, const LLVector4a& end, LLVector4a* intersection, S32* face_hit) { - LLVector3 local_end = end; + LLVector4a local_end = end; - LLVector3 position; + LLVector4a position; LLDrawable* drawable = NULL; @@ -6958,7 +6958,7 @@ LLVOPartGroup* LLPipeline::lineSegmentIntersectParticle(const LLVector3& start, return ret; } -LLViewerObject* LLPipeline::lineSegmentIntersectInWorld(const LLVector3& start, const LLVector3& end, +LLViewerObject* LLPipeline::lineSegmentIntersectInWorld(const LLVector4a& start, const LLVector4a& end, BOOL pick_transparent, S32* face_hit, LLVector4a* intersection, // return the intersection point -- cgit v1.2.3 From 6db14e3988a1248141d085e5005baa70e48f8172 Mon Sep 17 00:00:00 2001 From: simon Date: Tue, 30 Jul 2013 15:12:02 -0700 Subject: MAINT-2913: crash in LLCamera::AABBInFrustum. Tried to make array indexes bullet-proof. Reviewed by Kelly --- indra/newview/pipeline.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'indra/newview/pipeline.cpp') diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 0a518f8f78..f49395da34 100755 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -5383,7 +5383,7 @@ void LLPipeline::renderDebug() if (i > 3) { //render shadow frusta as volumes if (mShadowFrustPoints[i-4].empty()) - { + { continue; } @@ -9651,7 +9651,7 @@ BOOL LLPipeline::getVisiblePointCloud(LLCamera& camera, LLVector3& min, LLVector pp.push_back(LLVector3(max.mV[0], max.mV[1], max.mV[2])); //add corners of camera frustum - for (U32 i = 0; i < 8; i++) + for (U32 i = 0; i < LLCamera::AGENT_FRUSTRUM_NUM; i++) { pp.push_back(camera.mAgentFrustum[i]); } @@ -9678,7 +9678,7 @@ BOOL LLPipeline::getVisiblePointCloud(LLCamera& camera, LLVector3& min, LLVector for (U32 i = 0; i < 12; i++) { //for each line segment in bounding box - for (U32 j = 0; j < 6; j++) + for (U32 j = 0; j < LLCamera::AGENT_PLANE_NO_USER_CLIP_NUM; j++) { //for each plane in camera frustum const LLPlane& cp = camera.getAgentPlane(j); const LLVector3& v1 = pp[bs[i*2+0]]; @@ -9764,19 +9764,19 @@ BOOL LLPipeline::getVisiblePointCloud(LLCamera& camera, LLVector3& min, LLVector } } - for (U32 j = 0; j < 6; ++j) + for (U32 j = 0; j < LLCamera::AGENT_PLANE_NO_USER_CLIP_NUM; ++j) { const LLPlane& cp = camera.getAgentPlane(j); F32 dist = cp.dist(pp[i]); if (dist > 0.05f) //point is above some plane, not contained - { + { found = false; break; - } - } + } + } - if (found) - { + if (found) + { fp.push_back(pp[i]); } } -- cgit v1.2.3