From 5eeca73940bb083e76cb73d1528e61544d3f7fd2 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Tue, 1 Mar 2011 15:22:17 -0600 Subject: SH-1072 Fix for DoF focal point being incorrect. --- indra/newview/app_settings/settings.xml | 12 ++++++++++ indra/newview/llviewerwindow.cpp | 2 +- indra/newview/llvovolume.cpp | 7 ++++++ indra/newview/pipeline.cpp | 41 ++++++++++++++++++++++----------- 4 files changed, 47 insertions(+), 15 deletions(-) (limited to 'indra') diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 71a611ba90..01610f73ed 100755 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -1323,6 +1323,18 @@ 0 + CameraFocusTransitionTime + + Comment + How many seconds it takes the camera to transition between focal distances + Persist + 1 + Type + F32 + Value + 0.5 + + CameraFNumber Comment diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 94fb0b7d31..7aa90bd76d 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -3698,7 +3698,7 @@ LLViewerObject* LLViewerWindow::cursorIntersect(S32 mouse_x, S32 mouse_y, F32 de { found = gPipeline.lineSegmentIntersectInWorld(mouse_world_start, mouse_world_end, pick_transparent, face_hit, intersection, uv, normal, binormal); - if (found) + if (found && !pick_transparent) { gDebugRaycastIntersection = *intersection; } diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index e3cc2f2589..132e50904a 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -3365,8 +3365,15 @@ BOOL LLVOVolume::lineSegmentIntersect(const LLVector3& start, const LLVector3& e end_face = face+1; } + bool special_cursor = specialHoverCursor(); for (S32 i = start_face; i < end_face; ++i) { + if (!special_cursor && !pick_transparent && getTE(i)->getColor().mV[3] == 0.f) + { //don't attempt to pick completely transparent faces unless + //pick_transparent is true + continue; + } + face_hit = volume->lineSegmentIntersect(v_start, v_end, i, &p, &tc, &n, &bn); diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index c280805516..55d73f9808 100755 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -6173,26 +6173,39 @@ void LLPipeline::renderBloom(BOOL for_snapshot, F32 zoom_factor, int subfield) //depth of field focal plane calculations - F32 subject_distance = 16.f; - if (LLViewerJoystick::getInstance()->getOverrideCamera()) - { - //flycam mode, use mouse cursor as focus point - LLVector3 eye = LLViewerCamera::getInstance()->getOrigin(); - subject_distance = (eye-gDebugRaycastIntersection).magVec(); + static F32 current_distance = 16.f; + static F32 start_distance = 16.f; + static F32 transition_time = 1.f; + + LLVector3 eye = LLViewerCamera::getInstance()->getOrigin(); + F32 target_distance = LLViewerCamera::getInstance()->getAtAxis() * (gDebugRaycastIntersection-eye); + + if (transition_time >= 1.f && + fabsf(current_distance-target_distance)/current_distance > 0.01f) + { //large shift happened, interpolate smoothly to new target distance + llinfos << "start" << llendl; + transition_time = 0.f; + start_distance = current_distance; } - else - { - LLViewerObject* obj = gAgentCamera.getFocusObject(); - if (obj) + else if (transition_time < 1.f) + { //currently in a transition, continue interpolating + transition_time += 1.f/gSavedSettings.getF32("CameraFocusTransitionTime")*gFrameIntervalSeconds; + if (transition_time >= 1.f) { - LLVector3 focus = LLVector3(gAgentCamera.getFocusGlobal()-gAgent.getRegion()->getOriginGlobal()); - LLVector3 eye = LLViewerCamera::getInstance()->getOrigin(); - subject_distance = (focus-eye).magVec(); + llinfos << "stop" << llendl; } + transition_time = llmin(transition_time, 1.f); + + F32 t = cosf(transition_time*F_PI+F_PI)*0.5f+0.5f; + current_distance = start_distance + (target_distance-start_distance)*t; + } + else + { //small or no change, just snap to target distance + current_distance = target_distance; } //convert to mm - subject_distance *= 1000.f; + F32 subject_distance = current_distance*1000.f; F32 fnumber = gSavedSettings.getF32("CameraFNumber"); const F32 default_focal_length = gSavedSettings.getF32("CameraFocalLength"); -- cgit v1.2.3 From fcb205131ccc02b2b50e79ad274ed4ef4fec0330 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Tue, 1 Mar 2011 16:04:25 -0600 Subject: SH-1068 Disable DoF when underwater (shader doesn't have enough information to execute). --- indra/newview/pipeline.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 55d73f9808..b29e32f1d8 100755 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -6160,7 +6160,7 @@ void LLPipeline::renderBloom(BOOL for_snapshot, F32 zoom_factor, int subfield) LLVertexBuffer::unbind(); - if (LLPipeline::sRenderDeferred) + if (LLPipeline::sRenderDeferred && !LLViewerCamera::getInstance()->cameraUnderWater()) { LLGLSLShader* shader = &gDeferredPostProgram; if (LLViewerShaderMgr::instance()->getVertexShaderLevel(LLViewerShaderMgr::SHADER_DEFERRED) > 2) -- cgit v1.2.3 From f24a040beb878a5d24519e2a849379f8d7b473bb Mon Sep 17 00:00:00 2001 From: leyla_linden Date: Tue, 1 Mar 2011 14:29:46 -0800 Subject: SH-311 Physics Shape Type UI collides with torus parameters SH-309 Objects number in Edit Tools becomes obscured --- indra/newview/skins/default/xui/en/floater_tools.xml | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'indra') diff --git a/indra/newview/skins/default/xui/en/floater_tools.xml b/indra/newview/skins/default/xui/en/floater_tools.xml index 53cc808e70..0b241a9796 100644 --- a/indra/newview/skins/default/xui/en/floater_tools.xml +++ b/indra/newview/skins/default/xui/en/floater_tools.xml @@ -757,7 +757,7 @@ follows="left|top" halign="right" layout="topleft" - right="-100" + right="-120" name="linked_set_count" top="144" width="80"> @@ -772,7 +772,7 @@ halign="right" layout="topleft" top_delta="0" - right="-10" + right="-8" name="linked_set_cost" tool_tip="Cost of currently selected linked sets as [prims],[physics complexity]" width="80"> @@ -786,7 +786,7 @@ halign="right" layout="topleft" top_pad="5" - right="-100" + right="-120" name="object_count" width="80"> Objects: [COUNT] @@ -799,7 +799,7 @@ halign="right" layout="topleft" top_delta="0" - right="-10" + right="-8" name="object_cost" tool_tip="Cost of currently selected objects as [prims] / [physics complexity]" width="80"> @@ -843,7 +843,8 @@ tab_height="25" top="173" width="295"> - Physics Shape Type: