summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorDave Parks <davep@lindenlab.com>2010-11-30 00:26:17 -0600
committerDave Parks <davep@lindenlab.com>2010-11-30 00:26:17 -0600
commitd5227c6dd155081acb5c3ed0d333f0918ba886ca (patch)
tree2249a7b1dfd1db40d4142fd93a861a158df6186b /indra
parentb6dc4a4bf18e79ac4b67a5bac48aab15ef27f50a (diff)
parent88ed5581d5b5df150d4adac3e1fe53fdef84c959 (diff)
merge
Diffstat (limited to 'indra')
-rwxr-xr-xindra/newview/app_settings/settings.xml172
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/postDeferredF.glsl8
-rw-r--r--indra/newview/llfloatermodelpreview.cpp4
-rwxr-xr-xindra/newview/llmeshrepository.cpp4
-rw-r--r--indra/newview/pipeline.cpp55
-rw-r--r--indra/newview/pipeline.h1
6 files changed, 235 insertions, 9 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 @@
<key>Value</key>
<integer>13</integer>
</map>
- <key>PrimMediaMasterEnabled</key>
+
+ <key>PreviewAmbientColor</key>
+ <map>
+ <key>Comment</key>
+ <string>Ambient color of preview render.</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>Color4</string>
+ <key>Value</key>
+ <array>
+ <real>0.0</real>
+ <real>0.0</real>
+ <real>0.0</real>
+ <real>1.0</real>
+ </array>
+ </map>
+
+
+ <key>PreviewDiffuse0</key>
+ <map>
+ <key>Comment</key>
+ <string>Diffise color of preview light 0.</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>Color4</string>
+ <key>Value</key>
+ <array>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ </array>
+ </map>
+
+ <key>PreviewDiffuse1</key>
+ <map>
+ <key>Comment</key>
+ <string>Diffise color of preview light 1.</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>Color4</string>
+ <key>Value</key>
+ <array>
+ <real>0.25</real>
+ <real>0.25</real>
+ <real>0.25</real>
+ <real>1.0</real>
+ </array>
+ </map>
+
+ <key>PreviewDiffuse2</key>
+ <map>
+ <key>Comment</key>
+ <string>Diffise color of preview light 2.</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>Color4</string>
+ <key>Value</key>
+ <array>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ </array>
+ </map>
+
+ <key>PreviewSpecular0</key>
+ <map>
+ <key>Comment</key>
+ <string>Diffise color of preview light 0.</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>Color4</string>
+ <key>Value</key>
+ <array>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ </array>
+ </map>
+
+ <key>PreviewSpecular1</key>
+ <map>
+ <key>Comment</key>
+ <string>Diffise color of preview light 1.</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>Color4</string>
+ <key>Value</key>
+ <array>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ </array>
+ </map>
+
+ <key>PreviewSpecular2</key>
+ <map>
+ <key>Comment</key>
+ <string>Diffise color of preview light 2.</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>Color4</string>
+ <key>Value</key>
+ <array>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ </array>
+ </map>
+
+
+ <key>PreviewDirection0</key>
+ <map>
+ <key>Comment</key>
+ <string>Direction of light 0 for preview render.</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>Vector3</string>
+ <key>Value</key>
+ <array>
+ <real>-0.35</real>
+ <real>1</real>
+ <real>0.7</real>
+ </array>
+ </map>
+
+ <key>PreviewDirection1</key>
+ <map>
+ <key>Comment</key>
+ <string>Direction of light 1 for preview render.</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>Vector3</string>
+ <key>Value</key>
+ <array>
+ <real>-1</real>
+ <real>-1</real>
+ <real>-0.6</real>
+ </array>
+ </map>
+
+ <key>PreviewDirection2</key>
+ <map>
+ <key>Comment</key>
+ <string>Direction of light 2 for preview render.</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>Vector3</string>
+ <key>Value</key>
+ <array>
+ <real>-0.2</real>
+ <real>-0.8</real>
+ <real>-0.2</real>
+ </array>
+ </map>
+
+ <key>PrimMediaMasterEnabled</key>
<map>
<key>Comment</key>
<string>Whether or not Media on a Prim is enabled.</string>
diff --git a/indra/newview/app_settings/shaders/class1/deferred/postDeferredF.glsl b/indra/newview/app_settings/shaders/class1/deferred/postDeferredF.glsl
index eec44d9d42..a379910101 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 /= -far_focal_distance;
- //fd = depth[0]*0.5;
-
+ sc = min(sc, 8.0);
+
while (sc > 1.0)
{
do_aa = false;
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/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp
index 17be8586b5..6d117c8c39 100755
--- a/indra/newview/llmeshrepository.cpp
+++ b/indra/newview/llmeshrepository.cpp
@@ -787,7 +787,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));
}
}
@@ -859,7 +859,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));
}
}
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();