From afa2999f067097cf833bce1517a3e75ccd20a32a Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Mon, 29 Nov 2010 11:54:34 -0600 Subject: Tweak DoF bloom gradient. --- .../app_settings/shaders/class1/deferred/postDeferredF.glsl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/indra/newview/app_settings/shaders/class1/deferred/postDeferredF.glsl b/indra/newview/app_settings/shaders/class1/deferred/postDeferredF.glsl index eec44d9d42..4503dc9003 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/postDeferredF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/postDeferredF.glsl @@ -75,11 +75,11 @@ void main() float w = 1.0; float fd = far_focal_distance; - float sc = clamp(depth[0]/fd, 0.0, -8.0/fd); - sc = min(sc, 8.0); + float sc = far_focal_distance - depth[0]; + sc /= near_focal_distance-far_focal_distance; - //fd = depth[0]*0.5; - + sc = min(sc, 8.0); + while (sc > 1.0) { do_aa = false; -- cgit v1.2.3 From 689555fda2d580808ef4b9012b14716b4d1193e5 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Mon, 29 Nov 2010 11:54:58 -0600 Subject: Get rid of some redudnant calls to constructUrl --- indra/newview/llmeshrepository.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp index 1ff11f2c01..d8aeb1bf81 100755 --- a/indra/newview/llmeshrepository.cpp +++ b/indra/newview/llmeshrepository.cpp @@ -828,7 +828,7 @@ bool LLMeshRepoThread::fetchMeshDecomposition(const LLUUID& mesh_id) { ++sActiveLODRequests; LLMeshRepository::sHTTPRequestCount++; - mCurlRequest->getByteRange(constructUrl(mesh_id), headers, offset, size, + mCurlRequest->getByteRange(http_url, headers, offset, size, new LLMeshDecompositionResponder(mesh_id, offset, size)); } } @@ -900,7 +900,7 @@ bool LLMeshRepoThread::fetchMeshPhysicsShape(const LLUUID& mesh_id) { ++sActiveLODRequests; LLMeshRepository::sHTTPRequestCount++; - mCurlRequest->getByteRange(constructUrl(mesh_id), headers, offset, size, + mCurlRequest->getByteRange(http_url, headers, offset, size, new LLMeshPhysicsShapeResponder(mesh_id, offset, size)); } } -- cgit v1.2.3 From bd8d888ceab101db8e350b4b317823a316470ade Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Tue, 30 Nov 2010 00:25:44 -0600 Subject: Make importer use 3-light setup all the time --- indra/newview/app_settings/settings.xml | 172 +++++++++++++++++++++++++++++++- indra/newview/llfloatermodelpreview.cpp | 4 +- indra/newview/pipeline.cpp | 55 ++++++++++ indra/newview/pipeline.h | 1 + 4 files changed, 229 insertions(+), 3 deletions(-) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 0fc7d41ec7..61d6397109 100755 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -6457,7 +6457,177 @@ Value 13 - PrimMediaMasterEnabled + + PreviewAmbientColor + + Comment + Ambient color of preview render. + Persist + 1 + Type + Color4 + Value + + 0.0 + 0.0 + 0.0 + 1.0 + + + + + PreviewDiffuse0 + + Comment + Diffise color of preview light 0. + Persist + 1 + Type + Color4 + Value + + 1.0 + 1.0 + 1.0 + 1.0 + + + + PreviewDiffuse1 + + Comment + Diffise color of preview light 1. + Persist + 1 + Type + Color4 + Value + + 0.25 + 0.25 + 0.25 + 1.0 + + + + PreviewDiffuse2 + + Comment + Diffise color of preview light 2. + Persist + 1 + Type + Color4 + Value + + 1.0 + 1.0 + 1.0 + 1.0 + + + + PreviewSpecular0 + + Comment + Diffise color of preview light 0. + Persist + 1 + Type + Color4 + Value + + 1.0 + 1.0 + 1.0 + 1.0 + + + + PreviewSpecular1 + + Comment + Diffise color of preview light 1. + Persist + 1 + Type + Color4 + Value + + 1.0 + 1.0 + 1.0 + 1.0 + + + + PreviewSpecular2 + + Comment + Diffise color of preview light 2. + Persist + 1 + Type + Color4 + Value + + 1.0 + 1.0 + 1.0 + 1.0 + + + + + PreviewDirection0 + + Comment + Direction of light 0 for preview render. + Persist + 1 + Type + Vector3 + Value + + -0.35 + 1 + 0.7 + + + + PreviewDirection1 + + Comment + Direction of light 1 for preview render. + Persist + 1 + Type + Vector3 + Value + + -1 + -1 + -0.6 + + + + PreviewDirection2 + + Comment + Direction of light 2 for preview render. + Persist + 1 + Type + Vector3 + Value + + -0.2 + -0.8 + -0.2 + + + + PrimMediaMasterEnabled Comment Whether or not Media on a Prim is enabled. diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp index 68c7e3c1a2..b82e9dd62f 100644 --- a/indra/newview/llfloatermodelpreview.cpp +++ b/indra/newview/llfloatermodelpreview.cpp @@ -3369,6 +3369,8 @@ BOOL LLModelPreview::render() refresh(); } + gPipeline.enableLightsPreview(); + LLQuaternion camera_rot = LLQuaternion(mCameraPitch, LLVector3::y_axis) * LLQuaternion(mCameraYaw, LLVector3::z_axis); @@ -3383,8 +3385,6 @@ BOOL LLModelPreview::render() stop_glerror(); - gPipeline.enableLightsAvatar(); - gGL.pushMatrix(); const F32 BRIGHTNESS = 0.9f; gGL.color3f(BRIGHTNESS, BRIGHTNESS, BRIGHTNESS); diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index a189d17dc8..1ebc0a6a09 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -5226,6 +5226,61 @@ void LLPipeline::enableLightsAvatar() enableLights(mask); } +void LLPipeline::enableLightsPreview() +{ + disableLights(); + + glEnable(GL_LIGHTING); + LLColor4 ambient = gSavedSettings.getColor4("PreviewAmbientColor"); + glLightModelfv(GL_LIGHT_MODEL_AMBIENT,ambient.mV); + + + LLColor4 diffuse0 = gSavedSettings.getColor4("PreviewDiffuse0"); + LLColor4 specular0 = gSavedSettings.getColor4("PreviewSpecular0"); + LLColor4 diffuse1 = gSavedSettings.getColor4("PreviewDiffuse1"); + LLColor4 specular1 = gSavedSettings.getColor4("PreviewSpecular1"); + LLColor4 diffuse2 = gSavedSettings.getColor4("PreviewDiffuse2"); + LLColor4 specular2 = gSavedSettings.getColor4("PreviewSpecular2"); + + LLVector3 dir0 = gSavedSettings.getVector3("PreviewDirection0"); + LLVector3 dir1 = gSavedSettings.getVector3("PreviewDirection1"); + LLVector3 dir2 = gSavedSettings.getVector3("PreviewDirection2"); + + dir0.normVec(); + dir1.normVec(); + dir2.normVec(); + + LLVector4 light_pos(dir0, 0.0f); + glEnable(GL_LIGHT0); + glLightfv(GL_LIGHT0, GL_POSITION, light_pos.mV); + glLightfv(GL_LIGHT0, GL_DIFFUSE, diffuse0.mV); + glLightfv(GL_LIGHT0, GL_AMBIENT, LLColor4::black.mV); + glLightfv(GL_LIGHT0, GL_SPECULAR, specular0.mV); + glLightf (GL_LIGHT0, GL_SPOT_EXPONENT, 0.0f); + glLightf (GL_LIGHT0, GL_SPOT_CUTOFF, 180.0f); + + light_pos = LLVector4(dir1, 0.f); + glEnable(GL_LIGHT1); + glLightfv(GL_LIGHT1, GL_POSITION, light_pos.mV); + glLightfv(GL_LIGHT1, GL_DIFFUSE, diffuse1.mV); + glLightfv(GL_LIGHT1, GL_AMBIENT, LLColor4::black.mV); + glLightfv(GL_LIGHT1, GL_SPECULAR, specular1.mV); + glLightf (GL_LIGHT1, GL_SPOT_EXPONENT, 0.0f); + glLightf (GL_LIGHT1, GL_SPOT_CUTOFF, 180.0f); + + light_pos = LLVector4(dir2, 0.f); + glEnable(GL_LIGHT2); + glLightfv(GL_LIGHT2, GL_POSITION, light_pos.mV); + glLightfv(GL_LIGHT2, GL_DIFFUSE, diffuse2.mV); + glLightfv(GL_LIGHT2, GL_AMBIENT, LLColor4::black.mV); + glLightfv(GL_LIGHT2, GL_SPECULAR, specular2.mV); + glLightf (GL_LIGHT2, GL_SPOT_EXPONENT, 0.0f); + glLightf (GL_LIGHT2, GL_SPOT_CUTOFF, 180.0f); + + +} + + void LLPipeline::enableLightsAvatarEdit(const LLColor4& color) { U32 mask = 0x2002; // Avatar backlight only, set ambient diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h index e63fbbf147..156a4dd15f 100644 --- a/indra/newview/pipeline.h +++ b/indra/newview/pipeline.h @@ -279,6 +279,7 @@ public: void enableLightsStatic(); void enableLightsDynamic(); void enableLightsAvatar(); + void enableLightsPreview(); void enableLightsAvatarEdit(const LLColor4& color); void enableLightsFullbright(const LLColor4& color); void disableLights(); -- cgit v1.2.3 From 88ed5581d5b5df150d4adac3e1fe53fdef84c959 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Tue, 30 Nov 2010 00:26:02 -0600 Subject: Far focal plane blur attenuation tweak. --- indra/newview/app_settings/shaders/class1/deferred/postDeferredF.glsl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/app_settings/shaders/class1/deferred/postDeferredF.glsl b/indra/newview/app_settings/shaders/class1/deferred/postDeferredF.glsl index 4503dc9003..a379910101 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/postDeferredF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/postDeferredF.glsl @@ -76,7 +76,7 @@ void main() float fd = far_focal_distance; float sc = far_focal_distance - depth[0]; - sc /= near_focal_distance-far_focal_distance; + sc /= -far_focal_distance; sc = min(sc, 8.0); -- cgit v1.2.3