diff options
Diffstat (limited to 'indra/newview')
-rwxr-xr-x | indra/newview/app_settings/settings.xml | 172 | ||||
-rw-r--r-- | indra/newview/llfloatermodelpreview.cpp | 4 | ||||
-rw-r--r-- | indra/newview/pipeline.cpp | 55 | ||||
-rw-r--r-- | 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 @@ <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/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(); |