diff options
author | Todd Stinson <stinson@lindenlab.com> | 2011-12-13 11:15:18 -0800 |
---|---|---|
committer | Todd Stinson <stinson@lindenlab.com> | 2011-12-13 11:15:18 -0800 |
commit | 9d1db4f19ae7ca044e47d0fe4e605e14882351c5 (patch) | |
tree | 2d499d53b60b2486f1e6666f8b9fe2063f984d22 /indra/newview | |
parent | 817c97c2f836948f210599a6f67e36a411b22c21 (diff) | |
parent | dbc91a7fac9513bdd879c5c2dc82208e08eaad2d (diff) |
Pull and merge from https://bitbucket.org/lindenlab/viewer-development.
Diffstat (limited to 'indra/newview')
1072 files changed, 26728 insertions, 30100 deletions
diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index c1fe1729e5..ca6617a5ed 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -210,7 +210,6 @@ set(viewer_SOURCE_FILES llfloaterland.cpp llfloaterlandholdings.cpp llfloatermap.cpp - llfloatermediabrowser.cpp llfloatermediasettings.cpp llfloatermemleak.cpp llfloatermodelpreview.cpp @@ -222,7 +221,6 @@ set(viewer_SOURCE_FILES llfloateropenobject.cpp llfloaterpay.cpp llfloaterperms.cpp - llfloaterpostcard.cpp llfloaterpostprocess.cpp llfloaterpreference.cpp llfloaterproperties.cpp @@ -244,10 +242,12 @@ set(viewer_SOURCE_FILES llfloatertopobjects.cpp llfloatertos.cpp llfloatertoybox.cpp + llfloatertranslationsettings.cpp llfloateruipreview.cpp llfloaterurlentry.cpp llfloatervoiceeffect.cpp llfloaterwebcontent.cpp + llfloaterwebprofile.cpp llfloaterwhitelistentry.cpp llfloaterwindowsize.cpp llfloaterworldmap.cpp @@ -320,7 +320,6 @@ set(viewer_SOURCE_FILES llmediactrl.cpp llmediadataclient.cpp llmemoryview.cpp - llmenucommands.cpp llmeshrepository.cpp llmimetypes.cpp llmorphview.cpp @@ -398,7 +397,12 @@ set(viewer_SOURCE_FILES llpanelplacestab.cpp llpanelprimmediacontrols.cpp llpanelprofile.cpp - llpanelprofileview.cpp + llpanelsnapshot.cpp + llpanelsnapshotinventory.cpp + llpanelsnapshotlocal.cpp + llpanelsnapshotoptions.cpp + llpanelsnapshotpostcard.cpp + llpanelsnapshotprofile.cpp llpanelteleporthistory.cpp llpaneltiptoast.cpp llpanelvoiceeffect.cpp @@ -417,6 +421,7 @@ set(viewer_SOURCE_FILES llpopupview.cpp llpolymesh.cpp llpolymorph.cpp + llpostcard.cpp llpreview.cpp llpreviewanim.cpp llpreviewgesture.cpp @@ -543,9 +548,6 @@ set(viewer_SOURCE_FILES llviewerjoint.cpp llviewerjointattachment.cpp llviewerjointmesh.cpp - llviewerjointmesh_sse.cpp - llviewerjointmesh_sse2.cpp - llviewerjointmesh_vec.cpp llviewerjoystick.cpp llviewerkeyboard.cpp llviewerlayer.cpp @@ -593,7 +595,6 @@ set(viewer_SOURCE_FILES llvopartgroup.cpp llvosky.cpp llvosurfacepatch.cpp - llvotextbubble.cpp llvotree.cpp llvovolume.cpp llvowater.cpp @@ -606,6 +607,7 @@ set(viewer_SOURCE_FILES llwearablelist.cpp llwearabletype.cpp llweb.cpp + llwebprofile.cpp llwebsharing.cpp llwind.cpp llwindowlistener.cpp @@ -628,20 +630,6 @@ set(viewer_SOURCE_FILES set(VIEWER_BINARY_NAME "secondlife-bin" CACHE STRING "The name of the viewer executable to create.") -if (LINUX) - # We can't set these flags for Darwin, because they get passed to - # the PPC compiler. Ugh. - - set_source_files_properties( - llviewerjointmesh_sse.cpp - PROPERTIES COMPILE_FLAGS "-msse -mfpmath=sse" - ) - set_source_files_properties( - llviewerjointmesh_sse2.cpp - PROPERTIES COMPILE_FLAGS "-msse2 -mfpmath=sse" - ) -endif (LINUX) - set(viewer_HEADER_FILES CMakeLists.txt ViewerInstall.cmake @@ -777,7 +765,6 @@ set(viewer_HEADER_FILES llfloaterland.h llfloaterlandholdings.h llfloatermap.h - llfloatermediabrowser.h llfloatermediasettings.h llfloatermemleak.h llfloatermodelpreview.h @@ -789,7 +776,6 @@ set(viewer_HEADER_FILES llfloateropenobject.h llfloaterpay.h llfloaterperms.h - llfloaterpostcard.h llfloaterpostprocess.h llfloaterpreference.h llfloaterproperties.h @@ -811,10 +797,12 @@ set(viewer_HEADER_FILES llfloatertopobjects.h llfloatertos.h llfloatertoybox.h + llfloatertranslationsettings.h llfloateruipreview.h llfloaterurlentry.h llfloatervoiceeffect.h llfloaterwebcontent.h + llfloaterwebprofile.h llfloaterwhitelistentry.h llfloaterwindowsize.h llfloaterworldmap.h @@ -887,7 +875,6 @@ set(viewer_HEADER_FILES llmediactrl.h llmediadataclient.h llmemoryview.h - llmenucommands.h llmeshrepository.h llmimetypes.h llmorphview.h @@ -959,7 +946,7 @@ set(viewer_HEADER_FILES llpanelplacestab.h llpanelprimmediacontrols.h llpanelprofile.h - llpanelprofileview.h + llpanelsnapshot.h llpanelteleporthistory.h llpaneltiptoast.h llpanelvoicedevicesettings.h @@ -978,6 +965,7 @@ set(viewer_HEADER_FILES llpolymesh.h llpolymorph.h llpopupview.h + llpostcard.h llpreview.h llpreviewanim.h llpreviewgesture.h @@ -1153,7 +1141,6 @@ set(viewer_HEADER_FILES llvopartgroup.h llvosky.h llvosurfacepatch.h - llvotextbubble.h llvotree.h llvotreenew.h llvovolume.h @@ -1167,6 +1154,7 @@ set(viewer_HEADER_FILES llwearablelist.h llwearabletype.h llweb.h + llwebprofile.h llwebsharing.h llwind.h llwindowlistener.h @@ -1994,12 +1982,19 @@ if (LL_TESTS) llmediadataclient.cpp lllogininstance.cpp llremoteparcelrequest.cpp + lltranslate.cpp llviewerhelputil.cpp llversioninfo.cpp llworldmap.cpp llworldmipmap.cpp ) + set_source_files_properties( + lltranslate.cpp + PROPERTIES + LL_TEST_ADDITIONAL_LIBRARIES "${JSONCPP_LIBRARIES}" + ) + ################################################## # DISABLING PRECOMPILED HEADERS USAGE FOR TESTS ################################################## diff --git a/indra/newview/app_settings/keywords.ini b/indra/newview/app_settings/keywords.ini index b5f105439c..82b43432eb 100644 --- a/indra/newview/app_settings/keywords.ini +++ b/indra/newview/app_settings/keywords.ini @@ -603,9 +603,11 @@ return Leave current function or event handler # Comment [one_sided_delimiter .8, .3, .15] // Comment:Non-functional commentary or disabled code +[two_sided_delimiter .8, .3, .15] +/* */ Comment:Non-functional commentary or disabled code # String literals -[two_sided_delimiter 0, .2, 0] +[double_quotation_marks 0, .2, 0] " String literal #functions are supplied by the program now diff --git a/indra/newview/app_settings/logcontrol.xml b/indra/newview/app_settings/logcontrol.xml index ae72dee900..a76eb3cd37 100644 --- a/indra/newview/app_settings/logcontrol.xml +++ b/indra/newview/app_settings/logcontrol.xml @@ -43,7 +43,7 @@ <key>tags</key> <array> <!-- sample entry for debugging a specific item --> -<!-- <string>Voice</string> --> +<!-- <string>Voice</string> --> </array> </map> </array> diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 3c53a9d44c..aa8ad53a3d 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -1392,6 +1392,18 @@ <real>0.5</real> </map> + <key>CameraMaxCoF</key> + <map> + <key>Comment</key> + <string>Maximum camera circle of confusion for DoF effect</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>F32</string> + <key>Value</key> + <real>10.0</real> + </map> + <key>CameraFNumber</key> <map> <key>Comment</key> @@ -1550,17 +1562,6 @@ <key>Value</key> <integer>1</integer> </map> - <key>ChatVisible</key> - <map> - <key>Comment</key> - <string>Chat bar is visible</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <integer>1</integer> - </map> <key>ChatWindow</key> <map> <key>Comment</key> @@ -1605,17 +1606,6 @@ <key>Value</key> <integer>0</integer> </map> - <key>CloseSnapshotOnKeep</key> - <map> - <key>Comment</key> - <string>Close snapshot window after saving snapshot</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <integer>1</integer> - </map> <key>CmdLineDisableVoice</key> <map> <key>Comment</key> @@ -1904,6 +1894,17 @@ <key>Value</key> <integer>1</integer> </map> + <key>DebugHideEmptySystemFolders</key> + <map> + <key>Comment</key> + <string>Hide empty system folders when on</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>1</integer> + </map> <key>DebugInventoryFilters</key> <map> <key>Comment</key> @@ -2630,17 +2631,6 @@ <key>Value</key> <integer>-1</integer> </map> - <key>DebugToolbarFUI</key> - <map> - <key>Comment</key> - <string>Turn on the FUI Toolbars</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <integer>1</integer> - </map> <key>DebugViews</key> <map> <key>Comment</key> @@ -3137,17 +3127,6 @@ <key>Value</key> <integer>1</integer> </map> - <key>EnableRippleWater</key> - <map> - <key>Comment</key> - <string>Whether to use ripple water shader or not</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <integer>1</integer> - </map> <key>EnableTextureAtlas</key> <map> <key>Comment</key> @@ -4257,7 +4236,7 @@ <key>Type</key> <string>Boolean</string> <key>Value</key> - <integer>1</integer> + <integer>0</integer> </map> <key>InventoryDisplayOutbox</key> <map> @@ -4667,6 +4646,17 @@ <string>0.0.0</string> </map> + <key>LastSnapshotToProfileHeight</key> + <map> + <key>Comment</key> + <string>The height of the last profile snapshot, in px</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>S32</string> + <key>Value</key> + <integer>768</integer> + </map> <key>LastSnapshotToEmailHeight</key> <map> <key>Comment</key> @@ -4678,6 +4668,17 @@ <key>Value</key> <integer>768</integer> </map> + <key>LastSnapshotToProfileWidth</key> + <map> + <key>Comment</key> + <string>The width of the last profile snapshot, in px</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>S32</string> + <key>Value</key> + <integer>1024</integer> + </map> <key>LastSnapshotToEmailWidth</key> <map> <key>Comment</key> @@ -4733,17 +4734,6 @@ <key>Value</key> <integer>512</integer> </map> - <key>LastSnapshotType</key> - <map> - <key>Comment</key> - <string>Select this as next type of snapshot to take (0 = postcard, 1 = texture, 2 = local image)</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>S32</string> - <key>Value</key> - <integer>0</integer> - </map> <key>LeftClickShowMenu</key> <map> <key>Comment</key> @@ -7807,7 +7797,7 @@ <key>Type</key> <string>U32</string> <key>Value</key> - <integer>6</integer> + <integer>16</integer> </map> <key>RenderDebugTextureBind</key> <map> @@ -7868,162 +7858,6 @@ <integer>0</integer> </map> - <key>RenderAnimateTrees</key> - <map> - <key>Comment</key> - <string>Use GL matrix ops to animate tree branches.</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <integer>0</integer> - </map> - - <key>RenderGIRange</key> - <map> - <key>Comment</key> - <string>Distance to cut off GI effect.</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>F32</string> - <key>Value</key> - <real>96</real> - </map> - - <key>RenderGILuminance</key> - <map> - <key>Comment</key> - <string>Luminance factor of global illumination contribution.</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>F32</string> - <key>Value</key> - <real>0.075</real> - </map> - - <key>RenderGIBrightness</key> - <map> - <key>Comment</key> - <string>Brightness factor of global illumination contribution.</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>F32</string> - <key>Value</key> - <real>0.3</real> - </map> - - <key>RenderGINoise</key> - <map> - <key>Comment</key> - <string>Noise of position sampling for GI photon mapping.</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>F32</string> - <key>Value</key> - <real>0.7</real> - </map> - - <key>RenderGIAttenuation</key> - <map> - <key>Comment</key> - <string>Distance attenuation factor for indirect lighting.</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>F32</string> - <key>Value</key> - <real>0.1</real> - </map> - - <key>RenderGIBlurBrightness</key> - <map> - <key>Comment</key> - <string>Brightness factor of global illumination blur effect.</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>F32</string> - <key>Value</key> - <real>1.025</real> - </map> - - <key>RenderGIBlurEdgeWeight</key> - <map> - <key>Comment</key> - <string>Edge weight for GI soften filter (sharpness).</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>F32</string> - <key>Value</key> - <real>0.8</real> - </map> - - <key>RenderGIBlurIncrement</key> - <map> - <key>Comment</key> - <string>Increment of scale for each pass of global illumination blur effect.</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>F32</string> - <key>Value</key> - <real>0.8</real> - </map> - - <key>RenderLuminanceScale</key> - <map> - <key>Comment</key> - <string>Luminance value scalar for darkening effect.</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>F32</string> - <key>Value</key> - <real>1.0</real> - </map> - - <key>RenderSunLuminanceScale</key> - <map> - <key>Comment</key> - <string>Sun Luminance value scalar for darkening effect.</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>F32</string> - <key>Value</key> - <real>1.0</real> - </map> - - <key>RenderSunLuminanceOffset</key> - <map> - <key>Comment</key> - <string>Sun Luminance value offset for darkening effect.</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>F32</string> - <key>Value</key> - <real>0</real> - </map> - - <key>RenderLuminanceDetail</key> - <map> - <key>Comment</key> - <string>Mipmap level to use for luminance</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>F32</string> - <key>Value</key> - <real>16.0</real> - </map> - <key>RenderMinimumLODTriangleCount</key> <map> <key>Comment</key> @@ -8160,7 +7994,19 @@ <key>Value</key> <integer>0</integer> </map> - + + <key>CameraDoFResScale</key> + <map> + <key>Comment</key> + <string>Amount to scale down depth of field resolution. Valid range is 0.25 (quarter res) to 1.0 (full res)</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>F32</string> + <key>Value</key> + <real>0.7</real> + </map> + <key>RenderSpotLightsInNondeferred</key> <map> <key>Comment</key> @@ -8344,18 +8190,6 @@ <integer>0</integer> </map> - <key>RenderDeferredGI</key> - <map> - <key>Comment</key> - <string>Enable GI in deferred renderer.</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <integer>0</integer> - </map> - <key>RenderDeferredSun</key> <map> <key>Comment</key> @@ -8499,92 +8333,6 @@ <real>0</real> </map> - <key>RenderGIAmbiance</key> - <map> - <key>Comment</key> - <string>Ambiance factor of global illumination contribution.</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>F32</string> - <key>Value</key> - <real>0.5</real> - </map> - - <key>RenderGIMinRenderSize</key> - <map> - <key>Comment</key> - <string>Minimum size of objects to put into GI source map.</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>F32</string> - <key>Value</key> - <real>0.5</real> - </map> - - <key>RenderGIBlurColorCurve</key> - <map> - <key>Comment</key> - <string>Color curve for GI softening kernel</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Vector3</string> - <key>Value</key> - <array> - <real>1.0</real> - <real>0.6</real> - <real>0.02</real> - </array> - </map> - - <key>RenderGIBlurPasses</key> - <map> - <key>Comment</key> - <string>Scale of GI softening kernel.</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>U32</string> - <key>Value</key> - <real>4</real> - </map> - - <key>RenderGIBlurSize</key> - <map> - <key>Comment</key> - <string>Scale of GI softening kernel.</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>F32</string> - <key>Value</key> - <real>4.0</real> - </map> - <key>RenderGIBlurSamples</key> - <map> - <key>Comment</key> - <string>Number of samples to take for each pass of GI blur (value range 1-16). Actual number of samples is value * 2 - 1.</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>U32</string> - <key>Value</key> - <real>16</real> - </map> - <key>RenderGIBlurDistFactor</key> - <map> - <key>Comment</key> - <string>Distance scaler for GI blur.</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>F32</string> - <key>Value</key> - <real>0.0</real> - </map> - <key>RenderDynamicLOD</key> <map> <key>Comment</key> @@ -8627,7 +8375,7 @@ <key>Type</key> <string>Boolean</string> <key>Value</key> - <integer>0</integer> + <integer>1</integer> </map> <key>RenderAutoMaskAlphaDeferred</key> <map> @@ -8684,6 +8432,17 @@ <key>Value</key> <real>1.0</real> </map> + <key>RenderGLCoreProfile</key> + <map> + <key>Comment</key> + <string>Don't use a compatibility profile OpenGL context. Requires restart. Basic shaders MUST be enabled.</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>0</integer> + </map> <key>RenderGlow</key> <map> <key>Comment</key> @@ -9287,6 +9046,17 @@ <key>Value</key> <integer>1</integer> </map> + <key>RenderUseVAO</key> + <map> + <key>Comment</key> + <string>Use GL Vertex Array Objects</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>0</integer> + </map> <key>RenderVBOMappingDisable</key> <map> <key>Comment</key> @@ -9296,7 +9066,7 @@ <key>Type</key> <string>Boolean</string> <key>Value</key> - <integer>0</integer> + <integer>1</integer> </map> <key>RenderUseStreamVBO</key> <map> @@ -10597,28 +10367,6 @@ <key>Value</key> <integer>0</integer> </map> - <key>SnapshotLocalLastResolution</key> - <map> - <key>Comment</key> - <string>Take next local snapshot at this resolution</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>S32</string> - <key>Value</key> - <integer>0</integer> - </map> - <key>SnapshotPostcardLastResolution</key> - <map> - <key>Comment</key> - <string>Take next postcard snapshot at this resolution</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>S32</string> - <key>Value</key> - <integer>0</integer> - </map> <key>SnapshotQuality</key> <map> <key>Comment</key> @@ -10652,17 +10400,6 @@ <key>Value</key> <string>http://photos.apps.staging.avatarsunited.com/viewer_config</string> </map> - <key>SnapshotTextureLastResolution</key> - <map> - <key>Comment</key> - <string>Take next texture snapshot at this resolution</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>S32</string> - <key>Value</key> - <integer>0</integer> - </map> <key>SpeedTest</key> <map> <key>Comment</key> @@ -11014,6 +10751,39 @@ <key>Value</key> <integer>0</integer> </map> + <key>TranslationService</key> + <map> + <key>Comment</key> + <string>Translation API to use. (google|bing)</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>String</string> + <key>Value</key> + <string>bing</string> + </map> + <key>GoogleTranslateAPIKey</key> + <map> + <key>Comment</key> + <string>Google Translate API key</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>String</string> + <key>Value</key> + <string></string> + </map> + <key>BingTranslateAPIKey</key> + <map> + <key>Comment</key> + <string>Bing AppID to use with the Microsoft Translator API</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>String</string> + <key>Value</key> + <string></string> + </map> <key>TutorialURL</key> <map> <key>Comment</key> @@ -12244,7 +12014,7 @@ <key>Type</key> <string>Boolean</string> <key>Value</key> - <integer>1</integer> + <boolean>1</boolean> </map> <key>UseFreezeFrame</key> <map> @@ -12388,50 +12158,6 @@ <key>Value</key> <integer>1</integer> </map> - <key>VectorizeEnable</key> - <map> - <key>Comment</key> - <string>Enable general vector operations and data alignment.</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <integer>0</integer> - </map> - <key>VectorizePerfTest</key> - <map> - <key>Comment</key> - <string>Test SSE/vectorization performance and choose fastest version.</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <integer>1</integer> - </map> - <key>VectorizeProcessor</key> - <map> - <key>Comment</key> - <string>0=Compiler Default, 1=SSE, 2=SSE2, autodetected</string> - <key>Persist</key> - <integer>0</integer> - <key>Type</key> - <string>U32</string> - <key>Value</key> - <integer>0</integer> - </map> - <key>VectorizeSkin</key> - <map> - <key>Comment</key> - <string>Enable vector operations for avatar skinning.</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <integer>1</integer> - </map> <key>VelocityInterpolate</key> <map> <key>Comment</key> @@ -12883,10 +12609,10 @@ <key>Value</key> <integer>1</integer> </map> - <key>WindowFullScreen</key> + <key>FullScreen</key> <map> <key>Comment</key> - <string>SL viewer window full screen</string> + <string>run a fullscreen session</string> <key>Persist</key> <integer>1</integer> <key>Type</key> @@ -12894,6 +12620,17 @@ <key>Value</key> <integer>0</integer> </map> + <key>MinWindowHeight</key> + <map> + <key>Comment</key> + <string>SL viewer minimum window height in pixels</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>U32</string> + <key>Value</key> + <integer>0</integer> + </map> <key>WindowHeight</key> <map> <key>Comment</key> @@ -12901,7 +12638,7 @@ <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>S32</string> + <string>U32</string> <key>Value</key> <integer>738</integer> </map> @@ -12916,6 +12653,17 @@ <key>Value</key> <integer>0</integer> </map> + <key>MinWindowWidth</key> + <map> + <key>Comment</key> + <string>SL viewer minimum window width in pixels</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>U32</string> + <key>Value</key> + <integer>0</integer> + </map> <key>WindowWidth</key> <map> <key>Comment</key> @@ -12923,7 +12671,7 @@ <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>S32</string> + <string>U32</string> <key>Value</key> <integer>1024</integer> </map> @@ -13350,7 +13098,7 @@ <key>Comment</key> <string>Settings that are a applied per session (not saved).</string> <key>Persist</key> - <integer>1</integer> + <integer>0</integer> <key>Type</key> <string>String</string> <key>Value</key> @@ -13361,7 +13109,7 @@ <key>Comment</key> <string>User settings that are a applied per session (not saved).</string> <key>Persist</key> - <integer>1</integer> + <integer>0</integer> <key>Type</key> <string>String</string> <key>Value</key> @@ -13620,10 +13368,10 @@ <key>Value</key> <integer>1</integer> </map> - <key>WebProfileRect</key> + <key>WebProfileFloaterRect</key> <map> <key>Comment</key> - <string>Web profile dimensions</string> + <string>Web profile floater dimensions</string> <key>Persist</key> <integer>1</integer> <key>Type</key> @@ -13631,8 +13379,8 @@ <key>Value</key> <array> <integer>0</integer> - <integer>650</integer> - <integer>490</integer> + <integer>680</integer> + <integer>485</integer> <integer>0</integer> </array> </map> diff --git a/indra/newview/app_settings/settings_per_account.xml b/indra/newview/app_settings/settings_per_account.xml index d8295ddb87..8cdd8ed838 100644 --- a/indra/newview/app_settings/settings_per_account.xml +++ b/indra/newview/app_settings/settings_per_account.xml @@ -33,6 +33,17 @@ <key>Value</key> <string /> </map> + <key>DisplayDestinationsOnInitialRun</key> + <map> + <key>Comment</key> + <string>Display the destinations guide when a user first launches Second Life.</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>1</integer> + </map> <key>LastInventoryInboxActivity</key> <map> <key>Comment</key> diff --git a/indra/newview/app_settings/shaders/class1/avatar/avatarSkinV.glsl b/indra/newview/app_settings/shaders/class1/avatar/avatarSkinV.glsl index c72da8d758..bc63d07d72 100644 --- a/indra/newview/app_settings/shaders/class1/avatar/avatarSkinV.glsl +++ b/indra/newview/app_settings/shaders/class1/avatar/avatarSkinV.glsl @@ -24,8 +24,7 @@ */ - -attribute vec4 weight; //1 +ATTRIBUTE vec4 weight; uniform vec4 matrixPalette[45]; diff --git a/indra/newview/app_settings/shaders/class1/avatar/avatarV.glsl b/indra/newview/app_settings/shaders/class1/avatar/avatarV.glsl index c2fe60ddaf..19203ab670 100644 --- a/indra/newview/app_settings/shaders/class1/avatar/avatarV.glsl +++ b/indra/newview/app_settings/shaders/class1/avatar/avatarV.glsl @@ -22,8 +22,17 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - +uniform mat4 projection_matrix; + +ATTRIBUTE vec3 position; +ATTRIBUTE vec3 normal; +ATTRIBUTE vec2 texcoord0; + +VARYING vec4 vertex_color; +VARYING vec2 vary_texcoord0; + +uniform vec4 color; vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol); mat4 getSkinnedTransform(); @@ -31,32 +40,30 @@ void calcAtmospherics(vec3 inPositionEye); void main() { - gl_TexCoord[0] = gl_MultiTexCoord0; + vary_texcoord0 = texcoord0; vec4 pos; vec3 norm; + vec4 pos_in = vec4(position.xyz, 1.0); + mat4 trans = getSkinnedTransform(); - pos.x = dot(trans[0], gl_Vertex); - pos.y = dot(trans[1], gl_Vertex); - pos.z = dot(trans[2], gl_Vertex); + pos.x = dot(trans[0], pos_in); + pos.y = dot(trans[1], pos_in); + pos.z = dot(trans[2], pos_in); pos.w = 1.0; - norm.x = dot(trans[0].xyz, gl_Normal); - norm.y = dot(trans[1].xyz, gl_Normal); - norm.z = dot(trans[2].xyz, gl_Normal); + norm.x = dot(trans[0].xyz, normal); + norm.y = dot(trans[1].xyz, normal); + norm.z = dot(trans[2].xyz, normal); norm = normalize(norm); - gl_Position = gl_ProjectionMatrix * pos; - - //gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + gl_Position = projection_matrix * pos; - gl_FogFragCoord = length(pos.xyz); - calcAtmospherics(pos.xyz); - vec4 color = calcLighting(pos.xyz, norm, gl_Color, vec4(0,0,0,0)); - gl_FrontColor = color; + vec4 col = calcLighting(pos.xyz, norm, color, vec4(0,0,0,0)); + vertex_color = col; } diff --git a/indra/newview/app_settings/shaders/class1/avatar/eyeballV.glsl b/indra/newview/app_settings/shaders/class1/avatar/eyeballV.glsl index 1a0866be0a..82db15c3ae 100644 --- a/indra/newview/app_settings/shaders/class1/avatar/eyeballV.glsl +++ b/indra/newview/app_settings/shaders/class1/avatar/eyeballV.glsl @@ -22,8 +22,19 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - +uniform mat3 normal_matrix; +uniform mat4 texture_matrix0; +uniform mat4 modelview_matrix; +uniform mat4 modelview_projection_matrix; + +ATTRIBUTE vec3 position; +ATTRIBUTE vec4 diffuse_color; +ATTRIBUTE vec3 normal; +ATTRIBUTE vec2 texcoord0; + +VARYING vec4 vertex_color; +VARYING vec2 vary_texcoord0; vec4 calcLightingSpecular(vec3 pos, vec3 norm, vec4 color, inout vec4 specularColor, vec4 baseCol); void calcAtmospherics(vec3 inPositionEye); @@ -31,17 +42,18 @@ void calcAtmospherics(vec3 inPositionEye); void main() { //transform vertex - gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; - gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0; + vec3 pos = (modelview_matrix * vec4(position.xyz, 1.0)).xyz; + gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0); + vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy; + - vec3 pos = (gl_ModelViewMatrix * gl_Vertex).xyz; - vec3 norm = normalize(gl_NormalMatrix * gl_Normal); + vec3 norm = normalize(normal_matrix * normal); calcAtmospherics(pos.xyz); vec4 specular = vec4(1.0); - vec4 color = calcLightingSpecular(pos, norm, gl_Color, specular, vec4(0.0)); - gl_FrontColor = color; + vec4 color = calcLightingSpecular(pos, norm, diffuse_color, specular, vec4(0.0)); + vertex_color = color; } diff --git a/indra/newview/app_settings/shaders/class1/avatar/objectSkinV.glsl b/indra/newview/app_settings/shaders/class1/avatar/objectSkinV.glsl index 09688b2be2..43ed41a205 100644 --- a/indra/newview/app_settings/shaders/class1/avatar/objectSkinV.glsl +++ b/indra/newview/app_settings/shaders/class1/avatar/objectSkinV.glsl @@ -24,7 +24,7 @@ -attribute vec4 object_weight; +ATTRIBUTE vec4 weight4; uniform mat4 matrixPalette[32]; @@ -32,8 +32,8 @@ mat4 getObjectSkinnedTransform() { int i; - vec4 w = fract(object_weight); - vec4 index = floor(object_weight); + vec4 w = fract(weight4); + vec4 index = floor(weight4); float scale = 1.0/(w.x+w.y+w.z+w.w); w *= scale; diff --git a/indra/newview/app_settings/shaders/class1/avatar/pickAvatarF.glsl b/indra/newview/app_settings/shaders/class1/avatar/pickAvatarF.glsl index 374808c091..3e4d438ed3 100644 --- a/indra/newview/app_settings/shaders/class1/avatar/pickAvatarF.glsl +++ b/indra/newview/app_settings/shaders/class1/avatar/pickAvatarF.glsl @@ -22,12 +22,17 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - +#ifdef DEFINE_GL_FRAGCOLOR +out vec4 gl_FragColor; +#endif + +VARYING vec4 vertex_color; +VARYING vec2 vary_texcoord0; uniform sampler2D diffuseMap; void main() { - gl_FragColor = vec4(gl_Color.rgb, texture2D(diffuseMap, gl_TexCoord[0].xy).a); + gl_FragColor = vec4(vertex_color.rgb, texture2D(diffuseMap, vary_texcoord0.xy).a); } diff --git a/indra/newview/app_settings/shaders/class1/avatar/pickAvatarV.glsl b/indra/newview/app_settings/shaders/class1/avatar/pickAvatarV.glsl index e25d84a594..78b5328c9a 100644 --- a/indra/newview/app_settings/shaders/class1/avatar/pickAvatarV.glsl +++ b/indra/newview/app_settings/shaders/class1/avatar/pickAvatarV.glsl @@ -22,22 +22,29 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - +uniform mat4 projection_matrix; + +ATTRIBUTE vec3 position; +ATTRIBUTE vec4 diffuse_color; +ATTRIBUTE vec2 texcoord0; + +VARYING vec4 vertex_color; +VARYING vec2 vary_texcoord0; mat4 getSkinnedTransform(); void main() { vec4 pos; - + vec4 pos_in = vec4(position, 1.0); mat4 trans = getSkinnedTransform(); - pos.x = dot(trans[0], gl_Vertex); - pos.y = dot(trans[1], gl_Vertex); - pos.z = dot(trans[2], gl_Vertex); + pos.x = dot(trans[0], pos_in); + pos.y = dot(trans[1], pos_in); + pos.z = dot(trans[2], pos_in); pos.w = 1.0; - gl_FrontColor = gl_Color; - gl_TexCoord[0] = gl_MultiTexCoord0; - gl_Position = gl_ProjectionMatrix * pos; + vertex_color = diffuse_color; + vary_texcoord0 = texcoord0; + gl_Position = projection_matrix * pos; } diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl index 19de0c0b39..c012efa056 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl @@ -23,10 +23,12 @@ * $/LicenseInfo$ */ - - #extension GL_ARB_texture_rectangle : enable +#ifdef DEFINE_GL_FRAGCOLOR +out vec4 gl_FragColor; +#endif + uniform sampler2DRect depthMap; vec4 diffuseLookup(vec2 texcoord); @@ -38,26 +40,16 @@ uniform vec2 screen_res; vec3 atmosLighting(vec3 light); vec3 scaleSoftClip(vec3 light); -varying vec3 vary_ambient; -varying vec3 vary_directional; -varying vec3 vary_fragcoord; -varying vec3 vary_position; -varying vec3 vary_pointlight_col; +VARYING vec3 vary_ambient; +VARYING vec3 vary_directional; +VARYING vec3 vary_fragcoord; +VARYING vec3 vary_position; +VARYING vec3 vary_pointlight_col; -uniform mat4 inv_proj; +VARYING vec4 vertex_color; +VARYING vec2 vary_texcoord0; -vec4 getPosition(vec2 pos_screen) -{ - float depth = texture2DRect(depthMap, pos_screen.xy).a; - vec2 sc = pos_screen.xy*2.0; - sc /= screen_res; - sc -= vec2(1.0,1.0); - vec4 ndc = vec4(sc.x, sc.y, 2.0*depth-1.0, 1.0); - vec4 pos = inv_proj * ndc; - pos /= pos.w; - pos.w = 1.0; - return pos; -} +uniform mat4 inv_proj; void main() { @@ -66,9 +58,9 @@ void main() vec4 pos = vec4(vary_position, 1.0); - vec4 diff= diffuseLookup(gl_TexCoord[0].xy); + vec4 diff= diffuseLookup(vary_texcoord0.xy); - vec4 col = vec4(vary_ambient + vary_directional.rgb, gl_Color.a); + vec4 col = vec4(vary_ambient + vary_directional.rgb, vertex_color.a); vec4 color = diff * col; color.rgb = atmosLighting(color.rgb); @@ -78,8 +70,5 @@ void main() color.rgb += diff.rgb * vary_pointlight_col.rgb; gl_FragColor = color; - //gl_FragColor = vec4(1,0,1,1); - //gl_FragColor = vec4(1,0,1,1)*shadow; - } diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaNonIndexedF.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaNonIndexedF.glsl index d4f56896cf..8641827777 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/alphaNonIndexedF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/alphaNonIndexedF.glsl @@ -23,10 +23,12 @@ * $/LicenseInfo$ */ - - #extension GL_ARB_texture_rectangle : enable +#ifdef DEFINE_GL_FRAGCOLOR +out vec4 gl_FragColor; +#endif + uniform sampler2DRect depthMap; uniform sampler2D diffuseMap; @@ -38,11 +40,13 @@ uniform vec2 screen_res; vec3 atmosLighting(vec3 light); vec3 scaleSoftClip(vec3 light); -varying vec3 vary_ambient; -varying vec3 vary_directional; -varying vec3 vary_fragcoord; -varying vec3 vary_position; -varying vec3 vary_pointlight_col; +VARYING vec3 vary_ambient; +VARYING vec3 vary_directional; +VARYING vec3 vary_fragcoord; +VARYING vec3 vary_position; +VARYING vec3 vary_pointlight_col; +VARYING vec2 vary_texcoord0; +VARYING vec4 vertex_color; uniform mat4 inv_proj; @@ -66,9 +70,9 @@ void main() vec4 pos = vec4(vary_position, 1.0); - vec4 diff= texture2D(diffuseMap,gl_TexCoord[0].xy); + vec4 diff= texture2D(diffuseMap,vary_texcoord0.xy); - vec4 col = vec4(vary_ambient + vary_directional.rgb, gl_Color.a); + vec4 col = vec4(vary_ambient + vary_directional.rgb, vertex_color.a); vec4 color = diff * col; color.rgb = atmosLighting(color.rgb); diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaNonIndexedNoColorF.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaNonIndexedNoColorF.glsl new file mode 100644 index 0000000000..c13ea702db --- /dev/null +++ b/indra/newview/app_settings/shaders/class1/deferred/alphaNonIndexedNoColorF.glsl @@ -0,0 +1,84 @@ +/** + * @file alphaNonIndexedNoColorF.glsl + * + * $LicenseInfo:firstyear=2005&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2005, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#extension GL_ARB_texture_rectangle : enable + +#ifdef DEFINE_GL_FRAGCOLOR +out vec4 gl_FragColor; +#endif + +uniform sampler2DRect depthMap; +uniform sampler2D diffuseMap; + +uniform mat4 shadow_matrix[6]; +uniform vec4 shadow_clip; +uniform vec2 screen_res; + +vec3 atmosLighting(vec3 light); +vec3 scaleSoftClip(vec3 light); + +VARYING vec3 vary_ambient; +VARYING vec3 vary_directional; +VARYING vec3 vary_fragcoord; +VARYING vec3 vary_position; +VARYING vec3 vary_pointlight_col; +VARYING vec2 vary_texcoord0; + +uniform mat4 inv_proj; + +vec4 getPosition(vec2 pos_screen) +{ + float depth = texture2DRect(depthMap, pos_screen.xy).a; + vec2 sc = pos_screen.xy*2.0; + sc /= screen_res; + sc -= vec2(1.0,1.0); + vec4 ndc = vec4(sc.x, sc.y, 2.0*depth-1.0, 1.0); + vec4 pos = inv_proj * ndc; + pos /= pos.w; + pos.w = 1.0; + return pos; +} + +void main() +{ + vec2 frag = vary_fragcoord.xy/vary_fragcoord.z*0.5+0.5; + frag *= screen_res; + + vec4 pos = vec4(vary_position, 1.0); + + vec4 diff= texture2D(diffuseMap,vary_texcoord0.xy); + + vec4 col = vec4(vary_ambient + vary_directional.rgb, 1.0); + vec4 color = diff * col; + + color.rgb = atmosLighting(color.rgb); + + color.rgb = scaleSoftClip(color.rgb); + + color.rgb += diff.rgb * vary_pointlight_col.rgb; + + gl_FragColor = color; +} + diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaSkinnedV.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaSkinnedV.glsl index d57b8f8525..b09441f7eb 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/alphaSkinnedV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/alphaSkinnedV.glsl @@ -21,8 +21,14 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - +uniform mat4 projection_matrix; +uniform mat4 modelview_matrix; + +ATTRIBUTE vec3 position; +ATTRIBUTE vec3 normal; +ATTRIBUTE vec4 diffuse_color; +ATTRIBUTE vec2 texcoord0; vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol); mat4 getObjectSkinnedTransform(); @@ -35,15 +41,23 @@ vec3 atmosAffectDirectionalLight(float lightIntensity); vec3 scaleDownLight(vec3 light); vec3 scaleUpLight(vec3 light); -varying vec3 vary_position; -varying vec3 vary_ambient; -varying vec3 vary_directional; -varying vec3 vary_normal; -varying vec3 vary_fragcoord; -varying vec3 vary_pointlight_col; +VARYING vec3 vary_position; +VARYING vec3 vary_ambient; +VARYING vec3 vary_directional; +VARYING vec3 vary_normal; +VARYING vec3 vary_fragcoord; +VARYING vec3 vary_pointlight_col; +VARYING vec4 vertex_color; +VARYING vec2 vary_texcoord0; + uniform float near_clip; +uniform vec4 light_position[8]; +uniform vec3 light_direction[8]; +uniform vec3 light_attenuation[8]; +uniform vec3 light_diffuse[8]; + float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float fa, float is_pointlight) { //get light vector @@ -76,20 +90,20 @@ float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, floa void main() { - gl_TexCoord[0] = gl_MultiTexCoord0; + vary_texcoord0 = texcoord0; vec4 pos; vec3 norm; mat4 trans = getObjectSkinnedTransform(); - trans = gl_ModelViewMatrix * trans; + trans = modelview_matrix * trans; - pos = trans * gl_Vertex; + pos = trans * vec4(position.xyz, 1.0); - norm = gl_Vertex.xyz + gl_Normal.xyz; + norm = position.xyz + normal.xyz; norm = normalize(( trans*vec4(norm, 1.0) ).xyz-pos.xyz); - vec4 frag_pos = gl_ProjectionMatrix * pos; + vec4 frag_pos = projection_matrix * pos; gl_Position = frag_pos; vary_position = pos.xyz; @@ -97,31 +111,31 @@ void main() calcAtmospherics(pos.xyz); - vec4 col = vec4(0.0, 0.0, 0.0, gl_Color.a); + vec4 col = vec4(0.0, 0.0, 0.0, diffuse_color.a); // Collect normal lights - col.rgb += gl_LightSource[2].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[2].position, gl_LightSource[2].spotDirection.xyz, gl_LightSource[2].linearAttenuation, gl_LightSource[2].quadraticAttenuation, gl_LightSource[2].specular.a); - col.rgb += gl_LightSource[3].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[3].position, gl_LightSource[3].spotDirection.xyz, gl_LightSource[3].linearAttenuation, gl_LightSource[3].quadraticAttenuation ,gl_LightSource[3].specular.a); - col.rgb += gl_LightSource[4].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[4].position, gl_LightSource[4].spotDirection.xyz, gl_LightSource[4].linearAttenuation, gl_LightSource[4].quadraticAttenuation, gl_LightSource[4].specular.a); - col.rgb += gl_LightSource[5].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[5].position, gl_LightSource[5].spotDirection.xyz, gl_LightSource[5].linearAttenuation, gl_LightSource[5].quadraticAttenuation, gl_LightSource[5].specular.a); - col.rgb += gl_LightSource[6].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[6].position, gl_LightSource[6].spotDirection.xyz, gl_LightSource[6].linearAttenuation, gl_LightSource[6].quadraticAttenuation, gl_LightSource[6].specular.a); - col.rgb += gl_LightSource[7].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[7].position, gl_LightSource[7].spotDirection.xyz, gl_LightSource[7].linearAttenuation, gl_LightSource[7].quadraticAttenuation, gl_LightSource[7].specular.a); - - vary_pointlight_col = col.rgb*gl_Color.rgb; + col.rgb += light_diffuse[2].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[2], light_direction[2], light_attenuation[2].x, light_attenuation[2].y, light_attenuation[2].z); + col.rgb += light_diffuse[3].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[3], light_direction[3], light_attenuation[3].x, light_attenuation[3].y, light_attenuation[3].z); + col.rgb += light_diffuse[4].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[4], light_direction[4], light_attenuation[4].x, light_attenuation[4].y, light_attenuation[4].z); + col.rgb += light_diffuse[5].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[5], light_direction[5], light_attenuation[5].x, light_attenuation[5].y, light_attenuation[5].z); + col.rgb += light_diffuse[6].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[6], light_direction[6], light_attenuation[6].x, light_attenuation[6].y, light_attenuation[6].z); + col.rgb += light_diffuse[7].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[7], light_direction[7], light_attenuation[7].x, light_attenuation[7].y, light_attenuation[7].z); + + vary_pointlight_col = col.rgb*diffuse_color.rgb; col.rgb = vec3(0,0,0); // Add windlight lights col.rgb = atmosAmbient(vec3(0.)); - vary_ambient = col.rgb*gl_Color.rgb; - vary_directional = gl_Color.rgb*atmosAffectDirectionalLight(max(calcDirectionalLight(norm, gl_LightSource[0].position.xyz), (1.0-gl_Color.a)*(1.0-gl_Color.a))); + vary_ambient = col.rgb*diffuse_color.rgb; + vary_directional = diffuse_color.rgb*atmosAffectDirectionalLight(max(calcDirectionalLight(norm, light_position[0].xyz), (1.0-diffuse_color.a)*(1.0-diffuse_color.a))); - col.rgb = min(col.rgb*gl_Color.rgb, 1.0); + col.rgb = min(col.rgb*diffuse_color.rgb, 1.0); - gl_FrontColor = col; + vertex_color = col; - gl_FogFragCoord = pos.z; + vary_fragcoord.xyz = frag_pos.xyz + vec3(0,0,near_clip); } diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl index f6a280462e..93b1a114db 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl @@ -23,7 +23,16 @@ * $/LicenseInfo$ */ +uniform mat3 normal_matrix; +uniform mat4 texture_matrix0; +uniform mat4 modelview_matrix; +uniform mat4 modelview_projection_matrix; +ATTRIBUTE vec3 position; +void passTextureIndex(); +ATTRIBUTE vec3 normal; +ATTRIBUTE vec4 diffuse_color; +ATTRIBUTE vec2 texcoord0; vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol); void calcAtmospherics(vec3 inPositionEye); @@ -35,18 +44,26 @@ vec3 atmosAffectDirectionalLight(float lightIntensity); vec3 scaleDownLight(vec3 light); vec3 scaleUpLight(vec3 light); -varying vec3 vary_ambient; -varying vec3 vary_directional; -varying vec3 vary_fragcoord; -varying vec3 vary_position; -varying vec3 vary_light; -varying vec3 vary_pointlight_col; -varying float vary_texture_index; +VARYING vec3 vary_ambient; +VARYING vec3 vary_directional; +VARYING vec3 vary_fragcoord; +VARYING vec3 vary_position; +VARYING vec3 vary_light; +VARYING vec3 vary_pointlight_col; + +VARYING vec4 vertex_color; +VARYING vec2 vary_texcoord0; + uniform float near_clip; uniform float shadow_offset; uniform float shadow_bias; +uniform vec4 light_position[8]; +uniform vec3 light_direction[8]; +uniform vec3 light_attenuation[8]; +uniform vec3 light_diffuse[8]; + float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float fa, float is_pointlight) { //get light vector @@ -80,50 +97,50 @@ float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, floa void main() { //transform vertex - vec4 vert = vec4(gl_Vertex.xyz, 1.0); - vary_texture_index = gl_Vertex.w; - gl_Position = gl_ModelViewProjectionMatrix * vert; + vec4 vert = vec4(position.xyz, 1.0); + passTextureIndex(); + vec4 pos = (modelview_matrix * vert); + gl_Position = modelview_projection_matrix*vec4(position.xyz, 1.0); - gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0; + vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy; - vec4 pos = (gl_ModelViewMatrix * vert); - vec3 norm = normalize(gl_NormalMatrix * gl_Normal); + vec3 norm = normalize(normal_matrix * normal); - float dp_directional_light = max(0.0, dot(norm, gl_LightSource[0].position.xyz)); - vary_position = pos.xyz + gl_LightSource[0].position.xyz * (1.0-dp_directional_light)*shadow_offset; + float dp_directional_light = max(0.0, dot(norm, light_position[0].xyz)); + vary_position = pos.xyz + light_position[0].xyz * (1.0-dp_directional_light)*shadow_offset; calcAtmospherics(pos.xyz); - //vec4 color = calcLighting(pos.xyz, norm, gl_Color, vec4(0.)); - vec4 col = vec4(0.0, 0.0, 0.0, gl_Color.a); + //vec4 color = calcLighting(pos.xyz, norm, diffuse_color, vec4(0.)); + vec4 col = vec4(0.0, 0.0, 0.0, diffuse_color.a); // Collect normal lights - col.rgb += gl_LightSource[2].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[2].position, gl_LightSource[2].spotDirection.xyz, gl_LightSource[2].linearAttenuation, gl_LightSource[2].quadraticAttenuation, gl_LightSource[2].specular.a); - col.rgb += gl_LightSource[3].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[3].position, gl_LightSource[3].spotDirection.xyz, gl_LightSource[3].linearAttenuation, gl_LightSource[3].quadraticAttenuation ,gl_LightSource[3].specular.a); - col.rgb += gl_LightSource[4].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[4].position, gl_LightSource[4].spotDirection.xyz, gl_LightSource[4].linearAttenuation, gl_LightSource[4].quadraticAttenuation, gl_LightSource[4].specular.a); - col.rgb += gl_LightSource[5].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[5].position, gl_LightSource[5].spotDirection.xyz, gl_LightSource[5].linearAttenuation, gl_LightSource[5].quadraticAttenuation, gl_LightSource[5].specular.a); - col.rgb += gl_LightSource[6].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[6].position, gl_LightSource[6].spotDirection.xyz, gl_LightSource[6].linearAttenuation, gl_LightSource[6].quadraticAttenuation, gl_LightSource[6].specular.a); - col.rgb += gl_LightSource[7].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[7].position, gl_LightSource[7].spotDirection.xyz, gl_LightSource[7].linearAttenuation, gl_LightSource[7].quadraticAttenuation, gl_LightSource[7].specular.a); + col.rgb += light_diffuse[2].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[2], light_direction[2], light_attenuation[2].x, light_attenuation[2].y, light_attenuation[2].z); + col.rgb += light_diffuse[3].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[3], light_direction[3], light_attenuation[3].x, light_attenuation[3].y, light_attenuation[3].z); + col.rgb += light_diffuse[4].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[4], light_direction[4], light_attenuation[4].x, light_attenuation[4].y, light_attenuation[4].z); + col.rgb += light_diffuse[5].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[5], light_direction[5], light_attenuation[5].x, light_attenuation[5].y, light_attenuation[5].z); + col.rgb += light_diffuse[6].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[6], light_direction[6], light_attenuation[6].x, light_attenuation[6].y, light_attenuation[6].z); + col.rgb += light_diffuse[7].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[7], light_direction[7], light_attenuation[7].x, light_attenuation[7].y, light_attenuation[7].z); - vary_pointlight_col = col.rgb*gl_Color.rgb; + vary_pointlight_col = col.rgb*diffuse_color.rgb; col.rgb = vec3(0,0,0); // Add windlight lights col.rgb = atmosAmbient(vec3(0.)); - vary_light = gl_LightSource[0].position.xyz; + vary_light = light_position[0].xyz; - vary_ambient = col.rgb*gl_Color.rgb; - vary_directional.rgb = gl_Color.rgb*atmosAffectDirectionalLight(max(calcDirectionalLight(norm, gl_LightSource[0].position.xyz), (1.0-gl_Color.a)*(1.0-gl_Color.a))); + vary_ambient = col.rgb*diffuse_color.rgb; + vary_directional.rgb = diffuse_color.rgb*atmosAffectDirectionalLight(max(calcDirectionalLight(norm, light_position[0].xyz), (1.0-diffuse_color.a)*(1.0-diffuse_color.a))); - col.rgb = col.rgb*gl_Color.rgb; + col.rgb = col.rgb*diffuse_color.rgb; - gl_FrontColor = col; + vertex_color = col; - gl_FogFragCoord = pos.z; - pos = gl_ModelViewProjectionMatrix * vert; + + pos = modelview_projection_matrix * vert; vary_fragcoord.xyz = pos.xyz + vec3(0,0,near_clip); } diff --git a/indra/newview/app_settings/shaders/class1/deferred/attachmentShadowF.glsl b/indra/newview/app_settings/shaders/class1/deferred/attachmentShadowF.glsl index 0c930848e5..402f681631 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/attachmentShadowF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/attachmentShadowF.glsl @@ -22,14 +22,18 @@ * $/LicenseInfo$ */ - +#ifdef DEFINE_GL_FRAGCOLOR +out vec4 gl_FragColor; +#endif uniform sampler2D diffuseMap; +VARYING vec4 vertex_color; +VARYING vec2 vary_texcoord0; void main() { - //gl_FragColor = vec4(1,1,1,gl_Color.a * texture2D(diffuseMap, gl_TexCoord[0].xy).a); + //gl_FragColor = vec4(1,1,1,vertex_color.a * texture2D(diffuseMap, vary_texcoord0.xy).a); gl_FragColor = vec4(1,1,1,1); } diff --git a/indra/newview/app_settings/shaders/class1/deferred/attachmentShadowV.glsl b/indra/newview/app_settings/shaders/class1/deferred/attachmentShadowV.glsl index bf4e79d815..ded6cced27 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/attachmentShadowV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/attachmentShadowV.glsl @@ -22,23 +22,29 @@ * $/LicenseInfo$ */ +uniform mat4 projection_matrix; +uniform mat4 modelview_matrix; +uniform mat4 texture_matrix0; +ATTRIBUTE vec3 position; +ATTRIBUTE vec4 diffuse_color; +ATTRIBUTE vec2 texcoord0; + +VARYING vec4 vertex_color; mat4 getObjectSkinnedTransform(); void main() { //transform vertex - gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0; - mat4 mat = getObjectSkinnedTransform(); - mat = gl_ModelViewMatrix * mat; - vec3 pos = (mat*gl_Vertex).xyz; + mat = modelview_matrix * mat; + vec3 pos = (mat*vec4(position.xyz, 1.0)).xyz; - gl_FrontColor = gl_Color; + vertex_color = diffuse_color; - vec4 p = gl_ProjectionMatrix * vec4(pos, 1.0); + vec4 p = projection_matrix * vec4(pos, 1.0); p.z = max(p.z, -p.w+0.01); gl_Position = p; } diff --git a/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaV.glsl b/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaV.glsl index f70ea4da52..d7b90978ba 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaV.glsl @@ -22,8 +22,12 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - +uniform mat4 projection_matrix; + +ATTRIBUTE vec3 position; +ATTRIBUTE vec3 normal; +ATTRIBUTE vec2 texcoord0; vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol); mat4 getSkinnedTransform(); @@ -37,14 +41,24 @@ vec3 atmosAffectDirectionalLight(float lightIntensity); vec3 scaleDownLight(vec3 light); vec3 scaleUpLight(vec3 light); -varying vec3 vary_position; -varying vec3 vary_ambient; -varying vec3 vary_directional; -varying vec3 vary_fragcoord; -varying vec3 vary_pointlight_col; +VARYING vec3 vary_position; +VARYING vec3 vary_ambient; +VARYING vec3 vary_directional; +VARYING vec3 vary_fragcoord; +VARYING vec3 vary_pointlight_col; +VARYING vec4 vertex_color; +VARYING vec2 vary_texcoord0; + uniform float near_clip; +uniform vec4 color; + +uniform vec4 light_position[8]; +uniform vec3 light_direction[8]; +uniform vec3 light_attenuation[8]; +uniform vec3 light_diffuse[8]; + float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float fa, float is_pointlight) { //get light vector @@ -77,56 +91,55 @@ float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, floa void main() { - gl_TexCoord[0] = gl_MultiTexCoord0; + vary_texcoord0 = texcoord0; vec4 pos; vec3 norm; mat4 trans = getSkinnedTransform(); - pos.x = dot(trans[0], gl_Vertex); - pos.y = dot(trans[1], gl_Vertex); - pos.z = dot(trans[2], gl_Vertex); + vec4 pos_in = vec4(position.xyz, 1.0); + pos.x = dot(trans[0], pos_in); + pos.y = dot(trans[1], pos_in); + pos.z = dot(trans[2], pos_in); pos.w = 1.0; - norm.x = dot(trans[0].xyz, gl_Normal); - norm.y = dot(trans[1].xyz, gl_Normal); - norm.z = dot(trans[2].xyz, gl_Normal); + norm.x = dot(trans[0].xyz, normal); + norm.y = dot(trans[1].xyz, normal); + norm.z = dot(trans[2].xyz, normal); norm = normalize(norm); - vec4 frag_pos = gl_ProjectionMatrix * pos; + vec4 frag_pos = projection_matrix * pos; gl_Position = frag_pos; vary_position = pos.xyz; calcAtmospherics(pos.xyz); - //vec4 color = calcLighting(pos.xyz, norm, gl_Color, vec4(0.)); - - vec4 col = vec4(0.0, 0.0, 0.0, gl_Color.a); + vec4 col = vec4(0.0, 0.0, 0.0, 1.0); // Collect normal lights - col.rgb += gl_LightSource[2].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[2].position, gl_LightSource[2].spotDirection.xyz, gl_LightSource[2].linearAttenuation, gl_LightSource[2].quadraticAttenuation, gl_LightSource[2].specular.a); - col.rgb += gl_LightSource[3].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[3].position, gl_LightSource[3].spotDirection.xyz, gl_LightSource[3].linearAttenuation, gl_LightSource[3].quadraticAttenuation ,gl_LightSource[3].specular.a); - col.rgb += gl_LightSource[4].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[4].position, gl_LightSource[4].spotDirection.xyz, gl_LightSource[4].linearAttenuation, gl_LightSource[4].quadraticAttenuation, gl_LightSource[4].specular.a); - col.rgb += gl_LightSource[5].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[5].position, gl_LightSource[5].spotDirection.xyz, gl_LightSource[5].linearAttenuation, gl_LightSource[5].quadraticAttenuation, gl_LightSource[5].specular.a); - col.rgb += gl_LightSource[6].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[6].position, gl_LightSource[6].spotDirection.xyz, gl_LightSource[6].linearAttenuation, gl_LightSource[6].quadraticAttenuation, gl_LightSource[6].specular.a); - col.rgb += gl_LightSource[7].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[7].position, gl_LightSource[7].spotDirection.xyz, gl_LightSource[7].linearAttenuation, gl_LightSource[7].quadraticAttenuation, gl_LightSource[7].specular.a); + col.rgb += light_diffuse[2].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[2], light_direction[2], light_attenuation[2].x, light_attenuation[2].y, light_attenuation[2].z); + col.rgb += light_diffuse[3].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[3], light_direction[3], light_attenuation[3].x, light_attenuation[3].y, light_attenuation[3].z); + col.rgb += light_diffuse[4].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[4], light_direction[4], light_attenuation[4].x, light_attenuation[4].y, light_attenuation[4].z); + col.rgb += light_diffuse[5].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[5], light_direction[5], light_attenuation[5].x, light_attenuation[5].y, light_attenuation[5].z); + col.rgb += light_diffuse[6].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[6], light_direction[6], light_attenuation[6].x, light_attenuation[6].y, light_attenuation[6].z); + col.rgb += light_diffuse[7].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[7], light_direction[7], light_attenuation[7].x, light_attenuation[7].y, light_attenuation[7].z); - vary_pointlight_col = col.rgb*gl_Color.rgb; + vary_pointlight_col = col.rgb*color.rgb; col.rgb = vec3(0,0,0); // Add windlight lights col.rgb = atmosAmbient(vec3(0.)); - vary_ambient = col.rgb*gl_Color.rgb; - vary_directional = gl_Color.rgb*atmosAffectDirectionalLight(max(calcDirectionalLight(norm, gl_LightSource[0].position.xyz), (1.0-gl_Color.a)*(1.0-gl_Color.a))); + vary_ambient = col.rgb*color.rgb; + vary_directional = color.rgb*atmosAffectDirectionalLight(max(calcDirectionalLight(norm, light_position[0].xyz), 0.0)); - col.rgb = min(col.rgb*gl_Color.rgb, 1.0); + col.rgb = col.rgb * color.rgb; - gl_FrontColor = col; + vertex_color = col; - gl_FogFragCoord = pos.z; + vary_fragcoord.xyz = frag_pos.xyz + vec3(0,0,near_clip); } diff --git a/indra/newview/app_settings/shaders/class1/deferred/avatarEyesV.glsl b/indra/newview/app_settings/shaders/class1/deferred/avatarEyesV.glsl index d0f3397932..01ffb862f7 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/avatarEyesV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/avatarEyesV.glsl @@ -22,18 +22,27 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - +uniform mat3 normal_matrix; +uniform mat4 texture_matrix0; +uniform mat4 modelview_projection_matrix; -varying vec3 vary_normal; +ATTRIBUTE vec3 position; +ATTRIBUTE vec3 normal; +ATTRIBUTE vec4 diffuse_color; +ATTRIBUTE vec2 texcoord0; + +VARYING vec3 vary_normal; +VARYING vec4 vertex_color; +VARYING vec2 vary_texcoord0; void main() { //transform vertex - gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; - gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0; + gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0); + vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy; - vary_normal = normalize(gl_NormalMatrix * gl_Normal); + vary_normal = normalize(normal_matrix * normal); - gl_FrontColor = gl_Color; + vertex_color = diffuse_color; } diff --git a/indra/newview/app_settings/shaders/class1/deferred/avatarF.glsl b/indra/newview/app_settings/shaders/class1/deferred/avatarF.glsl index 3f30402583..9a3b2e3e8a 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/avatarF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/avatarF.glsl @@ -22,16 +22,19 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - +#ifdef DEFINE_GL_FRAGCOLOR +out vec4 gl_FragData[3]; +#endif uniform sampler2D diffuseMap; -varying vec3 vary_normal; +VARYING vec3 vary_normal; +VARYING vec2 vary_texcoord0; void main() { - vec4 diff = gl_Color*texture2D(diffuseMap, gl_TexCoord[0].xy); + vec4 diff = texture2D(diffuseMap, vary_texcoord0.xy); if (diff.a < 0.2) { diff --git a/indra/newview/app_settings/shaders/class1/deferred/avatarShadowF.glsl b/indra/newview/app_settings/shaders/class1/deferred/avatarShadowF.glsl index c9a349f026..558a88009a 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/avatarShadowF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/avatarShadowF.glsl @@ -23,15 +23,16 @@ * $/LicenseInfo$ */ - +#ifdef DEFINE_GL_FRAGCOLOR +out vec4 gl_FragColor; +#endif uniform sampler2D diffuseMap; -varying vec4 post_pos; +VARYING vec4 post_pos; void main() { - //gl_FragColor = vec4(1,1,1,gl_Color.a * texture2D(diffuseMap, gl_TexCoord[0].xy).a); gl_FragColor = vec4(1,1,1,1); gl_FragDepth = max(post_pos.z/post_pos.w*0.5+0.5, 0.0); diff --git a/indra/newview/app_settings/shaders/class1/deferred/avatarShadowV.glsl b/indra/newview/app_settings/shaders/class1/deferred/avatarShadowV.glsl index 3d2ad397df..23feb09d72 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/avatarShadowV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/avatarShadowV.glsl @@ -23,38 +23,37 @@ * $/LicenseInfo$ */ - +uniform mat4 projection_matrix; mat4 getSkinnedTransform(); -attribute vec4 weight; +ATTRIBUTE vec3 position; +ATTRIBUTE vec3 normal; +ATTRIBUTE vec2 texcoord0; -varying vec4 post_pos; +VARYING vec4 post_pos; void main() { - gl_TexCoord[0] = gl_MultiTexCoord0; - vec4 pos; vec3 norm; + vec4 pos_in = vec4(position.xyz, 1.0); mat4 trans = getSkinnedTransform(); - pos.x = dot(trans[0], gl_Vertex); - pos.y = dot(trans[1], gl_Vertex); - pos.z = dot(trans[2], gl_Vertex); + pos.x = dot(trans[0], pos_in); + pos.y = dot(trans[1], pos_in); + pos.z = dot(trans[2], pos_in); pos.w = 1.0; - norm.x = dot(trans[0].xyz, gl_Normal); - norm.y = dot(trans[1].xyz, gl_Normal); - norm.z = dot(trans[2].xyz, gl_Normal); + norm.x = dot(trans[0].xyz, normal); + norm.y = dot(trans[1].xyz, normal); + norm.z = dot(trans[2].xyz, normal); norm = normalize(norm); - pos = gl_ProjectionMatrix * pos; + pos = projection_matrix * pos; post_pos = pos; gl_Position = vec4(pos.x, pos.y, pos.w*0.5, pos.w); - - gl_FrontColor = gl_Color; } diff --git a/indra/newview/app_settings/shaders/class1/deferred/avatarV.glsl b/indra/newview/app_settings/shaders/class1/deferred/avatarV.glsl index 37fcef81f3..1bd8fee7c9 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/avatarV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/avatarV.glsl @@ -23,38 +23,41 @@ * $/LicenseInfo$ */ +uniform mat4 projection_matrix; +ATTRIBUTE vec3 position; +ATTRIBUTE vec3 normal; +ATTRIBUTE vec2 texcoord0; mat4 getSkinnedTransform(); -attribute vec4 weight; +ATTRIBUTE vec4 weight; -varying vec3 vary_normal; +VARYING vec3 vary_normal; +VARYING vec2 vary_texcoord0; void main() { - gl_TexCoord[0] = gl_MultiTexCoord0; + vary_texcoord0 = texcoord0; vec4 pos; vec3 norm; + vec4 pos_in = vec4(position.xyz, 1.0); mat4 trans = getSkinnedTransform(); - pos.x = dot(trans[0], gl_Vertex); - pos.y = dot(trans[1], gl_Vertex); - pos.z = dot(trans[2], gl_Vertex); + pos.x = dot(trans[0], pos_in); + pos.y = dot(trans[1], pos_in); + pos.z = dot(trans[2], pos_in); pos.w = 1.0; - norm.x = dot(trans[0].xyz, gl_Normal); - norm.y = dot(trans[1].xyz, gl_Normal); - norm.z = dot(trans[2].xyz, gl_Normal); + norm.x = dot(trans[0].xyz, normal); + norm.y = dot(trans[1].xyz, normal); + norm.z = dot(trans[2].xyz, normal); norm = normalize(norm); vary_normal = norm; - gl_Position = gl_ProjectionMatrix * pos; - //gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; - - gl_FrontColor = gl_Color; + gl_Position = projection_matrix * pos; } diff --git a/indra/newview/app_settings/shaders/class1/deferred/blurLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/blurLightF.glsl index 3609cc054b..60d4dae99f 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/blurLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/blurLightF.glsl @@ -22,11 +22,13 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - - #extension GL_ARB_texture_rectangle : enable +#ifdef DEFINE_GL_FRAGCOLOR +out vec4 gl_FragColor; +#endif + uniform sampler2DRect depthMap; uniform sampler2DRect normalMap; uniform sampler2DRect lightMap; @@ -37,11 +39,16 @@ uniform vec2 delta; uniform vec3 kern[4]; uniform float kern_scale; -varying vec2 vary_fragcoord; +VARYING vec2 vary_fragcoord; uniform mat4 inv_proj; uniform vec2 screen_res; +vec3 getKern(int i) +{ + return kern[i]; +} + vec4 getPosition(vec2 pos_screen) { float depth = texture2DRect(depthMap, pos_screen.xy).r; @@ -66,35 +73,38 @@ void main() vec2 dlt = kern_scale * delta / (1.0+norm.xy*norm.xy); dlt /= max(-pos.z*dist_factor, 1.0); - vec2 defined_weight = kern[0].xy; // special case the first (centre) sample's weight in the blur; we have to sample it anyway so we get it for 'free' + vec2 defined_weight = getKern(0).xy; // special case the first (centre) sample's weight in the blur; we have to sample it anyway so we get it for 'free' vec4 col = defined_weight.xyxx * ccol; // relax tolerance according to distance to avoid speckling artifacts, as angles and distances are a lot more abrupt within a small screen area at larger distances float pointplanedist_tolerance_pow2 = pos.z*pos.z*0.00005; // perturb sampling origin slightly in screen-space to hide edge-ghosting artifacts where smoothing radius is quite large - tc += ( (mod(tc.x+tc.y,2) - 0.5) * kern[1].z * dlt * 0.5 ); + float tc_mod = 0.5*(tc.x + tc.y); // mod(tc.x+tc.y,2) + tc_mod -= floor(tc_mod); + tc_mod *= 2.0; + tc += ( (tc_mod - 0.5) * getKern(1).z * dlt * 0.5 ); for (int i = 1; i < 4; i++) { - vec2 samptc = tc + kern[i].z*dlt; + vec2 samptc = tc + getKern(i).z*dlt; vec3 samppos = getPosition(samptc).xyz; float d = dot(norm.xyz, samppos.xyz-pos.xyz);// dist from plane if (d*d <= pointplanedist_tolerance_pow2) { - col += texture2DRect(lightMap, samptc)*kern[i].xyxx; - defined_weight += kern[i].xy; + col += texture2DRect(lightMap, samptc)*getKern(i).xyxx; + defined_weight += getKern(i).xy; } } for (int i = 1; i < 4; i++) { - vec2 samptc = tc - kern[i].z*dlt; + vec2 samptc = tc - getKern(i).z*dlt; vec3 samppos = getPosition(samptc).xyz; float d = dot(norm.xyz, samppos.xyz-pos.xyz);// dist from plane if (d*d <= pointplanedist_tolerance_pow2) { - col += texture2DRect(lightMap, samptc)*kern[i].xyxx; - defined_weight += kern[i].xy; + col += texture2DRect(lightMap, samptc)*getKern(i).xyxx; + defined_weight += getKern(i).xy; } } diff --git a/indra/newview/app_settings/shaders/class1/deferred/blurLightMSF.glsl b/indra/newview/app_settings/shaders/class1/deferred/blurLightMSF.glsl deleted file mode 100644 index c858eb7a3a..0000000000 --- a/indra/newview/app_settings/shaders/class1/deferred/blurLightMSF.glsl +++ /dev/null @@ -1,131 +0,0 @@ -/** - * @file blurLightF.glsl - * - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2007, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - - - -#extension GL_ARB_texture_rectangle : enable -#extension GL_ARB_texture_multisample : enable - -uniform sampler2DMS depthMap; -uniform sampler2DMS normalMap; -uniform sampler2DRect lightMap; - -uniform float dist_factor; -uniform float blur_size; -uniform vec2 delta; -uniform vec3 kern[4]; -uniform float kern_scale; - -varying vec2 vary_fragcoord; - -uniform mat4 inv_proj; -uniform vec2 screen_res; - -vec3 texture2DMS3(sampler2DMS tex, ivec2 tc) -{ - vec3 ret = vec3(0,0,0); - for (int i = 0; i < samples; i++) - { - ret += texelFetch(tex, tc, i).rgb; - } - - return ret/samples; -} - -float texture2DMS1(sampler2DMS tex, ivec2 tc) -{ - float ret = 0; - for (int i = 0; i < samples; i++) - { - ret += texelFetch(tex, tc, i).r; - } - - return ret/samples; -} - -vec4 getPosition(ivec2 pos_screen) -{ - float depth = texture2DMS1(depthMap, pos_screen.xy); - vec2 sc = pos_screen.xy*2.0; - sc /= screen_res; - sc -= vec2(1.0,1.0); - vec4 ndc = vec4(sc.x, sc.y, 2.0*depth-1.0, 1.0); - vec4 pos = inv_proj * ndc; - pos /= pos.w; - pos.w = 1.0; - return pos; -} - -void main() -{ - vec2 tc = vary_fragcoord.xy; - ivec2 itc = ivec2(tc); - - vec3 norm = texture2DMS3(normalMap, itc).xyz; - norm = vec3((norm.xy-0.5)*2.0,norm.z); // unpack norm - vec3 pos = getPosition(itc).xyz; - vec4 ccol = texture2DRect(lightMap, tc).rgba; - - vec2 dlt = kern_scale * delta / (1.0+norm.xy*norm.xy); - dlt /= max(-pos.z*dist_factor, 1.0); - - vec2 defined_weight = kern[0].xy; // special case the first (centre) sample's weight in the blur; we have to sample it anyway so we get it for 'free' - vec4 col = defined_weight.xyxx * ccol; - - // relax tolerance according to distance to avoid speckling artifacts, as angles and distances are a lot more abrupt within a small screen area at larger distances - float pointplanedist_tolerance_pow2 = pos.z*pos.z*0.00005; - - // perturb sampling origin slightly in screen-space to hide edge-ghosting artifacts where smoothing radius is quite large - tc += ( (mod(tc.x+tc.y,2) - 0.5) * kern[1].z * dlt * 0.5 ); - - for (int i = 1; i < 4; i++) - { - vec2 samptc = tc + kern[i].z*dlt; - vec3 samppos = getPosition(ivec2(samptc)).xyz; - float d = dot(norm.xyz, samppos.xyz-pos.xyz);// dist from plane - if (d*d <= pointplanedist_tolerance_pow2) - { - col += texture2DRect(lightMap, samptc)*kern[i].xyxx; - defined_weight += kern[i].xy; - } - } - for (int i = 1; i < 4; i++) - { - vec2 samptc = vec2(tc - kern[i].z*dlt); - vec3 samppos = getPosition(ivec2(samptc)).xyz; - float d = dot(norm.xyz, samppos.xyz-pos.xyz);// dist from plane - if (d*d <= pointplanedist_tolerance_pow2) - { - col += texture2DRect(lightMap, samptc)*kern[i].xyxx; - defined_weight += kern[i].xy; - } - } - - col /= defined_weight.xyxx; - col.y *= col.y; - - gl_FragColor = col; -} - diff --git a/indra/newview/app_settings/shaders/class1/deferred/blurLightV.glsl b/indra/newview/app_settings/shaders/class1/deferred/blurLightV.glsl index e904b7ded0..212f7e56ad 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/blurLightV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/blurLightV.glsl @@ -22,16 +22,18 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - +uniform mat4 modelview_projection_matrix; -varying vec2 vary_fragcoord; +ATTRIBUTE vec3 position; + +VARYING vec2 vary_fragcoord; uniform vec2 screen_res; void main() { //transform vertex - gl_Position = ftransform(); - vec4 pos = gl_ModelViewProjectionMatrix * gl_Vertex; + vec4 pos = modelview_projection_matrix * vec4(position.xyz, 1.0); + gl_Position = pos; vary_fragcoord = (pos.xy*0.5+0.5)*screen_res; } diff --git a/indra/newview/app_settings/shaders/class1/deferred/bumpF.glsl b/indra/newview/app_settings/shaders/class1/deferred/bumpF.glsl index 429a891f07..6cc5f23aca 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/bumpF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/bumpF.glsl @@ -23,27 +23,32 @@ * $/LicenseInfo$ */ - +#ifdef DEFINE_GL_FRAGCOLOR +out vec4 gl_FragData[3]; +#endif uniform sampler2D diffuseMap; uniform sampler2D bumpMap; -varying vec3 vary_mat0; -varying vec3 vary_mat1; -varying vec3 vary_mat2; +VARYING vec3 vary_mat0; +VARYING vec3 vary_mat1; +VARYING vec3 vary_mat2; + +VARYING vec4 vertex_color; +VARYING vec2 vary_texcoord0; void main() { - vec3 col = gl_Color.rgb * texture2D(diffuseMap, gl_TexCoord[0].xy).rgb; - vec3 norm = texture2D(bumpMap, gl_TexCoord[0].xy).rgb * 2.0 - 1.0; + vec3 col = vertex_color.rgb * texture2D(diffuseMap, vary_texcoord0.xy).rgb; + vec3 norm = texture2D(bumpMap, vary_texcoord0.xy).rgb * 2.0 - 1.0; vec3 tnorm = vec3(dot(norm,vary_mat0), dot(norm,vary_mat1), dot(norm,vary_mat2)); gl_FragData[0] = vec4(col, 0.0); - gl_FragData[1] = gl_Color.aaaa; // spec - //gl_FragData[1] = vec4(vec3(gl_Color.a), gl_Color.a+(1.0-gl_Color.a)*gl_Color.a); // spec - from former class3 - maybe better, but not so well tested + gl_FragData[1] = vertex_color.aaaa; // spec + //gl_FragData[1] = vec4(vec3(vertex_color.a), vertex_color.a+(1.0-vertex_color.a)*vertex_color.a); // spec - from former class3 - maybe better, but not so well tested vec3 nvn = normalize(tnorm); gl_FragData[2] = vec4(nvn.xy * 0.5 + 0.5, nvn.z, 0.0); } diff --git a/indra/newview/app_settings/shaders/class1/deferred/bumpSkinnedV.glsl b/indra/newview/app_settings/shaders/class1/deferred/bumpSkinnedV.glsl index 7d934e7ff8..6c205074b4 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/bumpSkinnedV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/bumpSkinnedV.glsl @@ -22,33 +22,43 @@ * $/LicenseInfo$ */ +uniform mat4 projection_matrix; +uniform mat4 texture_matrix0; +uniform mat4 modelview_matrix; +ATTRIBUTE vec3 position; +ATTRIBUTE vec4 diffuse_color; +ATTRIBUTE vec3 normal; +ATTRIBUTE vec2 texcoord0; +ATTRIBUTE vec2 texcoord2; -varying vec3 vary_mat0; -varying vec3 vary_mat1; -varying vec3 vary_mat2; +VARYING vec3 vary_mat0; +VARYING vec3 vary_mat1; +VARYING vec3 vary_mat2; +VARYING vec4 vertex_color; +VARYING vec2 vary_texcoord0; mat4 getObjectSkinnedTransform(); void main() { - gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0; + vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy; mat4 mat = getObjectSkinnedTransform(); - mat = gl_ModelViewMatrix * mat; + mat = modelview_matrix * mat; - vec3 pos = (mat*gl_Vertex).xyz; + vec3 pos = (mat*vec4(position.xyz, 1.0)).xyz; - vec3 n = normalize((mat * vec4(gl_Normal.xyz+gl_Vertex.xyz, 1.0)).xyz-pos.xyz); - vec3 b = normalize((mat * vec4(gl_MultiTexCoord2.xyz+gl_Vertex.xyz, 1.0)).xyz-pos.xyz); + vec3 n = normalize((mat * vec4(normal.xyz+position.xyz, 1.0)).xyz-pos.xyz); + vec3 b = normalize((mat * vec4(vec4(texcoord2,0,1).xyz+position.xyz, 1.0)).xyz-pos.xyz); vec3 t = cross(b, n); vary_mat0 = vec3(t.x, b.x, n.x); vary_mat1 = vec3(t.y, b.y, n.y); vary_mat2 = vec3(t.z, b.z, n.z); - gl_Position = gl_ProjectionMatrix*vec4(pos, 1.0); - gl_FrontColor = gl_Color; + gl_Position = projection_matrix*vec4(pos, 1.0); + vertex_color = diffuse_color; } diff --git a/indra/newview/app_settings/shaders/class1/deferred/bumpV.glsl b/indra/newview/app_settings/shaders/class1/deferred/bumpV.glsl index 92fd41554d..c8d38bb8f7 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/bumpV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/bumpV.glsl @@ -22,26 +22,36 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - +uniform mat3 normal_matrix; +uniform mat4 texture_matrix0; +uniform mat4 modelview_projection_matrix; -varying vec3 vary_mat0; -varying vec3 vary_mat1; -varying vec3 vary_mat2; +ATTRIBUTE vec3 position; +ATTRIBUTE vec4 diffuse_color; +ATTRIBUTE vec3 normal; +ATTRIBUTE vec2 texcoord0; +ATTRIBUTE vec3 binormal; + +VARYING vec3 vary_mat0; +VARYING vec3 vary_mat1; +VARYING vec3 vary_mat2; +VARYING vec4 vertex_color; +VARYING vec2 vary_texcoord0; void main() { //transform vertex - gl_Position = ftransform(); - gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0; + gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0); + vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy; - vec3 n = normalize(gl_NormalMatrix * gl_Normal); - vec3 b = normalize(gl_NormalMatrix * gl_MultiTexCoord2.xyz); + vec3 n = normalize(normal_matrix * normal); + vec3 b = normalize(normal_matrix * binormal); vec3 t = cross(b, n); vary_mat0 = vec3(t.x, b.x, n.x); vary_mat1 = vec3(t.y, b.y, n.y); vary_mat2 = vec3(t.z, b.z, n.z); - gl_FrontColor = gl_Color; + vertex_color = diffuse_color; } diff --git a/indra/newview/app_settings/shaders/class1/deferred/cloudsF.glsl b/indra/newview/app_settings/shaders/class1/deferred/cloudsF.glsl index f4310dae95..db272cf601 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/cloudsF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/cloudsF.glsl @@ -24,20 +24,28 @@ */ +#ifdef DEFINE_GL_FRAGCOLOR +out vec4 gl_FragData[3]; +#endif ///////////////////////////////////////////////////////////////////////// // The fragment shader for the sky ///////////////////////////////////////////////////////////////////////// -varying vec4 vary_CloudColorSun; -varying vec4 vary_CloudColorAmbient; -varying float vary_CloudDensity; +VARYING vec4 vary_CloudColorSun; +VARYING vec4 vary_CloudColorAmbient; +VARYING float vary_CloudDensity; uniform sampler2D cloud_noise_texture; uniform vec4 cloud_pos_density1; uniform vec4 cloud_pos_density2; uniform vec4 gamma; +VARYING vec2 vary_texcoord0; +VARYING vec2 vary_texcoord1; +VARYING vec2 vary_texcoord2; +VARYING vec2 vary_texcoord3; + /// Soft clips the light with a gamma correction vec3 scaleSoftClip(vec3 light) { //soft clip effect: @@ -50,14 +58,14 @@ vec3 scaleSoftClip(vec3 light) { void main() { // Set variables - vec2 uv1 = gl_TexCoord[0].xy; - vec2 uv2 = gl_TexCoord[1].xy; + vec2 uv1 = vary_texcoord0.xy; + vec2 uv2 = vary_texcoord1.xy; vec4 cloudColorSun = vary_CloudColorSun; vec4 cloudColorAmbient = vary_CloudColorAmbient; float cloudDensity = vary_CloudDensity; - vec2 uv3 = gl_TexCoord[2].xy; - vec2 uv4 = gl_TexCoord[3].xy; + vec2 uv3 = vary_texcoord2.xy; + vec2 uv4 = vary_texcoord3.xy; // Offset texture coords uv1 += cloud_pos_density1.xy; //large texture, visible density diff --git a/indra/newview/app_settings/shaders/class1/deferred/cloudsV.glsl b/indra/newview/app_settings/shaders/class1/deferred/cloudsV.glsl index c175a834c2..64e094e3c5 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/cloudsV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/cloudsV.glsl @@ -22,17 +22,25 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - +uniform mat4 modelview_projection_matrix; + +ATTRIBUTE vec3 position; +ATTRIBUTE vec2 texcoord0; ////////////////////////////////////////////////////////////////////////// // The vertex shader for creating the atmospheric sky /////////////////////////////////////////////////////////////////////////////// // Output parameters -varying vec4 vary_CloudColorSun; -varying vec4 vary_CloudColorAmbient; -varying float vary_CloudDensity; +VARYING vec4 vary_CloudColorSun; +VARYING vec4 vary_CloudColorAmbient; +VARYING float vary_CloudDensity; + +VARYING vec2 vary_texcoord0; +VARYING vec2 vary_texcoord1; +VARYING vec2 vary_texcoord2; +VARYING vec2 vary_texcoord3; // Inputs uniform vec3 camPosLocal; @@ -59,12 +67,12 @@ void main() { // World / view / projection - gl_Position = ftransform(); + gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0); - gl_TexCoord[0] = gl_MultiTexCoord0; + vary_texcoord0 = texcoord0; // Get relative position - vec3 P = gl_Vertex.xyz - camPosLocal.xyz + vec3(0,50,0); + vec3 P = position.xyz - camPosLocal.xyz + vec3(0,50,0); // Set altitude if (P.y > 0.) @@ -160,17 +168,17 @@ void main() // Texture coords - gl_TexCoord[0] = gl_MultiTexCoord0; - gl_TexCoord[0].xy -= 0.5; - gl_TexCoord[0].xy /= cloud_scale.x; - gl_TexCoord[0].xy += 0.5; + vary_texcoord0 = texcoord0; + vary_texcoord0.xy -= 0.5; + vary_texcoord0.xy /= cloud_scale.x; + vary_texcoord0.xy += 0.5; - gl_TexCoord[1] = gl_TexCoord[0]; - gl_TexCoord[1].x += lightnorm.x * 0.0125; - gl_TexCoord[1].y += lightnorm.z * 0.0125; + vary_texcoord1 = vary_texcoord0; + vary_texcoord1.x += lightnorm.x * 0.0125; + vary_texcoord1.y += lightnorm.z * 0.0125; - gl_TexCoord[2] = gl_TexCoord[0] * 16.; - gl_TexCoord[3] = gl_TexCoord[1] * 16.; + vary_texcoord2 = vary_texcoord0 * 16.; + vary_texcoord3 = vary_texcoord1 * 16.; // Combine these to minimize register use vary_CloudColorAmbient += oHazeColorBelowCloud; diff --git a/indra/newview/app_settings/shaders/class2/deferred/edgeF.glsl b/indra/newview/app_settings/shaders/class1/deferred/cofF.glsl index d9eafb6eba..88fe3c3dee 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/edgeF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/cofF.glsl @@ -1,5 +1,5 @@ /** - * @file edgeF.glsl + * @file cofF.glsl * * $LicenseInfo:firstyear=2007&license=viewerlgpl$ * Second Life Viewer Source Code @@ -22,22 +22,30 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - - #extension GL_ARB_texture_rectangle : enable -uniform sampler2DRect depthMap; -uniform sampler2DRect normalMap; +#ifdef DEFINE_GL_FRAGCOLOR +out vec4 gl_FragColor; +#endif -varying vec2 vary_fragcoord; +uniform sampler2DRect diffuseRect; +uniform sampler2DRect depthMap; +uniform sampler2D bloomMap; uniform float depth_cutoff; uniform float norm_cutoff; +uniform float focal_distance; +uniform float blur_constant; +uniform float tan_pixel_angle; +uniform float magnification; +uniform float max_cof; uniform mat4 inv_proj; uniform vec2 screen_res; +VARYING vec2 vary_fragcoord; + float getDepth(vec2 pos_screen) { float z = texture2DRect(depthMap, pos_screen.xy).r; @@ -47,35 +55,33 @@ float getDepth(vec2 pos_screen) return p.z/p.w; } -void main() +float calc_cof(float depth) { - vec3 norm = texture2DRect(normalMap, vary_fragcoord.xy).xyz; - norm = vec3((norm.xy-0.5)*2.0,norm.z); // unpack norm - float depth = getDepth(vary_fragcoord.xy); + float sc = abs(depth-focal_distance)/-depth*blur_constant; + + sc /= magnification; - vec2 tc = vary_fragcoord.xy; + // tan_pixel_angle = pixel_length/-depth; + float pixel_length = tan_pixel_angle*-focal_distance; - float sc = 0.75; + sc = sc/pixel_length; + sc *= 1.414; - vec2 de; - de.x = (depth-getDepth(tc+vec2(sc, sc))) + (depth-getDepth(tc+vec2(-sc, -sc))); - de.y = (depth-getDepth(tc+vec2(-sc, sc))) + (depth-getDepth(tc+vec2(sc, -sc))); - de /= depth; - de *= de; - de = step(depth_cutoff, de); + return sc; +} + +void main() +{ + vec2 tc = vary_fragcoord.xy; - vec2 ne; - vec3 nexnorm = texture2DRect(normalMap, tc+vec2(-sc,-sc)).rgb; - nexnorm = vec3((nexnorm.xy-0.5)*2.0,nexnorm.z); // unpack norm - ne.x = dot(nexnorm, norm); - vec3 neynorm = texture2DRect(normalMap, tc+vec2(sc,sc)).rgb; - neynorm = vec3((neynorm.xy-0.5)*2.0,neynorm.z); // unpack norm - ne.y = dot(neynorm, norm); + float depth = getDepth(tc); - ne = 1.0-ne; + vec4 diff = texture2DRect(diffuseRect, vary_fragcoord.xy); - ne = step(norm_cutoff, ne); + float sc = calc_cof(depth); + sc = min(abs(sc), max_cof); - gl_FragColor.a = dot(de,de)+dot(ne,ne); - //gl_FragColor.a = dot(de,de); + vec4 bloom = texture2D(bloomMap, vary_fragcoord.xy/screen_res); + gl_FragColor.rgb = diff.rgb + bloom.rgb; + gl_FragColor.a = sc/max_cof; } diff --git a/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskF.glsl index 933e50fed1..e9989a4e48 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskF.glsl @@ -1,5 +1,5 @@ /** - * @file diffuseF.glsl + * @file diffuseAlphaMaskF.glsl * * $LicenseInfo:firstyear=2011&license=viewerlgpl$ * Second Life Viewer Source Code @@ -22,20 +22,24 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - + +#ifdef DEFINE_GL_FRAGCOLOR +out vec4 gl_FragData[3]; +#endif uniform float minimum_alpha; -uniform float maximum_alpha; uniform sampler2D diffuseMap; -varying vec3 vary_normal; +VARYING vec3 vary_normal; +VARYING vec4 vertex_color; +VARYING vec2 vary_texcoord0; void main() { - vec4 col = gl_Color * texture2D(diffuseMap, gl_TexCoord[0].xy) * gl_Color; + vec4 col = texture2D(diffuseMap, vary_texcoord0.xy) * vertex_color; - if (col.a < minimum_alpha || col.a > maximum_alpha) + if (col.a < minimum_alpha) { discard; } diff --git a/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskIndexedF.glsl b/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskIndexedF.glsl index f3ad6f92de..fdf8d72b38 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskIndexedF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskIndexedF.glsl @@ -22,17 +22,23 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - -varying vec3 vary_normal; + +#ifdef DEFINE_GL_FRAGCOLOR +out vec4 gl_FragData[3]; +#endif + +VARYING vec3 vary_normal; uniform float minimum_alpha; -uniform float maximum_alpha; + +VARYING vec4 vertex_color; +VARYING vec2 vary_texcoord0; void main() { - vec4 col = diffuseLookup(gl_TexCoord[0].xy) * gl_Color; + vec4 col = diffuseLookup(vary_texcoord0.xy) * vertex_color; - if (col.a < minimum_alpha || col.a > maximum_alpha) + if (col.a < minimum_alpha) { discard; } diff --git a/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskNoColorF.glsl b/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskNoColorF.glsl new file mode 100644 index 0000000000..bb20e2ca47 --- /dev/null +++ b/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskNoColorF.glsl @@ -0,0 +1,52 @@ +/** + * @file diffuseAlphaMaskNoColorF.glsl + * + * $LicenseInfo:firstyear=2005&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2005, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + + +#ifdef DEFINE_GL_FRAGCOLOR +out vec4 gl_FragData[3]; +#endif + +uniform float minimum_alpha; + +uniform sampler2D diffuseMap; + +VARYING vec3 vary_normal; +VARYING vec2 vary_texcoord0; + +void main() +{ + vec4 col = texture2D(diffuseMap, vary_texcoord0.xy); + + if (col.a < minimum_alpha) + { + discard; + } + + gl_FragData[0] = vec4(col.rgb, 0.0); + gl_FragData[1] = vec4(0,0,0,0); // spec + vec3 nvn = normalize(vary_normal); + gl_FragData[2] = vec4(nvn.xy * 0.5 + 0.5, nvn.z, 0.0); +} + diff --git a/indra/newview/app_settings/shaders/class1/deferred/diffuseF.glsl b/indra/newview/app_settings/shaders/class1/deferred/diffuseF.glsl index 9c9a8b56c5..7bde49eb86 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/diffuseF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/diffuseF.glsl @@ -23,18 +23,22 @@ * $/LicenseInfo$ */ - +#ifdef DEFINE_GL_FRAGCOLOR +out vec4 gl_FragData[3]; +#endif uniform sampler2D diffuseMap; -varying vec3 vary_normal; +VARYING vec3 vary_normal; +VARYING vec4 vertex_color; +VARYING vec2 vary_texcoord0; void main() { - vec3 col = gl_Color.rgb * texture2D(diffuseMap, gl_TexCoord[0].xy).rgb; + vec3 col = vertex_color.rgb * texture2D(diffuseMap, vary_texcoord0.xy).rgb; gl_FragData[0] = vec4(col, 0.0); - gl_FragData[1] = gl_Color.aaaa; // spec - //gl_FragData[1] = vec4(vec3(gl_Color.a), gl_Color.a+(1.0-gl_Color.a)*gl_Color.a); // spec - from former class3 - maybe better, but not so well tested + gl_FragData[1] = vertex_color.aaaa; // spec + //gl_FragData[1] = vec4(vec3(vertex_color.a), vertex_color.a+(1.0-vertex_color.a)*vertex_color.a); // spec - from former class3 - maybe better, but not so well tested vec3 nvn = normalize(vary_normal); gl_FragData[2] = vec4(nvn.xy * 0.5 + 0.5, nvn.z, 0.0); } diff --git a/indra/newview/app_settings/shaders/class1/deferred/diffuseIndexedF.glsl b/indra/newview/app_settings/shaders/class1/deferred/diffuseIndexedF.glsl index 4d996a099d..75b45111e0 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/diffuseIndexedF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/diffuseIndexedF.glsl @@ -22,16 +22,22 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - -varying vec3 vary_normal; + +#ifdef DEFINE_GL_FRAGCOLOR +out vec4 gl_FragData[3]; +#endif + +VARYING vec3 vary_normal; +VARYING vec4 vertex_color; +VARYING vec2 vary_texcoord0; void main() { - vec3 col = gl_Color.rgb * diffuseLookup(gl_TexCoord[0].xy).rgb; + vec3 col = vertex_color.rgb * diffuseLookup(vary_texcoord0.xy).rgb; gl_FragData[0] = vec4(col, 0.0); - gl_FragData[1] = gl_Color.aaaa; // spec - //gl_FragData[1] = vec4(vec3(gl_Color.a), gl_Color.a+(1.0-gl_Color.a)*gl_Color.a); // spec - from former class3 - maybe better, but not so well tested + gl_FragData[1] = vertex_color.aaaa; // spec + //gl_FragData[1] = vec4(vec3(vertex_color.a), vertex_color.a+(1.0-vertex_color.a)*vertex_color.a); // spec - from former class3 - maybe better, but not so well tested vec3 nvn = normalize(vary_normal); gl_FragData[2] = vec4(nvn.xy * 0.5 + 0.5, nvn.z, 0.0); } diff --git a/indra/newview/app_settings/shaders/class1/deferred/diffuseNoColorV.glsl b/indra/newview/app_settings/shaders/class1/deferred/diffuseNoColorV.glsl new file mode 100644 index 0000000000..9461e3e32e --- /dev/null +++ b/indra/newview/app_settings/shaders/class1/deferred/diffuseNoColorV.glsl @@ -0,0 +1,45 @@ +/** + * @file diffuseNoColorV.glsl + * + * $LicenseInfo:firstyear=2007&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2007, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +uniform mat3 normal_matrix; +uniform mat4 texture_matrix0; +uniform mat4 modelview_projection_matrix; + +ATTRIBUTE vec3 position; +ATTRIBUTE vec3 normal; +ATTRIBUTE vec2 texcoord0; + +VARYING vec3 vary_normal; + +VARYING vec2 vary_texcoord0; + +void main() +{ + //transform vertex + gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0); + vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy; + + vary_normal = normalize(normal_matrix * normal); +} diff --git a/indra/newview/app_settings/shaders/class1/deferred/diffuseSkinnedV.glsl b/indra/newview/app_settings/shaders/class1/deferred/diffuseSkinnedV.glsl index 1470d7c9ca..a74290bfcd 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/diffuseSkinnedV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/diffuseSkinnedV.glsl @@ -22,29 +22,38 @@ * $/LicenseInfo$ */ +uniform mat4 projection_matrix; +uniform mat4 texture_matrix0; +uniform mat4 modelview_matrix; +ATTRIBUTE vec3 position; +ATTRIBUTE vec4 diffuse_color; +ATTRIBUTE vec3 normal; +ATTRIBUTE vec2 texcoord0; -varying vec3 vary_normal; +VARYING vec3 vary_normal; +VARYING vec4 vertex_color; +VARYING vec2 vary_texcoord0; mat4 getObjectSkinnedTransform(); void main() { - gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0; + vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy; mat4 mat = getObjectSkinnedTransform(); - mat = gl_ModelViewMatrix * mat; - vec3 pos = (mat*gl_Vertex).xyz; + mat = modelview_matrix * mat; + vec3 pos = (mat*vec4(position.xyz, 1.0)).xyz; - vec4 norm = gl_Vertex; - norm.xyz += gl_Normal.xyz; + vec4 norm = vec4(position.xyz, 1.0); + norm.xyz += normal.xyz; norm.xyz = (mat*norm).xyz; norm.xyz = normalize(norm.xyz-pos.xyz); vary_normal = norm.xyz; - gl_FrontColor = gl_Color; + vertex_color = diffuse_color; - gl_Position = gl_ProjectionMatrix*vec4(pos, 1.0); + gl_Position = projection_matrix*vec4(pos, 1.0); } diff --git a/indra/newview/app_settings/shaders/class1/deferred/diffuseV.glsl b/indra/newview/app_settings/shaders/class1/deferred/diffuseV.glsl index 7c5a4d35b3..76d29b1df7 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/diffuseV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/diffuseV.glsl @@ -22,20 +22,31 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - +uniform mat3 normal_matrix; +uniform mat4 texture_matrix0; +uniform mat4 modelview_projection_matrix; -varying vec3 vary_normal; -varying float vary_texture_index; +ATTRIBUTE vec3 position; +ATTRIBUTE vec4 diffuse_color; +ATTRIBUTE vec3 normal; +ATTRIBUTE vec2 texcoord0; + +VARYING vec3 vary_normal; + +VARYING vec4 vertex_color; +VARYING vec2 vary_texcoord0; + +void passTextureIndex(); void main() { //transform vertex - gl_Position = gl_ModelViewProjectionMatrix * vec4(gl_Vertex.xyz, 1.0); - gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0; + gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0); + vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy; - vary_texture_index = gl_Vertex.w; - vary_normal = normalize(gl_NormalMatrix * gl_Normal); + passTextureIndex(); + vary_normal = normalize(normal_matrix * normal); - gl_FrontColor = gl_Color; + vertex_color = diffuse_color; } diff --git a/indra/newview/app_settings/shaders/class1/deferred/dofCombineF.glsl b/indra/newview/app_settings/shaders/class1/deferred/dofCombineF.glsl new file mode 100644 index 0000000000..21453aefaa --- /dev/null +++ b/indra/newview/app_settings/shaders/class1/deferred/dofCombineF.glsl @@ -0,0 +1,67 @@ +/** + * @file dofCombineF.glsl + * + * $LicenseInfo:firstyear=2007&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2007, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#extension GL_ARB_texture_rectangle : enable + +#ifdef DEFINE_GL_FRAGCOLOR +out vec4 gl_FragColor; +#endif + +uniform sampler2DRect diffuseRect; +uniform sampler2DRect lightMap; + +uniform mat4 inv_proj; +uniform vec2 screen_res; + +uniform float max_cof; +uniform float res_scale; + +VARYING vec2 vary_fragcoord; + +void main() +{ + vec2 tc = vary_fragcoord.xy; + + vec4 dof = texture2DRect(diffuseRect, vary_fragcoord.xy*res_scale); + + vec4 diff = texture2DRect(lightMap, vary_fragcoord.xy); + + float a = min(diff.a * max_cof*res_scale*res_scale, 1.0); + + if (a > 0.25 && a < 0.75) + { //help out the transition a bit + float sc = a/res_scale; + + vec4 col; + col = texture2DRect(lightMap, vary_fragcoord.xy+vec2(sc,sc)); + col += texture2DRect(lightMap, vary_fragcoord.xy+vec2(-sc,sc)); + col += texture2DRect(lightMap, vary_fragcoord.xy+vec2(sc,-sc)); + col += texture2DRect(lightMap, vary_fragcoord.xy+vec2(-sc,-sc)); + + diff = mix(diff, col*0.25, a); + } + + gl_FragColor = mix(diff, dof, a); +} diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/emissiveF.glsl index f03b1fdc74..92f78125d8 100644 --- a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/emissiveF.glsl @@ -1,9 +1,9 @@ /** - * @file lightFullbrightF.glsl + * @file emissiveF.glsl * - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ + * $LicenseInfo:firstyear=2005&license=viewerlgpl$ * Second Life Viewer Source Code - * Copyright (C) 2007, Linden Research, Inc. + * Copyright (C) 2005, Linden Research, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -23,17 +23,26 @@ * $/LicenseInfo$ */ +#extension GL_ARB_texture_rectangle : enable +#ifdef DEFINE_GL_FRAGCOLOR +out vec4 gl_FragColor; +#endif vec3 fullbrightAtmosTransport(vec3 light); vec3 fullbrightScaleSoftClip(vec3 light); -void fullbright_lighting() +VARYING vec4 vertex_color; +VARYING vec2 vary_texcoord0; + +void main() { - vec4 color = diffuseLookup(gl_TexCoord[0].xy) * gl_Color; + float shadow = 1.0; + + vec4 color = diffuseLookup(vary_texcoord0.xy)*vertex_color; color.rgb = fullbrightAtmosTransport(color.rgb); - + color.rgb = fullbrightScaleSoftClip(color.rgb); gl_FragColor = color; diff --git a/indra/newview/app_settings/shaders/class1/deferred/emissiveV.glsl b/indra/newview/app_settings/shaders/class1/deferred/emissiveV.glsl new file mode 100644 index 0000000000..115b04797f --- /dev/null +++ b/indra/newview/app_settings/shaders/class1/deferred/emissiveV.glsl @@ -0,0 +1,63 @@ +/** + * @file emissiveV.glsl + * + * $LicenseInfo:firstyear=2007&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2007, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +uniform mat4 texture_matrix0; +uniform mat4 modelview_matrix; +uniform mat4 modelview_projection_matrix; + +ATTRIBUTE vec3 position; +void passTextureIndex(); +ATTRIBUTE vec4 emissive; +ATTRIBUTE vec2 texcoord0; + +void calcAtmospherics(vec3 inPositionEye); + +vec3 atmosAmbient(vec3 light); +vec3 atmosAffectDirectionalLight(float lightIntensity); +vec3 scaleDownLight(vec3 light); +vec3 scaleUpLight(vec3 light); + + +VARYING vec4 vertex_color; +VARYING vec2 vary_texcoord0; + + +void main() +{ + //transform vertex + vec4 vert = vec4(position.xyz, 1.0); + vec4 pos = (modelview_matrix * vert); + passTextureIndex(); + + gl_Position = modelview_projection_matrix*vec4(position.xyz, 1.0); + + vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy; + + calcAtmospherics(pos.xyz); + + vertex_color = emissive; + + +} diff --git a/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl index 6c506676af..84ae2f9f10 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl @@ -23,9 +23,14 @@ * $/LicenseInfo$ */ +#extension GL_ARB_texture_rectangle : enable +#ifdef DEFINE_GL_FRAGCOLOR +out vec4 gl_FragColor; +#endif -#extension GL_ARB_texture_rectangle : enable +VARYING vec4 vertex_color; +VARYING vec2 vary_texcoord0; vec3 fullbrightAtmosTransport(vec3 light); vec3 fullbrightScaleSoftClip(vec3 light); @@ -35,7 +40,7 @@ void main() { float shadow = 1.0; - vec4 color = diffuseLookup(gl_TexCoord[0].xy)*gl_Color; + vec4 color = diffuseLookup(vary_texcoord0.xy)*vertex_color; color.rgb = fullbrightAtmosTransport(color.rgb); diff --git a/indra/newview/app_settings/shaders/class1/deferred/fullbrightV.glsl b/indra/newview/app_settings/shaders/class1/deferred/fullbrightV.glsl index a4ff0b80e2..2e6982d101 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/fullbrightV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/fullbrightV.glsl @@ -22,8 +22,16 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - +uniform mat4 texture_matrix0; +uniform mat4 modelview_matrix; +uniform mat4 modelview_projection_matrix; + + +ATTRIBUTE vec3 position; +void passTextureIndex(); +ATTRIBUTE vec4 diffuse_color; +ATTRIBUTE vec2 texcoord0; void calcAtmospherics(vec3 inPositionEye); @@ -32,23 +40,25 @@ vec3 atmosAffectDirectionalLight(float lightIntensity); vec3 scaleDownLight(vec3 light); vec3 scaleUpLight(vec3 light); -varying float vary_texture_index; + +VARYING vec4 vertex_color; +VARYING vec2 vary_texcoord0; + void main() { //transform vertex - vec4 vert = vec4(gl_Vertex.xyz, 1.0); - vary_texture_index = gl_Vertex.w; + vec4 vert = vec4(position.xyz, 1.0); + vec4 pos = (modelview_matrix * vert); + passTextureIndex(); - gl_Position = gl_ModelViewProjectionMatrix*vert; + gl_Position = modelview_projection_matrix*vec4(position.xyz, 1.0); - gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0; + vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy; - vec4 pos = (gl_ModelViewMatrix * vert); - calcAtmospherics(pos.xyz); - gl_FrontColor = gl_Color; + vertex_color = diffuse_color; - gl_FogFragCoord = pos.z; + } diff --git a/indra/newview/app_settings/shaders/class1/deferred/fxaaF.glsl b/indra/newview/app_settings/shaders/class1/deferred/fxaaF.glsl new file mode 100644 index 0000000000..5af9406452 --- /dev/null +++ b/indra/newview/app_settings/shaders/class1/deferred/fxaaF.glsl @@ -0,0 +1,2118 @@ +/** + * @file fxaaF.glsl + * + * $LicenseInfo:firstyear=2007&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2007, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#extension GL_ARB_texture_rectangle : enable + +#ifdef DEFINE_GL_FRAGCOLOR +out vec4 gl_FragColor; +#endif + +#define FXAA_PC 1 +//#define FXAA_GLSL_130 1 +#define FXAA_QUALITY__PRESET 12 + +/*============================================================================ + + + NVIDIA FXAA 3.11 by TIMOTHY LOTTES + + +------------------------------------------------------------------------------ +COPYRIGHT (C) 2010, 2011 NVIDIA CORPORATION. ALL RIGHTS RESERVED. +------------------------------------------------------------------------------ +TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, THIS SOFTWARE IS PROVIDED +*AS IS* AND NVIDIA AND ITS SUPPLIERS DISCLAIM ALL WARRANTIES, EITHER EXPRESS +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL NVIDIA +OR ITS SUPPLIERS BE LIABLE FOR ANY SPECIAL, INCIDENTAL, INDIRECT, OR +CONSEQUENTIAL DAMAGES WHATSOEVER (INCLUDING, WITHOUT LIMITATION, DAMAGES FOR +LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF BUSINESS INFORMATION, +OR ANY OTHER PECUNIARY LOSS) ARISING OUT OF THE USE OF OR INABILITY TO USE +THIS SOFTWARE, EVEN IF NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + +------------------------------------------------------------------------------ + INTEGRATION CHECKLIST +------------------------------------------------------------------------------ +(1.) +In the shader source, setup defines for the desired configuration. +When providing multiple shaders (for different presets), +simply setup the defines differently in multiple files. +Example, + + #define FXAA_PC 1 + #define FXAA_HLSL_5 1 + #define FXAA_QUALITY__PRESET 12 + +Or, + + #define FXAA_360 1 + +Or, + + #define FXAA_PS3 1 + +Etc. + +(2.) +Then include this file, + + #include "Fxaa3_11.h" + +(3.) +Then call the FXAA pixel shader from within your desired shader. +Look at the FXAA Quality FxaaPixelShader() for docs on inputs. +As for FXAA 3.11 all inputs for all shaders are the same +to enable easy porting between platforms. + + return FxaaPixelShader(...); + +(4.) +Insure pass prior to FXAA outputs RGBL (see next section). +Or use, + + #define FXAA_GREEN_AS_LUMA 1 + +(5.) +Setup engine to provide the following constants +which are used in the FxaaPixelShader() inputs, + + FxaaFloat2 fxaaQualityRcpFrame, + FxaaFloat4 fxaaConsoleRcpFrameOpt, + FxaaFloat4 fxaaConsoleRcpFrameOpt2, + FxaaFloat4 fxaaConsole360RcpFrameOpt2, + FxaaFloat fxaaQualitySubpix, + FxaaFloat fxaaQualityEdgeThreshold, + FxaaFloat fxaaQualityEdgeThresholdMin, + FxaaFloat fxaaConsoleEdgeSharpness, + FxaaFloat fxaaConsoleEdgeThreshold, + FxaaFloat fxaaConsoleEdgeThresholdMin, + FxaaFloat4 fxaaConsole360ConstDir + +Look at the FXAA Quality FxaaPixelShader() for docs on inputs. + +(6.) +Have FXAA vertex shader run as a full screen triangle, +and output "pos" and "fxaaConsolePosPos" +such that inputs in the pixel shader provide, + + // {xy} = center of pixel + FxaaFloat2 pos, + + // {xy__} = upper left of pixel + // {__zw} = lower right of pixel + FxaaFloat4 fxaaConsolePosPos, + +(7.) +Insure the texture sampler(s) used by FXAA are set to bilinear filtering. + + +------------------------------------------------------------------------------ + INTEGRATION - RGBL AND COLORSPACE +------------------------------------------------------------------------------ +FXAA3 requires RGBL as input unless the following is set, + + #define FXAA_GREEN_AS_LUMA 1 + +In which case the engine uses green in place of luma, +and requires RGB input is in a non-linear colorspace. + +RGB should be LDR (low dynamic range). +Specifically do FXAA after tonemapping. + +RGB data as returned by a texture fetch can be non-linear, +or linear when FXAA_GREEN_AS_LUMA is not set. +Note an "sRGB format" texture counts as linear, +because the result of a texture fetch is linear data. +Regular "RGBA8" textures in the sRGB colorspace are non-linear. + +If FXAA_GREEN_AS_LUMA is not set, +luma must be stored in the alpha channel prior to running FXAA. +This luma should be in a perceptual space (could be gamma 2.0). +Example pass before FXAA where output is gamma 2.0 encoded, + + color.rgb = ToneMap(color.rgb); // linear color output + color.rgb = sqrt(color.rgb); // gamma 2.0 color output + return color; + +To use FXAA, + + color.rgb = ToneMap(color.rgb); // linear color output + color.rgb = sqrt(color.rgb); // gamma 2.0 color output + color.a = dot(color.rgb, FxaaFloat3(0.299, 0.587, 0.114)); // compute luma + return color; + +Another example where output is linear encoded, +say for instance writing to an sRGB formated render target, +where the render target does the conversion back to sRGB after blending, + + color.rgb = ToneMap(color.rgb); // linear color output + return color; + +To use FXAA, + + color.rgb = ToneMap(color.rgb); // linear color output + color.a = sqrt(dot(color.rgb, FxaaFloat3(0.299, 0.587, 0.114))); // compute luma + return color; + +Getting luma correct is required for the algorithm to work correctly. + + +------------------------------------------------------------------------------ + BEING LINEARLY CORRECT? +------------------------------------------------------------------------------ +Applying FXAA to a framebuffer with linear RGB color will look worse. +This is very counter intuitive, but happends to be true in this case. +The reason is because dithering artifacts will be more visiable +in a linear colorspace. + + +------------------------------------------------------------------------------ + COMPLEX INTEGRATION +------------------------------------------------------------------------------ +Q. What if the engine is blending into RGB before wanting to run FXAA? + +A. In the last opaque pass prior to FXAA, + have the pass write out luma into alpha. + Then blend into RGB only. + FXAA should be able to run ok + assuming the blending pass did not any add aliasing. + This should be the common case for particles and common blending passes. + +A. Or use FXAA_GREEN_AS_LUMA. + +============================================================================*/ + +/*============================================================================ + + INTEGRATION KNOBS + +============================================================================*/ +// +// FXAA_PS3 and FXAA_360 choose the console algorithm (FXAA3 CONSOLE). +// FXAA_360_OPT is a prototype for the new optimized 360 version. +// +// 1 = Use API. +// 0 = Don't use API. +// +/*--------------------------------------------------------------------------*/ +#ifndef FXAA_PS3 + #define FXAA_PS3 0 +#endif +/*--------------------------------------------------------------------------*/ +#ifndef FXAA_360 + #define FXAA_360 0 +#endif +/*--------------------------------------------------------------------------*/ +#ifndef FXAA_360_OPT + #define FXAA_360_OPT 0 +#endif +/*==========================================================================*/ +#ifndef FXAA_PC + // + // FXAA Quality + // The high quality PC algorithm. + // + #define FXAA_PC 0 +#endif +/*--------------------------------------------------------------------------*/ +#ifndef FXAA_PC_CONSOLE + // + // The console algorithm for PC is included + // for developers targeting really low spec machines. + // Likely better to just run FXAA_PC, and use a really low preset. + // + #define FXAA_PC_CONSOLE 0 +#endif +/*--------------------------------------------------------------------------*/ +#ifndef FXAA_GLSL_120 + #define FXAA_GLSL_120 0 +#endif +/*--------------------------------------------------------------------------*/ +#ifndef FXAA_GLSL_130 + #define FXAA_GLSL_130 0 +#endif +/*--------------------------------------------------------------------------*/ +#ifndef FXAA_HLSL_3 + #define FXAA_HLSL_3 0 +#endif +/*--------------------------------------------------------------------------*/ +#ifndef FXAA_HLSL_4 + #define FXAA_HLSL_4 0 +#endif +/*--------------------------------------------------------------------------*/ +#ifndef FXAA_HLSL_5 + #define FXAA_HLSL_5 0 +#endif +/*==========================================================================*/ +#ifndef FXAA_GREEN_AS_LUMA + // + // For those using non-linear color, + // and either not able to get luma in alpha, or not wanting to, + // this enables FXAA to run using green as a proxy for luma. + // So with this enabled, no need to pack luma in alpha. + // + // This will turn off AA on anything which lacks some amount of green. + // Pure red and blue or combination of only R and B, will get no AA. + // + // Might want to lower the settings for both, + // fxaaConsoleEdgeThresholdMin + // fxaaQualityEdgeThresholdMin + // In order to insure AA does not get turned off on colors + // which contain a minor amount of green. + // + // 1 = On. + // 0 = Off. + // + #define FXAA_GREEN_AS_LUMA 0 +#endif +/*--------------------------------------------------------------------------*/ +#ifndef FXAA_EARLY_EXIT + // + // Controls algorithm's early exit path. + // On PS3 turning this ON adds 2 cycles to the shader. + // On 360 turning this OFF adds 10ths of a millisecond to the shader. + // Turning this off on console will result in a more blurry image. + // So this defaults to on. + // + // 1 = On. + // 0 = Off. + // + #define FXAA_EARLY_EXIT 1 +#endif +/*--------------------------------------------------------------------------*/ +#ifndef FXAA_DISCARD + // + // Only valid for PC OpenGL currently. + // Probably will not work when FXAA_GREEN_AS_LUMA = 1. + // + // 1 = Use discard on pixels which don't need AA. + // For APIs which enable concurrent TEX+ROP from same surface. + // 0 = Return unchanged color on pixels which don't need AA. + // + #define FXAA_DISCARD 0 +#endif +/*--------------------------------------------------------------------------*/ +#ifndef FXAA_FAST_PIXEL_OFFSET + // + // Used for GLSL 120 only. + // + // 1 = GL API supports fast pixel offsets + // 0 = do not use fast pixel offsets + // + #ifdef GL_EXT_gpu_shader4 + #define FXAA_FAST_PIXEL_OFFSET 1 + #endif + #ifdef GL_NV_gpu_shader5 + #define FXAA_FAST_PIXEL_OFFSET 1 + #endif + #ifdef GL_ARB_gpu_shader5 + #define FXAA_FAST_PIXEL_OFFSET 1 + #endif + #ifndef FXAA_FAST_PIXEL_OFFSET + #define FXAA_FAST_PIXEL_OFFSET 0 + #endif +#endif +/*--------------------------------------------------------------------------*/ +#ifndef FXAA_GATHER4_ALPHA + // + // 1 = API supports gather4 on alpha channel. + // 0 = API does not support gather4 on alpha channel. + // + #if (FXAA_HLSL_5 == 1) + #define FXAA_GATHER4_ALPHA 1 + #endif + #ifdef GL_ARB_gpu_shader5 + #define FXAA_GATHER4_ALPHA 1 + #endif + #ifdef GL_NV_gpu_shader5 + #define FXAA_GATHER4_ALPHA 1 + #endif + #ifndef FXAA_GATHER4_ALPHA + #define FXAA_GATHER4_ALPHA 0 + #endif +#endif + +/*============================================================================ + FXAA CONSOLE PS3 - TUNING KNOBS +============================================================================*/ +#ifndef FXAA_CONSOLE__PS3_EDGE_SHARPNESS + // + // Consoles the sharpness of edges on PS3 only. + // Non-PS3 tuning is done with shader input. + // + // Due to the PS3 being ALU bound, + // there are only two safe values here: 4 and 8. + // These options use the shaders ability to a free *|/ by 2|4|8. + // + // 8.0 is sharper + // 4.0 is softer + // 2.0 is really soft (good for vector graphics inputs) + // + #if 1 + #define FXAA_CONSOLE__PS3_EDGE_SHARPNESS 8.0 + #endif + #if 0 + #define FXAA_CONSOLE__PS3_EDGE_SHARPNESS 4.0 + #endif + #if 0 + #define FXAA_CONSOLE__PS3_EDGE_SHARPNESS 2.0 + #endif +#endif +/*--------------------------------------------------------------------------*/ +#ifndef FXAA_CONSOLE__PS3_EDGE_THRESHOLD + // + // Only effects PS3. + // Non-PS3 tuning is done with shader input. + // + // The minimum amount of local contrast required to apply algorithm. + // The console setting has a different mapping than the quality setting. + // + // This only applies when FXAA_EARLY_EXIT is 1. + // + // Due to the PS3 being ALU bound, + // there are only two safe values here: 0.25 and 0.125. + // These options use the shaders ability to a free *|/ by 2|4|8. + // + // 0.125 leaves less aliasing, but is softer + // 0.25 leaves more aliasing, and is sharper + // + #if 1 + #define FXAA_CONSOLE__PS3_EDGE_THRESHOLD 0.125 + #else + #define FXAA_CONSOLE__PS3_EDGE_THRESHOLD 0.25 + #endif +#endif + +/*============================================================================ + FXAA QUALITY - TUNING KNOBS +------------------------------------------------------------------------------ +NOTE the other tuning knobs are now in the shader function inputs! +============================================================================*/ +#ifndef FXAA_QUALITY__PRESET + // + // Choose the quality preset. + // This needs to be compiled into the shader as it effects code. + // Best option to include multiple presets is to + // in each shader define the preset, then include this file. + // + // OPTIONS + // ----------------------------------------------------------------------- + // 10 to 15 - default medium dither (10=fastest, 15=highest quality) + // 20 to 29 - less dither, more expensive (20=fastest, 29=highest quality) + // 39 - no dither, very expensive + // + // NOTES + // ----------------------------------------------------------------------- + // 12 = slightly faster then FXAA 3.9 and higher edge quality (default) + // 13 = about same speed as FXAA 3.9 and better than 12 + // 23 = closest to FXAA 3.9 visually and performance wise + // _ = the lowest digit is directly related to performance + // _ = the highest digit is directly related to style + // + #define FXAA_QUALITY__PRESET 12 +#endif + + +/*============================================================================ + + FXAA QUALITY - PRESETS + +============================================================================*/ + +/*============================================================================ + FXAA QUALITY - MEDIUM DITHER PRESETS +============================================================================*/ +#if (FXAA_QUALITY__PRESET == 10) + #define FXAA_QUALITY__PS 3 + #define FXAA_QUALITY__P0 1.5 + #define FXAA_QUALITY__P1 3.0 + #define FXAA_QUALITY__P2 12.0 +#endif +/*--------------------------------------------------------------------------*/ +#if (FXAA_QUALITY__PRESET == 11) + #define FXAA_QUALITY__PS 4 + #define FXAA_QUALITY__P0 1.0 + #define FXAA_QUALITY__P1 1.5 + #define FXAA_QUALITY__P2 3.0 + #define FXAA_QUALITY__P3 12.0 +#endif +/*--------------------------------------------------------------------------*/ +#if (FXAA_QUALITY__PRESET == 12) + #define FXAA_QUALITY__PS 5 + #define FXAA_QUALITY__P0 1.0 + #define FXAA_QUALITY__P1 1.5 + #define FXAA_QUALITY__P2 2.0 + #define FXAA_QUALITY__P3 4.0 + #define FXAA_QUALITY__P4 12.0 +#endif +/*--------------------------------------------------------------------------*/ +#if (FXAA_QUALITY__PRESET == 13) + #define FXAA_QUALITY__PS 6 + #define FXAA_QUALITY__P0 1.0 + #define FXAA_QUALITY__P1 1.5 + #define FXAA_QUALITY__P2 2.0 + #define FXAA_QUALITY__P3 2.0 + #define FXAA_QUALITY__P4 4.0 + #define FXAA_QUALITY__P5 12.0 +#endif +/*--------------------------------------------------------------------------*/ +#if (FXAA_QUALITY__PRESET == 14) + #define FXAA_QUALITY__PS 7 + #define FXAA_QUALITY__P0 1.0 + #define FXAA_QUALITY__P1 1.5 + #define FXAA_QUALITY__P2 2.0 + #define FXAA_QUALITY__P3 2.0 + #define FXAA_QUALITY__P4 2.0 + #define FXAA_QUALITY__P5 4.0 + #define FXAA_QUALITY__P6 12.0 +#endif +/*--------------------------------------------------------------------------*/ +#if (FXAA_QUALITY__PRESET == 15) + #define FXAA_QUALITY__PS 8 + #define FXAA_QUALITY__P0 1.0 + #define FXAA_QUALITY__P1 1.5 + #define FXAA_QUALITY__P2 2.0 + #define FXAA_QUALITY__P3 2.0 + #define FXAA_QUALITY__P4 2.0 + #define FXAA_QUALITY__P5 2.0 + #define FXAA_QUALITY__P6 4.0 + #define FXAA_QUALITY__P7 12.0 +#endif + +/*============================================================================ + FXAA QUALITY - LOW DITHER PRESETS +============================================================================*/ +#if (FXAA_QUALITY__PRESET == 20) + #define FXAA_QUALITY__PS 3 + #define FXAA_QUALITY__P0 1.5 + #define FXAA_QUALITY__P1 2.0 + #define FXAA_QUALITY__P2 8.0 +#endif +/*--------------------------------------------------------------------------*/ +#if (FXAA_QUALITY__PRESET == 21) + #define FXAA_QUALITY__PS 4 + #define FXAA_QUALITY__P0 1.0 + #define FXAA_QUALITY__P1 1.5 + #define FXAA_QUALITY__P2 2.0 + #define FXAA_QUALITY__P3 8.0 +#endif +/*--------------------------------------------------------------------------*/ +#if (FXAA_QUALITY__PRESET == 22) + #define FXAA_QUALITY__PS 5 + #define FXAA_QUALITY__P0 1.0 + #define FXAA_QUALITY__P1 1.5 + #define FXAA_QUALITY__P2 2.0 + #define FXAA_QUALITY__P3 2.0 + #define FXAA_QUALITY__P4 8.0 +#endif +/*--------------------------------------------------------------------------*/ +#if (FXAA_QUALITY__PRESET == 23) + #define FXAA_QUALITY__PS 6 + #define FXAA_QUALITY__P0 1.0 + #define FXAA_QUALITY__P1 1.5 + #define FXAA_QUALITY__P2 2.0 + #define FXAA_QUALITY__P3 2.0 + #define FXAA_QUALITY__P4 2.0 + #define FXAA_QUALITY__P5 8.0 +#endif +/*--------------------------------------------------------------------------*/ +#if (FXAA_QUALITY__PRESET == 24) + #define FXAA_QUALITY__PS 7 + #define FXAA_QUALITY__P0 1.0 + #define FXAA_QUALITY__P1 1.5 + #define FXAA_QUALITY__P2 2.0 + #define FXAA_QUALITY__P3 2.0 + #define FXAA_QUALITY__P4 2.0 + #define FXAA_QUALITY__P5 3.0 + #define FXAA_QUALITY__P6 8.0 +#endif +/*--------------------------------------------------------------------------*/ +#if (FXAA_QUALITY__PRESET == 25) + #define FXAA_QUALITY__PS 8 + #define FXAA_QUALITY__P0 1.0 + #define FXAA_QUALITY__P1 1.5 + #define FXAA_QUALITY__P2 2.0 + #define FXAA_QUALITY__P3 2.0 + #define FXAA_QUALITY__P4 2.0 + #define FXAA_QUALITY__P5 2.0 + #define FXAA_QUALITY__P6 4.0 + #define FXAA_QUALITY__P7 8.0 +#endif +/*--------------------------------------------------------------------------*/ +#if (FXAA_QUALITY__PRESET == 26) + #define FXAA_QUALITY__PS 9 + #define FXAA_QUALITY__P0 1.0 + #define FXAA_QUALITY__P1 1.5 + #define FXAA_QUALITY__P2 2.0 + #define FXAA_QUALITY__P3 2.0 + #define FXAA_QUALITY__P4 2.0 + #define FXAA_QUALITY__P5 2.0 + #define FXAA_QUALITY__P6 2.0 + #define FXAA_QUALITY__P7 4.0 + #define FXAA_QUALITY__P8 8.0 +#endif +/*--------------------------------------------------------------------------*/ +#if (FXAA_QUALITY__PRESET == 27) + #define FXAA_QUALITY__PS 10 + #define FXAA_QUALITY__P0 1.0 + #define FXAA_QUALITY__P1 1.5 + #define FXAA_QUALITY__P2 2.0 + #define FXAA_QUALITY__P3 2.0 + #define FXAA_QUALITY__P4 2.0 + #define FXAA_QUALITY__P5 2.0 + #define FXAA_QUALITY__P6 2.0 + #define FXAA_QUALITY__P7 2.0 + #define FXAA_QUALITY__P8 4.0 + #define FXAA_QUALITY__P9 8.0 +#endif +/*--------------------------------------------------------------------------*/ +#if (FXAA_QUALITY__PRESET == 28) + #define FXAA_QUALITY__PS 11 + #define FXAA_QUALITY__P0 1.0 + #define FXAA_QUALITY__P1 1.5 + #define FXAA_QUALITY__P2 2.0 + #define FXAA_QUALITY__P3 2.0 + #define FXAA_QUALITY__P4 2.0 + #define FXAA_QUALITY__P5 2.0 + #define FXAA_QUALITY__P6 2.0 + #define FXAA_QUALITY__P7 2.0 + #define FXAA_QUALITY__P8 2.0 + #define FXAA_QUALITY__P9 4.0 + #define FXAA_QUALITY__P10 8.0 +#endif +/*--------------------------------------------------------------------------*/ +#if (FXAA_QUALITY__PRESET == 29) + #define FXAA_QUALITY__PS 12 + #define FXAA_QUALITY__P0 1.0 + #define FXAA_QUALITY__P1 1.5 + #define FXAA_QUALITY__P2 2.0 + #define FXAA_QUALITY__P3 2.0 + #define FXAA_QUALITY__P4 2.0 + #define FXAA_QUALITY__P5 2.0 + #define FXAA_QUALITY__P6 2.0 + #define FXAA_QUALITY__P7 2.0 + #define FXAA_QUALITY__P8 2.0 + #define FXAA_QUALITY__P9 2.0 + #define FXAA_QUALITY__P10 4.0 + #define FXAA_QUALITY__P11 8.0 +#endif + +/*============================================================================ + FXAA QUALITY - EXTREME QUALITY +============================================================================*/ +#if (FXAA_QUALITY__PRESET == 39) + #define FXAA_QUALITY__PS 12 + #define FXAA_QUALITY__P0 1.0 + #define FXAA_QUALITY__P1 1.0 + #define FXAA_QUALITY__P2 1.0 + #define FXAA_QUALITY__P3 1.0 + #define FXAA_QUALITY__P4 1.0 + #define FXAA_QUALITY__P5 1.5 + #define FXAA_QUALITY__P6 2.0 + #define FXAA_QUALITY__P7 2.0 + #define FXAA_QUALITY__P8 2.0 + #define FXAA_QUALITY__P9 2.0 + #define FXAA_QUALITY__P10 4.0 + #define FXAA_QUALITY__P11 8.0 +#endif + + + +/*============================================================================ + + API PORTING + +============================================================================*/ +#if (FXAA_GLSL_120 == 1) || (FXAA_GLSL_130 == 1) + #define FxaaBool bool + #define FxaaDiscard discard + #define FxaaFloat float + #define FxaaFloat2 vec2 + #define FxaaFloat3 vec3 + #define FxaaFloat4 vec4 + #define FxaaHalf float + #define FxaaHalf2 vec2 + #define FxaaHalf3 vec3 + #define FxaaHalf4 vec4 + #define FxaaInt2 ivec2 + #define FxaaSat(x) clamp(x, 0.0, 1.0) + #define FxaaTex sampler2D +#else + #define FxaaBool bool + #define FxaaDiscard clip(-1) + #define FxaaFloat float + #define FxaaFloat2 float2 + #define FxaaFloat3 float3 + #define FxaaFloat4 float4 + #define FxaaHalf half + #define FxaaHalf2 half2 + #define FxaaHalf3 half3 + #define FxaaHalf4 half4 + #define FxaaSat(x) saturate(x) +#endif +/*--------------------------------------------------------------------------*/ +#if (FXAA_GLSL_120 == 1) + // Requires, + // #version 120 + // And at least, + // #extension GL_EXT_gpu_shader4 : enable + // (or set FXAA_FAST_PIXEL_OFFSET 1 to work like DX9) + #define FxaaTexTop(t, p) texture2DLod(t, p, 0.0) + #if (FXAA_FAST_PIXEL_OFFSET == 1) + #define FxaaTexOff(t, p, o, r) texture2DLodOffset(t, p, 0.0, o) + #else + #define FxaaTexOff(t, p, o, r) texture2DLod(t, p + (o * r), 0.0) + #endif + #if (FXAA_GATHER4_ALPHA == 1) + // use #extension GL_ARB_gpu_shader5 : enable + #define FxaaTexAlpha4(t, p) textureGather(t, p, 3) + #define FxaaTexOffAlpha4(t, p, o) textureGatherOffset(t, p, o, 3) + #define FxaaTexGreen4(t, p) textureGather(t, p, 1) + #define FxaaTexOffGreen4(t, p, o) textureGatherOffset(t, p, o, 1) + #endif +#endif +/*--------------------------------------------------------------------------*/ +#if (FXAA_GLSL_130 == 1) + // Requires "#version 130" or better + #define FxaaTexTop(t, p) textureLod(t, p, 0.0) + #define FxaaTexOff(t, p, o, r) textureLodOffset(t, p, 0.0, o) + #if (FXAA_GATHER4_ALPHA == 1) + // use #extension GL_ARB_gpu_shader5 : enable + #define FxaaTexAlpha4(t, p) textureGather(t, p, 3) + #define FxaaTexOffAlpha4(t, p, o) textureGatherOffset(t, p, o, 3) + #define FxaaTexGreen4(t, p) textureGather(t, p, 1) + #define FxaaTexOffGreen4(t, p, o) textureGatherOffset(t, p, o, 1) + #endif +#endif +/*--------------------------------------------------------------------------*/ +#if (FXAA_HLSL_3 == 1) || (FXAA_360 == 1) || (FXAA_PS3 == 1) + #define FxaaInt2 float2 + #define FxaaTex sampler2D + #define FxaaTexTop(t, p) tex2Dlod(t, float4(p, 0.0, 0.0)) + #define FxaaTexOff(t, p, o, r) tex2Dlod(t, float4(p + (o * r), 0, 0)) +#endif +/*--------------------------------------------------------------------------*/ +#if (FXAA_HLSL_4 == 1) + #define FxaaInt2 int2 + struct FxaaTex { SamplerState smpl; Texture2D tex; }; + #define FxaaTexTop(t, p) t.tex.SampleLevel(t.smpl, p, 0.0) + #define FxaaTexOff(t, p, o, r) t.tex.SampleLevel(t.smpl, p, 0.0, o) +#endif +/*--------------------------------------------------------------------------*/ +#if (FXAA_HLSL_5 == 1) + #define FxaaInt2 int2 + struct FxaaTex { SamplerState smpl; Texture2D tex; }; + #define FxaaTexTop(t, p) t.tex.SampleLevel(t.smpl, p, 0.0) + #define FxaaTexOff(t, p, o, r) t.tex.SampleLevel(t.smpl, p, 0.0, o) + #define FxaaTexAlpha4(t, p) t.tex.GatherAlpha(t.smpl, p) + #define FxaaTexOffAlpha4(t, p, o) t.tex.GatherAlpha(t.smpl, p, o) + #define FxaaTexGreen4(t, p) t.tex.GatherGreen(t.smpl, p) + #define FxaaTexOffGreen4(t, p, o) t.tex.GatherGreen(t.smpl, p, o) +#endif + + +/*============================================================================ + GREEN AS LUMA OPTION SUPPORT FUNCTION +============================================================================*/ +#if (FXAA_GREEN_AS_LUMA == 0) + FxaaFloat FxaaLuma(FxaaFloat4 rgba) { return rgba.w; } +#else + FxaaFloat FxaaLuma(FxaaFloat4 rgba) { return rgba.y; } +#endif + + + + +/*============================================================================ + + FXAA3 QUALITY - PC + +============================================================================*/ +#if (FXAA_PC == 1) +/*--------------------------------------------------------------------------*/ +FxaaFloat4 FxaaPixelShader( + // + // Use noperspective interpolation here (turn off perspective interpolation). + // {xy} = center of pixel + FxaaFloat2 pos, + // + // Used only for FXAA Console, and not used on the 360 version. + // Use noperspective interpolation here (turn off perspective interpolation). + // {xy__} = upper left of pixel + // {__zw} = lower right of pixel + FxaaFloat4 fxaaConsolePosPos, + // + // Input color texture. + // {rgb_} = color in linear or perceptual color space + // if (FXAA_GREEN_AS_LUMA == 0) + // {___a} = luma in perceptual color space (not linear) + FxaaTex tex, + // + // Only used on the optimized 360 version of FXAA Console. + // For everything but 360, just use the same input here as for "tex". + // For 360, same texture, just alias with a 2nd sampler. + // This sampler needs to have an exponent bias of -1. + FxaaTex fxaaConsole360TexExpBiasNegOne, + // + // Only used on the optimized 360 version of FXAA Console. + // For everything but 360, just use the same input here as for "tex". + // For 360, same texture, just alias with a 3nd sampler. + // This sampler needs to have an exponent bias of -2. + FxaaTex fxaaConsole360TexExpBiasNegTwo, + // + // Only used on FXAA Quality. + // This must be from a constant/uniform. + // {x_} = 1.0/screenWidthInPixels + // {_y} = 1.0/screenHeightInPixels + FxaaFloat2 fxaaQualityRcpFrame, + // + // Only used on FXAA Console. + // This must be from a constant/uniform. + // This effects sub-pixel AA quality and inversely sharpness. + // Where N ranges between, + // N = 0.50 (default) + // N = 0.33 (sharper) + // {x___} = -N/screenWidthInPixels + // {_y__} = -N/screenHeightInPixels + // {__z_} = N/screenWidthInPixels + // {___w} = N/screenHeightInPixels + FxaaFloat4 fxaaConsoleRcpFrameOpt, + // + // Only used on FXAA Console. + // Not used on 360, but used on PS3 and PC. + // This must be from a constant/uniform. + // {x___} = -2.0/screenWidthInPixels + // {_y__} = -2.0/screenHeightInPixels + // {__z_} = 2.0/screenWidthInPixels + // {___w} = 2.0/screenHeightInPixels + FxaaFloat4 fxaaConsoleRcpFrameOpt2, + // + // Only used on FXAA Console. + // Only used on 360 in place of fxaaConsoleRcpFrameOpt2. + // This must be from a constant/uniform. + // {x___} = 8.0/screenWidthInPixels + // {_y__} = 8.0/screenHeightInPixels + // {__z_} = -4.0/screenWidthInPixels + // {___w} = -4.0/screenHeightInPixels + FxaaFloat4 fxaaConsole360RcpFrameOpt2, + // + // Only used on FXAA Quality. + // This used to be the FXAA_QUALITY__SUBPIX define. + // It is here now to allow easier tuning. + // Choose the amount of sub-pixel aliasing removal. + // This can effect sharpness. + // 1.00 - upper limit (softer) + // 0.75 - default amount of filtering + // 0.50 - lower limit (sharper, less sub-pixel aliasing removal) + // 0.25 - almost off + // 0.00 - completely off + FxaaFloat fxaaQualitySubpix, + // + // Only used on FXAA Quality. + // This used to be the FXAA_QUALITY__EDGE_THRESHOLD define. + // It is here now to allow easier tuning. + // The minimum amount of local contrast required to apply algorithm. + // 0.333 - too little (faster) + // 0.250 - low quality + // 0.166 - default + // 0.125 - high quality + // 0.063 - overkill (slower) + FxaaFloat fxaaQualityEdgeThreshold, + // + // Only used on FXAA Quality. + // This used to be the FXAA_QUALITY__EDGE_THRESHOLD_MIN define. + // It is here now to allow easier tuning. + // Trims the algorithm from processing darks. + // 0.0833 - upper limit (default, the start of visible unfiltered edges) + // 0.0625 - high quality (faster) + // 0.0312 - visible limit (slower) + // Special notes when using FXAA_GREEN_AS_LUMA, + // Likely want to set this to zero. + // As colors that are mostly not-green + // will appear very dark in the green channel! + // Tune by looking at mostly non-green content, + // then start at zero and increase until aliasing is a problem. + FxaaFloat fxaaQualityEdgeThresholdMin, + // + // Only used on FXAA Console. + // This used to be the FXAA_CONSOLE__EDGE_SHARPNESS define. + // It is here now to allow easier tuning. + // This does not effect PS3, as this needs to be compiled in. + // Use FXAA_CONSOLE__PS3_EDGE_SHARPNESS for PS3. + // Due to the PS3 being ALU bound, + // there are only three safe values here: 2 and 4 and 8. + // These options use the shaders ability to a free *|/ by 2|4|8. + // For all other platforms can be a non-power of two. + // 8.0 is sharper (default!!!) + // 4.0 is softer + // 2.0 is really soft (good only for vector graphics inputs) + FxaaFloat fxaaConsoleEdgeSharpness, + // + // Only used on FXAA Console. + // This used to be the FXAA_CONSOLE__EDGE_THRESHOLD define. + // It is here now to allow easier tuning. + // This does not effect PS3, as this needs to be compiled in. + // Use FXAA_CONSOLE__PS3_EDGE_THRESHOLD for PS3. + // Due to the PS3 being ALU bound, + // there are only two safe values here: 1/4 and 1/8. + // These options use the shaders ability to a free *|/ by 2|4|8. + // The console setting has a different mapping than the quality setting. + // Other platforms can use other values. + // 0.125 leaves less aliasing, but is softer (default!!!) + // 0.25 leaves more aliasing, and is sharper + FxaaFloat fxaaConsoleEdgeThreshold, + // + // Only used on FXAA Console. + // This used to be the FXAA_CONSOLE__EDGE_THRESHOLD_MIN define. + // It is here now to allow easier tuning. + // Trims the algorithm from processing darks. + // The console setting has a different mapping than the quality setting. + // This only applies when FXAA_EARLY_EXIT is 1. + // This does not apply to PS3, + // PS3 was simplified to avoid more shader instructions. + // 0.06 - faster but more aliasing in darks + // 0.05 - default + // 0.04 - slower and less aliasing in darks + // Special notes when using FXAA_GREEN_AS_LUMA, + // Likely want to set this to zero. + // As colors that are mostly not-green + // will appear very dark in the green channel! + // Tune by looking at mostly non-green content, + // then start at zero and increase until aliasing is a problem. + FxaaFloat fxaaConsoleEdgeThresholdMin, + // + // Extra constants for 360 FXAA Console only. + // Use zeros or anything else for other platforms. + // These must be in physical constant registers and NOT immedates. + // Immedates will result in compiler un-optimizing. + // {xyzw} = float4(1.0, -1.0, 0.25, -0.25) + FxaaFloat4 fxaaConsole360ConstDir +) { +/*--------------------------------------------------------------------------*/ + FxaaFloat2 posM; + posM.x = pos.x; + posM.y = pos.y; + #if (FXAA_GATHER4_ALPHA == 1) + #if (FXAA_DISCARD == 0) + FxaaFloat4 rgbyM = FxaaTexTop(tex, posM); + #if (FXAA_GREEN_AS_LUMA == 0) + #define lumaM rgbyM.w + #else + #define lumaM rgbyM.y + #endif + #endif + #if (FXAA_GREEN_AS_LUMA == 0) + FxaaFloat4 luma4A = FxaaTexAlpha4(tex, posM); + FxaaFloat4 luma4B = FxaaTexOffAlpha4(tex, posM, FxaaInt2(-1, -1)); + #else + FxaaFloat4 luma4A = FxaaTexGreen4(tex, posM); + FxaaFloat4 luma4B = FxaaTexOffGreen4(tex, posM, FxaaInt2(-1, -1)); + #endif + #if (FXAA_DISCARD == 1) + #define lumaM luma4A.w + #endif + #define lumaE luma4A.z + #define lumaS luma4A.x + #define lumaSE luma4A.y + #define lumaNW luma4B.w + #define lumaN luma4B.z + #define lumaW luma4B.x + #else + FxaaFloat4 rgbyM = FxaaTexTop(tex, posM); + #if (FXAA_GREEN_AS_LUMA == 0) + #define lumaM rgbyM.w + #else + #define lumaM rgbyM.y + #endif + FxaaFloat lumaS = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 0, 1), fxaaQualityRcpFrame.xy)); + FxaaFloat lumaE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1, 0), fxaaQualityRcpFrame.xy)); + FxaaFloat lumaN = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 0,-1), fxaaQualityRcpFrame.xy)); + FxaaFloat lumaW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 0), fxaaQualityRcpFrame.xy)); + #endif +/*--------------------------------------------------------------------------*/ + FxaaFloat maxSM = max(lumaS, lumaM); + FxaaFloat minSM = min(lumaS, lumaM); + FxaaFloat maxESM = max(lumaE, maxSM); + FxaaFloat minESM = min(lumaE, minSM); + FxaaFloat maxWN = max(lumaN, lumaW); + FxaaFloat minWN = min(lumaN, lumaW); + FxaaFloat rangeMax = max(maxWN, maxESM); + FxaaFloat rangeMin = min(minWN, minESM); + FxaaFloat rangeMaxScaled = rangeMax * fxaaQualityEdgeThreshold; + FxaaFloat range = rangeMax - rangeMin; + FxaaFloat rangeMaxClamped = max(fxaaQualityEdgeThresholdMin, rangeMaxScaled); + FxaaBool earlyExit = range < rangeMaxClamped; +/*--------------------------------------------------------------------------*/ + if(earlyExit) + #if (FXAA_DISCARD == 1) + FxaaDiscard; + #else + return rgbyM; + #endif +/*--------------------------------------------------------------------------*/ + #if (FXAA_GATHER4_ALPHA == 0) + FxaaFloat lumaNW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1,-1), fxaaQualityRcpFrame.xy)); + FxaaFloat lumaSE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1, 1), fxaaQualityRcpFrame.xy)); + FxaaFloat lumaNE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1,-1), fxaaQualityRcpFrame.xy)); + FxaaFloat lumaSW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 1), fxaaQualityRcpFrame.xy)); + #else + FxaaFloat lumaNE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(1, -1), fxaaQualityRcpFrame.xy)); + FxaaFloat lumaSW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 1), fxaaQualityRcpFrame.xy)); + #endif +/*--------------------------------------------------------------------------*/ + FxaaFloat lumaNS = lumaN + lumaS; + FxaaFloat lumaWE = lumaW + lumaE; + FxaaFloat subpixRcpRange = 1.0/range; + FxaaFloat subpixNSWE = lumaNS + lumaWE; + FxaaFloat edgeHorz1 = (-2.0 * lumaM) + lumaNS; + FxaaFloat edgeVert1 = (-2.0 * lumaM) + lumaWE; +/*--------------------------------------------------------------------------*/ + FxaaFloat lumaNESE = lumaNE + lumaSE; + FxaaFloat lumaNWNE = lumaNW + lumaNE; + FxaaFloat edgeHorz2 = (-2.0 * lumaE) + lumaNESE; + FxaaFloat edgeVert2 = (-2.0 * lumaN) + lumaNWNE; +/*--------------------------------------------------------------------------*/ + FxaaFloat lumaNWSW = lumaNW + lumaSW; + FxaaFloat lumaSWSE = lumaSW + lumaSE; + FxaaFloat edgeHorz4 = (abs(edgeHorz1) * 2.0) + abs(edgeHorz2); + FxaaFloat edgeVert4 = (abs(edgeVert1) * 2.0) + abs(edgeVert2); + FxaaFloat edgeHorz3 = (-2.0 * lumaW) + lumaNWSW; + FxaaFloat edgeVert3 = (-2.0 * lumaS) + lumaSWSE; + FxaaFloat edgeHorz = abs(edgeHorz3) + edgeHorz4; + FxaaFloat edgeVert = abs(edgeVert3) + edgeVert4; +/*--------------------------------------------------------------------------*/ + FxaaFloat subpixNWSWNESE = lumaNWSW + lumaNESE; + FxaaFloat lengthSign = fxaaQualityRcpFrame.x; + FxaaBool horzSpan = edgeHorz >= edgeVert; + FxaaFloat subpixA = subpixNSWE * 2.0 + subpixNWSWNESE; +/*--------------------------------------------------------------------------*/ + if(!horzSpan) lumaN = lumaW; + if(!horzSpan) lumaS = lumaE; + if(horzSpan) lengthSign = fxaaQualityRcpFrame.y; + FxaaFloat subpixB = (subpixA * (1.0/12.0)) - lumaM; +/*--------------------------------------------------------------------------*/ + FxaaFloat gradientN = lumaN - lumaM; + FxaaFloat gradientS = lumaS - lumaM; + FxaaFloat lumaNN = lumaN + lumaM; + FxaaFloat lumaSS = lumaS + lumaM; + FxaaBool pairN = abs(gradientN) >= abs(gradientS); + FxaaFloat gradient = max(abs(gradientN), abs(gradientS)); + if(pairN) lengthSign = -lengthSign; + FxaaFloat subpixC = FxaaSat(abs(subpixB) * subpixRcpRange); +/*--------------------------------------------------------------------------*/ + FxaaFloat2 posB; + posB.x = posM.x; + posB.y = posM.y; + FxaaFloat2 offNP; + offNP.x = (!horzSpan) ? 0.0 : fxaaQualityRcpFrame.x; + offNP.y = ( horzSpan) ? 0.0 : fxaaQualityRcpFrame.y; + if(!horzSpan) posB.x += lengthSign * 0.5; + if( horzSpan) posB.y += lengthSign * 0.5; +/*--------------------------------------------------------------------------*/ + FxaaFloat2 posN; + posN.x = posB.x - offNP.x * FXAA_QUALITY__P0; + posN.y = posB.y - offNP.y * FXAA_QUALITY__P0; + FxaaFloat2 posP; + posP.x = posB.x + offNP.x * FXAA_QUALITY__P0; + posP.y = posB.y + offNP.y * FXAA_QUALITY__P0; + FxaaFloat subpixD = ((-2.0)*subpixC) + 3.0; + FxaaFloat lumaEndN = FxaaLuma(FxaaTexTop(tex, posN)); + FxaaFloat subpixE = subpixC * subpixC; + FxaaFloat lumaEndP = FxaaLuma(FxaaTexTop(tex, posP)); +/*--------------------------------------------------------------------------*/ + if(!pairN) lumaNN = lumaSS; + FxaaFloat gradientScaled = gradient * 1.0/4.0; + FxaaFloat lumaMM = lumaM - lumaNN * 0.5; + FxaaFloat subpixF = subpixD * subpixE; + FxaaBool lumaMLTZero = lumaMM < 0.0; +/*--------------------------------------------------------------------------*/ + lumaEndN -= lumaNN * 0.5; + lumaEndP -= lumaNN * 0.5; + FxaaBool doneN = abs(lumaEndN) >= gradientScaled; + FxaaBool doneP = abs(lumaEndP) >= gradientScaled; + if(!doneN) posN.x -= offNP.x * FXAA_QUALITY__P1; + if(!doneN) posN.y -= offNP.y * FXAA_QUALITY__P1; + FxaaBool doneNP = (!doneN) || (!doneP); + if(!doneP) posP.x += offNP.x * FXAA_QUALITY__P1; + if(!doneP) posP.y += offNP.y * FXAA_QUALITY__P1; +/*--------------------------------------------------------------------------*/ + if(doneNP) { + if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy)); + if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy)); + if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5; + if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5; + doneN = abs(lumaEndN) >= gradientScaled; + doneP = abs(lumaEndP) >= gradientScaled; + if(!doneN) posN.x -= offNP.x * FXAA_QUALITY__P2; + if(!doneN) posN.y -= offNP.y * FXAA_QUALITY__P2; + doneNP = (!doneN) || (!doneP); + if(!doneP) posP.x += offNP.x * FXAA_QUALITY__P2; + if(!doneP) posP.y += offNP.y * FXAA_QUALITY__P2; +/*--------------------------------------------------------------------------*/ + #if (FXAA_QUALITY__PS > 3) + if(doneNP) { + if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy)); + if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy)); + if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5; + if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5; + doneN = abs(lumaEndN) >= gradientScaled; + doneP = abs(lumaEndP) >= gradientScaled; + if(!doneN) posN.x -= offNP.x * FXAA_QUALITY__P3; + if(!doneN) posN.y -= offNP.y * FXAA_QUALITY__P3; + doneNP = (!doneN) || (!doneP); + if(!doneP) posP.x += offNP.x * FXAA_QUALITY__P3; + if(!doneP) posP.y += offNP.y * FXAA_QUALITY__P3; +/*--------------------------------------------------------------------------*/ + #if (FXAA_QUALITY__PS > 4) + if(doneNP) { + if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy)); + if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy)); + if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5; + if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5; + doneN = abs(lumaEndN) >= gradientScaled; + doneP = abs(lumaEndP) >= gradientScaled; + if(!doneN) posN.x -= offNP.x * FXAA_QUALITY__P4; + if(!doneN) posN.y -= offNP.y * FXAA_QUALITY__P4; + doneNP = (!doneN) || (!doneP); + if(!doneP) posP.x += offNP.x * FXAA_QUALITY__P4; + if(!doneP) posP.y += offNP.y * FXAA_QUALITY__P4; +/*--------------------------------------------------------------------------*/ + #if (FXAA_QUALITY__PS > 5) + if(doneNP) { + if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy)); + if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy)); + if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5; + if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5; + doneN = abs(lumaEndN) >= gradientScaled; + doneP = abs(lumaEndP) >= gradientScaled; + if(!doneN) posN.x -= offNP.x * FXAA_QUALITY__P5; + if(!doneN) posN.y -= offNP.y * FXAA_QUALITY__P5; + doneNP = (!doneN) || (!doneP); + if(!doneP) posP.x += offNP.x * FXAA_QUALITY__P5; + if(!doneP) posP.y += offNP.y * FXAA_QUALITY__P5; +/*--------------------------------------------------------------------------*/ + #if (FXAA_QUALITY__PS > 6) + if(doneNP) { + if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy)); + if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy)); + if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5; + if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5; + doneN = abs(lumaEndN) >= gradientScaled; + doneP = abs(lumaEndP) >= gradientScaled; + if(!doneN) posN.x -= offNP.x * FXAA_QUALITY__P6; + if(!doneN) posN.y -= offNP.y * FXAA_QUALITY__P6; + doneNP = (!doneN) || (!doneP); + if(!doneP) posP.x += offNP.x * FXAA_QUALITY__P6; + if(!doneP) posP.y += offNP.y * FXAA_QUALITY__P6; +/*--------------------------------------------------------------------------*/ + #if (FXAA_QUALITY__PS > 7) + if(doneNP) { + if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy)); + if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy)); + if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5; + if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5; + doneN = abs(lumaEndN) >= gradientScaled; + doneP = abs(lumaEndP) >= gradientScaled; + if(!doneN) posN.x -= offNP.x * FXAA_QUALITY__P7; + if(!doneN) posN.y -= offNP.y * FXAA_QUALITY__P7; + doneNP = (!doneN) || (!doneP); + if(!doneP) posP.x += offNP.x * FXAA_QUALITY__P7; + if(!doneP) posP.y += offNP.y * FXAA_QUALITY__P7; +/*--------------------------------------------------------------------------*/ + #if (FXAA_QUALITY__PS > 8) + if(doneNP) { + if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy)); + if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy)); + if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5; + if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5; + doneN = abs(lumaEndN) >= gradientScaled; + doneP = abs(lumaEndP) >= gradientScaled; + if(!doneN) posN.x -= offNP.x * FXAA_QUALITY__P8; + if(!doneN) posN.y -= offNP.y * FXAA_QUALITY__P8; + doneNP = (!doneN) || (!doneP); + if(!doneP) posP.x += offNP.x * FXAA_QUALITY__P8; + if(!doneP) posP.y += offNP.y * FXAA_QUALITY__P8; +/*--------------------------------------------------------------------------*/ + #if (FXAA_QUALITY__PS > 9) + if(doneNP) { + if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy)); + if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy)); + if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5; + if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5; + doneN = abs(lumaEndN) >= gradientScaled; + doneP = abs(lumaEndP) >= gradientScaled; + if(!doneN) posN.x -= offNP.x * FXAA_QUALITY__P9; + if(!doneN) posN.y -= offNP.y * FXAA_QUALITY__P9; + doneNP = (!doneN) || (!doneP); + if(!doneP) posP.x += offNP.x * FXAA_QUALITY__P9; + if(!doneP) posP.y += offNP.y * FXAA_QUALITY__P9; +/*--------------------------------------------------------------------------*/ + #if (FXAA_QUALITY__PS > 10) + if(doneNP) { + if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy)); + if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy)); + if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5; + if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5; + doneN = abs(lumaEndN) >= gradientScaled; + doneP = abs(lumaEndP) >= gradientScaled; + if(!doneN) posN.x -= offNP.x * FXAA_QUALITY__P10; + if(!doneN) posN.y -= offNP.y * FXAA_QUALITY__P10; + doneNP = (!doneN) || (!doneP); + if(!doneP) posP.x += offNP.x * FXAA_QUALITY__P10; + if(!doneP) posP.y += offNP.y * FXAA_QUALITY__P10; +/*--------------------------------------------------------------------------*/ + #if (FXAA_QUALITY__PS > 11) + if(doneNP) { + if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy)); + if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy)); + if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5; + if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5; + doneN = abs(lumaEndN) >= gradientScaled; + doneP = abs(lumaEndP) >= gradientScaled; + if(!doneN) posN.x -= offNP.x * FXAA_QUALITY__P11; + if(!doneN) posN.y -= offNP.y * FXAA_QUALITY__P11; + doneNP = (!doneN) || (!doneP); + if(!doneP) posP.x += offNP.x * FXAA_QUALITY__P11; + if(!doneP) posP.y += offNP.y * FXAA_QUALITY__P11; +/*--------------------------------------------------------------------------*/ + #if (FXAA_QUALITY__PS > 12) + if(doneNP) { + if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy)); + if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy)); + if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5; + if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5; + doneN = abs(lumaEndN) >= gradientScaled; + doneP = abs(lumaEndP) >= gradientScaled; + if(!doneN) posN.x -= offNP.x * FXAA_QUALITY__P12; + if(!doneN) posN.y -= offNP.y * FXAA_QUALITY__P12; + doneNP = (!doneN) || (!doneP); + if(!doneP) posP.x += offNP.x * FXAA_QUALITY__P12; + if(!doneP) posP.y += offNP.y * FXAA_QUALITY__P12; +/*--------------------------------------------------------------------------*/ + } + #endif +/*--------------------------------------------------------------------------*/ + } + #endif +/*--------------------------------------------------------------------------*/ + } + #endif +/*--------------------------------------------------------------------------*/ + } + #endif +/*--------------------------------------------------------------------------*/ + } + #endif +/*--------------------------------------------------------------------------*/ + } + #endif +/*--------------------------------------------------------------------------*/ + } + #endif +/*--------------------------------------------------------------------------*/ + } + #endif +/*--------------------------------------------------------------------------*/ + } + #endif +/*--------------------------------------------------------------------------*/ + } + #endif +/*--------------------------------------------------------------------------*/ + } +/*--------------------------------------------------------------------------*/ + FxaaFloat dstN = posM.x - posN.x; + FxaaFloat dstP = posP.x - posM.x; + if(!horzSpan) dstN = posM.y - posN.y; + if(!horzSpan) dstP = posP.y - posM.y; +/*--------------------------------------------------------------------------*/ + FxaaBool goodSpanN = (lumaEndN < 0.0) != lumaMLTZero; + FxaaFloat spanLength = (dstP + dstN); + FxaaBool goodSpanP = (lumaEndP < 0.0) != lumaMLTZero; + FxaaFloat spanLengthRcp = 1.0/spanLength; +/*--------------------------------------------------------------------------*/ + FxaaBool directionN = dstN < dstP; + FxaaFloat dst = min(dstN, dstP); + FxaaBool goodSpan = directionN ? goodSpanN : goodSpanP; + FxaaFloat subpixG = subpixF * subpixF; + FxaaFloat pixelOffset = (dst * (-spanLengthRcp)) + 0.5; + FxaaFloat subpixH = subpixG * fxaaQualitySubpix; +/*--------------------------------------------------------------------------*/ + FxaaFloat pixelOffsetGood = goodSpan ? pixelOffset : 0.0; + FxaaFloat pixelOffsetSubpix = max(pixelOffsetGood, subpixH); + if(!horzSpan) posM.x += pixelOffsetSubpix * lengthSign; + if( horzSpan) posM.y += pixelOffsetSubpix * lengthSign; + #if (FXAA_DISCARD == 1) + return FxaaTexTop(tex, posM); + #else + return FxaaFloat4(FxaaTexTop(tex, posM).xyz, lumaM); + #endif +} +/*==========================================================================*/ +#endif + + + + +/*============================================================================ + + FXAA3 CONSOLE - PC VERSION + +------------------------------------------------------------------------------ +Instead of using this on PC, I'd suggest just using FXAA Quality with + #define FXAA_QUALITY__PRESET 10 +Or + #define FXAA_QUALITY__PRESET 20 +Either are higher qualilty and almost as fast as this on modern PC GPUs. +============================================================================*/ +#if (FXAA_PC_CONSOLE == 1) +/*--------------------------------------------------------------------------*/ +FxaaFloat4 FxaaPixelShader( + // See FXAA Quality FxaaPixelShader() source for docs on Inputs! + FxaaFloat2 pos, + FxaaFloat4 fxaaConsolePosPos, + FxaaTex tex, + FxaaTex fxaaConsole360TexExpBiasNegOne, + FxaaTex fxaaConsole360TexExpBiasNegTwo, + FxaaFloat2 fxaaQualityRcpFrame, + FxaaFloat4 fxaaConsoleRcpFrameOpt, + FxaaFloat4 fxaaConsoleRcpFrameOpt2, + FxaaFloat4 fxaaConsole360RcpFrameOpt2, + FxaaFloat fxaaQualitySubpix, + FxaaFloat fxaaQualityEdgeThreshold, + FxaaFloat fxaaQualityEdgeThresholdMin, + FxaaFloat fxaaConsoleEdgeSharpness, + FxaaFloat fxaaConsoleEdgeThreshold, + FxaaFloat fxaaConsoleEdgeThresholdMin, + FxaaFloat4 fxaaConsole360ConstDir +) { +/*--------------------------------------------------------------------------*/ + FxaaFloat lumaNw = FxaaLuma(FxaaTexTop(tex, fxaaConsolePosPos.xy)); + FxaaFloat lumaSw = FxaaLuma(FxaaTexTop(tex, fxaaConsolePosPos.xw)); + FxaaFloat lumaNe = FxaaLuma(FxaaTexTop(tex, fxaaConsolePosPos.zy)); + FxaaFloat lumaSe = FxaaLuma(FxaaTexTop(tex, fxaaConsolePosPos.zw)); +/*--------------------------------------------------------------------------*/ + FxaaFloat4 rgbyM = FxaaTexTop(tex, pos.xy); + #if (FXAA_GREEN_AS_LUMA == 0) + FxaaFloat lumaM = rgbyM.w; + #else + FxaaFloat lumaM = rgbyM.y; + #endif +/*--------------------------------------------------------------------------*/ + FxaaFloat lumaMaxNwSw = max(lumaNw, lumaSw); + lumaNe += 1.0/384.0; + FxaaFloat lumaMinNwSw = min(lumaNw, lumaSw); +/*--------------------------------------------------------------------------*/ + FxaaFloat lumaMaxNeSe = max(lumaNe, lumaSe); + FxaaFloat lumaMinNeSe = min(lumaNe, lumaSe); +/*--------------------------------------------------------------------------*/ + FxaaFloat lumaMax = max(lumaMaxNeSe, lumaMaxNwSw); + FxaaFloat lumaMin = min(lumaMinNeSe, lumaMinNwSw); +/*--------------------------------------------------------------------------*/ + FxaaFloat lumaMaxScaled = lumaMax * fxaaConsoleEdgeThreshold; +/*--------------------------------------------------------------------------*/ + FxaaFloat lumaMinM = min(lumaMin, lumaM); + FxaaFloat lumaMaxScaledClamped = max(fxaaConsoleEdgeThresholdMin, lumaMaxScaled); + FxaaFloat lumaMaxM = max(lumaMax, lumaM); + FxaaFloat dirSwMinusNe = lumaSw - lumaNe; + FxaaFloat lumaMaxSubMinM = lumaMaxM - lumaMinM; + FxaaFloat dirSeMinusNw = lumaSe - lumaNw; + if(lumaMaxSubMinM < lumaMaxScaledClamped) return rgbyM; +/*--------------------------------------------------------------------------*/ + FxaaFloat2 dir; + dir.x = dirSwMinusNe + dirSeMinusNw; + dir.y = dirSwMinusNe - dirSeMinusNw; +/*--------------------------------------------------------------------------*/ + FxaaFloat2 dir1 = normalize(dir.xy); + FxaaFloat4 rgbyN1 = FxaaTexTop(tex, pos.xy - dir1 * fxaaConsoleRcpFrameOpt.zw); + FxaaFloat4 rgbyP1 = FxaaTexTop(tex, pos.xy + dir1 * fxaaConsoleRcpFrameOpt.zw); +/*--------------------------------------------------------------------------*/ + FxaaFloat dirAbsMinTimesC = min(abs(dir1.x), abs(dir1.y)) * fxaaConsoleEdgeSharpness; + FxaaFloat2 dir2 = clamp(dir1.xy / dirAbsMinTimesC, -2.0, 2.0); +/*--------------------------------------------------------------------------*/ + FxaaFloat4 rgbyN2 = FxaaTexTop(tex, pos.xy - dir2 * fxaaConsoleRcpFrameOpt2.zw); + FxaaFloat4 rgbyP2 = FxaaTexTop(tex, pos.xy + dir2 * fxaaConsoleRcpFrameOpt2.zw); +/*--------------------------------------------------------------------------*/ + FxaaFloat4 rgbyA = rgbyN1 + rgbyP1; + FxaaFloat4 rgbyB = ((rgbyN2 + rgbyP2) * 0.25) + (rgbyA * 0.25); +/*--------------------------------------------------------------------------*/ + #if (FXAA_GREEN_AS_LUMA == 0) + FxaaBool twoTap = (rgbyB.w < lumaMin) || (rgbyB.w > lumaMax); + #else + FxaaBool twoTap = (rgbyB.y < lumaMin) || (rgbyB.y > lumaMax); + #endif + if(twoTap) rgbyB.xyz = rgbyA.xyz * 0.5; + return rgbyB; } +/*==========================================================================*/ +#endif + + + +/*============================================================================ + + FXAA3 CONSOLE - 360 PIXEL SHADER + +------------------------------------------------------------------------------ +This optimized version thanks to suggestions from Andy Luedke. +Should be fully tex bound in all cases. +As of the FXAA 3.11 release, I have still not tested this code, +however I fixed a bug which was in both FXAA 3.9 and FXAA 3.10. +And note this is replacing the old unoptimized version. +If it does not work, please let me know so I can fix it. +============================================================================*/ +#if (FXAA_360 == 1) +/*--------------------------------------------------------------------------*/ +[reduceTempRegUsage(4)] +float4 FxaaPixelShader( + // See FXAA Quality FxaaPixelShader() source for docs on Inputs! + FxaaFloat2 pos, + FxaaFloat4 fxaaConsolePosPos, + FxaaTex tex, + FxaaTex fxaaConsole360TexExpBiasNegOne, + FxaaTex fxaaConsole360TexExpBiasNegTwo, + FxaaFloat2 fxaaQualityRcpFrame, + FxaaFloat4 fxaaConsoleRcpFrameOpt, + FxaaFloat4 fxaaConsoleRcpFrameOpt2, + FxaaFloat4 fxaaConsole360RcpFrameOpt2, + FxaaFloat fxaaQualitySubpix, + FxaaFloat fxaaQualityEdgeThreshold, + FxaaFloat fxaaQualityEdgeThresholdMin, + FxaaFloat fxaaConsoleEdgeSharpness, + FxaaFloat fxaaConsoleEdgeThreshold, + FxaaFloat fxaaConsoleEdgeThresholdMin, + FxaaFloat4 fxaaConsole360ConstDir +) { +/*--------------------------------------------------------------------------*/ + float4 lumaNwNeSwSe; + #if (FXAA_GREEN_AS_LUMA == 0) + asm { + tfetch2D lumaNwNeSwSe.w___, tex, pos.xy, OffsetX = -0.5, OffsetY = -0.5, UseComputedLOD=false + tfetch2D lumaNwNeSwSe._w__, tex, pos.xy, OffsetX = 0.5, OffsetY = -0.5, UseComputedLOD=false + tfetch2D lumaNwNeSwSe.__w_, tex, pos.xy, OffsetX = -0.5, OffsetY = 0.5, UseComputedLOD=false + tfetch2D lumaNwNeSwSe.___w, tex, pos.xy, OffsetX = 0.5, OffsetY = 0.5, UseComputedLOD=false + }; + #else + asm { + tfetch2D lumaNwNeSwSe.y___, tex, pos.xy, OffsetX = -0.5, OffsetY = -0.5, UseComputedLOD=false + tfetch2D lumaNwNeSwSe._y__, tex, pos.xy, OffsetX = 0.5, OffsetY = -0.5, UseComputedLOD=false + tfetch2D lumaNwNeSwSe.__y_, tex, pos.xy, OffsetX = -0.5, OffsetY = 0.5, UseComputedLOD=false + tfetch2D lumaNwNeSwSe.___y, tex, pos.xy, OffsetX = 0.5, OffsetY = 0.5, UseComputedLOD=false + }; + #endif +/*--------------------------------------------------------------------------*/ + lumaNwNeSwSe.y += 1.0/384.0; + float2 lumaMinTemp = min(lumaNwNeSwSe.xy, lumaNwNeSwSe.zw); + float2 lumaMaxTemp = max(lumaNwNeSwSe.xy, lumaNwNeSwSe.zw); + float lumaMin = min(lumaMinTemp.x, lumaMinTemp.y); + float lumaMax = max(lumaMaxTemp.x, lumaMaxTemp.y); +/*--------------------------------------------------------------------------*/ + float4 rgbyM = tex2Dlod(tex, float4(pos.xy, 0.0, 0.0)); + #if (FXAA_GREEN_AS_LUMA == 0) + float lumaMinM = min(lumaMin, rgbyM.w); + float lumaMaxM = max(lumaMax, rgbyM.w); + #else + float lumaMinM = min(lumaMin, rgbyM.y); + float lumaMaxM = max(lumaMax, rgbyM.y); + #endif + if((lumaMaxM - lumaMinM) < max(fxaaConsoleEdgeThresholdMin, lumaMax * fxaaConsoleEdgeThreshold)) return rgbyM; +/*--------------------------------------------------------------------------*/ + float2 dir; + dir.x = dot(lumaNwNeSwSe, fxaaConsole360ConstDir.yyxx); + dir.y = dot(lumaNwNeSwSe, fxaaConsole360ConstDir.xyxy); + dir = normalize(dir); +/*--------------------------------------------------------------------------*/ + float4 dir1 = dir.xyxy * fxaaConsoleRcpFrameOpt.xyzw; +/*--------------------------------------------------------------------------*/ + float4 dir2; + float dirAbsMinTimesC = min(abs(dir.x), abs(dir.y)) * fxaaConsoleEdgeSharpness; + dir2 = saturate(fxaaConsole360ConstDir.zzww * dir.xyxy / dirAbsMinTimesC + 0.5); + dir2 = dir2 * fxaaConsole360RcpFrameOpt2.xyxy + fxaaConsole360RcpFrameOpt2.zwzw; +/*--------------------------------------------------------------------------*/ + float4 rgbyN1 = tex2Dlod(fxaaConsole360TexExpBiasNegOne, float4(pos.xy + dir1.xy, 0.0, 0.0)); + float4 rgbyP1 = tex2Dlod(fxaaConsole360TexExpBiasNegOne, float4(pos.xy + dir1.zw, 0.0, 0.0)); + float4 rgbyN2 = tex2Dlod(fxaaConsole360TexExpBiasNegTwo, float4(pos.xy + dir2.xy, 0.0, 0.0)); + float4 rgbyP2 = tex2Dlod(fxaaConsole360TexExpBiasNegTwo, float4(pos.xy + dir2.zw, 0.0, 0.0)); +/*--------------------------------------------------------------------------*/ + float4 rgbyA = rgbyN1 + rgbyP1; + float4 rgbyB = rgbyN2 + rgbyP2 * 0.5 + rgbyA; +/*--------------------------------------------------------------------------*/ + float4 rgbyR = ((rgbyB.w - lumaMax) > 0.0) ? rgbyA : rgbyB; + rgbyR = ((rgbyB.w - lumaMin) > 0.0) ? rgbyR : rgbyA; + return rgbyR; } +/*==========================================================================*/ +#endif + + + +/*============================================================================ + + FXAA3 CONSOLE - OPTIMIZED PS3 PIXEL SHADER (NO EARLY EXIT) + +============================================================================== +The code below does not exactly match the assembly. +I have a feeling that 12 cycles is possible, but was not able to get there. +Might have to increase register count to get full performance. +Note this shader does not use perspective interpolation. + +Use the following cgc options, + + --fenable-bx2 --fastmath --fastprecision --nofloatbindings + +------------------------------------------------------------------------------ + NVSHADERPERF OUTPUT +------------------------------------------------------------------------------ +For reference and to aid in debug, output of NVShaderPerf should match this, + +Shader to schedule: + 0: texpkb h0.w(TRUE), v5.zyxx, #0 + 2: addh h2.z(TRUE), h0.w, constant(0.001953, 0.000000, 0.000000, 0.000000).x + 4: texpkb h0.w(TRUE), v5.xwxx, #0 + 6: addh h0.z(TRUE), -h2, h0.w + 7: texpkb h1.w(TRUE), v5, #0 + 9: addh h0.x(TRUE), h0.z, -h1.w + 10: addh h3.w(TRUE), h0.z, h1 + 11: texpkb h2.w(TRUE), v5.zwzz, #0 + 13: addh h0.z(TRUE), h3.w, -h2.w + 14: addh h0.x(TRUE), h2.w, h0 + 15: nrmh h1.xz(TRUE), h0_n + 16: minh_m8 h0.x(TRUE), |h1|, |h1.z| + 17: maxh h4.w(TRUE), h0, h1 + 18: divx h2.xy(TRUE), h1_n.xzzw, h0_n + 19: movr r1.zw(TRUE), v4.xxxy + 20: madr r2.xz(TRUE), -h1, constant(cConst5.x, cConst5.y, cConst5.z, cConst5.w).zzww, r1.zzww + 22: minh h5.w(TRUE), h0, h1 + 23: texpkb h0(TRUE), r2.xzxx, #0 + 25: madr r0.zw(TRUE), h1.xzxz, constant(cConst5.x, cConst5.y, cConst5.z, cConst5.w), r1 + 27: maxh h4.x(TRUE), h2.z, h2.w + 28: texpkb h1(TRUE), r0.zwzz, #0 + 30: addh_d2 h1(TRUE), h0, h1 + 31: madr r0.xy(TRUE), -h2, constant(cConst5.x, cConst5.y, cConst5.z, cConst5.w).xyxx, r1.zwzz + 33: texpkb h0(TRUE), r0, #0 + 35: minh h4.z(TRUE), h2, h2.w + 36: fenct TRUE + 37: madr r1.xy(TRUE), h2, constant(cConst5.x, cConst5.y, cConst5.z, cConst5.w).xyxx, r1.zwzz + 39: texpkb h2(TRUE), r1, #0 + 41: addh_d2 h0(TRUE), h0, h2 + 42: maxh h2.w(TRUE), h4, h4.x + 43: minh h2.x(TRUE), h5.w, h4.z + 44: addh_d2 h0(TRUE), h0, h1 + 45: slth h2.x(TRUE), h0.w, h2 + 46: sgth h2.w(TRUE), h0, h2 + 47: movh h0(TRUE), h0 + 48: addx.c0 rc(TRUE), h2, h2.w + 49: movh h0(c0.NE.x), h1 + +IPU0 ------ Simplified schedule: -------- +Pass | Unit | uOp | PC: Op +-----+--------+------+------------------------- + 1 | SCT0/1 | mov | 0: TXLr h0.w, g[TEX1].zyxx, const.xxxx, TEX0; + | TEX | txl | 0: TXLr h0.w, g[TEX1].zyxx, const.xxxx, TEX0; + | SCB1 | add | 2: ADDh h2.z, h0.--w-, const.--x-; + | | | + 2 | SCT0/1 | mov | 4: TXLr h0.w, g[TEX1].xwxx, const.xxxx, TEX0; + | TEX | txl | 4: TXLr h0.w, g[TEX1].xwxx, const.xxxx, TEX0; + | SCB1 | add | 6: ADDh h0.z,-h2, h0.--w-; + | | | + 3 | SCT0/1 | mov | 7: TXLr h1.w, g[TEX1], const.xxxx, TEX0; + | TEX | txl | 7: TXLr h1.w, g[TEX1], const.xxxx, TEX0; + | SCB0 | add | 9: ADDh h0.x, h0.z---,-h1.w---; + | SCB1 | add | 10: ADDh h3.w, h0.---z, h1; + | | | + 4 | SCT0/1 | mov | 11: TXLr h2.w, g[TEX1].zwzz, const.xxxx, TEX0; + | TEX | txl | 11: TXLr h2.w, g[TEX1].zwzz, const.xxxx, TEX0; + | SCB0 | add | 14: ADDh h0.x, h2.w---, h0; + | SCB1 | add | 13: ADDh h0.z, h3.--w-,-h2.--w-; + | | | + 5 | SCT1 | mov | 15: NRMh h1.xz, h0; + | SRB | nrm | 15: NRMh h1.xz, h0; + | SCB0 | min | 16: MINh*8 h0.x, |h1|, |h1.z---|; + | SCB1 | max | 17: MAXh h4.w, h0, h1; + | | | + 6 | SCT0 | div | 18: DIVx h2.xy, h1.xz--, h0; + | SCT1 | mov | 19: MOVr r1.zw, g[TEX0].--xy; + | SCB0 | mad | 20: MADr r2.xz,-h1, const.z-w-, r1.z-w-; + | SCB1 | min | 22: MINh h5.w, h0, h1; + | | | + 7 | SCT0/1 | mov | 23: TXLr h0, r2.xzxx, const.xxxx, TEX0; + | TEX | txl | 23: TXLr h0, r2.xzxx, const.xxxx, TEX0; + | SCB0 | max | 27: MAXh h4.x, h2.z---, h2.w---; + | SCB1 | mad | 25: MADr r0.zw, h1.--xz, const, r1; + | | | + 8 | SCT0/1 | mov | 28: TXLr h1, r0.zwzz, const.xxxx, TEX0; + | TEX | txl | 28: TXLr h1, r0.zwzz, const.xxxx, TEX0; + | SCB0/1 | add | 30: ADDh/2 h1, h0, h1; + | | | + 9 | SCT0 | mad | 31: MADr r0.xy,-h2, const.xy--, r1.zw--; + | SCT1 | mov | 33: TXLr h0, r0, const.zzzz, TEX0; + | TEX | txl | 33: TXLr h0, r0, const.zzzz, TEX0; + | SCB1 | min | 35: MINh h4.z, h2, h2.--w-; + | | | + 10 | SCT0 | mad | 37: MADr r1.xy, h2, const.xy--, r1.zw--; + | SCT1 | mov | 39: TXLr h2, r1, const.zzzz, TEX0; + | TEX | txl | 39: TXLr h2, r1, const.zzzz, TEX0; + | SCB0/1 | add | 41: ADDh/2 h0, h0, h2; + | | | + 11 | SCT0 | min | 43: MINh h2.x, h5.w---, h4.z---; + | SCT1 | max | 42: MAXh h2.w, h4, h4.---x; + | SCB0/1 | add | 44: ADDh/2 h0, h0, h1; + | | | + 12 | SCT0 | set | 45: SLTh h2.x, h0.w---, h2; + | SCT1 | set | 46: SGTh h2.w, h0, h2; + | SCB0/1 | mul | 47: MOVh h0, h0; + | | | + 13 | SCT0 | mad | 48: ADDxc0_s rc, h2, h2.w---; + | SCB0/1 | mul | 49: MOVh h0(NE0.xxxx), h1; + +Pass SCT TEX SCB + 1: 0% 100% 25% + 2: 0% 100% 25% + 3: 0% 100% 50% + 4: 0% 100% 50% + 5: 0% 0% 50% + 6: 100% 0% 75% + 7: 0% 100% 75% + 8: 0% 100% 100% + 9: 0% 100% 25% + 10: 0% 100% 100% + 11: 50% 0% 100% + 12: 50% 0% 100% + 13: 25% 0% 100% + +MEAN: 17% 61% 67% + +Pass SCT0 SCT1 TEX SCB0 SCB1 + 1: 0% 0% 100% 0% 100% + 2: 0% 0% 100% 0% 100% + 3: 0% 0% 100% 100% 100% + 4: 0% 0% 100% 100% 100% + 5: 0% 0% 0% 100% 100% + 6: 100% 100% 0% 100% 100% + 7: 0% 0% 100% 100% 100% + 8: 0% 0% 100% 100% 100% + 9: 0% 0% 100% 0% 100% + 10: 0% 0% 100% 100% 100% + 11: 100% 100% 0% 100% 100% + 12: 100% 100% 0% 100% 100% + 13: 100% 0% 0% 100% 100% + +MEAN: 30% 23% 61% 76% 100% +Fragment Performance Setup: Driver RSX Compiler, GPU RSX, Flags 0x5 +Results 13 cycles, 3 r regs, 923,076,923 pixels/s +============================================================================*/ +#if (FXAA_PS3 == 1) && (FXAA_EARLY_EXIT == 0) +/*--------------------------------------------------------------------------*/ +#pragma regcount 7 +#pragma disablepc all +#pragma option O3 +#pragma option OutColorPrec=fp16 +#pragma texformat default RGBA8 +/*==========================================================================*/ +half4 FxaaPixelShader( + // See FXAA Quality FxaaPixelShader() source for docs on Inputs! + FxaaFloat2 pos, + FxaaFloat4 fxaaConsolePosPos, + FxaaTex tex, + FxaaTex fxaaConsole360TexExpBiasNegOne, + FxaaTex fxaaConsole360TexExpBiasNegTwo, + FxaaFloat2 fxaaQualityRcpFrame, + FxaaFloat4 fxaaConsoleRcpFrameOpt, + FxaaFloat4 fxaaConsoleRcpFrameOpt2, + FxaaFloat4 fxaaConsole360RcpFrameOpt2, + FxaaFloat fxaaQualitySubpix, + FxaaFloat fxaaQualityEdgeThreshold, + FxaaFloat fxaaQualityEdgeThresholdMin, + FxaaFloat fxaaConsoleEdgeSharpness, + FxaaFloat fxaaConsoleEdgeThreshold, + FxaaFloat fxaaConsoleEdgeThresholdMin, + FxaaFloat4 fxaaConsole360ConstDir +) { +/*--------------------------------------------------------------------------*/ +// (1) + half4 dir; + half4 lumaNe = h4tex2Dlod(tex, half4(fxaaConsolePosPos.zy, 0, 0)); + #if (FXAA_GREEN_AS_LUMA == 0) + lumaNe.w += half(1.0/512.0); + dir.x = -lumaNe.w; + dir.z = -lumaNe.w; + #else + lumaNe.y += half(1.0/512.0); + dir.x = -lumaNe.y; + dir.z = -lumaNe.y; + #endif +/*--------------------------------------------------------------------------*/ +// (2) + half4 lumaSw = h4tex2Dlod(tex, half4(fxaaConsolePosPos.xw, 0, 0)); + #if (FXAA_GREEN_AS_LUMA == 0) + dir.x += lumaSw.w; + dir.z += lumaSw.w; + #else + dir.x += lumaSw.y; + dir.z += lumaSw.y; + #endif +/*--------------------------------------------------------------------------*/ +// (3) + half4 lumaNw = h4tex2Dlod(tex, half4(fxaaConsolePosPos.xy, 0, 0)); + #if (FXAA_GREEN_AS_LUMA == 0) + dir.x -= lumaNw.w; + dir.z += lumaNw.w; + #else + dir.x -= lumaNw.y; + dir.z += lumaNw.y; + #endif +/*--------------------------------------------------------------------------*/ +// (4) + half4 lumaSe = h4tex2Dlod(tex, half4(fxaaConsolePosPos.zw, 0, 0)); + #if (FXAA_GREEN_AS_LUMA == 0) + dir.x += lumaSe.w; + dir.z -= lumaSe.w; + #else + dir.x += lumaSe.y; + dir.z -= lumaSe.y; + #endif +/*--------------------------------------------------------------------------*/ +// (5) + half4 dir1_pos; + dir1_pos.xy = normalize(dir.xyz).xz; + half dirAbsMinTimesC = min(abs(dir1_pos.x), abs(dir1_pos.y)) * half(FXAA_CONSOLE__PS3_EDGE_SHARPNESS); +/*--------------------------------------------------------------------------*/ +// (6) + half4 dir2_pos; + dir2_pos.xy = clamp(dir1_pos.xy / dirAbsMinTimesC, half(-2.0), half(2.0)); + dir1_pos.zw = pos.xy; + dir2_pos.zw = pos.xy; + half4 temp1N; + temp1N.xy = dir1_pos.zw - dir1_pos.xy * fxaaConsoleRcpFrameOpt.zw; +/*--------------------------------------------------------------------------*/ +// (7) + temp1N = h4tex2Dlod(tex, half4(temp1N.xy, 0.0, 0.0)); + half4 rgby1; + rgby1.xy = dir1_pos.zw + dir1_pos.xy * fxaaConsoleRcpFrameOpt.zw; +/*--------------------------------------------------------------------------*/ +// (8) + rgby1 = h4tex2Dlod(tex, half4(rgby1.xy, 0.0, 0.0)); + rgby1 = (temp1N + rgby1) * 0.5; +/*--------------------------------------------------------------------------*/ +// (9) + half4 temp2N; + temp2N.xy = dir2_pos.zw - dir2_pos.xy * fxaaConsoleRcpFrameOpt2.zw; + temp2N = h4tex2Dlod(tex, half4(temp2N.xy, 0.0, 0.0)); +/*--------------------------------------------------------------------------*/ +// (10) + half4 rgby2; + rgby2.xy = dir2_pos.zw + dir2_pos.xy * fxaaConsoleRcpFrameOpt2.zw; + rgby2 = h4tex2Dlod(tex, half4(rgby2.xy, 0.0, 0.0)); + rgby2 = (temp2N + rgby2) * 0.5; +/*--------------------------------------------------------------------------*/ +// (11) + // compilier moves these scalar ops up to other cycles + #if (FXAA_GREEN_AS_LUMA == 0) + half lumaMin = min(min(lumaNw.w, lumaSw.w), min(lumaNe.w, lumaSe.w)); + half lumaMax = max(max(lumaNw.w, lumaSw.w), max(lumaNe.w, lumaSe.w)); + #else + half lumaMin = min(min(lumaNw.y, lumaSw.y), min(lumaNe.y, lumaSe.y)); + half lumaMax = max(max(lumaNw.y, lumaSw.y), max(lumaNe.y, lumaSe.y)); + #endif + rgby2 = (rgby2 + rgby1) * 0.5; +/*--------------------------------------------------------------------------*/ +// (12) + #if (FXAA_GREEN_AS_LUMA == 0) + bool twoTapLt = rgby2.w < lumaMin; + bool twoTapGt = rgby2.w > lumaMax; + #else + bool twoTapLt = rgby2.y < lumaMin; + bool twoTapGt = rgby2.y > lumaMax; + #endif +/*--------------------------------------------------------------------------*/ +// (13) + if(twoTapLt || twoTapGt) rgby2 = rgby1; +/*--------------------------------------------------------------------------*/ + return rgby2; } +/*==========================================================================*/ +#endif + + + +/*============================================================================ + + FXAA3 CONSOLE - OPTIMIZED PS3 PIXEL SHADER (WITH EARLY EXIT) + +============================================================================== +The code mostly matches the assembly. +I have a feeling that 14 cycles is possible, but was not able to get there. +Might have to increase register count to get full performance. +Note this shader does not use perspective interpolation. + +Use the following cgc options, + + --fenable-bx2 --fastmath --fastprecision --nofloatbindings + +Use of FXAA_GREEN_AS_LUMA currently adds a cycle (16 clks). +Will look at fixing this for FXAA 3.12. +------------------------------------------------------------------------------ + NVSHADERPERF OUTPUT +------------------------------------------------------------------------------ +For reference and to aid in debug, output of NVShaderPerf should match this, + +Shader to schedule: + 0: texpkb h0.w(TRUE), v5.zyxx, #0 + 2: addh h2.y(TRUE), h0.w, constant(0.001953, 0.000000, 0.000000, 0.000000).x + 4: texpkb h1.w(TRUE), v5.xwxx, #0 + 6: addh h0.x(TRUE), h1.w, -h2.y + 7: texpkb h2.w(TRUE), v5.zwzz, #0 + 9: minh h4.w(TRUE), h2.y, h2 + 10: maxh h5.x(TRUE), h2.y, h2.w + 11: texpkb h0.w(TRUE), v5, #0 + 13: addh h3.w(TRUE), -h0, h0.x + 14: addh h0.x(TRUE), h0.w, h0 + 15: addh h0.z(TRUE), -h2.w, h0.x + 16: addh h0.x(TRUE), h2.w, h3.w + 17: minh h5.y(TRUE), h0.w, h1.w + 18: nrmh h2.xz(TRUE), h0_n + 19: minh_m8 h2.w(TRUE), |h2.x|, |h2.z| + 20: divx h4.xy(TRUE), h2_n.xzzw, h2_n.w + 21: movr r1.zw(TRUE), v4.xxxy + 22: maxh h2.w(TRUE), h0, h1 + 23: fenct TRUE + 24: madr r0.xy(TRUE), -h2.xzzw, constant(cConst5.x, cConst5.y, cConst5.z, cConst5.w).zwzz, r1.zwzz + 26: texpkb h0(TRUE), r0, #0 + 28: maxh h5.x(TRUE), h2.w, h5 + 29: minh h5.w(TRUE), h5.y, h4 + 30: madr r1.xy(TRUE), h2.xzzw, constant(cConst5.x, cConst5.y, cConst5.z, cConst5.w).zwzz, r1.zwzz + 32: texpkb h2(TRUE), r1, #0 + 34: addh_d2 h2(TRUE), h0, h2 + 35: texpkb h1(TRUE), v4, #0 + 37: maxh h5.y(TRUE), h5.x, h1.w + 38: minh h4.w(TRUE), h1, h5 + 39: madr r0.xy(TRUE), -h4, constant(cConst5.x, cConst5.y, cConst5.z, cConst5.w).xyxx, r1.zwzz + 41: texpkb h0(TRUE), r0, #0 + 43: addh_m8 h5.z(TRUE), h5.y, -h4.w + 44: madr r2.xy(TRUE), h4, constant(cConst5.x, cConst5.y, cConst5.z, cConst5.w).xyxx, r1.zwzz + 46: texpkb h3(TRUE), r2, #0 + 48: addh_d2 h0(TRUE), h0, h3 + 49: addh_d2 h3(TRUE), h0, h2 + 50: movh h0(TRUE), h3 + 51: slth h3.x(TRUE), h3.w, h5.w + 52: sgth h3.w(TRUE), h3, h5.x + 53: addx.c0 rc(TRUE), h3.x, h3 + 54: slth.c0 rc(TRUE), h5.z, h5 + 55: movh h0(c0.NE.w), h2 + 56: movh h0(c0.NE.x), h1 + +IPU0 ------ Simplified schedule: -------- +Pass | Unit | uOp | PC: Op +-----+--------+------+------------------------- + 1 | SCT0/1 | mov | 0: TXLr h0.w, g[TEX1].zyxx, const.xxxx, TEX0; + | TEX | txl | 0: TXLr h0.w, g[TEX1].zyxx, const.xxxx, TEX0; + | SCB0 | add | 2: ADDh h2.y, h0.-w--, const.-x--; + | | | + 2 | SCT0/1 | mov | 4: TXLr h1.w, g[TEX1].xwxx, const.xxxx, TEX0; + | TEX | txl | 4: TXLr h1.w, g[TEX1].xwxx, const.xxxx, TEX0; + | SCB0 | add | 6: ADDh h0.x, h1.w---,-h2.y---; + | | | + 3 | SCT0/1 | mov | 7: TXLr h2.w, g[TEX1].zwzz, const.xxxx, TEX0; + | TEX | txl | 7: TXLr h2.w, g[TEX1].zwzz, const.xxxx, TEX0; + | SCB0 | max | 10: MAXh h5.x, h2.y---, h2.w---; + | SCB1 | min | 9: MINh h4.w, h2.---y, h2; + | | | + 4 | SCT0/1 | mov | 11: TXLr h0.w, g[TEX1], const.xxxx, TEX0; + | TEX | txl | 11: TXLr h0.w, g[TEX1], const.xxxx, TEX0; + | SCB0 | add | 14: ADDh h0.x, h0.w---, h0; + | SCB1 | add | 13: ADDh h3.w,-h0, h0.---x; + | | | + 5 | SCT0 | mad | 16: ADDh h0.x, h2.w---, h3.w---; + | SCT1 | mad | 15: ADDh h0.z,-h2.--w-, h0.--x-; + | SCB0 | min | 17: MINh h5.y, h0.-w--, h1.-w--; + | | | + 6 | SCT1 | mov | 18: NRMh h2.xz, h0; + | SRB | nrm | 18: NRMh h2.xz, h0; + | SCB1 | min | 19: MINh*8 h2.w, |h2.---x|, |h2.---z|; + | | | + 7 | SCT0 | div | 20: DIVx h4.xy, h2.xz--, h2.ww--; + | SCT1 | mov | 21: MOVr r1.zw, g[TEX0].--xy; + | SCB1 | max | 22: MAXh h2.w, h0, h1; + | | | + 8 | SCT0 | mad | 24: MADr r0.xy,-h2.xz--, const.zw--, r1.zw--; + | SCT1 | mov | 26: TXLr h0, r0, const.xxxx, TEX0; + | TEX | txl | 26: TXLr h0, r0, const.xxxx, TEX0; + | SCB0 | max | 28: MAXh h5.x, h2.w---, h5; + | SCB1 | min | 29: MINh h5.w, h5.---y, h4; + | | | + 9 | SCT0 | mad | 30: MADr r1.xy, h2.xz--, const.zw--, r1.zw--; + | SCT1 | mov | 32: TXLr h2, r1, const.xxxx, TEX0; + | TEX | txl | 32: TXLr h2, r1, const.xxxx, TEX0; + | SCB0/1 | add | 34: ADDh/2 h2, h0, h2; + | | | + 10 | SCT0/1 | mov | 35: TXLr h1, g[TEX0], const.xxxx, TEX0; + | TEX | txl | 35: TXLr h1, g[TEX0], const.xxxx, TEX0; + | SCB0 | max | 37: MAXh h5.y, h5.-x--, h1.-w--; + | SCB1 | min | 38: MINh h4.w, h1, h5; + | | | + 11 | SCT0 | mad | 39: MADr r0.xy,-h4, const.xy--, r1.zw--; + | SCT1 | mov | 41: TXLr h0, r0, const.zzzz, TEX0; + | TEX | txl | 41: TXLr h0, r0, const.zzzz, TEX0; + | SCB0 | mad | 44: MADr r2.xy, h4, const.xy--, r1.zw--; + | SCB1 | add | 43: ADDh*8 h5.z, h5.--y-,-h4.--w-; + | | | + 12 | SCT0/1 | mov | 46: TXLr h3, r2, const.xxxx, TEX0; + | TEX | txl | 46: TXLr h3, r2, const.xxxx, TEX0; + | SCB0/1 | add | 48: ADDh/2 h0, h0, h3; + | | | + 13 | SCT0/1 | mad | 49: ADDh/2 h3, h0, h2; + | SCB0/1 | mul | 50: MOVh h0, h3; + | | | + 14 | SCT0 | set | 51: SLTh h3.x, h3.w---, h5.w---; + | SCT1 | set | 52: SGTh h3.w, h3, h5.---x; + | SCB0 | set | 54: SLThc0 rc, h5.z---, h5; + | SCB1 | add | 53: ADDxc0_s rc, h3.---x, h3; + | | | + 15 | SCT0/1 | mul | 55: MOVh h0(NE0.wwww), h2; + | SCB0/1 | mul | 56: MOVh h0(NE0.xxxx), h1; + +Pass SCT TEX SCB + 1: 0% 100% 25% + 2: 0% 100% 25% + 3: 0% 100% 50% + 4: 0% 100% 50% + 5: 50% 0% 25% + 6: 0% 0% 25% + 7: 100% 0% 25% + 8: 0% 100% 50% + 9: 0% 100% 100% + 10: 0% 100% 50% + 11: 0% 100% 75% + 12: 0% 100% 100% + 13: 100% 0% 100% + 14: 50% 0% 50% + 15: 100% 0% 100% + +MEAN: 26% 60% 56% + +Pass SCT0 SCT1 TEX SCB0 SCB1 + 1: 0% 0% 100% 100% 0% + 2: 0% 0% 100% 100% 0% + 3: 0% 0% 100% 100% 100% + 4: 0% 0% 100% 100% 100% + 5: 100% 100% 0% 100% 0% + 6: 0% 0% 0% 0% 100% + 7: 100% 100% 0% 0% 100% + 8: 0% 0% 100% 100% 100% + 9: 0% 0% 100% 100% 100% + 10: 0% 0% 100% 100% 100% + 11: 0% 0% 100% 100% 100% + 12: 0% 0% 100% 100% 100% + 13: 100% 100% 0% 100% 100% + 14: 100% 100% 0% 100% 100% + 15: 100% 100% 0% 100% 100% + +MEAN: 33% 33% 60% 86% 80% +Fragment Performance Setup: Driver RSX Compiler, GPU RSX, Flags 0x5 +Results 15 cycles, 3 r regs, 800,000,000 pixels/s +============================================================================*/ +#if (FXAA_PS3 == 1) && (FXAA_EARLY_EXIT == 1) +/*--------------------------------------------------------------------------*/ +#pragma regcount 7 +#pragma disablepc all +#pragma option O2 +#pragma option OutColorPrec=fp16 +#pragma texformat default RGBA8 +/*==========================================================================*/ +half4 FxaaPixelShader( + // See FXAA Quality FxaaPixelShader() source for docs on Inputs! + FxaaFloat2 pos, + FxaaFloat4 fxaaConsolePosPos, + FxaaTex tex, + FxaaTex fxaaConsole360TexExpBiasNegOne, + FxaaTex fxaaConsole360TexExpBiasNegTwo, + FxaaFloat2 fxaaQualityRcpFrame, + FxaaFloat4 fxaaConsoleRcpFrameOpt, + FxaaFloat4 fxaaConsoleRcpFrameOpt2, + FxaaFloat4 fxaaConsole360RcpFrameOpt2, + FxaaFloat fxaaQualitySubpix, + FxaaFloat fxaaQualityEdgeThreshold, + FxaaFloat fxaaQualityEdgeThresholdMin, + FxaaFloat fxaaConsoleEdgeSharpness, + FxaaFloat fxaaConsoleEdgeThreshold, + FxaaFloat fxaaConsoleEdgeThresholdMin, + FxaaFloat4 fxaaConsole360ConstDir +) { +/*--------------------------------------------------------------------------*/ +// (1) + half4 rgbyNe = h4tex2Dlod(tex, half4(fxaaConsolePosPos.zy, 0, 0)); + #if (FXAA_GREEN_AS_LUMA == 0) + half lumaNe = rgbyNe.w + half(1.0/512.0); + #else + half lumaNe = rgbyNe.y + half(1.0/512.0); + #endif +/*--------------------------------------------------------------------------*/ +// (2) + half4 lumaSw = h4tex2Dlod(tex, half4(fxaaConsolePosPos.xw, 0, 0)); + #if (FXAA_GREEN_AS_LUMA == 0) + half lumaSwNegNe = lumaSw.w - lumaNe; + #else + half lumaSwNegNe = lumaSw.y - lumaNe; + #endif +/*--------------------------------------------------------------------------*/ +// (3) + half4 lumaNw = h4tex2Dlod(tex, half4(fxaaConsolePosPos.xy, 0, 0)); + #if (FXAA_GREEN_AS_LUMA == 0) + half lumaMaxNwSw = max(lumaNw.w, lumaSw.w); + half lumaMinNwSw = min(lumaNw.w, lumaSw.w); + #else + half lumaMaxNwSw = max(lumaNw.y, lumaSw.y); + half lumaMinNwSw = min(lumaNw.y, lumaSw.y); + #endif +/*--------------------------------------------------------------------------*/ +// (4) + half4 lumaSe = h4tex2Dlod(tex, half4(fxaaConsolePosPos.zw, 0, 0)); + #if (FXAA_GREEN_AS_LUMA == 0) + half dirZ = lumaNw.w + lumaSwNegNe; + half dirX = -lumaNw.w + lumaSwNegNe; + #else + half dirZ = lumaNw.y + lumaSwNegNe; + half dirX = -lumaNw.y + lumaSwNegNe; + #endif +/*--------------------------------------------------------------------------*/ +// (5) + half3 dir; + dir.y = 0.0; + #if (FXAA_GREEN_AS_LUMA == 0) + dir.x = lumaSe.w + dirX; + dir.z = -lumaSe.w + dirZ; + half lumaMinNeSe = min(lumaNe, lumaSe.w); + #else + dir.x = lumaSe.y + dirX; + dir.z = -lumaSe.y + dirZ; + half lumaMinNeSe = min(lumaNe, lumaSe.y); + #endif +/*--------------------------------------------------------------------------*/ +// (6) + half4 dir1_pos; + dir1_pos.xy = normalize(dir).xz; + half dirAbsMinTimes8 = min(abs(dir1_pos.x), abs(dir1_pos.y)) * half(FXAA_CONSOLE__PS3_EDGE_SHARPNESS); +/*--------------------------------------------------------------------------*/ +// (7) + half4 dir2_pos; + dir2_pos.xy = clamp(dir1_pos.xy / dirAbsMinTimes8, half(-2.0), half(2.0)); + dir1_pos.zw = pos.xy; + dir2_pos.zw = pos.xy; + #if (FXAA_GREEN_AS_LUMA == 0) + half lumaMaxNeSe = max(lumaNe, lumaSe.w); + #else + half lumaMaxNeSe = max(lumaNe, lumaSe.y); + #endif +/*--------------------------------------------------------------------------*/ +// (8) + half4 temp1N; + temp1N.xy = dir1_pos.zw - dir1_pos.xy * fxaaConsoleRcpFrameOpt.zw; + temp1N = h4tex2Dlod(tex, half4(temp1N.xy, 0.0, 0.0)); + half lumaMax = max(lumaMaxNwSw, lumaMaxNeSe); + half lumaMin = min(lumaMinNwSw, lumaMinNeSe); +/*--------------------------------------------------------------------------*/ +// (9) + half4 rgby1; + rgby1.xy = dir1_pos.zw + dir1_pos.xy * fxaaConsoleRcpFrameOpt.zw; + rgby1 = h4tex2Dlod(tex, half4(rgby1.xy, 0.0, 0.0)); + rgby1 = (temp1N + rgby1) * 0.5; +/*--------------------------------------------------------------------------*/ +// (10) + half4 rgbyM = h4tex2Dlod(tex, half4(pos.xy, 0.0, 0.0)); + #if (FXAA_GREEN_AS_LUMA == 0) + half lumaMaxM = max(lumaMax, rgbyM.w); + half lumaMinM = min(lumaMin, rgbyM.w); + #else + half lumaMaxM = max(lumaMax, rgbyM.y); + half lumaMinM = min(lumaMin, rgbyM.y); + #endif +/*--------------------------------------------------------------------------*/ +// (11) + half4 temp2N; + temp2N.xy = dir2_pos.zw - dir2_pos.xy * fxaaConsoleRcpFrameOpt2.zw; + temp2N = h4tex2Dlod(tex, half4(temp2N.xy, 0.0, 0.0)); + half4 rgby2; + rgby2.xy = dir2_pos.zw + dir2_pos.xy * fxaaConsoleRcpFrameOpt2.zw; + half lumaRangeM = (lumaMaxM - lumaMinM) / FXAA_CONSOLE__PS3_EDGE_THRESHOLD; +/*--------------------------------------------------------------------------*/ +// (12) + rgby2 = h4tex2Dlod(tex, half4(rgby2.xy, 0.0, 0.0)); + rgby2 = (temp2N + rgby2) * 0.5; +/*--------------------------------------------------------------------------*/ +// (13) + rgby2 = (rgby2 + rgby1) * 0.5; +/*--------------------------------------------------------------------------*/ +// (14) + #if (FXAA_GREEN_AS_LUMA == 0) + bool twoTapLt = rgby2.w < lumaMin; + bool twoTapGt = rgby2.w > lumaMax; + #else + bool twoTapLt = rgby2.y < lumaMin; + bool twoTapGt = rgby2.y > lumaMax; + #endif + bool earlyExit = lumaRangeM < lumaMax; + bool twoTap = twoTapLt || twoTapGt; +/*--------------------------------------------------------------------------*/ +// (15) + if(twoTap) rgby2 = rgby1; + if(earlyExit) rgby2 = rgbyM; +/*--------------------------------------------------------------------------*/ + return rgby2; } +/*==========================================================================*/ +#endif + +uniform sampler2D diffuseMap; + +uniform vec2 rcp_screen_res; +uniform vec4 rcp_frame_opt; +uniform vec4 rcp_frame_opt2; +uniform vec2 screen_res; +VARYING vec2 vary_fragcoord; +VARYING vec2 vary_tc; + +void main() +{ + vec4 diff = FxaaPixelShader(vary_tc, //pos + vec4(vary_fragcoord.xy, 0, 0), //fxaaConsolePosPos + diffuseMap, //tex + diffuseMap, + diffuseMap, + rcp_screen_res, //fxaaQualityRcpFrame + vec4(0,0,0,0), //fxaaConsoleRcpFrameOpt + rcp_frame_opt, //fxaaConsoleRcpFrameOpt2 + rcp_frame_opt2, //fxaaConsole360RcpFrameOpt2 + 0.75, //fxaaQualitySubpix + 0.07, //fxaaQualityEdgeThreshold + 0.03, //fxaaQualityEdgeThresholdMin + 8.0, //fxaaConsoleEdgeSharpness + 0.125, //fxaaConsoleEdgeThreshold + 0.05, //fxaaConsoleEdgeThresholdMin + vec4(0,0,0,0)); //fxaaConsole360ConstDir + + + + //diff = texture2D(diffuseMap, vary_tc); + + gl_FragColor = diff; + +} diff --git a/indra/newview/app_settings/shaders/class1/deferred/giF.glsl b/indra/newview/app_settings/shaders/class1/deferred/giF.glsl index bfb7760af8..29ca80ae92 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/giF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/giF.glsl @@ -23,10 +23,12 @@ * $/LicenseInfo$ */ - - #extension GL_ARB_texture_rectangle : enable +#ifdef DEFINE_GL_FRAGCOLOR +out vec4 gl_FragColor; +#endif + uniform sampler2DRect depthMap; uniform sampler2DRect normalMap; uniform sampler2D noiseMap; @@ -38,7 +40,7 @@ uniform sampler2D depthGIMap; uniform sampler2D lightFunc; // Inputs -varying vec2 vary_fragcoord; +VARYING vec2 vary_fragcoord; uniform vec2 screen_res; @@ -182,5 +184,5 @@ void main() vec3 norm = texture2DRect(normalMap, pos_screen).xyz; norm = vec3((norm.xy-0.5)*2.0,norm.z); // unpack norm - gl_FragData[0].xyz = giAmbient(pos, norm); + gl_FragColor.xyz = giAmbient(pos, norm); } diff --git a/indra/newview/app_settings/shaders/class1/deferred/giV.glsl b/indra/newview/app_settings/shaders/class1/deferred/giV.glsl index 190e32b6a3..e5d3bb8ea6 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/giV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/giV.glsl @@ -22,21 +22,27 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - +uniform mat4 modelview_projection_matrix; -varying vec2 vary_fragcoord; +ATTRIBUTE vec3 position; +ATTRIBUTE vec4 diffuse_color; +ATTRIBUTE vec2 texcoord0; + +VARYING vec4 vertex_color; +VARYING vec2 vary_fragcoord; uniform vec2 screen_res; void main() { //transform vertex - gl_Position = ftransform(); - vec4 pos = gl_ModelViewProjectionMatrix * gl_Vertex; + vec4 pos = modelview_projection_matrix * vec4(position.xyz, 1.0); + gl_Position = pos; + vary_fragcoord = (pos.xy * 0.5 + 0.5)*screen_res; - vec4 tex = gl_MultiTexCoord0; + vec4 tex = vec4(texcoord0,0,1); tex.w = 1.0; - gl_FrontColor = gl_Color; + vertex_color = diffuse_color; } diff --git a/indra/newview/app_settings/shaders/class1/deferred/impostorF.glsl b/indra/newview/app_settings/shaders/class1/deferred/impostorF.glsl index 7152e13946..a44173a2a4 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/impostorF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/impostorF.glsl @@ -22,25 +22,30 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - + +#ifdef DEFINE_GL_FRAGCOLOR +out vec4 gl_FragData[3]; +#endif + uniform float minimum_alpha; -uniform float maximum_alpha; uniform sampler2D diffuseMap; uniform sampler2D normalMap; uniform sampler2D specularMap; +VARYING vec2 vary_texcoord0; + void main() { - vec4 col = texture2D(diffuseMap, gl_TexCoord[0].xy); + vec4 col = texture2D(diffuseMap, vary_texcoord0.xy); - if (col.a < minimum_alpha || col.a > maximum_alpha) + if (col.a < minimum_alpha) { discard; } gl_FragData[0] = vec4(col.rgb, col.a * 0.005); - gl_FragData[1] = texture2D(specularMap, gl_TexCoord[0].xy); - gl_FragData[2] = vec4(texture2D(normalMap, gl_TexCoord[0].xy).xyz, 0.0); + gl_FragData[1] = texture2D(specularMap, vary_texcoord0.xy); + gl_FragData[2] = vec4(texture2D(normalMap, vary_texcoord0.xy).xyz, 0.0); } diff --git a/indra/newview/app_settings/shaders/class1/deferred/impostorV.glsl b/indra/newview/app_settings/shaders/class1/deferred/impostorV.glsl index 0cf8c68173..42266e9378 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/impostorV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/impostorV.glsl @@ -22,14 +22,18 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - +uniform mat4 texture_matrix0; +uniform mat4 modelview_projection_matrix; + +ATTRIBUTE vec3 position; +ATTRIBUTE vec2 texcoord0; + +VARYING vec2 vary_texcoord0; void main() { //transform vertex - gl_Position = ftransform(); - gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0; - - gl_FrontColor = gl_Color; + gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0); + vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy; } diff --git a/indra/newview/app_settings/shaders/class1/deferred/luminanceF.glsl b/indra/newview/app_settings/shaders/class1/deferred/luminanceF.glsl index 4ba26fb0c6..e014a14ad8 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/luminanceF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/luminanceF.glsl @@ -22,12 +22,14 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - - - + uniform sampler2DRect diffuseMap; -varying vec2 vary_fragcoord; +#ifdef DEFINE_GL_FRAGCOLOR +out vec4 gl_FragColor; +#endif + +VARYING vec2 vary_fragcoord; void main() { diff --git a/indra/newview/app_settings/shaders/class1/deferred/luminanceV.glsl b/indra/newview/app_settings/shaders/class1/deferred/luminanceV.glsl index 9f22175f84..f2dc60aa5d 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/luminanceV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/luminanceV.glsl @@ -23,19 +23,23 @@ * $/LicenseInfo$ */ +uniform mat4 modelview_projection_matrix; + +ATTRIBUTE vec3 position; +ATTRIBUTE vec4 diffuse_color; - - -varying vec2 vary_fragcoord; +VARYING vec2 vary_fragcoord; +VARYING vec4 vertex_color; uniform vec2 screen_res; void main() { //transform vertex - gl_Position = ftransform(); - vec4 pos = gl_ModelViewProjectionMatrix * gl_Vertex; + vec4 pos = modelview_projection_matrix * vec4(position.xyz, 1.0); + gl_Position = pos; + vary_fragcoord = (pos.xy * 0.5 + 0.5)*screen_res; - gl_FrontColor = gl_Color; + vertex_color = diffuse_color; } diff --git a/indra/newview/app_settings/shaders/class1/deferred/multiPointLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/multiPointLightF.glsl index 42212a978e..179c721a2f 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/multiPointLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/multiPointLightF.glsl @@ -23,10 +23,12 @@ * $/LicenseInfo$ */ - - #extension GL_ARB_texture_rectangle : enable +#ifdef DEFINE_GL_FRAGCOLOR +out vec4 gl_FragColor; +#endif + uniform sampler2DRect depthMap; uniform sampler2DRect diffuseRect; uniform sampler2DRect specularRect; @@ -45,7 +47,7 @@ uniform int light_count; uniform vec4 light[MAX_LIGHT_COUNT]; uniform vec4 light_col[MAX_LIGHT_COUNT]; -varying vec4 vary_fragcoord; +VARYING vec4 vary_fragcoord; uniform vec2 screen_res; uniform float far_z; @@ -124,7 +126,7 @@ void main() if (sa > 0.0) { - sa = texture2D(lightFunc,vec2(sa, spec.a)).a * min(dist_atten*4.0, 1.0); + sa = texture2D(lightFunc,vec2(sa, spec.a)).r * min(dist_atten*4.0, 1.0); sa *= noise; col += da*sa*light_col[i].rgb*spec.rgb; } @@ -141,6 +143,4 @@ void main() gl_FragColor.rgb = out_col; gl_FragColor.a = 0.0; - - //gl_FragColor = vec4(0.1, 0.025, 0.025/4.0, 0.0); } diff --git a/indra/newview/app_settings/shaders/class1/deferred/multiPointLightMSF.glsl b/indra/newview/app_settings/shaders/class1/deferred/multiPointLightMSF.glsl deleted file mode 100644 index 863bac19cf..0000000000 --- a/indra/newview/app_settings/shaders/class1/deferred/multiPointLightMSF.glsl +++ /dev/null @@ -1,155 +0,0 @@ -/** - * @file multiPointLightF.glsl - * - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2007, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - - - -#extension GL_ARB_texture_rectangle : enable -#extension GL_ARB_texture_multisample : enable - -uniform sampler2DMS depthMap; -uniform sampler2DMS diffuseRect; -uniform sampler2DMS specularRect; -uniform sampler2DMS normalMap; -uniform sampler2D noiseMap; -uniform sampler2D lightFunc; - - -uniform vec3 env_mat[3]; -uniform float sun_wash; - -uniform int light_count; - -#define MAX_LIGHT_COUNT 16 -uniform vec4 light[MAX_LIGHT_COUNT]; -uniform vec4 light_col[MAX_LIGHT_COUNT]; - -varying vec4 vary_fragcoord; -uniform vec2 screen_res; - -uniform float far_z; - -uniform mat4 inv_proj; - -vec4 getPosition(ivec2 pos_screen, int sample) -{ - float depth = texelFetch(depthMap, pos_screen, sample).r; - vec2 sc = vec2(pos_screen.xy)*2.0; - sc /= screen_res; - sc -= vec2(1.0,1.0); - vec4 ndc = vec4(sc.x, sc.y, 2.0*depth-1.0, 1.0); - vec4 pos = inv_proj * ndc; - pos /= pos.w; - pos.w = 1.0; - return pos; -} - -void main() -{ - vec2 frag = (vary_fragcoord.xy*0.5+0.5)*screen_res; - ivec2 itc = ivec2(frag); - - int wght = 0; - vec3 fcol = vec3(0,0,0); - - for (int s = 0; s < samples; ++s) - { - vec3 pos = getPosition(itc, s).xyz; - if (pos.z >= far_z) - { - vec3 norm = texelFetch(normalMap, itc, s).xyz; - norm = vec3((norm.xy-0.5)*2.0,norm.z); // unpack norm - norm = normalize(norm); - vec4 spec = texelFetch(specularRect, itc, s); - vec3 diff = texelFetch(diffuseRect, itc, s).rgb; - float noise = texture2D(noiseMap, frag.xy/128.0).b; - vec3 out_col = vec3(0,0,0); - vec3 npos = normalize(-pos); - - // As of OSX 10.6.7 ATI Apple's crash when using a variable size loop - for (int i = 0; i < MAX_LIGHT_COUNT; ++i) - { - bool light_contrib = (i < light_count); - - vec3 lv = light[i].xyz-pos; - float dist2 = dot(lv,lv); - dist2 /= light[i].w; - if (dist2 > 1.0) - { - light_contrib = false; - } - - float da = dot(norm, lv); - if (da < 0.0) - { - light_contrib = false; - } - - if (light_contrib) - { - lv = normalize(lv); - da = dot(norm, lv); - - float fa = light_col[i].a+1.0; - float dist_atten = clamp(1.0-(dist2-1.0*(1.0-fa))/fa, 0.0, 1.0); - dist_atten *= noise; - - float lit = da * dist_atten; - - vec3 col = light_col[i].rgb*lit*diff; - //vec3 col = vec3(dist2, light_col[i].a, lit); - - if (spec.a > 0.0) - { - //vec3 ref = dot(pos+lv, norm); - - float sa = dot(normalize(lv+npos),norm); - - if (sa > 0.0) - { - sa = texture2D(lightFunc,vec2(sa, spec.a)).a * min(dist_atten*4.0, 1.0); - sa *= noise; - col += da*sa*light_col[i].rgb*spec.rgb; - } - } - - out_col += col; - } - } - - fcol += out_col; - ++wght; - } - } - - if (wght <= 0) - { - discard; - } - - gl_FragColor.rgb = fcol/samples; - gl_FragColor.a = 0.0; - - -} diff --git a/indra/newview/app_settings/shaders/class1/deferred/multiPointLightV.glsl b/indra/newview/app_settings/shaders/class1/deferred/multiPointLightV.glsl index 1362a48daf..eefefa640d 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/multiPointLightV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/multiPointLightV.glsl @@ -23,16 +23,17 @@ * $/LicenseInfo$ */ +uniform mat4 modelview_projection_matrix; +ATTRIBUTE vec3 position; -varying vec4 vary_fragcoord; +VARYING vec4 vary_fragcoord; void main() { //transform vertex - vec4 pos = gl_ModelViewProjectionMatrix * gl_Vertex; + vec4 pos = modelview_projection_matrix * vec4(position.xyz, 1.0); vary_fragcoord = pos; gl_Position = pos; - gl_FrontColor = gl_Color; } diff --git a/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl index 85b0ce5beb..2196d14895 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl @@ -23,7 +23,9 @@ * $/LicenseInfo$ */ - +#ifdef DEFINE_GL_FRAGCOLOR +out vec4 gl_FragColor; +#endif //class 1 -- no shadows @@ -35,7 +37,6 @@ uniform sampler2DRect depthMap; uniform sampler2DRect normalMap; uniform samplerCube environmentMap; uniform sampler2D noiseMap; -uniform sampler2D lightFunc; uniform sampler2D projectionMap; uniform mat4 proj_mat; //screen space to light space @@ -55,9 +56,12 @@ uniform float sun_wash; uniform int proj_shadow_idx; uniform float shadow_fade; -varying vec4 vary_light; +uniform vec3 center; +uniform vec3 color; +uniform float falloff; +uniform float size; -varying vec4 vary_fragcoord; +VARYING vec4 vary_fragcoord; uniform vec2 screen_res; uniform mat4 inv_proj; @@ -110,7 +114,7 @@ vec4 texture2DLodAmbient(sampler2D projectionMap, vec2 tc, float lod) vec4 getPosition(vec2 pos_screen) { - float depth = texture2DRect(depthMap, pos_screen.xy).a; + float depth = texture2DRect(depthMap, pos_screen.xy).r; vec2 sc = pos_screen.xy*2.0; sc /= screen_res; sc -= vec2(1.0,1.0); @@ -129,9 +133,9 @@ void main() frag.xy *= screen_res; vec3 pos = getPosition(frag.xy).xyz; - vec3 lv = vary_light.xyz-pos.xyz; + vec3 lv = center.xyz-pos.xyz; float dist2 = dot(lv,lv); - dist2 /= vary_light.w; + dist2 /= size; if (dist2 > 1.0) { discard; @@ -150,7 +154,7 @@ void main() proj_tc.xyz /= proj_tc.w; - float fa = gl_Color.a+1.0; + float fa = falloff+1.0; float dist_atten = min(1.0-(dist2-1.0*(1.0-fa))/fa, 1.0); if (dist_atten <= 0.0) { @@ -182,7 +186,7 @@ void main() vec4 plcol = texture2DLodDiffuse(projectionMap, proj_tc.xy, lod); - vec3 lcol = gl_Color.rgb * plcol.rgb * plcol.a; + vec3 lcol = color.rgb * plcol.rgb * plcol.a; lit = da * dist_atten * noise; @@ -199,7 +203,7 @@ void main() amb_da = min(amb_da, 1.0-lit); - col += amb_da*gl_Color.rgb*diff_tex.rgb*amb_plcol.rgb*amb_plcol.a; + col += amb_da*color.rgb*diff_tex.rgb*amb_plcol.rgb*amb_plcol.a; } @@ -232,7 +236,7 @@ void main() stc.y > 0.0) { vec4 scol = texture2DLodSpecular(projectionMap, stc.xy, proj_lod-spec.a*proj_lod); - col += dist_atten*scol.rgb*gl_Color.rgb*scol.a*spec.rgb; + col += dist_atten*scol.rgb*color.rgb*scol.a*spec.rgb; } } } diff --git a/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightMSF.glsl b/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightMSF.glsl deleted file mode 100644 index 10285817c2..0000000000 --- a/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightMSF.glsl +++ /dev/null @@ -1,250 +0,0 @@ -/** - * @file multiSpotLightF.glsl - * - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2007, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - - - -//class 1 -- no shadows - -#extension GL_ARB_texture_rectangle : enable -#extension GL_ARB_texture_multisample : enable - -uniform sampler2DMS diffuseRect; -uniform sampler2DMS specularRect; -uniform sampler2DMS depthMap; -uniform sampler2DMS normalMap; -uniform sampler2D noiseMap; -uniform sampler2D lightFunc; -uniform sampler2D projectionMap; - -uniform mat4 proj_mat; //screen space to light space -uniform float proj_near; //near clip for projection -uniform vec3 proj_p; //plane projection is emitting from (in screen space) -uniform vec3 proj_n; -uniform float proj_focus; //distance from plane to begin blurring -uniform float proj_lod; //(number of mips in proj map) -uniform float proj_range; //range between near clip and far clip plane of projection -uniform float proj_ambient_lod; -uniform float proj_ambiance; -uniform float near_clip; -uniform float far_clip; - -uniform vec3 proj_origin; //origin of projection to be used for angular attenuation -uniform float sun_wash; -uniform float shadow_fade; - -varying vec4 vary_light; - -varying vec4 vary_fragcoord; -uniform vec2 screen_res; - -uniform mat4 inv_proj; - -vec4 texture2DLodSpecular(sampler2D projectionMap, vec2 tc, float lod) -{ - vec4 ret = texture2DLod(projectionMap, tc, lod); - - vec2 dist = tc-vec2(0.5); - - float det = max(1.0-lod/(proj_lod*0.5), 0.0); - - float d = dot(dist,dist); - - ret *= min(clamp((0.25-d)/0.25, 0.0, 1.0)+det, 1.0); - - return ret; -} - -vec4 texture2DLodDiffuse(sampler2D projectionMap, vec2 tc, float lod) -{ - vec4 ret = texture2DLod(projectionMap, tc, lod); - - vec2 dist = vec2(0.5) - abs(tc-vec2(0.5)); - - float det = min(lod/(proj_lod*0.5), 1.0); - - float d = min(dist.x, dist.y); - - float edge = 0.25*det; - - ret *= clamp(d/edge, 0.0, 1.0); - - return ret; -} - -vec4 texture2DLodAmbient(sampler2D projectionMap, vec2 tc, float lod) -{ - vec4 ret = texture2DLod(projectionMap, tc, lod); - - vec2 dist = tc-vec2(0.5); - - float d = dot(dist,dist); - - ret *= min(clamp((0.25-d)/0.25, 0.0, 1.0), 1.0); - - return ret; -} - - -vec4 getPosition(ivec2 pos_screen, int sample) -{ - float depth = texelFetch(depthMap, pos_screen, sample).r; - vec2 sc = vec2(pos_screen.xy)*2.0; - sc /= screen_res; - sc -= vec2(1.0,1.0); - vec4 ndc = vec4(sc.x, sc.y, 2.0*depth-1.0, 1.0); - vec4 pos = inv_proj * ndc; - pos /= pos.w; - pos.w = 1.0; - return pos; -} - -void main() -{ - int wght = 0; - - vec3 fcol = vec3(0,0,0); - - vec2 frag = (vary_fragcoord.xy*0.5+0.5)*screen_res; - - ivec2 itc = ivec2(frag.xy); - - for (int i = 0; i < samples; ++i) - { - vec3 pos = getPosition(itc, i).xyz; - vec3 lv = vary_light.xyz-pos.xyz; - float dist2 = dot(lv,lv); - dist2 /= vary_light.w; - if (dist2 <= 1.0) - { - vec3 norm = texelFetch(normalMap, itc, i).xyz*2.0-1.0; - - norm = normalize(norm); - float l_dist = -dot(lv, proj_n); - - vec4 proj_tc = (proj_mat * vec4(pos.xyz, 1.0)); - if (proj_tc.z >= 0.0) - { - proj_tc.xyz /= proj_tc.w; - - float fa = gl_Color.a+1.0; - float dist_atten = min(1.0-(dist2-1.0*(1.0-fa))/fa, 1.0); - if (dist_atten > 0.0) - { - lv = proj_origin-pos.xyz; - lv = normalize(lv); - float da = dot(norm, lv); - - vec3 col = vec3(0,0,0); - - vec3 diff_tex = texelFetch(diffuseRect, itc, i).rgb; - - float noise = texture2D(noiseMap, frag.xy/128.0).b; - if (proj_tc.z > 0.0 && - proj_tc.x < 1.0 && - proj_tc.y < 1.0 && - proj_tc.x > 0.0 && - proj_tc.y > 0.0) - { - float lit = 0.0; - float amb_da = proj_ambiance; - - if (da > 0.0) - { - float diff = clamp((l_dist-proj_focus)/proj_range, 0.0, 1.0); - float lod = diff * proj_lod; - - vec4 plcol = texture2DLodDiffuse(projectionMap, proj_tc.xy, lod); - - vec3 lcol = gl_Color.rgb * plcol.rgb * plcol.a; - - lit = da * dist_atten * noise; - - col = lcol*lit*diff_tex; - amb_da += (da*0.5)*proj_ambiance; - } - - //float diff = clamp((proj_range-proj_focus)/proj_range, 0.0, 1.0); - vec4 amb_plcol = texture2DLodAmbient(projectionMap, proj_tc.xy, proj_lod); - - amb_da += (da*da*0.5+0.5)*proj_ambiance; - - amb_da *= dist_atten * noise; - - amb_da = min(amb_da, 1.0-lit); - - col += amb_da*gl_Color.rgb*diff_tex.rgb*amb_plcol.rgb*amb_plcol.a; - } - - - vec4 spec = texelFetch(specularRect, itc, i); - if (spec.a > 0.0) - { - vec3 ref = reflect(normalize(pos), norm); - - //project from point pos in direction ref to plane proj_p, proj_n - vec3 pdelta = proj_p-pos; - float ds = dot(ref, proj_n); - - if (ds < 0.0) - { - vec3 pfinal = pos + ref * dot(pdelta, proj_n)/ds; - - vec4 stc = (proj_mat * vec4(pfinal.xyz, 1.0)); - - if (stc.z > 0.0) - { - stc.xy /= stc.w; - - float fatten = clamp(spec.a*spec.a+spec.a*0.5, 0.25, 1.0); - - stc.xy = (stc.xy - vec2(0.5)) * fatten + vec2(0.5); - - if (stc.x < 1.0 && - stc.y < 1.0 && - stc.x > 0.0 && - stc.y > 0.0) - { - vec4 scol = texture2DLodSpecular(projectionMap, stc.xy, proj_lod-spec.a*proj_lod); - col += dist_atten*scol.rgb*gl_Color.rgb*scol.a*spec.rgb; - } - } - } - } - - fcol += col; - ++wght; - } - } - } - } - - if (wght <= 0) - { - discard; - } - - gl_FragColor.rgb = fcol/samples; - gl_FragColor.a = 0.0; -} diff --git a/indra/newview/app_settings/shaders/class1/effects/glowExtractMSF.glsl b/indra/newview/app_settings/shaders/class1/deferred/normgenF.glsl index c2cc8ed567..879942d8fa 100644 --- a/indra/newview/app_settings/shaders/class1/effects/glowExtractMSF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/normgenF.glsl @@ -1,5 +1,5 @@ /** - * @file glowExtractF.glsl + * @file normgenF.glsl * * $LicenseInfo:firstyear=2007&license=viewerlgpl$ * Second Life Viewer Source Code @@ -23,34 +23,34 @@ * $/LicenseInfo$ */ +#extension GL_ARB_texture_rectangle : enable +#ifdef DEFINE_GL_FRAGCOLOR +out vec4 gl_FragColor; +#endif -#extension GL_ARB_texture_rectangle : enable -#extension GL_ARB_texture_multisample : enable +uniform sampler2D alphaMap; -uniform sampler2DMS diffuseMap; -uniform float minLuminance; -uniform float maxExtractAlpha; -uniform vec3 lumWeights; -uniform vec3 warmthWeights; -uniform float warmthAmount; +VARYING vec2 vary_texcoord0; + +uniform float stepX; +uniform float stepY; +uniform float norm_scale; void main() { - ivec2 itc = ivec2(gl_TexCoord[0].xy); - vec4 fcol = vec4(0,0,0,0); - - for (int i = 0; i < samples; i++) - { - vec4 col = texelFetch(diffuseMap, itc, i); + float alpha = texture2D(alphaMap, vary_texcoord0).a; - /// CALCULATING LUMINANCE (Using NTSC lum weights) - /// http://en.wikipedia.org/wiki/Luma_%28video%29 - float lum = smoothstep(minLuminance, minLuminance+1.0, dot(col.rgb, lumWeights ) ); - float warmth = smoothstep(minLuminance, minLuminance+1.0, max(col.r * warmthWeights.r, max(col.g * warmthWeights.g, col.b * warmthWeights.b)) ); + vec3 right = vec3(norm_scale, 0, (texture2D(alphaMap, vary_texcoord0+vec2(stepX, 0)).a-alpha)*255); + vec3 left = vec3(-norm_scale, 0, (texture2D(alphaMap, vary_texcoord0-vec2(stepX, 0)).a-alpha)*255); + vec3 up = vec3(0, -norm_scale, (texture2D(alphaMap, vary_texcoord0-vec2(0, stepY)).a-alpha)*255); + vec3 down = vec3(0, norm_scale, (texture2D(alphaMap, vary_texcoord0+vec2(0, stepY)).a-alpha)*255); - fcol += vec4(col.rgb, max(col.a, mix(lum, warmth, warmthAmount) * maxExtractAlpha)); - } - - gl_FragColor = fcol/samples; + vec3 norm = cross(right, down) + cross(down, left) + cross(left,up) + cross(up, right); + + norm = normalize(norm); + norm *= 0.5; + norm += 0.5; + + gl_FragColor = vec4(norm, alpha); } diff --git a/indra/newview/app_settings/shaders/class3/deferred/giFinalV.glsl b/indra/newview/app_settings/shaders/class1/deferred/normgenV.glsl index a6a206502c..9bceae05b7 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/giFinalV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/normgenV.glsl @@ -1,5 +1,5 @@ /** - * @file giFinalV.glsl + * @file normgenV.glsl * * $LicenseInfo:firstyear=2007&license=viewerlgpl$ * Second Life Viewer Source Code @@ -23,15 +23,14 @@ * $/LicenseInfo$ */ +ATTRIBUTE vec3 position; +ATTRIBUTE vec2 texcoord0; - -varying vec2 vary_fragcoord; -uniform vec2 screen_res; +VARYING vec2 vary_fragcoord; +VARYING vec2 vary_texcoord0; void main() { - //transform vertex - gl_Position = ftransform(); - vec4 pos = gl_ModelViewProjectionMatrix * gl_Vertex; - vary_fragcoord = (pos.xy*0.5+0.5)*screen_res; + gl_Position = vec4(position.x*2.0-1.0, position.y*2.0-1.0, -1.0, 1.0); + vary_texcoord0 = texcoord0; } diff --git a/indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl index 0771f9b91a..b673d00d6e 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl @@ -23,10 +23,12 @@ * $/LicenseInfo$ */ - - #extension GL_ARB_texture_rectangle : enable +#ifdef DEFINE_GL_FRAGCOLOR +out vec4 gl_FragColor; +#endif + uniform sampler2DRect diffuseRect; uniform sampler2DRect specularRect; uniform sampler2DRect normalMap; @@ -38,9 +40,12 @@ uniform sampler2DRect depthMap; uniform vec3 env_mat[3]; uniform float sun_wash; -varying vec4 vary_light; +uniform vec3 center; +uniform vec3 color; +uniform float falloff; +uniform float size; -varying vec4 vary_fragcoord; +VARYING vec4 vary_fragcoord; uniform vec2 screen_res; uniform mat4 inv_proj; @@ -67,9 +72,9 @@ void main() frag.xy *= screen_res; vec3 pos = getPosition(frag.xy).xyz; - vec3 lv = vary_light.xyz-pos; + vec3 lv = center.xyz-pos; float dist2 = dot(lv,lv); - dist2 /= vary_light.w; + dist2 /= size; if (dist2 > 1.0) { discard; @@ -90,11 +95,11 @@ void main() float noise = texture2D(noiseMap, frag.xy/128.0).b; vec3 col = texture2DRect(diffuseRect, frag.xy).rgb; - float fa = gl_Color.a+1.0; + float fa = falloff+1.0; float dist_atten = clamp(1.0-(dist2-1.0*(1.0-fa))/fa, 0.0, 1.0); float lit = da * dist_atten * noise; - col = gl_Color.rgb*lit*col; + col = color.rgb*lit*col; vec4 spec = texture2DRect(specularRect, frag.xy); if (spec.a > 0.0) @@ -102,9 +107,9 @@ void main() float sa = dot(normalize(lv-normalize(pos)),norm); if (sa > 0.0) { - sa = texture2D(lightFunc, vec2(sa, spec.a)).a * min(dist_atten*4.0, 1.0); + sa = texture2D(lightFunc, vec2(sa, spec.a)).r * min(dist_atten*4.0, 1.0); sa *= noise; - col += da*sa*gl_Color.rgb*spec.rgb; + col += da*sa*color.rgb*spec.rgb; } } diff --git a/indra/newview/app_settings/shaders/class1/deferred/pointLightMSF.glsl b/indra/newview/app_settings/shaders/class1/deferred/pointLightMSF.glsl deleted file mode 100644 index cdce58c84e..0000000000 --- a/indra/newview/app_settings/shaders/class1/deferred/pointLightMSF.glsl +++ /dev/null @@ -1,126 +0,0 @@ -/** - * @file pointLightF.glsl - * - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2007, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - - - -#extension GL_ARB_texture_rectangle : enable -#extension GL_ARB_texture_multisample : enable - -uniform sampler2DMS depthMap; -uniform sampler2DMS diffuseRect; -uniform sampler2DMS specularRect; -uniform sampler2DMS normalMap; -uniform sampler2D noiseMap; -uniform sampler2D lightFunc; - - -uniform vec3 env_mat[3]; -uniform float sun_wash; - -varying vec4 vary_light; - -varying vec4 vary_fragcoord; -uniform vec2 screen_res; - -uniform mat4 inv_proj; -uniform vec4 viewport; - -vec4 getPosition(ivec2 pos_screen, int sample) -{ - float depth = texelFetch(depthMap, pos_screen, sample).r; - vec2 sc = (vec2(pos_screen.xy)-viewport.xy)*2.0; - sc /= viewport.zw; - sc -= vec2(1.0,1.0); - vec4 ndc = vec4(sc.x, sc.y, 2.0*depth-1.0, 1.0); - vec4 pos = inv_proj * ndc; - pos /= pos.w; - pos.w = 1.0; - return pos; -} - -void main() -{ - vec4 frag = vary_fragcoord; - frag.xyz /= frag.w; - frag.xyz = frag.xyz*0.5+0.5; - frag.xy *= screen_res; - - ivec2 itc = ivec2(frag.xy); - - int wght = 0; - vec3 fcol = vec3(0,0,0); - - for (int s = 0; s < samples; ++s) - { - vec3 pos = getPosition(itc, s).xyz; - vec3 lv = vary_light.xyz-pos; - float dist2 = dot(lv,lv); - dist2 /= vary_light.w; - if (dist2 <= 1.0) - { - vec3 norm = texelFetch(normalMap, itc, s).xyz; - norm = vec3((norm.xy-0.5)*2.0,norm.z); // unpack norm - float da = dot(norm, lv); - if (da >= 0.0) - { - norm = normalize(norm); - lv = normalize(lv); - da = dot(norm, lv); - - float noise = texture2D(noiseMap, frag.xy/128.0).b; - - vec3 col = texelFetch(diffuseRect, itc, s).rgb; - float fa = gl_Color.a+1.0; - float dist_atten = clamp(1.0-(dist2-1.0*(1.0-fa))/fa, 0.0, 1.0); - float lit = da * dist_atten * noise; - - col = gl_Color.rgb*lit*col; - - vec4 spec = texelFetch(specularRect, itc, s); - if (spec.a > 0.0) - { - float sa = dot(normalize(lv-normalize(pos)),norm); - if (sa > 0.0) - { - sa = texture2D(lightFunc, vec2(sa, spec.a)).a * min(dist_atten*4.0, 1.0); - sa *= noise; - col += da*sa*gl_Color.rgb*spec.rgb; - } - } - - fcol += col; - ++wght; - } - } - } - - if (wght <= 0) - { - discard; - } - - gl_FragColor.rgb = fcol/samples; - gl_FragColor.a = 0.0; -} diff --git a/indra/newview/app_settings/shaders/class1/deferred/pointLightV.glsl b/indra/newview/app_settings/shaders/class1/deferred/pointLightV.glsl index db1b9d3feb..cb14e6d4e8 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/pointLightV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/pointLightV.glsl @@ -23,23 +23,17 @@ * $/LicenseInfo$ */ +uniform mat4 modelview_projection_matrix; +ATTRIBUTE vec3 position; -varying vec4 vary_light; -varying vec4 vary_fragcoord; +VARYING vec4 vary_fragcoord; void main() { //transform vertex - vec4 pos = gl_ModelViewProjectionMatrix * gl_Vertex; + vec4 pos = modelview_projection_matrix * vec4(position.xyz, 1.0); vary_fragcoord = pos; - vec4 tex = gl_MultiTexCoord0; - tex.w = 1.0; - - vary_light = gl_MultiTexCoord0; - gl_Position = pos; - - gl_FrontColor = gl_Color; } diff --git a/indra/newview/app_settings/shaders/class1/deferred/postDeferredF.glsl b/indra/newview/app_settings/shaders/class1/deferred/postDeferredF.glsl index 29f5f899ba..4603d99c5e 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/postDeferredF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/postDeferredF.glsl @@ -22,82 +22,32 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - - #extension GL_ARB_texture_rectangle : enable -uniform sampler2DRect diffuseRect; -uniform sampler2DRect edgeMap; -uniform sampler2DRect depthMap; -uniform sampler2DRect normalMap; -uniform sampler2D bloomMap; +#ifdef DEFINE_GL_FRAGCOLOR +out vec4 gl_FragColor; +#endif -uniform float depth_cutoff; -uniform float norm_cutoff; -uniform float focal_distance; -uniform float blur_constant; -uniform float tan_pixel_angle; -uniform float magnification; +uniform sampler2DRect diffuseRect; uniform mat4 inv_proj; uniform vec2 screen_res; +uniform float max_cof; +uniform float res_scale; -varying vec2 vary_fragcoord; - -float getDepth(vec2 pos_screen) -{ - float z = texture2DRect(depthMap, pos_screen.xy).r; - z = z*2.0-1.0; - vec4 ndc = vec4(0.0, 0.0, z, 1.0); - vec4 p = inv_proj*ndc; - return p.z/p.w; -} - -float calc_cof(float depth) -{ - float sc = abs(depth-focal_distance)/-depth*blur_constant; - - sc /= magnification; - - // tan_pixel_angle = pixel_length/-depth; - float pixel_length = tan_pixel_angle*-focal_distance; - - sc = sc/pixel_length; - sc *= 1.414; - - return sc; -} +VARYING vec2 vary_fragcoord; -void dofSampleNear(inout vec4 diff, inout float w, float cur_sc, vec2 tc) +void dofSample(inout vec4 diff, inout float w, float min_sc, vec2 tc) { - float d = getDepth(tc); - - float sc = calc_cof(d); - - float wg = 0.25; - vec4 s = texture2DRect(diffuseRect, tc); - // de-weight dull areas to make highlights 'pop' - wg += s.r+s.g+s.b; - - diff += wg*s; - - w += wg; -} -void dofSample(inout vec4 diff, inout float w, float min_sc, float cur_depth, vec2 tc) -{ - float d = getDepth(tc); - - float sc = calc_cof(d); - - if (sc > min_sc //sampled pixel is more "out of focus" than current sample radius - || d < cur_depth) //sampled pixel is further away than current pixel + float sc = s.a*max_cof; + + if (sc > min_sc) //sampled pixel is more "out of focus" than current sample radius { float wg = 0.25; - vec4 s = texture2DRect(diffuseRect, tc); // de-weight dull areas to make highlights 'pop' wg += s.r+s.g+s.b; @@ -107,30 +57,20 @@ void dofSample(inout vec4 diff, inout float w, float min_sc, float cur_depth, ve } } - void main() { - vec3 norm = texture2DRect(normalMap, vary_fragcoord.xy).xyz; - norm = vec3((norm.xy-0.5)*2.0,norm.z); // unpack norm - vec2 tc = vary_fragcoord.xy; - float depth = getDepth(tc); - vec4 diff = texture2DRect(diffuseRect, vary_fragcoord.xy); { float w = 1.0; - float sc = calc_cof(depth); - sc = min(abs(sc), 10.0); - - float fd = depth*0.5f; - + float sc = diff.a*max_cof; + float PI = 3.14159265358979323846264; // sample quite uniformly spaced points within a circle, for a circular 'bokeh' - //if (depth < focal_distance) { while (sc > 0.5) { @@ -141,7 +81,7 @@ void main() float samp_x = sc*sin(ang); float samp_y = sc*cos(ang); // you could test sample coords against an interesting non-circular aperture shape here, if desired. - dofSample(diff, w, sc, depth, vary_fragcoord.xy + vec2(samp_x,samp_y)); + dofSample(diff, w, sc, vary_fragcoord.xy + vec2(samp_x,samp_y)); } sc -= 1.0; } @@ -150,6 +90,5 @@ void main() diff /= w; } - vec4 bloom = texture2D(bloomMap, vary_fragcoord.xy/screen_res); - gl_FragColor = diff + bloom; + gl_FragColor = diff; } diff --git a/indra/newview/app_settings/shaders/class1/deferred/postDeferredMSF.glsl b/indra/newview/app_settings/shaders/class1/deferred/postDeferredMSF.glsl deleted file mode 100644 index 792102a64d..0000000000 --- a/indra/newview/app_settings/shaders/class1/deferred/postDeferredMSF.glsl +++ /dev/null @@ -1,151 +0,0 @@ -/** - * @file postDeferredF.glsl - * - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2007, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - - - -#extension GL_ARB_texture_rectangle : enable -#extension GL_ARB_texture_multisample : enable - -uniform sampler2DMS diffuseRect; -uniform sampler2DMS edgeMap; -uniform sampler2DMS depthMap; -uniform sampler2DMS normalMap; -uniform sampler2D bloomMap; - -uniform float depth_cutoff; -uniform float norm_cutoff; -uniform float focal_distance; -uniform float blur_constant; -uniform float tan_pixel_angle; -uniform float magnification; - -uniform mat4 inv_proj; -uniform vec2 screen_res; - -varying vec2 vary_fragcoord; - -vec4 texture2DMS(sampler2DMS tex, ivec2 tc) -{ - vec4 ret = vec4(0,0,0,0); - for (int i = 0; i < samples; ++i) - { - ret += texelFetch(tex, tc, i); - } - - return ret/samples; -} - -float getDepth(ivec2 pos_screen) -{ - float z = texture2DMS(depthMap, pos_screen.xy).r; - z = z*2.0-1.0; - vec4 ndc = vec4(0.0, 0.0, z, 1.0); - vec4 p = inv_proj*ndc; - return p.z/p.w; -} - -float calc_cof(float depth) -{ - float sc = abs(depth-focal_distance)/-depth*blur_constant; - - sc /= magnification; - - // tan_pixel_angle = pixel_length/-depth; - float pixel_length = tan_pixel_angle*-focal_distance; - - sc = sc/pixel_length; - sc *= 1.414; - - return sc; -} - -void dofSample(inout vec4 diff, inout float w, float min_sc, float cur_depth, ivec2 tc) -{ - float d = getDepth(tc); - - float sc = calc_cof(d); - - if (sc > min_sc //sampled pixel is more "out of focus" than current sample radius - || d < cur_depth) //sampled pixel is further away than current pixel - { - float wg = 0.25; - - vec4 s = texture2DMS(diffuseRect, tc); - // de-weight dull areas to make highlights 'pop' - wg += s.r+s.g+s.b; - - diff += wg*s; - - w += wg; - } -} - - -void main() -{ - ivec2 itc = ivec2(vary_fragcoord.xy); - - vec3 norm = texture2DMS(normalMap, itc).xyz; - norm = vec3((norm.xy-0.5)*2.0,norm.z); // unpack norm - - float depth = getDepth(itc); - - vec4 diff = texture2DMS(diffuseRect, itc); - - { - float w = 1.0; - - float sc = calc_cof(depth); - sc = min(abs(sc), 10.0); - - float fd = depth*0.5f; - - float PI = 3.14159265358979323846264; - - int isc = int(sc); - - // sample quite uniformly spaced points within a circle, for a circular 'bokeh' - //if (depth < focal_distance) - { - for (int x = -isc; x <= isc; x+=2) - { - for (int y = -isc; y <= isc; y+=2) - { - ivec2 cur_samp = ivec2(x,y); - float cur_sc = length(vec2(cur_samp)); - if (cur_sc < sc) - { - dofSample(diff, w, cur_sc, depth, itc+cur_samp); - } - } - } - } - - diff /= w; - } - - vec4 bloom = texture2D(bloomMap, vary_fragcoord.xy/screen_res); - gl_FragColor = diff + bloom; -} diff --git a/indra/newview/app_settings/shaders/class1/deferred/postDeferredNoDoFF.glsl b/indra/newview/app_settings/shaders/class1/deferred/postDeferredNoDoFF.glsl index 34e30a3070..c275434777 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/postDeferredNoDoFF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/postDeferredNoDoFF.glsl @@ -1,5 +1,5 @@ /** - * @file postDeferredF.glsl + * @file postDeferredNoDoFF.glsl * * $LicenseInfo:firstyear=2007&license=viewerlgpl$ * Second Life Viewer Source Code @@ -23,15 +23,17 @@ * $/LicenseInfo$ */ - - #extension GL_ARB_texture_rectangle : enable +#ifdef DEFINE_GL_FRAGCOLOR +out vec4 gl_FragColor; +#endif + uniform sampler2DRect diffuseRect; uniform sampler2D bloomMap; uniform vec2 screen_res; -varying vec2 vary_fragcoord; +VARYING vec2 vary_fragcoord; void main() { @@ -40,3 +42,4 @@ void main() vec4 bloom = texture2D(bloomMap, vary_fragcoord.xy/screen_res); gl_FragColor = diff + bloom; } + diff --git a/indra/newview/app_settings/shaders/class1/deferred/postDeferredV.glsl b/indra/newview/app_settings/shaders/class1/deferred/postDeferredV.glsl index cb83dda795..8edf5b2723 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/postDeferredV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/postDeferredV.glsl @@ -22,16 +22,23 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - +uniform mat4 modelview_projection_matrix; + +ATTRIBUTE vec3 position; + +VARYING vec2 vary_fragcoord; +VARYING vec2 vary_tc; + +uniform vec2 tc_scale; -varying vec2 vary_fragcoord; uniform vec2 screen_res; void main() { //transform vertex - gl_Position = ftransform(); - vec4 pos = gl_ModelViewProjectionMatrix * gl_Vertex; + vec4 pos = modelview_projection_matrix * vec4(position.xyz, 1.0); + gl_Position = pos; + vary_tc = (pos.xy*0.5+0.5)*tc_scale; vary_fragcoord = (pos.xy*0.5+0.5)*screen_res; } diff --git a/indra/newview/app_settings/shaders/class1/deferred/postgiF.glsl b/indra/newview/app_settings/shaders/class1/deferred/postgiF.glsl index 99257daca4..84d65d5b3b 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/postgiF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/postgiF.glsl @@ -22,9 +22,11 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - - + #ifdef DEFINE_GL_FRAGCOLOR + out vec4 gl_FragColor; + #endif + uniform sampler2DRect depthMap; uniform sampler2DRect normalMap; uniform sampler2DRect giLightMap; @@ -38,7 +40,7 @@ uniform int kern_length; uniform float kern_scale; uniform vec3 blur_quad; -varying vec2 vary_fragcoord; +VARYING vec2 vary_fragcoord; uniform mat4 inv_proj; uniform vec2 screen_res; @@ -94,7 +96,5 @@ void main() col = col*col*blur_quad.x + col*blur_quad.y + blur_quad.z; - gl_FragData[0].xyz = col; - - //gl_FragColor = ccol; + gl_FragColor.rgb = col; } diff --git a/indra/newview/app_settings/shaders/class1/deferred/postgiV.glsl b/indra/newview/app_settings/shaders/class1/deferred/postgiV.glsl index 6231ee68b7..0d5c8e7287 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/postgiV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/postgiV.glsl @@ -22,16 +22,19 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ + +uniform mat4 modelview_projection_matrix; +ATTRIBUTE vec3 position; -varying vec2 vary_fragcoord; +VARYING vec2 vary_fragcoord; uniform vec2 screen_res; void main() { //transform vertex - gl_Position = ftransform(); - vec4 pos = gl_ModelViewProjectionMatrix * gl_Vertex; + vec4 pos = modelview_projection_matrix * vec4(position.xyz, 1.0); + gl_Position = pos; vary_fragcoord = (pos.xy*0.5+0.5)*screen_res; } diff --git a/indra/newview/app_settings/shaders/class1/deferred/shadowAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class1/deferred/shadowAlphaMaskF.glsl index 615317febf..c1fb7b55d4 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/shadowAlphaMaskF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/shadowAlphaMaskF.glsl @@ -22,19 +22,24 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - + +#ifdef DEFINE_GL_FRAGCOLOR +out vec4 gl_FragColor; +#endif + uniform float minimum_alpha; -uniform float maximum_alpha; uniform sampler2D diffuseMap; -varying vec4 post_pos; +VARYING vec4 post_pos; +VARYING vec4 vertex_color; +VARYING vec2 vary_texcoord0; void main() { - float alpha = texture2D(diffuseMap, gl_TexCoord[0].xy).a * gl_Color.a; + float alpha = diffuseLookup(vary_texcoord0.xy).a * vertex_color.a; - if (alpha < minimum_alpha || alpha > maximum_alpha) + if (alpha < minimum_alpha) { discard; } diff --git a/indra/newview/app_settings/shaders/class1/deferred/shadowAlphaMaskV.glsl b/indra/newview/app_settings/shaders/class1/deferred/shadowAlphaMaskV.glsl index 4be18a9c5e..7d3b06c56e 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/shadowAlphaMaskV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/shadowAlphaMaskV.glsl @@ -22,20 +22,30 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - +uniform mat4 texture_matrix0; +uniform mat4 modelview_projection_matrix; -varying vec4 post_pos; +ATTRIBUTE vec3 position; +ATTRIBUTE vec4 diffuse_color; +ATTRIBUTE vec2 texcoord0; + +VARYING vec4 post_pos; +VARYING vec4 vertex_color; +VARYING vec2 vary_texcoord0; + +void passTextureIndex(); void main() { //transform vertex - vec4 pos = gl_ModelViewProjectionMatrix*gl_Vertex; - + vec4 pos = modelview_projection_matrix*vec4(position.xyz, 1.0); post_pos = pos; gl_Position = vec4(pos.x, pos.y, pos.w*0.5, pos.w); - gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0; - gl_FrontColor = gl_Color; + passTextureIndex(); + + vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy; + vertex_color = diffuse_color; } diff --git a/indra/newview/app_settings/shaders/class1/deferred/shadowF.glsl b/indra/newview/app_settings/shaders/class1/deferred/shadowF.glsl index 541f08d5fe..bf75ca262e 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/shadowF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/shadowF.glsl @@ -23,9 +23,11 @@ * $/LicenseInfo$ */ +#ifdef DEFINE_GL_FRAGCOLOR +out vec4 gl_FragColor; +#endif - -varying vec4 post_pos; +VARYING vec4 post_pos; void main() { diff --git a/indra/newview/app_settings/shaders/class1/deferred/shadowV.glsl b/indra/newview/app_settings/shaders/class1/deferred/shadowV.glsl index fc3ff45614..8b46e81f90 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/shadowV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/shadowV.glsl @@ -22,15 +22,17 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - +uniform mat4 modelview_projection_matrix; -varying vec4 post_pos; +ATTRIBUTE vec3 position; + +VARYING vec4 post_pos; void main() { //transform vertex - vec4 pos = gl_ModelViewProjectionMatrix*gl_Vertex; + vec4 pos = modelview_projection_matrix*vec4(position.xyz, 1.0); post_pos = pos; diff --git a/indra/newview/app_settings/shaders/class1/deferred/skyF.glsl b/indra/newview/app_settings/shaders/class1/deferred/skyF.glsl index 59c0a994cd..96ad0aa93a 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/skyF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/skyF.glsl @@ -23,13 +23,15 @@ * $/LicenseInfo$ */ - +#ifdef DEFINE_GL_FRAGCOLOR +out vec4 gl_FragData[3]; +#endif ///////////////////////////////////////////////////////////////////////// // The fragment shader for the sky ///////////////////////////////////////////////////////////////////////// -varying vec4 vary_HazeColor; +VARYING vec4 vary_HazeColor; uniform sampler2D cloud_noise_texture; uniform vec4 gamma; diff --git a/indra/newview/app_settings/shaders/class1/deferred/skyV.glsl b/indra/newview/app_settings/shaders/class1/deferred/skyV.glsl index 3a44bb6d26..721de18e0b 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/skyV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/skyV.glsl @@ -22,15 +22,19 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - +uniform mat4 modelview_projection_matrix; + +ATTRIBUTE vec3 position; +ATTRIBUTE vec2 texcoord0; // SKY //////////////////////////////////////////////////////////////////////// // The vertex shader for creating the atmospheric sky /////////////////////////////////////////////////////////////////////////////// // Output parameters -varying vec4 vary_HazeColor; +VARYING vec4 vary_HazeColor; +VARYING vec2 vary_texcoord0; // Inputs uniform vec3 camPosLocal; @@ -57,12 +61,12 @@ void main() { // World / view / projection - gl_Position = ftransform(); - gl_TexCoord[0] = gl_MultiTexCoord0; + gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0); + vary_texcoord0 = texcoord0; // Get relative position - vec3 P = gl_Vertex.xyz - camPosLocal.xyz + vec3(0,50,0); - //vec3 P = gl_Vertex.xyz + vec3(0,50,0); + vec3 P = position.xyz - camPosLocal.xyz + vec3(0,50,0); + //vec3 P = position.xyz + vec3(0,50,0); // Set altitude if (P.y > 0.) diff --git a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl index 855d89ebe6..51110ae4df 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl @@ -23,17 +23,18 @@ * $/LicenseInfo$ */ - - #extension GL_ARB_texture_rectangle : enable +#ifdef DEFINE_GL_FRAGCOLOR +out vec4 gl_FragColor; +#endif + uniform sampler2DRect diffuseRect; uniform sampler2DRect specularRect; uniform sampler2DRect positionMap; uniform sampler2DRect normalMap; uniform sampler2DRect lightMap; uniform sampler2DRect depthMap; -uniform sampler2D noiseMap; uniform samplerCube environmentMap; uniform sampler2D lightFunc; @@ -58,13 +59,11 @@ uniform vec4 distance_multiplier; uniform vec4 max_y; uniform vec4 glow; uniform float scene_light_strength; -uniform vec3 env_mat[3]; -//uniform mat4 shadow_matrix[3]; -//uniform vec4 shadow_clip; +uniform mat3 env_mat; uniform mat3 ssao_effect_mat; -varying vec4 vary_light; -varying vec2 vary_fragcoord; +uniform vec3 sun_dir; +VARYING vec2 vary_fragcoord; vec3 vary_PositionEye; @@ -146,10 +145,6 @@ void calcAtmospherics(vec3 inPositionEye, float ambFactor) { vec3 P = inPositionEye; setPositionEye(P); - //(TERRAIN) limit altitude - if (P.y > max_y.x) P *= (max_y.x / P.y); - if (P.y < -max_y.x) P *= (-max_y.x / P.y); - vec3 tmpLightnorm = lightnorm.xyz; vec3 Pn = normalize(P); @@ -281,9 +276,8 @@ void main() vec3 pos = getPosition_d(tc, depth).xyz; vec3 norm = texture2DRect(normalMap, tc).xyz; norm = vec3((norm.xy-0.5)*2.0,norm.z); // unpack norm - //vec3 nz = texture2D(noiseMap, vary_fragcoord.xy/128.0).xyz; - - float da = max(dot(norm.xyz, vary_light.xyz), 0.0); + + float da = max(dot(norm.xyz, sun_dir.xyz), 0.0); vec4 diffuse = texture2DRect(diffuseRect, tc); vec4 spec = texture2DRect(specularRect, vary_fragcoord.xy); @@ -304,13 +298,18 @@ void main() // the old infinite-sky shiny reflection // vec3 refnormpersp = normalize(reflect(pos.xyz, norm.xyz)); - float sa = dot(refnormpersp, vary_light.xyz); - vec3 dumbshiny = vary_SunlitColor*texture2D(lightFunc, vec2(sa, spec.a)).a; + float sa = dot(refnormpersp, sun_dir.xyz); + vec3 dumbshiny = vary_SunlitColor*texture2D(lightFunc, vec2(sa, spec.a)).r; // add the two types of shiny together vec3 spec_contrib = dumbshiny * spec.rgb; bloom = dot(spec_contrib, spec_contrib); col += spec_contrib; + + //add environmentmap + vec3 env_vec = env_mat * refnormpersp; + col = mix(col.rgb, textureCube(environmentMap, env_vec).rgb, + max(spec.a-diffuse.a*2.0, 0.0)); } col = atmosLighting(col); @@ -324,5 +323,6 @@ void main() } gl_FragColor.rgb = col; + gl_FragColor.a = bloom; } diff --git a/indra/newview/app_settings/shaders/class1/deferred/softenLightMSF.glsl b/indra/newview/app_settings/shaders/class1/deferred/softenLightMSF.glsl deleted file mode 100644 index f118b0da2a..0000000000 --- a/indra/newview/app_settings/shaders/class1/deferred/softenLightMSF.glsl +++ /dev/null @@ -1,342 +0,0 @@ -/** - * @file softenLightF.glsl - * - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2007, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - - - -#extension GL_ARB_texture_rectangle : enable -#extension GL_ARB_texture_multisample : enable - -uniform sampler2DMS diffuseRect; -uniform sampler2DMS specularRect; -uniform sampler2DMS normalMap; -uniform sampler2DMS depthMap; -uniform sampler2D noiseMap; -uniform samplerCube environmentMap; -uniform sampler2D lightFunc; - -uniform float blur_size; -uniform float blur_fidelity; - -// Inputs -uniform vec4 morphFactor; -uniform vec3 camPosLocal; -//uniform vec4 camPosWorld; -uniform vec4 gamma; -uniform vec4 lightnorm; -uniform vec4 sunlight_color; -uniform vec4 ambient; -uniform vec4 blue_horizon; -uniform vec4 blue_density; -uniform vec4 haze_horizon; -uniform vec4 haze_density; -uniform vec4 cloud_shadow; -uniform vec4 density_multiplier; -uniform vec4 distance_multiplier; -uniform vec4 max_y; -uniform vec4 glow; -uniform float scene_light_strength; -uniform vec3 env_mat[3]; -//uniform mat4 shadow_matrix[3]; -//uniform vec4 shadow_clip; -uniform mat3 ssao_effect_mat; - -varying vec4 vary_light; -varying vec2 vary_fragcoord; - -vec3 vary_PositionEye; - -vec3 vary_SunlitColor; -vec3 vary_AmblitColor; -vec3 vary_AdditiveColor; -vec3 vary_AtmosAttenuation; - -uniform mat4 inv_proj; -uniform vec2 screen_res; - -vec4 getPosition_d(vec2 pos_screen, float depth) -{ - vec2 sc = pos_screen.xy*2.0; - sc /= screen_res; - sc -= vec2(1.0,1.0); - vec4 ndc = vec4(sc.x, sc.y, 2.0*depth-1.0, 1.0); - vec4 pos = inv_proj * ndc; - pos /= pos.w; - pos.w = 1.0; - return pos; -} - -vec3 getPositionEye() -{ - return vary_PositionEye; -} -vec3 getSunlitColor() -{ - return vary_SunlitColor; -} -vec3 getAmblitColor() -{ - return vary_AmblitColor; -} -vec3 getAdditiveColor() -{ - return vary_AdditiveColor; -} -vec3 getAtmosAttenuation() -{ - return vary_AtmosAttenuation; -} - - -void setPositionEye(vec3 v) -{ - vary_PositionEye = v; -} - -void setSunlitColor(vec3 v) -{ - vary_SunlitColor = v; -} - -void setAmblitColor(vec3 v) -{ - vary_AmblitColor = v; -} - -void setAdditiveColor(vec3 v) -{ - vary_AdditiveColor = v; -} - -void setAtmosAttenuation(vec3 v) -{ - vary_AtmosAttenuation = v; -} - -void calcAtmospherics(vec3 inPositionEye, float ambFactor) { - - vec3 P = inPositionEye; - setPositionEye(P); - - //(TERRAIN) limit altitude - if (P.y > max_y.x) P *= (max_y.x / P.y); - if (P.y < -max_y.x) P *= (-max_y.x / P.y); - - vec3 tmpLightnorm = lightnorm.xyz; - - vec3 Pn = normalize(P); - float Plen = length(P); - - vec4 temp1 = vec4(0); - vec3 temp2 = vec3(0); - vec4 blue_weight; - vec4 haze_weight; - vec4 sunlight = sunlight_color; - vec4 light_atten; - - //sunlight attenuation effect (hue and brightness) due to atmosphere - //this is used later for sunlight modulation at various altitudes - light_atten = (blue_density * 1.0 + vec4(haze_density.r) * 0.25) * (density_multiplier.x * max_y.x); - //I had thought blue_density and haze_density should have equal weighting, - //but attenuation due to haze_density tends to seem too strong - - temp1 = blue_density + vec4(haze_density.r); - blue_weight = blue_density / temp1; - haze_weight = vec4(haze_density.r) / temp1; - - //(TERRAIN) compute sunlight from lightnorm only (for short rays like terrain) - temp2.y = max(0.0, tmpLightnorm.y); - temp2.y = 1. / temp2.y; - sunlight *= exp( - light_atten * temp2.y); - - // main atmospheric scattering line integral - temp2.z = Plen * density_multiplier.x; - - // Transparency (-> temp1) - // ATI Bugfix -- can't store temp1*temp2.z*distance_multiplier.x in a variable because the ati - // compiler gets confused. - temp1 = exp(-temp1 * temp2.z * distance_multiplier.x); - - //final atmosphere attenuation factor - setAtmosAttenuation(temp1.rgb); - - //compute haze glow - //(can use temp2.x as temp because we haven't used it yet) - temp2.x = dot(Pn, tmpLightnorm.xyz); - temp2.x = 1. - temp2.x; - //temp2.x is 0 at the sun and increases away from sun - temp2.x = max(temp2.x, .03); //was glow.y - //set a minimum "angle" (smaller glow.y allows tighter, brighter hotspot) - temp2.x *= glow.x; - //higher glow.x gives dimmer glow (because next step is 1 / "angle") - temp2.x = pow(temp2.x, glow.z); - //glow.z should be negative, so we're doing a sort of (1 / "angle") function - - //add "minimum anti-solar illumination" - temp2.x += .25; - - //increase ambient when there are more clouds - vec4 tmpAmbient = ambient + (vec4(1.) - ambient) * cloud_shadow.x * 0.5; - - /* decrease value and saturation (that in HSV, not HSL) for occluded areas - * // for HSV color/geometry used here, see http://gimp-savvy.com/BOOK/index.html?node52.html - * // The following line of code performs the equivalent of: - * float ambAlpha = tmpAmbient.a; - * float ambValue = dot(vec3(tmpAmbient), vec3(0.577)); // projection onto <1/rt(3), 1/rt(3), 1/rt(3)>, the neutral white-black axis - * vec3 ambHueSat = vec3(tmpAmbient) - vec3(ambValue); - * tmpAmbient = vec4(RenderSSAOEffect.valueFactor * vec3(ambValue) + RenderSSAOEffect.saturationFactor *(1.0 - ambFactor) * ambHueSat, ambAlpha); - */ - tmpAmbient = vec4(mix(ssao_effect_mat * tmpAmbient.rgb, tmpAmbient.rgb, ambFactor), tmpAmbient.a); - - //haze color - setAdditiveColor( - vec3(blue_horizon * blue_weight * (sunlight*(1.-cloud_shadow.x) + tmpAmbient) - + (haze_horizon.r * haze_weight) * (sunlight*(1.-cloud_shadow.x) * temp2.x - + tmpAmbient))); - - //brightness of surface both sunlight and ambient - setSunlitColor(vec3(sunlight * .5)); - setAmblitColor(vec3(tmpAmbient * .25)); - setAdditiveColor(getAdditiveColor() * vec3(1.0 - temp1)); -} - -vec3 atmosLighting(vec3 light) -{ - light *= getAtmosAttenuation().r; - light += getAdditiveColor(); - return (2.0 * light); -} - -vec3 atmosTransport(vec3 light) { - light *= getAtmosAttenuation().r; - light += getAdditiveColor() * 2.0; - return light; -} -vec3 atmosGetDiffuseSunlightColor() -{ - return getSunlitColor(); -} - -vec3 scaleDownLight(vec3 light) -{ - return (light / scene_light_strength ); -} - -vec3 scaleUpLight(vec3 light) -{ - return (light * scene_light_strength); -} - -vec3 atmosAmbient(vec3 light) -{ - return getAmblitColor() + light / 2.0; -} - -vec3 atmosAffectDirectionalLight(float lightIntensity) -{ - return getSunlitColor() * lightIntensity; -} - -vec3 scaleSoftClip(vec3 light) -{ - //soft clip effect: - light = 1. - clamp(light, vec3(0.), vec3(1.)); - light = 1. - pow(light, gamma.xxx); - - return light; -} - -vec4 texture2DMS(sampler2DMS tex, ivec2 tc) -{ - vec4 ret = vec4(0,0,0,0); - - for (int i = 0; i < samples; ++i) - { - ret += texelFetch(tex,tc,i); - } - - return ret/samples; -} - -void main() -{ - vec2 tc = vary_fragcoord.xy; - ivec2 itc = ivec2(tc); - - vec4 fcol = vec4(0,0,0,0); - - for (int i = 0; i < samples; ++i) - { - float depth = texelFetch(depthMap, itc, i).r; - vec3 pos = getPosition_d(tc, depth).xyz; - vec3 norm = texelFetch(normalMap, itc, i).xyz; - - norm = vec3((norm.xy-0.5)*2.0,norm.z); // unpack norm - //vec3 nz = texture2D(noiseMap, vary_fragcoord.xy/128.0).xyz; - - float da = max(dot(norm.xyz, vary_light.xyz), 0.0); - - vec4 diffuse = texelFetch(diffuseRect, itc, i); - vec3 col; - float bloom = 0.0; - - if (diffuse.a < 0.9) - { - vec4 spec = texelFetch(specularRect, itc, i); - - calcAtmospherics(pos.xyz, 1.0); - - col = atmosAmbient(vec3(0)); - col += atmosAffectDirectionalLight(max(min(da, 1.0), diffuse.a)); - - col *= diffuse.rgb; - - if (spec.a > 0.0) // specular reflection - { - // the old infinite-sky shiny reflection - // - vec3 refnormpersp = normalize(reflect(pos.xyz, norm.xyz)); - float sa = dot(refnormpersp, vary_light.xyz); - vec3 dumbshiny = vary_SunlitColor*texture2D(lightFunc, vec2(sa, spec.a)).a; - - // add the two types of shiny together - vec3 spec_contrib = dumbshiny * spec.rgb; - bloom = dot(spec_contrib, spec_contrib); - col += spec_contrib; - } - - col = atmosLighting(col); - col = scaleSoftClip(col); - col = mix(col, diffuse.rgb, diffuse.a); - } - else - { - col = diffuse.rgb; - } - - fcol += vec4(col, bloom); - } - - gl_FragColor = fcol/samples; -} diff --git a/indra/newview/app_settings/shaders/class1/deferred/softenLightV.glsl b/indra/newview/app_settings/shaders/class1/deferred/softenLightV.glsl index fed238510a..c6031fc45a 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/softenLightV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/softenLightV.glsl @@ -23,22 +23,18 @@ * $/LicenseInfo$ */ +uniform mat4 modelview_projection_matrix; +ATTRIBUTE vec3 position; uniform vec2 screen_res; -varying vec4 vary_light; -varying vec2 vary_fragcoord; +VARYING vec2 vary_fragcoord; void main() { //transform vertex - gl_Position = ftransform(); - - vec4 pos = gl_ModelViewProjectionMatrix * gl_Vertex; - vary_fragcoord = (pos.xy*0.5+0.5)*screen_res; + vec4 pos = modelview_projection_matrix * vec4(position.xyz, 1.0); + gl_Position = pos; - vec4 tex = gl_MultiTexCoord0; - tex.w = 1.0; - - vary_light = gl_MultiTexCoord0; + vary_fragcoord = (pos.xy*0.5+0.5)*screen_res; } diff --git a/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl index 7363bd6715..cc0f4e5b6b 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl @@ -23,17 +23,18 @@ * $/LicenseInfo$ */ - - + #extension GL_ARB_texture_rectangle : enable +#ifdef DEFINE_GL_FRAGCOLOR +out vec4 gl_FragColor; +#endif + uniform sampler2DRect diffuseRect; uniform sampler2DRect specularRect; uniform sampler2DRect depthMap; uniform sampler2DRect normalMap; -uniform samplerCube environmentMap; uniform sampler2D noiseMap; -uniform sampler2D lightFunc; uniform sampler2D projectionMap; uniform mat4 proj_mat; //screen space to light space @@ -50,9 +51,12 @@ uniform float far_clip; uniform vec3 proj_origin; //origin of projection to be used for angular attenuation uniform float sun_wash; -varying vec4 vary_light; +uniform vec3 center; +uniform vec3 color; +uniform float falloff; +uniform float size; -varying vec4 vary_fragcoord; +VARYING vec4 vary_fragcoord; uniform vec2 screen_res; uniform mat4 inv_proj; @@ -78,9 +82,9 @@ void main() frag.xy *= screen_res; vec3 pos = getPosition(frag.xy).xyz; - vec3 lv = vary_light.xyz-pos.xyz; + vec3 lv = center.xyz-pos.xyz; float dist2 = dot(lv,lv); - dist2 /= vary_light.w; + dist2 /= size; if (dist2 > 1.0) { discard; @@ -100,7 +104,7 @@ void main() proj_tc.xyz /= proj_tc.w; - float fa = gl_Color.a+1.0; + float fa = falloff+1.0; float dist_atten = clamp(1.0-(dist2-1.0*(1.0-fa))/fa, 0.0, 1.0); lv = proj_origin-pos.xyz; @@ -126,7 +130,7 @@ void main() vec4 plcol = texture2DLod(projectionMap, proj_tc.xy, lod); - vec3 lcol = gl_Color.rgb * plcol.rgb * plcol.a; + vec3 lcol = color.rgb * plcol.rgb * plcol.a; lit = da * dist_atten * noise; @@ -145,7 +149,7 @@ void main() amb_da = min(amb_da, 1.0-lit); - col += amb_da*gl_Color.rgb*diff_tex.rgb*amb_plcol.rgb*amb_plcol.a; + col += amb_da*color.rgb*diff_tex.rgb*amb_plcol.rgb*amb_plcol.a; } @@ -174,7 +178,7 @@ void main() stc.y > 0.0) { vec4 scol = texture2DLod(projectionMap, stc.xy, proj_lod-spec.a*proj_lod); - col += dist_atten*scol.rgb*gl_Color.rgb*scol.a*spec.rgb; + col += dist_atten*scol.rgb*color.rgb*scol.a*spec.rgb; } } } diff --git a/indra/newview/app_settings/shaders/class1/deferred/spotLightMSF.glsl b/indra/newview/app_settings/shaders/class1/deferred/spotLightMSF.glsl deleted file mode 100644 index 0c0171881f..0000000000 --- a/indra/newview/app_settings/shaders/class1/deferred/spotLightMSF.glsl +++ /dev/null @@ -1,252 +0,0 @@ -/** - * @file multiSpotLightF.glsl - * - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2007, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - - - -//class 1 -- no shadows - -#extension GL_ARB_texture_rectangle : enable -#extension GL_ARB_texture_multisample : enable - -uniform sampler2DMS diffuseRect; -uniform sampler2DMS specularRect; -uniform sampler2DMS depthMap; -uniform sampler2DMS normalMap; -uniform sampler2D noiseMap; -uniform sampler2D lightFunc; -uniform sampler2D projectionMap; - -uniform mat4 proj_mat; //screen space to light space -uniform float proj_near; //near clip for projection -uniform vec3 proj_p; //plane projection is emitting from (in screen space) -uniform vec3 proj_n; -uniform float proj_focus; //distance from plane to begin blurring -uniform float proj_lod; //(number of mips in proj map) -uniform float proj_range; //range between near clip and far clip plane of projection -uniform float proj_ambient_lod; -uniform float proj_ambiance; -uniform float near_clip; -uniform float far_clip; - -uniform vec3 proj_origin; //origin of projection to be used for angular attenuation -uniform float sun_wash; -uniform int proj_shadow_idx; -uniform float shadow_fade; - -varying vec4 vary_light; - -varying vec4 vary_fragcoord; -uniform vec2 screen_res; - -uniform mat4 inv_proj; - -vec4 texture2DLodSpecular(sampler2D projectionMap, vec2 tc, float lod) -{ - vec4 ret = texture2DLod(projectionMap, tc, lod); - - vec2 dist = tc-vec2(0.5); - - float det = max(1.0-lod/(proj_lod*0.5), 0.0); - - float d = dot(dist,dist); - - ret *= min(clamp((0.25-d)/0.25, 0.0, 1.0)+det, 1.0); - - return ret; -} - -vec4 texture2DLodDiffuse(sampler2D projectionMap, vec2 tc, float lod) -{ - vec4 ret = texture2DLod(projectionMap, tc, lod); - - vec2 dist = vec2(0.5) - abs(tc-vec2(0.5)); - - float det = min(lod/(proj_lod*0.5), 1.0); - - float d = min(dist.x, dist.y); - - float edge = 0.25*det; - - ret *= clamp(d/edge, 0.0, 1.0); - - return ret; -} - -vec4 texture2DLodAmbient(sampler2D projectionMap, vec2 tc, float lod) -{ - vec4 ret = texture2DLod(projectionMap, tc, lod); - - vec2 dist = tc-vec2(0.5); - - float d = dot(dist,dist); - - ret *= min(clamp((0.25-d)/0.25, 0.0, 1.0), 1.0); - - return ret; -} - - -vec4 getPosition(ivec2 pos_screen, int sample) -{ - float depth = texelFetch(depthMap, pos_screen, sample).r; - vec2 sc = vec2(pos_screen.xy)*2.0; - sc /= screen_res; - sc -= vec2(1.0,1.0); - vec4 ndc = vec4(sc.x, sc.y, 2.0*depth-1.0, 1.0); - vec4 pos = inv_proj * ndc; - pos /= pos.w; - pos.w = 1.0; - return pos; -} - -void main() -{ - vec4 frag = vary_fragcoord; - frag.xyz /= frag.w; - frag.xyz = frag.xyz*0.5+0.5; - frag.xy *= screen_res; - ivec2 itc = ivec2(frag.xy); - - vec3 fcol = vec3(0,0,0); - int wght = 0; - - for (int i = 0; i < samples; ++i) - { - vec3 pos = getPosition(itc, i).xyz; - vec3 lv = vary_light.xyz-pos.xyz; - float dist2 = dot(lv,lv); - dist2 /= vary_light.w; - if (dist2 <= 1.0) - { - vec3 norm = texelFetch(normalMap, itc, i).xyz*2.0-1.0; - - norm = normalize(norm); - float l_dist = -dot(lv, proj_n); - - vec4 proj_tc = (proj_mat * vec4(pos.xyz, 1.0)); - if (proj_tc.z >= 0.0) - { - proj_tc.xyz /= proj_tc.w; - - float fa = gl_Color.a+1.0; - float dist_atten = min(1.0-(dist2-1.0*(1.0-fa))/fa, 1.0); - if (dist_atten > 0.0) - { - lv = proj_origin-pos.xyz; - lv = normalize(lv); - float da = dot(norm, lv); - - vec3 col = vec3(0,0,0); - - vec3 diff_tex = texelFetch(diffuseRect, itc, i).rgb; - - float noise = texture2D(noiseMap, frag.xy/128.0).b; - if (proj_tc.z > 0.0 && - proj_tc.x < 1.0 && - proj_tc.y < 1.0 && - proj_tc.x > 0.0 && - proj_tc.y > 0.0) - { - float lit = 0.0; - float amb_da = proj_ambiance; - - if (da > 0.0) - { - float diff = clamp((l_dist-proj_focus)/proj_range, 0.0, 1.0); - float lod = diff * proj_lod; - - vec4 plcol = texture2DLodDiffuse(projectionMap, proj_tc.xy, lod); - - vec3 lcol = gl_Color.rgb * plcol.rgb * plcol.a; - - lit = da * dist_atten * noise; - - col = lcol*lit*diff_tex; - amb_da += (da*0.5)*proj_ambiance; - } - - //float diff = clamp((proj_range-proj_focus)/proj_range, 0.0, 1.0); - vec4 amb_plcol = texture2DLodAmbient(projectionMap, proj_tc.xy, proj_lod); - - amb_da += (da*da*0.5+0.5)*proj_ambiance; - - amb_da *= dist_atten * noise; - - amb_da = min(amb_da, 1.0-lit); - - col += amb_da*gl_Color.rgb*diff_tex.rgb*amb_plcol.rgb*amb_plcol.a; - } - - - vec4 spec = texelFetch(specularRect, itc, i); - if (spec.a > 0.0) - { - vec3 ref = reflect(normalize(pos), norm); - - //project from point pos in direction ref to plane proj_p, proj_n - vec3 pdelta = proj_p-pos; - float ds = dot(ref, proj_n); - - if (ds < 0.0) - { - vec3 pfinal = pos + ref * dot(pdelta, proj_n)/ds; - - vec4 stc = (proj_mat * vec4(pfinal.xyz, 1.0)); - - if (stc.z > 0.0) - { - stc.xy /= stc.w; - - float fatten = clamp(spec.a*spec.a+spec.a*0.5, 0.25, 1.0); - - stc.xy = (stc.xy - vec2(0.5)) * fatten + vec2(0.5); - - if (stc.x < 1.0 && - stc.y < 1.0 && - stc.x > 0.0 && - stc.y > 0.0) - { - vec4 scol = texture2DLodSpecular(projectionMap, stc.xy, proj_lod-spec.a*proj_lod); - col += dist_atten*scol.rgb*gl_Color.rgb*scol.a*spec.rgb; - } - } - } - } - - fcol += col; - ++wght; - } - } - } - } - - if (wght <= 0) - { - discard; - } - - gl_FragColor.rgb = fcol/samples; - gl_FragColor.a = 0.0; -} diff --git a/indra/newview/app_settings/shaders/class1/deferred/starsF.glsl b/indra/newview/app_settings/shaders/class1/deferred/starsF.glsl index 4ab59d4d66..03fccd2766 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/starsF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/starsF.glsl @@ -22,14 +22,19 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - +#ifdef DEFINE_GL_FRAGCOLOR +out vec4 gl_FragData[3]; +#endif + +VARYING vec4 vertex_color; +VARYING vec2 vary_texcoord0; uniform sampler2D diffuseMap; void main() { - vec4 col = gl_Color * texture2D(diffuseMap, gl_TexCoord[0].xy); + vec4 col = vertex_color * texture2D(diffuseMap, vary_texcoord0.xy); gl_FragData[0] = col; gl_FragData[1] = vec4(0,0,0,0); diff --git a/indra/newview/app_settings/shaders/class1/deferred/starsV.glsl b/indra/newview/app_settings/shaders/class1/deferred/starsV.glsl index 84adf6bc41..8bc5b06379 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/starsV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/starsV.glsl @@ -22,14 +22,21 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - +uniform mat4 texture_matrix0; +uniform mat4 modelview_projection_matrix; +ATTRIBUTE vec3 position; +ATTRIBUTE vec4 diffuse_color; +ATTRIBUTE vec2 texcoord0; + +VARYING vec4 vertex_color; +VARYING vec2 vary_texcoord0; void main() { //transform vertex - gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; - gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0; - gl_FrontColor = gl_Color; + gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0); + vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy; + vertex_color = diffuse_color; } diff --git a/indra/newview/app_settings/shaders/class1/deferred/sunLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/sunLightF.glsl index 78ea15e87a..adc7c5d005 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/sunLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/sunLightF.glsl @@ -23,12 +23,14 @@ * $/LicenseInfo$ */ - - //class 1, no shadow, no SSAO, should never be called #extension GL_ARB_texture_rectangle : enable +#ifdef DEFINE_GL_FRAGCOLOR +out vec4 gl_FragColor; +#endif + void main() { gl_FragColor = vec4(0,0,0,0); diff --git a/indra/newview/app_settings/shaders/class1/deferred/sunLightSSAOF.glsl b/indra/newview/app_settings/shaders/class1/deferred/sunLightSSAOF.glsl index 2f880d65dd..fc5959a33c 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/sunLightSSAOF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/sunLightSSAOF.glsl @@ -23,9 +23,12 @@ */ - #extension GL_ARB_texture_rectangle : enable +#ifdef DEFINE_GL_FRAGCOLOR +out vec4 gl_FragColor; +#endif + //class 1 -- no shadow, SSAO only uniform sampler2DRect depthMap; @@ -41,8 +44,7 @@ uniform float ssao_max_radius; uniform float ssao_factor; uniform float ssao_factor_inv; -varying vec2 vary_fragcoord; -varying vec4 vary_light; +VARYING vec2 vary_fragcoord; uniform mat4 inv_proj; uniform vec2 screen_res; diff --git a/indra/newview/app_settings/shaders/class1/deferred/sunLightSSAOMSF.glsl b/indra/newview/app_settings/shaders/class1/deferred/sunLightSSAOMSF.glsl deleted file mode 100644 index abb64334ed..0000000000 --- a/indra/newview/app_settings/shaders/class1/deferred/sunLightSSAOMSF.glsl +++ /dev/null @@ -1,140 +0,0 @@ -/** - * @file sunLightSSAOF.glsl - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2007, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - - - -#extension GL_ARB_texture_rectangle : enable -#extension GL_ARB_texture_multisample : enable - -//class 1 -- no shadow, SSAO only - -uniform sampler2DMS depthMap; -uniform sampler2DMS normalMap; -uniform sampler2D noiseMap; - - -// Inputs -uniform mat4 shadow_matrix[6]; -uniform vec4 shadow_clip; -uniform float ssao_radius; -uniform float ssao_max_radius; -uniform float ssao_factor; -uniform float ssao_factor_inv; - -varying vec2 vary_fragcoord; -varying vec4 vary_light; - -uniform mat4 inv_proj; -uniform vec2 screen_res; - -uniform float shadow_bias; -uniform float shadow_offset; - -vec4 getPosition(ivec2 pos_screen, int sample) -{ - float depth = texelFetch(depthMap, pos_screen, sample).r; - vec2 sc = pos_screen.xy*2.0; - sc /= screen_res; - sc -= vec2(1.0,1.0); - vec4 ndc = vec4(sc.x, sc.y, 2.0*depth-1.0, 1.0); - vec4 pos = inv_proj * ndc; - pos /= pos.w; - pos.w = 1.0; - return pos; -} - -//calculate decreases in ambient lighting when crowded out (SSAO) -float calcAmbientOcclusion(vec4 pos, vec3 norm, int sample) -{ - float ret = 1.0; - - vec2 kern[8]; - // exponentially (^2) distant occlusion samples spread around origin - kern[0] = vec2(-1.0, 0.0) * 0.125*0.125; - kern[1] = vec2(1.0, 0.0) * 0.250*0.250; - kern[2] = vec2(0.0, 1.0) * 0.375*0.375; - kern[3] = vec2(0.0, -1.0) * 0.500*0.500; - kern[4] = vec2(0.7071, 0.7071) * 0.625*0.625; - kern[5] = vec2(-0.7071, -0.7071) * 0.750*0.750; - kern[6] = vec2(-0.7071, 0.7071) * 0.875*0.875; - kern[7] = vec2(0.7071, -0.7071) * 1.000*1.000; - - vec2 pos_screen = vary_fragcoord.xy; - vec3 pos_world = pos.xyz; - vec2 noise_reflect = texture2D(noiseMap, vary_fragcoord.xy/128.0).xy; - - float angle_hidden = 0.0; - int points = 0; - - float scale = min(ssao_radius / -pos_world.z, ssao_max_radius); - - // it was found that keeping # of samples a constant was the fastest, probably due to compiler optimizations unrolling?) - for (int i = 0; i < 8; i++) - { - ivec2 samppos_screen = ivec2(pos_screen + scale * reflect(kern[i], noise_reflect)); - vec3 samppos_world = getPosition(samppos_screen, sample).xyz; - - vec3 diff = pos_world - samppos_world; - float dist2 = dot(diff, diff); - - // assume each sample corresponds to an occluding sphere with constant radius, constant x-sectional area - // --> solid angle shrinking by the square of distance - //radius is somewhat arbitrary, can approx with just some constant k * 1 / dist^2 - //(k should vary inversely with # of samples, but this is taken care of later) - - angle_hidden = angle_hidden + float(dot((samppos_world - 0.05*norm - pos_world), norm) > 0.0) * min(1.0/dist2, ssao_factor_inv); - - // 'blocked' samples (significantly closer to camera relative to pos_world) are "no data", not "no occlusion" - points = points + int(diff.z > -1.0); - } - - angle_hidden = min(ssao_factor*angle_hidden/float(points), 1.0); - - ret = (1.0 - (float(points != 0) * angle_hidden)); - - return min(ret, 1.0); -} - -void main() -{ - vec2 pos_screen = vary_fragcoord.xy; - ivec2 itc = ivec2(pos_screen); - - float col = 0; - - for (int i = 0; i < samples; i++) - { - vec4 pos = getPosition(itc, i); - vec3 norm = texelFetch(normalMap, itc, i).xyz; - norm = vec3((norm.xy-0.5)*2.0,norm.z); // unpack norm - col += calcAmbientOcclusion(pos,norm,i); - } - - col /= samples; - - gl_FragColor[0] = 1.0; - gl_FragColor[1] = col; - gl_FragColor[2] = 1.0; - gl_FragColor[3] = 1.0; -} diff --git a/indra/newview/app_settings/shaders/class1/deferred/sunLightV.glsl b/indra/newview/app_settings/shaders/class1/deferred/sunLightV.glsl index e7ab11c6ed..473d6df8fa 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/sunLightV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/sunLightV.glsl @@ -22,24 +22,20 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - +uniform mat4 modelview_projection_matrix; + +ATTRIBUTE vec3 position; -varying vec4 vary_light; -varying vec2 vary_fragcoord; +VARYING vec2 vary_fragcoord; uniform vec2 screen_res; void main() { //transform vertex - gl_Position = ftransform(); - vec4 pos = gl_ModelViewProjectionMatrix * gl_Vertex; - vary_fragcoord = (pos.xy * 0.5 + 0.5)*screen_res; - vec4 tex = gl_MultiTexCoord0; - tex.w = 1.0; + vec4 pos = modelview_projection_matrix * vec4(position.xyz, 1.0); + gl_Position = pos; - vary_light = gl_MultiTexCoord0; - - gl_FrontColor = gl_Color; + vary_fragcoord = (pos.xy * 0.5 + 0.5)*screen_res; } diff --git a/indra/newview/app_settings/shaders/class1/deferred/terrainF.glsl b/indra/newview/app_settings/shaders/class1/deferred/terrainF.glsl index c6578ea177..5522e6c41d 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/terrainF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/terrainF.glsl @@ -23,7 +23,9 @@ * $/LicenseInfo$ */ - +#ifdef DEFINE_GL_FRAGCOLOR +out vec4 gl_FragData[3]; +#endif uniform sampler2D detail_0; uniform sampler2D detail_1; @@ -31,24 +33,26 @@ uniform sampler2D detail_2; uniform sampler2D detail_3; uniform sampler2D alpha_ramp; -varying vec3 vary_normal; +VARYING vec3 vary_normal; +VARYING vec4 vary_texcoord0; +VARYING vec4 vary_texcoord1; void main() { /// Note: This should duplicate the blending functionality currently used for the terrain rendering. - vec4 color0 = texture2D(detail_0, gl_TexCoord[0].xy); - vec4 color1 = texture2D(detail_1, gl_TexCoord[0].xy); - vec4 color2 = texture2D(detail_2, gl_TexCoord[0].xy); - vec4 color3 = texture2D(detail_3, gl_TexCoord[0].xy); + vec4 color0 = texture2D(detail_0, vary_texcoord0.xy); + vec4 color1 = texture2D(detail_1, vary_texcoord0.xy); + vec4 color2 = texture2D(detail_2, vary_texcoord0.xy); + vec4 color3 = texture2D(detail_3, vary_texcoord0.xy); - float alpha1 = texture2D(alpha_ramp, gl_TexCoord[0].zw).a; - float alpha2 = texture2D(alpha_ramp,gl_TexCoord[1].xy).a; - float alphaFinal = texture2D(alpha_ramp, gl_TexCoord[1].zw).a; + float alpha1 = texture2D(alpha_ramp, vary_texcoord0.zw).a; + float alpha2 = texture2D(alpha_ramp,vary_texcoord1.xy).a; + float alphaFinal = texture2D(alpha_ramp, vary_texcoord1.zw).a; vec4 outColor = mix( mix(color3, color2, alpha2), mix(color1, color0, alpha1), alphaFinal ); gl_FragData[0] = vec4(outColor.rgb, 0.0); - gl_FragData[1] = vec4(outColor.rgb*0.2, 0.2); + gl_FragData[1] = vec4(0,0,0,0); vec3 nvn = normalize(vary_normal); gl_FragData[2] = vec4(nvn.xy * 0.5 + 0.5, nvn.z, 0.0); } diff --git a/indra/newview/app_settings/shaders/class1/deferred/terrainV.glsl b/indra/newview/app_settings/shaders/class1/deferred/terrainV.glsl index fc19a73709..5effee4e4e 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/terrainV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/terrainV.glsl @@ -22,10 +22,24 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - +uniform mat3 normal_matrix; +uniform mat4 texture_matrix0; +uniform mat4 modelview_projection_matrix; -varying vec3 vary_normal; +ATTRIBUTE vec3 position; +ATTRIBUTE vec3 normal; +ATTRIBUTE vec4 diffuse_color; +ATTRIBUTE vec2 texcoord0; +ATTRIBUTE vec2 texcoord1; + +VARYING vec3 vary_normal; + +VARYING vec4 vary_texcoord0; +VARYING vec4 vary_texcoord1; + +uniform vec4 object_plane_s; +uniform vec4 object_plane_t; vec4 texgen_object(vec4 vpos, vec4 tc, mat4 mat, vec4 tp0, vec4 tp1) { @@ -44,16 +58,16 @@ vec4 texgen_object(vec4 vpos, vec4 tc, mat4 mat, vec4 tp0, vec4 tp1) void main() { //transform vertex - gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0); - vary_normal = normalize(gl_NormalMatrix * gl_Normal); + vary_normal = normalize(normal_matrix * normal); // Transform and pass tex coords - gl_TexCoord[0].xy = texgen_object(gl_Vertex, gl_MultiTexCoord0, gl_TextureMatrix[0], gl_ObjectPlaneS[0], gl_ObjectPlaneT[0]).xy; + vary_texcoord0.xy = texgen_object(vec4(position, 1.0), vec4(texcoord0,0,1), texture_matrix0, object_plane_s, object_plane_t).xy; - vec4 t = gl_MultiTexCoord1; + vec4 t = vec4(texcoord1,0,1); - gl_TexCoord[0].zw = t.xy; - gl_TexCoord[1].xy = t.xy-vec2(2.0, 0.0); - gl_TexCoord[1].zw = t.xy-vec2(1.0, 0.0); + vary_texcoord0.zw = t.xy; + vary_texcoord1.xy = t.xy-vec2(2.0, 0.0); + vary_texcoord1.zw = t.xy-vec2(1.0, 0.0); } diff --git a/indra/newview/app_settings/shaders/class1/deferred/treeF.glsl b/indra/newview/app_settings/shaders/class1/deferred/treeF.glsl index 56a149523e..ea98d6884c 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/treeF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/treeF.glsl @@ -22,17 +22,28 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - +#ifdef DEFINE_GL_FRAGCOLOR +out vec4 gl_FragData[3]; +#endif uniform sampler2D diffuseMap; -varying vec3 vary_normal; +VARYING vec4 vertex_color; +VARYING vec3 vary_normal; +VARYING vec2 vary_texcoord0; + +uniform float minimum_alpha; void main() { - vec4 col = texture2D(diffuseMap, gl_TexCoord[0].xy); - gl_FragData[0] = vec4(gl_Color.rgb*col.rgb, col.a <= 0.5 ? 0.0 : 0.005); + vec4 col = texture2D(diffuseMap, vary_texcoord0.xy); + if (col.a < minimum_alpha) + { + discard; + } + + gl_FragData[0] = vec4(vertex_color.rgb*col.rgb, 0.0); gl_FragData[1] = vec4(0,0,0,0); vec3 nvn = normalize(vary_normal); gl_FragData[2] = vec4(nvn.xy * 0.5 + 0.5, nvn.z, 0.0); diff --git a/indra/newview/app_settings/shaders/class1/deferred/treeShadowF.glsl b/indra/newview/app_settings/shaders/class1/deferred/treeShadowF.glsl new file mode 100644 index 0000000000..20d0170535 --- /dev/null +++ b/indra/newview/app_settings/shaders/class1/deferred/treeShadowF.glsl @@ -0,0 +1,49 @@ +/** + * @file treeShadowF.glsl + * + * $LicenseInfo:firstyear=2005&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2005, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#ifdef DEFINE_GL_FRAGCOLOR +out vec4 gl_FragColor; +#endif + +uniform float minimum_alpha; + +uniform sampler2D diffuseMap; + +VARYING vec4 post_pos; +VARYING vec2 vary_texcoord0; + +void main() +{ + float alpha = texture2D(diffuseMap, vary_texcoord0.xy).a; + + if (alpha < minimum_alpha) + { + discard; + } + + gl_FragColor = vec4(1,1,1,1); + + gl_FragDepth = max(post_pos.z/post_pos.w*0.5+0.5, 0.0); +} diff --git a/indra/newview/app_settings/shaders/class3/deferred/softenLightV.glsl b/indra/newview/app_settings/shaders/class1/deferred/treeShadowV.glsl index fed238510a..e472a75304 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/softenLightV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/treeShadowV.glsl @@ -1,7 +1,7 @@ /** - * @file softenLightF.glsl + * @file treeShadowV.glsl * - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ + * $LicenseInfo:firstyear=2007&license=viewerlgpl$ * Second Life Viewer Source Code * Copyright (C) 2007, Linden Research, Inc. * @@ -22,23 +22,24 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - +uniform mat4 texture_matrix0; +uniform mat4 modelview_projection_matrix; + +ATTRIBUTE vec3 position; +ATTRIBUTE vec2 texcoord0; -uniform vec2 screen_res; +VARYING vec4 post_pos; +VARYING vec2 vary_texcoord0; -varying vec4 vary_light; -varying vec2 vary_fragcoord; void main() { //transform vertex - gl_Position = ftransform(); + vec4 pos = modelview_projection_matrix*vec4(position.xyz, 1.0); + + post_pos = pos; - vec4 pos = gl_ModelViewProjectionMatrix * gl_Vertex; - vary_fragcoord = (pos.xy*0.5+0.5)*screen_res; - - vec4 tex = gl_MultiTexCoord0; - tex.w = 1.0; + gl_Position = vec4(pos.x, pos.y, pos.w*0.5, pos.w); - vary_light = gl_MultiTexCoord0; + vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy; } diff --git a/indra/newview/app_settings/shaders/class1/deferred/treeV.glsl b/indra/newview/app_settings/shaders/class1/deferred/treeV.glsl index 01401028d6..3b6571a24a 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/treeV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/treeV.glsl @@ -22,18 +22,26 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - +uniform mat4 texture_matrix0; +uniform mat4 modelview_projection_matrix; +uniform mat3 normal_matrix; -varying vec3 vary_normal; +ATTRIBUTE vec3 position; +ATTRIBUTE vec3 normal; +ATTRIBUTE vec2 texcoord0; + +VARYING vec3 vary_normal; +VARYING vec4 vertex_color; +VARYING vec2 vary_texcoord0; void main() { //transform vertex - gl_Position = ftransform(); - gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0; + gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0); + vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy; - vary_normal = normalize(gl_NormalMatrix * gl_Normal); + vary_normal = normalize(normal_matrix * normal); - gl_FrontColor = gl_Color; + vertex_color = vec4(1,1,1,1); } diff --git a/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl b/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl index c3e7371c8e..4c9ea24a24 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl @@ -23,10 +23,12 @@ * $/LicenseInfo$ */ - - #extension GL_ARB_texture_rectangle : enable +#ifdef DEFINE_GL_FRAGCOLOR +out vec4 gl_FragData[3]; +#endif + vec3 scaleSoftClip(vec3 inColor); vec3 atmosTransport(vec3 inColor); @@ -58,10 +60,10 @@ uniform vec2 screen_res; uniform mat4 norm_mat; //region space to screen space //bigWave is (refCoord.w, view.w); -varying vec4 refCoord; -varying vec4 littleWave; -varying vec4 view; -varying vec4 vary_position; +VARYING vec4 refCoord; +VARYING vec4 littleWave; +VARYING vec4 view; +VARYING vec4 vary_position; void main() { diff --git a/indra/newview/app_settings/shaders/class1/deferred/waterV.glsl b/indra/newview/app_settings/shaders/class1/deferred/waterV.glsl index 9d415ade85..9734acf005 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/waterV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/waterV.glsl @@ -22,7 +22,11 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - + +uniform mat4 modelview_matrix; +uniform mat4 modelview_projection_matrix; + +ATTRIBUTE vec3 position; void calcAtmospherics(vec3 inPositionEye); @@ -33,11 +37,11 @@ uniform float time; uniform vec3 eyeVec; uniform float waterHeight; -varying vec4 refCoord; -varying vec4 littleWave; -varying vec4 view; +VARYING vec4 refCoord; +VARYING vec4 littleWave; +VARYING vec4 view; -varying vec4 vary_position; +VARYING vec4 vary_position; float wave(vec2 v, float t, float f, vec2 d, float s) { @@ -47,43 +51,42 @@ float wave(vec2 v, float t, float f, vec2 d, float s) void main() { //transform vertex - vec4 position = gl_Vertex; - mat4 modelViewProj = gl_ModelViewProjectionMatrix; + vec4 pos = vec4(position.xyz, 1.0); + mat4 modelViewProj = modelview_projection_matrix; vec4 oPosition; //get view vector vec3 oEyeVec; - oEyeVec.xyz = position.xyz-eyeVec; + oEyeVec.xyz = pos.xyz-eyeVec; float d = length(oEyeVec.xy); float ld = min(d, 2560.0); - position.xy = eyeVec.xy + oEyeVec.xy/d*ld; + pos.xy = eyeVec.xy + oEyeVec.xy/d*ld; view.xyz = oEyeVec; d = clamp(ld/1536.0-0.5, 0.0, 1.0); d *= d; - oPosition = position; + oPosition = vec4(position, 1.0); oPosition.z = mix(oPosition.z, max(eyeVec.z*0.75, 0.0), d); - vary_position = gl_ModelViewMatrix * oPosition; + vary_position = modelview_matrix * oPosition; oPosition = modelViewProj * oPosition; refCoord.xyz = oPosition.xyz + vec3(0,0,0.2); //get wave position parameter (create sweeping horizontal waves) - vec3 v = position.xyz; + vec3 v = pos.xyz; v.x += (cos(v.x*0.08/*+time*0.01*/)+sin(v.y*0.02))*6.0; //push position for further horizon effect. - position.xyz = oEyeVec.xyz*(waterHeight/oEyeVec.z); - position.w = 1.0; - position = position*gl_ModelViewMatrix; - - calcAtmospherics((gl_ModelViewMatrix * gl_Vertex).xyz); - + pos.xyz = oEyeVec.xyz*(waterHeight/oEyeVec.z); + pos.w = 1.0; + pos = modelview_matrix*pos; + calcAtmospherics(pos.xyz); + //pass wave parameters to pixel shader vec2 bigWave = (v.xy) * vec2(0.04,0.04) + d1 * time * 0.055; //get two normal map (detail map) texture coordinates diff --git a/indra/newview/app_settings/shaders/class1/effects/glowExtractF.glsl b/indra/newview/app_settings/shaders/class1/effects/glowExtractF.glsl index e827863436..9a3d792224 100644 --- a/indra/newview/app_settings/shaders/class1/effects/glowExtractF.glsl +++ b/indra/newview/app_settings/shaders/class1/effects/glowExtractF.glsl @@ -23,10 +23,12 @@ * $/LicenseInfo$ */ - - #extension GL_ARB_texture_rectangle : enable +#ifdef DEFINE_GL_FRAGCOLOR +out vec4 gl_FragColor; +#endif + uniform sampler2DRect diffuseMap; uniform float minLuminance; uniform float maxExtractAlpha; @@ -34,10 +36,11 @@ uniform vec3 lumWeights; uniform vec3 warmthWeights; uniform float warmthAmount; +VARYING vec2 vary_texcoord0; + void main() { - vec4 col = texture2DRect(diffuseMap, gl_TexCoord[0].xy); - + vec4 col = texture2DRect(diffuseMap, vary_texcoord0.xy); /// CALCULATING LUMINANCE (Using NTSC lum weights) /// http://en.wikipedia.org/wiki/Luma_%28video%29 float lum = smoothstep(minLuminance, minLuminance+1.0, dot(col.rgb, lumWeights ) ); @@ -45,4 +48,5 @@ void main() gl_FragColor.rgb = col.rgb; gl_FragColor.a = max(col.a, mix(lum, warmth, warmthAmount) * maxExtractAlpha); + } diff --git a/indra/newview/app_settings/shaders/class1/effects/glowExtractV.glsl b/indra/newview/app_settings/shaders/class1/effects/glowExtractV.glsl index 8db6d1bf24..1396dc6973 100644 --- a/indra/newview/app_settings/shaders/class1/effects/glowExtractV.glsl +++ b/indra/newview/app_settings/shaders/class1/effects/glowExtractV.glsl @@ -23,11 +23,16 @@ * $/LicenseInfo$ */ +uniform mat4 modelview_projection_matrix; +ATTRIBUTE vec3 position; +ATTRIBUTE vec2 texcoord0; + +VARYING vec2 vary_texcoord0; void main() { - gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + gl_Position = modelview_projection_matrix * vec4(position, 1.0); - gl_TexCoord[0].xy = gl_MultiTexCoord0.xy; + vary_texcoord0.xy = texcoord0; } diff --git a/indra/newview/app_settings/shaders/class1/effects/glowF.glsl b/indra/newview/app_settings/shaders/class1/effects/glowF.glsl index 75cff75ea9..90bb84323c 100644 --- a/indra/newview/app_settings/shaders/class1/effects/glowF.glsl +++ b/indra/newview/app_settings/shaders/class1/effects/glowF.glsl @@ -23,11 +23,18 @@ * $/LicenseInfo$ */ - +#ifdef DEFINE_GL_FRAGCOLOR +out vec4 gl_FragColor; +#endif uniform sampler2D diffuseMap; uniform float glowStrength; +VARYING vec4 vary_texcoord0; +VARYING vec4 vary_texcoord1; +VARYING vec4 vary_texcoord2; +VARYING vec4 vary_texcoord3; + void main() { @@ -38,14 +45,14 @@ void main() kern[0] = 0.25; kern[1] = 0.5; kern[2] = 0.8; kern[3] = 1.0; kern[4] = 1.0; kern[5] = 0.8; kern[6] = 0.5; kern[7] = 0.25; - col += kern[0] * texture2D(diffuseMap, gl_TexCoord[0].xy); - col += kern[1] * texture2D(diffuseMap, gl_TexCoord[1].xy); - col += kern[2] * texture2D(diffuseMap, gl_TexCoord[2].xy); - col += kern[3] * texture2D(diffuseMap, gl_TexCoord[3].xy); - col += kern[4] * texture2D(diffuseMap, gl_TexCoord[0].zw); - col += kern[5] * texture2D(diffuseMap, gl_TexCoord[1].zw); - col += kern[6] * texture2D(diffuseMap, gl_TexCoord[2].zw); - col += kern[7] * texture2D(diffuseMap, gl_TexCoord[3].zw); + col += kern[0] * texture2D(diffuseMap, vary_texcoord0.xy); + col += kern[1] * texture2D(diffuseMap, vary_texcoord1.xy); + col += kern[2] * texture2D(diffuseMap, vary_texcoord2.xy); + col += kern[3] * texture2D(diffuseMap, vary_texcoord3.xy); + col += kern[4] * texture2D(diffuseMap, vary_texcoord0.zw); + col += kern[5] * texture2D(diffuseMap, vary_texcoord1.zw); + col += kern[6] * texture2D(diffuseMap, vary_texcoord2.zw); + col += kern[7] * texture2D(diffuseMap, vary_texcoord3.zw); gl_FragColor = vec4(col.rgb * glowStrength, col.a); } diff --git a/indra/newview/app_settings/shaders/class1/effects/glowV.glsl b/indra/newview/app_settings/shaders/class1/effects/glowV.glsl index a5aacc0196..cdb2281578 100644 --- a/indra/newview/app_settings/shaders/class1/effects/glowV.glsl +++ b/indra/newview/app_settings/shaders/class1/effects/glowV.glsl @@ -23,20 +23,28 @@ * $/LicenseInfo$ */ +uniform mat4 modelview_projection_matrix; +ATTRIBUTE vec3 position; +ATTRIBUTE vec2 texcoord0; uniform vec2 glowDelta; +VARYING vec4 vary_texcoord0; +VARYING vec4 vary_texcoord1; +VARYING vec4 vary_texcoord2; +VARYING vec4 vary_texcoord3; + void main() { - gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + gl_Position = modelview_projection_matrix * vec4(position, 1.0); - gl_TexCoord[0].xy = gl_MultiTexCoord0.xy + glowDelta*(-3.5); - gl_TexCoord[1].xy = gl_MultiTexCoord0.xy + glowDelta*(-2.5); - gl_TexCoord[2].xy = gl_MultiTexCoord0.xy + glowDelta*(-1.5); - gl_TexCoord[3].xy = gl_MultiTexCoord0.xy + glowDelta*(-0.5); - gl_TexCoord[0].zw = gl_MultiTexCoord0.xy + glowDelta*(0.5); - gl_TexCoord[1].zw = gl_MultiTexCoord0.xy + glowDelta*(1.5); - gl_TexCoord[2].zw = gl_MultiTexCoord0.xy + glowDelta*(2.5); - gl_TexCoord[3].zw = gl_MultiTexCoord0.xy + glowDelta*(3.5); + vary_texcoord0.xy = texcoord0 + glowDelta*(-3.5); + vary_texcoord1.xy = texcoord0 + glowDelta*(-2.5); + vary_texcoord2.xy = texcoord0 + glowDelta*(-1.5); + vary_texcoord3.xy = texcoord0 + glowDelta*(-0.5); + vary_texcoord0.zw = texcoord0 + glowDelta*(0.5); + vary_texcoord1.zw = texcoord0 + glowDelta*(1.5); + vary_texcoord2.zw = texcoord0 + glowDelta*(2.5); + vary_texcoord3.zw = texcoord0 + glowDelta*(3.5); } diff --git a/indra/newview/app_settings/shaders/class1/environment/terrainF.glsl b/indra/newview/app_settings/shaders/class1/environment/terrainF.glsl index c61d5a2a08..18f6d91804 100644 --- a/indra/newview/app_settings/shaders/class1/environment/terrainF.glsl +++ b/indra/newview/app_settings/shaders/class1/environment/terrainF.glsl @@ -1,4 +1,4 @@ -/** +/** * @file terrainF.glsl * * $LicenseInfo:firstyear=2007&license=viewerlgpl$ @@ -23,19 +23,42 @@ * $/LicenseInfo$ */ +#ifdef DEFINE_GL_FRAGCOLOR +out vec4 gl_FragColor; +#endif +VARYING vec4 vertex_color; +VARYING vec4 vary_texcoord0; +VARYING vec4 vary_texcoord1; -uniform sampler2D detail0; -uniform sampler2D detail1; -uniform sampler2D alphaRamp; +uniform sampler2D detail_0; +uniform sampler2D detail_1; +uniform sampler2D detail_2; +uniform sampler2D detail_3; +uniform sampler2D alpha_ramp; -void main() +vec3 atmosLighting(vec3 light); + +vec3 scaleSoftClip(vec3 color); + +void main() { - float a = texture2D(alphaRamp, gl_TexCoord[1].xy).a; - vec3 color = mix(texture2D(detail1, gl_TexCoord[2].xy).rgb, - texture2D(detail0, gl_TexCoord[0].xy).rgb, - a); + /// Note: This should duplicate the blending functionality currently used for the terrain rendering. + + /// TODO Confirm tex coords and bind them appropriately in vert shader. + vec4 color0 = texture2D(detail_0, vary_texcoord0.xy); + vec4 color1 = texture2D(detail_1, vary_texcoord0.xy); + vec4 color2 = texture2D(detail_2, vary_texcoord0.xy); + vec4 color3 = texture2D(detail_3, vary_texcoord0.xy); - gl_FragColor.rgb = color; - gl_FragColor.a = texture2D(alphaRamp, gl_TexCoord[3].xy).a; + float alpha1 = texture2D(alpha_ramp, vary_texcoord0.zw).a; + float alpha2 = texture2D(alpha_ramp,vary_texcoord1.xy).a; + float alphaFinal = texture2D(alpha_ramp, vary_texcoord1.zw).a; + vec4 outColor = mix( mix(color3, color2, alpha2), mix(color1, color0, alpha1), alphaFinal ); + + /// Add WL Components + outColor.rgb = atmosLighting(outColor.rgb * vertex_color.rgb); + + gl_FragColor = vec4(scaleSoftClip(outColor.rgb), 1.0); } + diff --git a/indra/newview/app_settings/shaders/class1/environment/terrainV.glsl b/indra/newview/app_settings/shaders/class1/environment/terrainV.glsl index 917891c063..d09c5f9247 100644 --- a/indra/newview/app_settings/shaders/class1/environment/terrainV.glsl +++ b/indra/newview/app_settings/shaders/class1/environment/terrainV.glsl @@ -1,4 +1,4 @@ -/** +/** * @file terrainV.glsl * * $LicenseInfo:firstyear=2007&license=viewerlgpl$ @@ -22,8 +22,25 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - +uniform mat3 normal_matrix; +uniform mat4 texture_matrix0; +uniform mat4 modelview_matrix; +uniform mat4 modelview_projection_matrix; + +uniform vec4 object_plane_t; +uniform vec4 object_plane_s; + +ATTRIBUTE vec3 position; +ATTRIBUTE vec3 normal; +ATTRIBUTE vec2 texcoord0; +ATTRIBUTE vec2 texcoord1; + +VARYING vec4 vertex_color; +VARYING vec4 vary_texcoord0; +VARYING vec4 vary_texcoord1; + +void calcAtmospherics(vec3 inPositionEye); vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol); @@ -44,17 +61,27 @@ vec4 texgen_object(vec4 vpos, vec4 tc, mat4 mat, vec4 tp0, vec4 tp1) void main() { //transform vertex - gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; - - vec4 pos = gl_ModelViewMatrix * gl_Vertex; - vec3 norm = normalize(gl_NormalMatrix * gl_Normal); + gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0); + + vec4 pos = modelview_matrix * vec4(position.xyz, 1.0); + vec3 norm = normalize(normal_matrix * normal); + + calcAtmospherics(pos.xyz); + + /// Potentially better without it for water. + pos /= pos.w; + + vec4 color = calcLighting(pos.xyz, norm, vec4(1,1,1,1), vec4(0)); - vec4 color = calcLighting(pos.xyz, norm, vec4(1,1,1,1), gl_Color); + vertex_color = color; + + // Transform and pass tex coords + vary_texcoord0.xy = texgen_object(vec4(position.xyz, 1.0), vec4(texcoord0,0,1), texture_matrix0, object_plane_s, object_plane_t).xy; - gl_FrontColor = color; + vec4 t = vec4(texcoord1,0,1); - gl_TexCoord[0] = texgen_object(gl_Vertex,gl_MultiTexCoord0,gl_TextureMatrix[0],gl_ObjectPlaneS[0],gl_ObjectPlaneT[0]); - gl_TexCoord[1] = gl_TextureMatrix[1]*gl_MultiTexCoord1; - gl_TexCoord[2] = texgen_object(gl_Vertex,gl_MultiTexCoord2,gl_TextureMatrix[2],gl_ObjectPlaneS[2],gl_ObjectPlaneT[2]); - gl_TexCoord[3] = gl_TextureMatrix[3]*gl_MultiTexCoord3; + vary_texcoord0.zw = t.xy; + vary_texcoord1.xy = t.xy-vec2(2.0, 0.0); + vary_texcoord1.zw = t.xy-vec2(1.0, 0.0); } + diff --git a/indra/newview/app_settings/shaders/class1/environment/terrainWaterF.glsl b/indra/newview/app_settings/shaders/class1/environment/terrainWaterF.glsl index 711b42b95e..e5c7ced52c 100644 --- a/indra/newview/app_settings/shaders/class1/environment/terrainWaterF.glsl +++ b/indra/newview/app_settings/shaders/class1/environment/terrainWaterF.glsl @@ -1,4 +1,4 @@ -/** +/** * @file terrainWaterF.glsl * * $LicenseInfo:firstyear=2007&license=viewerlgpl$ @@ -22,22 +22,44 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - +#ifdef DEFINE_GL_FRAGCOLOR +out vec4 gl_FragColor; +#endif -// this class1 shader is just a copy of terrainF +VARYING vec4 vertex_color; +VARYING vec4 vary_texcoord0; +VARYING vec4 vary_texcoord1; -uniform sampler2D detail0; -uniform sampler2D detail1; -uniform sampler2D alphaRamp; +uniform sampler2D detail_0; +uniform sampler2D detail_1; +uniform sampler2D detail_2; +uniform sampler2D detail_3; +uniform sampler2D alpha_ramp; -void main() +vec3 atmosLighting(vec3 light); + +vec4 applyWaterFog(vec4 color); + +void main() { - float a = texture2D(alphaRamp, gl_TexCoord[1].xy).a; - vec3 color = mix(texture2D(detail1, gl_TexCoord[2].xy).rgb, - texture2D(detail0, gl_TexCoord[0].xy).rgb, - a); + /// Note: This should duplicate the blending functionality currently used for the terrain rendering. + + /// TODO Confirm tex coords and bind them appropriately in vert shader. + vec4 color0 = texture2D(detail_0, vary_texcoord0.xy); + vec4 color1 = texture2D(detail_1, vary_texcoord0.xy); + vec4 color2 = texture2D(detail_2, vary_texcoord0.xy); + vec4 color3 = texture2D(detail_3, vary_texcoord0.xy); - gl_FragColor.rgb = color; - gl_FragColor.a = texture2D(alphaRamp, gl_TexCoord[3].xy).a; + float alpha1 = texture2D(alpha_ramp, vary_texcoord0.zw).a; + float alpha2 = texture2D(alpha_ramp,vary_texcoord1.xy).a; + float alphaFinal = texture2D(alpha_ramp, vary_texcoord1.zw).a; + vec4 outColor = mix( mix(color3, color2, alpha2), mix(color1, color0, alpha1), alphaFinal ); + + /// Add WL Components + outColor.rgb = atmosLighting(outColor.rgb * vertex_color.rgb); + + outColor = applyWaterFog(outColor); + gl_FragColor = outColor; } + diff --git a/indra/newview/app_settings/shaders/class1/environment/underWaterF.glsl b/indra/newview/app_settings/shaders/class1/environment/underWaterF.glsl index 72e8e739b3..1fdb90f792 100644 --- a/indra/newview/app_settings/shaders/class1/environment/underWaterF.glsl +++ b/indra/newview/app_settings/shaders/class1/environment/underWaterF.glsl @@ -23,36 +23,82 @@ * $/LicenseInfo$ */ - +#ifdef DEFINE_GL_FRAGCOLOR +out vec4 gl_FragColor; +#endif uniform sampler2D diffuseMap; uniform sampler2D bumpMap; uniform sampler2D screenTex; +uniform sampler2D refTex; +uniform sampler2D screenDepth; +uniform vec4 fogCol; +uniform vec3 lightDir; +uniform vec3 specular; +uniform float lightExp; +uniform vec2 fbScale; uniform float refScale; +uniform float znear; +uniform float zfar; +uniform float kd; +uniform vec4 waterPlane; +uniform vec3 eyeVec; uniform vec4 waterFogColor; +uniform float waterFogDensity; +uniform float waterFogKS; +uniform vec2 screenRes; //bigWave is (refCoord.w, view.w); -varying vec4 refCoord; -varying vec4 littleWave; -varying vec4 view; +VARYING vec4 refCoord; +VARYING vec4 littleWave; +VARYING vec4 view; -void main() +vec4 applyWaterFog(vec4 color, vec3 viewVec) { - vec4 color; + //normalize view vector + vec3 view = normalize(viewVec); + float es = -view.z; + + //find intersection point with water plane and eye vector - //get bigwave normal - vec3 wavef = texture2D(bumpMap, vec2(refCoord.w, view.w)).xyz*2.0; - - //get detail normals - vec3 dcol = texture2D(bumpMap, littleWave.xy).rgb*0.75; - dcol += texture2D(bumpMap, littleWave.zw).rgb*1.25; - - //interpolate between big waves and little waves (big waves in deep water) - wavef = (wavef+dcol)*0.5; + //get eye depth + float e0 = max(-waterPlane.w, 0.0); + + //get object depth + float depth = length(viewVec); + + //get "thickness" of water + float l = max(depth, 0.1); - //crunch normal to range [-1,1] - wavef -= vec3(1,1,1); + float kd = waterFogDensity; + float ks = waterFogKS; + vec4 kc = waterFogColor; + + float F = 0.98; + + float t1 = -kd * pow(F, ks * e0); + float t2 = kd + ks * es; + float t3 = pow(F, t2*l) - 1.0; + + float L = min(t1/t2*t3, 1.0); + + float D = pow(0.98, l*kd); + //return vec4(1.0, 0.0, 1.0, 1.0); + return color * D + kc * L; + //depth /= 10.0; + //return vec4(depth,depth,depth,0.0); +} + +void main() +{ + vec4 color; + + //get detail normals + vec3 wave1 = texture2D(bumpMap, vec2(refCoord.w, view.w)).xyz*2.0-1.0; + vec3 wave2 = texture2D(bumpMap, littleWave.xy).xyz*2.0-1.0; + vec3 wave3 = texture2D(bumpMap, littleWave.zw).xyz*2.0-1.0; + vec3 wavef = normalize(wave1+wave2+wave3); //figure out distortion vector (ripply) vec2 distort = (refCoord.xy/refCoord.z) * 0.5 + 0.5; @@ -60,6 +106,5 @@ void main() vec4 fb = texture2D(screenTex, distort); - gl_FragColor.rgb = mix(waterFogColor.rgb, fb.rgb, waterFogColor.a * 0.001 + 0.999); - gl_FragColor.a = fb.a; + gl_FragColor = applyWaterFog(fb,view.xyz); } diff --git a/indra/newview/app_settings/shaders/class1/environment/waterF.glsl b/indra/newview/app_settings/shaders/class1/environment/waterF.glsl index 4d555b566a..444c896d38 100644 --- a/indra/newview/app_settings/shaders/class1/environment/waterF.glsl +++ b/indra/newview/app_settings/shaders/class1/environment/waterF.glsl @@ -23,20 +23,19 @@ * $/LicenseInfo$ */ - +#ifdef DEFINE_GL_FRAGCOLOR +out vec4 gl_FragColor; +#endif vec3 scaleSoftClip(vec3 inColor); vec3 atmosTransport(vec3 inColor); -vec3 applyWaterFog(vec4 inColor); -uniform sampler2D diffuseMap; uniform sampler2D bumpMap; uniform sampler2D screenTex; uniform sampler2D refTex; uniform float sunAngle; uniform float sunAngle2; -uniform float scaledAngle; uniform vec3 lightDir; uniform vec3 specular; uniform float lightExp; @@ -47,67 +46,92 @@ uniform vec3 normScale; uniform float fresnelScale; uniform float fresnelOffset; uniform float blurMultiplier; -uniform vec4 fogCol; + //bigWave is (refCoord.w, view.w); -varying vec4 refCoord; -varying vec4 littleWave; -varying vec4 view; +VARYING vec4 refCoord; +VARYING vec4 littleWave; +VARYING vec4 view; void main() { - vec3 viewVec = view.xyz; vec4 color; - float dist = length(viewVec.xy); + float dist = length(view.xy); //normalize view vector - viewVec = normalize(viewVec); + vec3 viewVec = normalize(view.xyz); //get wave normals - vec3 wavef = texture2D(bumpMap, vec2(refCoord.w, view.w)).xyz*2.0; - - //get detail normals - vec3 dcol = texture2D(bumpMap, littleWave.xy).rgb*0.75; - dcol += texture2D(bumpMap, littleWave.zw).rgb*1.25; - - //interpolate between big waves and little waves (big waves in deep water) - wavef = (wavef + dcol) * 0.5; - - //crunch normal to range [-1,1] - wavef -= vec3(1,1,1); - wavef = normalize(wavef); - + vec3 wave1 = texture2D(bumpMap, vec2(refCoord.w, view.w)).xyz*2.0-1.0; + vec3 wave2 = texture2D(bumpMap, littleWave.xy).xyz*2.0-1.0; + vec3 wave3 = texture2D(bumpMap, littleWave.zw).xyz*2.0-1.0; //get base fresnel components - float df = dot(viewVec,wavef) * fresnelScale + fresnelOffset; + vec3 df = vec3( + dot(viewVec, wave1), + dot(viewVec, (wave2 + wave3) * 0.5), + dot(viewVec, wave3) + ) * fresnelScale + fresnelOffset; + df *= df; vec2 distort = (refCoord.xy/refCoord.z) * 0.5 + 0.5; float dist2 = dist; dist = max(dist, 5.0); + float dmod = sqrt(dist); + + vec2 dmod_scale = vec2(dmod*dmod, dmod); + //get reflected color - vec2 refdistort = wavef.xy*dot(normScale, vec3(0.333)); - vec2 refvec = distort+refdistort/dist; - vec4 refcol = texture2D(refTex, refvec); + vec2 refdistort1 = wave1.xy*normScale.x; + vec2 refvec1 = distort+refdistort1/dmod_scale; + vec4 refcol1 = texture2D(refTex, refvec1); + + vec2 refdistort2 = wave2.xy*normScale.y; + vec2 refvec2 = distort+refdistort2/dmod_scale; + vec4 refcol2 = texture2D(refTex, refvec2); + + vec2 refdistort3 = wave3.xy*normScale.z; + vec2 refvec3 = distort+refdistort3/dmod_scale; + vec4 refcol3 = texture2D(refTex, refvec3); + + vec4 refcol = refcol1 + refcol2 + refcol3; + float df1 = df.x + df.y + df.z; + refcol *= df1 * 0.333; + + vec3 wavef = (wave1 + wave2 * 0.4 + wave3 * 0.6) * 0.5; + + wavef.z *= max(-viewVec.z, 0.1); + wavef = normalize(wavef); + + float df2 = dot(viewVec, wavef) * fresnelScale+fresnelOffset; + + vec2 refdistort4 = wavef.xy*0.125; + refdistort4.y -= abs(refdistort4.y); + vec2 refvec4 = distort+refdistort4/dmod; + float dweight = min(dist2*blurMultiplier, 1.0); + vec4 baseCol = texture2D(refTex, refvec4); + refcol = mix(baseCol*df2, refcol, dweight); //get specular component float spec = clamp(dot(lightDir, (reflect(viewVec,wavef))),0.0,1.0); - + //harden specular - spec = pow(spec, lightExp); + spec = pow(spec, 128.0); //figure out distortion vector (ripply) - vec2 distort2 = distort+wavef.xy*refScale/max(dist*df, 1.0); + vec2 distort2 = distort+wavef.xy*refScale/max(dmod*df1, 1.0); vec4 fb = texture2D(screenTex, distort2); //mix with reflection - color.rgb = mix(mix(fogCol.rgb, fb.rgb, fogCol.a), refcol.rgb, df); + // Note we actually want to use just df1, but multiplying by 0.999999 gets around and nvidia compiler bug + color.rgb = mix(fb.rgb, refcol.rgb, df1 * 0.99999); color.rgb += spec * specular; - //color.rgb = applyWaterFog(color);//atmosTransport(color.rgb); + color.rgb = atmosTransport(color.rgb); color.rgb = scaleSoftClip(color.rgb); color.a = spec * sunAngle2; diff --git a/indra/newview/app_settings/shaders/class1/environment/waterFogF.glsl b/indra/newview/app_settings/shaders/class1/environment/waterFogF.glsl index d44690d1fb..4bdfce9260 100644 --- a/indra/newview/app_settings/shaders/class1/environment/waterFogF.glsl +++ b/indra/newview/app_settings/shaders/class1/environment/waterFogF.glsl @@ -25,16 +25,50 @@ +uniform vec4 lightnorm; +uniform vec4 waterPlane; +uniform vec4 waterFogColor; +uniform float waterFogDensity; +uniform float waterFogKS; + +vec3 getPositionEye(); + vec4 applyWaterFog(vec4 color) { - // GL_EXP2 Fog - //float fog = exp(-gl_Fog.density * gl_Fog.density * gl_FogFragCoord * gl_FogFragCoord); - // GL_EXP Fog - // float fog = exp(-gl_Fog.density * gl_FogFragCoord); - // GL_LINEAR Fog - float fog = (gl_Fog.end - gl_FogFragCoord) * gl_Fog.scale; - fog = clamp(fog, 0.0, 1.0); - color.rgb = mix(gl_Fog.color.rgb, color.rgb, fog); + //normalize view vector + vec3 view = normalize(getPositionEye()); + float es = -(dot(view, waterPlane.xyz)); + + //find intersection point with water plane and eye vector + + //get eye depth + float e0 = max(-waterPlane.w, 0.0); + + vec3 int_v = waterPlane.w > 0.0 ? view * waterPlane.w/es : vec3(0.0, 0.0, 0.0); + + //get object depth + float depth = length(getPositionEye() - int_v); + + //get "thickness" of water + float l = max(depth, 0.1); + + float kd = waterFogDensity; + float ks = waterFogKS; + vec4 kc = waterFogColor; + + float F = 0.98; + + float t1 = -kd * pow(F, ks * e0); + float t2 = kd + ks * es; + float t3 = pow(F, t2*l) - 1.0; + + float L = min(t1/t2*t3, 1.0); + + float D = pow(0.98, l*kd); + + color.rgb = color.rgb * D + kc.rgb * L; + color.a = kc.a + color.a; + return color; } diff --git a/indra/newview/app_settings/shaders/class1/environment/waterV.glsl b/indra/newview/app_settings/shaders/class1/environment/waterV.glsl index 610c06fbbc..f66ba1d2d9 100644 --- a/indra/newview/app_settings/shaders/class1/environment/waterV.glsl +++ b/indra/newview/app_settings/shaders/class1/environment/waterV.glsl @@ -22,8 +22,11 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - +uniform mat4 modelview_matrix; +uniform mat4 modelview_projection_matrix; + +ATTRIBUTE vec3 position; void calcAtmospherics(vec3 inPositionEye); @@ -33,9 +36,9 @@ uniform float time; uniform vec3 eyeVec; uniform float waterHeight; -varying vec4 refCoord; -varying vec4 littleWave; -varying vec4 view; +VARYING vec4 refCoord; +VARYING vec4 littleWave; +VARYING vec4 view; float wave(vec2 v, float t, float f, vec2 d, float s) { @@ -45,8 +48,7 @@ float wave(vec2 v, float t, float f, vec2 d, float s) void main() { //transform vertex - vec4 position = gl_Vertex; - mat4 modelViewProj = gl_ModelViewProjectionMatrix; + mat4 modelViewProj = modelview_projection_matrix; vec4 oPosition; @@ -57,27 +59,29 @@ void main() float d = length(oEyeVec.xy); float ld = min(d, 2560.0); - position.xy = eyeVec.xy + oEyeVec.xy/d*ld; + vec3 lpos = position; + lpos.xy = eyeVec.xy + oEyeVec.xy/d*ld; view.xyz = oEyeVec; d = clamp(ld/1536.0-0.5, 0.0, 1.0); d *= d; - oPosition = position; + oPosition = vec4(lpos, 1.0); oPosition.z = mix(oPosition.z, max(eyeVec.z*0.75, 0.0), d); oPosition = modelViewProj * oPosition; refCoord.xyz = oPosition.xyz + vec3(0,0,0.2); //get wave position parameter (create sweeping horizontal waves) - vec3 v = position.xyz; + vec3 v = lpos; v.x += (cos(v.x*0.08/*+time*0.01*/)+sin(v.y*0.02))*6.0; //push position for further horizon effect. - position.xyz = oEyeVec.xyz*(waterHeight/oEyeVec.z); - position.w = 1.0; - position = position*gl_ModelViewMatrix; + vec4 pos; + pos.xyz = oEyeVec.xyz*(waterHeight/oEyeVec.z); + pos.w = 1.0; + pos = modelview_matrix*pos; - calcAtmospherics((gl_ModelViewMatrix * gl_Vertex).xyz); + calcAtmospherics(pos.xyz); //pass wave parameters to pixel shader diff --git a/indra/newview/app_settings/shaders/class3/deferred/treeF.glsl b/indra/newview/app_settings/shaders/class1/interface/alphamaskF.glsl index 56a149523e..d2f5e1987a 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/treeF.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/alphamaskF.glsl @@ -1,5 +1,5 @@ /** - * @file treeF.glsl + * @file alphamaskF.glsl * * $LicenseInfo:firstyear=2007&license=viewerlgpl$ * Second Life Viewer Source Code @@ -22,18 +22,25 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - +#ifdef DEFINE_GL_FRAGCOLOR +out vec4 gl_FragColor; +#endif uniform sampler2D diffuseMap; -varying vec3 vary_normal; +uniform float minimum_alpha; + +VARYING vec2 vary_texcoord0; +VARYING vec4 vertex_color; void main() { - vec4 col = texture2D(diffuseMap, gl_TexCoord[0].xy); - gl_FragData[0] = vec4(gl_Color.rgb*col.rgb, col.a <= 0.5 ? 0.0 : 0.005); - gl_FragData[1] = vec4(0,0,0,0); - vec3 nvn = normalize(vary_normal); - gl_FragData[2] = vec4(nvn.xy * 0.5 + 0.5, nvn.z, 0.0); + vec4 col = vertex_color*texture2D(diffuseMap, vary_texcoord0.xy); + if (col.a < minimum_alpha) + { + discard; + } + + gl_FragColor = col; } diff --git a/indra/newview/app_settings/shaders/class3/deferred/luminanceV.glsl b/indra/newview/app_settings/shaders/class1/interface/alphamaskV.glsl index 2d99ef5481..3580d1f27b 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/luminanceV.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/alphamaskV.glsl @@ -1,5 +1,5 @@ /** - * @file giV.glsl + * @file alphamaskV.glsl * * $LicenseInfo:firstyear=2007&license=viewerlgpl$ * Second Life Viewer Source Code @@ -22,19 +22,21 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - +uniform mat4 texture_matrix0; +uniform mat4 modelview_projection_matrix; -varying vec2 vary_fragcoord; +ATTRIBUTE vec3 position; +ATTRIBUTE vec4 diffuse_color; +ATTRIBUTE vec2 texcoord0; -uniform vec2 screen_res; +VARYING vec4 vertex_color; +VARYING vec2 vary_texcoord0; void main() { - //transform vertex - gl_Position = ftransform(); - vec4 pos = gl_ModelViewProjectionMatrix * gl_Vertex; - vary_fragcoord = (pos.xy * 0.5 + 0.5)*screen_res; - - gl_FrontColor = gl_Color; + gl_Position = modelview_projection_matrix * vec4(position, 1); + vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy; + vertex_color = diffuse_color; } + diff --git a/indra/newview/app_settings/shaders/class1/interface/customalphaF.glsl b/indra/newview/app_settings/shaders/class1/interface/customalphaF.glsl index 27c63fdc8b..4b481ba834 100644 --- a/indra/newview/app_settings/shaders/class1/interface/customalphaF.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/customalphaF.glsl @@ -22,14 +22,21 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - + +#ifdef DEFINE_GL_FRAGCOLOR +out vec4 gl_FragColor; +#endif + uniform sampler2D diffuseMap; uniform float custom_alpha; +VARYING vec4 vertex_color; +VARYING vec2 vary_texcoord0; + void main() { - vec4 color = gl_Color*texture2D(diffuseMap, gl_TexCoord[0].xy); + vec4 color = vertex_color*texture2D(diffuseMap, vary_texcoord0.xy); color.a *= custom_alpha; gl_FragColor = color; } diff --git a/indra/newview/app_settings/shaders/class1/interface/customalphaV.glsl b/indra/newview/app_settings/shaders/class1/interface/customalphaV.glsl index c4c896c35c..890474d6d8 100644 --- a/indra/newview/app_settings/shaders/class1/interface/customalphaV.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/customalphaV.glsl @@ -22,13 +22,20 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - +uniform mat4 modelview_projection_matrix; + +ATTRIBUTE vec3 position; +ATTRIBUTE vec4 diffuse_color; +ATTRIBUTE vec2 texcoord0; + +VARYING vec4 vertex_color; +VARYING vec2 vary_texcoord0; void main() { - gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; - gl_TexCoord[0] = gl_MultiTexCoord0; - gl_FrontColor = gl_Color; + gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0); + vary_texcoord0 = texcoord0; + vertex_color = diffuse_color; } diff --git a/indra/newview/app_settings/shaders/class1/interface/debugF.glsl b/indra/newview/app_settings/shaders/class1/interface/debugF.glsl new file mode 100644 index 0000000000..6bcc97ba18 --- /dev/null +++ b/indra/newview/app_settings/shaders/class1/interface/debugF.glsl @@ -0,0 +1,35 @@ +/** + * @file debugF.glsl + * + * $LicenseInfo:firstyear=2007&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2011, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#ifdef DEFINE_GL_FRAGCOLOR +out vec4 gl_FragColor; +#endif + +uniform vec4 color; + +void main() +{ + gl_FragColor = color; +} diff --git a/indra/newview/app_settings/shaders/class1/interface/debugV.glsl b/indra/newview/app_settings/shaders/class1/interface/debugV.glsl new file mode 100644 index 0000000000..f4d704577a --- /dev/null +++ b/indra/newview/app_settings/shaders/class1/interface/debugV.glsl @@ -0,0 +1,34 @@ +/** + * @file debugV.glsl + * + * $LicenseInfo:firstyear=2007&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2011, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +uniform mat4 modelview_projection_matrix; + +ATTRIBUTE vec3 position; + +void main() +{ + gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0); +} + diff --git a/indra/newview/app_settings/shaders/class1/interface/glowcombineF.glsl b/indra/newview/app_settings/shaders/class1/interface/glowcombineF.glsl index b8963e1dec..f67703b839 100644 --- a/indra/newview/app_settings/shaders/class1/interface/glowcombineF.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/glowcombineF.glsl @@ -22,14 +22,21 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - + +#ifdef DEFINE_GL_FRAGCOLOR +out vec4 gl_FragColor; +#endif + #extension GL_ARB_texture_rectangle : enable uniform sampler2D glowMap; uniform sampler2DRect screenMap; +VARYING vec2 vary_texcoord0; +VARYING vec2 vary_texcoord1; + void main() { - gl_FragColor = texture2D(glowMap, gl_TexCoord[0].xy) + - texture2DRect(screenMap, gl_TexCoord[1].xy); + gl_FragColor = texture2D(glowMap, vary_texcoord0.xy) + + texture2DRect(screenMap, vary_texcoord1.xy); } diff --git a/indra/newview/app_settings/shaders/class3/deferred/giFinalF.glsl b/indra/newview/app_settings/shaders/class1/interface/glowcombineFXAAF.glsl index 7c55fcc286..c66a6e5b48 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/giFinalF.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/glowcombineFXAAF.glsl @@ -1,9 +1,9 @@ /** - * @file giFinalF.glsl + * @file glowcombineFXAAF.glsl * - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ + * $LicenseInfo:firstyear=2005&license=viewerlgpl$ * Second Life Viewer Source Code - * Copyright (C) 2007, Linden Research, Inc. + * Copyright (C) 2005, Linden Research, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -23,23 +23,20 @@ * $/LicenseInfo$ */ - - #extension GL_ARB_texture_rectangle : enable +#ifdef DEFINE_GL_FRAGCOLOR +out vec4 gl_FragColor; +#endif + uniform sampler2DRect diffuseRect; -uniform sampler2D bloomMap; -uniform sampler2DRect edgeMap; uniform vec2 screen_res; -varying vec2 vary_fragcoord; - +VARYING vec2 vary_tc; void main() { - vec4 bloom = texture2D(bloomMap, vary_fragcoord.xy/screen_res); - vec4 diff = texture2DRect(diffuseRect, vary_fragcoord.xy); + vec3 col = texture2DRect(diffuseRect, vary_tc*screen_res).rgb; - gl_FragColor = bloom + diff; - //gl_FragColor.rgb = vec3(texture2DRect(edgeMap, vary_fragcoord.xy).a); + gl_FragColor = vec4(col.rgb, dot(col.rgb, vec3(0.299, 0.587, 0.144))); } diff --git a/indra/newview/app_settings/shaders/class3/deferred/postDeferredV.glsl b/indra/newview/app_settings/shaders/class1/interface/glowcombineFXAAV.glsl index cb83dda795..058f3b1b82 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/postDeferredV.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/glowcombineFXAAV.glsl @@ -1,7 +1,7 @@ /** - * @file postDeferredV.glsl + * @file glowcombineFXAAV.glsl * - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ + * $LicenseInfo:firstyear=2007&license=viewerlgpl$ * Second Life Viewer Source Code * Copyright (C) 2007, Linden Research, Inc. * @@ -22,16 +22,18 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - +uniform mat4 modelview_projection_matrix; -varying vec2 vary_fragcoord; -uniform vec2 screen_res; +ATTRIBUTE vec3 position; + +VARYING vec2 vary_tc; void main() { - //transform vertex - gl_Position = ftransform(); - vec4 pos = gl_ModelViewProjectionMatrix * gl_Vertex; - vary_fragcoord = (pos.xy*0.5+0.5)*screen_res; + vec4 pos = modelview_projection_matrix*vec4(position.xyz, 1.0); + gl_Position = pos; + + vary_tc = pos.xy*0.5+0.5; } + diff --git a/indra/newview/app_settings/shaders/class1/interface/glowcombineV.glsl b/indra/newview/app_settings/shaders/class1/interface/glowcombineV.glsl index 4c6360f71d..f7970b7f78 100644 --- a/indra/newview/app_settings/shaders/class1/interface/glowcombineV.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/glowcombineV.glsl @@ -22,12 +22,20 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - + +uniform mat4 modelview_projection_matrix; + +ATTRIBUTE vec3 position; +ATTRIBUTE vec2 texcoord0; +ATTRIBUTE vec2 texcoord1; + +VARYING vec2 vary_texcoord0; +VARYING vec2 vary_texcoord1; void main() { - gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; - gl_TexCoord[0] = gl_MultiTexCoord0; - gl_TexCoord[1] = gl_MultiTexCoord1; + gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0); + vary_texcoord0 = texcoord0; + vary_texcoord1 = texcoord1; } diff --git a/indra/newview/app_settings/shaders/class1/interface/highlightF.glsl b/indra/newview/app_settings/shaders/class1/interface/highlightF.glsl index a3cb5225ba..ecbc30f05f 100644 --- a/indra/newview/app_settings/shaders/class1/interface/highlightF.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/highlightF.glsl @@ -23,11 +23,16 @@ * $/LicenseInfo$ */ +#ifdef DEFINE_GL_FRAGCOLOR +out vec4 gl_FragColor; +#endif - +uniform vec4 color; uniform sampler2D diffuseMap; +VARYING vec2 vary_texcoord0; + void main() { - gl_FragColor = gl_Color*texture2D(diffuseMap, gl_TexCoord[0].xy); + gl_FragColor = color*texture2D(diffuseMap, vary_texcoord0.xy); } diff --git a/indra/newview/app_settings/shaders/class1/interface/highlightV.glsl b/indra/newview/app_settings/shaders/class1/interface/highlightV.glsl index da3bea6d06..9bf7b60eb7 100644 --- a/indra/newview/app_settings/shaders/class1/interface/highlightV.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/highlightV.glsl @@ -22,24 +22,19 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - +uniform mat4 texture_matrix0; +uniform mat4 modelview_projection_matrix; + +ATTRIBUTE vec3 position; +ATTRIBUTE vec2 texcoord0; + +VARYING vec2 vary_texcoord0; void main() { //transform vertex - gl_Position = ftransform(); - vec3 pos = (gl_ModelViewMatrix * gl_Vertex).xyz; - pos = normalize(pos); - float d = dot(pos, normalize(gl_NormalMatrix * gl_Normal)); - d *= d; - d = 1.0 - d; - d *= d; - - d = min(d, gl_Color.a*2.0); - - gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0; - gl_FrontColor.rgb = gl_Color.rgb; - gl_FrontColor.a = max(d, gl_Color.a); + gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0); + vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy; } diff --git a/indra/newview/app_settings/shaders/class1/interface/occlusionF.glsl b/indra/newview/app_settings/shaders/class1/interface/occlusionF.glsl index 57248699cb..85f819f4c2 100644 --- a/indra/newview/app_settings/shaders/class1/interface/occlusionF.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/occlusionF.glsl @@ -23,6 +23,10 @@ * $/LicenseInfo$ */ +#ifdef DEFINE_GL_FRAGCOLOR +out vec4 gl_FragColor; +#endif + void main() { gl_FragColor = vec4(1,1,1,1); diff --git a/indra/newview/app_settings/shaders/class1/interface/occlusionV.glsl b/indra/newview/app_settings/shaders/class1/interface/occlusionV.glsl index 915e452e0f..c26fa08ddc 100644 --- a/indra/newview/app_settings/shaders/class1/interface/occlusionV.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/occlusionV.glsl @@ -23,8 +23,12 @@ * $/LicenseInfo$ */ +uniform mat4 modelview_projection_matrix; + +ATTRIBUTE vec3 position; + void main() { - gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0); } diff --git a/indra/newview/app_settings/shaders/class1/interface/onetexturenocolorF.glsl b/indra/newview/app_settings/shaders/class1/interface/onetexturenocolorF.glsl new file mode 100644 index 0000000000..fafeb5a7b4 --- /dev/null +++ b/indra/newview/app_settings/shaders/class1/interface/onetexturenocolorF.glsl @@ -0,0 +1,37 @@ +/** + * @file onetexturenocolorF.glsl + * + * $LicenseInfo:firstyear=2005&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2005, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#ifdef DEFINE_GL_FRAGCOLOR +out vec4 gl_FragColor; +#endif + +uniform sampler2D tex0; + +VARYING vec2 vary_texcoord0; + +void main() +{ + gl_FragColor = texture2D(tex0, vary_texcoord0.xy); +} diff --git a/indra/newview/app_settings/shaders/class3/deferred/giDownsampleV.glsl b/indra/newview/app_settings/shaders/class1/interface/onetexturenocolorV.glsl index 6231ee68b7..6b9986c8d7 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/giDownsampleV.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/onetexturenocolorV.glsl @@ -1,5 +1,5 @@ /** - * @file postgiV.glsl + * @file onetexturenocolorV.glsl * * $LicenseInfo:firstyear=2007&license=viewerlgpl$ * Second Life Viewer Source Code @@ -23,15 +23,16 @@ * $/LicenseInfo$ */ +uniform mat4 modelview_projection_matrix; +ATTRIBUTE vec3 position; +ATTRIBUTE vec2 texcoord0; -varying vec2 vary_fragcoord; -uniform vec2 screen_res; +VARYING vec2 vary_texcoord0; void main() { - //transform vertex - gl_Position = ftransform(); - vec4 pos = gl_ModelViewProjectionMatrix * gl_Vertex; - vary_fragcoord = (pos.xy*0.5+0.5)*screen_res; + gl_Position = modelview_projection_matrix * vec4(position, 1); + vary_texcoord0 = texcoord0; } + diff --git a/indra/newview/app_settings/shaders/class1/interface/solidcolorF.glsl b/indra/newview/app_settings/shaders/class1/interface/solidcolorF.glsl index b1d2b949ac..f790122749 100644 --- a/indra/newview/app_settings/shaders/class1/interface/solidcolorF.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/solidcolorF.glsl @@ -22,12 +22,19 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - + +#ifdef DEFINE_GL_FRAGCOLOR +out vec4 gl_FragColor; +#endif + uniform sampler2D tex0; +VARYING vec4 vertex_color; +VARYING vec2 vary_texcoord0; + void main() { - float alpha = texture2D(tex0, gl_TexCoord[0].xy).a * gl_Color.a; + float alpha = texture2D(tex0, vary_texcoord0.xy).a * vertex_color.a; - gl_FragColor = vec4(gl_Color.rgb, alpha); + gl_FragColor = vec4(vertex_color.rgb, alpha); } diff --git a/indra/newview/app_settings/shaders/class1/interface/solidcolorV.glsl b/indra/newview/app_settings/shaders/class1/interface/solidcolorV.glsl index fedf6ae546..c58f9dfdaf 100644 --- a/indra/newview/app_settings/shaders/class1/interface/solidcolorV.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/solidcolorV.glsl @@ -22,13 +22,20 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ + +uniform mat4 modelview_projection_matrix; +ATTRIBUTE vec3 position; +ATTRIBUTE vec4 diffuse_color; +ATTRIBUTE vec2 texcoord0; +VARYING vec4 vertex_color; +VARYING vec2 vary_texcoord0; void main() { - gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; - gl_FrontColor = gl_Color; - gl_TexCoord[0] = gl_MultiTexCoord0; + gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0); + vertex_color = diffuse_color; + vary_texcoord0 = texcoord0; } diff --git a/indra/newview/app_settings/shaders/class3/deferred/luminanceF.glsl b/indra/newview/app_settings/shaders/class1/interface/splattexturerectF.glsl index 13517a26ba..a0bb255cfa 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/luminanceF.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/splattexturerectF.glsl @@ -1,9 +1,9 @@ /** - * @file luminanceF.glsl + * @file splattexturerectF.glsl * * $LicenseInfo:firstyear=2007&license=viewerlgpl$ * Second Life Viewer Source Code - * Copyright (C) 2007, Linden Research, Inc. + * Copyright (C) 2011, Linden Research, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -23,17 +23,18 @@ * $/LicenseInfo$ */ +#extension GL_ARB_texture_rectangle : enable +#ifdef DEFINE_GL_FRAGCOLOR +out vec4 gl_FragColor; +#endif -#extension GL_ARB_texture_rectangle : enable +uniform sampler2DRect screenMap; -uniform sampler2DRect lightMap; -uniform sampler2DRect diffuseRect; +VARYING vec4 vertex_color; +VARYING vec2 vary_texcoord0; -varying vec2 vary_fragcoord; void main() { - float i = texture2DRect(lightMap, vary_fragcoord.xy).r; - gl_FragColor.rgb = vec3(i); - gl_FragColor.a = 1.0; + gl_FragColor = texture2DRect(screenMap, vary_texcoord0.xy) * vertex_color; } diff --git a/indra/newview/app_settings/shaders/class3/deferred/giV.glsl b/indra/newview/app_settings/shaders/class1/interface/splattexturerectV.glsl index 190e32b6a3..641d670c26 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/giV.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/splattexturerectV.glsl @@ -1,9 +1,9 @@ /** - * @file giV.glsl + * @file splattexturerectV.glsl * * $LicenseInfo:firstyear=2007&license=viewerlgpl$ * Second Life Viewer Source Code - * Copyright (C) 2007, Linden Research, Inc. + * Copyright (C) 2011, Linden Research, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -22,21 +22,20 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - +uniform mat4 modelview_projection_matrix; -varying vec2 vary_fragcoord; +ATTRIBUTE vec3 position; +ATTRIBUTE vec2 texcoord0; +ATTRIBUTE vec4 diffuse_color; -uniform vec2 screen_res; +VARYING vec4 vertex_color; +VARYING vec2 vary_texcoord0; void main() { - //transform vertex - gl_Position = ftransform(); - vec4 pos = gl_ModelViewProjectionMatrix * gl_Vertex; - vary_fragcoord = (pos.xy * 0.5 + 0.5)*screen_res; - vec4 tex = gl_MultiTexCoord0; - tex.w = 1.0; - - gl_FrontColor = gl_Color; + gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0); + vary_texcoord0 = texcoord0; + vertex_color = diffuse_color; } + diff --git a/indra/newview/app_settings/shaders/class1/interface/twotextureaddF.glsl b/indra/newview/app_settings/shaders/class1/interface/twotextureaddF.glsl index 3408cc44f8..cdb48163dd 100644 --- a/indra/newview/app_settings/shaders/class1/interface/twotextureaddF.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/twotextureaddF.glsl @@ -22,11 +22,18 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - + +#ifdef DEFINE_GL_FRAGCOLOR +out vec4 gl_FragColor; +#endif + uniform sampler2D tex0; uniform sampler2D tex1; +VARYING vec2 vary_texcoord0; +VARYING vec2 vary_texcoord1; + void main() { - gl_FragColor = texture2D(tex0, gl_TexCoord[0].xy)+texture2D(tex1, gl_TexCoord[1].xy); + gl_FragColor = texture2D(tex0, vary_texcoord0.xy)+texture2D(tex1, vary_texcoord1.xy); } diff --git a/indra/newview/app_settings/shaders/class1/interface/twotextureaddV.glsl b/indra/newview/app_settings/shaders/class1/interface/twotextureaddV.glsl index 94aa964be6..3c2f297f7f 100644 --- a/indra/newview/app_settings/shaders/class1/interface/twotextureaddV.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/twotextureaddV.glsl @@ -23,12 +23,19 @@ * $/LicenseInfo$ */ +uniform mat4 modelview_projection_matrix; +ATTRIBUTE vec3 position; +ATTRIBUTE vec2 texcoord0; +ATTRIBUTE vec2 texcoord1; + +VARYING vec2 vary_texcoord0; +VARYING vec2 vary_texcoord1; void main() { - gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; - gl_TexCoord[0] = gl_MultiTexCoord0; - gl_TexCoord[1] = gl_MultiTexCoord1; + gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0); + vary_texcoord0 = texcoord0; + vary_texcoord1 = texcoord1; } diff --git a/indra/newview/app_settings/shaders/class1/interface/uiF.glsl b/indra/newview/app_settings/shaders/class1/interface/uiF.glsl index 7694056b08..36d6e06fc5 100644 --- a/indra/newview/app_settings/shaders/class1/interface/uiF.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/uiF.glsl @@ -22,10 +22,17 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - + +#ifdef DEFINE_GL_FRAGCOLOR +out vec4 gl_FragColor; +#endif + uniform sampler2D diffuseMap; +VARYING vec2 vary_texcoord0; +VARYING vec4 vertex_color; + void main() { - gl_FragColor = gl_Color*texture2D(diffuseMap, gl_TexCoord[0].xy); + gl_FragColor = vertex_color*texture2D(diffuseMap, vary_texcoord0.xy); } diff --git a/indra/newview/app_settings/shaders/class1/interface/uiV.glsl b/indra/newview/app_settings/shaders/class1/interface/uiV.glsl index b1b90d0b5e..220dafef25 100644 --- a/indra/newview/app_settings/shaders/class1/interface/uiV.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/uiV.glsl @@ -22,13 +22,21 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - +uniform mat4 texture_matrix0; +uniform mat4 modelview_projection_matrix; + +ATTRIBUTE vec3 position; +ATTRIBUTE vec4 diffuse_color; +ATTRIBUTE vec2 texcoord0; + +VARYING vec4 vertex_color; +VARYING vec2 vary_texcoord0; void main() { - gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; - gl_TexCoord[0] = gl_MultiTexCoord0; - gl_FrontColor = gl_Color; + gl_Position = modelview_projection_matrix * vec4(position, 1); + vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy; + vertex_color = diffuse_color; } diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightAlphaMaskF.glsl index 4c05329065..10413bdeb0 100644 --- a/indra/newview/app_settings/shaders/class2/lighting/lightAlphaMaskF.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightAlphaMaskF.glsl @@ -23,18 +23,23 @@ * $/LicenseInfo$ */ +#ifdef DEFINE_GL_FRAGCOLOR +out vec4 gl_FragColor; +#endif uniform float minimum_alpha; -uniform float maximum_alpha; vec3 atmosLighting(vec3 light); vec3 scaleSoftClip(vec3 light); +VARYING vec4 vertex_color; +VARYING vec2 vary_texcoord0; + void default_lighting() { - vec4 color = diffuseLookup(gl_TexCoord[0].xy) * gl_Color; + vec4 color = diffuseLookup(vary_texcoord0.xy) * vertex_color; - if (color.a < minimum_alpha || color.a > maximum_alpha) + if (color.a < minimum_alpha) { discard; } diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightAlphaMaskNonIndexedF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightAlphaMaskNonIndexedF.glsl index 0de909353e..1164e5b0a6 100644 --- a/indra/newview/app_settings/shaders/class2/lighting/lightAlphaMaskNonIndexedF.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightAlphaMaskNonIndexedF.glsl @@ -22,22 +22,26 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - -uniform float minimum_alpha; -uniform float maximum_alpha; +#ifdef DEFINE_GL_FRAGCOLOR +out vec4 gl_FragColor; +#endif +uniform float minimum_alpha; uniform sampler2D diffuseMap; vec3 atmosLighting(vec3 light); vec3 scaleSoftClip(vec3 light); +VARYING vec4 vertex_color; +VARYING vec2 vary_texcoord0; + void default_lighting() { - vec4 color = texture2D(diffuseMap,gl_TexCoord[0].xy) * gl_Color; + vec4 color = texture2D(diffuseMap,vary_texcoord0.xy) * vertex_color; - if (color.a < minimum_alpha || color.a > maximum_alpha) + if (color.a < minimum_alpha) { discard; } diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightF.glsl index 5cb3eb05a7..735f5b3813 100644 --- a/indra/newview/app_settings/shaders/class1/lighting/lightF.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightF.glsl @@ -22,14 +22,25 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - +#ifdef DEFINE_GL_FRAGCOLOR +out vec4 gl_FragColor; +#endif -uniform sampler2D diffuseMap; +VARYING vec4 vertex_color; +VARYING vec2 vary_texcoord0; + +vec3 atmosLighting(vec3 light); +vec3 scaleSoftClip(vec3 light); void default_lighting() { - vec4 color = gl_Color * texture2D(diffuseMap, gl_TexCoord[0].xy); + vec4 color = diffuseLookup(vary_texcoord0.xy) * vertex_color; + + color.rgb = atmosLighting(color.rgb); + + color.rgb = scaleSoftClip(color.rgb); + gl_FragColor = color; } diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightAlphaMaskF.glsl index 8c7713c08d..ba99c0ed71 100644 --- a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightAlphaMaskF.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightAlphaMaskF.glsl @@ -22,18 +22,24 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - + +#ifdef DEFINE_GL_FRAGCOLOR +out vec4 gl_FragColor; +#endif + uniform float minimum_alpha; -uniform float maximum_alpha; vec3 fullbrightAtmosTransport(vec3 light); vec3 fullbrightScaleSoftClip(vec3 light); +VARYING vec4 vertex_color; +VARYING vec2 vary_texcoord0; + void fullbright_lighting() { - vec4 color = diffuseLookup(gl_TexCoord[0].xy) * gl_Color; + vec4 color = diffuseLookup(vary_texcoord0.xy) * vertex_color; - if (color.a < minimum_alpha || color.a > maximum_alpha) + if (color.a < minimum_alpha) { discard; } diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightF.glsl index f3ba8b73a8..c3edc0bd70 100644 --- a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightF.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightF.glsl @@ -22,14 +22,25 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - +#ifdef DEFINE_GL_FRAGCOLOR +out vec4 gl_FragColor; +#endif +VARYING vec4 vertex_color; +VARYING vec2 vary_texcoord0; -uniform sampler2D diffuseMap; +vec3 fullbrightAtmosTransport(vec3 light); +vec3 fullbrightScaleSoftClip(vec3 light); void fullbright_lighting() { - gl_FragColor = texture2D(diffuseMap, gl_TexCoord[0].xy); + vec4 color = diffuseLookup(vary_texcoord0.xy) * vertex_color; + + color.rgb = fullbrightAtmosTransport(color.rgb); + + color.rgb = fullbrightScaleSoftClip(color.rgb); + + gl_FragColor = color; } diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightNonIndexedAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightNonIndexedAlphaMaskF.glsl index 89468b9665..276fad4f44 100644 --- a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightNonIndexedAlphaMaskF.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightNonIndexedAlphaMaskF.glsl @@ -22,20 +22,26 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - + +#ifdef DEFINE_GL_FRAGCOLOR +out vec4 gl_FragColor; +#endif + uniform float minimum_alpha; -uniform float maximum_alpha; vec3 fullbrightAtmosTransport(vec3 light); vec3 fullbrightScaleSoftClip(vec3 light); uniform sampler2D diffuseMap; +VARYING vec4 vertex_color; +VARYING vec2 vary_texcoord0; + void fullbright_lighting() { - vec4 color = texture2D(diffuseMap,gl_TexCoord[0].xy) * gl_Color; + vec4 color = texture2D(diffuseMap,vary_texcoord0.xy) * vertex_color; - if (color.a < minimum_alpha || color.a > maximum_alpha) + if (color.a < minimum_alpha) { discard; } diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightNonIndexedF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightNonIndexedF.glsl index a909ff608a..4e1e664e6b 100644 --- a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightNonIndexedF.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightNonIndexedF.glsl @@ -22,8 +22,13 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - +#ifdef DEFINE_GL_FRAGCOLOR +out vec4 gl_FragColor; +#endif + +VARYING vec4 vertex_color; +VARYING vec2 vary_texcoord0; vec3 fullbrightAtmosTransport(vec3 light); vec3 fullbrightScaleSoftClip(vec3 light); @@ -32,7 +37,7 @@ uniform sampler2D diffuseMap; void fullbright_lighting() { - vec4 color = texture2D(diffuseMap,gl_TexCoord[0].xy) * gl_Color; + vec4 color = texture2D(diffuseMap,vary_texcoord0.xy) * vertex_color; color.rgb = fullbrightAtmosTransport(color.rgb); diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyF.glsl index b4c8a9abce..c981e9eba2 100644 --- a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyF.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyF.glsl @@ -22,14 +22,34 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - +#ifdef DEFINE_GL_FRAGCOLOR +out vec4 gl_FragColor; +#endif +VARYING vec4 vertex_color; +VARYING vec2 vary_texcoord0; +VARYING vec3 vary_texcoord1; -uniform sampler2D diffuseMap; uniform samplerCube environmentMap; -void fullbright_shiny_lighting() +vec3 fullbrightShinyAtmosTransport(vec3 light); +vec3 fullbrightScaleSoftClip(vec3 light); + +void fullbright_shiny_lighting() { - gl_FragColor = texture2D(diffuseMap, gl_TexCoord[0].xy); + vec4 color = diffuseLookup(vary_texcoord0.xy); + color.rgb *= vertex_color.rgb; + + vec3 envColor = textureCube(environmentMap, vary_texcoord1.xyz).rgb; + color.rgb = mix(color.rgb, envColor.rgb, vertex_color.a); + + color.rgb = fullbrightShinyAtmosTransport(color.rgb); + + color.rgb = fullbrightScaleSoftClip(color.rgb); + + color.a = max(color.a, vertex_color.a); + + gl_FragColor = color; } + diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyNonIndexedF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyNonIndexedF.glsl index af73168c13..a4893f0359 100644 --- a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyNonIndexedF.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyNonIndexedF.glsl @@ -22,8 +22,14 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - +#ifdef DEFINE_GL_FRAGCOLOR +out vec4 gl_FragColor; +#endif + +VARYING vec4 vertex_color; +VARYING vec2 vary_texcoord0; +VARYING vec3 vary_texcoord1; uniform samplerCube environmentMap; uniform sampler2D diffuseMap; @@ -33,17 +39,17 @@ vec3 fullbrightScaleSoftClip(vec3 light); void fullbright_shiny_lighting() { - vec4 color = texture2D(diffuseMap, gl_TexCoord[0].xy); - color.rgb *= gl_Color.rgb; + vec4 color = texture2D(diffuseMap, vary_texcoord0.xy); + color.rgb *= vertex_color.rgb; - vec3 envColor = textureCube(environmentMap, gl_TexCoord[1].xyz).rgb; - color.rgb = mix(color.rgb, envColor.rgb, gl_Color.a); + vec3 envColor = textureCube(environmentMap, vary_texcoord1.xyz).rgb; + color.rgb = mix(color.rgb, envColor.rgb, vertex_color.a); color.rgb = fullbrightShinyAtmosTransport(color.rgb); color.rgb = fullbrightScaleSoftClip(color.rgb); - color.a = max(color.a, gl_Color.a); + color.a = max(color.a, vertex_color.a); gl_FragColor = color; } diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyWaterF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyWaterF.glsl index 925d6fbcfd..c10cde98e0 100644 --- a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyWaterF.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyWaterF.glsl @@ -21,14 +21,33 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - +#ifdef DEFINE_GL_FRAGCOLOR +out vec4 gl_FragColor; +#endif +VARYING vec4 vertex_color; +VARYING vec2 vary_texcoord0; +VARYING vec3 vary_texcoord1; -uniform sampler2D diffuseMap; uniform samplerCube environmentMap; -void fullbright_shiny_lighting_water() +vec3 fullbrightShinyAtmosTransport(vec3 light); +vec3 fullbrightScaleSoftClip(vec3 light); +vec4 applyWaterFog(vec4 color); + +void fullbright_shiny_lighting_water() { - gl_FragColor = texture2D(diffuseMap, gl_TexCoord[0].xy); + vec4 color = diffuseLookup(vary_texcoord0.xy); + color.rgb *= vertex_color.rgb; + + vec3 envColor = textureCube(environmentMap, vary_texcoord1.xyz).rgb; + color.rgb = mix(color.rgb, envColor.rgb, vertex_color.a); + + color.rgb = fullbrightShinyAtmosTransport(color.rgb); + color.rgb = fullbrightScaleSoftClip(color.rgb); + color.a = max(color.a, vertex_color.a); + + gl_FragColor = applyWaterFog(color); } + diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyWaterNonIndexedF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyWaterNonIndexedF.glsl index e0a7986705..e9b26087f4 100644 --- a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyWaterNonIndexedF.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyWaterNonIndexedF.glsl @@ -22,8 +22,13 @@ * $/LicenseInfo$ */ +#ifdef DEFINE_GL_FRAGCOLOR +out vec4 gl_FragColor; +#endif - +VARYING vec4 vertex_color; +VARYING vec2 vary_texcoord0; +VARYING vec3 vary_texcoord1; uniform samplerCube environmentMap; uniform sampler2D diffuseMap; @@ -34,15 +39,15 @@ vec4 applyWaterFog(vec4 color); void fullbright_shiny_lighting_water() { - vec4 color = texture2D(diffuseMap,gl_TexCoord[0].xy); - color.rgb *= gl_Color.rgb; + vec4 color = texture2D(diffuseMap,vary_texcoord0.xy); + color.rgb *= vertex_color.rgb; - vec3 envColor = textureCube(environmentMap, gl_TexCoord[1].xyz).rgb; - color.rgb = mix(color.rgb, envColor.rgb, gl_Color.a); + vec3 envColor = textureCube(environmentMap, vary_texcoord1.xyz).rgb; + color.rgb = mix(color.rgb, envColor.rgb, vertex_color.a); color.rgb = fullbrightShinyAtmosTransport(color.rgb); color.rgb = fullbrightScaleSoftClip(color.rgb); - color.a = max(color.a, gl_Color.a); + color.a = max(color.a, vertex_color.a); gl_FragColor = applyWaterFog(color); } diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightWaterAlphaMaskF.glsl index e5998b77a9..754b2922d9 100644 --- a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterAlphaMaskF.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightWaterAlphaMaskF.glsl @@ -23,19 +23,25 @@ * $/LicenseInfo$ */ +#ifdef DEFINE_GL_FRAGCOLOR +out vec4 gl_FragColor; +#endif + uniform float minimum_alpha; -uniform float maximum_alpha; vec4 diffuseLookup(vec2 texcoord); vec3 fullbrightAtmosTransport(vec3 light); vec4 applyWaterFog(vec4 color); +VARYING vec4 vertex_color; +VARYING vec2 vary_texcoord0; + void fullbright_lighting_water() { - vec4 color = diffuseLookup(gl_TexCoord[0].xy) * gl_Color; + vec4 color = diffuseLookup(vary_texcoord0.xy) * vertex_color; - if (color.a < minimum_alpha || color.a > maximum_alpha) + if (color.a < minimum_alpha) { discard; } diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightWaterF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightWaterF.glsl index 71238f7d31..2547f9e750 100644 --- a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightWaterF.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightWaterF.glsl @@ -23,13 +23,24 @@ * $/LicenseInfo$ */ - +#ifdef DEFINE_GL_FRAGCOLOR +out vec4 gl_FragColor; +#endif +VARYING vec4 vertex_color; +VARYING vec2 vary_texcoord0; -uniform sampler2D diffuseMap; +vec4 diffuseLookup(vec2 texcoord); + +vec3 fullbrightAtmosTransport(vec3 light); +vec4 applyWaterFog(vec4 color); void fullbright_lighting_water() { - gl_FragColor = texture2D(diffuseMap, gl_TexCoord[0].xy); + vec4 color = diffuseLookup(vary_texcoord0.xy) * vertex_color; + + color.rgb = fullbrightAtmosTransport(color.rgb); + + gl_FragColor = applyWaterFog(color); } diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterNonIndexedAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightWaterNonIndexedAlphaMaskF.glsl index 3fdd110f7d..f69b907dc7 100644 --- a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterNonIndexedAlphaMaskF.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightWaterNonIndexedAlphaMaskF.glsl @@ -22,20 +22,26 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - + +#ifdef DEFINE_GL_FRAGCOLOR +out vec4 gl_FragColor; +#endif + uniform float minimum_alpha; -uniform float maximum_alpha; uniform sampler2D diffuseMap; vec3 fullbrightAtmosTransport(vec3 light); vec4 applyWaterFog(vec4 color); +VARYING vec4 vertex_color; +VARYING vec2 vary_texcoord0; + void fullbright_lighting_water() { - vec4 color = texture2D(diffuseMap, gl_TexCoord[0].xy) * gl_Color; + vec4 color = texture2D(diffuseMap, vary_texcoord0.xy) * vertex_color; - if (color.a < minimum_alpha || color.a > maximum_alpha) + if (color.a < minimum_alpha) { discard; } diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterNonIndexedF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightWaterNonIndexedF.glsl index 01b89019b1..aa3ef8cdd9 100644 --- a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterNonIndexedF.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightWaterNonIndexedF.glsl @@ -22,8 +22,13 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - +#ifdef DEFINE_GL_FRAGCOLOR +out vec4 gl_FragColor; +#endif + +VARYING vec4 vertex_color; +VARYING vec2 vary_texcoord0; uniform sampler2D diffuseMap; @@ -32,7 +37,7 @@ vec4 applyWaterFog(vec4 color); void fullbright_lighting_water() { - vec4 color = texture2D(diffuseMap, gl_TexCoord[0].xy) * gl_Color; + vec4 color = texture2D(diffuseMap, vary_texcoord0.xy) * vertex_color; color.rgb = fullbrightAtmosTransport(color.rgb); diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightNonIndexedF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightNonIndexedF.glsl index d419c2d116..9f1a358b53 100644 --- a/indra/newview/app_settings/shaders/class2/lighting/lightNonIndexedF.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightNonIndexedF.glsl @@ -22,8 +22,13 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - +#ifdef DEFINE_GL_FRAGCOLOR +out vec4 gl_FragColor; +#endif + +VARYING vec4 vertex_color; +VARYING vec2 vary_texcoord0; uniform sampler2D diffuseMap; @@ -32,7 +37,7 @@ vec3 scaleSoftClip(vec3 light); void default_lighting() { - vec4 color = texture2D(diffuseMap,gl_TexCoord[0].xy) * gl_Color; + vec4 color = texture2D(diffuseMap,vary_texcoord0.xy) * vertex_color; color.rgb = atmosLighting(color.rgb); diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightShinyF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightShinyF.glsl index 7c9b7c218f..e9c27dbefd 100644 --- a/indra/newview/app_settings/shaders/class1/lighting/lightShinyF.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightShinyF.glsl @@ -22,16 +22,33 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - +#ifdef DEFINE_GL_FRAGCOLOR +out vec4 gl_FragColor; +#endif +VARYING vec4 vertex_color; +VARYING vec2 vary_texcoord0; +VARYING vec3 vary_texcoord1; -uniform sampler2D diffuseMap; uniform samplerCube environmentMap; -void shiny_lighting() +vec3 scaleSoftClip(vec3 light); +vec3 atmosLighting(vec3 light); +vec4 applyWaterFog(vec4 color); + +void shiny_lighting() { - vec4 color = gl_Color * texture2D(diffuseMap, gl_TexCoord[0].xy); + vec4 color = diffuseLookup(vary_texcoord0.xy); + color.rgb *= vertex_color.rgb; + + vec3 envColor = textureCube(environmentMap, vary_texcoord1.xyz).rgb; + color.rgb = mix(color.rgb, envColor.rgb, vertex_color.a); + + color.rgb = atmosLighting(color.rgb); + + color.rgb = scaleSoftClip(color.rgb); + color.a = max(color.a, vertex_color.a); gl_FragColor = color; } diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightShinyNonIndexedF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightShinyNonIndexedF.glsl index 3b30ebf6f1..595ad74365 100644 --- a/indra/newview/app_settings/shaders/class2/lighting/lightShinyNonIndexedF.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightShinyNonIndexedF.glsl @@ -22,9 +22,14 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - - +#ifdef DEFINE_GL_FRAGCOLOR +out vec4 gl_FragColor; +#endif + +VARYING vec4 vertex_color; +VARYING vec2 vary_texcoord0; +VARYING vec3 vary_texcoord1; uniform samplerCube environmentMap; uniform sampler2D diffuseMap; @@ -35,16 +40,16 @@ vec4 applyWaterFog(vec4 color); void shiny_lighting() { - vec4 color = texture2D(diffuseMap,gl_TexCoord[0].xy); - color.rgb *= gl_Color.rgb; + vec4 color = texture2D(diffuseMap,vary_texcoord0.xy); + color.rgb *= vertex_color.rgb; - vec3 envColor = textureCube(environmentMap, gl_TexCoord[1].xyz).rgb; - color.rgb = mix(color.rgb, envColor.rgb, gl_Color.a); + vec3 envColor = textureCube(environmentMap, vary_texcoord1.xyz).rgb; + color.rgb = mix(color.rgb, envColor.rgb, vertex_color.a); color.rgb = atmosLighting(color.rgb); color.rgb = scaleSoftClip(color.rgb); - color.a = max(color.a, gl_Color.a); + color.a = max(color.a, vertex_color.a); gl_FragColor = color; } diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightShinyWaterF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightShinyWaterF.glsl index ca1af8fc79..68c727d62c 100644 --- a/indra/newview/app_settings/shaders/class1/lighting/lightShinyWaterF.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightShinyWaterF.glsl @@ -22,16 +22,30 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - +#ifdef DEFINE_GL_FRAGCOLOR +out vec4 gl_FragColor; +#endif +VARYING vec4 vertex_color; +VARYING vec2 vary_texcoord0; +VARYING vec3 vary_texcoord1; -uniform sampler2D diffuseMap; uniform samplerCube environmentMap; -void shiny_lighting_water() +vec3 atmosLighting(vec3 light); +vec4 applyWaterFog(vec4 color); + +void shiny_lighting_water() { - vec4 color = gl_Color * texture2D(diffuseMap, gl_TexCoord[0].xy); - gl_FragColor = color; + vec4 color = diffuseLookup(vary_texcoord0.xy); + color.rgb *= vertex_color.rgb; + + vec3 envColor = textureCube(environmentMap, vary_texcoord1.xyz).rgb; + color.rgb = mix(color.rgb, envColor.rgb, vertex_color.a); + + color.rgb = atmosLighting(color.rgb); + color.a = max(color.a, vertex_color.a); + gl_FragColor = applyWaterFog(color); } diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightShinyWaterNonIndexedF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightShinyWaterNonIndexedF.glsl index eeb997fb5f..f32b9e1958 100644 --- a/indra/newview/app_settings/shaders/class2/lighting/lightShinyWaterNonIndexedF.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightShinyWaterNonIndexedF.glsl @@ -22,9 +22,14 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - +#ifdef DEFINE_GL_FRAGCOLOR +out vec4 gl_FragColor; +#endif +VARYING vec4 vertex_color; +VARYING vec2 vary_texcoord0; +VARYING vec3 vary_texcoord1; uniform sampler2D diffuseMap; uniform samplerCube environmentMap; @@ -34,14 +39,14 @@ vec4 applyWaterFog(vec4 color); void shiny_lighting_water() { - vec4 color = texture2D(diffuseMap,gl_TexCoord[0].xy); - color.rgb *= gl_Color.rgb; + vec4 color = texture2D(diffuseMap,vary_texcoord0.xy); + color.rgb *= vertex_color.rgb; - vec3 envColor = textureCube(environmentMap, gl_TexCoord[1].xyz).rgb; - color.rgb = mix(color.rgb, envColor.rgb, gl_Color.a); + vec3 envColor = textureCube(environmentMap, vary_texcoord1.xyz).rgb; + color.rgb = mix(color.rgb, envColor.rgb, vertex_color.a); color.rgb = atmosLighting(color.rgb); - color.a = max(color.a, gl_Color.a); + color.a = max(color.a, vertex_color.a); gl_FragColor = applyWaterFog(color); } diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightSpecularV.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightSpecularV.glsl index 4a59b8245d..24bf9b3cee 100644 --- a/indra/newview/app_settings/shaders/class1/lighting/lightSpecularV.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightSpecularV.glsl @@ -1,5 +1,5 @@ /** - * @file lightV.glsl + * @file lightSpecularV.glsl * * $LicenseInfo:firstyear=2007&license=viewerlgpl$ * Second Life Viewer Source Code @@ -25,22 +25,12 @@ -float calcDirectionalLight(vec3 n, vec3 l); +// All lights, no specular highlights + +vec4 sumLightsSpecular(vec3 pos, vec3 norm, vec4 color, inout vec4 specularColor, vec4 baseCol); -// Same as non-specular lighting in lightV.glsl vec4 calcLightingSpecular(vec3 pos, vec3 norm, vec4 color, inout vec4 specularColor, vec4 baseCol) { - specularColor.rgb = vec3(0.0, 0.0, 0.0); - vec4 col; - col.a = color.a; - - col.rgb = gl_LightModel.ambient.rgb + baseCol.rgb; - - col.rgb += gl_LightSource[0].diffuse.rgb*calcDirectionalLight(norm, gl_LightSource[0].position.xyz); - col.rgb += gl_LightSource[1].diffuse.rgb*calcDirectionalLight(norm, gl_LightSource[1].position.xyz); - - col.rgb = min(col.rgb*color.rgb, 1.0); - - return col; + return sumLightsSpecular(pos, norm, color, specularColor, baseCol); } diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightV.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightV.glsl index 742cb38d80..8045809b82 100644 --- a/indra/newview/app_settings/shaders/class1/lighting/lightV.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightV.glsl @@ -25,20 +25,12 @@ -float calcDirectionalLight(vec3 n, vec3 l); +// All lights, no specular highlights + +vec4 sumLights(vec3 pos, vec3 norm, vec4 color, vec4 baseLight); vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseLight) { - vec4 col; - col.a = color.a; - - col.rgb = gl_LightModel.ambient.rgb + baseLight.rgb; - - col.rgb += gl_LightSource[0].diffuse.rgb*calcDirectionalLight(norm, gl_LightSource[0].position.xyz); - col.rgb += gl_LightSource[1].diffuse.rgb*calcDirectionalLight(norm, gl_LightSource[1].position.xyz); - - col.rgb = min(col.rgb*color.rgb, 1.0); - - return col; + return sumLights(pos, norm, color, baseLight); } diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightWaterAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightWaterAlphaMaskF.glsl index 072dcaa6b6..103dd633c9 100644 --- a/indra/newview/app_settings/shaders/class2/lighting/lightWaterAlphaMaskF.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightWaterAlphaMaskF.glsl @@ -22,18 +22,24 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - + +#ifdef DEFINE_GL_FRAGCOLOR +out vec4 gl_FragColor; +#endif + uniform float minimum_alpha; -uniform float maximum_alpha; vec3 atmosLighting(vec3 light); vec4 applyWaterFog(vec4 color); +VARYING vec4 vertex_color; +VARYING vec2 vary_texcoord0; + void default_lighting_water() { - vec4 color = diffuseLookup(gl_TexCoord[0].xy) * gl_Color; + vec4 color = diffuseLookup(vary_texcoord0.xy) * vertex_color; - if (color.a < minimum_alpha || color.a > maximum_alpha) + if (color.a < minimum_alpha) { discard; } diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightWaterAlphaMaskNonIndexedF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightWaterAlphaMaskNonIndexedF.glsl index 2df34da4b4..bef72752da 100644 --- a/indra/newview/app_settings/shaders/class2/lighting/lightWaterAlphaMaskNonIndexedF.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightWaterAlphaMaskNonIndexedF.glsl @@ -22,20 +22,26 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - + +#ifdef DEFINE_GL_FRAGCOLOR +out vec4 gl_FragColor; +#endif + uniform float minimum_alpha; -uniform float maximum_alpha; uniform sampler2D diffuseMap; vec3 atmosLighting(vec3 light); vec4 applyWaterFog(vec4 color); +VARYING vec4 vertex_color; +VARYING vec2 vary_texcoord0; + void default_lighting_water() { - vec4 color = texture2D(diffuseMap,gl_TexCoord[0].xy) * gl_Color; + vec4 color = texture2D(diffuseMap,vary_texcoord0.xy) * vertex_color; - if (color.a < minimum_alpha || color.a > maximum_alpha) + if (color.a < minimum_alpha) { discard; } diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightWaterF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightWaterF.glsl index da76a977b6..e9537d1e9d 100644 --- a/indra/newview/app_settings/shaders/class1/lighting/lightWaterF.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightWaterF.glsl @@ -22,14 +22,23 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - +#ifdef DEFINE_GL_FRAGCOLOR +out vec4 gl_FragColor; +#endif -uniform sampler2D diffuseMap; +VARYING vec4 vertex_color; +VARYING vec2 vary_texcoord0; -void default_lighting_water() +vec3 atmosLighting(vec3 light); +vec4 applyWaterFog(vec4 color); + +void default_lighting_water() { - vec4 color = gl_Color * texture2D(diffuseMap, gl_TexCoord[0].xy); - gl_FragColor = color; + vec4 color = diffuseLookup(vary_texcoord0.xy) * vertex_color; + + color.rgb = atmosLighting(color.rgb); + + gl_FragColor = applyWaterFog(color); } diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightWaterNonIndexedF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightWaterNonIndexedF.glsl index 5a86dad827..8b0c25b705 100644 --- a/indra/newview/app_settings/shaders/class2/lighting/lightWaterNonIndexedF.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightWaterNonIndexedF.glsl @@ -22,8 +22,13 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - +#ifdef DEFINE_GL_FRAGCOLOR +out vec4 gl_FragColor; +#endif + +VARYING vec4 vertex_color; +VARYING vec2 vary_texcoord0; uniform sampler2D diffuseMap; @@ -32,7 +37,7 @@ vec4 applyWaterFog(vec4 color); void default_lighting_water() { - vec4 color = texture2D(diffuseMap,gl_TexCoord[0].xy) * gl_Color; + vec4 color = texture2D(diffuseMap,vary_texcoord0.xy) * vertex_color; color.rgb = atmosLighting(color.rgb); diff --git a/indra/newview/app_settings/shaders/class1/lighting/sumLightsSpecularV.glsl b/indra/newview/app_settings/shaders/class1/lighting/sumLightsSpecularV.glsl index 3e0815226c..7059ff31ae 100644 --- a/indra/newview/app_settings/shaders/class1/lighting/sumLightsSpecularV.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/sumLightsSpecularV.glsl @@ -31,21 +31,22 @@ vec3 atmosAffectDirectionalLight(float lightIntensity); vec3 atmosGetDiffuseSunlightColor(); vec3 scaleDownLight(vec3 light); +uniform vec4 light_position[8]; +uniform vec3 light_diffuse[8]; + vec4 sumLightsSpecular(vec3 pos, vec3 norm, vec4 color, inout vec4 specularColor, vec4 baseCol) { - vec4 col; - col.a = color.a; - - + vec4 col = vec4(0,0,0, color.a); + vec3 view = normalize(pos); /// collect all the specular values from each calcXXXLightSpecular() function vec4 specularSum = vec4(0.0); - col.rgb = gl_LightSource[1].diffuse.rgb * calcDirectionalLightSpecular(specularColor, view, norm, gl_LightSource[1].position.xyz, gl_LightSource[1].diffuse.rgb, 1.0); + col.rgb += light_diffuse[1].rgb * calcDirectionalLightSpecular(specularColor, view, norm, light_position[1].xyz,light_diffuse[1].rgb, 1.0); col.rgb = scaleDownLight(col.rgb); col.rgb += atmosAmbient(baseCol.rgb); - col.rgb += atmosAffectDirectionalLight(calcDirectionalLightSpecular(specularSum, view, norm, gl_LightSource[0].position.xyz,atmosGetDiffuseSunlightColor() * baseCol.a, 1.0)); + col.rgb += atmosAffectDirectionalLight(calcDirectionalLightSpecular(specularSum, view, norm, light_position[0].xyz,atmosGetDiffuseSunlightColor()*baseCol.a, 1.0)); col.rgb = min(col.rgb * color.rgb, 1.0); specularColor.rgb = min(specularColor.rgb * specularSum.rgb, 1.0); diff --git a/indra/newview/app_settings/shaders/class1/lighting/sumLightsV.glsl b/indra/newview/app_settings/shaders/class1/lighting/sumLightsV.glsl index c271dbcd18..41288c21c1 100644 --- a/indra/newview/app_settings/shaders/class1/lighting/sumLightsV.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/sumLightsV.glsl @@ -23,7 +23,8 @@ * $/LicenseInfo$ */ - +uniform vec4 light_position[8]; +uniform vec3 light_diffuse[8]; float calcDirectionalLight(vec3 n, vec3 l); @@ -36,10 +37,10 @@ vec4 sumLights(vec3 pos, vec3 norm, vec4 color, vec4 baseLight) vec4 col; col.a = color.a; - col.rgb = gl_LightSource[1].diffuse.rgb * calcDirectionalLight(norm, gl_LightSource[1].position.xyz); + col.rgb = light_diffuse[1].rgb * calcDirectionalLight(norm, light_position[1].xyz); col.rgb = scaleDownLight(col.rgb); col.rgb += atmosAmbient(baseLight.rgb); - col.rgb += atmosAffectDirectionalLight(calcDirectionalLight(norm, gl_LightSource[0].position.xyz)); + col.rgb += atmosAffectDirectionalLight(calcDirectionalLight(norm, light_position[0].xyz)); col.rgb = min(col.rgb*color.rgb, 1.0); diff --git a/indra/newview/app_settings/shaders/class1/objects/bumpF.glsl b/indra/newview/app_settings/shaders/class1/objects/bumpF.glsl index 11031a8829..4b85d61aca 100644 --- a/indra/newview/app_settings/shaders/class1/objects/bumpF.glsl +++ b/indra/newview/app_settings/shaders/class1/objects/bumpF.glsl @@ -22,14 +22,21 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - + +#ifdef DEFINE_GL_FRAGCOLOR +out vec4 gl_FragColor; +#endif + uniform sampler2D texture0; uniform sampler2D texture1; +VARYING vec2 vary_texcoord0; +VARYING vec2 vary_texcoord1; + void main() { - float tex0 = texture2D(texture0, gl_TexCoord[0].xy).a; - float tex1 = texture2D(texture1, gl_TexCoord[1].xy).a; + float tex0 = texture2D(texture0, vary_texcoord0.xy).a; + float tex1 = texture2D(texture1, vary_texcoord1.xy).a; gl_FragColor = vec4(tex0+(1.0-tex1)-0.5); } diff --git a/indra/newview/app_settings/shaders/class1/objects/bumpV.glsl b/indra/newview/app_settings/shaders/class1/objects/bumpV.glsl index c50ed86315..a7738087dc 100644 --- a/indra/newview/app_settings/shaders/class1/objects/bumpV.glsl +++ b/indra/newview/app_settings/shaders/class1/objects/bumpV.glsl @@ -22,13 +22,21 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - + +uniform mat4 texture_matrix0; +uniform mat4 modelview_projection_matrix; + +ATTRIBUTE vec3 position; +ATTRIBUTE vec2 texcoord0; +ATTRIBUTE vec2 texcoord1; + +VARYING vec2 vary_texcoord0; +VARYING vec2 vary_texcoord1; void main() { //transform vertex - gl_Position = gl_ModelViewProjectionMatrix*gl_Vertex; - gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0; - gl_TexCoord[1] = gl_TextureMatrix[1] * gl_MultiTexCoord1; - gl_FrontColor = gl_Color; + gl_Position = modelview_projection_matrix*vec4(position.xyz, 1.0); + vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy; + vary_texcoord1 = (texture_matrix0 * vec4(texcoord1,0,1)).xy; } diff --git a/indra/newview/app_settings/shaders/class2/objects/simpleV.glsl b/indra/newview/app_settings/shaders/class1/objects/emissiveSkinnedV.glsl index b0114763c1..8494ffba52 100644 --- a/indra/newview/app_settings/shaders/class2/objects/simpleV.glsl +++ b/indra/newview/app_settings/shaders/class1/objects/emissiveSkinnedV.glsl @@ -1,5 +1,5 @@ /** - * @file simpleV.glsl + * @file emissiveSkinnedV.glsl * * $LicenseInfo:firstyear=2007&license=viewerlgpl$ * Second Life Viewer Source Code @@ -22,30 +22,37 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - +uniform mat4 projection_matrix; +uniform mat4 texture_matrix0; +uniform mat4 modelview_matrix; -vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol); -void calcAtmospherics(vec3 inPositionEye); +ATTRIBUTE vec3 position; +ATTRIBUTE vec4 emissive; +ATTRIBUTE vec2 texcoord0; + +VARYING vec4 vertex_color; +VARYING vec2 vary_texcoord0; -varying float vary_texture_index; + +void calcAtmospherics(vec3 inPositionEye); +mat4 getObjectSkinnedTransform(); void main() { //transform vertex - vec4 vert = vec4(gl_Vertex.xyz,1.0); - vary_texture_index = gl_Vertex.w; - gl_Position = gl_ModelViewProjectionMatrix*vert; - gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0; + vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy; - vec4 pos = (gl_ModelViewMatrix * vert); + mat4 mat = getObjectSkinnedTransform(); + + mat = modelview_matrix * mat; + vec3 pos = (mat*vec4(position.xyz, 1.0)).xyz; - vec3 norm = normalize(gl_NormalMatrix * gl_Normal); - calcAtmospherics(pos.xyz); - vec4 color = calcLighting(pos.xyz, norm, gl_Color, vec4(0.)); - gl_FrontColor = color; - - gl_FogFragCoord = pos.z; + vertex_color = emissive; + + gl_Position = projection_matrix*vec4(pos, 1.0); + + } diff --git a/indra/newview/app_settings/shaders/class2/objects/fullbrightShinyV.glsl b/indra/newview/app_settings/shaders/class1/objects/emissiveV.glsl index 819b28e4fd..e984deb0c8 100644 --- a/indra/newview/app_settings/shaders/class2/objects/fullbrightShinyV.glsl +++ b/indra/newview/app_settings/shaders/class1/objects/emissiveV.glsl @@ -1,7 +1,7 @@ /** - * @file fullbrightShinyV.glsl + * @file emissiveV.glsl * - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ + * $LicenseInfo:firstyear=2007&license=viewerlgpl$ * Second Life Viewer Source Code * Copyright (C) 2007, Linden Research, Inc. * @@ -22,32 +22,35 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - +uniform mat4 texture_matrix0; +uniform mat4 modelview_matrix; +uniform mat4 modelview_projection_matrix; + +ATTRIBUTE vec3 position; +void passTextureIndex(); +ATTRIBUTE vec4 emissive; +ATTRIBUTE vec2 texcoord0; + +VARYING vec4 vertex_color; +VARYING vec2 vary_texcoord0; void calcAtmospherics(vec3 inPositionEye); -uniform vec4 origin; -varying float vary_texture_index; + void main() { //transform vertex - vec4 vert = vec4(gl_Vertex.xyz,1.0); - vary_texture_index = gl_Vertex.w; - gl_Position = gl_ModelViewProjectionMatrix*vert; + passTextureIndex(); + gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0); + vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy; - vec4 pos = (gl_ModelViewMatrix * vert); - vec3 norm = normalize(gl_NormalMatrix * gl_Normal); - vec3 ref = reflect(pos.xyz, -norm); - - gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0; - gl_TexCoord[1] = gl_TextureMatrix[1]*vec4(ref,1.0); - + vec4 pos = (modelview_matrix * vec4(position.xyz, 1.0)); calcAtmospherics(pos.xyz); - gl_FrontColor = gl_Color; + vertex_color = emissive; - gl_FogFragCoord = pos.z; + } diff --git a/indra/newview/app_settings/shaders/class1/objects/fullbrightF.glsl b/indra/newview/app_settings/shaders/class1/objects/fullbrightF.glsl index 0fab5e5001..a54c0caf81 100644 --- a/indra/newview/app_settings/shaders/class1/objects/fullbrightF.glsl +++ b/indra/newview/app_settings/shaders/class1/objects/fullbrightF.glsl @@ -20,7 +20,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ + * $/LicenseInfo$F */ diff --git a/indra/newview/app_settings/shaders/class2/objects/fullbrightV.glsl b/indra/newview/app_settings/shaders/class1/objects/fullbrightNoColorV.glsl index abf6e37b7c..5d6f14230c 100644 --- a/indra/newview/app_settings/shaders/class2/objects/fullbrightV.glsl +++ b/indra/newview/app_settings/shaders/class1/objects/fullbrightNoColorV.glsl @@ -1,5 +1,5 @@ /** - * @file fullbrightV.glsl + * @file fullbrightNoColorV.glsl * * $LicenseInfo:firstyear=2007&license=viewerlgpl$ * Second Life Viewer Source Code @@ -22,26 +22,32 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - +uniform mat4 texture_matrix0; +uniform mat4 modelview_matrix; +uniform mat4 modelview_projection_matrix; + +ATTRIBUTE vec3 position; +ATTRIBUTE vec2 texcoord0; +ATTRIBUTE vec3 normal; + +VARYING vec4 vertex_color; +VARYING vec2 vary_texcoord0; -void calcAtmospherics(vec3 inPositionEye); -varying float vary_texture_index; +void calcAtmospherics(vec3 inPositionEye); void main() { //transform vertex - vec4 vert = vec4(gl_Vertex.xyz,1.0); - vary_texture_index = gl_Vertex.w; - gl_Position = gl_ModelViewProjectionMatrix*vert; - gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0; - - vec4 pos = (gl_ModelViewMatrix * vert); + vec4 vert = vec4(position.xyz,1.0); + vec4 pos = (modelview_matrix * vert); + gl_Position = modelview_projection_matrix*vec4(position.xyz, 1.0); + vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy; calcAtmospherics(pos.xyz); - gl_FrontColor = gl_Color; + vertex_color = vec4(1,1,1,1); - gl_FogFragCoord = pos.z; + } diff --git a/indra/newview/app_settings/shaders/class1/objects/fullbrightShinySkinnedV.glsl b/indra/newview/app_settings/shaders/class1/objects/fullbrightShinySkinnedV.glsl index e1a7f263f7..79b552ee1a 100644 --- a/indra/newview/app_settings/shaders/class1/objects/fullbrightShinySkinnedV.glsl +++ b/indra/newview/app_settings/shaders/class1/objects/fullbrightShinySkinnedV.glsl @@ -22,6 +22,19 @@ * $/LicenseInfo$ */ +uniform mat4 texture_matrix0; +uniform mat4 texture_matrix1; +uniform mat4 modelview_matrix; +uniform mat4 projection_matrix; + +ATTRIBUTE vec3 position; +ATTRIBUTE vec3 normal; +ATTRIBUTE vec4 diffuse_color; +ATTRIBUTE vec2 texcoord0; + +VARYING vec4 vertex_color; +VARYING vec2 vary_texcoord0; +VARYING vec3 vary_texcoord1; void calcAtmospherics(vec3 inPositionEye); @@ -31,24 +44,24 @@ void main() { mat4 mat = getObjectSkinnedTransform(); - mat = gl_ModelViewMatrix * mat; - vec3 pos = (mat*gl_Vertex).xyz; + mat = modelview_matrix * mat; + vec3 pos = (mat*vec4(position.xyz, 1.0)).xyz; - vec4 norm = gl_Vertex; - norm.xyz += gl_Normal.xyz; + vec4 norm = vec4(position.xyz, 1.0); + norm.xyz += normal.xyz; norm.xyz = (mat*norm).xyz; norm.xyz = normalize(norm.xyz-pos.xyz); vec3 ref = reflect(pos.xyz, -norm.xyz); - gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0; - gl_TexCoord[1] = gl_TextureMatrix[1]*vec4(ref,1.0); + vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy; + vary_texcoord1 = (texture_matrix1*vec4(ref,1.0)).xyz; calcAtmospherics(pos.xyz); - gl_FrontColor = gl_Color; + vertex_color = diffuse_color; + + gl_Position = projection_matrix*vec4(pos, 1.0); - gl_Position = gl_ProjectionMatrix*vec4(pos, 1.0); - gl_FogFragCoord = pos.z; } diff --git a/indra/newview/app_settings/shaders/class1/objects/fullbrightShinyV.glsl b/indra/newview/app_settings/shaders/class1/objects/fullbrightShinyV.glsl index 36b00dfbc1..34bd8d445a 100644 --- a/indra/newview/app_settings/shaders/class1/objects/fullbrightShinyV.glsl +++ b/indra/newview/app_settings/shaders/class1/objects/fullbrightShinyV.glsl @@ -22,28 +22,46 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - + +uniform mat3 normal_matrix; +uniform mat4 texture_matrix0; +uniform mat4 texture_matrix1; +uniform mat4 modelview_matrix; +uniform mat4 modelview_projection_matrix; void calcAtmospherics(vec3 inPositionEye); uniform vec4 origin; + + +ATTRIBUTE vec3 position; +void passTextureIndex(); +ATTRIBUTE vec3 normal; +ATTRIBUTE vec4 diffuse_color; +ATTRIBUTE vec2 texcoord0; + +VARYING vec4 vertex_color; +VARYING vec2 vary_texcoord0; +VARYING vec3 vary_texcoord1; + + void main() { //transform vertex - gl_Position = ftransform(); + vec4 vert = vec4(position.xyz,1.0); + passTextureIndex(); + vec4 pos = (modelview_matrix * vert); + gl_Position = modelview_projection_matrix*vec4(position.xyz, 1.0); - vec4 pos = (gl_ModelViewMatrix * gl_Vertex); - vec3 norm = normalize(gl_NormalMatrix * gl_Normal); + vec3 norm = normalize(normal_matrix * normal); vec3 ref = reflect(pos.xyz, -norm); - gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0; - gl_TexCoord[1] = gl_TextureMatrix[1]*vec4(ref,1.0); + vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy; + vary_texcoord1 = (texture_matrix1*vec4(ref,1.0)).xyz; calcAtmospherics(pos.xyz); - gl_FrontColor = gl_Color; - - gl_FogFragCoord = pos.z; + vertex_color = diffuse_color; } diff --git a/indra/newview/app_settings/shaders/class1/objects/fullbrightSkinnedV.glsl b/indra/newview/app_settings/shaders/class1/objects/fullbrightSkinnedV.glsl index b540054c56..eff75435a9 100644 --- a/indra/newview/app_settings/shaders/class1/objects/fullbrightSkinnedV.glsl +++ b/indra/newview/app_settings/shaders/class1/objects/fullbrightSkinnedV.glsl @@ -22,31 +22,36 @@ * $/LicenseInfo$ */ +uniform mat4 projection_matrix; +uniform mat4 texture_matrix0; +uniform mat4 modelview_matrix; +ATTRIBUTE vec3 position; +ATTRIBUTE vec4 diffuse_color; +ATTRIBUTE vec2 texcoord0; void calcAtmospherics(vec3 inPositionEye); mat4 getObjectSkinnedTransform(); +VARYING vec4 vertex_color; +VARYING vec2 vary_texcoord0; + + void main() { //transform vertex - gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0; + vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy; mat4 mat = getObjectSkinnedTransform(); - mat = gl_ModelViewMatrix * mat; - vec3 pos = (mat*gl_Vertex).xyz; + mat = modelview_matrix * mat; + vec3 pos = (mat*vec4(position.xyz, 1.0)).xyz; - vec4 norm = gl_Vertex; - norm.xyz += gl_Normal.xyz; - norm.xyz = (mat*norm).xyz; - norm.xyz = normalize(norm.xyz-pos.xyz); - calcAtmospherics(pos.xyz); - gl_FrontColor = gl_Color; + vertex_color = diffuse_color; - gl_Position = gl_ProjectionMatrix*vec4(pos, 1.0); + gl_Position = projection_matrix*vec4(pos, 1.0); - gl_FogFragCoord = pos.z; + } diff --git a/indra/newview/app_settings/shaders/class1/objects/fullbrightV.glsl b/indra/newview/app_settings/shaders/class1/objects/fullbrightV.glsl index 22f731ffde..fc20d3270e 100644 --- a/indra/newview/app_settings/shaders/class1/objects/fullbrightV.glsl +++ b/indra/newview/app_settings/shaders/class1/objects/fullbrightV.glsl @@ -22,22 +22,37 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ + +uniform mat4 texture_matrix0; +uniform mat4 modelview_matrix; +uniform mat4 modelview_projection_matrix; +ATTRIBUTE vec3 position; +void passTextureIndex(); +ATTRIBUTE vec2 texcoord0; +ATTRIBUTE vec3 normal; +ATTRIBUTE vec4 diffuse_color; void calcAtmospherics(vec3 inPositionEye); + +VARYING vec4 vertex_color; +VARYING vec2 vary_texcoord0; + + void main() { //transform vertex - gl_Position = ftransform(); - gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0; + vec4 vert = vec4(position.xyz,1.0); + passTextureIndex(); + vec4 pos = (modelview_matrix * vert); + gl_Position = modelview_projection_matrix*vec4(position.xyz, 1.0); + vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy; - vec4 pos = (gl_ModelViewMatrix * gl_Vertex); - calcAtmospherics(pos.xyz); - gl_FrontColor = gl_Color; + vertex_color = diffuse_color; - gl_FogFragCoord = pos.z; + } diff --git a/indra/newview/app_settings/shaders/class1/objects/impostorF.glsl b/indra/newview/app_settings/shaders/class1/objects/impostorF.glsl index 92c09ce937..3c6e22b295 100644 --- a/indra/newview/app_settings/shaders/class1/objects/impostorF.glsl +++ b/indra/newview/app_settings/shaders/class1/objects/impostorF.glsl @@ -22,20 +22,22 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - -uniform float minimum_alpha; -uniform float maximum_alpha; -vec3 fullbrightAtmosTransport(vec3 light); -vec3 fullbrightScaleSoftClip(vec3 light); +#ifdef DEFINE_GL_FRAGCOLOR +out vec4 gl_FragColor; +#endif + +uniform float minimum_alpha; uniform sampler2D diffuseMap; +VARYING vec2 vary_texcoord0; + void main() { - vec4 color = texture2D(diffuseMap,gl_TexCoord[0].xy) * gl_Color; + vec4 color = texture2D(diffuseMap,vary_texcoord0.xy); - if (color.a < minimum_alpha || color.a > maximum_alpha) + if (color.a < minimum_alpha) { discard; } diff --git a/indra/newview/app_settings/shaders/class1/objects/impostorV.glsl b/indra/newview/app_settings/shaders/class1/objects/impostorV.glsl index eea51eba45..e90dbb115a 100644 --- a/indra/newview/app_settings/shaders/class1/objects/impostorV.glsl +++ b/indra/newview/app_settings/shaders/class1/objects/impostorV.glsl @@ -22,13 +22,19 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - - + +uniform mat4 texture_matrix0; +uniform mat4 modelview_projection_matrix; + + +ATTRIBUTE vec3 position; +ATTRIBUTE vec2 texcoord0; + +VARYING vec2 vary_texcoord0; + void main() { //transform vertex - gl_Position = ftransform(); - gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0; - - gl_FrontColor = gl_Color; + gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0); + vary_texcoord0 = (texture_matrix0 * vec4(texcoord0, 0, 1)).xy; } diff --git a/indra/newview/app_settings/shaders/class1/deferred/sunLightMSF.glsl b/indra/newview/app_settings/shaders/class1/objects/indexedTextureF.glsl index 78ea15e87a..254c1d4fc2 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/sunLightMSF.glsl +++ b/indra/newview/app_settings/shaders/class1/objects/indexedTextureF.glsl @@ -1,5 +1,5 @@ /** - * @file sunLightF.glsl + * @file fullbrightF.glsl * * $LicenseInfo:firstyear=2007&license=viewerlgpl$ * Second Life Viewer Source Code @@ -23,13 +23,11 @@ * $/LicenseInfo$ */ + -//class 1, no shadow, no SSAO, should never be called - -#extension GL_ARB_texture_rectangle : enable - void main() { - gl_FragColor = vec4(0,0,0,0); + fullbright_lighting(); } + diff --git a/indra/newview/app_settings/shaders/class2/deferred/edgeV.glsl b/indra/newview/app_settings/shaders/class1/objects/indexedTextureV.glsl index 9deff7bb2a..a95c9e0ab9 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/edgeV.glsl +++ b/indra/newview/app_settings/shaders/class1/objects/indexedTextureV.glsl @@ -1,5 +1,5 @@ /** - * @file edgeV.glsl + * @file indexedTextureV.glsl * * $LicenseInfo:firstyear=2007&license=viewerlgpl$ * Second Life Viewer Source Code @@ -22,16 +22,13 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - +ATTRIBUTE float texture_index; -varying vec2 vary_fragcoord; -uniform vec2 screen_res; +VARYING float vary_texture_index; -void main() +void passTextureIndex() { - //transform vertex - gl_Position = ftransform(); - vec4 pos = gl_ModelViewProjectionMatrix * gl_Vertex; - vary_fragcoord = (pos.xy*0.5+0.5)*screen_res; + vary_texture_index = texture_index; } + diff --git a/indra/newview/app_settings/shaders/class1/objects/nonindexedTextureV.glsl b/indra/newview/app_settings/shaders/class1/objects/nonindexedTextureV.glsl new file mode 100644 index 0000000000..80ea286ac0 --- /dev/null +++ b/indra/newview/app_settings/shaders/class1/objects/nonindexedTextureV.glsl @@ -0,0 +1,31 @@ +/** + * @file nonindexedTextureV.glsl + * + * $LicenseInfo:firstyear=2007&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2007, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +void passTextureIndex() +{ + +} + + diff --git a/indra/newview/app_settings/shaders/class1/objects/previewV.glsl b/indra/newview/app_settings/shaders/class1/objects/previewV.glsl new file mode 100644 index 0000000000..5dcfa87066 --- /dev/null +++ b/indra/newview/app_settings/shaders/class1/objects/previewV.glsl @@ -0,0 +1,57 @@ +/** + * @file previewV.glsl + * + * $LicenseInfo:firstyear=2007&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2007, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +uniform mat3 normal_matrix; +uniform mat4 texture_matrix0; +uniform mat4 modelview_matrix; +uniform mat4 modelview_projection_matrix; + +ATTRIBUTE vec3 position; +ATTRIBUTE vec3 normal; +ATTRIBUTE vec2 texcoord0; + +VARYING vec4 vertex_color; +VARYING vec2 vary_texcoord0; + + +vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol); +void calcAtmospherics(vec3 inPositionEye); + +void main() +{ + //transform vertex + vec4 pos = (modelview_matrix * vec4(position.xyz, 1.0)); + gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0); + vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy; + + vec3 norm = normalize(normal_matrix * normal); + + calcAtmospherics(pos.xyz); + + vec4 color = calcLighting(pos.xyz, norm, vec4(1,1,1,1), vec4(0.)); + vertex_color = color; + + +} diff --git a/indra/newview/app_settings/shaders/class1/objects/shinySimpleSkinnedV.glsl b/indra/newview/app_settings/shaders/class1/objects/shinySimpleSkinnedV.glsl index f5fd4ededd..591d6fc5c9 100644 --- a/indra/newview/app_settings/shaders/class1/objects/shinySimpleSkinnedV.glsl +++ b/indra/newview/app_settings/shaders/class1/objects/shinySimpleSkinnedV.glsl @@ -22,7 +22,19 @@ * $/LicenseInfo$ */ +uniform mat4 projection_matrix; +uniform mat4 texture_matrix0; +uniform mat4 texture_matrix1; +uniform mat4 modelview_matrix; +ATTRIBUTE vec3 position; +ATTRIBUTE vec3 normal; +ATTRIBUTE vec4 diffuse_color; +ATTRIBUTE vec2 texcoord0; + +VARYING vec4 vertex_color; +VARYING vec2 vary_texcoord0; +VARYING vec3 vary_texcoord1; vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol); void calcAtmospherics(vec3 inPositionEye); @@ -32,23 +44,23 @@ void main() { mat4 mat = getObjectSkinnedTransform(); - mat = gl_ModelViewMatrix * mat; - vec3 pos = (mat*gl_Vertex).xyz; + mat = modelview_matrix * mat; + vec3 pos = (mat*vec4(position.xyz, 1.0)).xyz; - vec4 norm = gl_Vertex; - norm.xyz += gl_Normal.xyz; + vec4 norm = vec4(position.xyz, 1.0); + norm.xyz += normal.xyz; norm.xyz = (mat*norm).xyz; norm.xyz = normalize(norm.xyz-pos.xyz); vec3 ref = reflect(pos.xyz, -norm.xyz); - gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0; - gl_TexCoord[1] = gl_TextureMatrix[1]*vec4(ref,1.0); + vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy; + vary_texcoord1 = (texture_matrix1*vec4(ref,1.0)).xyz; calcAtmospherics(pos.xyz); - vec4 color = calcLighting(pos.xyz, norm.xyz, gl_Color, vec4(0.)); - gl_FrontColor = color; + vec4 color = calcLighting(pos.xyz, norm.xyz, diffuse_color, vec4(0.)); + vertex_color = color; - gl_Position = gl_ProjectionMatrix*vec4(pos, 1.0); + gl_Position = projection_matrix*vec4(pos, 1.0); } diff --git a/indra/newview/app_settings/shaders/class1/objects/shinyV.glsl b/indra/newview/app_settings/shaders/class1/objects/shinyV.glsl index 13a58f0d4a..fdb3453cc5 100644 --- a/indra/newview/app_settings/shaders/class1/objects/shinyV.glsl +++ b/indra/newview/app_settings/shaders/class1/objects/shinyV.glsl @@ -1,4 +1,4 @@ -/** +/** * @file shinyV.glsl * * $LicenseInfo:firstyear=2007&license=viewerlgpl$ @@ -22,8 +22,24 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - +uniform mat3 normal_matrix; +uniform mat4 texture_matrix0; +uniform mat4 texture_matrix1; +uniform mat4 modelview_matrix; +uniform mat4 modelview_projection_matrix; + +ATTRIBUTE vec3 position; +void passTextureIndex(); +ATTRIBUTE vec2 texcoord0; +ATTRIBUTE vec3 normal; +ATTRIBUTE vec4 diffuse_color; + +VARYING vec4 vertex_color; +VARYING vec2 vary_texcoord0; +VARYING vec3 vary_texcoord1; + +vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol); void calcAtmospherics(vec3 inPositionEye); @@ -32,19 +48,18 @@ uniform vec4 origin; void main() { //transform vertex - gl_Position = ftransform(); - - vec4 pos = (gl_ModelViewMatrix * gl_Vertex); - vec3 norm = normalize(gl_NormalMatrix * gl_Normal); + vec4 vert = vec4(position.xyz,1.0); + passTextureIndex(); + vec4 pos = (modelview_matrix * vert); + gl_Position = modelview_projection_matrix*vec4(position.xyz, 1.0); + + vec3 norm = normalize(normal_matrix * normal); + vec3 ref = reflect(pos.xyz, -norm); + + vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy; + vary_texcoord1 = (texture_matrix1*vec4(ref,1.0)).xyz; calcAtmospherics(pos.xyz); - - gl_FrontColor = gl_Color; - - vec3 ref = reflect(pos.xyz, -norm); - - gl_TexCoord[0] = gl_TextureMatrix[0]*vec4(ref,1.0); - - gl_FogFragCoord = pos.z; -} + vertex_color = calcLighting(pos.xyz, norm, diffuse_color, vec4(0.0)); +} diff --git a/indra/newview/app_settings/shaders/class1/objects/simpleNoColorV.glsl b/indra/newview/app_settings/shaders/class1/objects/simpleNoColorV.glsl new file mode 100644 index 0000000000..0be52a52af --- /dev/null +++ b/indra/newview/app_settings/shaders/class1/objects/simpleNoColorV.glsl @@ -0,0 +1,59 @@ +/** + * @file simpleNoColorV.glsl + * + * $LicenseInfo:firstyear=2007&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2007, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +uniform mat3 normal_matrix; +uniform mat4 texture_matrix0; +uniform mat4 modelview_matrix; +uniform mat4 modelview_projection_matrix; + +uniform vec4 color; + +ATTRIBUTE vec3 position; +ATTRIBUTE vec3 normal; +ATTRIBUTE vec2 texcoord0; + +VARYING vec4 vertex_color; +VARYING vec2 vary_texcoord0; + + +vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol); +void calcAtmospherics(vec3 inPositionEye); + +void main() +{ + //transform vertex + vec4 pos = (modelview_matrix * vec4(position.xyz, 1.0)); + gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0); + vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy; + + vec3 norm = normalize(normal_matrix * normal); + + calcAtmospherics(pos.xyz); + + vec4 col = calcLighting(pos.xyz, norm, color, vec4(0.)); + vertex_color = col; + + +} diff --git a/indra/newview/app_settings/shaders/class1/objects/simpleNonIndexedV.glsl b/indra/newview/app_settings/shaders/class1/objects/simpleNonIndexedV.glsl new file mode 100644 index 0000000000..cb80697d15 --- /dev/null +++ b/indra/newview/app_settings/shaders/class1/objects/simpleNonIndexedV.glsl @@ -0,0 +1,61 @@ +/** + * @file simpleNonIndexedV.glsl + * + * $LicenseInfo:firstyear=2007&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2007, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +uniform mat3 normal_matrix; +uniform mat4 texture_matrix0; +uniform mat4 modelview_matrix; +uniform mat4 modelview_projection_matrix; + +ATTRIBUTE vec3 position; +ATTRIBUTE vec2 texcoord0; +ATTRIBUTE vec3 normal; +ATTRIBUTE vec4 diffuse_color; + +VARYING vec4 vertex_color; +VARYING vec2 vary_texcoord0; + + +vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol); +void calcAtmospherics(vec3 inPositionEye); + +void main() +{ + //transform vertex + vec4 vert = vec4(position.xyz,1.0); + + gl_Position = modelview_projection_matrix*vert; + vary_texcoord0 = (texture_matrix0 * vec4(texcoord0, 0, 1)).xy; + + vec4 pos = (modelview_matrix * vert); + + vec3 norm = normalize(normal_matrix * normal); + + calcAtmospherics(pos.xyz); + + vec4 color = calcLighting(pos.xyz, norm, diffuse_color, vec4(0.)); + vertex_color = color; + + +} diff --git a/indra/newview/app_settings/shaders/class1/objects/simpleSkinnedV.glsl b/indra/newview/app_settings/shaders/class1/objects/simpleSkinnedV.glsl index ad171f7b43..1c6e53b187 100644 --- a/indra/newview/app_settings/shaders/class1/objects/simpleSkinnedV.glsl +++ b/indra/newview/app_settings/shaders/class1/objects/simpleSkinnedV.glsl @@ -22,6 +22,17 @@ * $/LicenseInfo$ */ +uniform mat4 texture_matrix0; +uniform mat4 modelview_matrix; +uniform mat4 projection_matrix; + +ATTRIBUTE vec3 position; +ATTRIBUTE vec3 normal; +ATTRIBUTE vec4 diffuse_color; +ATTRIBUTE vec2 texcoord0; + +VARYING vec4 vertex_color; +VARYING vec2 vary_texcoord0; vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol); @@ -31,24 +42,24 @@ mat4 getObjectSkinnedTransform(); void main() { //transform vertex - gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0; + vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy; mat4 mat = getObjectSkinnedTransform(); - mat = gl_ModelViewMatrix * mat; - vec3 pos = (mat*gl_Vertex).xyz; + mat = modelview_matrix * mat; + vec3 pos = (mat*vec4(position.xyz, 1.0)).xyz; - vec4 norm = gl_Vertex; - norm.xyz += gl_Normal.xyz; + vec4 norm = vec4(position.xyz, 1.0); + norm.xyz += normal.xyz; norm.xyz = (mat*norm).xyz; norm.xyz = normalize(norm.xyz-pos.xyz); calcAtmospherics(pos.xyz); - vec4 color = calcLighting(pos.xyz, norm.xyz, gl_Color, vec4(0.)); - gl_FrontColor = color; + vec4 color = calcLighting(pos.xyz, norm.xyz, diffuse_color, vec4(0.)); + vertex_color = color; + + gl_Position = projection_matrix*vec4(pos, 1.0); - gl_Position = gl_ProjectionMatrix*vec4(pos, 1.0); - gl_FogFragCoord = pos.z; } diff --git a/indra/newview/app_settings/shaders/class2/environment/terrainV.glsl b/indra/newview/app_settings/shaders/class1/objects/simpleTexGenV.glsl index 36d0c99b63..d4dee78793 100644 --- a/indra/newview/app_settings/shaders/class2/environment/terrainV.glsl +++ b/indra/newview/app_settings/shaders/class1/objects/simpleTexGenV.glsl @@ -1,5 +1,5 @@ -/** - * @file terrainV.glsl +/** + * @file simpleV.glsl * * $LicenseInfo:firstyear=2007&license=viewerlgpl$ * Second Life Viewer Source Code @@ -22,12 +22,26 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - +uniform mat3 normal_matrix; +uniform mat4 texture_matrix0; +uniform mat4 modelview_matrix; +uniform mat4 modelview_projection_matrix; -void calcAtmospherics(vec3 inPositionEye); +ATTRIBUTE vec3 position; +void passTextureIndex(); +ATTRIBUTE vec2 texcoord0; +ATTRIBUTE vec3 normal; + +uniform vec4 color; +uniform vec4 object_plane_t; +uniform vec4 object_plane_s; vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol); +void calcAtmospherics(vec3 inPositionEye); + +VARYING vec4 vertex_color; +VARYING vec2 vary_texcoord0; vec4 texgen_object(vec4 vpos, vec4 tc, mat4 mat, vec4 tp0, vec4 tp1) { @@ -46,27 +60,18 @@ vec4 texgen_object(vec4 vpos, vec4 tc, mat4 mat, vec4 tp0, vec4 tp1) void main() { //transform vertex - gl_Position = ftransform(); - - vec4 pos = gl_ModelViewMatrix * gl_Vertex; - vec3 norm = normalize(gl_NormalMatrix * gl_Normal); + vec4 vert = vec4(position.xyz,1.0); + passTextureIndex(); + vec4 pos = (modelview_matrix * vert); + gl_Position = modelview_projection_matrix*vec4(position.xyz, 1.0); + vary_texcoord0.xy = texgen_object(vec4(position.xyz, 1.0), vec4(texcoord0,0,1), texture_matrix0, object_plane_s, object_plane_t).xy; + + vec3 norm = normalize(normal_matrix * normal); - /// Potentially better without it for water. - pos /= pos.w; + calcAtmospherics(pos.xyz); - calcAtmospherics((gl_ModelViewMatrix * gl_Vertex).xyz); + vec4 color = calcLighting(pos.xyz, norm, color, vec4(0.)); + vertex_color = color; - vec4 color = calcLighting(pos.xyz, norm, gl_Color, vec4(0)); - gl_FrontColor = color; - - // Transform and pass tex coords - gl_TexCoord[0].xy = texgen_object(gl_Vertex, gl_MultiTexCoord0, gl_TextureMatrix[0], gl_ObjectPlaneS[0], gl_ObjectPlaneT[0]).xy; - - vec4 t = gl_MultiTexCoord1; - - gl_TexCoord[0].zw = t.xy; - gl_TexCoord[1].xy = t.xy-vec2(2.0, 0.0); - gl_TexCoord[1].zw = t.xy-vec2(1.0, 0.0); } - diff --git a/indra/newview/app_settings/shaders/class1/objects/simpleV.glsl b/indra/newview/app_settings/shaders/class1/objects/simpleV.glsl index dc1794e132..37a20383e2 100644 --- a/indra/newview/app_settings/shaders/class1/objects/simpleV.glsl +++ b/indra/newview/app_settings/shaders/class1/objects/simpleV.glsl @@ -22,26 +22,43 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - +uniform mat3 normal_matrix; +uniform mat4 texture_matrix0; +uniform mat4 modelview_matrix; +uniform mat4 modelview_projection_matrix; + +ATTRIBUTE vec3 position; +void passTextureIndex(); +ATTRIBUTE vec2 texcoord0; +ATTRIBUTE vec3 normal; +ATTRIBUTE vec4 diffuse_color; vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol); void calcAtmospherics(vec3 inPositionEye); + +VARYING vec4 vertex_color; +VARYING vec2 vary_texcoord0; + + void main() { //transform vertex - gl_Position = ftransform(); - gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0; + vec4 vert = vec4(position.xyz,1.0); + passTextureIndex(); + vec4 pos = (modelview_matrix * vert); + gl_Position = modelview_projection_matrix*vec4(position.xyz, 1.0); + vary_texcoord0 = (texture_matrix0 * vec4(texcoord0, 0, 1)).xy; + - vec4 pos = (gl_ModelViewMatrix * gl_Vertex); - vec3 norm = normalize(gl_NormalMatrix * gl_Normal); + vec3 norm = normalize(normal_matrix * normal); calcAtmospherics(pos.xyz); - vec4 color = calcLighting(pos.xyz, norm, gl_Color, vec4(0.)); - gl_FrontColor = color; + vec4 color = calcLighting(pos.xyz, norm, diffuse_color, vec4(0.)); + vertex_color = color; - gl_FogFragCoord = pos.z; + } diff --git a/indra/newview/app_settings/shaders/class2/objects/shinyV.glsl b/indra/newview/app_settings/shaders/class1/objects/treeV.glsl index 44c711701b..fa01a27ec0 100644 --- a/indra/newview/app_settings/shaders/class2/objects/shinyV.glsl +++ b/indra/newview/app_settings/shaders/class1/objects/treeV.glsl @@ -1,5 +1,5 @@ -/** - * @file shinyV.glsl +/** + * @file treeV.glsl * * $LicenseInfo:firstyear=2007&license=viewerlgpl$ * Second Life Viewer Source Code @@ -22,34 +22,39 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - +uniform mat3 normal_matrix; +uniform mat4 texture_matrix0; +uniform mat4 modelview_matrix; +uniform mat4 modelview_projection_matrix; -vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol); +ATTRIBUTE vec3 position; +ATTRIBUTE vec2 texcoord0; +ATTRIBUTE vec3 normal; +vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol); void calcAtmospherics(vec3 inPositionEye); -varying float vary_texture_index; +VARYING vec4 vertex_color; +VARYING vec2 vary_texcoord0; -uniform vec4 origin; void main() { //transform vertex - vec4 vert = vec4(gl_Vertex.xyz,1.0); - vary_texture_index = gl_Vertex.w; - gl_Position = gl_ModelViewProjectionMatrix*vert; + vec4 vert = vec4(position.xyz,1.0); - vec4 pos = (gl_ModelViewMatrix * vert); - vec3 norm = normalize(gl_NormalMatrix * gl_Normal); - vec3 ref = reflect(pos.xyz, -norm); - - gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0; - gl_TexCoord[1] = gl_TextureMatrix[1]*vec4(ref,1.0); + gl_Position = modelview_projection_matrix*vert; + vary_texcoord0 = (texture_matrix0 * vec4(texcoord0, 0, 1)).xy; + + vec4 pos = (modelview_matrix * vert); + + vec3 norm = normalize(normal_matrix * normal); calcAtmospherics(pos.xyz); - gl_FrontColor = calcLighting(pos.xyz, norm, gl_Color, vec4(0.0)); + vec4 color = calcLighting(pos.xyz, norm, vec4(1,1,1,1), vec4(0.)); + vertex_color = color; - gl_FogFragCoord = pos.z; + } diff --git a/indra/newview/app_settings/shaders/class1/windlight/atmosphericsHelpersV.glsl b/indra/newview/app_settings/shaders/class1/windlight/atmosphericsHelpersV.glsl index 15738e37e8..6ff860362c 100644 --- a/indra/newview/app_settings/shaders/class1/windlight/atmosphericsHelpersV.glsl +++ b/indra/newview/app_settings/shaders/class1/windlight/atmosphericsHelpersV.glsl @@ -23,21 +23,22 @@ * $/LicenseInfo$ */ - +uniform vec4 sunlight_color_copy; +uniform vec4 light_ambient; vec3 atmosAmbient(vec3 light) { - return gl_LightModel.ambient.rgb + light; + return light + light_ambient.rgb; } vec3 atmosAffectDirectionalLight(float lightIntensity) { - return gl_LightSource[0].diffuse.rgb * lightIntensity; + return sunlight_color_copy.rgb * lightIntensity; } vec3 atmosGetDiffuseSunlightColor() { - return gl_LightSource[0].diffuse.rgb; + return sunlight_color_copy.rgb; } vec3 scaleDownLight(vec3 light) diff --git a/indra/newview/app_settings/shaders/class1/windlight/atmosphericsVarsF.glsl b/indra/newview/app_settings/shaders/class1/windlight/atmosphericsVarsF.glsl index dbacf28637..8bdae328bd 100644 --- a/indra/newview/app_settings/shaders/class1/windlight/atmosphericsVarsF.glsl +++ b/indra/newview/app_settings/shaders/class1/windlight/atmosphericsVarsF.glsl @@ -24,10 +24,7 @@ */ - -varying vec3 vary_PositionEye; - vec3 getPositionEye() { - return vary_PositionEye; + return vec3(0,0,0); } diff --git a/indra/newview/app_settings/shaders/class1/windlight/atmosphericsVarsV.glsl b/indra/newview/app_settings/shaders/class1/windlight/atmosphericsVarsV.glsl index e051ac9851..8ec9ae617c 100644 --- a/indra/newview/app_settings/shaders/class1/windlight/atmosphericsVarsV.glsl +++ b/indra/newview/app_settings/shaders/class1/windlight/atmosphericsVarsV.glsl @@ -25,15 +25,12 @@ -varying vec3 vary_PositionEye; - - vec3 getPositionEye() { - return vary_PositionEye; + return vec3(0,0,0); } void setPositionEye(vec3 v) { - vary_PositionEye = v; + } diff --git a/indra/newview/app_settings/shaders/class2/effects/drawQuadV.glsl b/indra/newview/app_settings/shaders/class1/windlight/atmosphericsVarsWaterF.glsl index 25806cd914..636d4af006 100644 --- a/indra/newview/app_settings/shaders/class2/effects/drawQuadV.glsl +++ b/indra/newview/app_settings/shaders/class1/windlight/atmosphericsVarsWaterF.glsl @@ -1,5 +1,5 @@ -/** - * @file drawQuadV.glsl +/** + * @file atmosphericVarsWaterF.glsl * * $LicenseInfo:firstyear=2007&license=viewerlgpl$ * Second Life Viewer Source Code @@ -24,11 +24,10 @@ */ +VARYING vec3 vary_PositionEye; -void main(void) +vec3 getPositionEye() { - //transform vertex - gl_Position = ftransform(); - gl_TexCoord[0] = gl_MultiTexCoord0; - gl_TexCoord[1] = gl_MultiTexCoord1; + return vary_PositionEye; } + diff --git a/indra/newview/app_settings/shaders/class2/effects/simpleF.glsl b/indra/newview/app_settings/shaders/class1/windlight/atmosphericsVarsWaterV.glsl index abf1be6645..8afcc20f6d 100644 --- a/indra/newview/app_settings/shaders/class2/effects/simpleF.glsl +++ b/indra/newview/app_settings/shaders/class1/windlight/atmosphericsVarsWaterV.glsl @@ -1,5 +1,5 @@ -/** - * @file simpleF.glsl +/** + * @file atmosphericVarsWaterV.glsl * * $LicenseInfo:firstyear=2007&license=viewerlgpl$ * Second Life Viewer Source Code @@ -23,12 +23,15 @@ * $/LicenseInfo$ */ + +VARYING vec3 vary_PositionEye; +vec3 getPositionEye() +{ + return vary_PositionEye; +} -uniform sampler2DRect RenderTexture; - -void main(void) +void setPositionEye(vec3 v) { - vec3 color = vec3(texture2DRect(RenderTexture, gl_TexCoord[0].st)); - gl_FragColor = vec4(1.0 - color, 1.0); + vary_PositionEye = v; } diff --git a/indra/newview/app_settings/shaders/class2/avatar/eyeballV.glsl b/indra/newview/app_settings/shaders/class2/avatar/eyeballV.glsl index f9f376c2b7..5af9f5c902 100644 --- a/indra/newview/app_settings/shaders/class2/avatar/eyeballV.glsl +++ b/indra/newview/app_settings/shaders/class2/avatar/eyeballV.glsl @@ -22,7 +22,19 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - + +uniform mat3 normal_matrix; +uniform mat4 texture_matrix0; +uniform mat4 modelview_matrix; +uniform mat4 modelview_projection_matrix; + +ATTRIBUTE vec3 position; +ATTRIBUTE vec4 diffuse_color; +ATTRIBUTE vec3 normal; +ATTRIBUTE vec2 texcoord0; + +VARYING vec4 vertex_color; +VARYING vec2 vary_texcoord0; vec4 calcLightingSpecular(vec3 pos, vec3 norm, vec4 color, inout vec4 specularColor, vec4 baseCol); @@ -31,20 +43,20 @@ void calcAtmospherics(vec3 inPositionEye); void main() { //transform vertex - gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; - gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0; - - vec3 pos = (gl_ModelViewMatrix * gl_Vertex).xyz; - vec3 norm = normalize(gl_NormalMatrix * gl_Normal); + vec3 pos = (modelview_matrix * vec4(position.xyz, 1.0)).xyz; + gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0); + vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy; + + vec3 norm = normalize(normal_matrix * normal); calcAtmospherics(pos.xyz); // vec4 specular = specularColor; vec4 specular = vec4(1.0); - vec4 color = calcLightingSpecular(pos, norm, gl_Color, specular, vec4(0.0)); + vec4 color = calcLightingSpecular(pos, norm, diffuse_color, specular, vec4(0.0)); - gl_FrontColor = color; - gl_FogFragCoord = pos.z; + vertex_color = color; + } diff --git a/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl b/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl index 839606cdcb..1179b212ae 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl @@ -22,11 +22,16 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - - #extension GL_ARB_texture_rectangle : enable +#ifdef DEFINE_GL_FRAGCOLOR +out vec4 gl_FragColor; +#endif + +VARYING vec4 vertex_color; +VARYING vec2 vary_texcoord0; + uniform sampler2DRectShadow shadowMap0; uniform sampler2DRectShadow shadowMap1; uniform sampler2DRectShadow shadowMap2; @@ -41,29 +46,16 @@ uniform vec2 shadow_res; vec3 atmosLighting(vec3 light); vec3 scaleSoftClip(vec3 light); -varying vec3 vary_ambient; -varying vec3 vary_directional; -varying vec3 vary_fragcoord; -varying vec3 vary_position; -varying vec3 vary_pointlight_col; +VARYING vec3 vary_ambient; +VARYING vec3 vary_directional; +VARYING vec3 vary_fragcoord; +VARYING vec3 vary_position; +VARYING vec3 vary_pointlight_col; uniform float shadow_bias; uniform mat4 inv_proj; -vec4 getPosition(vec2 pos_screen) -{ - float depth = texture2DRect(depthMap, pos_screen.xy).a; - vec2 sc = pos_screen.xy*2.0; - sc /= screen_res; - sc -= vec2(1.0,1.0); - vec4 ndc = vec4(sc.x, sc.y, 2.0*depth-1.0, 1.0); - vec4 pos = inv_proj * ndc; - pos.xyz /= pos.w; - pos.w = 1.0; - return pos; -} - float pcfShadow(sampler2DRectShadow shadowMap, vec4 stc, float scl) { stc.xyz /= stc.w; @@ -122,9 +114,9 @@ void main() } } - vec4 diff = diffuseLookup(gl_TexCoord[0].xy); + vec4 diff = diffuseLookup(vary_texcoord0.xy); - vec4 col = vec4(vary_ambient + vary_directional.rgb*shadow, gl_Color.a); + vec4 col = vec4(vary_ambient + vary_directional.rgb*shadow, vertex_color.a); vec4 color = diff * col; color.rgb = atmosLighting(color.rgb); @@ -133,10 +125,6 @@ void main() color.rgb += diff.rgb * vary_pointlight_col.rgb; - //gl_FragColor = gl_Color; gl_FragColor = color; - //gl_FragColor.r = 0.0; - //gl_FragColor = vec4(1,shadow,1,1); - } diff --git a/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedF.glsl b/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedF.glsl index 84e49a5f8f..0df557f2aa 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedF.glsl @@ -23,10 +23,12 @@ * $/LicenseInfo$ */ - - #extension GL_ARB_texture_rectangle : enable +#ifdef DEFINE_GL_FRAGCOLOR +out vec4 gl_FragColor; +#endif + uniform sampler2DRectShadow shadowMap0; uniform sampler2DRectShadow shadowMap1; uniform sampler2DRectShadow shadowMap2; @@ -42,11 +44,13 @@ uniform vec2 shadow_res; vec3 atmosLighting(vec3 light); vec3 scaleSoftClip(vec3 light); -varying vec3 vary_ambient; -varying vec3 vary_directional; -varying vec3 vary_fragcoord; -varying vec3 vary_position; -varying vec3 vary_pointlight_col; +VARYING vec3 vary_ambient; +VARYING vec3 vary_directional; +VARYING vec3 vary_fragcoord; +VARYING vec3 vary_position; +VARYING vec3 vary_pointlight_col; +VARYING vec2 vary_texcoord0; +VARYING vec4 vertex_color; uniform float shadow_bias; @@ -123,9 +127,9 @@ void main() } } - vec4 diff = texture2D(diffuseMap,gl_TexCoord[0].xy); + vec4 diff = texture2D(diffuseMap,vary_texcoord0.xy); - vec4 col = vec4(vary_ambient + vary_directional.rgb*shadow, gl_Color.a); + vec4 col = vec4(vary_ambient + vary_directional.rgb*shadow, vertex_color.a); vec4 color = diff * col; color.rgb = atmosLighting(color.rgb); @@ -134,10 +138,6 @@ void main() color.rgb += diff.rgb * vary_pointlight_col.rgb; - //gl_FragColor = gl_Color; - gl_FragColor = color; - //gl_FragColor.r = 0.0; - //gl_FragColor = vec4(1,shadow,1,1); - + gl_FragColor = color; } diff --git a/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedNoColorF.glsl b/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedNoColorF.glsl new file mode 100644 index 0000000000..331dbc7079 --- /dev/null +++ b/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedNoColorF.glsl @@ -0,0 +1,142 @@ +/** + * @file alphaNonIndexedNoColorF.glsl + * + * $LicenseInfo:firstyear=2005&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2005, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#extension GL_ARB_texture_rectangle : enable + +#ifdef DEFINE_GL_FRAGCOLOR +out vec4 gl_FragColor; +#endif + +uniform sampler2DRectShadow shadowMap0; +uniform sampler2DRectShadow shadowMap1; +uniform sampler2DRectShadow shadowMap2; +uniform sampler2DRectShadow shadowMap3; +uniform sampler2DRect depthMap; +uniform sampler2D diffuseMap; + +uniform mat4 shadow_matrix[6]; +uniform vec4 shadow_clip; +uniform vec2 screen_res; +uniform vec2 shadow_res; + +vec3 atmosLighting(vec3 light); +vec3 scaleSoftClip(vec3 light); + +VARYING vec3 vary_ambient; +VARYING vec3 vary_directional; +VARYING vec3 vary_fragcoord; +VARYING vec3 vary_position; +VARYING vec3 vary_pointlight_col; +VARYING vec2 vary_texcoord0; + +uniform float shadow_bias; + +uniform mat4 inv_proj; + +vec4 getPosition(vec2 pos_screen) +{ + float depth = texture2DRect(depthMap, pos_screen.xy).a; + vec2 sc = pos_screen.xy*2.0; + sc /= screen_res; + sc -= vec2(1.0,1.0); + vec4 ndc = vec4(sc.x, sc.y, 2.0*depth-1.0, 1.0); + vec4 pos = inv_proj * ndc; + pos.xyz /= pos.w; + pos.w = 1.0; + return pos; +} + +float pcfShadow(sampler2DRectShadow shadowMap, vec4 stc, float scl) +{ + stc.xyz /= stc.w; + stc.z += shadow_bias; + + float cs = shadow2DRect(shadowMap, stc.xyz).x; + float shadow = cs; + + shadow += max(shadow2DRect(shadowMap, stc.xyz+vec3(scl, scl, 0.0)).x, cs); + shadow += max(shadow2DRect(shadowMap, stc.xyz+vec3(scl, -scl, 0.0)).x, cs); + shadow += max(shadow2DRect(shadowMap, stc.xyz+vec3(-scl, scl, 0.0)).x, cs); + shadow += max(shadow2DRect(shadowMap, stc.xyz+vec3(-scl, -scl, 0.0)).x, cs); + + return shadow/5.0; +} + + +void main() +{ + vec2 frag = vary_fragcoord.xy/vary_fragcoord.z*0.5+0.5; + frag *= screen_res; + + float shadow = 1.0; + vec4 pos = vec4(vary_position, 1.0); + + vec4 spos = pos; + + if (spos.z > -shadow_clip.w) + { + vec4 lpos; + + if (spos.z < -shadow_clip.z) + { + lpos = shadow_matrix[3]*spos; + lpos.xy *= shadow_res; + shadow = pcfShadow(shadowMap3, lpos, 1.5); + shadow += max((pos.z+shadow_clip.z)/(shadow_clip.z-shadow_clip.w)*2.0-1.0, 0.0); + } + else if (spos.z < -shadow_clip.y) + { + lpos = shadow_matrix[2]*spos; + lpos.xy *= shadow_res; + shadow = pcfShadow(shadowMap2, lpos, 1.5); + } + else if (spos.z < -shadow_clip.x) + { + lpos = shadow_matrix[1]*spos; + lpos.xy *= shadow_res; + shadow = pcfShadow(shadowMap1, lpos, 1.5); + } + else + { + lpos = shadow_matrix[0]*spos; + lpos.xy *= shadow_res; + shadow = pcfShadow(shadowMap0, lpos, 1.5); + } + } + + vec4 diff = texture2D(diffuseMap,vary_texcoord0.xy); + + vec4 col = vec4(vary_ambient + vary_directional.rgb*shadow, 1.0); + vec4 color = diff * col; + + color.rgb = atmosLighting(color.rgb); + + color.rgb = scaleSoftClip(color.rgb); + + color.rgb += diff.rgb * vary_pointlight_col.rgb; + + gl_FragColor = color; +} + diff --git a/indra/newview/app_settings/shaders/class2/deferred/alphaSkinnedV.glsl b/indra/newview/app_settings/shaders/class2/deferred/alphaSkinnedV.glsl index 20121da52d..5a3955ef00 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/alphaSkinnedV.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/alphaSkinnedV.glsl @@ -21,8 +21,16 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - +uniform mat4 projection_matrix; +uniform mat4 texture_matrix0; +uniform mat4 modelview_matrix; +uniform mat4 modelview_projection_matrix; + +ATTRIBUTE vec3 position; +ATTRIBUTE vec3 normal; +ATTRIBUTE vec4 diffuse_color; +ATTRIBUTE vec2 texcoord0; vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol); void calcAtmospherics(vec3 inPositionEye); @@ -34,16 +42,25 @@ vec3 atmosAffectDirectionalLight(float lightIntensity); vec3 scaleDownLight(vec3 light); vec3 scaleUpLight(vec3 light); -varying vec3 vary_ambient; -varying vec3 vary_directional; -varying vec3 vary_fragcoord; -varying vec3 vary_position; -varying vec3 vary_pointlight_col; +VARYING vec3 vary_ambient; +VARYING vec3 vary_directional; +VARYING vec3 vary_fragcoord; +VARYING vec3 vary_position; +VARYING vec3 vary_pointlight_col; + +VARYING vec4 vertex_color; +VARYING vec2 vary_texcoord0; + uniform float near_clip; uniform float shadow_offset; uniform float shadow_bias; +uniform vec4 light_position[8]; +uniform vec3 light_direction[8]; +uniform vec3 light_attenuation[8]; +uniform vec3 light_diffuse[8]; + float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float fa, float is_pointlight) { //get light vector @@ -76,56 +93,56 @@ float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, floa void main() { - gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0; + vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy; mat4 mat = getObjectSkinnedTransform(); - mat = gl_ModelViewMatrix * mat; + mat = modelview_matrix * mat; - vec3 pos = (mat*gl_Vertex).xyz; + vec3 pos = (mat*vec4(position, 1.0)).xyz; - gl_Position = gl_ProjectionMatrix * vec4(pos, 1.0); + gl_Position = projection_matrix * vec4(pos, 1.0); - vec4 n = gl_Vertex; - n.xyz += gl_Normal.xyz; + vec4 n = vec4(position, 1.0); + n.xyz += normal.xyz; n.xyz = (mat*n).xyz; n.xyz = normalize(n.xyz-pos.xyz); vec3 norm = n.xyz; - float dp_directional_light = max(0.0, dot(norm, gl_LightSource[0].position.xyz)); - vary_position = pos.xyz + gl_LightSource[0].position.xyz * (1.0-dp_directional_light)*shadow_offset; + float dp_directional_light = max(0.0, dot(norm, light_position[0].xyz)); + vary_position = pos.xyz + light_position[0].xyz * (1.0-dp_directional_light)*shadow_offset; calcAtmospherics(pos.xyz); - //vec4 color = calcLighting(pos.xyz, norm, gl_Color, vec4(0.)); - vec4 col = vec4(0.0, 0.0, 0.0, gl_Color.a); + //vec4 color = calcLighting(pos.xyz, norm, diffuse_color, vec4(0.)); + vec4 col = vec4(0.0, 0.0, 0.0, diffuse_color.a); // Collect normal lights - col.rgb += gl_LightSource[2].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[2].position, gl_LightSource[2].spotDirection.xyz, gl_LightSource[2].linearAttenuation, gl_LightSource[2].quadraticAttenuation, gl_LightSource[2].specular.a); - col.rgb += gl_LightSource[3].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[3].position, gl_LightSource[3].spotDirection.xyz, gl_LightSource[3].linearAttenuation, gl_LightSource[3].quadraticAttenuation ,gl_LightSource[3].specular.a); - col.rgb += gl_LightSource[4].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[4].position, gl_LightSource[4].spotDirection.xyz, gl_LightSource[4].linearAttenuation, gl_LightSource[4].quadraticAttenuation, gl_LightSource[4].specular.a); - col.rgb += gl_LightSource[5].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[5].position, gl_LightSource[5].spotDirection.xyz, gl_LightSource[5].linearAttenuation, gl_LightSource[5].quadraticAttenuation, gl_LightSource[5].specular.a); - col.rgb += gl_LightSource[6].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[6].position, gl_LightSource[6].spotDirection.xyz, gl_LightSource[6].linearAttenuation, gl_LightSource[6].quadraticAttenuation, gl_LightSource[6].specular.a); - col.rgb += gl_LightSource[7].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[7].position, gl_LightSource[7].spotDirection.xyz, gl_LightSource[7].linearAttenuation, gl_LightSource[7].quadraticAttenuation, gl_LightSource[7].specular.a); + col.rgb += light_diffuse[2].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[2], light_direction[2], light_attenuation[2].x, light_attenuation[2].y, light_attenuation[2].z); + col.rgb += light_diffuse[3].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[3], light_direction[3], light_attenuation[3].x, light_attenuation[3].y, light_attenuation[3].z); + col.rgb += light_diffuse[4].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[4], light_direction[4], light_attenuation[4].x, light_attenuation[4].y, light_attenuation[4].z); + col.rgb += light_diffuse[5].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[5], light_direction[5], light_attenuation[5].x, light_attenuation[5].y, light_attenuation[5].z); + col.rgb += light_diffuse[6].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[6], light_direction[6], light_attenuation[6].x, light_attenuation[6].y, light_attenuation[6].z); + col.rgb += light_diffuse[7].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[7], light_direction[7], light_attenuation[7].x, light_attenuation[7].y, light_attenuation[7].z); - vary_pointlight_col = col.rgb*gl_Color.rgb; + vary_pointlight_col = col.rgb*diffuse_color.rgb; col.rgb = vec3(0,0,0); // Add windlight lights col.rgb = atmosAmbient(vec3(0.)); - vary_ambient = col.rgb*gl_Color.rgb; - vary_directional.rgb = gl_Color.rgb*atmosAffectDirectionalLight(max(calcDirectionalLight(norm, gl_LightSource[0].position.xyz), (1.0-gl_Color.a)*(1.0-gl_Color.a))); + vary_ambient = col.rgb*diffuse_color.rgb; + vary_directional.rgb = diffuse_color.rgb*atmosAffectDirectionalLight(max(calcDirectionalLight(norm, light_position[0].xyz), (1.0-diffuse_color.a)*(1.0-diffuse_color.a))); - col.rgb = min(col.rgb*gl_Color.rgb, 1.0); + col.rgb = min(col.rgb*diffuse_color.rgb, 1.0); - gl_FrontColor = col; + vertex_color = col; - gl_FogFragCoord = pos.z; - pos.xyz = (gl_ModelViewProjectionMatrix * gl_Vertex).xyz; + + pos.xyz = (modelview_projection_matrix * vec4(position.xyz, 1.0)).xyz; vary_fragcoord.xyz = pos.xyz + vec3(0,0,near_clip); } diff --git a/indra/newview/app_settings/shaders/class2/deferred/alphaV.glsl b/indra/newview/app_settings/shaders/class2/deferred/alphaV.glsl index 307ae30098..9540ddd2e8 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/alphaV.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/alphaV.glsl @@ -22,8 +22,17 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - +uniform mat3 normal_matrix; +uniform mat4 texture_matrix0; +uniform mat4 modelview_matrix; +uniform mat4 modelview_projection_matrix; + +ATTRIBUTE vec3 position; +void passTextureIndex(); +ATTRIBUTE vec3 normal; +ATTRIBUTE vec4 diffuse_color; +ATTRIBUTE vec2 texcoord0; vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol); void calcAtmospherics(vec3 inPositionEye); @@ -35,17 +44,25 @@ vec3 atmosAffectDirectionalLight(float lightIntensity); vec3 scaleDownLight(vec3 light); vec3 scaleUpLight(vec3 light); -varying vec3 vary_ambient; -varying vec3 vary_directional; -varying vec3 vary_fragcoord; -varying vec3 vary_position; -varying vec3 vary_pointlight_col; -varying float vary_texture_index; +VARYING vec3 vary_ambient; +VARYING vec3 vary_directional; +VARYING vec3 vary_fragcoord; +VARYING vec3 vary_position; +VARYING vec3 vary_pointlight_col; + +VARYING vec4 vertex_color; +VARYING vec2 vary_texcoord0; + uniform float near_clip; uniform float shadow_offset; uniform float shadow_bias; +uniform vec4 light_position[8]; +uniform vec3 light_direction[8]; +uniform vec3 light_attenuation[8]; +uniform vec3 light_diffuse[8]; + float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float fa, float is_pointlight) { //get light vector @@ -79,48 +96,49 @@ float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, floa void main() { //transform vertex - vec4 vert = vec4(gl_Vertex.xyz, 1.0); - vary_texture_index = gl_Vertex.w; - gl_Position = gl_ModelViewProjectionMatrix * vert; - - gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0; + vec4 vert = vec4(position.xyz, 1.0); + passTextureIndex(); + vec4 pos = (modelview_matrix * vert); + gl_Position = modelview_projection_matrix*vec4(position.xyz, 1.0); - vec4 pos = (gl_ModelViewMatrix * vert); - vec3 norm = normalize(gl_NormalMatrix * gl_Normal); + vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy; + + vec3 norm = normalize(normal_matrix * normal); - float dp_directional_light = max(0.0, dot(norm, gl_LightSource[0].position.xyz)); - vary_position = pos.xyz + gl_LightSource[0].position.xyz * (1.0-dp_directional_light)*shadow_offset; + float dp_directional_light = max(0.0, dot(norm, light_position[0].xyz)); + vary_position = pos.xyz + light_position[0].xyz * (1.0-dp_directional_light)*shadow_offset; calcAtmospherics(pos.xyz); - //vec4 color = calcLighting(pos.xyz, norm, gl_Color, vec4(0.)); - vec4 col = vec4(0.0, 0.0, 0.0, gl_Color.a); + //vec4 color = calcLighting(pos.xyz, norm, diffuse_color, vec4(0.)); + vec4 col = vec4(0.0, 0.0, 0.0, diffuse_color.a); - // Collect normal lights - col.rgb += gl_LightSource[2].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[2].position, gl_LightSource[2].spotDirection.xyz, gl_LightSource[2].linearAttenuation, gl_LightSource[2].quadraticAttenuation, gl_LightSource[2].specular.a); - col.rgb += gl_LightSource[3].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[3].position, gl_LightSource[3].spotDirection.xyz, gl_LightSource[3].linearAttenuation, gl_LightSource[3].quadraticAttenuation ,gl_LightSource[3].specular.a); - col.rgb += gl_LightSource[4].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[4].position, gl_LightSource[4].spotDirection.xyz, gl_LightSource[4].linearAttenuation, gl_LightSource[4].quadraticAttenuation, gl_LightSource[4].specular.a); - col.rgb += gl_LightSource[5].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[5].position, gl_LightSource[5].spotDirection.xyz, gl_LightSource[5].linearAttenuation, gl_LightSource[5].quadraticAttenuation, gl_LightSource[5].specular.a); - col.rgb += gl_LightSource[6].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[6].position, gl_LightSource[6].spotDirection.xyz, gl_LightSource[6].linearAttenuation, gl_LightSource[6].quadraticAttenuation, gl_LightSource[6].specular.a); - col.rgb += gl_LightSource[7].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[7].position, gl_LightSource[7].spotDirection.xyz, gl_LightSource[7].linearAttenuation, gl_LightSource[7].quadraticAttenuation, gl_LightSource[7].specular.a); - vary_pointlight_col = col.rgb*gl_Color.rgb; + // Collect normal lights + col.rgb += light_diffuse[2].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[2], light_direction[2], light_attenuation[2].x, light_attenuation[2].y, light_attenuation[2].z); + col.rgb += light_diffuse[3].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[3], light_direction[3], light_attenuation[3].x, light_attenuation[3].y, light_attenuation[3].z); + col.rgb += light_diffuse[4].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[4], light_direction[4], light_attenuation[4].x, light_attenuation[4].y, light_attenuation[4].z); + col.rgb += light_diffuse[5].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[5], light_direction[5], light_attenuation[5].x, light_attenuation[5].y, light_attenuation[5].z); + col.rgb += light_diffuse[6].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[6], light_direction[6], light_attenuation[6].x, light_attenuation[6].y, light_attenuation[6].z); + col.rgb += light_diffuse[7].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[7], light_direction[7], light_attenuation[7].x, light_attenuation[7].y, light_attenuation[7].z); + + vary_pointlight_col = col.rgb*diffuse_color.rgb; col.rgb = vec3(0,0,0); // Add windlight lights col.rgb = atmosAmbient(vec3(0.)); - vary_ambient = col.rgb*gl_Color.rgb; - vary_directional.rgb = gl_Color.rgb*atmosAffectDirectionalLight(max(calcDirectionalLight(norm, gl_LightSource[0].position.xyz), (1.0-gl_Color.a)*(1.0-gl_Color.a))); + vary_ambient = col.rgb*diffuse_color.rgb; + vary_directional.rgb = diffuse_color.rgb*atmosAffectDirectionalLight(max(calcDirectionalLight(norm, light_position[0].xyz), (1.0-diffuse_color.a)*(1.0-diffuse_color.a))); - col.rgb = col.rgb*gl_Color.rgb; + col.rgb = col.rgb*diffuse_color.rgb; - gl_FrontColor = col; + vertex_color = col; - gl_FogFragCoord = pos.z; - pos = gl_ModelViewProjectionMatrix * vert; + + pos = modelview_projection_matrix * vert; vary_fragcoord.xyz = pos.xyz + vec3(0,0,near_clip); } diff --git a/indra/newview/app_settings/shaders/class2/deferred/avatarAlphaV.glsl b/indra/newview/app_settings/shaders/class2/deferred/avatarAlphaV.glsl index 80f386ecb0..9c7a332417 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/avatarAlphaV.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/avatarAlphaV.glsl @@ -23,7 +23,11 @@ * $/LicenseInfo$ */ +uniform mat4 projection_matrix; +ATTRIBUTE vec3 position; +ATTRIBUTE vec3 normal; +ATTRIBUTE vec2 texcoord0; vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol); mat4 getSkinnedTransform(); @@ -37,16 +41,25 @@ vec3 atmosAffectDirectionalLight(float lightIntensity); vec3 scaleDownLight(vec3 light); vec3 scaleUpLight(vec3 light); -varying vec3 vary_position; -varying vec3 vary_ambient; -varying vec3 vary_directional; -varying vec3 vary_fragcoord; -varying vec3 vary_pointlight_col; +VARYING vec3 vary_position; +VARYING vec3 vary_ambient; +VARYING vec3 vary_directional; +VARYING vec3 vary_fragcoord; +VARYING vec3 vary_pointlight_col; +VARYING vec4 vertex_color; +VARYING vec2 vary_texcoord0; + +uniform vec4 color; uniform float near_clip; uniform float shadow_offset; uniform float shadow_bias; +uniform vec4 light_position[8]; +uniform vec3 light_direction[8]; +uniform vec3 light_attenuation[8]; +uniform vec3 light_diffuse[8]; + float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float fa, float is_pointlight) { //get light vector @@ -79,56 +92,55 @@ float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, floa void main() { - gl_TexCoord[0] = gl_MultiTexCoord0; + vary_texcoord0 = texcoord0; vec4 pos; vec3 norm; mat4 trans = getSkinnedTransform(); - pos.x = dot(trans[0], gl_Vertex); - pos.y = dot(trans[1], gl_Vertex); - pos.z = dot(trans[2], gl_Vertex); + vec4 pos_in = vec4(position.xyz, 1.0); + pos.x = dot(trans[0], pos_in); + pos.y = dot(trans[1], pos_in); + pos.z = dot(trans[2], pos_in); pos.w = 1.0; - norm.x = dot(trans[0].xyz, gl_Normal); - norm.y = dot(trans[1].xyz, gl_Normal); - norm.z = dot(trans[2].xyz, gl_Normal); + norm.x = dot(trans[0].xyz, normal); + norm.y = dot(trans[1].xyz, normal); + norm.z = dot(trans[2].xyz, normal); norm = normalize(norm); - gl_Position = gl_ProjectionMatrix * pos; + gl_Position = projection_matrix * pos; - float dp_directional_light = max(0.0, dot(norm, gl_LightSource[0].position.xyz)); - vary_position = pos.xyz + gl_LightSource[0].position.xyz * (1.0-dp_directional_light)*shadow_offset; + float dp_directional_light = max(0.0, dot(norm, light_position[0].xyz)); + vary_position = pos.xyz + light_position[0].xyz * (1.0-dp_directional_light)*shadow_offset; calcAtmospherics(pos.xyz); - //vec4 color = calcLighting(pos.xyz, norm, gl_Color, vec4(0.)); - - vec4 col = vec4(0.0, 0.0, 0.0, gl_Color.a); + vec4 col = vec4(0.0, 0.0, 0.0, 1.0); // Collect normal lights - col.rgb += gl_LightSource[2].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[2].position, gl_LightSource[2].spotDirection.xyz, gl_LightSource[2].linearAttenuation, gl_LightSource[2].quadraticAttenuation, gl_LightSource[2].specular.a); - col.rgb += gl_LightSource[3].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[3].position, gl_LightSource[3].spotDirection.xyz, gl_LightSource[3].linearAttenuation, gl_LightSource[3].quadraticAttenuation ,gl_LightSource[3].specular.a); - col.rgb += gl_LightSource[4].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[4].position, gl_LightSource[4].spotDirection.xyz, gl_LightSource[4].linearAttenuation, gl_LightSource[4].quadraticAttenuation, gl_LightSource[4].specular.a); - col.rgb += gl_LightSource[5].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[5].position, gl_LightSource[5].spotDirection.xyz, gl_LightSource[5].linearAttenuation, gl_LightSource[5].quadraticAttenuation, gl_LightSource[5].specular.a); - col.rgb += gl_LightSource[6].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[6].position, gl_LightSource[6].spotDirection.xyz, gl_LightSource[6].linearAttenuation, gl_LightSource[6].quadraticAttenuation, gl_LightSource[6].specular.a); - col.rgb += gl_LightSource[7].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[7].position, gl_LightSource[7].spotDirection.xyz, gl_LightSource[7].linearAttenuation, gl_LightSource[7].quadraticAttenuation, gl_LightSource[7].specular.a); + col.rgb += light_diffuse[2].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[2], light_direction[2], light_attenuation[2].x, light_attenuation[2].y, light_attenuation[2].z); + col.rgb += light_diffuse[3].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[3], light_direction[3], light_attenuation[3].x, light_attenuation[3].y, light_attenuation[3].z); + col.rgb += light_diffuse[4].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[4], light_direction[4], light_attenuation[4].x, light_attenuation[4].y, light_attenuation[4].z); + col.rgb += light_diffuse[5].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[5], light_direction[5], light_attenuation[5].x, light_attenuation[5].y, light_attenuation[5].z); + col.rgb += light_diffuse[6].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[6], light_direction[6], light_attenuation[6].x, light_attenuation[6].y, light_attenuation[6].z); + col.rgb += light_diffuse[7].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[7], light_direction[7], light_attenuation[7].x, light_attenuation[7].y, light_attenuation[7].z); - vary_pointlight_col = col.rgb*gl_Color.rgb; + vary_pointlight_col = col.rgb*color.rgb; col.rgb = vec3(0,0,0); // Add windlight lights col.rgb = atmosAmbient(vec3(0.)); - vary_ambient = col.rgb*gl_Color.rgb; - vary_directional = gl_Color.rgb*atmosAffectDirectionalLight(max(calcDirectionalLight(norm, gl_LightSource[0].position.xyz), (1.0-gl_Color.a)*(1.0-gl_Color.a))); + vary_ambient = col.rgb*color.rgb; + vary_directional = atmosAffectDirectionalLight(max(calcDirectionalLight(norm, light_position[0].xyz), 0.0)); - col.rgb = min(col.rgb*gl_Color.rgb, 1.0); + col.rgb = col.rgb*color.rgb; - gl_FrontColor = col; + vertex_color = col; - gl_FogFragCoord = pos.z; + vary_fragcoord.xyz = pos.xyz + vec3(0,0,near_clip); } diff --git a/indra/newview/app_settings/shaders/class2/deferred/edgeMSF.glsl b/indra/newview/app_settings/shaders/class2/deferred/edgeMSF.glsl deleted file mode 100644 index a84fdd5dc1..0000000000 --- a/indra/newview/app_settings/shaders/class2/deferred/edgeMSF.glsl +++ /dev/null @@ -1,92 +0,0 @@ -/** - * @file edgeF.glsl - * - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2007, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - - - -#extension GL_ARB_texture_rectangle : enable -#extension GL_ARB_texture_multisample : enable - -uniform sampler2DMS depthMap; -uniform sampler2DMS normalMap; - -varying vec2 vary_fragcoord; - -uniform float depth_cutoff; -uniform float norm_cutoff; - -uniform mat4 inv_proj; -uniform vec2 screen_res; - -float getDepth(ivec2 pos_screen, int sample) -{ - float z = texelFetch(depthMap, pos_screen, sample).r; - z = z*2.0-1.0; - vec4 ndc = vec4(0.0, 0.0, z, 1.0); - vec4 p = inv_proj*ndc; - return p.z/p.w; -} - -void main() -{ - float e = 0; - - ivec2 itc = ivec2(vary_fragcoord.xy); - - for (int i = 0; i < samples; i++) - { - vec3 norm = texelFetch(normalMap, itc, i).xyz; - norm = vec3((norm.xy-0.5)*2.0,norm.z); // unpack norm - float depth = getDepth(itc, i); - - vec2 tc = vary_fragcoord.xy; - - int sc = 1; - - vec2 de; - de.x = (depth-getDepth(itc+ivec2(sc, sc),i)) + (depth-getDepth(itc+ivec2(-sc, -sc), i)); - de.y = (depth-getDepth(itc+ivec2(-sc, sc),i)) + (depth-getDepth(itc+ivec2(sc, -sc), i)); - de /= depth; - de *= de; - de = step(depth_cutoff, de); - - vec2 ne; - vec3 nexnorm = texelFetch(normalMap, itc+ivec2(-sc,-sc), i).rgb; - nexnorm = vec3((nexnorm.xy-0.5)*2.0,nexnorm.z); // unpack norm - ne.x = dot(nexnorm, norm); - vec3 neynorm = texelFetch(normalMap, itc+ivec2(sc,sc), i).rgb; - neynorm = vec3((neynorm.xy-0.5)*2.0,neynorm.z); // unpack norm - ne.y = dot(neynorm, norm); - - ne = 1.0-ne; - - ne = step(norm_cutoff, ne); - - e += dot(de,de)+dot(ne,ne); - } - - e /= samples; - - gl_FragColor.a = e; -} diff --git a/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl index 0b31cbefd1..14a683971a 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl @@ -22,11 +22,13 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - - - + #extension GL_ARB_texture_rectangle : enable +#ifdef DEFINE_GL_FRAGCOLOR +out vec4 gl_FragColor; +#endif + uniform sampler2DRect diffuseRect; uniform sampler2DRect specularRect; uniform sampler2DRect depthMap; @@ -34,7 +36,6 @@ uniform sampler2DRect normalMap; uniform samplerCube environmentMap; uniform sampler2DRect lightMap; uniform sampler2D noiseMap; -uniform sampler2D lightFunc; uniform sampler2D projectionMap; uniform mat4 proj_mat; //screen space to light space @@ -54,9 +55,12 @@ uniform float sun_wash; uniform int proj_shadow_idx; uniform float shadow_fade; -varying vec4 vary_light; +uniform vec3 center; +uniform float size; +uniform vec3 color; +uniform float falloff; -varying vec4 vary_fragcoord; +VARYING vec4 vary_fragcoord; uniform vec2 screen_res; uniform mat4 inv_proj; @@ -128,9 +132,9 @@ void main() frag.xy *= screen_res; vec3 pos = getPosition(frag.xy).xyz; - vec3 lv = vary_light.xyz-pos.xyz; + vec3 lv = center.xyz-pos.xyz; float dist2 = dot(lv,lv); - dist2 /= vary_light.w; + dist2 /= size; if (dist2 > 1.0) { discard; @@ -161,7 +165,7 @@ void main() proj_tc.xyz /= proj_tc.w; - float fa = gl_Color.a+1.0; + float fa = falloff+1.0; float dist_atten = min(1.0-(dist2-1.0*(1.0-fa))/fa, 1.0); if (dist_atten <= 0.0) { @@ -193,7 +197,7 @@ void main() vec4 plcol = texture2DLodDiffuse(projectionMap, proj_tc.xy, lod); - vec3 lcol = gl_Color.rgb * plcol.rgb * plcol.a; + vec3 lcol = color.rgb * plcol.rgb * plcol.a; lit = da * dist_atten * noise; @@ -210,7 +214,7 @@ void main() amb_da = min(amb_da, 1.0-lit); - col += amb_da*gl_Color.rgb*diff_tex.rgb*amb_plcol.rgb*amb_plcol.a; + col += amb_da*color.rgb*diff_tex.rgb*amb_plcol.rgb*amb_plcol.a; } @@ -243,7 +247,7 @@ void main() stc.y > 0.0) { vec4 scol = texture2DLodSpecular(projectionMap, stc.xy, proj_lod-spec.a*proj_lod); - col += dist_atten*scol.rgb*gl_Color.rgb*scol.a*spec.rgb*shadow; + col += dist_atten*scol.rgb*color.rgb*scol.a*spec.rgb*shadow; } } } diff --git a/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightMSF.glsl b/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightMSF.glsl deleted file mode 100644 index 1afa9a9fb4..0000000000 --- a/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightMSF.glsl +++ /dev/null @@ -1,262 +0,0 @@ -/** - * @file multiSpotLightF.glsl - * - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2007, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - - - -#extension GL_ARB_texture_rectangle : enable -#extension GL_ARB_texture_multisample : enable - -uniform sampler2DMS diffuseRect; -uniform sampler2DMS specularRect; -uniform sampler2DMS depthMap; -uniform sampler2DMS normalMap; -uniform sampler2DRect lightMap; -uniform sampler2D noiseMap; -uniform sampler2D lightFunc; -uniform sampler2D projectionMap; - -uniform mat4 proj_mat; //screen space to light space -uniform float proj_near; //near clip for projection -uniform vec3 proj_p; //plane projection is emitting from (in screen space) -uniform vec3 proj_n; -uniform float proj_focus; //distance from plane to begin blurring -uniform float proj_lod; //(number of mips in proj map) -uniform float proj_range; //range between near clip and far clip plane of projection -uniform float proj_ambient_lod; -uniform float proj_ambiance; -uniform float near_clip; -uniform float far_clip; - -uniform vec3 proj_origin; //origin of projection to be used for angular attenuation -uniform float sun_wash; -uniform int proj_shadow_idx; -uniform float shadow_fade; - -varying vec4 vary_light; - -varying vec4 vary_fragcoord; -uniform vec2 screen_res; - -uniform mat4 inv_proj; - -vec4 texture2DLodSpecular(sampler2D projectionMap, vec2 tc, float lod) -{ - vec4 ret = texture2DLod(projectionMap, tc, lod); - - vec2 dist = tc-vec2(0.5); - - float det = max(1.0-lod/(proj_lod*0.5), 0.0); - - float d = dot(dist,dist); - - ret *= min(clamp((0.25-d)/0.25, 0.0, 1.0)+det, 1.0); - - return ret; -} - -vec4 texture2DLodDiffuse(sampler2D projectionMap, vec2 tc, float lod) -{ - vec4 ret = texture2DLod(projectionMap, tc, lod); - - vec2 dist = vec2(0.5) - abs(tc-vec2(0.5)); - - float det = min(lod/(proj_lod*0.5), 1.0); - - float d = min(dist.x, dist.y); - - float edge = 0.25*det; - - ret *= clamp(d/edge, 0.0, 1.0); - - return ret; -} - -vec4 texture2DLodAmbient(sampler2D projectionMap, vec2 tc, float lod) -{ - vec4 ret = texture2DLod(projectionMap, tc, lod); - - vec2 dist = tc-vec2(0.5); - - float d = dot(dist,dist); - - ret *= min(clamp((0.25-d)/0.25, 0.0, 1.0), 1.0); - - return ret; -} - - -vec4 getPosition(ivec2 pos_screen, int sample) -{ - float depth = texelFetch(depthMap, pos_screen, sample).r; - vec2 sc = vec2(pos_screen.xy)*2.0; - sc /= screen_res; - sc -= vec2(1.0,1.0); - vec4 ndc = vec4(sc.x, sc.y, 2.0*depth-1.0, 1.0); - vec4 pos = inv_proj * ndc; - pos /= pos.w; - pos.w = 1.0; - return pos; -} - -void main() -{ - int wght = 0; - - vec3 fcol = vec3(0,0,0); - - vec2 frag = (vary_fragcoord.xy*0.5+0.5)*screen_res; - - ivec2 itc = ivec2(frag.xy); - - float shadow = 1.0; - - if (proj_shadow_idx >= 0) - { - vec4 shd = texture2DRect(lightMap, frag); - float sh[2]; - sh[0] = shd.b; - sh[1] = shd.a; - shadow = min(sh[proj_shadow_idx]+shadow_fade, 1.0); - } - - for (int i = 0; i < samples; i++) - { - vec3 pos = getPosition(itc, i).xyz; - vec3 lv = vary_light.xyz-pos.xyz; - float dist2 = dot(lv,lv); - dist2 /= vary_light.w; - if (dist2 <= 1.0) - { - vec3 norm = texelFetch(normalMap, itc, i).xyz; - norm = vec3((norm.xy-0.5)*2.0,norm.z); // unpack norm - - norm = normalize(norm); - float l_dist = -dot(lv, proj_n); - - vec4 proj_tc = (proj_mat * vec4(pos.xyz, 1.0)); - if (proj_tc.z >= 0.0) - { - proj_tc.xyz /= proj_tc.w; - - float fa = gl_Color.a+1.0; - float dist_atten = min(1.0-(dist2-1.0*(1.0-fa))/fa, 1.0); - if (dist_atten > 0.0) - { - lv = proj_origin-pos.xyz; - lv = normalize(lv); - float da = dot(norm, lv); - - vec3 col = vec3(0,0,0); - - vec3 diff_tex = texelFetch(diffuseRect, itc, i).rgb; - - float noise = texture2D(noiseMap, frag.xy/128.0).b; - if (proj_tc.z > 0.0 && - proj_tc.x < 1.0 && - proj_tc.y < 1.0 && - proj_tc.x > 0.0 && - proj_tc.y > 0.0) - { - float lit = 0.0; - float amb_da = proj_ambiance; - - if (da > 0.0) - { - float diff = clamp((l_dist-proj_focus)/proj_range, 0.0, 1.0); - float lod = diff * proj_lod; - - vec4 plcol = texture2DLodDiffuse(projectionMap, proj_tc.xy, lod); - - vec3 lcol = gl_Color.rgb * plcol.rgb * plcol.a; - - lit = da * dist_atten * noise; - - col = lcol*lit*diff_tex*shadow; - amb_da += (da*0.5)*(1.0-shadow)*proj_ambiance; - } - - //float diff = clamp((proj_range-proj_focus)/proj_range, 0.0, 1.0); - vec4 amb_plcol = texture2DLodAmbient(projectionMap, proj_tc.xy, proj_lod); - - amb_da += (da*da*0.5+0.5)*proj_ambiance; - - amb_da *= dist_atten * noise; - - amb_da = min(amb_da, 1.0-lit); - - col += amb_da*gl_Color.rgb*diff_tex.rgb*amb_plcol.rgb*amb_plcol.a; - } - - - vec4 spec = texelFetch(specularRect, itc, i); - if (spec.a > 0.0) - { - vec3 ref = reflect(normalize(pos), norm); - - //project from point pos in direction ref to plane proj_p, proj_n - vec3 pdelta = proj_p-pos; - float ds = dot(ref, proj_n); - - if (ds < 0.0) - { - vec3 pfinal = pos + ref * dot(pdelta, proj_n)/ds; - - vec4 stc = (proj_mat * vec4(pfinal.xyz, 1.0)); - - if (stc.z > 0.0) - { - stc.xy /= stc.w; - - float fatten = clamp(spec.a*spec.a+spec.a*0.5, 0.25, 1.0); - - stc.xy = (stc.xy - vec2(0.5)) * fatten + vec2(0.5); - - if (stc.x < 1.0 && - stc.y < 1.0 && - stc.x > 0.0 && - stc.y > 0.0) - { - vec4 scol = texture2DLodSpecular(projectionMap, stc.xy, proj_lod-spec.a*proj_lod); - col += dist_atten*scol.rgb*gl_Color.rgb*scol.a*spec.rgb*shadow; - } - } - } - } - - fcol += col; - wght++; - } - } - } - } - - if (wght <= 0) - { - discard; - } - - gl_FragColor.rgb = fcol/samples; - gl_FragColor.a = 0.0; -} diff --git a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl index d7407332e5..97f3063a9e 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl @@ -23,16 +23,17 @@ * $/LicenseInfo$ */ - - #extension GL_ARB_texture_rectangle : enable +#ifdef DEFINE_GL_FRAGCOLOR +out vec4 gl_FragColor; +#endif + uniform sampler2DRect diffuseRect; uniform sampler2DRect specularRect; uniform sampler2DRect normalMap; uniform sampler2DRect lightMap; uniform sampler2DRect depthMap; -uniform sampler2D noiseMap; uniform samplerCube environmentMap; uniform sampler2D lightFunc; uniform vec3 gi_quad; @@ -58,15 +59,16 @@ uniform vec4 distance_multiplier; uniform vec4 max_y; uniform vec4 glow; uniform float scene_light_strength; -uniform vec3 env_mat[3]; +uniform mat3 env_mat; uniform vec4 shadow_clip; uniform mat3 ssao_effect_mat; uniform mat4 inv_proj; uniform vec2 screen_res; -varying vec4 vary_light; -varying vec2 vary_fragcoord; +uniform vec3 sun_dir; + +VARYING vec2 vary_fragcoord; vec3 vary_PositionEye; @@ -145,10 +147,6 @@ void calcAtmospherics(vec3 inPositionEye, float ambFactor) { vec3 P = inPositionEye; setPositionEye(P); - //(TERRAIN) limit altitude - if (P.y > max_y.x) P *= (max_y.x / P.y); - if (P.y < -max_y.x) P *= (-max_y.x / P.y); - vec3 tmpLightnorm = lightnorm.xyz; vec3 Pn = normalize(P); @@ -280,9 +278,8 @@ void main() vec3 pos = getPosition_d(tc, depth).xyz; vec3 norm = texture2DRect(normalMap, tc).xyz; norm = vec3((norm.xy-0.5)*2.0,norm.z); // unpack norm - //vec3 nz = texture2D(noiseMap, vary_fragcoord.xy/128.0).xyz; - - float da = max(dot(norm.xyz, vary_light.xyz), 0.0); + + float da = max(dot(norm.xyz, sun_dir.xyz), 0.0); vec4 diffuse = texture2DRect(diffuseRect, tc); @@ -309,13 +306,18 @@ void main() // the old infinite-sky shiny reflection // vec3 refnormpersp = normalize(reflect(pos.xyz, norm.xyz)); - float sa = dot(refnormpersp, vary_light.xyz); - vec3 dumbshiny = vary_SunlitColor*scol_ambocc.r*texture2D(lightFunc, vec2(sa, spec.a)).a; + float sa = dot(refnormpersp, sun_dir.xyz); + vec3 dumbshiny = vary_SunlitColor*scol_ambocc.r*texture2D(lightFunc, vec2(sa, spec.a)).r; // add the two types of shiny together vec3 spec_contrib = dumbshiny * spec.rgb; bloom = dot(spec_contrib, spec_contrib); col += spec_contrib; + + //add environmentmap + vec3 env_vec = env_mat * refnormpersp; + col = mix(col.rgb, textureCube(environmentMap, env_vec).rgb, + max(spec.a-diffuse.a*2.0, 0.0)); } col = atmosLighting(col); diff --git a/indra/newview/app_settings/shaders/class2/deferred/softenLightMSF.glsl b/indra/newview/app_settings/shaders/class2/deferred/softenLightMSF.glsl deleted file mode 100644 index 1244294451..0000000000 --- a/indra/newview/app_settings/shaders/class2/deferred/softenLightMSF.glsl +++ /dev/null @@ -1,337 +0,0 @@ -/** - * @file softenLightMSF.glsl - * - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2007, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - - - -#extension GL_ARB_texture_rectangle : enable -#extension GL_ARB_texture_multisample : enable - -uniform sampler2DMS diffuseRect; -uniform sampler2DMS specularRect; -uniform sampler2DMS normalMap; -uniform sampler2DRect lightMap; -uniform sampler2DMS depthMap; -uniform sampler2D noiseMap; -uniform samplerCube environmentMap; -uniform sampler2D lightFunc; -uniform vec3 gi_quad; - -uniform float blur_size; -uniform float blur_fidelity; - -// Inputs -uniform vec4 morphFactor; -uniform vec3 camPosLocal; -//uniform vec4 camPosWorld; -uniform vec4 gamma; -uniform vec4 lightnorm; -uniform vec4 sunlight_color; -uniform vec4 ambient; -uniform vec4 blue_horizon; -uniform vec4 blue_density; -uniform vec4 haze_horizon; -uniform vec4 haze_density; -uniform vec4 cloud_shadow; -uniform vec4 density_multiplier; -uniform vec4 distance_multiplier; -uniform vec4 max_y; -uniform vec4 glow; -uniform float scene_light_strength; -uniform vec3 env_mat[3]; -uniform vec4 shadow_clip; -uniform mat3 ssao_effect_mat; - -uniform mat4 inv_proj; -uniform vec2 screen_res; - -varying vec4 vary_light; -varying vec2 vary_fragcoord; - -vec3 vary_PositionEye; - -vec3 vary_SunlitColor; -vec3 vary_AmblitColor; -vec3 vary_AdditiveColor; -vec3 vary_AtmosAttenuation; - -vec4 getPosition_d(vec2 pos_screen, float depth) -{ - vec2 sc = pos_screen.xy*2.0; - sc /= screen_res; - sc -= vec2(1.0,1.0); - vec4 ndc = vec4(sc.x, sc.y, 2.0*depth-1.0, 1.0); - vec4 pos = inv_proj * ndc; - pos /= pos.w; - pos.w = 1.0; - return pos; -} - -vec3 getPositionEye() -{ - return vary_PositionEye; -} -vec3 getSunlitColor() -{ - return vary_SunlitColor; -} -vec3 getAmblitColor() -{ - return vary_AmblitColor; -} -vec3 getAdditiveColor() -{ - return vary_AdditiveColor; -} -vec3 getAtmosAttenuation() -{ - return vary_AtmosAttenuation; -} - - -void setPositionEye(vec3 v) -{ - vary_PositionEye = v; -} - -void setSunlitColor(vec3 v) -{ - vary_SunlitColor = v; -} - -void setAmblitColor(vec3 v) -{ - vary_AmblitColor = v; -} - -void setAdditiveColor(vec3 v) -{ - vary_AdditiveColor = v; -} - -void setAtmosAttenuation(vec3 v) -{ - vary_AtmosAttenuation = v; -} - -void calcAtmospherics(vec3 inPositionEye, float ambFactor) { - - vec3 P = inPositionEye; - setPositionEye(P); - - //(TERRAIN) limit altitude - if (P.y > max_y.x) P *= (max_y.x / P.y); - if (P.y < -max_y.x) P *= (-max_y.x / P.y); - - vec3 tmpLightnorm = lightnorm.xyz; - - vec3 Pn = normalize(P); - float Plen = length(P); - - vec4 temp1 = vec4(0); - vec3 temp2 = vec3(0); - vec4 blue_weight; - vec4 haze_weight; - vec4 sunlight = sunlight_color; - vec4 light_atten; - - //sunlight attenuation effect (hue and brightness) due to atmosphere - //this is used later for sunlight modulation at various altitudes - light_atten = (blue_density * 1.0 + vec4(haze_density.r) * 0.25) * (density_multiplier.x * max_y.x); - //I had thought blue_density and haze_density should have equal weighting, - //but attenuation due to haze_density tends to seem too strong - - temp1 = blue_density + vec4(haze_density.r); - blue_weight = blue_density / temp1; - haze_weight = vec4(haze_density.r) / temp1; - - //(TERRAIN) compute sunlight from lightnorm only (for short rays like terrain) - temp2.y = max(0.0, tmpLightnorm.y); - temp2.y = 1. / temp2.y; - sunlight *= exp( - light_atten * temp2.y); - - // main atmospheric scattering line integral - temp2.z = Plen * density_multiplier.x; - - // Transparency (-> temp1) - // ATI Bugfix -- can't store temp1*temp2.z*distance_multiplier.x in a variable because the ati - // compiler gets confused. - temp1 = exp(-temp1 * temp2.z * distance_multiplier.x); - - //final atmosphere attenuation factor - setAtmosAttenuation(temp1.rgb); - - //compute haze glow - //(can use temp2.x as temp because we haven't used it yet) - temp2.x = dot(Pn, tmpLightnorm.xyz); - temp2.x = 1. - temp2.x; - //temp2.x is 0 at the sun and increases away from sun - temp2.x = max(temp2.x, .03); //was glow.y - //set a minimum "angle" (smaller glow.y allows tighter, brighter hotspot) - temp2.x *= glow.x; - //higher glow.x gives dimmer glow (because next step is 1 / "angle") - temp2.x = pow(temp2.x, glow.z); - //glow.z should be negative, so we're doing a sort of (1 / "angle") function - - //add "minimum anti-solar illumination" - temp2.x += .25; - - //increase ambient when there are more clouds - vec4 tmpAmbient = ambient + (vec4(1.) - ambient) * cloud_shadow.x * 0.5; - - /* decrease value and saturation (that in HSV, not HSL) for occluded areas - * // for HSV color/geometry used here, see http://gimp-savvy.com/BOOK/index.html?node52.html - * // The following line of code performs the equivalent of: - * float ambAlpha = tmpAmbient.a; - * float ambValue = dot(vec3(tmpAmbient), vec3(0.577)); // projection onto <1/rt(3), 1/rt(3), 1/rt(3)>, the neutral white-black axis - * vec3 ambHueSat = vec3(tmpAmbient) - vec3(ambValue); - * tmpAmbient = vec4(RenderSSAOEffect.valueFactor * vec3(ambValue) + RenderSSAOEffect.saturationFactor *(1.0 - ambFactor) * ambHueSat, ambAlpha); - */ - tmpAmbient = vec4(mix(ssao_effect_mat * tmpAmbient.rgb, tmpAmbient.rgb, ambFactor), tmpAmbient.a); - - //haze color - setAdditiveColor( - vec3(blue_horizon * blue_weight * (sunlight*(1.-cloud_shadow.x) + tmpAmbient) - + (haze_horizon.r * haze_weight) * (sunlight*(1.-cloud_shadow.x) * temp2.x - + tmpAmbient))); - - //brightness of surface both sunlight and ambient - setSunlitColor(vec3(sunlight * .5)); - setAmblitColor(vec3(tmpAmbient * .25)); - setAdditiveColor(getAdditiveColor() * vec3(1.0 - temp1)); -} - -vec3 atmosLighting(vec3 light) -{ - light *= getAtmosAttenuation().r; - light += getAdditiveColor(); - return (2.0 * light); -} - -vec3 atmosTransport(vec3 light) { - light *= getAtmosAttenuation().r; - light += getAdditiveColor() * 2.0; - return light; -} -vec3 atmosGetDiffuseSunlightColor() -{ - return getSunlitColor(); -} - -vec3 scaleDownLight(vec3 light) -{ - return (light / scene_light_strength ); -} - -vec3 scaleUpLight(vec3 light) -{ - return (light * scene_light_strength); -} - -vec3 atmosAmbient(vec3 light) -{ - return getAmblitColor() + light / 2.0; -} - -vec3 atmosAffectDirectionalLight(float lightIntensity) -{ - return getSunlitColor() * lightIntensity; -} - -vec3 scaleSoftClip(vec3 light) -{ - //soft clip effect: - light = 1. - clamp(light, vec3(0.), vec3(1.)); - light = 1. - pow(light, gamma.xxx); - - return light; -} - -void main() -{ - vec2 tc = vary_fragcoord.xy; - ivec2 itc = ivec2(tc); - - vec4 fcol = vec4(0,0,0,0); - - vec2 scol_ambocc = texture2DRect(lightMap, tc).rg; - float ambocc = scol_ambocc.g; - - for (int i = 0; i < samples; ++i) - { - float depth = texelFetch(depthMap, itc.xy, i).r; - vec3 pos = getPosition_d(tc, depth).xyz; - vec3 norm = texelFetch(normalMap, itc, i).xyz; - norm = vec3((norm.xy-0.5)*2.0,norm.z); // unpack norm - - float da = max(dot(norm.xyz, vary_light.xyz), 0.0); - - vec4 diffuse = texelFetch(diffuseRect, itc, i); - vec3 col; - float bloom = 0.0; - if (diffuse.a < 0.9) - { - vec4 spec = texelFetch(specularRect, itc, i); - - float amb = 0; - - float scol = max(scol_ambocc.r, diffuse.a); - amb += ambocc; - - calcAtmospherics(pos.xyz, ambocc); - - col = atmosAmbient(vec3(0)); - col += atmosAffectDirectionalLight(max(min(da, scol), diffuse.a)); - - col *= diffuse.rgb; - - if (spec.a > 0.0) // specular reflection - { - // the old infinite-sky shiny reflection - // - vec3 refnormpersp = normalize(reflect(pos.xyz, norm.xyz)); - float sa = dot(refnormpersp, vary_light.xyz); - vec3 dumbshiny = vary_SunlitColor*scol_ambocc.r*texture2D(lightFunc, vec2(sa, spec.a)).a; - - // add the two types of shiny together - vec3 spec_contrib = dumbshiny * spec.rgb; - bloom = dot(spec_contrib, spec_contrib); - col += spec_contrib; - } - - col = atmosLighting(col); - col = scaleSoftClip(col); - - col = mix(col, diffuse.rgb, diffuse.a); - } - else - { - col = diffuse.rgb; - } - - fcol += vec4(col, bloom); - } - - gl_FragColor = fcol/samples; -} diff --git a/indra/newview/app_settings/shaders/class2/deferred/softenLightV.glsl b/indra/newview/app_settings/shaders/class2/deferred/softenLightV.glsl index fed238510a..c840d72784 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/softenLightV.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/softenLightV.glsl @@ -22,23 +22,21 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - +uniform mat4 modelview_projection_matrix; + +ATTRIBUTE vec3 position; uniform vec2 screen_res; -varying vec4 vary_light; -varying vec2 vary_fragcoord; +VARYING vec2 vary_fragcoord; + void main() { //transform vertex - gl_Position = ftransform(); + vec4 pos = modelview_projection_matrix * vec4(position.xyz, 1.0); + gl_Position = pos; - vec4 pos = gl_ModelViewProjectionMatrix * gl_Vertex; - vary_fragcoord = (pos.xy*0.5+0.5)*screen_res; - - vec4 tex = gl_MultiTexCoord0; - tex.w = 1.0; - vary_light = gl_MultiTexCoord0; + vary_fragcoord = (pos.xy*0.5+0.5)*screen_res; } diff --git a/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl index 25270f4939..31bd0c79da 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl @@ -23,9 +23,13 @@ * $/LicenseInfo$ */ +#extension GL_ARB_texture_rectangle : enable +#ifdef DEFINE_GL_FRAGCOLOR +out vec4 gl_FragColor; +#endif -#extension GL_ARB_texture_rectangle : enable +VARYING vec4 vertex_color; uniform sampler2DRect diffuseRect; uniform sampler2DRect specularRect; @@ -34,7 +38,6 @@ uniform sampler2DRect normalMap; uniform samplerCube environmentMap; uniform sampler2DRect lightMap; uniform sampler2D noiseMap; -uniform sampler2D lightFunc; uniform sampler2D projectionMap; uniform mat4 proj_mat; //screen space to light space @@ -53,9 +56,9 @@ uniform float sun_wash; uniform int proj_shadow_idx; uniform float shadow_fade; -varying vec4 vary_light; +VARYING vec4 vary_light; -varying vec4 vary_fragcoord; +VARYING vec4 vary_fragcoord; uniform vec2 screen_res; uniform mat4 inv_proj; @@ -114,7 +117,7 @@ void main() proj_tc.xyz /= proj_tc.w; - float fa = gl_Color.a+1.0; + float fa = vertex_color.a+1.0; float dist_atten = clamp(1.0-(dist2-1.0*(1.0-fa))/fa, 0.0, 1.0); lv = proj_origin-pos.xyz; @@ -140,7 +143,7 @@ void main() vec4 plcol = texture2DLod(projectionMap, proj_tc.xy, lod); - vec3 lcol = gl_Color.rgb * plcol.rgb * plcol.a; + vec3 lcol = vertex_color.rgb * plcol.rgb * plcol.a; lit = da * dist_atten * noise; @@ -163,7 +166,7 @@ void main() amb_da = min(amb_da, 1.0-lit); - col += amb_da*gl_Color.rgb*diff_tex.rgb*amb_plcol.rgb*amb_plcol.a; + col += amb_da*vertex_color.rgb*diff_tex.rgb*amb_plcol.rgb*amb_plcol.a; } @@ -192,7 +195,7 @@ void main() stc.y > 0.0) { vec4 scol = texture2DLod(projectionMap, stc.xy, proj_lod-spec.a*proj_lod); - col += dist_atten*scol.rgb*gl_Color.rgb*scol.a*spec.rgb*shadow; + col += dist_atten*scol.rgb*vertex_color.rgb*scol.a*spec.rgb*shadow; } } } diff --git a/indra/newview/app_settings/shaders/class2/deferred/spotLightMSF.glsl b/indra/newview/app_settings/shaders/class2/deferred/spotLightMSF.glsl deleted file mode 100644 index 4962e73e39..0000000000 --- a/indra/newview/app_settings/shaders/class2/deferred/spotLightMSF.glsl +++ /dev/null @@ -1,263 +0,0 @@ -/** - * @file multiSpotLightF.glsl - * - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2007, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - - - -#extension GL_ARB_texture_rectangle : enable -#extension GL_ARB_texture_multisample : enable - -uniform sampler2DMS diffuseRect; -uniform sampler2DMS specularRect; -uniform sampler2DMS depthMap; -uniform sampler2DMS normalMap; -uniform sampler2DRect lightMap; -uniform sampler2D noiseMap; -uniform sampler2D lightFunc; -uniform sampler2D projectionMap; - -uniform mat4 proj_mat; //screen space to light space -uniform float proj_near; //near clip for projection -uniform vec3 proj_p; //plane projection is emitting from (in screen space) -uniform vec3 proj_n; -uniform float proj_focus; //distance from plane to begin blurring -uniform float proj_lod; //(number of mips in proj map) -uniform float proj_range; //range between near clip and far clip plane of projection -uniform float proj_ambient_lod; -uniform float proj_ambiance; -uniform float near_clip; -uniform float far_clip; - -uniform vec3 proj_origin; //origin of projection to be used for angular attenuation -uniform float sun_wash; -uniform int proj_shadow_idx; -uniform float shadow_fade; - -varying vec4 vary_light; - -varying vec4 vary_fragcoord; -uniform vec2 screen_res; - -uniform mat4 inv_proj; - -vec4 texture2DLodSpecular(sampler2D projectionMap, vec2 tc, float lod) -{ - vec4 ret = texture2DLod(projectionMap, tc, lod); - - vec2 dist = tc-vec2(0.5); - - float det = max(1.0-lod/(proj_lod*0.5), 0.0); - - float d = dot(dist,dist); - - ret *= min(clamp((0.25-d)/0.25, 0.0, 1.0)+det, 1.0); - - return ret; -} - -vec4 texture2DLodDiffuse(sampler2D projectionMap, vec2 tc, float lod) -{ - vec4 ret = texture2DLod(projectionMap, tc, lod); - - vec2 dist = vec2(0.5) - abs(tc-vec2(0.5)); - - float det = min(lod/(proj_lod*0.5), 1.0); - - float d = min(dist.x, dist.y); - - float edge = 0.25*det; - - ret *= clamp(d/edge, 0.0, 1.0); - - return ret; -} - -vec4 texture2DLodAmbient(sampler2D projectionMap, vec2 tc, float lod) -{ - vec4 ret = texture2DLod(projectionMap, tc, lod); - - vec2 dist = tc-vec2(0.5); - - float d = dot(dist,dist); - - ret *= min(clamp((0.25-d)/0.25, 0.0, 1.0), 1.0); - - return ret; -} - - -vec4 getPosition(ivec2 pos_screen, int sample) -{ - float depth = texelFetch(depthMap, pos_screen, sample).r; - vec2 sc = vec2(pos_screen.xy)*2.0; - sc /= screen_res; - sc -= vec2(1.0,1.0); - vec4 ndc = vec4(sc.x, sc.y, 2.0*depth-1.0, 1.0); - vec4 pos = inv_proj * ndc; - pos /= pos.w; - pos.w = 1.0; - return pos; -} - -void main() -{ - vec4 frag = vary_fragcoord; - frag.xyz /= frag.w; - frag.xyz = frag.xyz*0.5+0.5; - frag.xy *= screen_res; - ivec2 itc = ivec2(frag.xy); - - vec3 fcol = vec3(0,0,0); - int wght = 0; - - float shadow = 1.0; - - if (proj_shadow_idx >= 0) - { - vec4 shd = texture2DRect(lightMap, frag.xy); - float sh[2]; - sh[0] = shd.b; - sh[1] = shd.a; - shadow = min(sh[proj_shadow_idx]+shadow_fade, 1.0); - } - - for (int i = 0; i < samples; i++) - { - vec3 pos = getPosition(itc, i).xyz; - vec3 lv = vary_light.xyz-pos.xyz; - float dist2 = dot(lv,lv); - dist2 /= vary_light.w; - if (dist2 <= 1.0) - { - vec3 norm = texelFetch(normalMap, itc, i).xyz; - norm = vec3((norm.xy-0.5)*2.0,norm.z); // unpack norm - - norm = normalize(norm); - float l_dist = -dot(lv, proj_n); - - vec4 proj_tc = (proj_mat * vec4(pos.xyz, 1.0)); - if (proj_tc.z >= 0.0) - { - proj_tc.xyz /= proj_tc.w; - - float fa = gl_Color.a+1.0; - float dist_atten = min(1.0-(dist2-1.0*(1.0-fa))/fa, 1.0); - if (dist_atten > 0.0) - { - lv = proj_origin-pos.xyz; - lv = normalize(lv); - float da = dot(norm, lv); - - vec3 col = vec3(0,0,0); - - vec3 diff_tex = texelFetch(diffuseRect, itc, i).rgb; - - float noise = texture2D(noiseMap, frag.xy/128.0).b; - if (proj_tc.z > 0.0 && - proj_tc.x < 1.0 && - proj_tc.y < 1.0 && - proj_tc.x > 0.0 && - proj_tc.y > 0.0) - { - float lit = 0.0; - float amb_da = proj_ambiance; - - if (da > 0.0) - { - float diff = clamp((l_dist-proj_focus)/proj_range, 0.0, 1.0); - float lod = diff * proj_lod; - - vec4 plcol = texture2DLodDiffuse(projectionMap, proj_tc.xy, lod); - - vec3 lcol = gl_Color.rgb * plcol.rgb * plcol.a; - - lit = da * dist_atten * noise; - - col = lcol*lit*diff_tex*shadow; - amb_da += (da*0.5)*(1.0-shadow)*proj_ambiance; - } - - //float diff = clamp((proj_range-proj_focus)/proj_range, 0.0, 1.0); - vec4 amb_plcol = texture2DLodAmbient(projectionMap, proj_tc.xy, proj_lod); - - amb_da += (da*da*0.5+0.5)*proj_ambiance; - - amb_da *= dist_atten * noise; - - amb_da = min(amb_da, 1.0-lit); - - col += amb_da*gl_Color.rgb*diff_tex.rgb*amb_plcol.rgb*amb_plcol.a; - } - - - vec4 spec = texelFetch(specularRect, itc, i); - if (spec.a > 0.0) - { - vec3 ref = reflect(normalize(pos), norm); - - //project from point pos in direction ref to plane proj_p, proj_n - vec3 pdelta = proj_p-pos; - float ds = dot(ref, proj_n); - - if (ds < 0.0) - { - vec3 pfinal = pos + ref * dot(pdelta, proj_n)/ds; - - vec4 stc = (proj_mat * vec4(pfinal.xyz, 1.0)); - - if (stc.z > 0.0) - { - stc.xy /= stc.w; - - float fatten = clamp(spec.a*spec.a+spec.a*0.5, 0.25, 1.0); - - stc.xy = (stc.xy - vec2(0.5)) * fatten + vec2(0.5); - - if (stc.x < 1.0 && - stc.y < 1.0 && - stc.x > 0.0 && - stc.y > 0.0) - { - vec4 scol = texture2DLodSpecular(projectionMap, stc.xy, proj_lod-spec.a*proj_lod); - col += dist_atten*scol.rgb*gl_Color.rgb*scol.a*spec.rgb*shadow; - } - } - } - } - - fcol += col; - wght++; - } - } - } - } - - if (wght <= 0) - { - discard; - } - - gl_FragColor.rgb = fcol/wght; - gl_FragColor.a = 0.0; -} diff --git a/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl index 1809cff1e5..229c2f4b67 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl @@ -22,11 +22,13 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - - #extension GL_ARB_texture_rectangle : enable +#ifdef DEFINE_GL_FRAGCOLOR +out vec4 gl_FragColor; +#endif + //class 2, shadows, no SSAO uniform sampler2DRect depthMap; @@ -47,13 +49,13 @@ uniform float ssao_max_radius; uniform float ssao_factor; uniform float ssao_factor_inv; -varying vec2 vary_fragcoord; -varying vec4 vary_light; +VARYING vec2 vary_fragcoord; uniform mat4 inv_proj; uniform vec2 screen_res; uniform vec2 shadow_res; uniform vec2 proj_shadow_res; +uniform vec3 sun_dir; uniform float shadow_bias; uniform float shadow_offset; @@ -132,10 +134,10 @@ void main() }*/ float shadow = 1.0; - float dp_directional_light = max(0.0, dot(norm, vary_light.xyz)); + float dp_directional_light = max(0.0, dot(norm, sun_dir.xyz)); vec3 shadow_pos = pos.xyz + displace*norm; - vec3 offset = vary_light.xyz * (1.0-dp_directional_light); + vec3 offset = sun_dir.xyz * (1.0-dp_directional_light); vec4 spos = vec4(shadow_pos+offset*shadow_offset, 1.0); diff --git a/indra/newview/app_settings/shaders/class2/deferred/sunLightMSF.glsl b/indra/newview/app_settings/shaders/class2/deferred/sunLightMSF.glsl deleted file mode 100644 index ac4fe52655..0000000000 --- a/indra/newview/app_settings/shaders/class2/deferred/sunLightMSF.glsl +++ /dev/null @@ -1,220 +0,0 @@ -/** - * @file sunLightMSF.glsl - * - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2007, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - - - -#extension GL_ARB_texture_rectangle : enable -#extension GL_ARB_texture_multisample : enable - -//class 2, shadows, no SSAO - -uniform sampler2DMS depthMap; -uniform sampler2DMS normalMap; -uniform sampler2DRectShadow shadowMap0; -uniform sampler2DRectShadow shadowMap1; -uniform sampler2DRectShadow shadowMap2; -uniform sampler2DRectShadow shadowMap3; -uniform sampler2DShadow shadowMap4; -uniform sampler2DShadow shadowMap5; - - -// Inputs -uniform mat4 shadow_matrix[6]; -uniform vec4 shadow_clip; -uniform float ssao_radius; -uniform float ssao_max_radius; -uniform float ssao_factor; -uniform float ssao_factor_inv; - -varying vec2 vary_fragcoord; -varying vec4 vary_light; - -uniform mat4 inv_proj; -uniform vec2 screen_res; -uniform vec2 shadow_res; -uniform vec2 proj_shadow_res; - -uniform float shadow_bias; -uniform float shadow_offset; - -uniform float spot_shadow_bias; -uniform float spot_shadow_offset; - -vec4 getPosition(ivec2 pos_screen, int sample) -{ - float depth = texelFetch(depthMap, pos_screen.xy, sample).r; - vec2 sc = vec2(pos_screen.xy)*2.0; - sc /= screen_res; - sc -= vec2(1.0,1.0); - vec4 ndc = vec4(sc.x, sc.y, 2.0*depth-1.0, 1.0); - vec4 pos = inv_proj * ndc; - pos /= pos.w; - pos.w = 1.0; - return pos; -} - -float pcfShadow(sampler2DRectShadow shadowMap, vec4 stc, float scl) -{ - stc.xyz /= stc.w; - stc.z += shadow_bias*scl; - - float cs = shadow2DRect(shadowMap, stc.xyz).x; - float shadow = cs; - - shadow += max(shadow2DRect(shadowMap, stc.xyz+vec3(1.5, 1.5, 0.0)).x, cs); - shadow += max(shadow2DRect(shadowMap, stc.xyz+vec3(1.5, -1.5, 0.0)).x, cs); - shadow += max(shadow2DRect(shadowMap, stc.xyz+vec3(-1.5, 1.5, 0.0)).x, cs); - shadow += max(shadow2DRect(shadowMap, stc.xyz+vec3(-1.5, -1.5, 0.0)).x, cs); - - return shadow/5.0; - - //return shadow; -} - -float pcfShadow(sampler2DShadow shadowMap, vec4 stc, float scl) -{ - stc.xyz /= stc.w; - stc.z += spot_shadow_bias*scl; - - float cs = shadow2D(shadowMap, stc.xyz).x; - float shadow = cs; - - vec2 off = 1.5/proj_shadow_res; - - shadow += max(shadow2D(shadowMap, stc.xyz+vec3(off.x, off.y, 0.0)).x, cs); - shadow += max(shadow2D(shadowMap, stc.xyz+vec3(off.x, -off.y, 0.0)).x, cs); - shadow += max(shadow2D(shadowMap, stc.xyz+vec3(-off.x, off.y, 0.0)).x, cs); - shadow += max(shadow2D(shadowMap, stc.xyz+vec3(-off.x, -off.y, 0.0)).x, cs); - - return shadow/5.0; - - //return shadow; -} - -void main() -{ - vec2 pos_screen = vary_fragcoord.xy; - ivec2 itc = ivec2(pos_screen); - - //try doing an unproject here - - vec4 fcol = vec4(0,0,0,0); - - for (int i = 0; i < samples; i++) - { - vec4 pos = getPosition(itc, i); - - vec4 nmap4 = texelFetch(normalMap, itc, i); - nmap4 = vec4((nmap4.xy-0.5)*2.0,nmap4.z,nmap4.w); // unpack norm - float displace = nmap4.w; - vec3 norm = nmap4.xyz; - - /*if (pos.z == 0.0) // do nothing for sky *FIX: REMOVE THIS IF/WHEN THE POSITION MAP IS BEING USED AS A STENCIL - { - gl_FragColor = vec4(0.0); // doesn't matter - return; - }*/ - - float shadow = 1.0; - float dp_directional_light = max(0.0, dot(norm, vary_light.xyz)); - - vec3 shadow_pos = pos.xyz + displace*norm; - vec3 offset = vary_light.xyz * (1.0-dp_directional_light); - - vec4 spos = vec4(shadow_pos+offset*shadow_offset, 1.0); - - if (spos.z > -shadow_clip.w) - { - if (dp_directional_light == 0.0) - { - // if we know this point is facing away from the sun then we know it's in shadow without having to do a squirrelly shadow-map lookup - shadow = 0.0; - } - else - { - vec4 lpos; - - if (spos.z < -shadow_clip.z) - { - lpos = shadow_matrix[3]*spos; - lpos.xy *= shadow_res; - shadow = pcfShadow(shadowMap3, lpos, 0.25); - shadow += max((pos.z+shadow_clip.z)/(shadow_clip.z-shadow_clip.w)*2.0-1.0, 0.0); - } - else if (spos.z < -shadow_clip.y) - { - lpos = shadow_matrix[2]*spos; - lpos.xy *= shadow_res; - shadow = pcfShadow(shadowMap2, lpos, 0.5); - } - else if (spos.z < -shadow_clip.x) - { - lpos = shadow_matrix[1]*spos; - lpos.xy *= shadow_res; - shadow = pcfShadow(shadowMap1, lpos, 0.75); - } - else - { - lpos = shadow_matrix[0]*spos; - lpos.xy *= shadow_res; - shadow = pcfShadow(shadowMap0, lpos, 1.0); - } - - // take the most-shadowed value out of these two: - // * the blurred sun shadow in the light (shadow) map - // * an unblurred dot product between the sun and this norm - // the goal is to err on the side of most-shadow to fill-in shadow holes and reduce artifacting - shadow = min(shadow, dp_directional_light); - - //lpos.xy /= lpos.w*32.0; - //if (fract(lpos.x) < 0.1 || fract(lpos.y) < 0.1) - //{ - // shadow = 0.0; - //} - - } - } - else - { - // more distant than the shadow map covers - shadow = 1.0; - } - - fcol[0] += shadow; - fcol[1] += 1.0; - - spos = vec4(shadow_pos+norm*spot_shadow_offset, 1.0); - - //spotlight shadow 1 - vec4 lpos = shadow_matrix[4]*spos; - fcol[2] += pcfShadow(shadowMap4, lpos, 0.8); - - //spotlight shadow 2 - lpos = shadow_matrix[5]*spos; - fcol[3] += pcfShadow(shadowMap5, lpos, 0.8); - } - - gl_FragColor = fcol/samples; -} diff --git a/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl b/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl index 681186d6b2..6b420833b9 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl @@ -22,10 +22,12 @@ * $/LicenseInfo$ */ - - #extension GL_ARB_texture_rectangle : enable +#ifdef DEFINE_GL_FRAGCOLOR +out vec4 gl_FragColor; +#endif + //class 2 -- shadows and SSAO uniform sampler2DRect depthMap; @@ -38,6 +40,7 @@ uniform sampler2DShadow shadowMap4; uniform sampler2DShadow shadowMap5; uniform sampler2D noiseMap; + // Inputs uniform mat4 shadow_matrix[6]; uniform vec4 shadow_clip; @@ -46,13 +49,13 @@ uniform float ssao_max_radius; uniform float ssao_factor; uniform float ssao_factor_inv; -varying vec2 vary_fragcoord; -varying vec4 vary_light; +VARYING vec2 vary_fragcoord; uniform mat4 inv_proj; uniform vec2 screen_res; uniform vec2 shadow_res; uniform vec2 proj_shadow_res; +uniform vec3 sun_dir; uniform float shadow_bias; uniform float shadow_offset; @@ -73,11 +76,8 @@ vec4 getPosition(vec2 pos_screen) return pos; } -//calculate decreases in ambient lighting when crowded out (SSAO) -float calcAmbientOcclusion(vec4 pos, vec3 norm) +vec2 getKern(int i) { - float ret = 1.0; - vec2 kern[8]; // exponentially (^2) distant occlusion samples spread around origin kern[0] = vec2(-1.0, 0.0) * 0.125*0.125; @@ -88,22 +88,30 @@ float calcAmbientOcclusion(vec4 pos, vec3 norm) kern[5] = vec2(-0.7071, -0.7071) * 0.750*0.750; kern[6] = vec2(-0.7071, 0.7071) * 0.875*0.875; kern[7] = vec2(0.7071, -0.7071) * 1.000*1.000; + + return kern[i]; +} + +//calculate decreases in ambient lighting when crowded out (SSAO) +float calcAmbientOcclusion(vec4 pos, vec3 norm) +{ + float ret = 1.0; vec2 pos_screen = vary_fragcoord.xy; vec3 pos_world = pos.xyz; vec2 noise_reflect = texture2D(noiseMap, vary_fragcoord.xy/128.0).xy; float angle_hidden = 0.0; - int points = 0; + float points = 0; float scale = min(ssao_radius / -pos_world.z, ssao_max_radius); - + // it was found that keeping # of samples a constant was the fastest, probably due to compiler optimizations (unrolling?) for (int i = 0; i < 8; i++) { - vec2 samppos_screen = pos_screen + scale * reflect(kern[i], noise_reflect); + vec2 samppos_screen = pos_screen + scale * reflect(getKern(i), noise_reflect); vec3 samppos_world = getPosition(samppos_screen).xyz; - + vec3 diff = pos_world - samppos_world; float dist2 = dot(diff, diff); @@ -111,17 +119,21 @@ float calcAmbientOcclusion(vec4 pos, vec3 norm) // --> solid angle shrinking by the square of distance //radius is somewhat arbitrary, can approx with just some constant k * 1 / dist^2 //(k should vary inversely with # of samples, but this is taken care of later) - - angle_hidden = angle_hidden + float(dot((samppos_world - 0.05*norm - pos_world), norm) > 0.0) * min(1.0/dist2, ssao_factor_inv); + + float funky_val = (dot((samppos_world - 0.05*norm - pos_world), norm) > 0.0) ? 1.0 : 0.0; + angle_hidden = angle_hidden + funky_val * min(1.0/dist2, ssao_factor_inv); // 'blocked' samples (significantly closer to camera relative to pos_world) are "no data", not "no occlusion" - points = points + int(diff.z > -1.0); + float diffz_val = (diff.z > -1.0) ? 1.0 : 0.0; + points = points + diffz_val; } - angle_hidden = min(ssao_factor*angle_hidden/float(points), 1.0); - - ret = (1.0 - (float(points != 0) * angle_hidden)); + angle_hidden = min(ssao_factor*angle_hidden/points, 1.0); + float points_val = (points > 0.0) ? 1.0 : 0.0; + ret = (1.0 - (points_val * angle_hidden)); + + ret = max(ret, 0.0); return min(ret, 1.0); } @@ -158,7 +170,6 @@ float pcfShadow(sampler2DShadow shadowMap, vec4 stc, float scl) shadow += max(shadow2D(shadowMap, stc.xyz+vec3(-off.x, off.y, 0.0)).x, cs); shadow += max(shadow2D(shadowMap, stc.xyz+vec3(-off.x, -off.y, 0.0)).x, cs); - return shadow/5.0; //return shadow; @@ -184,10 +195,10 @@ void main() }*/ float shadow = 1.0; - float dp_directional_light = max(0.0, dot(norm, vary_light.xyz)); + float dp_directional_light = max(0.0, dot(norm, sun_dir.xyz)); vec3 shadow_pos = pos.xyz + displace*norm; - vec3 offset = vary_light.xyz * (1.0-dp_directional_light); + vec3 offset = sun_dir.xyz * (1.0-dp_directional_light); vec4 spos = vec4(shadow_pos+offset*shadow_offset, 1.0); @@ -251,7 +262,7 @@ void main() gl_FragColor[0] = shadow; gl_FragColor[1] = calcAmbientOcclusion(pos, norm); - spos.xyz = shadow_pos+norm*spot_shadow_offset; + spos = vec4(shadow_pos+norm*spot_shadow_offset, 1.0); //spotlight shadow 1 vec4 lpos = shadow_matrix[4]*spos; diff --git a/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOMSF.glsl b/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOMSF.glsl deleted file mode 100644 index 0fd7b7525d..0000000000 --- a/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOMSF.glsl +++ /dev/null @@ -1,258 +0,0 @@ -/** - * @file sunLightSSAOF.glsl - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2007, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - - - -#extension GL_ARB_texture_rectangle : enable -#extension GL_ARB_texture_multisample : enable - -//class 2 -- shadows and SSAO - -uniform sampler2DMS depthMap; -uniform sampler2DMS normalMap; -uniform sampler2DRectShadow shadowMap0; -uniform sampler2DRectShadow shadowMap1; -uniform sampler2DRectShadow shadowMap2; -uniform sampler2DRectShadow shadowMap3; -uniform sampler2DShadow shadowMap4; -uniform sampler2DShadow shadowMap5; -uniform sampler2D noiseMap; - -// Inputs -uniform mat4 shadow_matrix[6]; -uniform vec4 shadow_clip; -uniform float ssao_radius; -uniform float ssao_max_radius; -uniform float ssao_factor; -uniform float ssao_factor_inv; - -varying vec2 vary_fragcoord; -varying vec4 vary_light; - -uniform mat4 inv_proj; -uniform vec2 screen_res; -uniform vec2 shadow_res; -uniform vec2 proj_shadow_res; - -uniform float shadow_bias; -uniform float shadow_offset; - -uniform float spot_shadow_bias; -uniform float spot_shadow_offset; - -vec4 getPosition(ivec2 pos_screen, int sample) -{ - float depth = texelFetch(depthMap, pos_screen, sample).r; - vec2 sc = vec2(pos_screen.xy)*2.0; - sc /= screen_res; - sc -= vec2(1.0,1.0); - vec4 ndc = vec4(sc.x, sc.y, 2.0*depth-1.0, 1.0); - vec4 pos = inv_proj * ndc; - pos /= pos.w; - pos.w = 1.0; - return pos; -} - -//calculate decreases in ambient lighting when crowded out (SSAO) -float calcAmbientOcclusion(vec4 pos, vec3 norm, int sample) -{ - float ret = 1.0; - - vec2 kern[8]; - // exponentially (^2) distant occlusion samples spread around origin - kern[0] = vec2(-1.0, 0.0) * 0.125*0.125; - kern[1] = vec2(1.0, 0.0) * 0.250*0.250; - kern[2] = vec2(0.0, 1.0) * 0.375*0.375; - kern[3] = vec2(0.0, -1.0) * 0.500*0.500; - kern[4] = vec2(0.7071, 0.7071) * 0.625*0.625; - kern[5] = vec2(-0.7071, -0.7071) * 0.750*0.750; - kern[6] = vec2(-0.7071, 0.7071) * 0.875*0.875; - kern[7] = vec2(0.7071, -0.7071) * 1.000*1.000; - - vec2 pos_screen = vary_fragcoord.xy; - vec3 pos_world = pos.xyz; - vec2 noise_reflect = texture2D(noiseMap, vary_fragcoord.xy/128.0).xy; - - float angle_hidden = 0.0; - int points = 0; - - float scale = min(ssao_radius / -pos_world.z, ssao_max_radius); - - // it was found that keeping # of samples a constant was the fastest, probably due to compiler optimizations (unrolling?) - for (int i = 0; i < 8; i++) - { - ivec2 samppos_screen = ivec2(pos_screen + scale * reflect(kern[i], noise_reflect)); - vec3 samppos_world = getPosition(samppos_screen, sample).xyz; - - vec3 diff = pos_world - samppos_world; - float dist2 = dot(diff, diff); - - // assume each sample corresponds to an occluding sphere with constant radius, constant x-sectional area - // --> solid angle shrinking by the square of distance - //radius is somewhat arbitrary, can approx with just some constant k * 1 / dist^2 - //(k should vary inversely with # of samples, but this is taken care of later) - - angle_hidden = angle_hidden + float(dot((samppos_world - 0.05*norm - pos_world), norm) > 0.0) * min(1.0/dist2, ssao_factor_inv); - - // 'blocked' samples (significantly closer to camera relative to pos_world) are "no data", not "no occlusion" - points = points + int(diff.z > -1.0); - } - - angle_hidden = min(ssao_factor*angle_hidden/float(points), 1.0); - - ret = (1.0 - (float(points != 0) * angle_hidden)); - - return min(ret, 1.0); -} - -float pcfShadow(sampler2DRectShadow shadowMap, vec4 stc, float scl) -{ - stc.xyz /= stc.w; - stc.z += shadow_bias*scl; - - float cs = shadow2DRect(shadowMap, stc.xyz).x; - float shadow = cs; - - shadow += max(shadow2DRect(shadowMap, stc.xyz+vec3(1.5, 1.5, 0.0)).x, cs); - shadow += max(shadow2DRect(shadowMap, stc.xyz+vec3(1.5, -1.5, 0.0)).x, cs); - shadow += max(shadow2DRect(shadowMap, stc.xyz+vec3(-1.5, 1.5, 0.0)).x, cs); - shadow += max(shadow2DRect(shadowMap, stc.xyz+vec3(-1.5, -1.5, 0.0)).x, cs); - - return shadow/5.0; - - //return shadow; -} - -float pcfShadow(sampler2DShadow shadowMap, vec4 stc, float scl) -{ - stc.xyz /= stc.w; - stc.z += spot_shadow_bias*scl; - - float cs = shadow2D(shadowMap, stc.xyz).x; - float shadow = cs; - - vec2 off = 1.5/proj_shadow_res; - - shadow += max(shadow2D(shadowMap, stc.xyz+vec3(off.x, off.y, 0.0)).x, cs); - shadow += max(shadow2D(shadowMap, stc.xyz+vec3(off.x, -off.y, 0.0)).x, cs); - shadow += max(shadow2D(shadowMap, stc.xyz+vec3(-off.x, off.y, 0.0)).x, cs); - shadow += max(shadow2D(shadowMap, stc.xyz+vec3(-off.x, -off.y, 0.0)).x, cs); - - - return shadow/5.0; - - //return shadow; -} - -void main() -{ - vec2 pos_screen = vary_fragcoord.xy; - ivec2 itc = ivec2(pos_screen); - vec4 fcol = vec4(0,0,0,0); - - for (int i = 0; i < samples; i++) - { - vec4 pos = getPosition(itc, i); - - vec4 nmap4 = texelFetch(normalMap, itc, i); - nmap4 = vec4((nmap4.xy-0.5)*2.0,nmap4.z,nmap4.w); // unpack norm - float displace = nmap4.w; - vec3 norm = nmap4.xyz; - - float shadow = 1.0; - float dp_directional_light = max(0.0, dot(norm, vary_light.xyz)); - - vec3 shadow_pos = pos.xyz + displace*norm; - vec3 offset = vary_light.xyz * (1.0-dp_directional_light); - - vec4 spos = vec4(shadow_pos+offset*shadow_offset, 1.0); - - if (spos.z > -shadow_clip.w) - { - if (dp_directional_light == 0.0) - { - // if we know this point is facing away from the sun then we know it's in shadow without having to do a squirrelly shadow-map lookup - shadow = 0.0; - } - else - { - vec4 lpos; - - if (spos.z < -shadow_clip.z) - { - lpos = shadow_matrix[3]*spos; - lpos.xy *= shadow_res; - shadow = pcfShadow(shadowMap3, lpos, 0.25); - shadow += max((pos.z+shadow_clip.z)/(shadow_clip.z-shadow_clip.w)*2.0-1.0, 0.0); - } - else if (spos.z < -shadow_clip.y) - { - lpos = shadow_matrix[2]*spos; - lpos.xy *= shadow_res; - shadow = pcfShadow(shadowMap2, lpos, 0.5); - } - else if (spos.z < -shadow_clip.x) - { - lpos = shadow_matrix[1]*spos; - lpos.xy *= shadow_res; - shadow = pcfShadow(shadowMap1, lpos, 0.75); - } - else - { - lpos = shadow_matrix[0]*spos; - lpos.xy *= shadow_res; - shadow = pcfShadow(shadowMap0, lpos, 1.0); - } - - // take the most-shadowed value out of these two: - // * the blurred sun shadow in the light (shadow) map - // * an unblurred dot product between the sun and this norm - // the goal is to err on the side of most-shadow to fill-in shadow holes and reduce artifacting - shadow = min(shadow, dp_directional_light); - - } - } - else - { - // more distant than the shadow map covers - shadow = 1.0; - } - - - fcol[0] += shadow; - fcol[1] += calcAmbientOcclusion(pos, norm, i); - - spos.xyz = shadow_pos+offset*spot_shadow_offset; - - //spotlight shadow 1 - vec4 lpos = shadow_matrix[4]*spos; - fcol[2] += pcfShadow(shadowMap4, lpos, 0.8); - - //spotlight shadow 2 - lpos = shadow_matrix[5]*spos; - fcol[3] += pcfShadow(shadowMap5, lpos, 0.8); - } - - gl_FragColor = fcol / samples; -} diff --git a/indra/newview/app_settings/shaders/class2/deferred/sunLightV.glsl b/indra/newview/app_settings/shaders/class2/deferred/sunLightV.glsl index e7ab11c6ed..bc5eb5181d 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/sunLightV.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/sunLightV.glsl @@ -1,5 +1,5 @@ /** - * @file sunLightF.glsl + * @file sunLightV.glsl * * $LicenseInfo:firstyear=2007&license=viewerlgpl$ * Second Life Viewer Source Code @@ -22,24 +22,20 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - +uniform mat4 modelview_projection_matrix; -varying vec4 vary_light; -varying vec2 vary_fragcoord; +ATTRIBUTE vec3 position; + +VARYING vec2 vary_fragcoord; uniform vec2 screen_res; void main() { //transform vertex - gl_Position = ftransform(); - vec4 pos = gl_ModelViewProjectionMatrix * gl_Vertex; - vary_fragcoord = (pos.xy * 0.5 + 0.5)*screen_res; - vec4 tex = gl_MultiTexCoord0; - tex.w = 1.0; + vec4 pos = modelview_projection_matrix * vec4(position.xyz, 1.0); + gl_Position = pos; - vary_light = gl_MultiTexCoord0; - - gl_FrontColor = gl_Color; + vary_fragcoord = (pos.xy * 0.5 + 0.5)*screen_res; } diff --git a/indra/newview/app_settings/shaders/class2/effects/blurF.glsl b/indra/newview/app_settings/shaders/class2/effects/blurF.glsl deleted file mode 100644 index 35411db04b..0000000000 --- a/indra/newview/app_settings/shaders/class2/effects/blurF.glsl +++ /dev/null @@ -1,51 +0,0 @@ -/** - * @file blurf.glsl - * - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2007, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - - - -uniform sampler2DRect RenderTexture; -uniform float bloomStrength; - -varying vec4 gl_TexCoord[gl_MaxTextureCoords]; -void main(void) -{ - float blurWeights[7]; - blurWeights[0] = 0.05; - blurWeights[1] = 0.1; - blurWeights[2] = 0.2; - blurWeights[3] = 0.3; - blurWeights[4] = 0.2; - blurWeights[5] = 0.1; - blurWeights[6] = 0.05; - - vec3 color = vec3(0,0,0); - for (int i = 0; i < 7; i++){ - color += vec3(texture2DRect(RenderTexture, gl_TexCoord[i].st)) * blurWeights[i]; - } - - color *= bloomStrength; - - gl_FragColor = vec4(color, 1.0); -} diff --git a/indra/newview/app_settings/shaders/class2/effects/blurV.glsl b/indra/newview/app_settings/shaders/class2/effects/blurV.glsl deleted file mode 100644 index 3e47ed15fe..0000000000 --- a/indra/newview/app_settings/shaders/class2/effects/blurV.glsl +++ /dev/null @@ -1,55 +0,0 @@ -/** - * @file blurV.glsl - * - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2007, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - - - -uniform vec2 texelSize; -uniform vec2 blurDirection; -uniform float blurWidth; - -void main(void) -{ - // Transform vertex - gl_Position = ftransform(); - - vec2 blurDelta = texelSize * blurDirection * vec2(blurWidth, blurWidth); - vec2 s = gl_MultiTexCoord0.st - (blurDelta * 3.0); - - // for (int i = 0; i < 7; i++) { - // gl_TexCoord[i].st = s + (i * blurDelta); - // } - - // MANUALLY UNROLL - gl_TexCoord[0].st = s; - gl_TexCoord[1].st = s + blurDelta; - gl_TexCoord[2].st = s + (2. * blurDelta); - gl_TexCoord[3].st = s + (3. * blurDelta); - gl_TexCoord[4].st = s + (4. * blurDelta); - gl_TexCoord[5].st = s + (5. * blurDelta); - gl_TexCoord[6].st = s + (6. * blurDelta); - - // gl_TexCoord[0].st = s; - // gl_TexCoord[1].st = blurDelta; -} diff --git a/indra/newview/app_settings/shaders/class2/effects/colorFilterF.glsl b/indra/newview/app_settings/shaders/class2/effects/colorFilterF.glsl deleted file mode 100644 index 42ab8d40e8..0000000000 --- a/indra/newview/app_settings/shaders/class2/effects/colorFilterF.glsl +++ /dev/null @@ -1,51 +0,0 @@ -/** - * @file colorFilterF.glsl - * - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2007, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - - - -uniform sampler2DRect RenderTexture; -uniform float brightness; -uniform float contrast; -uniform vec3 contrastBase; -uniform float saturation; -uniform vec3 lumWeights; - -const float gamma = 2.0; - -void main(void) -{ - vec3 color = vec3(texture2DRect(RenderTexture, gl_TexCoord[0].st)); - - /// Modulate brightness - color *= brightness; - - /// Modulate contrast - color = mix(contrastBase, color, contrast); - - /// Modulate saturation - color = mix(vec3(dot(color, lumWeights)), color, saturation); - - gl_FragColor = vec4(color, 1.0); -} diff --git a/indra/newview/app_settings/shaders/class2/effects/extractF.glsl b/indra/newview/app_settings/shaders/class2/effects/extractF.glsl deleted file mode 100644 index 9187c8ec31..0000000000 --- a/indra/newview/app_settings/shaders/class2/effects/extractF.glsl +++ /dev/null @@ -1,42 +0,0 @@ -/** - * @file extractF.glsl - * - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2007, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - - - -uniform sampler2DRect RenderTexture; -uniform float extractLow; -uniform float extractHigh; -uniform vec3 lumWeights; - -void main(void) -{ - /// Get scene color - vec3 color = vec3(texture2DRect(RenderTexture, gl_TexCoord[0].st)); - - /// Extract luminance and scale up by night vision brightness - float lum = smoothstep(extractLow, extractHigh, dot(color, lumWeights)); - - gl_FragColor = vec4(vec3(lum), 1.0); -} diff --git a/indra/newview/app_settings/shaders/class2/effects/nightVisionF.glsl b/indra/newview/app_settings/shaders/class2/effects/nightVisionF.glsl deleted file mode 100644 index 76b675a9bd..0000000000 --- a/indra/newview/app_settings/shaders/class2/effects/nightVisionF.glsl +++ /dev/null @@ -1,62 +0,0 @@ -/** - * @file nightVisionF.glsl - * - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2007, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - - - -uniform sampler2DRect RenderTexture; -uniform sampler2D NoiseTexture; -uniform float brightMult; -uniform float noiseStrength; - -float luminance(vec3 color) -{ - /// CALCULATING LUMINANCE (Using NTSC lum weights) - /// http://en.wikipedia.org/wiki/Luma_%28video%29 - return dot(color, vec3(0.299, 0.587, 0.114)); -} - -void main(void) -{ - /// Get scene color - vec3 color = vec3(texture2DRect(RenderTexture, gl_TexCoord[0].st)); - - /// Extract luminance and scale up by night vision brightness - float lum = luminance(color) * brightMult; - - /// Convert into night vision color space - /// Newer NVG colors (crisper and more saturated) - vec3 outColor = (lum * vec3(0.91, 1.21, 0.9)) + vec3(-0.07, 0.1, -0.12); - - /// Add noise - float noiseValue = texture2D(NoiseTexture, gl_TexCoord[1].st).r; - noiseValue = (noiseValue - 0.5) * noiseStrength; - - /// Older NVG colors (more muted) - // vec3 outColor = (lum * vec3(0.82, 0.75, 0.83)) + vec3(0.05, 0.32, -0.11); - - outColor += noiseValue; - - gl_FragColor = vec4(outColor, 1.0); -} diff --git a/indra/newview/app_settings/shaders/class2/environment/terrainF.glsl b/indra/newview/app_settings/shaders/class2/environment/terrainF.glsl deleted file mode 100644 index df08fce0da..0000000000 --- a/indra/newview/app_settings/shaders/class2/environment/terrainF.glsl +++ /dev/null @@ -1,58 +0,0 @@ -/** - * @file terrainF.glsl - * - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2007, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - - - -uniform sampler2D detail_0; -uniform sampler2D detail_1; -uniform sampler2D detail_2; -uniform sampler2D detail_3; -uniform sampler2D alpha_ramp; - -vec3 atmosLighting(vec3 light); - -vec3 scaleSoftClip(vec3 color); - -void main() -{ - /// Note: This should duplicate the blending functionality currently used for the terrain rendering. - - /// TODO Confirm tex coords and bind them appropriately in vert shader. - vec4 color0 = texture2D(detail_0, gl_TexCoord[0].xy); - vec4 color1 = texture2D(detail_1, gl_TexCoord[0].xy); - vec4 color2 = texture2D(detail_2, gl_TexCoord[0].xy); - vec4 color3 = texture2D(detail_3, gl_TexCoord[0].xy); - - float alpha1 = texture2D(alpha_ramp, gl_TexCoord[0].zw).a; - float alpha2 = texture2D(alpha_ramp,gl_TexCoord[1].xy).a; - float alphaFinal = texture2D(alpha_ramp, gl_TexCoord[1].zw).a; - vec4 outColor = mix( mix(color3, color2, alpha2), mix(color1, color0, alpha1), alphaFinal ); - - /// Add WL Components - outColor.rgb = atmosLighting(outColor.rgb * gl_Color.rgb); - - gl_FragColor = vec4(scaleSoftClip(outColor.rgb), 1.0); -} - diff --git a/indra/newview/app_settings/shaders/class2/environment/terrainWaterF.glsl b/indra/newview/app_settings/shaders/class2/environment/terrainWaterF.glsl deleted file mode 100644 index 90468b45a2..0000000000 --- a/indra/newview/app_settings/shaders/class2/environment/terrainWaterF.glsl +++ /dev/null @@ -1,59 +0,0 @@ -/** - * @file terrainWaterF.glsl - * - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2007, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - - - -uniform sampler2D detail_0; -uniform sampler2D detail_1; -uniform sampler2D detail_2; -uniform sampler2D detail_3; -uniform sampler2D alpha_ramp; - -vec3 atmosLighting(vec3 light); - -vec4 applyWaterFog(vec4 color); - -void main() -{ - /// Note: This should duplicate the blending functionality currently used for the terrain rendering. - - /// TODO Confirm tex coords and bind them appropriately in vert shader. - vec4 color0 = texture2D(detail_0, gl_TexCoord[0].xy); - vec4 color1 = texture2D(detail_1, gl_TexCoord[0].xy); - vec4 color2 = texture2D(detail_2, gl_TexCoord[0].xy); - vec4 color3 = texture2D(detail_3, gl_TexCoord[0].xy); - - float alpha1 = texture2D(alpha_ramp, gl_TexCoord[0].zw).a; - float alpha2 = texture2D(alpha_ramp,gl_TexCoord[1].xy).a; - float alphaFinal = texture2D(alpha_ramp, gl_TexCoord[1].zw).a; - vec4 outColor = mix( mix(color3, color2, alpha2), mix(color1, color0, alpha1), alphaFinal ); - - /// Add WL Components - outColor.rgb = atmosLighting(outColor.rgb * gl_Color.rgb); - - outColor = applyWaterFog(outColor); - gl_FragColor = outColor; -} - diff --git a/indra/newview/app_settings/shaders/class2/environment/underWaterF.glsl b/indra/newview/app_settings/shaders/class2/environment/underWaterF.glsl deleted file mode 100644 index f947aa4be1..0000000000 --- a/indra/newview/app_settings/shaders/class2/environment/underWaterF.glsl +++ /dev/null @@ -1,108 +0,0 @@ -/** - * @file underWaterF.glsl - * - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2007, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - - - -uniform sampler2D diffuseMap; -uniform sampler2D bumpMap; -uniform sampler2D screenTex; -uniform sampler2D refTex; -uniform sampler2D screenDepth; - -uniform vec4 fogCol; -uniform vec3 lightDir; -uniform vec3 specular; -uniform float lightExp; -uniform vec2 fbScale; -uniform float refScale; -uniform float znear; -uniform float zfar; -uniform float kd; -uniform vec4 waterPlane; -uniform vec3 eyeVec; -uniform vec4 waterFogColor; -uniform float waterFogDensity; -uniform float waterFogKS; -uniform vec2 screenRes; - -//bigWave is (refCoord.w, view.w); -varying vec4 refCoord; -varying vec4 littleWave; -varying vec4 view; - -vec4 applyWaterFog(vec4 color, vec3 viewVec) -{ - //normalize view vector - vec3 view = normalize(viewVec); - float es = -view.z; - - //find intersection point with water plane and eye vector - - //get eye depth - float e0 = max(-waterPlane.w, 0.0); - - //get object depth - float depth = length(viewVec); - - //get "thickness" of water - float l = max(depth, 0.1); - - float kd = waterFogDensity; - float ks = waterFogKS; - vec4 kc = waterFogColor; - - float F = 0.98; - - float t1 = -kd * pow(F, ks * e0); - float t2 = kd + ks * es; - float t3 = pow(F, t2*l) - 1.0; - - float L = min(t1/t2*t3, 1.0); - - float D = pow(0.98, l*kd); - //return vec4(1.0, 0.0, 1.0, 1.0); - return color * D + kc * L; - //depth /= 10.0; - //return vec4(depth,depth,depth,0.0); -} - -void main() -{ - vec4 color; - - //get detail normals - vec3 wave1 = texture2D(bumpMap, vec2(refCoord.w, view.w)).xyz*2.0-1.0; - vec3 wave2 = texture2D(bumpMap, littleWave.xy).xyz*2.0-1.0; - vec3 wave3 = texture2D(bumpMap, littleWave.zw).xyz*2.0-1.0; - vec3 wavef = normalize(wave1+wave2+wave3); - - //figure out distortion vector (ripply) - vec2 distort = (refCoord.xy/refCoord.z) * 0.5 + 0.5; - distort = distort+wavef.xy*refScale; - - vec4 fb = texture2D(screenTex, distort); - - gl_FragColor = applyWaterFog(fb,view.xyz); -} diff --git a/indra/newview/app_settings/shaders/class2/environment/waterF.glsl b/indra/newview/app_settings/shaders/class2/environment/waterF.glsl deleted file mode 100644 index dc543b2231..0000000000 --- a/indra/newview/app_settings/shaders/class2/environment/waterF.glsl +++ /dev/null @@ -1,137 +0,0 @@ -/** - * @file waterF.glsl - * - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2007, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - - - -vec3 scaleSoftClip(vec3 inColor); -vec3 atmosTransport(vec3 inColor); - -uniform sampler2D bumpMap; -uniform sampler2D screenTex; -uniform sampler2D refTex; - -uniform float sunAngle; -uniform float sunAngle2; -uniform vec3 lightDir; -uniform vec3 specular; -uniform float lightExp; -uniform float refScale; -uniform float kd; -uniform vec2 screenRes; -uniform vec3 normScale; -uniform float fresnelScale; -uniform float fresnelOffset; -uniform float blurMultiplier; - - -//bigWave is (refCoord.w, view.w); -varying vec4 refCoord; -varying vec4 littleWave; -varying vec4 view; - -void main() -{ - vec4 color; - - float dist = length(view.xy); - - //normalize view vector - vec3 viewVec = normalize(view.xyz); - - //get wave normals - vec3 wave1 = texture2D(bumpMap, vec2(refCoord.w, view.w)).xyz*2.0-1.0; - vec3 wave2 = texture2D(bumpMap, littleWave.xy).xyz*2.0-1.0; - vec3 wave3 = texture2D(bumpMap, littleWave.zw).xyz*2.0-1.0; - //get base fresnel components - - vec3 df = vec3( - dot(viewVec, wave1), - dot(viewVec, (wave2 + wave3) * 0.5), - dot(viewVec, wave3) - ) * fresnelScale + fresnelOffset; - df *= df; - - vec2 distort = (refCoord.xy/refCoord.z) * 0.5 + 0.5; - - float dist2 = dist; - dist = max(dist, 5.0); - - float dmod = sqrt(dist); - - vec2 dmod_scale = vec2(dmod*dmod, dmod); - - //get reflected color - vec2 refdistort1 = wave1.xy*normScale.x; - vec2 refvec1 = distort+refdistort1/dmod_scale; - vec4 refcol1 = texture2D(refTex, refvec1); - - vec2 refdistort2 = wave2.xy*normScale.y; - vec2 refvec2 = distort+refdistort2/dmod_scale; - vec4 refcol2 = texture2D(refTex, refvec2); - - vec2 refdistort3 = wave3.xy*normScale.z; - vec2 refvec3 = distort+refdistort3/dmod_scale; - vec4 refcol3 = texture2D(refTex, refvec3); - - vec4 refcol = refcol1 + refcol2 + refcol3; - float df1 = df.x + df.y + df.z; - refcol *= df1 * 0.333; - - vec3 wavef = (wave1 + wave2 * 0.4 + wave3 * 0.6) * 0.5; - - wavef.z *= max(-viewVec.z, 0.1); - wavef = normalize(wavef); - - float df2 = dot(viewVec, wavef) * fresnelScale+fresnelOffset; - - vec2 refdistort4 = wavef.xy*0.125; - refdistort4.y -= abs(refdistort4.y); - vec2 refvec4 = distort+refdistort4/dmod; - float dweight = min(dist2*blurMultiplier, 1.0); - vec4 baseCol = texture2D(refTex, refvec4); - refcol = mix(baseCol*df2, refcol, dweight); - - //get specular component - float spec = clamp(dot(lightDir, (reflect(viewVec,wavef))),0.0,1.0); - - //harden specular - spec = pow(spec, 128.0); - - //figure out distortion vector (ripply) - vec2 distort2 = distort+wavef.xy*refScale/max(dmod*df1, 1.0); - - vec4 fb = texture2D(screenTex, distort2); - - //mix with reflection - // Note we actually want to use just df1, but multiplying by 0.999999 gets around and nvidia compiler bug - color.rgb = mix(fb.rgb, refcol.rgb, df1 * 0.99999); - color.rgb += spec * specular; - - color.rgb = atmosTransport(color.rgb); - color.rgb = scaleSoftClip(color.rgb); - color.a = spec * sunAngle2; - - gl_FragColor = color; -} diff --git a/indra/newview/app_settings/shaders/class2/environment/waterFogF.glsl b/indra/newview/app_settings/shaders/class2/environment/waterFogF.glsl deleted file mode 100644 index 4bdfce9260..0000000000 --- a/indra/newview/app_settings/shaders/class2/environment/waterFogF.glsl +++ /dev/null @@ -1,74 +0,0 @@ -/** - * @file waterFogF.glsl - * - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2007, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - - - -uniform vec4 lightnorm; -uniform vec4 waterPlane; -uniform vec4 waterFogColor; -uniform float waterFogDensity; -uniform float waterFogKS; - -vec3 getPositionEye(); - -vec4 applyWaterFog(vec4 color) -{ - //normalize view vector - vec3 view = normalize(getPositionEye()); - float es = -(dot(view, waterPlane.xyz)); - - //find intersection point with water plane and eye vector - - //get eye depth - float e0 = max(-waterPlane.w, 0.0); - - vec3 int_v = waterPlane.w > 0.0 ? view * waterPlane.w/es : vec3(0.0, 0.0, 0.0); - - //get object depth - float depth = length(getPositionEye() - int_v); - - //get "thickness" of water - float l = max(depth, 0.1); - - float kd = waterFogDensity; - float ks = waterFogKS; - vec4 kc = waterFogColor; - - float F = 0.98; - - float t1 = -kd * pow(F, ks * e0); - float t2 = kd + ks * es; - float t3 = pow(F, t2*l) - 1.0; - - float L = min(t1/t2*t3, 1.0); - - float D = pow(0.98, l*kd); - - color.rgb = color.rgb * D + kc.rgb * L; - color.a = kc.a + color.a; - - return color; -} - diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyF.glsl deleted file mode 100644 index d2bc912edb..0000000000 --- a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyF.glsl +++ /dev/null @@ -1,49 +0,0 @@ -/** - * @file lightFullbrightShinyF.glsl - * - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2007, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - - - -uniform samplerCube environmentMap; - -vec3 fullbrightShinyAtmosTransport(vec3 light); -vec3 fullbrightScaleSoftClip(vec3 light); - -void fullbright_shiny_lighting() -{ - vec4 color = diffuseLookup(gl_TexCoord[0].xy); - color.rgb *= gl_Color.rgb; - - vec3 envColor = textureCube(environmentMap, gl_TexCoord[1].xyz).rgb; - color.rgb = mix(color.rgb, envColor.rgb, gl_Color.a); - - color.rgb = fullbrightShinyAtmosTransport(color.rgb); - - color.rgb = fullbrightScaleSoftClip(color.rgb); - - color.a = max(color.a, gl_Color.a); - - gl_FragColor = color; -} - diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyWaterF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyWaterF.glsl deleted file mode 100644 index e9dab85095..0000000000 --- a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyWaterF.glsl +++ /dev/null @@ -1,48 +0,0 @@ -/** - * @file lightFullbrightShinyWaterF.glsl - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2007, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - - - - -uniform samplerCube environmentMap; - -vec3 fullbrightShinyAtmosTransport(vec3 light); -vec3 fullbrightScaleSoftClip(vec3 light); -vec4 applyWaterFog(vec4 color); - -void fullbright_shiny_lighting_water() -{ - vec4 color = diffuseLookup(gl_TexCoord[0].xy); - color.rgb *= gl_Color.rgb; - - vec3 envColor = textureCube(environmentMap, gl_TexCoord[1].xyz).rgb; - color.rgb = mix(color.rgb, envColor.rgb, gl_Color.a); - - color.rgb = fullbrightShinyAtmosTransport(color.rgb); - color.rgb = fullbrightScaleSoftClip(color.rgb); - color.a = max(color.a, gl_Color.a); - - gl_FragColor = applyWaterFog(color); -} - diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterF.glsl deleted file mode 100644 index 20ff3712af..0000000000 --- a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterF.glsl +++ /dev/null @@ -1,41 +0,0 @@ -/** - * @file lightFullbrightWaterF.glsl - * - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2007, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - - - -vec4 diffuseLookup(vec2 texcoord); - -vec3 fullbrightAtmosTransport(vec3 light); -vec4 applyWaterFog(vec4 color); - -void fullbright_lighting_water() -{ - vec4 color = diffuseLookup(gl_TexCoord[0].xy) * gl_Color; - - color.rgb = fullbrightAtmosTransport(color.rgb); - - gl_FragColor = applyWaterFog(color); -} - diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightShinyF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightShinyF.glsl deleted file mode 100644 index ba4cd949d6..0000000000 --- a/indra/newview/app_settings/shaders/class2/lighting/lightShinyF.glsl +++ /dev/null @@ -1,49 +0,0 @@ -/** - * @file lightShinyF.glsl - * - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2007, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - - - - -uniform samplerCube environmentMap; - -vec3 scaleSoftClip(vec3 light); -vec3 atmosLighting(vec3 light); -vec4 applyWaterFog(vec4 color); - -void shiny_lighting() -{ - vec4 color = diffuseLookup(gl_TexCoord[0].xy); - color.rgb *= gl_Color.rgb; - - vec3 envColor = textureCube(environmentMap, gl_TexCoord[1].xyz).rgb; - color.rgb = mix(color.rgb, envColor.rgb, gl_Color.a); - - color.rgb = atmosLighting(color.rgb); - - color.rgb = scaleSoftClip(color.rgb); - color.a = max(color.a, gl_Color.a); - gl_FragColor = color; -} - diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightShinyWaterF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightShinyWaterF.glsl deleted file mode 100644 index c451e68763..0000000000 --- a/indra/newview/app_settings/shaders/class2/lighting/lightShinyWaterF.glsl +++ /dev/null @@ -1,46 +0,0 @@ -/** - * @file lightShinyWaterF.glsl - * - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2007, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - - - - -uniform samplerCube environmentMap; - -vec3 atmosLighting(vec3 light); -vec4 applyWaterFog(vec4 color); - -void shiny_lighting_water() -{ - vec4 color = diffuseLookup(gl_TexCoord[0].xy); - color.rgb *= gl_Color.rgb; - - vec3 envColor = textureCube(environmentMap, gl_TexCoord[1].xyz).rgb; - color.rgb = mix(color.rgb, envColor.rgb, gl_Color.a); - - color.rgb = atmosLighting(color.rgb); - color.a = max(color.a, gl_Color.a); - gl_FragColor = applyWaterFog(color); -} - diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightSpecularV.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightSpecularV.glsl deleted file mode 100644 index 24bf9b3cee..0000000000 --- a/indra/newview/app_settings/shaders/class2/lighting/lightSpecularV.glsl +++ /dev/null @@ -1,36 +0,0 @@ -/** - * @file lightSpecularV.glsl - * - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2007, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - - - -// All lights, no specular highlights - -vec4 sumLightsSpecular(vec3 pos, vec3 norm, vec4 color, inout vec4 specularColor, vec4 baseCol); - -vec4 calcLightingSpecular(vec3 pos, vec3 norm, vec4 color, inout vec4 specularColor, vec4 baseCol) -{ - return sumLightsSpecular(pos, norm, color, specularColor, baseCol); -} - diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightV.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightV.glsl deleted file mode 100644 index 8045809b82..0000000000 --- a/indra/newview/app_settings/shaders/class2/lighting/lightV.glsl +++ /dev/null @@ -1,36 +0,0 @@ -/** - * @file lightV.glsl - * - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2007, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - - - -// All lights, no specular highlights - -vec4 sumLights(vec3 pos, vec3 norm, vec4 color, vec4 baseLight); - -vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseLight) -{ - return sumLights(pos, norm, color, baseLight); -} - diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightWaterF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightWaterF.glsl deleted file mode 100644 index ae7be4d231..0000000000 --- a/indra/newview/app_settings/shaders/class2/lighting/lightWaterF.glsl +++ /dev/null @@ -1,39 +0,0 @@ -/** - * @file lightWaterF.glsl - * - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2007, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - - - -vec3 atmosLighting(vec3 light); -vec4 applyWaterFog(vec4 color); - -void default_lighting_water() -{ - vec4 color = diffuseLookup(gl_TexCoord[0].xy) * gl_Color; - - color.rgb = atmosLighting(color.rgb); - - gl_FragColor = applyWaterFog(color); -} - diff --git a/indra/newview/app_settings/shaders/class2/lighting/sumLightsSpecularV.glsl b/indra/newview/app_settings/shaders/class2/lighting/sumLightsSpecularV.glsl index d0a12479db..3acf9fe883 100644 --- a/indra/newview/app_settings/shaders/class2/lighting/sumLightsSpecularV.glsl +++ b/indra/newview/app_settings/shaders/class2/lighting/sumLightsSpecularV.glsl @@ -33,6 +33,10 @@ vec3 atmosAffectDirectionalLight(float lightIntensity); vec3 atmosGetDiffuseSunlightColor(); vec3 scaleDownLight(vec3 light); +uniform vec4 light_position[8]; +uniform vec3 light_attenuation[8]; +uniform vec3 light_diffuse[8]; + vec4 sumLightsSpecular(vec3 pos, vec3 norm, vec4 color, inout vec4 specularColor, vec4 baseCol) { vec4 col = vec4(0.0, 0.0, 0.0, color.a); @@ -43,15 +47,14 @@ vec4 sumLightsSpecular(vec3 pos, vec3 norm, vec4 color, inout vec4 specularColor vec4 specularSum = vec4(0.0); // Collect normal lights (need to be divided by two, as we later multiply by 2) - col.rgb += gl_LightSource[1].diffuse.rgb * calcDirectionalLightSpecular(specularColor, view, norm, gl_LightSource[1].position.xyz, gl_LightSource[1].diffuse.rgb, 1.0); - col.rgb += calcPointLightSpecular(specularSum, view, pos, norm, gl_LightSource[2].position.xyz, gl_LightSource[2].linearAttenuation, gl_LightSource[2].quadraticAttenuation, gl_LightSource[2].diffuse.rgb); - col.rgb += calcPointLightSpecular(specularSum, view, pos, norm, gl_LightSource[3].position.xyz, gl_LightSource[3].linearAttenuation, gl_LightSource[3].quadraticAttenuation, gl_LightSource[3].diffuse.rgb); - //col.rgb += calcPointLightSpecular(specularSum, view, pos, norm, gl_LightSource[4].position.xyz, gl_LightSource[4].linearAttenuation, gl_LightSource[4].quadraticAttenuation, gl_LightSource[4].diffuse.rgb); + col.rgb += light_diffuse[1].rgb * calcDirectionalLightSpecular(specularColor, view, norm, light_position[1].xyz,light_diffuse[1].rgb, 1.0); + col.rgb += calcPointLightSpecular(specularSum, view, pos, norm, light_position[2].xyz, light_attenuation[2].x, light_attenuation[2].y, light_diffuse[2].rgb); + col.rgb += calcPointLightSpecular(specularSum, view, pos, norm, light_position[3].xyz, light_attenuation[3].x, light_attenuation[3].y, light_diffuse[3].rgb); col.rgb = scaleDownLight(col.rgb); // Add windlight lights col.rgb += atmosAmbient(baseCol.rgb); - col.rgb += atmosAffectDirectionalLight(calcDirectionalLightSpecular(specularSum, view, norm, gl_LightSource[0].position.xyz, atmosGetDiffuseSunlightColor()*baseCol.a, 1.0)); + col.rgb += atmosAffectDirectionalLight(calcDirectionalLightSpecular(specularSum, view, norm, light_position[0].xyz,atmosGetDiffuseSunlightColor()*baseCol.a, 1.0)); col.rgb = min(col.rgb*color.rgb, 1.0); specularColor.rgb = min(specularColor.rgb*specularSum.rgb, 1.0); diff --git a/indra/newview/app_settings/shaders/class2/lighting/sumLightsV.glsl b/indra/newview/app_settings/shaders/class2/lighting/sumLightsV.glsl index ad045a3058..c9987ef3b9 100644 --- a/indra/newview/app_settings/shaders/class2/lighting/sumLightsV.glsl +++ b/indra/newview/app_settings/shaders/class2/lighting/sumLightsV.glsl @@ -23,8 +23,6 @@ * $/LicenseInfo$ */ - - float calcDirectionalLight(vec3 n, vec3 l); float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float is_pointlight); @@ -32,21 +30,26 @@ vec3 atmosAmbient(vec3 light); vec3 atmosAffectDirectionalLight(float lightIntensity); vec3 scaleDownLight(vec3 light); +uniform vec4 light_position[8]; +uniform vec3 light_direction[8]; +uniform vec3 light_attenuation[8]; +uniform vec3 light_diffuse[8]; + vec4 sumLights(vec3 pos, vec3 norm, vec4 color, vec4 baseLight) { vec4 col = vec4(0.0, 0.0, 0.0, color.a); // Collect normal lights (need to be divided by two, as we later multiply by 2) - col.rgb += gl_LightSource[1].diffuse.rgb * calcDirectionalLight(norm, gl_LightSource[1].position.xyz); + col.rgb += light_diffuse[1].rgb * calcDirectionalLight(norm, light_position[1].xyz); + + col.rgb += light_diffuse[2].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[2], light_direction[2], light_attenuation[2].x, light_attenuation[2].z); + col.rgb += light_diffuse[3].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[3], light_direction[3], light_attenuation[3].x, light_attenuation[3].z); - col.rgb += gl_LightSource[2].diffuse.rgb * calcPointLightOrSpotLight(pos, norm, gl_LightSource[2].position, gl_LightSource[2].spotDirection.xyz, gl_LightSource[2].linearAttenuation, gl_LightSource[2].specular.a); - col.rgb += gl_LightSource[3].diffuse.rgb * calcPointLightOrSpotLight(pos, norm, gl_LightSource[3].position, gl_LightSource[3].spotDirection.xyz, gl_LightSource[3].linearAttenuation, gl_LightSource[3].specular.a); - //col.rgb += gl_LightSource[4].diffuse.rgb * calcPointLightOrSpotLight(pos, norm, gl_LightSource[4].position, gl_LightSource[4].spotDirection.xyz, gl_LightSource[4].linearAttenuation, gl_LightSource[4].specular.a); col.rgb = scaleDownLight(col.rgb); // Add windlight lights col.rgb += atmosAmbient(baseLight.rgb); - col.rgb += atmosAffectDirectionalLight(calcDirectionalLight(norm, gl_LightSource[0].position.xyz)); + col.rgb += atmosAffectDirectionalLight(calcDirectionalLight(norm, light_position[0].xyz)); col.rgb = min(col.rgb*color.rgb, 1.0); diff --git a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsV.glsl b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsV.glsl index be990c1757..6a83be1426 100644 --- a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsV.glsl +++ b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsV.glsl @@ -25,7 +25,7 @@ -// varying param funcs +// VARYING param funcs void setSunlitColor(vec3 v); void setAmblitColor(vec3 v); void setAdditiveColor(vec3 v); @@ -34,8 +34,8 @@ void setPositionEye(vec3 v); vec3 getAdditiveColor(); -//varying vec4 vary_CloudUVs; -//varying float vary_CloudDensity; +//VARYING vec4 vary_CloudUVs; +//VARYING float vary_CloudDensity; // Inputs uniform vec4 morphFactor; diff --git a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsF.glsl b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsF.glsl index a98c04b259..765b0927c3 100644 --- a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsF.glsl +++ b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsF.glsl @@ -24,25 +24,17 @@ */ +VARYING vec3 vary_SunlitColor; +VARYING vec3 vary_AdditiveColor; +VARYING vec3 vary_AtmosAttenuation; -varying vec3 vary_PositionEye; - -varying vec3 vary_SunlitColor; -varying vec3 vary_AmblitColor; -varying vec3 vary_AdditiveColor; -varying vec3 vary_AtmosAttenuation; - -vec3 getPositionEye() -{ - return vary_PositionEye; -} vec3 getSunlitColor() { - return vary_SunlitColor; + return vec3(0,0,0); } vec3 getAmblitColor() { - return vary_AmblitColor; + return vec3(0,0,0); } vec3 getAdditiveColor() { @@ -50,5 +42,5 @@ vec3 getAdditiveColor() } vec3 getAtmosAttenuation() { - return vary_AtmosAttenuation; + return vec3(vary_AtmosAttenuation); } diff --git a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsV.glsl b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsV.glsl index 7c3cb88b3c..99dbee15ee 100644 --- a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsV.glsl +++ b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsV.glsl @@ -24,57 +24,61 @@ */ +VARYING vec3 vary_AdditiveColor; +VARYING vec3 vary_AtmosAttenuation; -varying vec3 vary_PositionEye; +vec3 additive_color; +vec3 atmos_attenuation; +vec3 sunlit_color; +vec3 amblit_color; +vec3 position_eye; -varying vec3 vary_SunlitColor; -varying vec3 vary_AmblitColor; -varying vec3 vary_AdditiveColor; -varying vec3 vary_AtmosAttenuation; - -vec3 getPositionEye() -{ - return vary_PositionEye; -} vec3 getSunlitColor() { - return vary_SunlitColor; + return sunlit_color; } vec3 getAmblitColor() { - return vary_AmblitColor; + return amblit_color; } + vec3 getAdditiveColor() { - return vary_AdditiveColor; + return additive_color; } vec3 getAtmosAttenuation() { - return vary_AtmosAttenuation; + return atmos_attenuation; } +vec3 getPositionEye() +{ + return position_eye; +} void setPositionEye(vec3 v) { - vary_PositionEye = v; + position_eye = v; } void setSunlitColor(vec3 v) { - vary_SunlitColor = v; + sunlit_color = v; } void setAmblitColor(vec3 v) { - vary_AmblitColor = v; + amblit_color = v; } void setAdditiveColor(vec3 v) { + additive_color = v; vary_AdditiveColor = v; } void setAtmosAttenuation(vec3 v) { + atmos_attenuation = v; vary_AtmosAttenuation = v; } diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightF.glsl b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsWaterF.glsl index d12d88f1c5..163ef26444 100644 --- a/indra/newview/app_settings/shaders/class2/lighting/lightF.glsl +++ b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsWaterF.glsl @@ -1,5 +1,5 @@ /** - * @file lightF.glsl + * @file atmosphericVarsWaterF.glsl * * $LicenseInfo:firstyear=2007&license=viewerlgpl$ * Second Life Viewer Source Code @@ -23,19 +23,28 @@ * $/LicenseInfo$ */ +VARYING vec3 vary_PositionEye; +VARYING vec3 vary_AdditiveColor; +VARYING vec3 vary_AtmosAttenuation; - -vec3 atmosLighting(vec3 light); -vec3 scaleSoftClip(vec3 light); - -void default_lighting() +vec3 getSunlitColor() { - vec4 color = diffuseLookup(gl_TexCoord[0].xy) * gl_Color; - - color.rgb = atmosLighting(color.rgb); - - color.rgb = scaleSoftClip(color.rgb); - - gl_FragColor = color; + return vec3(0,0,0); +} +vec3 getAmblitColor() +{ + return vec3(0,0,0); +} +vec3 getAdditiveColor() +{ + return vary_AdditiveColor; +} +vec3 getAtmosAttenuation() +{ + return vary_AtmosAttenuation; +} +vec3 getPositionEye() +{ + return vary_PositionEye; } diff --git a/indra/newview/app_settings/shaders/class1/deferred/postDeferredNoDoFMSF.glsl b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsWaterV.glsl index 41849858e7..553f6752e6 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/postDeferredNoDoFMSF.glsl +++ b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsWaterV.glsl @@ -1,5 +1,5 @@ /** - * @file postDeferredF.glsl + * @file atmosphericVarsWaterV.glsl * * $LicenseInfo:firstyear=2007&license=viewerlgpl$ * Second Life Viewer Source Code @@ -23,33 +23,59 @@ * $/LicenseInfo$ */ +VARYING vec3 vary_PositionEye; +VARYING vec3 vary_AdditiveColor; +VARYING vec3 vary_AtmosAttenuation; +vec3 atmos_attenuation; +vec3 sunlit_color; +vec3 amblit_color; -#extension GL_ARB_texture_rectangle : enable -#extension GL_ARB_texture_multisample : enable +vec3 getSunlitColor() +{ + return sunlit_color; +} +vec3 getAmblitColor() +{ + return amblit_color; +} -uniform sampler2DMS diffuseRect; -uniform sampler2D bloomMap; +vec3 getAdditiveColor() +{ + return vary_AdditiveColor; +} +vec3 getAtmosAttenuation() +{ + return atmos_attenuation; +} -uniform vec2 screen_res; -varying vec2 vary_fragcoord; +vec3 getPositionEye() +{ + return vary_PositionEye; +} -vec4 texture2DMS(sampler2DMS tex, ivec2 tc) +void setPositionEye(vec3 v) { - vec4 ret = vec4(0,0,0,0); + vary_PositionEye = v; +} - for (int i = 0; i < samples; ++i) - { - ret += texelFetch(tex,tc,i); - } +void setSunlitColor(vec3 v) +{ + sunlit_color = v; +} - return ret/samples; +void setAmblitColor(vec3 v) +{ + amblit_color = v; } -void main() +void setAdditiveColor(vec3 v) { - vec4 diff = texture2DMS(diffuseRect, ivec2(vary_fragcoord.xy)); + vary_AdditiveColor = v; +} - vec4 bloom = texture2D(bloomMap, vary_fragcoord.xy/screen_res); - gl_FragColor = diff + bloom; +void setAtmosAttenuation(vec3 v) +{ + atmos_attenuation = v; + vary_AtmosAttenuation = v; } diff --git a/indra/newview/app_settings/shaders/class2/windlight/cloudsF.glsl b/indra/newview/app_settings/shaders/class2/windlight/cloudsF.glsl index b90cec119b..4ab06c6e21 100644 --- a/indra/newview/app_settings/shaders/class2/windlight/cloudsF.glsl +++ b/indra/newview/app_settings/shaders/class2/windlight/cloudsF.glsl @@ -23,15 +23,21 @@ * $/LicenseInfo$ */ - +#ifdef DEFINE_GL_FRAGCOLOR +out vec4 gl_FragColor; +#endif ///////////////////////////////////////////////////////////////////////// // The fragment shader for the sky ///////////////////////////////////////////////////////////////////////// -varying vec4 vary_CloudColorSun; -varying vec4 vary_CloudColorAmbient; -varying float vary_CloudDensity; +VARYING vec4 vary_CloudColorSun; +VARYING vec4 vary_CloudColorAmbient; +VARYING float vary_CloudDensity; +VARYING vec2 vary_texcoord0; +VARYING vec2 vary_texcoord1; +VARYING vec2 vary_texcoord2; +VARYING vec2 vary_texcoord3; uniform sampler2D cloud_noise_texture; uniform vec4 cloud_pos_density1; @@ -50,14 +56,14 @@ vec3 scaleSoftClip(vec3 light) { void main() { // Set variables - vec2 uv1 = gl_TexCoord[0].xy; - vec2 uv2 = gl_TexCoord[1].xy; + vec2 uv1 = vary_texcoord0.xy; + vec2 uv2 = vary_texcoord1.xy; vec4 cloudColorSun = vary_CloudColorSun; vec4 cloudColorAmbient = vary_CloudColorAmbient; float cloudDensity = vary_CloudDensity; - vec2 uv3 = gl_TexCoord[2].xy; - vec2 uv4 = gl_TexCoord[3].xy; + vec2 uv3 = vary_texcoord2.xy; + vec2 uv4 = vary_texcoord3.xy; // Offset texture coords uv1 += cloud_pos_density1.xy; //large texture, visible density diff --git a/indra/newview/app_settings/shaders/class2/windlight/cloudsV.glsl b/indra/newview/app_settings/shaders/class2/windlight/cloudsV.glsl index c175a834c2..c5bb52169c 100644 --- a/indra/newview/app_settings/shaders/class2/windlight/cloudsV.glsl +++ b/indra/newview/app_settings/shaders/class2/windlight/cloudsV.glsl @@ -22,17 +22,24 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - +uniform mat4 modelview_projection_matrix; + +ATTRIBUTE vec3 position; +ATTRIBUTE vec2 texcoord0; ////////////////////////////////////////////////////////////////////////// // The vertex shader for creating the atmospheric sky /////////////////////////////////////////////////////////////////////////////// // Output parameters -varying vec4 vary_CloudColorSun; -varying vec4 vary_CloudColorAmbient; -varying float vary_CloudDensity; +VARYING vec4 vary_CloudColorSun; +VARYING vec4 vary_CloudColorAmbient; +VARYING float vary_CloudDensity; +VARYING vec2 vary_texcoord0; +VARYING vec2 vary_texcoord1; +VARYING vec2 vary_texcoord2; +VARYING vec2 vary_texcoord3; // Inputs uniform vec3 camPosLocal; @@ -59,12 +66,12 @@ void main() { // World / view / projection - gl_Position = ftransform(); + gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0); - gl_TexCoord[0] = gl_MultiTexCoord0; + vary_texcoord0 = texcoord0; // Get relative position - vec3 P = gl_Vertex.xyz - camPosLocal.xyz + vec3(0,50,0); + vec3 P = position.xyz - camPosLocal.xyz + vec3(0,50,0); // Set altitude if (P.y > 0.) @@ -160,17 +167,17 @@ void main() // Texture coords - gl_TexCoord[0] = gl_MultiTexCoord0; - gl_TexCoord[0].xy -= 0.5; - gl_TexCoord[0].xy /= cloud_scale.x; - gl_TexCoord[0].xy += 0.5; + vary_texcoord0 = texcoord0; + vary_texcoord0.xy -= 0.5; + vary_texcoord0.xy /= cloud_scale.x; + vary_texcoord0.xy += 0.5; - gl_TexCoord[1] = gl_TexCoord[0]; - gl_TexCoord[1].x += lightnorm.x * 0.0125; - gl_TexCoord[1].y += lightnorm.z * 0.0125; + vary_texcoord1 = vary_texcoord0; + vary_texcoord1.x += lightnorm.x * 0.0125; + vary_texcoord1.y += lightnorm.z * 0.0125; - gl_TexCoord[2] = gl_TexCoord[0] * 16.; - gl_TexCoord[3] = gl_TexCoord[1] * 16.; + vary_texcoord2 = vary_texcoord0 * 16.; + vary_texcoord3 = vary_texcoord1 * 16.; // Combine these to minimize register use vary_CloudColorAmbient += oHazeColorBelowCloud; diff --git a/indra/newview/app_settings/shaders/class2/windlight/skyF.glsl b/indra/newview/app_settings/shaders/class2/windlight/skyF.glsl index ac569e8257..c9d96b2cf4 100644 --- a/indra/newview/app_settings/shaders/class2/windlight/skyF.glsl +++ b/indra/newview/app_settings/shaders/class2/windlight/skyF.glsl @@ -23,13 +23,15 @@ * $/LicenseInfo$ */ - +#ifdef DEFINE_GL_FRAGCOLOR +out vec4 gl_FragColor; +#endif ///////////////////////////////////////////////////////////////////////// // The fragment shader for the sky ///////////////////////////////////////////////////////////////////////// -varying vec4 vary_HazeColor; +VARYING vec4 vary_HazeColor; uniform sampler2D cloud_noise_texture; uniform vec4 gamma; diff --git a/indra/newview/app_settings/shaders/class2/windlight/skyV.glsl b/indra/newview/app_settings/shaders/class2/windlight/skyV.glsl index 3a44bb6d26..46773cf89f 100644 --- a/indra/newview/app_settings/shaders/class2/windlight/skyV.glsl +++ b/indra/newview/app_settings/shaders/class2/windlight/skyV.glsl @@ -23,14 +23,16 @@ * $/LicenseInfo$ */ +uniform mat4 modelview_projection_matrix; +ATTRIBUTE vec3 position; // SKY //////////////////////////////////////////////////////////////////////// // The vertex shader for creating the atmospheric sky /////////////////////////////////////////////////////////////////////////////// // Output parameters -varying vec4 vary_HazeColor; +VARYING vec4 vary_HazeColor; // Inputs uniform vec3 camPosLocal; @@ -57,12 +59,11 @@ void main() { // World / view / projection - gl_Position = ftransform(); - gl_TexCoord[0] = gl_MultiTexCoord0; + gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0); // Get relative position - vec3 P = gl_Vertex.xyz - camPosLocal.xyz + vec3(0,50,0); - //vec3 P = gl_Vertex.xyz + vec3(0,50,0); + vec3 P = position.xyz - camPosLocal.xyz + vec3(0,50,0); + //vec3 P = position.xyz + vec3(0,50,0); // Set altitude if (P.y > 0.) diff --git a/indra/newview/app_settings/shaders/class3/avatar/avatarV.glsl b/indra/newview/app_settings/shaders/class3/avatar/avatarV.glsl index 151602dbc0..721054b5ad 100644 --- a/indra/newview/app_settings/shaders/class3/avatar/avatarV.glsl +++ b/indra/newview/app_settings/shaders/class3/avatar/avatarV.glsl @@ -22,39 +22,47 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - +uniform mat4 projection_matrix; + +ATTRIBUTE vec3 position; +ATTRIBUTE vec3 normal; +ATTRIBUTE vec2 texcoord0; +ATTRIBUTE vec4 clothing; + +VARYING vec4 vertex_color; +VARYING vec2 vary_texcoord0; vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol); mat4 getSkinnedTransform(); void calcAtmospherics(vec3 inPositionEye); -attribute vec4 clothing; //4 +uniform vec4 color; -attribute vec4 gWindDir; //7 -attribute vec4 gSinWaveParams; //3 -attribute vec4 gGravity; //5 +uniform vec4 gWindDir; +uniform vec4 gSinWaveParams; +uniform vec4 gGravity; const vec4 gMinMaxConstants = vec4(1.0, 0.166666, 0.0083143, .00018542); // #minimax-generated coefficients const vec4 gPiConstants = vec4(0.159154943, 6.28318530, 3.141592653, 1.5707963); // # {1/2PI, 2PI, PI, PI/2} void main() { - gl_TexCoord[0] = gl_MultiTexCoord0; + vary_texcoord0 = texcoord0; vec4 pos; mat4 trans = getSkinnedTransform(); vec3 norm; - norm.x = dot(trans[0].xyz, gl_Normal); - norm.y = dot(trans[1].xyz, gl_Normal); - norm.z = dot(trans[2].xyz, gl_Normal); + norm.x = dot(trans[0].xyz, normal); + norm.y = dot(trans[1].xyz, normal); + norm.z = dot(trans[2].xyz, normal); norm = normalize(norm); //wind vec4 windEffect; windEffect = vec4(dot(norm, gWindDir.xyz)); - pos.x = dot(trans[2].xyz, gl_Vertex.xyz); + pos.x = dot(trans[2].xyz, position.xyz); windEffect.xyz = pos.x * vec3(0.015, 0.015, 0.015) + windEffect.xyz; windEffect.w = windEffect.w * 2.0 + 1.0; // move wind offset value to [-1, 3] @@ -101,7 +109,7 @@ void main() sinWave.xyz = max(sinWave.xyz, vec3(-1.0, -1.0, -1.0)); // clamp to underlying body shape offsetPos = clothing * sinWave.x; // multiply wind effect times clothing displacement temp2 = gWindDir*sinWave.z + vec4(norm,0); // calculate normal offset due to wind oscillation - offsetPos = vec4(1.0,1.0,1.0,0.0)*offsetPos+gl_Vertex; // add to offset vertex position, and zero out effect from w + offsetPos = vec4(1.0,1.0,1.0,0.0)*offsetPos+vec4(position.xyz, 1.0); // add to offset vertex position, and zero out effect from w norm += temp2.xyz*2.0; // add sin wave effect on normals (exaggerated) //add "backlighting" effect @@ -119,12 +127,8 @@ void main() calcAtmospherics(pos.xyz); - vec4 color = calcLighting(pos.xyz, norm, gl_Color, vec4(0.0)); - gl_FrontColor = color; + vec4 col = calcLighting(pos.xyz, norm, color, vec4(0.0)); + vertex_color = col; - gl_Position = gl_ProjectionMatrix * pos; - - - gl_TexCoord[2] = vec4(pos.xyz, 1.0); - + gl_Position = projection_matrix * pos; } diff --git a/indra/newview/app_settings/shaders/class3/deferred/giDownsampleF.glsl b/indra/newview/app_settings/shaders/class3/deferred/giDownsampleF.glsl deleted file mode 100644 index 616ea5fe9e..0000000000 --- a/indra/newview/app_settings/shaders/class3/deferred/giDownsampleF.glsl +++ /dev/null @@ -1,106 +0,0 @@ -/** - * @file giDownsampleF.glsl - * - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2007, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - - - -uniform sampler2DRect giLightMap; - -uniform vec2 kern[32]; -uniform float dist_factor; -uniform float blur_size; -uniform vec2 delta; -uniform int kern_length; -uniform float kern_scale; -uniform vec3 blur_quad; - -varying vec2 vary_fragcoord; - -uniform mat4 inv_proj; -uniform vec2 screen_res; - -vec4 getPosition(vec2 pos_screen) -{ - float depth = texture2DRect(depthMap, pos_screen.xy).a; - vec2 sc = pos_screen.xy*2.0; - sc /= screen_res; - sc -= vec2(1.0,1.0); - vec4 ndc = vec4(sc.x, sc.y, 2.0*depth-1.0, 1.0); - vec4 pos = inv_proj * ndc; - pos /= pos.w; - pos.w = 1.0; - return pos; -} - -float getDepth(vec2 pos_screen) -{ - float z = texture2DRect(depthMap, pos_screen.xy).a; - z = z*2.0-1.0; - vec4 ndc = vec4(0.0, 0.0, z, 1.0); - vec4 p = inv_proj*ndc; - return p.z/p.w; -} - -void main() -{ - vec3 norm = texture2DRect(normalMap, vary_fragcoord.xy).xyz; - norm = vec3((norm.xy-0.5)*2.0,norm.z); // unpack norm - float depth = getDepth(vary_fragcoord.xy); - - vec3 ccol = texture2DRect(giLightMap, vary_fragcoord.xy).rgb; - vec2 dlt = kern_scale * delta/(vec2(1.0,1.0)+norm.xy*norm.xy); - dlt /= clamp(-depth*blur_quad.x, 1.0, 3.0); - float defined_weight = kern[0].x; - vec3 col = ccol*kern[0].x; - - for (int i = 0; i < kern_length; i++) - { - vec2 tc = vary_fragcoord.xy + kern[i].y*dlt; - vec3 sampNorm = texture2DRect(normalMap, tc.xy).xyz; - sampNorm = vec3((sampNorm.xy-0.5)*2.0,sampNorm.z); // unpack norm - - float d = dot(norm.xyz, sampNorm); - - if (d > 0.5) - { - float sampdepth = getDepth(tc.xy); - sampdepth -= depth; - if (sampdepth*sampdepth < blur_quad.z) - { - col += texture2DRect(giLightMap, tc).rgb*kern[i].x; - defined_weight += kern[i].x; - } - } - } - - col /= defined_weight; - - //col = ccol; - - col = col*blur_quad.y; - - gl_FragData[0].xyz = col; - - //gl_FragColor = ccol; -} diff --git a/indra/newview/app_settings/shaders/class3/deferred/giF.glsl b/indra/newview/app_settings/shaders/class3/deferred/giF.glsl deleted file mode 100644 index 95913a502c..0000000000 --- a/indra/newview/app_settings/shaders/class3/deferred/giF.glsl +++ /dev/null @@ -1,211 +0,0 @@ -/** - * @file giF.glsl - * - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2007, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - - - -#extension GL_ARB_texture_rectangle : enable - -uniform sampler2DRect depthMap; -uniform sampler2DRect normalMap; -uniform sampler2DRect lightMap; -uniform sampler2DRect specularRect; - -uniform sampler2D noiseMap; - -uniform sampler2D diffuseGIMap; -uniform sampler2D specularGIMap; -uniform sampler2D normalGIMap; -uniform sampler2D depthGIMap; - -uniform sampler2D lightFunc; - -// Inputs -varying vec2 vary_fragcoord; - -uniform vec2 screen_res; - -uniform vec4 sunlight_color; - -uniform mat4 inv_proj; -uniform mat4 gi_mat; //gPipeline.mGIMatrix - eye space to sun space -uniform mat4 gi_mat_proj; //gPipeline.mGIMatrixProj - eye space to projected sun space -uniform mat4 gi_norm_mat; //gPipeline.mGINormalMatrix - eye space normal to sun space normal matrix -uniform mat4 gi_inv_proj; //gPipeline.mGIInvProj - projected sun space to sun space -uniform float gi_sample_width; -uniform float gi_noise; -uniform float gi_attenuation; -uniform float gi_range; - -vec4 getPosition(vec2 pos_screen) -{ - float depth = texture2DRect(depthMap, pos_screen.xy).a; - vec2 sc = pos_screen.xy*2.0; - sc /= screen_res; - sc -= vec2(1.0,1.0); - vec4 ndc = vec4(sc.x, sc.y, 2.0*depth-1.0, 1.0); - vec4 pos = inv_proj * ndc; - pos /= pos.w; - pos.w = 1.0; - return pos; -} - -vec4 getGIPosition(vec2 gi_tc) -{ - float depth = texture2D(depthGIMap, gi_tc).a; - vec2 sc = gi_tc*2.0; - sc -= vec2(1.0, 1.0); - vec4 ndc = vec4(sc.x, sc.y, 2.0*depth-1.0, 1.0); - vec4 pos = gi_inv_proj*ndc; - pos.xyz /= pos.w; - pos.w = 1.0; - return pos; -} - -vec3 giAmbient(vec3 pos, vec3 norm) -{ - vec4 gi_c = gi_mat_proj * vec4(pos, 1.0); - gi_c.xyz /= gi_c.w; - - vec4 gi_pos = gi_mat*vec4(pos,1.0); - vec3 gi_norm = (gi_norm_mat*vec4(norm,1.0)).xyz; - gi_norm = normalize(gi_norm); - - vec4 c_spec = texture2DRect(specularRect, vary_fragcoord.xy); - vec3 nz = texture2D(noiseMap, vary_fragcoord.xy/128.0).rgb; - gi_pos.xyz += nz.x*gi_noise*gi_norm.xyz; - vec2 tcx = gi_norm.xy; - vec2 tcy = gi_norm.yx; - - vec4 eye_pos = gi_mat*vec4(0,0,0,1.0); - - vec3 eye_dir = normalize(gi_pos.xyz-eye_pos.xyz); - vec3 eye_ref = reflect(eye_dir, gi_norm); - - float da = 0.0; //texture2DRect(lightMap, vary_fragcoord.xy).r*0.5; - vec3 fdiff = vec3(da); - float fda = da; - - vec3 rcol = vec3(0,0,0); - - float fsa = 0.0; - - - for (int i = -1; i <= 1; i += 2 ) - { - for (int j = -1; j <= 1; j+= 2) - { - vec2 tc = vec2(i, j)*0.75+gi_norm.xy*nz.z; - tc += nz.xy*2.0; - tc *= gi_sample_width*0.25; - tc += gi_c.xy; - - vec3 lnorm = -(texture2D(normalGIMap, tc.xy).xyz*2.0-1.0); - vec3 lpos = getGIPosition(tc.xy).xyz; - - vec3 at = lpos-gi_pos.xyz; - float dist = length(at); - float dist_atten = clamp(1.0/(gi_attenuation*dist), 0.0, 1.0); - - - if (dist_atten > 0.01) - { //possible contribution of indirect light to this surface - vec3 ldir = at; - - float ld = -dot(ldir, lnorm); - - if (ld < 0.0) - { - float ang_atten = dot(ldir, gi_norm); - - if (ang_atten > 0.0) - { - vec4 spec = texture2D(specularGIMap, tc.xy); - at = normalize(at); - vec3 diff; - - float da = 0.0; - - //contribution from indirect source to visible pixel - vec3 ha = at; - ha.z -= 1.0; - ha = normalize(ha); - if (spec.a > 0.0) - { - float sa = dot(ha,lnorm); - da = texture2D(lightFunc, vec2(sa, spec.a)).a; - } - else - { - da = -lnorm.z; - } - - diff = texture2D(diffuseGIMap, tc.xy).rgb+spec.rgb*spec.a*2.0; - - if (da > 0.0) - { //contribution from visible pixel to eye - vec3 ha = normalize(at-eye_dir); - if (c_spec.a > 0.0) - { - float sa = dot(ha, gi_norm); - da = dist_atten*texture2D(lightFunc, vec2(sa, c_spec.a)).a; - } - else - { - da = dist_atten*dot(gi_norm, normalize(ldir)); - } - fda += da; - fdiff += da*(c_spec.rgb*c_spec.a*2.0+vec3(1,1,1))*diff.rgb; - } - } - } - } - } - } - - fdiff *= sunlight_color.rgb; - - vec3 ret = fda*fdiff; - - return clamp(ret,vec3(0.0), vec3(1.0)); -} - -void main() -{ - vec2 pos_screen = vary_fragcoord.xy; - vec4 pos = getPosition(pos_screen); - - float rad = gi_range*0.5; - - vec3 norm = texture2DRect(normalMap, pos_screen).xyz; - norm = vec3((norm.xy-0.5)*2.0,norm.z); // unpack norm - float dist = max(length(pos.xyz)-rad, 0.0); - - float da = clamp(1.0-dist/rad, 0.0, 1.0); - - vec3 ambient = da > 0.0 ? giAmbient(pos.xyz, norm) : vec3(0); - - - gl_FragData[0].xyz = mix(vec3(0), ambient, da); -} diff --git a/indra/newview/app_settings/shaders/class3/deferred/postDeferredF.glsl b/indra/newview/app_settings/shaders/class3/deferred/postDeferredF.glsl deleted file mode 100644 index 0364da6258..0000000000 --- a/indra/newview/app_settings/shaders/class3/deferred/postDeferredF.glsl +++ /dev/null @@ -1,100 +0,0 @@ -/** - * @file postDeferredF.glsl - * - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2007, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - - - -#extension GL_ARB_texture_rectangle : enable - -uniform sampler2DRect diffuseRect; -uniform sampler2DRect specularRect; - -uniform sampler2DRect localLightMap; -uniform sampler2DRect sunLightMap; -uniform sampler2DRect giLightMap; -uniform sampler2DRect edgeMap; - -uniform sampler2D luminanceMap; - -uniform sampler2DRect lightMap; - -uniform sampler2D lightFunc; -uniform sampler2D noiseMap; - -uniform float sun_lum_scale; -uniform float sun_lum_offset; -uniform float lum_scale; -uniform float lum_lod; -uniform vec4 ambient; -uniform float gi_brightness; -uniform float gi_luminance; - -uniform vec4 sunlight_color; - -uniform vec2 screen_res; -varying vec2 vary_fragcoord; - -void main() -{ - vec2 tc = vary_fragcoord.xy; - vec4 lcol = texture2DLod(luminanceMap, vec2(0.5, 0.5), lum_lod); - - vec3 gi_col = texture2DRect(giLightMap, vary_fragcoord.xy).rgb; - vec4 sun_col = texture2DRect(sunLightMap, vary_fragcoord.xy); - vec3 local_col = texture2DRect(localLightMap, vary_fragcoord.xy).rgb; - - float scol = texture2DRect(lightMap, vary_fragcoord.xy).r; - - vec3 diff = texture2DRect(diffuseRect, vary_fragcoord.xy).rgb; - vec4 spec = texture2DRect(specularRect, vary_fragcoord.xy); - - gi_col = gi_col*(diff.rgb+spec.rgb*spec.a); - - float lum = 1.0-clamp(pow(lcol.r, gi_brightness)+sun_lum_offset, 0.0, 1.0); - - lum *= sun_lum_scale; - - sun_col *= 1.0+(lum*lum_scale*scol); - - vec4 col; - col.rgb = gi_col+sun_col.rgb+local_col; - - col.a = sun_col.a; - - vec3 bcol = vec3(0,0,0); - float tweight = 0.0; - for (int i = 0; i < 16; i++) - { - float weight = (float(i)+1.0)/2.0; - bcol += texture2DLod(luminanceMap, vary_fragcoord.xy/screen_res, weight).rgb*weight*weight*weight; - tweight += weight*weight; - } - - bcol /= tweight; - bcol *= gi_luminance; - col.rgb += bcol*lum; - - gl_FragColor = col; - //gl_FragColor.rgb = texture2DRect(giLightMap, vary_fragcoord.xy).rgb; -} diff --git a/indra/newview/app_settings/shaders/class3/deferred/postgiF.glsl b/indra/newview/app_settings/shaders/class3/deferred/postgiF.glsl deleted file mode 100644 index 009b5cc743..0000000000 --- a/indra/newview/app_settings/shaders/class3/deferred/postgiF.glsl +++ /dev/null @@ -1,89 +0,0 @@ -/** - * @file postgiF.glsl - * - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2007, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - - - -#extension GL_ARB_texture_rectangle : enable - -uniform sampler2DRect depthMap; -uniform sampler2DRect normalMap; -uniform sampler2DRect giLightMap; -uniform sampler2D noiseMap; -uniform sampler2D giMip; -uniform sampler2DRect edgeMap; - - -uniform vec2 delta; -uniform float kern_scale; -uniform float gi_edge_weight; -uniform float gi_blur_brightness; - -varying vec2 vary_fragcoord; - -void main() -{ - vec2 dlt = kern_scale*delta; - float defined_weight = 0.0; - vec3 col = vec3(0.0); - - float e = 1.0; - - for (int i = 1; i < 8; i++) - { - vec2 tc = vary_fragcoord.xy + float(i) * dlt; - - e = max(e, 0.0); - float wght = e; - - col += texture2DRect(giLightMap, tc).rgb*wght; - defined_weight += wght; - - e *= e; - e -=(texture2DRect(edgeMap, tc.xy-dlt*0.25).a+ - texture2DRect(edgeMap, tc.xy+dlt*0.25).a)*gi_edge_weight; - } - - e = 1.0; - - for (int i = 1; i < 8; i++) - { - vec2 tc = vary_fragcoord.xy - float(i) * dlt; - - e = max(e,0.0); - float wght = e; - - col += texture2DRect(giLightMap, tc).rgb*wght; - defined_weight += wght; - - e *= e; - e -= (texture2DRect(edgeMap, tc.xy-dlt*0.25).a+ - texture2DRect(edgeMap, tc.xy+dlt*0.25).a)*gi_edge_weight; - - } - - col /= max(defined_weight, 0.01); - - gl_FragColor.rgb = col * gi_blur_brightness; -} diff --git a/indra/newview/app_settings/shaders/class3/deferred/postgiV.glsl b/indra/newview/app_settings/shaders/class3/deferred/postgiV.glsl deleted file mode 100644 index 6231ee68b7..0000000000 --- a/indra/newview/app_settings/shaders/class3/deferred/postgiV.glsl +++ /dev/null @@ -1,37 +0,0 @@ -/** - * @file postgiV.glsl - * - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2007, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - - - -varying vec2 vary_fragcoord; -uniform vec2 screen_res; - -void main() -{ - //transform vertex - gl_Position = ftransform(); - vec4 pos = gl_ModelViewProjectionMatrix * gl_Vertex; - vary_fragcoord = (pos.xy*0.5+0.5)*screen_res; -} diff --git a/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl deleted file mode 100644 index 1c02adea89..0000000000 --- a/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl +++ /dev/null @@ -1,335 +0,0 @@ -/** - * @file softenLightF.glsl - * - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2007, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - - - -#extension GL_ARB_texture_rectangle : enable - -uniform sampler2DRect diffuseRect; -uniform sampler2DRect specularRect; -uniform sampler2DRect normalMap; -uniform sampler2DRect lightMap; -uniform sampler2D noiseMap; -uniform samplerCube environmentMap; -uniform sampler2D lightFunc; -uniform vec3 gi_quad; - -uniform float blur_size; -uniform float blur_fidelity; - -// Inputs -uniform vec4 morphFactor; -uniform vec3 camPosLocal; -//uniform vec4 camPosWorld; -uniform vec4 gamma; -uniform vec4 lightnorm; -uniform vec4 sunlight_color; -uniform vec4 ambient; -uniform vec4 blue_horizon; -uniform vec4 blue_density; -uniform vec4 haze_horizon; -uniform vec4 haze_density; -uniform vec4 cloud_shadow; -uniform vec4 density_multiplier; -uniform vec4 distance_multiplier; -uniform vec4 max_y; -uniform vec4 glow; -uniform float scene_light_strength; -uniform vec3 env_mat[3]; -uniform vec4 shadow_clip; -uniform mat3 ssao_effect_mat; - -uniform sampler2DRect depthMap; -uniform mat4 inv_proj; -uniform vec2 screen_res; - -varying vec4 vary_light; -varying vec2 vary_fragcoord; - -vec3 vary_PositionEye; - -vec3 vary_SunlitColor; -vec3 vary_AmblitColor; -vec3 vary_AdditiveColor; -vec3 vary_AtmosAttenuation; -uniform float gi_ambiance; - -vec4 getPosition_d(vec2 pos_screen, float depth) -{ - vec2 sc = pos_screen.xy*2.0; - sc /= screen_res; - sc -= vec2(1.0,1.0); - vec4 ndc = vec4(sc.x, sc.y, 2.0*depth-1.0, 1.0); - vec4 pos = inv_proj * ndc; - pos /= pos.w; - pos.w = 1.0; - return pos; -} - -vec4 getPosition(vec2 pos_screen) -{ //get position in screen space (world units) given window coordinate and depth map - float depth = texture2DRect(depthMap, pos_screen.xy).a; - return getPosition_d(pos_screen, depth); -} - -vec3 getPositionEye() -{ - return vary_PositionEye; -} -vec3 getSunlitColor() -{ - return vary_SunlitColor; -} -vec3 getAmblitColor() -{ - return vary_AmblitColor; -} -vec3 getAdditiveColor() -{ - return vary_AdditiveColor; -} -vec3 getAtmosAttenuation() -{ - return vary_AtmosAttenuation; -} - - -void setPositionEye(vec3 v) -{ - vary_PositionEye = v; -} - -void setSunlitColor(vec3 v) -{ - vary_SunlitColor = v; -} - -void setAmblitColor(vec3 v) -{ - vary_AmblitColor = v; -} - -void setAdditiveColor(vec3 v) -{ - vary_AdditiveColor = v; -} - -void setAtmosAttenuation(vec3 v) -{ - vary_AtmosAttenuation = v; -} - -void calcAtmospherics(vec3 inPositionEye, float ambFactor) { - - vec3 P = inPositionEye; - setPositionEye(P); - - //(TERRAIN) limit altitude - if (P.y > max_y.x) P *= (max_y.x / P.y); - if (P.y < -max_y.x) P *= (-max_y.x / P.y); - - vec3 tmpLightnorm = lightnorm.xyz; - - vec3 Pn = normalize(P); - float Plen = length(P); - - vec4 temp1 = vec4(0); - vec3 temp2 = vec3(0); - vec4 blue_weight; - vec4 haze_weight; - vec4 sunlight = sunlight_color; - vec4 light_atten; - - //sunlight attenuation effect (hue and brightness) due to atmosphere - //this is used later for sunlight modulation at various altitudes - light_atten = (blue_density * 1.0 + vec4(haze_density.r) * 0.25) * (density_multiplier.x * max_y.x); - //I had thought blue_density and haze_density should have equal weighting, - //but attenuation due to haze_density tends to seem too strong - - temp1 = blue_density + vec4(haze_density.r); - blue_weight = blue_density / temp1; - haze_weight = vec4(haze_density.r) / temp1; - - //(TERRAIN) compute sunlight from lightnorm only (for short rays like terrain) - temp2.y = max(0.0, tmpLightnorm.y); - temp2.y = 1. / temp2.y; - sunlight *= exp( - light_atten * temp2.y); - - // main atmospheric scattering line integral - temp2.z = Plen * density_multiplier.x; - - // Transparency (-> temp1) - // ATI Bugfix -- can't store temp1*temp2.z*distance_multiplier.x in a variable because the ati - // compiler gets confused. - temp1 = exp(-temp1 * temp2.z * distance_multiplier.x); - - //final atmosphere attenuation factor - setAtmosAttenuation(temp1.rgb); - - //compute haze glow - //(can use temp2.x as temp because we haven't used it yet) - temp2.x = dot(Pn, tmpLightnorm.xyz); - temp2.x = 1. - temp2.x; - //temp2.x is 0 at the sun and increases away from sun - temp2.x = max(temp2.x, .03); //was glow.y - //set a minimum "angle" (smaller glow.y allows tighter, brighter hotspot) - temp2.x *= glow.x; - //higher glow.x gives dimmer glow (because next step is 1 / "angle") - temp2.x = pow(temp2.x, glow.z); - //glow.z should be negative, so we're doing a sort of (1 / "angle") function - - //add "minimum anti-solar illumination" - temp2.x += .25; - - //increase ambient when there are more clouds - vec4 tmpAmbient = ambient*gi_ambiance + (vec4(1.) - ambient*gi_ambiance) * cloud_shadow.x * 0.5; - - /* decrease value and saturation (that in HSV, not HSL) for occluded areas - * // for HSV color/geometry used here, see http://gimp-savvy.com/BOOK/index.html?node52.html - * // The following line of code performs the equivalent of: - * float ambAlpha = tmpAmbient.a; - * float ambValue = dot(vec3(tmpAmbient), vec3(0.577)); // projection onto <1/rt(3), 1/rt(3), 1/rt(3)>, the neutral white-black axis - * vec3 ambHueSat = vec3(tmpAmbient) - vec3(ambValue); - * tmpAmbient = vec4(RenderSSAOEffect.valueFactor * vec3(ambValue) + RenderSSAOEffect.saturationFactor *(1.0 - ambFactor) * ambHueSat, ambAlpha); - */ - tmpAmbient = vec4(mix(ssao_effect_mat * tmpAmbient.rgb, tmpAmbient.rgb, ambFactor), tmpAmbient.a); - - //haze color - setAdditiveColor( - vec3(blue_horizon * blue_weight * (sunlight*(1.-cloud_shadow.x) + tmpAmbient) - + (haze_horizon.r * haze_weight) * (sunlight*(1.-cloud_shadow.x) * temp2.x - + tmpAmbient))); - - //brightness of surface both sunlight and ambient - setSunlitColor(vec3(sunlight * .5)); - setAmblitColor(vec3(tmpAmbient * .25)); - setAdditiveColor(getAdditiveColor() * vec3(1.0 - temp1)); -} - -vec3 atmosLighting(vec3 light) -{ - light *= getAtmosAttenuation().r; - light += getAdditiveColor(); - return (2.0 * light); -} - -vec3 atmosTransport(vec3 light) { - light *= getAtmosAttenuation().r; - light += getAdditiveColor() * 2.0; - return light; -} -vec3 atmosGetDiffuseSunlightColor() -{ - return getSunlitColor(); -} - -vec3 scaleDownLight(vec3 light) -{ - return (light / scene_light_strength ); -} - -vec3 scaleUpLight(vec3 light) -{ - return (light * scene_light_strength); -} - -vec3 atmosAmbient(vec3 light) -{ - return getAmblitColor() + light / 2.0; -} - -vec3 atmosAffectDirectionalLight(float lightIntensity) -{ - return getSunlitColor() * lightIntensity; -} - -vec3 scaleSoftClip(vec3 light) -{ - //soft clip effect: - light = 1. - clamp(light, vec3(0.), vec3(1.)); - light = 1. - pow(light, gamma.xxx); - - return light; -} - -void main() -{ - vec2 tc = vary_fragcoord.xy; - float depth = texture2DRect(depthMap, tc.xy).a; - vec3 pos = getPosition_d(tc, depth).xyz; - vec3 norm = texture2DRect(normalMap, tc).xyz; - norm = vec3((norm.xy-0.5)*2.0,norm.z); // unpack norm - //vec3 nz = texture2D(noiseMap, vary_fragcoord.xy/128.0).xyz; - - float da = max(dot(norm.xyz, vary_light.xyz), 0.0); - - vec4 diffuse = texture2DRect(diffuseRect, tc); - vec3 col; - float bloom = 0.0; - - if (diffuse.a < 0.9) - { - vec4 spec = texture2DRect(specularRect, vary_fragcoord.xy); - - da = texture2D(lightFunc, vec2(da, 0.0)).a; - - vec2 scol_ambocc = texture2DRect(lightMap, vary_fragcoord.xy).rg; - float scol = max(scol_ambocc.r, diffuse.a); - float ambocc = scol_ambocc.g; - - calcAtmospherics(pos.xyz, ambocc); - - col = atmosAmbient(vec3(0)); - col += atmosAffectDirectionalLight(max(min(da, scol), diffuse.a)); - - col *= diffuse.rgb; - - if (spec.a > 0.0) // specular reflection - { - // the old infinite-sky shiny reflection - // - vec3 refnormpersp = normalize(reflect(pos.xyz, norm.xyz)); - float sa = dot(refnormpersp, vary_light.xyz); - vec3 dumbshiny = vary_SunlitColor*scol*texture2D(lightFunc, vec2(sa, spec.a)).a; - - // add the two types of shiny together - vec3 spec_contrib = dumbshiny * spec.rgb; - bloom = dot(spec_contrib, spec_contrib); - col += spec_contrib; - } - - col = atmosLighting(col); - col = scaleSoftClip(col); - - col = mix(col, diffuse.rgb, diffuse.a); - } - else - { - col = diffuse.rgb; - } - - gl_FragColor.rgb = col; - gl_FragColor.a = bloom; -} diff --git a/indra/newview/app_settings/shaders/class3/lighting/sumLightsSpecularV.glsl b/indra/newview/app_settings/shaders/class3/lighting/sumLightsSpecularV.glsl index 79bd017efc..e043ac873e 100644 --- a/indra/newview/app_settings/shaders/class3/lighting/sumLightsSpecularV.glsl +++ b/indra/newview/app_settings/shaders/class3/lighting/sumLightsSpecularV.glsl @@ -23,8 +23,6 @@ * $/LicenseInfo$ */ - - float calcDirectionalLightSpecular(inout vec4 specular, vec3 view, vec3 n, vec3 l, vec3 lightCol, float da); vec3 calcPointLightSpecular(inout vec4 specular, vec3 view, vec3 v, vec3 n, vec3 l, float r, float pw, vec3 lightCol); @@ -33,6 +31,10 @@ vec3 atmosAffectDirectionalLight(float lightIntensity); vec3 atmosGetDiffuseSunlightColor(); vec3 scaleDownLight(vec3 light); +uniform vec4 light_position[8]; +uniform vec3 light_attenuation[8]; +uniform vec3 light_diffuse[8]; + vec4 sumLightsSpecular(vec3 pos, vec3 norm, vec4 color, inout vec4 specularColor, vec4 baseCol) { vec4 col = vec4(0.0, 0.0, 0.0, color.a); @@ -43,18 +45,18 @@ vec4 sumLightsSpecular(vec3 pos, vec3 norm, vec4 color, inout vec4 specularColor vec4 specularSum = vec4(0.0); // Collect normal lights (need to be divided by two, as we later multiply by 2) - col.rgb += gl_LightSource[1].diffuse.rgb * calcDirectionalLightSpecular(specularColor, view, norm, gl_LightSource[1].position.xyz,gl_LightSource[1].diffuse.rgb, 1.0); - col.rgb += calcPointLightSpecular(specularSum, view, pos, norm, gl_LightSource[2].position.xyz, gl_LightSource[2].linearAttenuation, gl_LightSource[2].quadraticAttenuation,gl_LightSource[2].diffuse.rgb); - col.rgb += calcPointLightSpecular(specularSum, view, pos, norm, gl_LightSource[3].position.xyz, gl_LightSource[3].linearAttenuation, gl_LightSource[3].quadraticAttenuation,gl_LightSource[3].diffuse.rgb); - col.rgb += calcPointLightSpecular(specularSum, view, pos, norm, gl_LightSource[4].position.xyz, gl_LightSource[4].linearAttenuation, gl_LightSource[4].quadraticAttenuation,gl_LightSource[4].diffuse.rgb); - col.rgb += calcPointLightSpecular(specularSum, view, pos, norm, gl_LightSource[5].position.xyz, gl_LightSource[5].linearAttenuation, gl_LightSource[5].quadraticAttenuation,gl_LightSource[5].diffuse.rgb); - col.rgb += calcPointLightSpecular(specularSum, view, pos, norm, gl_LightSource[6].position.xyz, gl_LightSource[6].linearAttenuation, gl_LightSource[6].quadraticAttenuation,gl_LightSource[6].diffuse.rgb); - col.rgb += calcPointLightSpecular(specularSum, view, pos, norm, gl_LightSource[7].position.xyz, gl_LightSource[7].linearAttenuation, gl_LightSource[7].quadraticAttenuation,gl_LightSource[7].diffuse.rgb); + col.rgb += light_diffuse[1].rgb * calcDirectionalLightSpecular(specularColor, view, norm, light_position[1].xyz,light_diffuse[1].rgb, 1.0); + col.rgb += calcPointLightSpecular(specularSum, view, pos, norm, light_position[2].xyz, light_attenuation[2].x, light_attenuation[2].y, light_diffuse[2].rgb); + col.rgb += calcPointLightSpecular(specularSum, view, pos, norm, light_position[3].xyz, light_attenuation[3].x, light_attenuation[3].y, light_diffuse[3].rgb); + col.rgb += calcPointLightSpecular(specularSum, view, pos, norm, light_position[4].xyz, light_attenuation[4].x, light_attenuation[4].y, light_diffuse[4].rgb); + col.rgb += calcPointLightSpecular(specularSum, view, pos, norm, light_position[5].xyz, light_attenuation[5].x, light_attenuation[5].y, light_diffuse[5].rgb); + col.rgb += calcPointLightSpecular(specularSum, view, pos, norm, light_position[6].xyz, light_attenuation[6].x, light_attenuation[6].y, light_diffuse[6].rgb); + col.rgb += calcPointLightSpecular(specularSum, view, pos, norm, light_position[7].xyz, light_attenuation[7].x, light_attenuation[7].y, light_diffuse[7].rgb); col.rgb = scaleDownLight(col.rgb); // Add windlight lights col.rgb += atmosAmbient(baseCol.rgb); - col.rgb += atmosAffectDirectionalLight(calcDirectionalLightSpecular(specularSum, view, norm, gl_LightSource[0].position.xyz,atmosGetDiffuseSunlightColor()*baseCol.a, 1.0)); + col.rgb += atmosAffectDirectionalLight(calcDirectionalLightSpecular(specularSum, view, norm, light_position[0].xyz,atmosGetDiffuseSunlightColor()*baseCol.a, 1.0)); col.rgb = min(col.rgb*color.rgb, 1.0); specularColor.rgb = min(specularColor.rgb*specularSum.rgb, 1.0); diff --git a/indra/newview/app_settings/shaders/class3/lighting/sumLightsV.glsl b/indra/newview/app_settings/shaders/class3/lighting/sumLightsV.glsl index dcdc72ac02..dadff40933 100644 --- a/indra/newview/app_settings/shaders/class3/lighting/sumLightsV.glsl +++ b/indra/newview/app_settings/shaders/class3/lighting/sumLightsV.glsl @@ -24,7 +24,6 @@ */ - float calcDirectionalLight(vec3 n, vec3 l); float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float is_pointlight); @@ -33,22 +32,29 @@ vec3 atmosAffectDirectionalLight(float lightIntensity); vec3 scaleDownLight(vec3 light); vec3 scaleUpLight(vec3 light); +uniform vec4 light_position[8]; +uniform vec3 light_direction[8]; +uniform vec3 light_attenuation[8]; +uniform vec3 light_diffuse[8]; + vec4 sumLights(vec3 pos, vec3 norm, vec4 color, vec4 baseLight) { vec4 col = vec4(0.0, 0.0, 0.0, color.a); // Collect normal lights (need to be divided by two, as we later multiply by 2) - col.rgb += gl_LightSource[2].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[2].position, gl_LightSource[2].spotDirection.xyz, gl_LightSource[2].linearAttenuation, gl_LightSource[2].specular.a); - col.rgb += gl_LightSource[3].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[3].position, gl_LightSource[3].spotDirection.xyz, gl_LightSource[3].linearAttenuation, gl_LightSource[3].specular.a); - col.rgb += gl_LightSource[4].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[4].position, gl_LightSource[4].spotDirection.xyz, gl_LightSource[4].linearAttenuation, gl_LightSource[4].specular.a); - col.rgb += gl_LightSource[5].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[5].position, gl_LightSource[5].spotDirection.xyz, gl_LightSource[5].linearAttenuation, gl_LightSource[5].specular.a); - col.rgb += gl_LightSource[6].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[6].position, gl_LightSource[6].spotDirection.xyz, gl_LightSource[6].linearAttenuation, gl_LightSource[6].specular.a); - col.rgb += gl_LightSource[7].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[7].position, gl_LightSource[7].spotDirection.xyz, gl_LightSource[7].linearAttenuation, gl_LightSource[7].specular.a); - col.rgb += gl_LightSource[1].diffuse.rgb*calcDirectionalLight(norm, gl_LightSource[1].position.xyz); + + // Collect normal lights + col.rgb += light_diffuse[2].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[2], light_direction[2], light_attenuation[2].x, light_attenuation[2].z); + col.rgb += light_diffuse[3].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[3], light_direction[3], light_attenuation[3].x, light_attenuation[3].z); + col.rgb += light_diffuse[4].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[4], light_direction[4], light_attenuation[4].x, light_attenuation[4].z); + col.rgb += light_diffuse[5].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[5], light_direction[5], light_attenuation[5].x, light_attenuation[5].z); + col.rgb += light_diffuse[6].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[6], light_direction[6], light_attenuation[6].x, light_attenuation[6].z); + col.rgb += light_diffuse[7].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[7], light_direction[7], light_attenuation[7].x, light_attenuation[7].z); + col.rgb += light_diffuse[1].rgb*calcDirectionalLight(norm, light_position[1].xyz); col.rgb = scaleDownLight(col.rgb); // Add windlight lights - col.rgb += atmosAffectDirectionalLight(calcDirectionalLight(norm, gl_LightSource[0].position.xyz)); + col.rgb += atmosAffectDirectionalLight(calcDirectionalLight(norm, light_position[0].xyz)); col.rgb += atmosAmbient(baseLight.rgb); col.rgb = min(col.rgb*color.rgb, 1.0); diff --git a/indra/newview/app_settings/toolbars.xml b/indra/newview/app_settings/toolbars.xml index f2192a75ad..29c019719d 100644 --- a/indra/newview/app_settings/toolbars.xml +++ b/indra/newview/app_settings/toolbars.xml @@ -7,8 +7,8 @@ <command name="destinations"/> <command name="people"/> <command name="profile"/> - <command name="view"/> <command name="move"/> + <command name="view"/> <command name="howto"/> </bottom_toolbar> <left_toolbar @@ -20,5 +20,6 @@ <command name="places"/> <command name="voice"/> <command name="minimap"/> + <command name="snapshot"/> </left_toolbar> </toolbars> diff --git a/indra/newview/character/avatar_lad.xml b/indra/newview/character/avatar_lad.xml index 5d6b10c047..99dbfcae51 100644 --- a/indra/newview/character/avatar_lad.xml +++ b/indra/newview/character/avatar_lad.xml @@ -393,7 +393,26 @@ max_attachment_offset="2.0" visible_in_first_person="true" /> - + <attachment_point + id="39" + group="6" + pie_slice="1" + name="Neck" + joint="mNeck" + position="0 0 0" + rotation="0 0 0" + visible_in_first_person="true" /> + + <attachment_point + id="40" + group="6" + pie_slice="2" + name="Avatar Center" + joint="mRoot" + position="0 0 0" + rotation="0 0 0" + visible_in_first_person="true" /> + <param id="32" group="1" diff --git a/indra/newview/featuretable.txt b/indra/newview/featuretable.txt index 9ad313a9a7..0f33d40ac3 100644 --- a/indra/newview/featuretable.txt +++ b/indra/newview/featuretable.txt @@ -69,6 +69,8 @@ RenderShadowDetail 1 2 WatchdogDisabled 1 1 RenderUseStreamVBO 1 1 RenderFSAASamples 1 16 +RenderMaxTextureIndex 1 16 + // // Low Graphics Settings @@ -159,7 +161,7 @@ WLSkyDetail 1 48 RenderDeferred 1 0 RenderDeferredSSAO 1 0 RenderShadowDetail 1 0 -RenderFSAASamples 1 4 +RenderFSAASamples 1 2 // // Ultra graphics (REALLY PURTY!) @@ -188,7 +190,7 @@ WLSkyDetail 1 128 RenderDeferred 1 1 RenderDeferredSSAO 1 1 RenderShadowDetail 1 2 -RenderFSAASamples 1 8 +RenderFSAASamples 1 2 // @@ -296,6 +298,7 @@ RenderVBOEnable 1 0 list OpenGLPre30 RenderDeferred 0 0 +RenderMaxTextureIndex 1 1 list Intel RenderAnisotropic 1 0 diff --git a/indra/newview/featuretable_linux.txt b/indra/newview/featuretable_linux.txt index 2dbdf3a76e..8142311a55 100644 --- a/indra/newview/featuretable_linux.txt +++ b/indra/newview/featuretable_linux.txt @@ -67,6 +67,7 @@ RenderDeferred 1 1 RenderDeferredSSAO 1 1 RenderShadowDetail 1 2 RenderFSAASamples 1 16 +RenderMaxTextureIndex 1 16 // // Low Graphics Settings @@ -157,7 +158,7 @@ WLSkyDetail 1 48 RenderDeferred 1 0 RenderDeferredSSAO 1 0 RenderShadowDetail 1 0 -RenderFSAASamples 1 4 +RenderFSAASamples 1 2 // // Ultra graphics (REALLY PURTY!) @@ -187,7 +188,7 @@ WLSkyDetail 1 128 RenderDeferred 1 1 RenderDeferredSSAO 1 1 RenderShadowDetail 1 2 -RenderFSAASamples 1 8 +RenderFSAASamples 1 2 // // Class Unknown Hardware (unknown) diff --git a/indra/newview/featuretable_mac.txt b/indra/newview/featuretable_mac.txt index 996e574350..942c043081 100644 --- a/indra/newview/featuretable_mac.txt +++ b/indra/newview/featuretable_mac.txt @@ -1,4 +1,4 @@ -version 30 +version 32 // The version number above should be implemented IF AND ONLY IF some // change has been made that is sufficiently important to justify // resetting the graphics preferences of all users to the recommended @@ -51,10 +51,10 @@ RenderTerrainLODFactor 1 2.0 RenderTransparentWater 1 1 RenderTreeLODFactor 1 1.0 RenderUseImpostors 1 1 -RenderVBOEnable 1 0 -RenderVBOMappingDisable 1 0 +RenderVBOEnable 1 1 +RenderVBOMappingDisable 1 1 RenderVolumeLODFactor 1 2.0 -UseStartScreen 1 1 +UseStartScreen 1 1 UseOcclusion 1 1 VertexShaderEnable 1 1 WindLightUseAtmosShaders 1 1 @@ -67,8 +67,9 @@ RenderDeferred 1 1 RenderDeferredSSAO 1 1 RenderShadowDetail 1 2 WatchdogDisabled 1 1 -RenderUseStreamVBO 1 0 +RenderUseStreamVBO 1 1 RenderFSAASamples 1 16 +RenderMaxTextureIndex 1 16 // // Low Graphics Settings @@ -159,7 +160,7 @@ WLSkyDetail 1 48 RenderDeferred 1 0 RenderDeferredSSAO 1 0 RenderShadowDetail 1 2 -RenderFSAASamples 1 4 +RenderFSAASamples 1 2 // // Ultra graphics (REALLY PURTY!) @@ -189,7 +190,7 @@ WLSkyDetail 1 128 RenderDeferred 1 0 RenderDeferredSSAO 1 0 RenderShadowDetail 1 2 -RenderFSAASamples 1 8 +RenderFSAASamples 1 2 // // Class Unknown Hardware (unknown) @@ -290,7 +291,7 @@ list TexUnit8orLess RenderDeferredSSAO 0 0 list ATI -RenderDeferredSSAO 0 0 +RenderDeferredSSAO 1 0 list Intel RenderAnisotropic 1 0 diff --git a/indra/newview/featuretable_xp.txt b/indra/newview/featuretable_xp.txt index a53be10be1..278d601860 100644 --- a/indra/newview/featuretable_xp.txt +++ b/indra/newview/featuretable_xp.txt @@ -69,6 +69,7 @@ RenderShadowDetail 1 0 WatchdogDisabled 1 1 RenderUseStreamVBO 1 1 RenderFSAASamples 1 16 +RenderMaxTextureIndex 1 16 // // Low Graphics Settings @@ -159,7 +160,7 @@ WLSkyDetail 1 48 RenderDeferred 1 0 RenderDeferredSSAO 1 0 RenderShadowDetail 1 2 -RenderFSAASamples 1 4 +RenderFSAASamples 1 2 // // Ultra graphics (REALLY PURTY!) @@ -189,7 +190,7 @@ WLSkyDetail 1 128 RenderDeferred 1 0 RenderDeferredSSAO 1 0 RenderShadowDetail 1 2 -RenderFSAASamples 1 8 +RenderFSAASamples 1 2 // // Class Unknown Hardware (unknown) @@ -294,6 +295,7 @@ RenderVBOEnable 1 0 list OpenGLPre30 RenderDeferred 0 0 +RenderMaxTextureIndex 1 1 list Intel RenderAnisotropic 1 0 diff --git a/indra/newview/gpu_table.txt b/indra/newview/gpu_table.txt index b7d951e018..198e702459 100644 --- a/indra/newview/gpu_table.txt +++ b/indra/newview/gpu_table.txt @@ -112,8 +112,8 @@ ATI Mobility Radeon HD 545v .*ATI.*Mobility.*HD *545v.* 2 1 ATI Mobility Radeon HD 550v .*ATI.*Mobility.*HD *550v.* 2 1 ATI Mobility Radeon HD 560v .*ATI.*Mobility.*HD *560v.* 2 1 ATI Mobility Radeon HD 565v .*ATI.*Mobility.*HD *565v.* 2 1 -ATI Mobility Radeon HD 2300 .*ATI.*Mobility.*HD *23.* 1 1 -ATI Mobility Radeon HD 2400 .*ATI.*Mobility.*HD *24.* 1 1 +ATI Mobility Radeon HD 2300 .*ATI.*Mobility.*HD *23.* 2 1 +ATI Mobility Radeon HD 2400 .*ATI.*Mobility.*HD *24.* 2 1 ATI Mobility Radeon HD 2600 .*ATI.*Mobility.*HD *26.* 3 1 ATI Mobility Radeon HD 2700 .*ATI.*Mobility.*HD *27.* 3 1 ATI Mobility Radeon HD 3100 .*ATI.*Mobility.*HD *31.* 0 1 @@ -140,23 +140,23 @@ ATI Mobility Radeon HD 6600M .*ATI.*Mobility.*HD *66.* 3 1 ATI Mobility Radeon HD 6700M .*ATI.*Mobility.*HD *67.* 3 1 ATI Mobility Radeon HD 6800M .*ATI.*Mobility.*HD *68.* 3 1 ATI Mobility Radeon HD 6900M .*ATI.*Mobility.*HD *69.* 3 1 -ATI Radeon HD 2300 .*ATI.*Radeon HD *23.. 0 1 -ATI Radeon HD 2400 .*ATI.*Radeon HD *24.. 1 1 +ATI Radeon HD 2300 .*ATI.*Radeon HD *23.. 2 1 +ATI Radeon HD 2400 .*ATI.*Radeon HD *24.. 2 1 ATI Radeon HD 2600 .*ATI.*Radeon HD *26.. 2 1 ATI Radeon HD 2900 .*ATI.*Radeon HD *29.. 3 1 ATI Radeon HD 3000 .*ATI.*Radeon HD *30.. 0 1 ATI Radeon HD 3100 .*ATI.*Radeon HD *31.. 1 1 ATI Radeon HD 3200 .*ATI.*Radeon HD *32.. 1 1 -ATI Radeon HD 3300 .*ATI.*Radeon HD *33.. 1 1 -ATI Radeon HD 3400 .*ATI.*Radeon HD *34.. 1 1 -ATI Radeon HD 3500 .*ATI.*Radeon HD *35.. 1 1 +ATI Radeon HD 3300 .*ATI.*Radeon HD *33.. 2 1 +ATI Radeon HD 3400 .*ATI.*Radeon HD *34.. 2 1 +ATI Radeon HD 3500 .*ATI.*Radeon HD *35.. 2 1 ATI Radeon HD 3600 .*ATI.*Radeon HD *36.. 3 1 ATI Radeon HD 3700 .*ATI.*Radeon HD *37.. 3 1 ATI Radeon HD 3800 .*ATI.*Radeon HD *38.. 3 1 ATI Radeon HD 4100 .*ATI.*Radeon HD *41.. 1 1 ATI Radeon HD 4200 .*ATI.*Radeon HD *42.. 1 1 -ATI Radeon HD 4300 .*ATI.*Radeon HD *43.. 1 1 -ATI Radeon HD 4400 .*ATI.*Radeon HD *44.. 1 1 +ATI Radeon HD 4300 .*ATI.*Radeon HD *43.. 2 1 +ATI Radeon HD 4400 .*ATI.*Radeon HD *44.. 2 1 ATI Radeon HD 4500 .*ATI.*Radeon HD *45.. 3 1 ATI Radeon HD 4600 .*ATI.*Radeon HD *46.. 3 1 ATI Radeon HD 4700 .*ATI.*Radeon HD *47.. 3 1 @@ -401,11 +401,11 @@ NVIDIA GeForce 7900 .*NVIDIA .*GeForce 79.* 2 1 NVIDIA GeForce 8100 .*NVIDIA .*GeForce 81.* 1 1 NVIDIA GeForce 8200M .*NVIDIA .*GeForce 8200M.* 1 1 NVIDIA GeForce 8200 .*NVIDIA .*GeForce 82.* 1 1 -NVIDIA GeForce 8300 .*NVIDIA .*GeForce 83.* 1 1 -NVIDIA GeForce 8400M .*NVIDIA .*GeForce 8400M.* 1 1 -NVIDIA GeForce 8400 .*NVIDIA .*GeForce 84.* 1 1 +NVIDIA GeForce 8300 .*NVIDIA .*GeForce 83.* 2 1 +NVIDIA GeForce 8400M .*NVIDIA .*GeForce 8400M.* 2 1 +NVIDIA GeForce 8400 .*NVIDIA .*GeForce 84.* 2 1 NVIDIA GeForce 8500 .*NVIDIA .*GeForce 85.* 3 1 -NVIDIA GeForce 8600M .*NVIDIA .*GeForce 8600M.* 1 1 +NVIDIA GeForce 8600M .*NVIDIA .*GeForce 8600M.* 2 1 NVIDIA GeForce 8600 .*NVIDIA .*GeForce 86.* 3 1 NVIDIA GeForce 8700M .*NVIDIA .*GeForce 8700M.* 3 1 NVIDIA GeForce 8700 .*NVIDIA .*GeForce 87.* 3 1 @@ -415,10 +415,10 @@ NVIDIA GeForce 9100M .*NVIDIA .*GeForce 9100M.* 0 1 NVIDIA GeForce 9100 .*NVIDIA .*GeForce 91.* 0 1 NVIDIA GeForce 9200M .*NVIDIA .*GeForce 9200M.* 1 1 NVIDIA GeForce 9200 .*NVIDIA .*GeForce 92.* 1 1 -NVIDIA GeForce 9300M .*NVIDIA .*GeForce 9300M.* 1 1 -NVIDIA GeForce 9300 .*NVIDIA .*GeForce 93.* 1 1 -NVIDIA GeForce 9400M .*NVIDIA .*GeForce 9400M.* 1 1 -NVIDIA GeForce 9400 .*NVIDIA .*GeForce 94.* 1 1 +NVIDIA GeForce 9300M .*NVIDIA .*GeForce 9300M.* 2 1 +NVIDIA GeForce 9300 .*NVIDIA .*GeForce 93.* 2 1 +NVIDIA GeForce 9400M .*NVIDIA .*GeForce 9400M.* 2 1 +NVIDIA GeForce 9400 .*NVIDIA .*GeForce 94.* 2 1 NVIDIA GeForce 9500M .*NVIDIA .*GeForce 9500M.* 2 1 NVIDIA GeForce 9500 .*NVIDIA .*GeForce 95.* 2 1 NVIDIA GeForce 9600M .*NVIDIA .*GeForce 9600M.* 3 1 diff --git a/indra/newview/installers/darwin/dmg-cleanup.applescript b/indra/newview/installers/darwin/dmg-cleanup.applescript index f3d39aec21..8a71b392f9 100644 --- a/indra/newview/installers/darwin/dmg-cleanup.applescript +++ b/indra/newview/installers/darwin/dmg-cleanup.applescript @@ -19,7 +19,7 @@ tell application "Finder" set current view of foo to icon view set toolbar visible of foo to false set statusbar visible of foo to false - set the bounds of foo to {100, 100, 600, 399} + set the bounds of foo to {100, 100, 600, 449} -- set the position of front window to {100, 100} -- get {name, position} of every item of front window diff --git a/indra/newview/installers/darwin/fix_application_icon_position.sh b/indra/newview/installers/darwin/fix_application_icon_position.sh index c6b92589db..618e34820c 100644 --- a/indra/newview/installers/darwin/fix_application_icon_position.sh +++ b/indra/newview/installers/darwin/fix_application_icon_position.sh @@ -1,6 +1,6 @@ # just run this script each time after you change the installer's name to fix the icon misalignment #!/bin/bash -cp -r ./../../../build-darwin-i386/newview/*.dmg ~/Desktop/TempBuild.dmg +cp -r ../../../../build-darwin-i386/newview/*.dmg ~/Desktop/TempBuild.dmg hdid ~/Desktop/TempBuild.dmg open -a finder /Volumes/Second\ Life\ Installer osascript dmg-cleanup.applescript diff --git a/indra/newview/installers/darwin/release-dmg/_DS_Store b/indra/newview/installers/darwin/release-dmg/_DS_Store Binary files differindex 8f6c25c2f4..747ca961d8 100644 --- a/indra/newview/installers/darwin/release-dmg/_DS_Store +++ b/indra/newview/installers/darwin/release-dmg/_DS_Store diff --git a/indra/newview/installers/windows/installer_template.nsi b/indra/newview/installers/windows/installer_template.nsi index 4811f1fcd5..8a6114f0d5 100644 --- a/indra/newview/installers/windows/installer_template.nsi +++ b/indra/newview/installers/windows/installer_template.nsi @@ -1,6 +1,22 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; secondlife setup.nsi
-;; Copyright 2004-2010, Linden Research, Inc.
+;; Copyright 2004-2011, Linden Research, Inc.
+;;
+;; This library is free software; you can redistribute it and/or
+;; modify it under the terms of the GNU Lesser General Public
+;; License as published by the Free Software Foundation;
+;; version 2.1 of the License only.
+;;
+;; This library is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+;; Lesser General Public License for more details.
+;;
+;; You should have received a copy of the GNU Lesser General Public
+;; License along with this library; if not, write to the Free Software
+;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+;;
+;; Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
;;
;; NSIS Unicode 2.38.1 or higher required
;; http://www.scratchpaper.com/
@@ -99,6 +115,7 @@ Var COMMANDLINE ; command line passed to this installer, set in .onInit Var SHORTCUT_LANG_PARAM ; "--set InstallLanguage de", passes language to viewer
Var SKIP_DIALOGS ; set from command line in .onInit. autoinstall
; GUI and the defaults.
+Var DO_UNINSTALL_V2 ; If non-null, path to a previous Viewer 2 installation that will be uninstalled.
;;; Function definitions should go before file includes, because calls to
;;; DLLs like LangDLL trigger an implicit file include, so if that call is at
@@ -293,19 +310,171 @@ Function CheckNetworkConnection Return
FunctionEnd
+
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-; Delete files in Documents and Settings\<user>\SecondLife\cache
-; Delete files in Documents and Settings\All Users\SecondLife\cache
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;Function RemoveCacheFiles
+; Function CheckWillUninstallV2
;
-;; Delete files in Documents and Settings\<user>\SecondLife
+; If we are being called through auto-update, we need to uninstall any
+; existing V2 installation. Otherwise, we wind up with
+; SecondLifeViewer2 and SecondLifeViewer installations existing side
+; by side no indication which to use.
+; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+Function CheckWillUninstallV2
+
+ StrCpy $DO_UNINSTALL_V2 ""
+
+ StrCmp $SKIP_DIALOGS "true" 0 CHECKV2_DONE
+ StrCmp $INSTDIR "$PROGRAMFILES\SecondLifeViewer2" CHECKV2_DONE ; don't uninstall our own install dir.
+ IfFileExists "$PROGRAMFILES\SecondLifeViewer2\uninst.exe" CHECKV2_FOUND CHECKV2_DONE
+
+CHECKV2_FOUND:
+ StrCpy $DO_UNINSTALL_V2 "true"
+
+CHECKV2_DONE:
+
+FunctionEnd
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+; Save user files to temp location
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+Function PreserveUserFiles
+
+Push $0
+Push $1
+Push $2
+
+ RMDir /r "$TEMP\SecondLifeSettingsBackup"
+ CreateDirectory "$TEMP\SecondLifeSettingsBackup"
+ StrCpy $0 0 ; Index number used to iterate via EnumRegKey
+
+ LOOP:
+ EnumRegKey $1 HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList" $0
+ StrCmp $1 "" DONE ; no more users
+
+ ReadRegStr $2 HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\$1" "ProfileImagePath"
+ StrCmp $2 "" CONTINUE 0 ; "ProfileImagePath" value is missing
+
+ ; Required since ProfileImagePath is of type REG_EXPAND_SZ
+ ExpandEnvStrings $2 $2
+
+ CreateDirectory "$TEMP\SecondLifeSettingsBackup\$0"
+ CopyFiles /SILENT "$2\Application Data\SecondLife\*" "$TEMP\SecondLifeSettingsBackup\$0"
+
+ CONTINUE:
+ IntOp $0 $0 + 1
+ Goto LOOP
+ DONE:
+
+Pop $2
+Pop $1
+Pop $0
+
+; Copy files in Documents and Settings\All Users\SecondLife
+Push $0
+ ReadRegStr $0 HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" "Common AppData"
+ StrCmp $0 "" +2
+ CreateDirectory "$TEMP\SecondLifeSettingsBackup\AllUsers\"
+ CopyFiles /SILENT "$2\Application Data\SecondLife\*" "$TEMP\SecondLifeSettingsBackup\AllUsers\"
+Pop $0
+
+FunctionEnd
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+; Restore user files from temp location
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+Function RestoreUserFiles
+
+Push $0
+Push $1
+Push $2
+
+ StrCpy $0 0 ; Index number used to iterate via EnumRegKey
+
+ LOOP:
+ EnumRegKey $1 HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList" $0
+ StrCmp $1 "" DONE ; no more users
+
+ ReadRegStr $2 HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\$1" "ProfileImagePath"
+ StrCmp $2 "" CONTINUE 0 ; "ProfileImagePath" value is missing
+
+ ; Required since ProfileImagePath is of type REG_EXPAND_SZ
+ ExpandEnvStrings $2 $2
+
+ CreateDirectory "$2\Application Data\SecondLife\"
+ CopyFiles /SILENT "$TEMP\SecondLifeSettingsBackup\$0\*" "$2\Application Data\SecondLife\"
+
+ CONTINUE:
+ IntOp $0 $0 + 1
+ Goto LOOP
+ DONE:
+
+Pop $2
+Pop $1
+Pop $0
+
+; Copy files in Documents and Settings\All Users\SecondLife
+Push $0
+ ReadRegStr $0 HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" "Common AppData"
+ StrCmp $0 "" +2
+ CreateDirectory "$2\Application Data\SecondLife\"
+ CopyFiles /SILENT "$TEMP\SecondLifeSettingsBackup\AllUsers\*" "$2\Application Data\SecondLife\"
+Pop $0
+
+FunctionEnd
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+; Remove temp dirs
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+Function RemoveTempUserFiles
+
+Push $0
+Push $1
+Push $2
+
+ StrCpy $0 0 ; Index number used to iterate via EnumRegKey
+
+ LOOP:
+ EnumRegKey $1 HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList" $0
+ StrCmp $1 "" DONE ; no more users
+
+ ReadRegStr $2 HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\$1" "ProfileImagePath"
+ StrCmp $2 "" CONTINUE 0 ; "ProfileImagePath" value is missing
+
+ ; Required since ProfileImagePath is of type REG_EXPAND_SZ
+ ExpandEnvStrings $2 $2
+
+ RMDir /r "$TEMP\SecondLifeSettingsBackup\$0\*"
+
+ CONTINUE:
+ IntOp $0 $0 + 1
+ Goto LOOP
+ DONE:
+
+Pop $2
+Pop $1
+Pop $0
+
+; Copy files in Documents and Settings\All Users\SecondLife
+Push $0
+ ReadRegStr $0 HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" "Common AppData"
+ StrCmp $0 "" +2
+ RMDir /r "$TEMP\SecondLifeSettingsBackup\AllUsers\*"
+Pop $0
+
+FunctionEnd
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+; Clobber user files - TEST ONLY
+; This is here for testing, generally not desirable to call it.
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;Function ClobberUserFilesTESTONLY
+
;Push $0
;Push $1
;Push $2
-; DetailPrint $(RemoveCacheFilesDP)
;
-; StrCpy $0 0 ; Index number used to iterate via EnumRegKey
+; StrCpy $0 0 ; Index number used to iterate via EnumRegKey
;
; LOOP:
; EnumRegKey $1 HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList" $0
@@ -317,29 +486,24 @@ FunctionEnd ; ; Required since ProfileImagePath is of type REG_EXPAND_SZ
; ExpandEnvStrings $2 $2
;
-; ; When explicitly uninstalling, everything goes away
-; RMDir /r "$2\Application Data\SecondLife\cache"
+; RMDir /r "$2\Application Data\SecondLife\"
;
; CONTINUE:
; IntOp $0 $0 + 1
; Goto LOOP
; DONE:
+;
;Pop $2
;Pop $1
;Pop $0
;
-;; Delete files in Documents and Settings\All Users\SecondLife
+;; Copy files in Documents and Settings\All Users\SecondLife
;Push $0
-; ReadRegStr $0 HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" "Common AppData"
-; StrCmp $0 "" +2
-; RMDir /r "$0\SecondLife\cache"
+; ReadRegStr $0 HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" "Common AppData"
+; StrCmp $0 "" +2
+; RMDir /r "$2\Application Data\SecondLife\"
;Pop $0
;
-;; Delete filse in C:\Windows\Application Data\SecondLife
-;; If the user is running on a pre-NT system, Application Data lives here instead of
-;; in Documents and Settings.
-;RMDir /r "$WINDIR\Application Data\SecondLife\cache"
-;
;FunctionEnd
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -412,17 +576,15 @@ Push $2 ; Required since ProfileImagePath is of type REG_EXPAND_SZ
ExpandEnvStrings $2 $2
- ; If uninstalling a normal install remove everything
- ; Otherwise (preview/dmz etc) just remove cache
- StrCmp $INSTFLAGS "" RM_ALL RM_CACHE
- RM_ALL:
- RMDir /r "$2\Application Data\SecondLife"
- RM_CACHE:
- # Local Settings directory is the cache, there is no "cache" subdir
- RMDir /r "$2\Local Settings\Application Data\SecondLife"
- # Vista version of the same
- RMDir /r "$2\AppData\Local\SecondLife"
- Delete "$2\Application Data\SecondLife\user_settings\settings_windlight.xml"
+ ; Remove all cache and settings files but leave any other .txt files to preserve the chat logs
+; RMDir /r "$2\Application Data\SecondLife\logs"
+ RMDir /r "$2\Application Data\SecondLife\browser_profile"
+ RMDir /r "$2\Application Data\SecondLife\user_settings"
+ Delete "$2\Application Data\SecondLife\*.xml"
+ Delete "$2\Application Data\SecondLife\*.bmp"
+ Delete "$2\Application Data\SecondLife\search_history.txt"
+ Delete "$2\Application Data\SecondLife\plugin_cookies.txt"
+ Delete "$2\Application Data\SecondLife\typed_locations.txt"
CONTINUE:
IntOp $0 $0 + 1
@@ -440,7 +602,7 @@ Push $0 RMDir /r "$0\SecondLife"
Pop $0
-; Delete filse in C:\Windows\Application Data\SecondLife
+; Delete files in C:\Windows\Application Data\SecondLife
; If the user is running on a pre-NT system, Application Data lives here instead of
; in Documents and Settings.
RMDir /r "$WINDIR\Application Data\SecondLife"
@@ -768,12 +930,16 @@ Call CheckIfAdministrator ; Make sure the user can install/uninstall Call CheckIfAlreadyCurrent ; Make sure that we haven't already installed this version
Call CloseSecondLife ; Make sure we're not running
Call CheckNetworkConnection ; ping secondlife.com
+Call CheckWillUninstallV2 ; See if a V2 install exists and will be removed.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+StrCmp $DO_UNINSTALL_V2 "" PRESERVE_DONE
+ Call PreserveUserFiles
+PRESERVE_DONE:
+
;;; Don't remove cache files during a regular install, removing the inventory cache on upgrades results in lots of damage to the servers.
;Call RemoveCacheFiles ; Installing over removes potentially corrupted
; VFS and cache files.
-
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; Need to clean out shader files from previous installs to fix DEV-5663
Call RemoveOldShaders
@@ -854,6 +1020,16 @@ WriteRegExpandStr HKEY_CLASSES_ROOT "x-grid-location-info\shell\open\command" "" ; write out uninstaller
WriteUninstaller "$INSTDIR\uninst.exe"
+; Uninstall existing "Second Life Viewer 2" install if needed.
+StrCmp $DO_UNINSTALL_V2 "" REMOVE_SLV2_DONE
+ ExecWait '"$PROGRAMFILES\SecondLifeViewer2\uninst.exe" /S _?=$PROGRAMFILES\SecondLifeViewer2'
+ Delete "$PROGRAMFILES\SecondLifeViewer2\uninst.exe" ; with _? option above, uninst.exe will be left behind.
+ RMDir "$PROGRAMFILES\SecondLifeViewer2" ; will remove only if empty.
+
+ Call RestoreUserFiles
+ Call RemoveTempUserFiles
+REMOVE_SLV2_DONE:
+
; end of default section
SectionEnd
diff --git a/indra/newview/installers/windows/lang_ru.nsi b/indra/newview/installers/windows/lang_ru.nsi Binary files differindex bd37e4ad4c..de7affe08a 100644 --- a/indra/newview/installers/windows/lang_ru.nsi +++ b/indra/newview/installers/windows/lang_ru.nsi diff --git a/indra/newview/installers/windows/lang_tr.nsi b/indra/newview/installers/windows/lang_tr.nsi Binary files differindex 7b4ce358f3..5e7e3d797b 100644 --- a/indra/newview/installers/windows/lang_tr.nsi +++ b/indra/newview/installers/windows/lang_tr.nsi diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index f8b204eca0..54ad3cd187 100755 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -205,6 +205,12 @@ void LLAgent::releaseMicrophone(const LLSD& name) } // static +void LLAgent::toggleMicrophone(const LLSD& name) +{ + LLVoiceClient::getInstance()->toggleUserPTTState(); +} + +// static bool LLAgent::isMicrophoneOn(const LLSD& sdname) { return LLVoiceClient::getInstance()->getUserPTTState(); @@ -331,12 +337,6 @@ void LLAgent::init() LLViewerParcelMgr::getInstance()->addAgentParcelChangedCallback(boost::bind(&LLAgent::parcelChangedCallback)); - LLUICtrl::EnableCallbackRegistry::currentRegistrar().add("Agent.IsActionAllowed", boost::bind(&LLAgent::isActionAllowed, _2)); - LLUICtrl::CommitCallbackRegistry::currentRegistrar().add("Agent.PressMicrophone", boost::bind(&LLAgent::pressMicrophone, _2)); - LLUICtrl::CommitCallbackRegistry::currentRegistrar().add("Agent.ReleaseMicrophone", boost::bind(&LLAgent::releaseMicrophone, _2)); - LLUICtrl::EnableCallbackRegistry::currentRegistrar().add("Agent.IsMicrophoneOn", boost::bind(&LLAgent::isMicrophoneOn, _2)); - - mInitialized = TRUE; } @@ -1101,20 +1101,11 @@ F32 LLAgent::clampPitchToLimits(F32 angle) LLVector3 skyward = getReferenceUpVector(); - F32 look_down_limit; - F32 look_up_limit = 10.f * DEG_TO_RAD; + const F32 look_down_limit = 179.f * DEG_TO_RAD;; + const F32 look_up_limit = 1.f * DEG_TO_RAD; F32 angle_from_skyward = acos( mFrameAgent.getAtAxis() * skyward ); - if (isAgentAvatarValid() && gAgentAvatarp->isSitting()) - { - look_down_limit = 130.f * DEG_TO_RAD; - } - else - { - look_down_limit = 170.f * DEG_TO_RAD; - } - // clamp pitch to limits if ((angle >= 0.f) && (angle_from_skyward + angle > look_down_limit)) { @@ -4004,14 +3995,14 @@ void LLAgent::renderAutoPilotTarget() F32 height_meters; LLVector3d target_global; - glMatrixMode(GL_MODELVIEW); + gGL.matrixMode(LLRender::MM_MODELVIEW); gGL.pushMatrix(); // not textured gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); // lovely green - glColor4f(0.f, 1.f, 1.f, 1.f); + gGL.color4f(0.f, 1.f, 1.f, 1.f); target_global = mAutoPilotTargetGlobal; @@ -4019,9 +4010,9 @@ void LLAgent::renderAutoPilotTarget() height_meters = 1.f; - glScalef(height_meters, height_meters, height_meters); + gGL.scalef(height_meters, height_meters, height_meters); - gSphere.render(1500.f); + gSphere.render(); gGL.popMatrix(); } diff --git a/indra/newview/llagent.h b/indra/newview/llagent.h index 0f7ed9ce68..740770bbdf 100644 --- a/indra/newview/llagent.h +++ b/indra/newview/llagent.h @@ -292,7 +292,9 @@ public: static void pressMicrophone(const LLSD& name); static void releaseMicrophone(const LLSD& name); + static void toggleMicrophone(const LLSD& name); static bool isMicrophoneOn(const LLSD& sdname); + static bool isActionAllowed(const LLSD& sdname); private: bool mVoiceConnected; @@ -595,7 +597,6 @@ public: private: bool mCanEditParcel; - static bool isActionAllowed(const LLSD& sdname); static void parcelChangedCallback(); /******************************************************************************** diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index ecfd101eeb..b45f9c55fb 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -522,6 +522,8 @@ static void settings_to_globals() LLSurface::setTextureSize(gSavedSettings.getU32("RegionTextureSize")); + LLRender::sGLCoreProfile = gSavedSettings.getBOOL("RenderGLCoreProfile"); + LLImageGL::sGlobalUseAnisotropic = gSavedSettings.getBOOL("RenderAnisotropic"); LLVOVolume::sLODFactor = gSavedSettings.getF32("RenderVolumeLODFactor"); LLVOVolume::sDistanceFactor = 1.f-LLVOVolume::sLODFactor * 0.1f; @@ -556,42 +558,6 @@ static void settings_modify() gDebugGL = gSavedSettings.getBOOL("RenderDebugGL") || gDebugSession; gDebugPipeline = gSavedSettings.getBOOL("RenderDebugPipeline"); gAuditTexture = gSavedSettings.getBOOL("AuditTexture"); -#if LL_VECTORIZE - if (gSysCPU.hasAltivec()) - { - gSavedSettings.setBOOL("VectorizeEnable", TRUE ); - gSavedSettings.setU32("VectorizeProcessor", 0 ); - } - else - if (gSysCPU.hasSSE2()) - { - gSavedSettings.setBOOL("VectorizeEnable", TRUE ); - gSavedSettings.setU32("VectorizeProcessor", 2 ); - } - else - if (gSysCPU.hasSSE()) - { - gSavedSettings.setBOOL("VectorizeEnable", TRUE ); - gSavedSettings.setU32("VectorizeProcessor", 1 ); - } - else - { - // Don't bother testing or running if CPU doesn't support it. JC - gSavedSettings.setBOOL("VectorizePerfTest", FALSE ); - gSavedSettings.setBOOL("VectorizeEnable", FALSE ); - gSavedSettings.setU32("VectorizeProcessor", 0 ); - gSavedSettings.setBOOL("VectorizeSkin", FALSE); - } -#else - // This build target doesn't support SSE, don't test/run. - gSavedSettings.setBOOL("VectorizePerfTest", FALSE ); - gSavedSettings.setBOOL("VectorizeEnable", FALSE ); - gSavedSettings.setU32("VectorizeProcessor", 0 ); - gSavedSettings.setBOOL("VectorizeSkin", FALSE); - - // disable fullscreen mode, unsupported - gSavedSettings.setBOOL("WindowFullScreen", FALSE); -#endif } class LLFastTimerLogThread : public LLThread @@ -773,7 +739,7 @@ bool LLAppViewer::init() LLViewerAssetStatsFF::init(); } - initThreads(); + initThreads(); LL_INFOS("InitInfo") << "Threads initialized." << LL_ENDL ; // Initialize settings early so that the defaults for ignorable dialogs are @@ -847,9 +813,9 @@ bool LLAppViewer::init() LLWeb::initClass(); // do this after LLUI // Provide the text fields with callbacks for opening Urls - LLUrlAction::setOpenURLCallback(&LLWeb::loadURL); - LLUrlAction::setOpenURLInternalCallback(&LLWeb::loadURLInternal); - LLUrlAction::setOpenURLExternalCallback(&LLWeb::loadURLExternal); + LLUrlAction::setOpenURLCallback(boost::bind(&LLWeb::loadURL, _1, LLStringUtil::null, LLStringUtil::null)); + LLUrlAction::setOpenURLInternalCallback(boost::bind(&LLWeb::loadURLInternal, _1, LLStringUtil::null, LLStringUtil::null)); + LLUrlAction::setOpenURLExternalCallback(boost::bind(&LLWeb::loadURLExternal, _1, true, LLStringUtil::null)); LLUrlAction::setExecuteSLURLCallback(&LLURLDispatcher::dispatchFromTextEditor); // Let code in llui access the viewer help floater @@ -875,8 +841,6 @@ bool LLAppViewer::init() LLAgent::parseTeleportMessages("teleport_strings.xml"); - LLViewerJointMesh::updateVectorize(); - // load MIME type -> media impl mappings std::string mime_types_name; #if LL_DARWIN @@ -1417,6 +1381,11 @@ bool LLAppViewer::mainLoop() } } gMeshRepo.update() ; + + if(!LLCurl::getCurlThread()->update(1)) + { + LLCurl::getCurlThread()->pause() ; //nothing in the curl thread. + } if(!total_work_pending) //pause texture fetching threads if nothing to process. { @@ -1812,6 +1781,7 @@ bool LLAppViewer::cleanup() pending += LLAppViewer::getTextureFetch()->update(1); // unpauses the texture fetch thread pending += LLVFSThread::updateClass(0); pending += LLLFSThread::updateClass(0); + pending += LLCurl::getCurlThread()->update(1) ; F64 idle_time = idleTimer.getElapsedTimeF64(); if(!pending) { @@ -1823,6 +1793,7 @@ bool LLAppViewer::cleanup() break; } } + LLCurl::getCurlThread()->pause() ; // Delete workers first // shotdown all worker threads before deleting them in case of co-dependencies @@ -1970,6 +1941,8 @@ bool LLAppViewer::initThreads() static const bool enable_threads = true; #endif + LLImage::initClass(); + LLVFSThread::initClass(enable_threads && false); LLLFSThread::initClass(enable_threads && false); @@ -1979,8 +1952,7 @@ bool LLAppViewer::initThreads() LLAppViewer::sTextureFetch = new LLTextureFetch(LLAppViewer::getTextureCache(), sImageDecodeThread, enable_threads && true, - app_metrics_qa_mode); - LLImage::initClass(); + app_metrics_qa_mode); if (LLFastTimer::sLog || LLFastTimer::sMetricLog) { @@ -2825,48 +2797,15 @@ void LLAppViewer::initUpdater() void LLAppViewer::checkForCrash(void) { - #if LL_SEND_CRASH_REPORTS if (gLastExecEvent == LAST_EXEC_FROZE) { - llinfos << "Last execution froze, requesting to send crash report." << llendl; - // - // Pop up a freeze or crash warning dialog - // - S32 choice; - const S32 cb = gCrashSettings.getS32("CrashSubmitBehavior"); - if(cb == CRASH_BEHAVIOR_ASK) - { - std::ostringstream msg; - msg << LLTrans::getString("MBFrozenCrashed"); - std::string alert = LLTrans::getString("APP_NAME") + " " + LLTrans::getString("MBAlert"); - choice = OSMessageBox(msg.str(), - alert, - OSMB_YESNO); - } - else if(cb == CRASH_BEHAVIOR_NEVER_SEND) - { - choice = OSBTN_NO; - } - else - { - choice = OSBTN_YES; - } - - if (OSBTN_YES == choice) - { - llinfos << "Sending crash report." << llendl; + llinfos << "Last execution froze, sending a crash report." << llendl; - bool report_freeze = true; - handleCrashReporting(report_freeze); - } - else - { - llinfos << "Not sending crash report." << llendl; - } + bool report_freeze = true; + handleCrashReporting(report_freeze); } #endif // LL_SEND_CRASH_REPORTS - } // @@ -2892,11 +2831,21 @@ bool LLAppViewer::initWindow() // always start windowed BOOL ignorePixelDepth = gSavedSettings.getBOOL("IgnorePixelDepth"); - gViewerWindow = new LLViewerWindow(gWindowTitle, - VIEWER_WINDOW_CLASSNAME, - gSavedSettings.getS32("WindowX"), gSavedSettings.getS32("WindowY"), - gSavedSettings.getS32("WindowWidth"), gSavedSettings.getS32("WindowHeight"), - gSavedSettings.getBOOL("WindowFullScreen"), ignorePixelDepth); + + LLViewerWindow::Params window_params; + window_params + .title(gWindowTitle) + .name(VIEWER_WINDOW_CLASSNAME) + .x(gSavedSettings.getS32("WindowX")) + .y(gSavedSettings.getS32("WindowY")) + .width(gSavedSettings.getU32("WindowWidth")) + .height(gSavedSettings.getU32("WindowHeight")) + .min_width(gSavedSettings.getU32("MinWindowWidth")) + .min_height(gSavedSettings.getU32("MinWindowHeight")) + .fullscreen(gSavedSettings.getBOOL("FullScreen")) + .ignore_pixel_depth(ignorePixelDepth); + + gViewerWindow = new LLViewerWindow(window_params); LL_INFOS("AppInit") << "gViewerwindow created." << LL_ENDL; @@ -3117,6 +3066,8 @@ void LLAppViewer::handleViewerCrash() llinfos << "Last render pool type: " << LLPipeline::sCurRenderPoolType << llendl ; + LLMemory::logMemoryInfo(true) ; + //print out recorded call stacks if there are any. LLError::LLCallStacks::print(); diff --git a/indra/newview/llappviewerwin32.cpp b/indra/newview/llappviewerwin32.cpp index f94c843ad9..647ace7ee3 100644 --- a/indra/newview/llappviewerwin32.cpp +++ b/indra/newview/llappviewerwin32.cpp @@ -403,11 +403,9 @@ bool LLAppViewerWin32::initHardwareTest() // if (FALSE == gSavedSettings.getBOOL("NoHardwareProbe")) { - BOOL vram_only = !gSavedSettings.getBOOL("ProbeHardwareOnStartup"); - // per DEV-11631 - disable hardware probing for everything // but vram. - vram_only = TRUE; + BOOL vram_only = TRUE; LLSplashScreen::update(LLTrans::getString("StartupDetectingHardware")); diff --git a/indra/newview/llassetuploadresponders.cpp b/indra/newview/llassetuploadresponders.cpp index 966f5b941e..65bfc990d1 100644 --- a/indra/newview/llassetuploadresponders.cpp +++ b/indra/newview/llassetuploadresponders.cpp @@ -78,6 +78,8 @@ void on_new_single_inventory_upload_complete( const LLSD& server_response, S32 upload_price) { + bool success = false; + if ( upload_price > 0 ) { // this upload costed us L$, update our balance @@ -152,6 +154,7 @@ void on_new_single_inventory_upload_complete( gInventory.updateItem(item); gInventory.notifyObservers(); + success = true; // Show the preview panel for textures and sounds to let // user know that the image (or snapshot) arrived intact. @@ -175,6 +178,13 @@ void on_new_single_inventory_upload_complete( // remove the "Uploading..." message LLUploadDialog::modalUploadFinished(); + + // Let the Snapshot floater know we have finished uploading a snapshot to inventory. + LLFloater* floater_snapshot = LLFloaterReg::findInstance("snapshot"); + if (asset_type == LLAssetType::AT_TEXTURE && floater_snapshot) + { + floater_snapshot->notify(LLSD().with("set-finished", LLSD().with("ok", success).with("msg", "inventory"))); + } } LLAssetUploadResponder::LLAssetUploadResponder(const LLSD &post_data, @@ -285,6 +295,11 @@ void LLAssetUploadResponder::uploadFailure(const LLSD& content) { // remove the "Uploading..." message LLUploadDialog::modalUploadFinished(); + LLFloater* floater_snapshot = LLFloaterReg::findInstance("snapshot"); + if (floater_snapshot) + { + floater_snapshot->notify(LLSD().with("set-finished", LLSD().with("ok", false).with("msg", "inventory"))); + } std::string reason = content["state"]; // deal with L$ errors diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp index 10fd6b739e..8ca621538f 100755 --- a/indra/newview/llavataractions.cpp +++ b/indra/newview/llavataractions.cpp @@ -302,6 +302,12 @@ void LLAvatarActions::startConference(const uuid_vec_t& ids) make_ui_sound("UISndStartIM"); } +static const char* get_profile_floater_name(const LLUUID& avatar_id) +{ + // Use different floater XML for our profile to be able to save its rect. + return avatar_id == gAgentID ? "my_profile" : "profile"; +} + static void on_avatar_name_show_profile(const LLUUID& agent_id, const LLAvatarName& av_name) { std::string username = av_name.mUsername; @@ -314,15 +320,10 @@ static void on_avatar_name_show_profile(const LLUUID& agent_id, const LLAvatarNa std::string url = getProfileURL(username); // PROFILES: open in webkit window - const bool show_chrome = false; - static LLCachedControl<LLRect> profile_rect(gSavedSettings, "WebProfileRect"); LLFloaterWebContent::Params p; p.url(url). - id(agent_id.asString()). - show_chrome(show_chrome). - window_class("profile"). - preferred_media_size(profile_rect); - LLFloaterReg::showInstance("profile", p); + id(agent_id.asString()); + LLFloaterReg::showInstance(get_profile_floater_name(agent_id), p); } // static @@ -339,14 +340,15 @@ bool LLAvatarActions::profileVisible(const LLUUID& id) { LLSD sd; sd["id"] = id; - LLFloaterWebContent *browser = dynamic_cast<LLFloaterWebContent*> (LLFloaterReg::findInstance("profile", sd)); + LLFloater* browser = getProfileFloater(id); return browser && browser->isShown(); } //static LLFloater* LLAvatarActions::getProfileFloater(const LLUUID& id) { - LLFloaterWebContent *browser = dynamic_cast<LLFloaterWebContent*> (LLFloaterReg::findInstance("profile", LLSD().with("id", id))); + LLFloaterWebContent *browser = dynamic_cast<LLFloaterWebContent*> + (LLFloaterReg::findInstance(get_profile_floater_name(id), LLSD().with("id", id))); return browser; } @@ -355,7 +357,7 @@ void LLAvatarActions::hideProfile(const LLUUID& id) { LLSD sd; sd["id"] = id; - LLFloaterWebContent *browser = dynamic_cast<LLFloaterWebContent*> (LLFloaterReg::findInstance("profile", sd)); + LLFloater* browser = getProfileFloater(id); if (browser) { browser->closeFloater(); diff --git a/indra/newview/llchicletbar.cpp b/indra/newview/llchicletbar.cpp index a17e1d13f5..a879651060 100644 --- a/indra/newview/llchicletbar.cpp +++ b/indra/newview/llchicletbar.cpp @@ -35,6 +35,7 @@ // newview includes #include "llchiclet.h" #include "llimfloater.h" // for LLIMFloater +#include "llpaneltopinfobar.h" #include "llsyswellwindow.h" namespace @@ -181,6 +182,9 @@ BOOL LLChicletBar::postBuild() showWellButton("im_well", !LLIMWellWindow::getInstance()->isWindowEmpty()); showWellButton("notification_well", !LLNotificationWellWindow::getInstance()->isWindowEmpty()); + LLPanelTopInfoBar::instance().setResizeCallback(boost::bind(&LLChicletBar::fitWithTopInfoBar, this)); + LLPanelTopInfoBar::instance().setVisibleCallback(boost::bind(&LLChicletBar::fitWithTopInfoBar, this)); + return TRUE; } @@ -338,3 +342,33 @@ S32 LLChicletBar::getChicletPanelShrinkHeadroom() const llassert(shrink_headroom >= 0); // the panel cannot get narrower than the minimum return shrink_headroom; } + +void LLChicletBar::fitWithTopInfoBar() +{ + LLPanelTopInfoBar& top_info_bar = LLPanelTopInfoBar::instance(); + + LLRect rect = getRect(); + S32 width = rect.getWidth(); + + if (top_info_bar.getVisible()) + { + S32 delta = top_info_bar.calcScreenRect().mRight - calcScreenRect().mLeft; + if (delta < 0 && rect.mLeft < llabs(delta)) + delta = -rect.mLeft; + rect.setLeftTopAndSize(rect.mLeft + delta, rect.mTop, rect.getWidth(), rect.getHeight()); + width = rect.getWidth() - delta; + } + else + { + LLView* parent = getParent(); + if (parent) + { + LLRect parent_rect = parent->getRect(); + rect.setLeftTopAndSize(0, rect.mTop, rect.getWidth(), rect.getHeight()); + width = parent_rect.getWidth(); + } + } + + setRect(rect); + LLPanel::reshape(width, rect.getHeight(), false); +} diff --git a/indra/newview/llchicletbar.h b/indra/newview/llchicletbar.h index 224dfbb647..1427bf95e0 100644 --- a/indra/newview/llchicletbar.h +++ b/indra/newview/llchicletbar.h @@ -89,6 +89,12 @@ private: */ S32 getChicletPanelShrinkHeadroom() const; + /** + * function adjusts Chiclet bar width to prevent overlapping with Mini-Location bar + * EXP-1463 + */ + void fitWithTopInfoBar(); + protected: LLChicletBar(const LLSD& key = LLSD()); diff --git a/indra/newview/llcylinder.cpp b/indra/newview/llcylinder.cpp index 4901e29691..f353851a25 100644 --- a/indra/newview/llcylinder.cpp +++ b/indra/newview/llcylinder.cpp @@ -37,261 +37,39 @@ #include "llgl.h" #include "llglheaders.h" -LLCylinder gCylinder; LLCone gCone; -GLUquadricObj* gQuadObj = NULL; - -static const GLint SLICES[] = { 30, 20, 12, 6 }; // same as sphere slices -static const GLint STACKS = 2; -static const GLfloat RADIUS = 0.5f; - -// draws a cylinder or cone -// returns approximate number of triangles required -U32 draw_cylinder_side(GLint slices, GLint stacks, GLfloat base_radius, GLfloat top_radius) -{ - U32 triangles = 0; - GLfloat height = 1.0f; - - if (!gQuadObj) - { - gQuadObj = gluNewQuadric(); - if (!gQuadObj) llerror("draw_cylindrical_body couldn't allocated quadric", 0); - } - - gluQuadricDrawStyle(gQuadObj, GLU_FILL); - gluQuadricNormals(gQuadObj, GLU_SMOOTH); - gluQuadricOrientation(gQuadObj, GLU_OUTSIDE); - gluQuadricTexture(gQuadObj, GL_TRUE); - gluCylinder(gQuadObj, base_radius, top_radius, height, slices, stacks); - triangles += stacks * (slices * 2); - - - return triangles; -} - - -// Returns number of triangles required to draw -// Need to know if top or not to set lighting normals -const BOOL TOP = TRUE; -const BOOL BOTTOM = FALSE; -U32 draw_cylinder_cap(GLint slices, GLfloat base_radius, BOOL is_top) -{ - U32 triangles = 0; - - if (!gQuadObj) - { - gQuadObj = gluNewQuadric(); - if (!gQuadObj) llerror("draw_cylinder_base couldn't allocated quadric", 0); - } - - gluQuadricDrawStyle(gQuadObj, GLU_FILL); - gluQuadricNormals(gQuadObj, GLU_SMOOTH); - gluQuadricOrientation(gQuadObj, GLU_OUTSIDE); - gluQuadricTexture(gQuadObj, GL_TRUE); - - // no hole in the middle of the disk, and just one ring - GLdouble inner_radius = 0.0; - GLint rings = 1; - - // normals point in +z for top, -z for base - if (is_top) - { - gluQuadricOrientation(gQuadObj, GLU_OUTSIDE); - } - else - { - gluQuadricOrientation(gQuadObj, GLU_INSIDE); - } - gluDisk(gQuadObj, inner_radius, base_radius, slices, rings); - triangles += slices; - - return triangles; -} - -void LLCylinder::drawSide(S32 detail) -{ - draw_cylinder_side(SLICES[detail], STACKS, RADIUS, RADIUS); -} - -void LLCylinder::drawTop(S32 detail) -{ - draw_cylinder_cap(SLICES[detail], RADIUS, TOP); -} - -void LLCylinder::drawBottom(S32 detail) -{ - draw_cylinder_cap(SLICES[detail], RADIUS, BOTTOM); -} - -void LLCylinder::prerender() -{ -} - -void LLCylinder::cleanupGL() -{ - if (gQuadObj) - { - gluDeleteQuadric(gQuadObj); - gQuadObj = NULL; - } -} - -void LLCylinder::render(F32 pixel_area) -{ - renderface(pixel_area, 0); - renderface(pixel_area, 1); - renderface(pixel_area, 2); -} - - -void LLCylinder::renderface(F32 pixel_area, S32 face) -{ - if (face < 0 || face > 2) - { - llerror("LLCylinder::renderface() invalid face number", face); - return; - } - - glMatrixMode(GL_MODELVIEW); - glPushMatrix(); - - S32 level_of_detail; - - if (pixel_area > 20000.f) - { - level_of_detail = 0; - } - else if (pixel_area > 1600.f) - { - level_of_detail = 1; - } - else if (pixel_area > 200.f) - { - level_of_detail = 2; - } - else - { - level_of_detail = 3; - } - - if (level_of_detail < 0 || CYLINDER_LEVELS_OF_DETAIL <= level_of_detail) - { - llerror("LLCylinder::renderface() invalid level of detail", level_of_detail); - return; - } - - LLVertexBuffer::unbind(); - - switch(face) - { - case 0: - glTranslatef(0.f, 0.f, -0.5f); - drawSide(level_of_detail); - break; - case 1: - glTranslatef(0.0f, 0.f, 0.5f); - drawTop(level_of_detail); - break; - case 2: - glTranslatef(0.0f, 0.f, -0.5f); - drawBottom(level_of_detail); - break; - default: - llerror("LLCylinder::renderface() fell out of switch", 0); - break; - } - - glMatrixMode(GL_MODELVIEW); - glPopMatrix(); -} - - // // Cones // -void LLCone::prerender() +void LLCone::render(S32 sides) { -} + gGL.begin(LLRender::TRIANGLE_FAN); + gGL.vertex3f(0,0,0); -void LLCone::cleanupGL() -{ - if (gQuadObj) + for (U32 i = 0; i < sides; i++) { - gluDeleteQuadric(gQuadObj); - gQuadObj = NULL; + F32 a = (F32) i/sides * F_PI*2.f; + F32 x = cosf(a)*0.5f; + F32 y = sinf(a)*0.5f; + gGL.vertex3f(x,y,-.5f); } -} + gGL.vertex3f(cosf(0.f)*0.5f, sinf(0.f)*0.5f, -0.5f); -void LLCone::drawSide(S32 detail) -{ - draw_cylinder_side( SLICES[detail], STACKS, RADIUS, 0.f ); -} - -void LLCone::drawBottom(S32 detail) -{ - draw_cylinder_cap( SLICES[detail], RADIUS, BOTTOM ); -} - -void LLCone::render(S32 level_of_detail) -{ - GLfloat height = 1.0f; + gGL.end(); - if (level_of_detail < 0 || CONE_LEVELS_OF_DETAIL <= level_of_detail) + gGL.begin(LLRender::TRIANGLE_FAN); + gGL.vertex3f(0.f, 0.f, 0.5f); + for (U32 i = 0; i < sides; i++) { - llerror("LLCone::render() invalid level of detail", level_of_detail); - return; + F32 a = (F32) i/sides * F_PI*2.f; + F32 x = cosf(a)*0.5f; + F32 y = sinf(a)*0.5f; + gGL.vertex3f(x,y,-0.5f); } + gGL.vertex3f(cosf(0.f)*0.5f, sinf(0.f)*0.5f, -0.5f); - glMatrixMode(GL_MODELVIEW); - glPushMatrix(); - - // center object at 0 - glTranslatef(0.f, 0.f, - height / 2.0f); - - drawSide(level_of_detail); - drawBottom(level_of_detail); - - glMatrixMode(GL_MODELVIEW); - glPopMatrix(); + gGL.end(); } - -void LLCone::renderface(S32 level_of_detail, S32 face) -{ - if (face < 0 || face > 1) - { - llerror("LLCone::renderface() invalid face number", face); - return; - } - - if (level_of_detail < 0 || CONE_LEVELS_OF_DETAIL <= level_of_detail) - { - llerror("LLCone::renderface() invalid level of detail", level_of_detail); - return; - } - - glMatrixMode(GL_MODELVIEW); - glPushMatrix(); - - LLVertexBuffer::unbind(); - - switch(face) - { - case 0: - glTranslatef(0.f, 0.f, -0.5f); - drawSide(level_of_detail); - break; - case 1: - glTranslatef(0.f, 0.f, -0.5f); - drawBottom(level_of_detail); - break; - default: - llerror("LLCylinder::renderface() fell out of switch", 0); - break; - } - - glMatrixMode(GL_MODELVIEW); - glPopMatrix(); -} diff --git a/indra/newview/llcylinder.h b/indra/newview/llcylinder.h index 40a669ceb6..4369f06659 100644 --- a/indra/newview/llcylinder.h +++ b/indra/newview/llcylinder.h @@ -30,45 +30,18 @@ //#include "stdtypes.h" //#include "llgl.h" -// -// Cylinders -// -const S32 CYLINDER_LEVELS_OF_DETAIL = 4; -const S32 CYLINDER_FACES = 3; - -class LLCylinder -{ -public: - void prerender(); - void drawTop(S32 detail); - void drawSide(S32 detail); - void drawBottom(S32 detail); - void cleanupGL(); - - void render(F32 pixel_area); - void renderface(F32 pixel_area, S32 face); -}; - +#include "llvertexbuffer.h" // // Cones // -const S32 CONE_LOD_HIGHEST = 0; -const S32 CONE_LEVELS_OF_DETAIL = 4; -const S32 CONE_FACES = 2; - class LLCone { public: - void prerender(); - void cleanupGL(); - void drawSide(S32 detail); - void drawBottom(S32 detail); - void render(S32 level_of_detail); - void renderface(S32 level_of_detail, S32 face); + void render(S32 sides = 12); }; -extern LLCylinder gCylinder; + extern LLCone gCone; #endif diff --git a/indra/newview/lldebugview.cpp b/indra/newview/lldebugview.cpp index ba511a3693..7d3170cb76 100644 --- a/indra/newview/lldebugview.cpp +++ b/indra/newview/lldebugview.cpp @@ -55,9 +55,23 @@ LLDebugView* gDebugView = NULL; static LLDefaultChildRegistry::Register<LLDebugView> r("debug_view"); LLDebugView::LLDebugView(const LLDebugView::Params& p) -: LLView(p) +: LLView(p), + mFastTimerView(NULL), + mMemoryView(NULL), + mDebugConsolep(NULL), + mFloaterSnapRegion(NULL) {} +LLDebugView::~LLDebugView() +{ + // These have already been deleted. Fix the globals appropriately. + gDebugView = NULL; + gTextureView = NULL; + gSceneView = NULL; + gTextureSizeView = NULL; + gTextureCategoryView = NULL; +} + void LLDebugView::init() { LLRect r; @@ -109,8 +123,6 @@ void LLDebugView::init() addChild(gTextureView); //gTextureView->reshape(r.getWidth(), r.getHeight(), TRUE); - - if(gAuditTexture) { @@ -136,22 +148,15 @@ void LLDebugView::init() } } - -LLDebugView::~LLDebugView() -{ - // These have already been deleted. Fix the globals appropriately. - gDebugView = NULL; - gTextureView = NULL; - gSceneView = NULL; - gTextureSizeView = NULL; - gTextureCategoryView = NULL; -} - void LLDebugView::draw() { - LLView* floater_snap_region = getRootView()->getChildView("floater_snap_region"); + if (mFloaterSnapRegion == NULL) + { + mFloaterSnapRegion = getRootView()->getChildView("floater_snap_region"); + } + LLRect debug_rect; - floater_snap_region->localRectToOtherView(floater_snap_region->getLocalRect(), &debug_rect, getParent()); + mFloaterSnapRegion->localRectToOtherView(mFloaterSnapRegion->getLocalRect(), &debug_rect, getParent()); setShape(debug_rect); LLView::draw(); diff --git a/indra/newview/lldebugview.h b/indra/newview/lldebugview.h index 907a42c981..5aec77ad62 100644 --- a/indra/newview/lldebugview.h +++ b/indra/newview/lldebugview.h @@ -51,17 +51,19 @@ public: changeDefault(mouse_opaque, false); } }; + LLDebugView(const Params&); ~LLDebugView(); void init(); void draw(); - + void setStatsVisible(BOOL visible); LLFastTimerView* mFastTimerView; LLMemoryView* mMemoryView; LLConsole* mDebugConsolep; + LLView* mFloaterSnapRegion; }; extern LLDebugView* gDebugView; diff --git a/indra/newview/lldrawpool.cpp b/indra/newview/lldrawpool.cpp index 286284f828..35f8a85796 100644 --- a/indra/newview/lldrawpool.cpp +++ b/indra/newview/lldrawpool.cpp @@ -384,7 +384,7 @@ BOOL LLFacePool::LLOverrideFaceColor::sOverrideFaceColor = FALSE; void LLFacePool::LLOverrideFaceColor::setColor(const LLColor4& color) { - glColor4fv(color.mV); + gGL.diffuseColor4fv(color.mV); } void LLFacePool::LLOverrideFaceColor::setColor(const LLColor4U& color) @@ -394,7 +394,7 @@ void LLFacePool::LLOverrideFaceColor::setColor(const LLColor4U& color) void LLFacePool::LLOverrideFaceColor::setColor(F32 r, F32 g, F32 b, F32 a) { - glColor4f(r,g,b,a); + gGL.diffuseColor4f(r,g,b,a); } @@ -457,10 +457,10 @@ void LLRenderPass::applyModelMatrix(LLDrawInfo& params) if (params.mModelMatrix != gGLLastMatrix) { gGLLastMatrix = params.mModelMatrix; - glLoadMatrixd(gGLModelView); + gGL.loadMatrix(gGLModelView); if (params.mModelMatrix) { - glMultMatrixf((GLfloat*) params.mModelMatrix->mMatrix); + gGL.multMatrix((GLfloat*) params.mModelMatrix->mMatrix); } gPipeline.mMatrixOpCount++; } @@ -494,8 +494,8 @@ void LLRenderPass::pushBatch(LLDrawInfo& params, U32 mask, BOOL texture, BOOL ba { tex_setup = true; gGL.getTexUnit(0)->activate(); - glMatrixMode(GL_TEXTURE); - glLoadMatrixf((GLfloat*) params.mTextureMatrix->mMatrix); + gGL.matrixMode(LLRender::MM_TEXTURE); + gGL.loadMatrix((GLfloat*) params.mTextureMatrix->mMatrix); gPipeline.mTextureMatrixOps++; } } @@ -519,8 +519,8 @@ void LLRenderPass::pushBatch(LLDrawInfo& params, U32 mask, BOOL texture, BOOL ba if (tex_setup) { - glLoadIdentity(); - glMatrixMode(GL_MODELVIEW); + gGL.loadIdentity(); + gGL.matrixMode(LLRender::MM_MODELVIEW); } } diff --git a/indra/newview/lldrawpool.h b/indra/newview/lldrawpool.h index c7acbb42c6..5a2981e749 100644 --- a/indra/newview/lldrawpool.h +++ b/indra/newview/lldrawpool.h @@ -133,7 +133,6 @@ public: PASS_ALPHA, PASS_ALPHA_MASK, PASS_FULLBRIGHT_ALPHA_MASK, - PASS_ALPHA_SHADOW, NUM_RENDER_TYPES, }; diff --git a/indra/newview/lldrawpoolalpha.cpp b/indra/newview/lldrawpoolalpha.cpp index 9719140a37..ddb7d3ceeb 100644 --- a/indra/newview/lldrawpoolalpha.cpp +++ b/indra/newview/lldrawpoolalpha.cpp @@ -54,7 +54,7 @@ static BOOL deferred_render = FALSE; LLDrawPoolAlpha::LLDrawPoolAlpha(U32 type) : LLRenderPass(type), current_shader(NULL), target_shader(NULL), - simple_shader(NULL), fullbright_shader(NULL), + simple_shader(NULL), fullbright_shader(NULL), emissive_shader(NULL), mColorSFactor(LLRender::BF_UNDEF), mColorDFactor(LLRender::BF_UNDEF), mAlphaSFactor(LLRender::BF_UNDEF), mAlphaDFactor(LLRender::BF_UNDEF) { @@ -90,7 +90,7 @@ void LLDrawPoolAlpha::renderDeferred(S32 pass) { LLFastTimer t(FTM_RENDER_GRASS); gDeferredDiffuseAlphaMaskProgram.bind(); - gDeferredDiffuseAlphaMaskProgram.setAlphaRange(0.33f, 1.f); + gDeferredDiffuseAlphaMaskProgram.setMinimumAlpha(0.33f); //render alpha masked objects LLRenderPass::pushBatches(LLRenderPass::PASS_ALPHA_MASK, getVertexDataMask() | LLVertexBuffer::MAP_TEXTURE_INDEX, TRUE, TRUE); @@ -136,7 +136,7 @@ void LLDrawPoolAlpha::beginPostDeferredPass(S32 pass) simple_shader = NULL; fullbright_shader = NULL; gObjectFullbrightAlphaMaskProgram.bind(); - gObjectFullbrightAlphaMaskProgram.setAlphaRange(0.33f, 1.f); + gObjectFullbrightAlphaMaskProgram.setMinimumAlpha(0.33f); } deferred_render = TRUE; @@ -175,11 +175,13 @@ void LLDrawPoolAlpha::beginRenderPass(S32 pass) { simple_shader = &gObjectSimpleWaterAlphaMaskProgram; fullbright_shader = &gObjectFullbrightWaterAlphaMaskProgram; + emissive_shader = &gObjectEmissiveWaterProgram; } else { simple_shader = &gObjectSimpleAlphaMaskProgram; fullbright_shader = &gObjectFullbrightAlphaMaskProgram; + emissive_shader = &gObjectEmissiveProgram; } if (mVertexShaderLevel > 0) @@ -230,14 +232,14 @@ void LLDrawPoolAlpha::render(S32 pass) if (!LLPipeline::sRenderDeferred || !deferred_render) { simple_shader->bind(); - simple_shader->setAlphaRange(0.33f, 1.f); + simple_shader->setMinimumAlpha(0.33f); pushBatches(LLRenderPass::PASS_ALPHA_MASK, getVertexDataMask() | LLVertexBuffer::MAP_TEXTURE_INDEX, TRUE, TRUE); } if (fullbright_shader) { fullbright_shader->bind(); - fullbright_shader->setAlphaRange(0.33f, 1.f); + fullbright_shader->setMinimumAlpha(0.33f); } pushBatches(LLRenderPass::PASS_FULLBRIGHT_ALPHA_MASK, getVertexDataMask() | LLVertexBuffer::MAP_TEXTURE_INDEX, TRUE, TRUE); //LLGLSLShader::bindNoShader(); @@ -273,16 +275,16 @@ void LLDrawPoolAlpha::render(S32 pass) if (LLPipeline::sImpostorRender) { fullbright_shader->bind(); - fullbright_shader->setAlphaRange(0.5f, 1.f); + fullbright_shader->setMinimumAlpha(0.5f); simple_shader->bind(); - simple_shader->setAlphaRange(0.5f, 1.f); + simple_shader->setMinimumAlpha(0.5f); } else { fullbright_shader->bind(); - fullbright_shader->setAlphaRange(0.f, 1.f); + fullbright_shader->setMinimumAlpha(0.f); simple_shader->bind(); - simple_shader->setAlphaRange(0.f, 1.f); + simple_shader->setMinimumAlpha(0.f); } } else @@ -319,20 +321,26 @@ void LLDrawPoolAlpha::render(S32 pass) BOOL shaders = gPipeline.canUseVertexShaders(); if(shaders) { - gObjectFullbrightNonIndexedProgram.bind(); + gHighlightProgram.bind(); } else { gPipeline.enableLightsFullbright(LLColor4(1,1,1,1)); } - glColor4f(1,0,0,1); + + gGL.diffuseColor4f(1,0,0,1); + LLViewerFetchedTexture::sSmokeImagep->addTextureStats(1024.f*1024.f); gGL.getTexUnit(0)->bind(LLViewerFetchedTexture::sSmokeImagep, TRUE) ; renderAlphaHighlight(LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_TEXCOORD0); + + pushBatches(LLRenderPass::PASS_ALPHA_MASK, LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_TEXCOORD0, FALSE); + pushBatches(LLRenderPass::PASS_FULLBRIGHT_ALPHA_MASK, LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_TEXCOORD0, FALSE); + if(shaders) { - gObjectFullbrightNonIndexedProgram.unbind(); + gHighlightProgram.unbind(); } } } @@ -472,8 +480,8 @@ void LLDrawPoolAlpha::renderAlpha(U32 mask) { tex_setup = true; gGL.getTexUnit(0)->activate(); - glMatrixMode(GL_TEXTURE); - glLoadMatrixf((GLfloat*) params.mTextureMatrix->mMatrix); + gGL.matrixMode(LLRender::MM_TEXTURE); + gGL.loadMatrix((GLfloat*) params.mTextureMatrix->mMatrix); gPipeline.mTextureMatrixOps++; } } @@ -488,30 +496,34 @@ void LLDrawPoolAlpha::renderAlpha(U32 mask) gPipeline.addTrianglesDrawn(params.mCount, params.mDrawMode); // If this alpha mesh has glow, then draw it a second time to add the destination-alpha (=glow). Interleaving these state-changing calls could be expensive, but glow must be drawn Z-sorted with alpha. - if (draw_glow_for_this_partition && - params.mGlowColor.mV[3] > 0) + if (current_shader && + draw_glow_for_this_partition && + params.mVertexBuffer->hasDataType(LLVertexBuffer::TYPE_EMISSIVE)) { // install glow-accumulating blend mode gGL.blendFunc(LLRender::BF_ZERO, LLRender::BF_ONE, // don't touch color LLRender::BF_ONE, LLRender::BF_ONE); // add to alpha (glow) + emissive_shader->bind(); + // glow doesn't use vertex colors from the mesh data - params.mVertexBuffer->setBuffer(mask & ~LLVertexBuffer::MAP_COLOR); - glColor4ubv(params.mGlowColor.mV); - + params.mVertexBuffer->setBuffer((mask & ~LLVertexBuffer::MAP_COLOR) | LLVertexBuffer::MAP_EMISSIVE); + // do the actual drawing, again params.mVertexBuffer->drawRange(params.mDrawMode, params.mStart, params.mEnd, params.mCount, params.mOffset); gPipeline.addTrianglesDrawn(params.mCount, params.mDrawMode); // restore our alpha blend mode gGL.blendFunc(mColorSFactor, mColorDFactor, mAlphaSFactor, mAlphaDFactor); + + current_shader->bind(); } if (tex_setup) { gGL.getTexUnit(0)->activate(); - glLoadIdentity(); - glMatrixMode(GL_MODELVIEW); + gGL.loadIdentity(); + gGL.matrixMode(LLRender::MM_MODELVIEW); } } } diff --git a/indra/newview/lldrawpoolalpha.h b/indra/newview/lldrawpoolalpha.h index 12a7ae92b1..a4245e561d 100644 --- a/indra/newview/lldrawpoolalpha.h +++ b/indra/newview/lldrawpoolalpha.h @@ -78,6 +78,7 @@ private: LLGLSLShader* target_shader; LLGLSLShader* simple_shader; LLGLSLShader* fullbright_shader; + LLGLSLShader* emissive_shader; // our 'normal' alpha blend function for this pass LLRender::eBlendFactor mColorSFactor; diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp index 37ee81aeb5..55b314fbb1 100644 --- a/indra/newview/lldrawpoolavatar.cpp +++ b/indra/newview/lldrawpoolavatar.cpp @@ -263,7 +263,6 @@ void LLDrawPoolAvatar::beginPostDeferredAlpha() gPipeline.bindDeferredShader(*sVertexProgram); sDiffuseChannel = sVertexProgram->enableTexture(LLViewerShaderMgr::DIFFUSE_MAP); - enable_vertex_weighting(sVertexProgram->mAttribute[LLViewerShaderMgr::AVATAR_WEIGHT]); } void LLDrawPoolAvatar::beginDeferredRiggedAlpha() @@ -271,7 +270,6 @@ void LLDrawPoolAvatar::beginDeferredRiggedAlpha() sVertexProgram = &gDeferredSkinnedAlphaProgram; gPipeline.bindDeferredShader(*sVertexProgram); sDiffuseChannel = sVertexProgram->enableTexture(LLViewerShaderMgr::DIFFUSE_MAP); - LLVertexBuffer::sWeight4Loc = sVertexProgram->getAttribLocation(LLViewerShaderMgr::OBJECT_WEIGHT); gPipeline.enableLightsDynamic(); } @@ -280,7 +278,6 @@ void LLDrawPoolAvatar::endDeferredRiggedAlpha() LLVertexBuffer::unbind(); gPipeline.unbindDeferredShader(*sVertexProgram); sDiffuseChannel = 0; - LLVertexBuffer::sWeight4Loc = -1; sVertexProgram = NULL; } @@ -314,8 +311,7 @@ void LLDrawPoolAvatar::endPostDeferredAlpha() // if we're in software-blending, remember to set the fence _after_ we draw so we wait till this rendering is done sRenderingSkinned = FALSE; sSkipOpaque = FALSE; - disable_vertex_weighting(sVertexProgram->mAttribute[LLViewerShaderMgr::AVATAR_WEIGHT]); - + gPipeline.unbindDeferredShader(*sVertexProgram); sDiffuseChannel = 0; sShaderLevel = mVertexShaderLevel; @@ -356,27 +352,22 @@ void LLDrawPoolAvatar::beginShadowPass(S32 pass) if (pass == 0) { sVertexProgram = &gDeferredAvatarShadowProgram; - if (sShaderLevel > 0) - { - gAvatarMatrixParam = sVertexProgram->mUniform[LLViewerShaderMgr::AVATAR_MATRIX]; - } - //gGL.setAlphaRejectSettings(LLRender::CF_GREATER_EQUAL, 0.2f); - glColor4f(1,1,1,1); + //gGL.setAlphaRejectSettings(LLRender::CF_GREATER_EQUAL, 0.2f); if ((sShaderLevel > 0)) // for hardware blending { sRenderingSkinned = TRUE; sVertexProgram->bind(); - enable_vertex_weighting(sVertexProgram->mAttribute[LLViewerShaderMgr::AVATAR_WEIGHT]); } + + gGL.diffuseColor4f(1,1,1,1); } else { sVertexProgram = &gDeferredAttachmentShadowProgram; sDiffuseChannel = sVertexProgram->enableTexture(LLViewerShaderMgr::DIFFUSE_MAP); sVertexProgram->bind(); - LLVertexBuffer::sWeight4Loc = sVertexProgram->getAttribLocation(LLViewerShaderMgr::OBJECT_WEIGHT); } } @@ -389,14 +380,12 @@ void LLDrawPoolAvatar::endShadowPass(S32 pass) { sRenderingSkinned = FALSE; sVertexProgram->unbind(); - disable_vertex_weighting(sVertexProgram->mAttribute[LLViewerShaderMgr::AVATAR_WEIGHT]); } } else { LLVertexBuffer::unbind(); sVertexProgram->unbind(); - LLVertexBuffer::sWeight4Loc = -1; sVertexProgram = NULL; } } @@ -430,11 +419,6 @@ void LLDrawPoolAvatar::renderShadow(S32 pass) if (pass == 0) { - if (sShaderLevel > 0) - { - gAvatarMatrixParam = sVertexProgram->mUniform[LLViewerShaderMgr::AVATAR_MATRIX]; - } - avatarp->renderSkinned(AVATAR_RENDER_PASS_SINGLE); } else @@ -492,11 +476,6 @@ void LLDrawPoolAvatar::beginRenderPass(S32 pass) //reset vertex buffer mappings LLVertexBuffer::unbind(); - if (pass == 0) - { //make sure no stale colors are left over from a previous render - glColor4f(1,1,1,1); - } - if (LLPipeline::sImpostorRender) { //impostor render does not have impostors or rigid rendering pass += 2; @@ -535,6 +514,11 @@ void LLDrawPoolAvatar::beginRenderPass(S32 pass) beginRiggedGlow(); break; } + + if (pass == 0) + { //make sure no stale colors are left over from a previous render + gGL.diffuseColor4f(1,1,1,1); + } } void LLDrawPoolAvatar::endRenderPass(S32 pass) @@ -592,7 +576,7 @@ void LLDrawPoolAvatar::beginImpostor() if (LLGLSLShader::sNoFixedFunction) { gImpostorProgram.bind(); - gImpostorProgram.setAlphaRange(0.01f, 1.f); + gImpostorProgram.setMinimumAlpha(0.01f); } gPipeline.enableLightsFullbright(LLColor4(1,1,1,1)); @@ -614,17 +598,17 @@ void LLDrawPoolAvatar::beginRigid() { if (LLPipeline::sUnderWaterRender) { - sVertexProgram = &gObjectAlphaMaskNonIndexedWaterProgram; + sVertexProgram = &gObjectAlphaMaskNoColorWaterProgram; } else { - sVertexProgram = &gObjectAlphaMaskNonIndexedProgram; + sVertexProgram = &gObjectAlphaMaskNoColorProgram; } if (sVertexProgram != NULL) { //eyeballs render with the specular shader sVertexProgram->bind(); - sVertexProgram->setAlphaRange(0.2f, 1.f); + sVertexProgram->setMinimumAlpha(0.2f); } } else @@ -657,7 +641,7 @@ void LLDrawPoolAvatar::beginDeferredImpostor() sDiffuseChannel = sVertexProgram->enableTexture(LLViewerShaderMgr::DIFFUSE_MAP); sVertexProgram->bind(); - sVertexProgram->setAlphaRange(0.01f, 1.f); + sVertexProgram->setMinimumAlpha(0.01f); } void LLDrawPoolAvatar::endDeferredImpostor() @@ -672,14 +656,16 @@ void LLDrawPoolAvatar::endDeferredImpostor() void LLDrawPoolAvatar::beginDeferredRigid() { - sVertexProgram = &gDeferredNonIndexedDiffuseProgram; - + sVertexProgram = &gDeferredNonIndexedDiffuseAlphaMaskNoColorProgram; + sDiffuseChannel = sVertexProgram->enableTexture(LLViewerShaderMgr::DIFFUSE_MAP); sVertexProgram->bind(); + sVertexProgram->setMinimumAlpha(0.2f); } void LLDrawPoolAvatar::endDeferredRigid() { sShaderLevel = mVertexShaderLevel; + sVertexProgram->disableTexture(LLViewerShaderMgr::DIFFUSE_MAP); sVertexProgram->unbind(); gGL.getTexUnit(0)->activate(); } @@ -703,11 +689,11 @@ void LLDrawPoolAvatar::beginSkinned() { if (LLPipeline::sUnderWaterRender) { - sVertexProgram = &gObjectAlphaMaskNonIndexedWaterProgram; + sVertexProgram = &gObjectAlphaMaskNoColorWaterProgram; } else { - sVertexProgram = &gObjectAlphaMaskNonIndexedProgram; + sVertexProgram = &gObjectAlphaMaskNoColorProgram; } } @@ -716,17 +702,6 @@ void LLDrawPoolAvatar::beginSkinned() sRenderingSkinned = TRUE; sVertexProgram->bind(); - if (sShaderLevel >= SHADER_LEVEL_CLOTH) - { - enable_cloth_weights(sVertexProgram->mAttribute[LLViewerShaderMgr::AVATAR_CLOTHING]); - } - enable_vertex_weighting(sVertexProgram->mAttribute[LLViewerShaderMgr::AVATAR_WEIGHT]); - - if (sShaderLevel >= SHADER_LEVEL_BUMP) - { - enable_binormals(sVertexProgram->mAttribute[LLViewerShaderMgr::BINORMAL]); - } - sVertexProgram->enableTexture(LLViewerShaderMgr::BUMP_MAP); gGL.getTexUnit(0)->activate(); } @@ -742,7 +717,7 @@ void LLDrawPoolAvatar::beginSkinned() if (LLGLSLShader::sNoFixedFunction) { - sVertexProgram->setAlphaRange(0.2f, 1.f); + sVertexProgram->setMinimumAlpha(0.2f); } } @@ -754,16 +729,6 @@ void LLDrawPoolAvatar::endSkinned() sRenderingSkinned = FALSE; sVertexProgram->disableTexture(LLViewerShaderMgr::BUMP_MAP); gGL.getTexUnit(0)->activate(); - disable_vertex_weighting(sVertexProgram->mAttribute[LLViewerShaderMgr::AVATAR_WEIGHT]); - if (sShaderLevel >= SHADER_LEVEL_BUMP) - { - disable_binormals(sVertexProgram->mAttribute[LLViewerShaderMgr::BINORMAL]); - } - if ((sShaderLevel >= SHADER_LEVEL_CLOTH)) - { - disable_cloth_weights(sVertexProgram->mAttribute[LLViewerShaderMgr::AVATAR_CLOTHING]); - } - sVertexProgram->unbind(); sShaderLevel = mVertexShaderLevel; } @@ -809,7 +774,6 @@ void LLDrawPoolAvatar::beginRiggedSimple() { sDiffuseChannel = 0; sVertexProgram->bind(); - LLVertexBuffer::sWeight4Loc = sVertexProgram->getAttribLocation(LLViewerShaderMgr::OBJECT_WEIGHT); } } @@ -820,7 +784,6 @@ void LLDrawPoolAvatar::endRiggedSimple() { sVertexProgram->unbind(); sVertexProgram = NULL; - LLVertexBuffer::sWeight4Loc = -1; } } @@ -847,7 +810,34 @@ void LLDrawPoolAvatar::endRiggedFullbrightAlpha() void LLDrawPoolAvatar::beginRiggedGlow() { - beginRiggedFullbright(); + if (sShaderLevel > 0) + { + if (LLPipeline::sUnderWaterRender) + { + sVertexProgram = &gSkinnedObjectEmissiveWaterProgram; + } + else + { + sVertexProgram = &gSkinnedObjectEmissiveProgram; + } + } + else + { + if (LLPipeline::sUnderWaterRender) + { + sVertexProgram = &gObjectEmissiveNonIndexedWaterProgram; + } + else + { + sVertexProgram = &gObjectEmissiveNonIndexedProgram; + } + } + + if (sShaderLevel > 0 || gPipeline.canUseVertexShaders()) + { + sDiffuseChannel = 0; + sVertexProgram->bind(); + } } void LLDrawPoolAvatar::endRiggedGlow() @@ -884,7 +874,6 @@ void LLDrawPoolAvatar::beginRiggedFullbright() { sDiffuseChannel = 0; sVertexProgram->bind(); - LLVertexBuffer::sWeight4Loc = sVertexProgram->getAttribLocation(LLViewerShaderMgr::OBJECT_WEIGHT); } } @@ -895,7 +884,6 @@ void LLDrawPoolAvatar::endRiggedFullbright() { sVertexProgram->unbind(); sVertexProgram = NULL; - LLVertexBuffer::sWeight4Loc = -1; } } @@ -928,7 +916,6 @@ void LLDrawPoolAvatar::beginRiggedShinySimple() { sVertexProgram->bind(); LLDrawPoolBump::bindCubeMap(sVertexProgram, 2, sDiffuseChannel, cube_channel, false); - LLVertexBuffer::sWeight4Loc = sVertexProgram->getAttribLocation(LLViewerShaderMgr::OBJECT_WEIGHT); } } @@ -940,7 +927,6 @@ void LLDrawPoolAvatar::endRiggedShinySimple() LLDrawPoolBump::unbindCubeMap(sVertexProgram, 2, sDiffuseChannel, cube_channel, false); sVertexProgram->unbind(); sVertexProgram = NULL; - LLVertexBuffer::sWeight4Loc = -1; } } @@ -974,7 +960,6 @@ void LLDrawPoolAvatar::beginRiggedFullbrightShiny() { sVertexProgram->bind(); LLDrawPoolBump::bindCubeMap(sVertexProgram, 2, sDiffuseChannel, cube_channel, false); - LLVertexBuffer::sWeight4Loc = sVertexProgram->getAttribLocation(LLViewerShaderMgr::OBJECT_WEIGHT); } } @@ -986,7 +971,6 @@ void LLDrawPoolAvatar::endRiggedFullbrightShiny() LLDrawPoolBump::unbindCubeMap(sVertexProgram, 2, sDiffuseChannel, cube_channel, false); sVertexProgram->unbind(); sVertexProgram = NULL; - LLVertexBuffer::sWeight4Loc = -1; } } @@ -996,14 +980,12 @@ void LLDrawPoolAvatar::beginDeferredRiggedSimple() sVertexProgram = &gDeferredSkinnedDiffuseProgram; sDiffuseChannel = 0; sVertexProgram->bind(); - LLVertexBuffer::sWeight4Loc = sVertexProgram->getAttribLocation(LLViewerShaderMgr::OBJECT_WEIGHT); } void LLDrawPoolAvatar::endDeferredRiggedSimple() { LLVertexBuffer::unbind(); sVertexProgram->unbind(); - LLVertexBuffer::sWeight4Loc = -1; sVertexProgram = NULL; } @@ -1013,7 +995,6 @@ void LLDrawPoolAvatar::beginDeferredRiggedBump() sVertexProgram->bind(); normal_channel = sVertexProgram->enableTexture(LLViewerShaderMgr::BUMP_MAP); sDiffuseChannel = sVertexProgram->enableTexture(LLViewerShaderMgr::DIFFUSE_MAP); - LLVertexBuffer::sWeight4Loc = sVertexProgram->getAttribLocation(LLViewerShaderMgr::OBJECT_WEIGHT); } void LLDrawPoolAvatar::endDeferredRiggedBump() @@ -1022,7 +1003,6 @@ void LLDrawPoolAvatar::endDeferredRiggedBump() sVertexProgram->disableTexture(LLViewerShaderMgr::BUMP_MAP); sVertexProgram->disableTexture(LLViewerShaderMgr::DIFFUSE_MAP); sVertexProgram->unbind(); - LLVertexBuffer::sWeight4Loc = -1; normal_channel = -1; sDiffuseChannel = 0; sVertexProgram = NULL; @@ -1032,14 +1012,12 @@ void LLDrawPoolAvatar::beginDeferredSkinned() { sShaderLevel = mVertexShaderLevel; sVertexProgram = &gDeferredAvatarProgram; - sRenderingSkinned = TRUE; sVertexProgram->bind(); + sVertexProgram->setMinimumAlpha(0.2f); sDiffuseChannel = sVertexProgram->enableTexture(LLViewerShaderMgr::DIFFUSE_MAP); - enable_vertex_weighting(sVertexProgram->mAttribute[LLViewerShaderMgr::AVATAR_WEIGHT]); - gGL.getTexUnit(0)->activate(); } @@ -1047,7 +1025,6 @@ void LLDrawPoolAvatar::endDeferredSkinned() { // if we're in software-blending, remember to set the fence _after_ we draw so we wait till this rendering is done sRenderingSkinned = FALSE; - disable_vertex_weighting(sVertexProgram->mAttribute[LLViewerShaderMgr::AVATAR_WEIGHT]); sVertexProgram->unbind(); sVertexProgram->disableTexture(LLViewerShaderMgr::DIFFUSE_MAP); @@ -1161,10 +1138,10 @@ void LLDrawPoolAvatar::renderAvatars(LLVOAvatar* single_avatar, S32 pass) return; } - if (single_avatar && avatarp->mSpecialRenderMode >= 1) // 1=anim preview, 2=image preview, 3=morph view + /*if (single_avatar && avatarp->mSpecialRenderMode >= 1) // 1=anim preview, 2=image preview, 3=morph view { gPipeline.enableLightsAvatarEdit(LLColor4(.5f, .5f, .5f, 1.f)); - } + }*/ if (pass == 1) { @@ -1255,11 +1232,6 @@ void LLDrawPoolAvatar::renderAvatars(LLVOAvatar* single_avatar, S32 pass) return; } - if (sShaderLevel > 0) - { - gAvatarMatrixParam = sVertexProgram->mUniform[LLViewerShaderMgr::AVATAR_MATRIX]; - } - if ((sShaderLevel >= SHADER_LEVEL_CLOTH)) { LLMatrix4 rot_mat; @@ -1273,16 +1245,16 @@ void LLDrawPoolAvatar::renderAvatars(LLVOAvatar* single_avatar, S32 pass) wind = wind * rot_mat; wind.mV[VW] = avatarp->mWindVec.mV[VW]; - sVertexProgram->vertexAttrib4fv(LLViewerShaderMgr::AVATAR_WIND, wind.mV); + sVertexProgram->uniform4fv(LLViewerShaderMgr::AVATAR_WIND, 1, wind.mV); F32 phase = -1.f * (avatarp->mRipplePhase); F32 freq = 7.f + (noise1(avatarp->mRipplePhase) * 2.f); LLVector4 sin_params(freq, freq, freq, phase); - sVertexProgram->vertexAttrib4fv(LLViewerShaderMgr::AVATAR_SINWAVE, sin_params.mV); + sVertexProgram->uniform4fv(LLViewerShaderMgr::AVATAR_SINWAVE, 1, sin_params.mV); LLVector4 gravity(0.f, 0.f, -CLOTHING_GRAVITY_EFFECT, 0.f); gravity = gravity * rot_mat; - sVertexProgram->vertexAttrib4fv(LLViewerShaderMgr::AVATAR_GRAVITY, gravity.mV); + sVertexProgram->uniform4fv(LLViewerShaderMgr::AVATAR_GRAVITY, 1, gravity.mV); } if( !single_avatar || (avatarp == single_avatar) ) @@ -1306,8 +1278,8 @@ void LLDrawPoolAvatar::updateRiggedFaceVertexBuffer(LLVOAvatar* avatar, LLFace* if (buffer.isNull() || buffer->getTypeMask() != data_mask || - buffer->getRequestedVerts() != vol_face.mNumVertices || - buffer->getRequestedIndices() != vol_face.mNumIndices || + buffer->getNumVerts() != vol_face.mNumVertices || + buffer->getNumIndices() != vol_face.mNumIndices || (drawable && drawable->isState(LLDrawable::REBUILD_ALL))) { face->setGeomIndex(0); @@ -1346,7 +1318,19 @@ void LLDrawPoolAvatar::updateRiggedFaceVertexBuffer(LLVOAvatar* avatar, LLFace* LLMatrix3 mat_normal(mat3); + //let getGeometryVolume know if alpha should override shiny + if (face->getFaceColor().mV[3] < 1.f) + { + face->setPoolType(LLDrawPool::POOL_ALPHA); + } + else + { + face->setPoolType(LLDrawPool::POOL_AVATAR); + } + face->getGeometryVolume(*volume, face->getTEOffset(), mat_vert, mat_normal, offset, true); + + buffer->flush(); } if (sShaderLevel <= 0 && face->mLastSkinTime < avatar->getLastSkinTime()) @@ -1383,7 +1367,7 @@ void LLDrawPoolAvatar::updateRiggedFaceVertexBuffer(LLVOAvatar* avatar, LLFace* LLMatrix4a bind_shape_matrix; bind_shape_matrix.loadu(skin->mBindShapeMatrix); - for (U32 j = 0; j < buffer->getRequestedVerts(); ++j) + for (U32 j = 0; j < buffer->getNumVerts(); ++j) { LLMatrix4a final_mat; final_mat.clear(); @@ -1483,12 +1467,12 @@ void LLDrawPoolAvatar::renderRigged(LLVOAvatar* avatar, U32 type, bool glow) continue; } - stop_glerror(); + //stop_glerror(); - const LLVolumeFace& vol_face = volume->getVolumeFace(te); - updateRiggedFaceVertexBuffer(avatar, face, skin, volume, vol_face); + //const LLVolumeFace& vol_face = volume->getVolumeFace(te); + //updateRiggedFaceVertexBuffer(avatar, face, skin, volume, vol_face); - stop_glerror(); + //stop_glerror(); U32 data_mask = LLFace::getRiggedDataMask(type); @@ -1524,17 +1508,15 @@ void LLDrawPoolAvatar::renderRigged(LLVOAvatar* avatar, U32 type, bool glow) data_mask &= ~LLVertexBuffer::MAP_WEIGHT4; } - buff->setBuffer(data_mask); - U16 start = face->getGeomStart(); U16 end = start + face->getGeomCount()-1; S32 offset = face->getIndicesStart(); U32 count = face->getIndicesCount(); - if (glow) + /*if (glow) { - glColor4f(0,0,0,face->getTextureEntry()->getGlow()); - } + gGL.diffuseColor4f(0,0,0,face->getTextureEntry()->getGlow()); + }*/ gGL.getTexUnit(sDiffuseChannel)->bind(face->getTexture()); if (normal_channel > -1) @@ -1544,14 +1526,16 @@ void LLDrawPoolAvatar::renderRigged(LLVOAvatar* avatar, U32 type, bool glow) if (face->mTextureMatrix) { - glMatrixMode(GL_TEXTURE); - glLoadMatrixf((F32*) face->mTextureMatrix->mMatrix); + gGL.matrixMode(LLRender::MM_TEXTURE); + gGL.loadMatrix((F32*) face->mTextureMatrix->mMatrix); + buff->setBuffer(data_mask); buff->drawRange(LLRender::TRIANGLES, start, end, count, offset); - glLoadIdentity(); - glMatrixMode(GL_MODELVIEW); + gGL.loadIdentity(); + gGL.matrixMode(LLRender::MM_MODELVIEW); } else { + buff->setBuffer(data_mask); buff->drawRange(LLRender::TRIANGLES, start, end, count, offset); } } @@ -1560,6 +1544,7 @@ void LLDrawPoolAvatar::renderRigged(LLVOAvatar* avatar, U32 type, bool glow) void LLDrawPoolAvatar::renderDeferredRiggedSimple(LLVOAvatar* avatar) { + updateRiggedVertexBuffers(avatar); renderRigged(avatar, RIGGED_DEFERRED_SIMPLE); } @@ -1568,8 +1553,58 @@ void LLDrawPoolAvatar::renderDeferredRiggedBump(LLVOAvatar* avatar) renderRigged(avatar, RIGGED_DEFERRED_BUMP); } +void LLDrawPoolAvatar::updateRiggedVertexBuffers(LLVOAvatar* avatar) +{ + //update rigged vertex buffers + for (U32 type = 0; type < NUM_RIGGED_PASSES; ++type) + { + for (U32 i = 0; i < mRiggedFace[type].size(); ++i) + { + LLFace* face = mRiggedFace[type][i]; + LLDrawable* drawable = face->getDrawable(); + if (!drawable) + { + continue; + } + + LLVOVolume* vobj = drawable->getVOVolume(); + + if (!vobj) + { + continue; + } + + LLVolume* volume = vobj->getVolume(); + S32 te = face->getTEOffset(); + + if (!volume || volume->getNumVolumeFaces() <= te) + { + continue; + } + + LLUUID mesh_id = volume->getParams().getSculptID(); + if (mesh_id.isNull()) + { + continue; + } + + const LLMeshSkinInfo* skin = gMeshRepo.getSkinInfo(mesh_id, vobj); + if (!skin) + { + continue; + } + + stop_glerror(); + + const LLVolumeFace& vol_face = volume->getVolumeFace(te); + updateRiggedFaceVertexBuffer(avatar, face, skin, volume, vol_face); + } + } +} + void LLDrawPoolAvatar::renderRiggedSimple(LLVOAvatar* avatar) { + updateRiggedVertexBuffers(avatar); renderRigged(avatar, RIGGED_SIMPLE); } @@ -1684,34 +1719,3 @@ LLVertexBufferAvatar::LLVertexBufferAvatar() } -void LLVertexBufferAvatar::setupVertexBuffer(U32 data_mask) const -{ - if (sRenderingSkinned) - { - U8* base = useVBOs() ? (U8*) mAlignedOffset : mMappedData; - - glVertexPointer(3,GL_FLOAT, LLVertexBuffer::sTypeSize[LLVertexBuffer::TYPE_VERTEX], (void*)(base + 0)); - glNormalPointer(GL_FLOAT, LLVertexBuffer::sTypeSize[LLVertexBuffer::TYPE_NORMAL], (void*)(base + mOffsets[TYPE_NORMAL])); - glTexCoordPointer(2,GL_FLOAT, LLVertexBuffer::sTypeSize[LLVertexBuffer::TYPE_TEXCOORD0], (void*)(base + mOffsets[TYPE_TEXCOORD0])); - - set_vertex_weights(LLDrawPoolAvatar::sVertexProgram->mAttribute[LLViewerShaderMgr::AVATAR_WEIGHT], - LLVertexBuffer::sTypeSize[LLVertexBuffer::TYPE_WEIGHT], (F32*)(base + mOffsets[TYPE_WEIGHT])); - - if (sShaderLevel >= LLDrawPoolAvatar::SHADER_LEVEL_BUMP) - { - set_binormals(LLDrawPoolAvatar::sVertexProgram->mAttribute[LLViewerShaderMgr::BINORMAL], - LLVertexBuffer::sTypeSize[LLVertexBuffer::TYPE_BINORMAL], (LLVector3*)(base + mOffsets[TYPE_BINORMAL])); - } - - if (sShaderLevel >= LLDrawPoolAvatar::SHADER_LEVEL_CLOTH) - { - set_vertex_clothing_weights(LLDrawPoolAvatar::sVertexProgram->mAttribute[LLViewerShaderMgr::AVATAR_CLOTHING], - LLVertexBuffer::sTypeSize[LLVertexBuffer::TYPE_CLOTHWEIGHT], (LLVector4*)(base + mOffsets[TYPE_CLOTHWEIGHT])); - } - } - else - { - LLVertexBuffer::setupVertexBuffer(data_mask); - } -} - diff --git a/indra/newview/lldrawpoolavatar.h b/indra/newview/lldrawpoolavatar.h index fcd8294af5..69e3068858 100644 --- a/indra/newview/lldrawpoolavatar.h +++ b/indra/newview/lldrawpoolavatar.h @@ -134,6 +134,7 @@ public: const LLMeshSkinInfo* skin, LLVolume* volume, const LLVolumeFace& vol_face); + void updateRiggedVertexBuffers(LLVOAvatar* avatar); void renderRigged(LLVOAvatar* avatar, U32 type, bool glow = false); void renderRiggedSimple(LLVOAvatar* avatar); @@ -176,6 +177,7 @@ public: RIGGED_FULLBRIGHT_SHINY_MASK = RIGGED_SIMPLE_MASK, RIGGED_GLOW_MASK = LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_TEXCOORD0 | + LLVertexBuffer::MAP_EMISSIVE | LLVertexBuffer::MAP_WEIGHT4, RIGGED_ALPHA_MASK = RIGGED_SIMPLE_MASK, RIGGED_FULLBRIGHT_ALPHA_MASK = RIGGED_FULLBRIGHT_MASK, @@ -214,7 +216,6 @@ class LLVertexBufferAvatar : public LLVertexBuffer { public: LLVertexBufferAvatar(); - virtual void setupVertexBuffer(U32 data_mask) const; }; extern S32 AVATAR_OFFSET_POS; diff --git a/indra/newview/lldrawpoolbump.cpp b/indra/newview/lldrawpoolbump.cpp index 0742250b0b..b696b90d84 100644 --- a/indra/newview/lldrawpoolbump.cpp +++ b/indra/newview/lldrawpoolbump.cpp @@ -763,7 +763,7 @@ void LLDrawPoolBump::renderBump(U32 pass) LLGLDisable fog(GL_FOG); LLGLDepthTest gls_depth(GL_TRUE, GL_FALSE, GL_LEQUAL); LLGLEnable blend(GL_BLEND); - glColor4f(1,1,1,1); + gGL.diffuseColor4f(1,1,1,1); /// Get rid of z-fighting with non-bump pass. LLGLEnable polyOffset(GL_POLYGON_OFFSET_FILL); glPolygonOffset(-1.0f, -1.0f); @@ -786,7 +786,7 @@ void LLDrawPoolBump::endBump(U32 pass) { // Disable texture blending on unit 1 gGL.getTexUnit(1)->activate(); - //gGL.getTexUnit(1)->disable(); + gGL.getTexUnit(1)->disable(); gGL.getTexUnit(1)->setTextureBlendType(LLTexUnit::TB_MULT); // Disable texture blending on unit 0 @@ -1088,6 +1088,8 @@ LLViewerTexture* LLBumpImageList::getBrightnessDarknessImage(LLViewerFetchedText } +static LLFastTimer::DeclareTimer FTM_BUMP_SOURCE_STANDARD_LOADED("Bump Standard Callback"); + // static void LLBumpImageList::onSourceBrightnessLoaded( BOOL success, LLViewerFetchedTexture *src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, BOOL final, void* userdata ) { @@ -1110,14 +1112,24 @@ void LLBumpImageList::onSourceDarknessLoaded( BOOL success, LLViewerFetchedTextu } } +static LLFastTimer::DeclareTimer FTM_BUMP_GEN_NORMAL("Generate Normal Map"); +static LLFastTimer::DeclareTimer FTM_BUMP_CREATE_TEXTURE("Create GL Normal Map"); + void LLBumpImageList::onSourceStandardLoaded( BOOL success, LLViewerFetchedTexture* src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, BOOL final, void* userdata) { if (success && LLPipeline::sRenderDeferred) { + LLFastTimer t(FTM_BUMP_SOURCE_STANDARD_LOADED); LLPointer<LLImageRaw> nrm_image = new LLImageRaw(src->getWidth(), src->getHeight(), 4); - generateNormalMapFromAlpha(src, nrm_image); + { + LLFastTimer t(FTM_BUMP_GEN_NORMAL); + generateNormalMapFromAlpha(src, nrm_image); + } src_vi->setExplicitFormat(GL_RGBA, GL_RGBA); - src_vi->createGLTexture(src_vi->getDiscardLevel(), nrm_image); + { + LLFastTimer t(FTM_BUMP_CREATE_TEXTURE); + src_vi->createGLTexture(src_vi->getDiscardLevel(), nrm_image); + } } } @@ -1176,24 +1188,39 @@ void LLBumpImageList::generateNormalMapFromAlpha(LLImageRaw* src, LLImageRaw* nr } } + +static LLFastTimer::DeclareTimer FTM_BUMP_SOURCE_LOADED("Bump Source Loaded"); +static LLFastTimer::DeclareTimer FTM_BUMP_SOURCE_ENTRIES_UPDATE("Entries Update"); +static LLFastTimer::DeclareTimer FTM_BUMP_SOURCE_MIN_MAX("Min/Max"); +static LLFastTimer::DeclareTimer FTM_BUMP_SOURCE_RGB2LUM("RGB to Luminance"); +static LLFastTimer::DeclareTimer FTM_BUMP_SOURCE_RESCALE("Rescale"); +static LLFastTimer::DeclareTimer FTM_BUMP_SOURCE_GEN_NORMAL("Generate Normal"); +static LLFastTimer::DeclareTimer FTM_BUMP_SOURCE_CREATE("Create"); + // static void LLBumpImageList::onSourceLoaded( BOOL success, LLViewerTexture *src_vi, LLImageRaw* src, LLUUID& source_asset_id, EBumpEffect bump_code ) { if( success ) { + LLFastTimer t(FTM_BUMP_SOURCE_LOADED); + + bump_image_map_t& entries_list(bump_code == BE_BRIGHTNESS ? gBumpImageList.mBrightnessEntries : gBumpImageList.mDarknessEntries ); bump_image_map_t::iterator iter = entries_list.find(source_asset_id); - if (iter == entries_list.end() || - iter->second.isNull() || - iter->second->getWidth() != src->getWidth() || - iter->second->getHeight() != src->getHeight()) // bump not cached yet or has changed resolution - { //make sure an entry exists for this image - LLPointer<LLImageRaw> raw = new LLImageRaw(1,1,1); - raw->clear(0x77, 0x77, 0xFF, 0xFF); - - entries_list[src_vi->getID()] = LLViewerTextureManager::getLocalTexture( raw.get(), TRUE); - iter = entries_list.find(src_vi->getID()); + { + LLFastTimer t(FTM_BUMP_SOURCE_ENTRIES_UPDATE); + if (iter == entries_list.end() || + iter->second.isNull() || + iter->second->getWidth() != src->getWidth() || + iter->second->getHeight() != src->getHeight()) // bump not cached yet or has changed resolution + { //make sure an entry exists for this image + LLPointer<LLImageRaw> raw = new LLImageRaw(1,1,1); + raw->clear(0x77, 0x77, 0xFF, 0xFF); + + entries_list[src_vi->getID()] = LLViewerTextureManager::getLocalTexture( raw.get(), TRUE); + iter = entries_list.find(src_vi->getID()); + } } //if (iter->second->getWidth() != src->getWidth() || @@ -1224,50 +1251,56 @@ void LLBumpImageList::onSourceLoaded( BOOL success, LLViewerTexture *src_vi, LLI { case 1: case 2: - if( src_data_size == dst_data_size * src_components ) { - for( S32 i = 0, j=0; i < dst_data_size; i++, j+= src_components ) + LLFastTimer t(FTM_BUMP_SOURCE_MIN_MAX); + if( src_data_size == dst_data_size * src_components ) { - dst_data[i] = src_data[j]; - if( dst_data[i] < minimum ) - { - minimum = dst_data[i]; - } - if( dst_data[i] > maximum ) + for( S32 i = 0, j=0; i < dst_data_size; i++, j+= src_components ) { - maximum = dst_data[i]; + dst_data[i] = src_data[j]; + if( dst_data[i] < minimum ) + { + minimum = dst_data[i]; + } + if( dst_data[i] > maximum ) + { + maximum = dst_data[i]; + } } } - } - else - { - llassert(0); - dst_image->clear(); + else + { + llassert(0); + dst_image->clear(); + } } break; case 3: case 4: - if( src_data_size == dst_data_size * src_components ) { - for( S32 i = 0, j=0; i < dst_data_size; i++, j+= src_components ) + LLFastTimer t(FTM_BUMP_SOURCE_RGB2LUM); + if( src_data_size == dst_data_size * src_components ) { - // RGB to luminance - dst_data[i] = (R_WEIGHT * src_data[j] + G_WEIGHT * src_data[j+1] + B_WEIGHT * src_data[j+2]) >> FIXED_PT; - //llassert( dst_data[i] <= 255 );true because it's 8bit - if( dst_data[i] < minimum ) + for( S32 i = 0, j=0; i < dst_data_size; i++, j+= src_components ) { - minimum = dst_data[i]; - } - if( dst_data[i] > maximum ) - { - maximum = dst_data[i]; + // RGB to luminance + dst_data[i] = (R_WEIGHT * src_data[j] + G_WEIGHT * src_data[j+1] + B_WEIGHT * src_data[j+2]) >> FIXED_PT; + //llassert( dst_data[i] <= 255 );true because it's 8bit + if( dst_data[i] < minimum ) + { + minimum = dst_data[i]; + } + if( dst_data[i] > maximum ) + { + maximum = dst_data[i]; + } } } - } - else - { - llassert(0); - dst_image->clear(); + else + { + llassert(0); + dst_image->clear(); + } } break; default: @@ -1278,6 +1311,7 @@ void LLBumpImageList::onSourceLoaded( BOOL success, LLViewerTexture *src_vi, LLI if( maximum > minimum ) { + LLFastTimer t(FTM_BUMP_SOURCE_RESCALE); U8 bias_and_scale_lut[256]; F32 twice_one_over_range = 2.f / (maximum - minimum); S32 i; @@ -1311,17 +1345,99 @@ void LLBumpImageList::onSourceLoaded( BOOL success, LLViewerTexture *src_vi, LLI // accidentally releases it. LLPointer<LLViewerTexture> bump = LLViewerTextureManager::getLocalTexture( TRUE ); + if (!LLPipeline::sRenderDeferred) { + LLFastTimer t(FTM_BUMP_SOURCE_CREATE); bump->setExplicitFormat(GL_ALPHA8, GL_ALPHA); bump->createGLTexture(0, dst_image); } - else - { - LLPointer<LLImageRaw> nrm_image = new LLImageRaw(dst_image->getWidth(), dst_image->getHeight(), 4); - generateNormalMapFromAlpha(dst_image, nrm_image); - bump->setExplicitFormat(GL_RGBA, GL_RGBA); - bump->createGLTexture(0, nrm_image); + else + { //convert to normal map + { + LLFastTimer t(FTM_BUMP_SOURCE_CREATE); + bump->setExplicitFormat(GL_RGBA8, GL_ALPHA); + bump->createGLTexture(0, dst_image); + } + + { + LLFastTimer t(FTM_BUMP_SOURCE_GEN_NORMAL); + gPipeline.mScreen.bindTarget(); + + LLGLDepthTest depth(GL_FALSE); + LLGLDisable cull(GL_CULL_FACE); + LLGLDisable blend(GL_BLEND); + gGL.setColorMask(TRUE, TRUE); + gNormalMapGenProgram.bind(); + gNormalMapGenProgram.uniform1f("norm_scale", gSavedSettings.getF32("RenderNormalMapScale")); + gNormalMapGenProgram.uniform1f("stepX", 1.f/bump->getWidth()); + gNormalMapGenProgram.uniform1f("stepY", 1.f/bump->getHeight()); + + LLVector2 v((F32) bump->getWidth()/gPipeline.mScreen.getWidth(), + (F32) bump->getHeight()/gPipeline.mScreen.getHeight()); + + gGL.getTexUnit(0)->bind(bump); + + S32 width = bump->getWidth(); + S32 height = bump->getHeight(); + + S32 screen_width = gPipeline.mScreen.getWidth(); + S32 screen_height = gPipeline.mScreen.getHeight(); + + glViewport(0, 0, screen_width, screen_height); + + for (S32 left = 0; left < width; left += screen_width) + { + S32 right = left + screen_width; + right = llmin(right, width); + + F32 left_tc = (F32) left/ width; + F32 right_tc = (F32) right/width; + + for (S32 bottom = 0; bottom < height; bottom += screen_height) + { + S32 top = bottom+screen_height; + top = llmin(top, height); + + F32 bottom_tc = (F32) bottom/height; + F32 top_tc = (F32)(bottom+screen_height)/height; + top_tc = llmin(top_tc, 1.f); + + F32 screen_right = (F32) (right-left)/screen_width; + F32 screen_top = (F32) (top-bottom)/screen_height; + + gGL.begin(LLRender::TRIANGLE_STRIP); + gGL.texCoord2f(left_tc, bottom_tc); + gGL.vertex2f(0, 0); + + gGL.texCoord2f(left_tc, top_tc); + gGL.vertex2f(0, screen_top); + + gGL.texCoord2f(right_tc, bottom_tc); + gGL.vertex2f(screen_right, 0); + + gGL.texCoord2f(right_tc, top_tc); + gGL.vertex2f(screen_right, screen_top); + + gGL.end(); + + gGL.flush(); + + S32 w = right-left; + S32 h = top-bottom; + + glCopyTexSubImage2D(GL_TEXTURE_2D, 0, left, bottom, 0, 0, w, h); + } + } + + glGenerateMipmap(GL_TEXTURE_2D); + + gPipeline.mScreen.flush(); + + gNormalMapGenProgram.unbind(); + + //generateNormalMapFromAlpha(dst_image, nrm_image); + } } iter->second = bump; // derefs (and deletes) old image @@ -1369,18 +1485,24 @@ void LLDrawPoolBump::pushBatch(LLDrawInfo& params, U32 mask, BOOL texture, BOOL if (mShiny) { gGL.getTexUnit(0)->activate(); - glMatrixMode(GL_TEXTURE); + gGL.matrixMode(LLRender::MM_TEXTURE); } else { - gGL.getTexUnit(1)->activate(); - glMatrixMode(GL_TEXTURE); - glLoadMatrixf((GLfloat*) params.mTextureMatrix->mMatrix); - gPipeline.mTextureMatrixOps++; + if (!LLGLSLShader::sNoFixedFunction) + { + gGL.getTexUnit(1)->activate(); + gGL.matrixMode(LLRender::MM_TEXTURE); + gGL.loadMatrix((GLfloat*) params.mTextureMatrix->mMatrix); + } + gGL.getTexUnit(0)->activate(); + gGL.matrixMode(LLRender::MM_TEXTURE); + gGL.loadMatrix((GLfloat*) params.mTextureMatrix->mMatrix); + gPipeline.mTextureMatrixOps++; } - glLoadMatrixf((GLfloat*) params.mTextureMatrix->mMatrix); + gGL.loadMatrix((GLfloat*) params.mTextureMatrix->mMatrix); gPipeline.mTextureMatrixOps++; tex_setup = true; @@ -1390,7 +1512,7 @@ void LLDrawPoolBump::pushBatch(LLDrawInfo& params, U32 mask, BOOL texture, BOOL { if (params.mTexture.notNull()) { - gGL.getTexUnit(diffuse_channel)->bind(params.mTexture) ; + gGL.getTexUnit(diffuse_channel)->bind(params.mTexture); params.mTexture->addTextureStats(params.mVSize); } else @@ -1415,12 +1537,17 @@ void LLDrawPoolBump::pushBatch(LLDrawInfo& params, U32 mask, BOOL texture, BOOL } else { - gGL.getTexUnit(1)->activate(); - glLoadIdentity(); + if (!LLGLSLShader::sNoFixedFunction) + { + gGL.getTexUnit(1)->activate(); + gGL.matrixMode(LLRender::MM_TEXTURE); + gGL.loadIdentity(); + } gGL.getTexUnit(0)->activate(); + gGL.matrixMode(LLRender::MM_TEXTURE); } - glLoadIdentity(); - glMatrixMode(GL_MODELVIEW); + gGL.loadIdentity(); + gGL.matrixMode(LLRender::MM_MODELVIEW); } } @@ -1465,6 +1592,7 @@ void LLDrawPoolInvisible::endDeferredPass( S32 pass ) void LLDrawPoolInvisible::renderDeferred( S32 pass ) { //render invisiprims; this doesn't work becaue it also blocks all the post-deferred stuff +#if 0 LLFastTimer t(FTM_RENDER_INVISIBLE); U32 invisi_mask = LLVertexBuffer::MAP_VERTEX; @@ -1482,4 +1610,5 @@ void LLDrawPoolInvisible::renderDeferred( S32 pass ) renderShiny(true); endShiny(true); } +#endif } diff --git a/indra/newview/lldrawpoolground.cpp b/indra/newview/lldrawpoolground.cpp index ce07e62122..59c3fbf7a1 100644 --- a/indra/newview/lldrawpoolground.cpp +++ b/indra/newview/lldrawpoolground.cpp @@ -71,9 +71,9 @@ void LLDrawPoolGround::render(S32 pass) LLGLSquashToFarClip far_clip(glh_get_current_projection()); F32 water_height = gAgent.getRegion()->getWaterHeight(); - glPushMatrix(); + gGL.pushMatrix(); LLVector3 origin = LLViewerCamera::getInstance()->getOrigin(); - glTranslatef(origin.mV[0], origin.mV[1], llmax(origin.mV[2], water_height)); + gGL.translatef(origin.mV[0], origin.mV[1], llmax(origin.mV[2], water_height)); LLFace *facep = mDrawFace[0]; @@ -82,6 +82,6 @@ void LLDrawPoolGround::render(S32 pass) LLOverrideFaceColor col(this, gSky.mVOSkyp->getGLFogColor()); facep->renderIndexed(); - glPopMatrix(); + gGL.popMatrix(); } diff --git a/indra/newview/lldrawpoolsimple.cpp b/indra/newview/lldrawpoolsimple.cpp index eec4ee6bac..6e0ea78af2 100644 --- a/indra/newview/lldrawpoolsimple.cpp +++ b/indra/newview/lldrawpoolsimple.cpp @@ -46,7 +46,7 @@ static LLFastTimer::DeclareTimer FTM_RENDER_GRASS_DEFERRED("Deferred Grass"); void LLDrawPoolGlow::beginPostDeferredPass(S32 pass) { - gDeferredFullbrightProgram.bind(); + gDeferredEmissiveProgram.bind(); } static LLFastTimer::DeclareTimer FTM_RENDER_GLOW_PUSH("Glow Push"); @@ -76,10 +76,22 @@ void LLDrawPoolGlow::renderPostDeferred(S32 pass) void LLDrawPoolGlow::endPostDeferredPass(S32 pass) { - gDeferredFullbrightProgram.unbind(); + gDeferredEmissiveProgram.unbind(); LLRenderPass::endRenderPass(pass); } +S32 LLDrawPoolGlow::getNumPasses() +{ + if (LLViewerShaderMgr::instance()->getVertexShaderLevel(LLViewerShaderMgr::SHADER_OBJECT) > 0) + { + return 1; + } + else + { + return 0; + } +} + void LLDrawPoolGlow::render(S32 pass) { LLFastTimer t(FTM_RENDER_GLOW); @@ -93,39 +105,29 @@ void LLDrawPoolGlow::render(S32 pass) U32 shader_level = LLViewerShaderMgr::instance()->getVertexShaderLevel(LLViewerShaderMgr::SHADER_OBJECT); - if (shader_level > 0 && fullbright_shader) - { - fullbright_shader->bind(); - } - else - { - gPipeline.enableLightsFullbright(LLColor4(1,1,1,1)); - } + //should never get here without basic shaders enabled + llassert(shader_level > 0); + + LLGLSLShader* shader = LLPipeline::sUnderWaterRender ? &gObjectEmissiveWaterProgram : &gObjectEmissiveProgram; + shader->bind(); LLGLDepthTest depth(GL_TRUE, GL_FALSE); gGL.setColorMask(false, true); - if (shader_level > 1) - { - pushBatches(LLRenderPass::PASS_GLOW, getVertexDataMask() | LLVertexBuffer::MAP_TEXTURE_INDEX, TRUE, TRUE); - } - else - { - renderTexture(LLRenderPass::PASS_GLOW, getVertexDataMask()); - } + pushBatches(LLRenderPass::PASS_GLOW, getVertexDataMask() | LLVertexBuffer::MAP_TEXTURE_INDEX, TRUE, TRUE); gGL.setColorMask(true, false); gGL.setSceneBlendType(LLRender::BT_ALPHA); if (shader_level > 0 && fullbright_shader) { - fullbright_shader->unbind(); + shader->unbind(); } } void LLDrawPoolGlow::pushBatch(LLDrawInfo& params, U32 mask, BOOL texture, BOOL batch_textures) { - glColor4ubv(params.mGlowColor.mV); + //gGL.diffuseColor4ubv(params.mGlowColor.mV); LLRenderPass::pushBatch(params, mask, texture, batch_textures); } @@ -253,6 +255,7 @@ void LLDrawPoolGrass::prerender() void LLDrawPoolGrass::beginRenderPass(S32 pass) { LLFastTimer t(FTM_RENDER_GRASS); + stop_glerror(); if (LLPipeline::sUnderWaterRender) { @@ -266,7 +269,7 @@ void LLDrawPoolGrass::beginRenderPass(S32 pass) if (mVertexShaderLevel > 0) { simple_shader->bind(); - simple_shader->setAlphaRange(0.5f, 1.f); + simple_shader->setMinimumAlpha(0.5f); } else { @@ -322,7 +325,7 @@ void LLDrawPoolGrass::renderDeferred(S32 pass) { LLFastTimer t(FTM_RENDER_GRASS_DEFERRED); gDeferredNonIndexedDiffuseAlphaMaskProgram.bind(); - gDeferredNonIndexedDiffuseAlphaMaskProgram.setAlphaRange(0.5f, 1.f); + gDeferredNonIndexedDiffuseAlphaMaskProgram.setMinimumAlpha(0.5f); //render grass LLRenderPass::renderTexture(LLRenderPass::PASS_GRASS, getVertexDataMask()); } diff --git a/indra/newview/lldrawpoolsimple.h b/indra/newview/lldrawpoolsimple.h index 3811b3d398..bd62bc7502 100644 --- a/indra/newview/lldrawpoolsimple.h +++ b/indra/newview/lldrawpoolsimple.h @@ -118,7 +118,8 @@ public: enum { VERTEX_DATA_MASK = LLVertexBuffer::MAP_VERTEX | - LLVertexBuffer::MAP_TEXCOORD0 + LLVertexBuffer::MAP_TEXCOORD0 | + LLVertexBuffer::MAP_EMISSIVE }; virtual U32 getVertexDataMask() { return VERTEX_DATA_MASK; } @@ -130,6 +131,8 @@ public: /*virtual*/ void endPostDeferredPass(S32 pass); /*virtual*/ void renderPostDeferred(S32 pass); + /*virtual*/ S32 getNumPasses(); + void render(S32 pass = 0); void pushBatch(LLDrawInfo& params, U32 mask, BOOL texture = TRUE, BOOL batch_textures = FALSE); diff --git a/indra/newview/lldrawpoolsky.cpp b/indra/newview/lldrawpoolsky.cpp index efffb2df9e..7f7d9f65c6 100644 --- a/indra/newview/lldrawpoolsky.cpp +++ b/indra/newview/lldrawpoolsky.cpp @@ -76,15 +76,16 @@ void LLDrawPoolSky::render(S32 pass) return; } - // use a shader only underwater + // don't render sky under water (background just gets cleared to fog color) if(mVertexShaderLevel > 0 && LLPipeline::sUnderWaterRender) { - mShader = &gObjectFullbrightWaterProgram; - mShader->bind(); + return; } - else if (LLGLSLShader::sNoFixedFunction) + + + if (LLGLSLShader::sNoFixedFunction) { //just use the UI shader (generic single texture no lighting) - gUIProgram.bind(); + gOneTextureNoColorProgram.bind(); } else { @@ -111,21 +112,21 @@ void LLDrawPoolSky::render(S32 pass) LLGLDisable clip(GL_CLIP_PLANE0); - glPushMatrix(); + gGL.pushMatrix(); LLVector3 origin = LLViewerCamera::getInstance()->getOrigin(); - glTranslatef(origin.mV[0], origin.mV[1], origin.mV[2]); + gGL.translatef(origin.mV[0], origin.mV[1], origin.mV[2]); S32 face_count = (S32)mDrawFace.size(); LLVertexBuffer::unbind(); - glColor4f(1,1,1,1); + gGL.diffuseColor4f(1,1,1,1); for (S32 i = 0; i < llmin(6, face_count); ++i) { renderSkyCubeFace(i); } - glPopMatrix(); + gGL.popMatrix(); } void LLDrawPoolSky::renderSkyCubeFace(U8 side) @@ -146,7 +147,7 @@ void LLDrawPoolSky::renderSkyCubeFace(U8 side) LLGLEnable blend(GL_BLEND); mSkyTex[side].bindTexture(FALSE); - glColor4f(1, 1, 1, LLSkyTex::getInterpVal()); // lighting is disabled + gGL.diffuseColor4f(1, 1, 1, LLSkyTex::getInterpVal()); // lighting is disabled face.renderIndexed(); } } diff --git a/indra/newview/lldrawpoolterrain.cpp b/indra/newview/lldrawpoolterrain.cpp index 3daa0f8261..b95d8296fa 100644 --- a/indra/newview/lldrawpoolterrain.cpp +++ b/indra/newview/lldrawpoolterrain.cpp @@ -62,13 +62,16 @@ LLDrawPoolTerrain::LLDrawPoolTerrain(LLViewerTexture *texturep) : LLFacePool(POOL_TERRAIN), mTexturep(texturep) { + U32 format = GL_ALPHA8; + U32 int_format = GL_ALPHA; + // Hack! sDetailScale = 1.f/gSavedSettings.getF32("RenderTerrainScale"); sDetailMode = gSavedSettings.getS32("RenderTerrainDetail"); mAlphaRampImagep = LLViewerTextureManager::getFetchedTextureFromFile("alpha_gradient.tga", TRUE, LLViewerTexture::BOOST_UI, LLViewerTexture::FETCHED_TEXTURE, - GL_ALPHA8, GL_ALPHA, + format, int_format, LLUUID("e97cf410-8e61-7005-ec06-629eba4cd1fb")); //gGL.getTexUnit(0)->bind(mAlphaRampImagep.get()); @@ -77,7 +80,7 @@ LLDrawPoolTerrain::LLDrawPoolTerrain(LLViewerTexture *texturep) : m2DAlphaRampImagep = LLViewerTextureManager::getFetchedTextureFromFile("alpha_gradient_2d.j2c", TRUE, LLViewerTexture::BOOST_UI, LLViewerTexture::FETCHED_TEXTURE, - GL_ALPHA8, GL_ALPHA, + format, int_format, LLUUID("38b86f85-2575-52a9-a531-23108d8da837")); //gGL.getTexUnit(0)->bind(m2DAlphaRampImagep.get()); @@ -106,6 +109,10 @@ U32 LLDrawPoolTerrain::getVertexDataMask() { return LLVertexBuffer::MAP_VERTEX; } + else if (LLGLSLShader::sCurBoundShaderPtr) + { + return VERTEX_DATA_MASK & ~(LLVertexBuffer::MAP_TEXCOORD2 | LLVertexBuffer::MAP_TEXCOORD3); + } else { return VERTEX_DATA_MASK; @@ -115,14 +122,7 @@ U32 LLDrawPoolTerrain::getVertexDataMask() void LLDrawPoolTerrain::prerender() { mVertexShaderLevel = LLViewerShaderMgr::instance()->getVertexShaderLevel(LLViewerShaderMgr::SHADER_ENVIRONMENT); - if (mVertexShaderLevel > 0) - { - sDetailMode = 1; - } - else - { - sDetailMode = gSavedSettings.getS32("RenderTerrainDetail"); - } + sDetailMode = gSavedSettings.getS32("RenderTerrainDetail"); } void LLDrawPoolTerrain::beginRenderPass( S32 pass ) @@ -132,7 +132,7 @@ void LLDrawPoolTerrain::beginRenderPass( S32 pass ) sShader = LLPipeline::sUnderWaterRender ? &gTerrainWaterProgram : - &gTerrainProgram; + &gTerrainProgram; if (mVertexShaderLevel > 1 && sShader->mShaderLevel > 0) { @@ -174,6 +174,8 @@ void LLDrawPoolTerrain::render(S32 pass) compp->mDetailTextures[i]->addTextureStats(1024.f*1024.f); // assume large pixel area } + LLOverrideFaceColor override(this, 1.f, 1.f, 1.f, 1.f); + if (!gGLManager.mHasMultitexture) { // No multitexture, render simple land. @@ -188,22 +190,27 @@ void LLDrawPoolTerrain::render(S32 pass) } LLGLSPipeline gls; - LLOverrideFaceColor override(this, 1.f, 1.f, 1.f, 1.f); - + if (mVertexShaderLevel > 1 && sShader->mShaderLevel > 0) { gPipeline.enableLightsDynamic(); + renderFullShader(); } else { gPipeline.enableLightsStatic(); - if (sDetailMode == 0){ + if (sDetailMode == 0) + { renderSimple(); - } else if (gGLManager.mNumTextureUnits < 4){ + } + else if (gGLManager.mNumTextureUnits < 4) + { renderFull2TU(); - } else { + } + else + { renderFull4TU(); } } @@ -215,8 +222,9 @@ void LLDrawPoolTerrain::render(S32 pass) { //use fullbright shader for highlighting LLGLSLShader* old_shader = sShader; sShader->unbind(); - sShader = &gObjectFullbrightNonIndexedProgram; + sShader = &gHighlightProgram; sShader->bind(); + gGL.diffuseColor4f(1,1,1,1); LLGLEnable polyOffset(GL_POLYGON_OFFSET_FILL); glPolygonOffset(-1.0f, -1.0f); renderOwnership(); @@ -312,16 +320,15 @@ void LLDrawPoolTerrain::renderFullShader() gGL.getTexUnit(detail0)->bind(detail_texture0p); gGL.getTexUnit(0)->activate(); - glEnable(GL_TEXTURE_GEN_S); - glEnable(GL_TEXTURE_GEN_T); - glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR); - glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR); + LLGLSLShader* shader = LLGLSLShader::sCurBoundShaderPtr; + llassert(shader); + + shader->uniform4fv("object_plane_s", 1, tp0.mV); + shader->uniform4fv("object_plane_t", 1, tp1.mV); - glTexGenfv(GL_S, GL_OBJECT_PLANE, tp0.mV); - glTexGenfv(GL_T, GL_OBJECT_PLANE, tp1.mV); - glMatrixMode(GL_TEXTURE); - glLoadIdentity(); - glMatrixMode(GL_MODELVIEW); + gGL.matrixMode(LLRender::MM_TEXTURE); + gGL.loadIdentity(); + gGL.matrixMode(LLRender::MM_MODELVIEW); // // detail texture 1 @@ -331,9 +338,9 @@ void LLDrawPoolTerrain::renderFullShader() /// ALPHA TEXTURE COORDS 0: gGL.getTexUnit(1)->activate(); - glMatrixMode(GL_TEXTURE); - glLoadIdentity(); - glMatrixMode(GL_MODELVIEW); + gGL.matrixMode(LLRender::MM_TEXTURE); + gGL.loadIdentity(); + gGL.matrixMode(LLRender::MM_MODELVIEW); // detail texture 2 // @@ -343,10 +350,10 @@ void LLDrawPoolTerrain::renderFullShader() gGL.getTexUnit(2)->activate(); /// ALPHA TEXTURE COORDS 1: - glMatrixMode(GL_TEXTURE); - glLoadIdentity(); - glTranslatef(-2.f, 0.f, 0.f); - glMatrixMode(GL_MODELVIEW); + gGL.matrixMode(LLRender::MM_TEXTURE); + gGL.loadIdentity(); + gGL.translatef(-2.f, 0.f, 0.f); + gGL.matrixMode(LLRender::MM_MODELVIEW); // // detail texture 3 @@ -356,10 +363,10 @@ void LLDrawPoolTerrain::renderFullShader() /// ALPHA TEXTURE COORDS 2: gGL.getTexUnit(3)->activate(); - glMatrixMode(GL_TEXTURE); - glLoadIdentity(); - glTranslatef(-1.f, 0.f, 0.f); - glMatrixMode(GL_MODELVIEW); + gGL.matrixMode(LLRender::MM_TEXTURE); + gGL.loadIdentity(); + gGL.translatef(-1.f, 0.f, 0.f); + gGL.matrixMode(LLRender::MM_MODELVIEW); // // Alpha Ramp @@ -380,38 +387,30 @@ void LLDrawPoolTerrain::renderFullShader() gGL.getTexUnit(alpha_ramp)->unbind(LLTexUnit::TT_TEXTURE); gGL.getTexUnit(4)->disable(); gGL.getTexUnit(4)->activate(); - glDisable(GL_TEXTURE_GEN_S); - glDisable(GL_TEXTURE_GEN_T); - glMatrixMode(GL_TEXTURE); - glLoadIdentity(); - glMatrixMode(GL_MODELVIEW); - + gGL.getTexUnit(detail3)->unbind(LLTexUnit::TT_TEXTURE); gGL.getTexUnit(3)->disable(); gGL.getTexUnit(3)->activate(); - glDisable(GL_TEXTURE_GEN_S); - glDisable(GL_TEXTURE_GEN_T); - glMatrixMode(GL_TEXTURE); - glLoadIdentity(); - glMatrixMode(GL_MODELVIEW); + + gGL.matrixMode(LLRender::MM_TEXTURE); + gGL.loadIdentity(); + gGL.matrixMode(LLRender::MM_MODELVIEW); gGL.getTexUnit(detail2)->unbind(LLTexUnit::TT_TEXTURE); gGL.getTexUnit(2)->disable(); gGL.getTexUnit(2)->activate(); - glDisable(GL_TEXTURE_GEN_S); - glDisable(GL_TEXTURE_GEN_T); - glMatrixMode(GL_TEXTURE); - glLoadIdentity(); - glMatrixMode(GL_MODELVIEW); + + gGL.matrixMode(LLRender::MM_TEXTURE); + gGL.loadIdentity(); + gGL.matrixMode(LLRender::MM_MODELVIEW); gGL.getTexUnit(detail1)->unbind(LLTexUnit::TT_TEXTURE); gGL.getTexUnit(1)->disable(); gGL.getTexUnit(1)->activate(); - glDisable(GL_TEXTURE_GEN_S); - glDisable(GL_TEXTURE_GEN_T); - glMatrixMode(GL_TEXTURE); - glLoadIdentity(); - glMatrixMode(GL_MODELVIEW); + + gGL.matrixMode(LLRender::MM_TEXTURE); + gGL.loadIdentity(); + gGL.matrixMode(LLRender::MM_MODELVIEW); //---------------------------------------------------------------------------- // Restore Texture Unit 0 defaults @@ -419,11 +418,9 @@ void LLDrawPoolTerrain::renderFullShader() gGL.getTexUnit(detail0)->unbind(LLTexUnit::TT_TEXTURE); gGL.getTexUnit(0)->enable(LLTexUnit::TT_TEXTURE); gGL.getTexUnit(0)->activate(); - glDisable(GL_TEXTURE_GEN_S); - glDisable(GL_TEXTURE_GEN_T); - glMatrixMode(GL_TEXTURE); - glLoadIdentity(); - glMatrixMode(GL_MODELVIEW); + gGL.matrixMode(LLRender::MM_TEXTURE); + gGL.loadIdentity(); + gGL.matrixMode(LLRender::MM_MODELVIEW); } void LLDrawPoolTerrain::renderFull4TU() @@ -534,9 +531,9 @@ void LLDrawPoolTerrain::renderFull4TU() gGL.getTexUnit(1)->activate(); // Set the texture matrix - glMatrixMode(GL_TEXTURE); - glLoadIdentity(); - glTranslatef(-2.f, 0.f, 0.f); + gGL.matrixMode(LLRender::MM_TEXTURE); + gGL.loadIdentity(); + gGL.translatef(-2.f, 0.f, 0.f); // Care about alpha only gGL.getTexUnit(1)->setTextureColorBlend(LLTexUnit::TBO_REPLACE, LLTexUnit::TBS_PREV_COLOR); @@ -566,9 +563,9 @@ void LLDrawPoolTerrain::renderFull4TU() gGL.getTexUnit(3)->activate(); // Set the texture matrix - glMatrixMode(GL_TEXTURE); - glLoadIdentity(); - glTranslatef(-1.f, 0.f, 0.f); + gGL.matrixMode(LLRender::MM_TEXTURE); + gGL.loadIdentity(); + gGL.translatef(-1.f, 0.f, 0.f); // Set alpha texture and do lighting modulation gGL.getTexUnit(3)->setTextureColorBlend(LLTexUnit::TBO_MULT, LLTexUnit::TBS_PREV_COLOR, LLTexUnit::TBS_VERT_COLOR); @@ -586,9 +583,9 @@ void LLDrawPoolTerrain::renderFull4TU() gGL.getTexUnit(3)->disable(); gGL.getTexUnit(3)->activate(); - glMatrixMode(GL_TEXTURE); - glLoadIdentity(); - glMatrixMode(GL_MODELVIEW); + gGL.matrixMode(LLRender::MM_TEXTURE); + gGL.loadIdentity(); + gGL.matrixMode(LLRender::MM_MODELVIEW); gGL.getTexUnit(2)->unbind(LLTexUnit::TT_TEXTURE); gGL.getTexUnit(2)->disable(); @@ -596,17 +593,17 @@ void LLDrawPoolTerrain::renderFull4TU() glDisable(GL_TEXTURE_GEN_S); glDisable(GL_TEXTURE_GEN_T); - glMatrixMode(GL_TEXTURE); - glLoadIdentity(); - glMatrixMode(GL_MODELVIEW); + gGL.matrixMode(LLRender::MM_TEXTURE); + gGL.loadIdentity(); + gGL.matrixMode(LLRender::MM_MODELVIEW); gGL.getTexUnit(1)->unbind(LLTexUnit::TT_TEXTURE); gGL.getTexUnit(1)->disable(); gGL.getTexUnit(1)->activate(); - glMatrixMode(GL_TEXTURE); - glLoadIdentity(); - glMatrixMode(GL_MODELVIEW); + gGL.matrixMode(LLRender::MM_TEXTURE); + gGL.loadIdentity(); + gGL.matrixMode(LLRender::MM_MODELVIEW); // Restore blend state gGL.setSceneBlendType(LLRender::BT_ALPHA); @@ -620,9 +617,9 @@ void LLDrawPoolTerrain::renderFull4TU() glDisable(GL_TEXTURE_GEN_S); glDisable(GL_TEXTURE_GEN_T); - glMatrixMode(GL_TEXTURE); - glLoadIdentity(); - glMatrixMode(GL_MODELVIEW); + gGL.matrixMode(LLRender::MM_TEXTURE); + gGL.loadIdentity(); + gGL.matrixMode(LLRender::MM_MODELVIEW); gGL.getTexUnit(0)->setTextureBlendType(LLTexUnit::TB_MULT); } @@ -714,9 +711,9 @@ void LLDrawPoolTerrain::renderFull2TU() gGL.getTexUnit(0)->bind(m2DAlphaRampImagep); // Set the texture matrix - glMatrixMode(GL_TEXTURE); - glLoadIdentity(); - glTranslatef(-1.f, 0.f, 0.f); + gGL.matrixMode(LLRender::MM_TEXTURE); + gGL.loadIdentity(); + gGL.translatef(-1.f, 0.f, 0.f); // Care about alpha only gGL.getTexUnit(0)->setTextureColorBlend(LLTexUnit::TBO_REPLACE, LLTexUnit::TBS_PREV_COLOR); @@ -753,9 +750,9 @@ void LLDrawPoolTerrain::renderFull2TU() gGL.getTexUnit(0)->activate(); gGL.getTexUnit(0)->bind(m2DAlphaRampImagep); // Set the texture matrix - glMatrixMode(GL_TEXTURE); - glLoadIdentity(); - glTranslatef(-2.f, 0.f, 0.f); + gGL.matrixMode(LLRender::MM_TEXTURE); + gGL.loadIdentity(); + gGL.translatef(-2.f, 0.f, 0.f); // Care about alpha only gGL.getTexUnit(0)->setTextureColorBlend(LLTexUnit::TBO_REPLACE, LLTexUnit::TBS_PREV_COLOR); @@ -793,9 +790,9 @@ void LLDrawPoolTerrain::renderFull2TU() glDisable(GL_TEXTURE_GEN_S); glDisable(GL_TEXTURE_GEN_T); - glMatrixMode(GL_TEXTURE); - glLoadIdentity(); - glMatrixMode(GL_MODELVIEW); + gGL.matrixMode(LLRender::MM_TEXTURE); + gGL.loadIdentity(); + gGL.matrixMode(LLRender::MM_MODELVIEW); //---------------------------------------------------------------------------- // Restore Texture Unit 0 defaults @@ -805,9 +802,9 @@ void LLDrawPoolTerrain::renderFull2TU() glDisable(GL_TEXTURE_GEN_S); glDisable(GL_TEXTURE_GEN_T); - glMatrixMode(GL_TEXTURE); - glLoadIdentity(); - glMatrixMode(GL_MODELVIEW); + gGL.matrixMode(LLRender::MM_TEXTURE); + gGL.loadIdentity(); + gGL.matrixMode(LLRender::MM_MODELVIEW); gGL.getTexUnit(0)->setTextureBlendType(LLTexUnit::TB_MULT); } @@ -831,13 +828,21 @@ void LLDrawPoolTerrain::renderSimple() tp0.setVec(tscale, 0.f, 0.0f, -1.f*(origin_agent.mV[0]/256.f)); tp1.setVec(0.f, tscale, 0.0f, -1.f*(origin_agent.mV[1]/256.f)); - glEnable(GL_TEXTURE_GEN_S); - glEnable(GL_TEXTURE_GEN_T); - glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR); - glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR); - glTexGenfv(GL_S, GL_OBJECT_PLANE, tp0.mV); - glTexGenfv(GL_T, GL_OBJECT_PLANE, tp1.mV); - + if (LLGLSLShader::sNoFixedFunction) + { + sShader->uniform4fv("object_plane_s", 1, tp0.mV); + sShader->uniform4fv("object_plane_t", 1, tp1.mV); + } + else + { + glEnable(GL_TEXTURE_GEN_S); + glEnable(GL_TEXTURE_GEN_T); + glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR); + glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR); + glTexGenfv(GL_S, GL_OBJECT_PLANE, tp0.mV); + glTexGenfv(GL_T, GL_OBJECT_PLANE, tp1.mV); + } + gGL.getTexUnit(0)->setTextureColorBlend(LLTexUnit::TBO_MULT, LLTexUnit::TBS_TEX_COLOR, LLTexUnit::TBS_VERT_COLOR); drawLoop(); @@ -847,11 +852,14 @@ void LLDrawPoolTerrain::renderSimple() gGL.getTexUnit(0)->activate(); gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); - glDisable(GL_TEXTURE_GEN_S); - glDisable(GL_TEXTURE_GEN_T); - glMatrixMode(GL_TEXTURE); - glLoadIdentity(); - glMatrixMode(GL_MODELVIEW); + if (!LLGLSLShader::sNoFixedFunction) + { + glDisable(GL_TEXTURE_GEN_S); + glDisable(GL_TEXTURE_GEN_T); + } + gGL.matrixMode(LLRender::MM_TEXTURE); + gGL.loadIdentity(); + gGL.matrixMode(LLRender::MM_MODELVIEW); gGL.getTexUnit(0)->setTextureBlendType(LLTexUnit::TB_MULT); } @@ -882,11 +890,11 @@ void LLDrawPoolTerrain::renderOwnership() // texture coordinates for pixel 256x256 is not 1,1. This makes the // ownership map not line up with the selection. We address this with // a texture matrix multiply. - glMatrixMode(GL_TEXTURE); - glPushMatrix(); + gGL.matrixMode(LLRender::MM_TEXTURE); + gGL.pushMatrix(); const F32 TEXTURE_FUDGE = 257.f / 256.f; - glScalef( TEXTURE_FUDGE, TEXTURE_FUDGE, 1.f ); + gGL.scalef( TEXTURE_FUDGE, TEXTURE_FUDGE, 1.f ); for (std::vector<LLFace*>::iterator iter = mDrawFace.begin(); iter != mDrawFace.end(); iter++) { @@ -895,9 +903,9 @@ void LLDrawPoolTerrain::renderOwnership() LLVertexBuffer::MAP_TEXCOORD0); } - glMatrixMode(GL_TEXTURE); - glPopMatrix(); - glMatrixMode(GL_MODELVIEW); + gGL.matrixMode(LLRender::MM_TEXTURE); + gGL.popMatrix(); + gGL.matrixMode(LLRender::MM_MODELVIEW); } diff --git a/indra/newview/lldrawpoolterrain.h b/indra/newview/lldrawpoolterrain.h index 3056da44d5..283ed87f1a 100644 --- a/indra/newview/lldrawpoolterrain.h +++ b/indra/newview/lldrawpoolterrain.h @@ -40,8 +40,7 @@ public: LLVertexBuffer::MAP_TEXCOORD0 | LLVertexBuffer::MAP_TEXCOORD1 | LLVertexBuffer::MAP_TEXCOORD2 | - LLVertexBuffer::MAP_TEXCOORD3 | - LLVertexBuffer::MAP_COLOR + LLVertexBuffer::MAP_TEXCOORD3 }; virtual U32 getVertexDataMask(); diff --git a/indra/newview/lldrawpooltree.cpp b/indra/newview/lldrawpooltree.cpp index a6e0151114..3165a3516c 100644 --- a/indra/newview/lldrawpooltree.cpp +++ b/indra/newview/lldrawpooltree.cpp @@ -65,17 +65,18 @@ void LLDrawPoolTree::beginRenderPass(S32 pass) if (LLPipeline::sUnderWaterRender) { - shader = &gObjectAlphaMaskNonIndexedWaterProgram; + shader = &gTreeWaterProgram; } else { - shader = &gObjectAlphaMaskNonIndexedProgram; + shader = &gTreeProgram; } if (gPipeline.canUseVertexShaders()) { shader->bind(); - shader->setAlphaRange(0.5f, 1.f); + shader->setMinimumAlpha(0.5f); + gGL.diffuseColor4f(1,1,1,1); } else { @@ -96,25 +97,18 @@ void LLDrawPoolTree::render(S32 pass) LLGLState test(GL_ALPHA_TEST, LLGLSLShader::sNoFixedFunction ? 0 : 1); LLOverrideFaceColor color(this, 1.f, 1.f, 1.f, 1.f); - if (gSavedSettings.getBOOL("RenderAnimateTrees")) - { - renderTree(); - } - else + gGL.getTexUnit(sDiffTex)->bind(mTexturep); + + for (std::vector<LLFace*>::iterator iter = mDrawFace.begin(); + iter != mDrawFace.end(); iter++) { - gGL.getTexUnit(sDiffTex)->bind(mTexturep); - - for (std::vector<LLFace*>::iterator iter = mDrawFace.begin(); - iter != mDrawFace.end(); iter++) + LLFace *face = *iter; + LLVertexBuffer* buff = face->getVertexBuffer(); + if(buff) { - LLFace *face = *iter; - LLVertexBuffer* buff = face->getVertexBuffer(); - if(buff) - { - buff->setBuffer(LLDrawPoolTree::VERTEX_DATA_MASK); - buff->drawRange(LLRender::TRIANGLES, 0, buff->getRequestedVerts()-1, buff->getRequestedIndices(), 0); - gPipeline.addTrianglesDrawn(buff->getRequestedIndices()); - } + buff->setBuffer(LLDrawPoolTree::VERTEX_DATA_MASK); + buff->drawRange(LLRender::TRIANGLES, 0, buff->getNumVerts()-1, buff->getNumIndices(), 0); + gPipeline.addTrianglesDrawn(buff->getNumIndices()); } } } @@ -141,9 +135,9 @@ void LLDrawPoolTree::beginDeferredPass(S32 pass) { LLFastTimer t(FTM_RENDER_TREES); - shader = &gDeferredNonIndexedDiffuseAlphaMaskProgram; + shader = &gDeferredTreeProgram; shader->bind(); - shader->setAlphaRange(0.5f, 1.f); + shader->setMinimumAlpha(0.5f); } void LLDrawPoolTree::renderDeferred(S32 pass) @@ -168,8 +162,8 @@ void LLDrawPoolTree::beginShadowPass(S32 pass) glPolygonOffset(gSavedSettings.getF32("RenderDeferredTreeShadowOffset"), gSavedSettings.getF32("RenderDeferredTreeShadowBias")); - gDeferredShadowAlphaMaskProgram.bind(); - gDeferredShadowAlphaMaskProgram.setAlphaRange(0.5f, 1.f); + gDeferredTreeShadowProgram.bind(); + gDeferredTreeShadowProgram.setMinimumAlpha(0.5f); } void LLDrawPoolTree::renderShadow(S32 pass) @@ -183,133 +177,7 @@ void LLDrawPoolTree::endShadowPass(S32 pass) glPolygonOffset(gSavedSettings.getF32("RenderDeferredSpotShadowOffset"), gSavedSettings.getF32("RenderDeferredSpotShadowBias")); -} - - -void LLDrawPoolTree::renderTree(BOOL selecting) -{ - LLGLState normalize(GL_NORMALIZE, TRUE); - - // Bind the texture for this tree. - gGL.getTexUnit(sDiffTex)->bind(mTexturep.get(), TRUE); - - U32 indices_drawn = 0; - - glMatrixMode(GL_MODELVIEW); - - for (std::vector<LLFace*>::iterator iter = mDrawFace.begin(); - iter != mDrawFace.end(); iter++) - { - LLFace *face = *iter; - LLDrawable *drawablep = face->getDrawable(); - - if (drawablep->isDead() || !face->getVertexBuffer()) - { - continue; - } - - face->getVertexBuffer()->setBuffer(LLDrawPoolTree::VERTEX_DATA_MASK); - U16* indicesp = (U16*) face->getVertexBuffer()->getIndicesPointer(); - - // Render each of the trees - LLVOTree *treep = (LLVOTree *)drawablep->getVObj().get(); - - LLColor4U color(255,255,255,255); - - if (!selecting || treep->mGLName != 0) - { - if (selecting) - { - S32 name = treep->mGLName; - - color = LLColor4U((U8)(name >> 16), (U8)(name >> 8), (U8)name, 255); - } - - gGLLastMatrix = NULL; - glLoadMatrixd(gGLModelView); - //glPushMatrix(); - F32 mat[16]; - for (U32 i = 0; i < 16; i++) - mat[i] = (F32) gGLModelView[i]; - - LLMatrix4 matrix(mat); - - // Translate to tree base HACK - adjustment in Z plants tree underground - const LLVector3 &pos_agent = treep->getPositionAgent(); - //glTranslatef(pos_agent.mV[VX], pos_agent.mV[VY], pos_agent.mV[VZ] - 0.1f); - LLMatrix4 trans_mat; - trans_mat.setTranslation(pos_agent.mV[VX], pos_agent.mV[VY], pos_agent.mV[VZ] - 0.1f); - trans_mat *= matrix; - - // Rotate to tree position and bend for current trunk/wind - // Note that trunk stiffness controls the amount of bend at the trunk as - // opposed to the crown of the tree - // - const F32 TRUNK_STIFF = 22.f; - - LLQuaternion rot = - LLQuaternion(treep->mTrunkBend.magVec()*TRUNK_STIFF*DEG_TO_RAD, LLVector4(treep->mTrunkBend.mV[VX], treep->mTrunkBend.mV[VY], 0)) * - LLQuaternion(90.f*DEG_TO_RAD, LLVector4(0,0,1)) * - treep->getRotation(); - - LLMatrix4 rot_mat(rot); - rot_mat *= trans_mat; - - F32 radius = treep->getScale().magVec()*0.05f; - LLMatrix4 scale_mat; - scale_mat.mMatrix[0][0] = - scale_mat.mMatrix[1][1] = - scale_mat.mMatrix[2][2] = radius; - - scale_mat *= rot_mat; - - const F32 THRESH_ANGLE_FOR_BILLBOARD = 15.f; - const F32 BLEND_RANGE_FOR_BILLBOARD = 3.f; - - F32 droop = treep->mDroop + 25.f*(1.f - treep->mTrunkBend.magVec()); - - S32 stop_depth = 0; - F32 app_angle = treep->getAppAngle()*LLVOTree::sTreeFactor; - F32 alpha = 1.0; - S32 trunk_LOD = LLVOTree::sMAX_NUM_TREE_LOD_LEVELS; - - for (S32 j = 0; j < 4; j++) - { - - if (app_angle > LLVOTree::sLODAngles[j]) - { - trunk_LOD = j; - break; - } - } - if(trunk_LOD >= LLVOTree::sMAX_NUM_TREE_LOD_LEVELS) - { - continue ; //do not render. - } - - if (app_angle < (THRESH_ANGLE_FOR_BILLBOARD - BLEND_RANGE_FOR_BILLBOARD)) - { - // - // Draw only the billboard - // - // Only the billboard, can use closer to normal alpha func. - stop_depth = -1; - LLFacePool::LLOverrideFaceColor clr(this, color); - indices_drawn += treep->drawBranchPipeline(scale_mat, indicesp, trunk_LOD, stop_depth, treep->mDepth, treep->mTrunkDepth, 1.0, treep->mTwist, droop, treep->mBranches, alpha); - } - else // if (app_angle > (THRESH_ANGLE_FOR_BILLBOARD + BLEND_RANGE_FOR_BILLBOARD)) - { - // - // Draw only the full geometry tree - // - //stop_depth = (app_angle < THRESH_ANGLE_FOR_RECURSION_REDUCTION); - LLFacePool::LLOverrideFaceColor clr(this, color); - indices_drawn += treep->drawBranchPipeline(scale_mat, indicesp, trunk_LOD, stop_depth, treep->mDepth, treep->mTrunkDepth, 1.0, treep->mTwist, droop, treep->mBranches, alpha); - } - - //glPopMatrix(); - } - } + gDeferredTreeShadowProgram.unbind(); } BOOL LLDrawPoolTree::verify() const diff --git a/indra/newview/lldrawpooltree.h b/indra/newview/lldrawpooltree.h index ddb259bb82..e7e25453cf 100644 --- a/indra/newview/lldrawpooltree.h +++ b/indra/newview/lldrawpooltree.h @@ -68,9 +68,6 @@ public: /*virtual*/ LLColor3 getDebugColor() const; // For AGP debug display static S32 sDiffTex; - -private: - void renderTree(BOOL selecting = FALSE); }; #endif // LL_LLDRAWPOOLTREE_H diff --git a/indra/newview/lldrawpoolwater.cpp b/indra/newview/lldrawpoolwater.cpp index 31c14361b5..4f6eaa5a5b 100644 --- a/indra/newview/lldrawpoolwater.cpp +++ b/indra/newview/lldrawpoolwater.cpp @@ -59,6 +59,8 @@ BOOL LLDrawPoolWater::sSkipScreenCopy = FALSE; BOOL LLDrawPoolWater::sNeedsReflectionUpdate = TRUE; BOOL LLDrawPoolWater::sNeedsDistortionUpdate = TRUE; LLColor4 LLDrawPoolWater::sWaterFogColor = LLColor4(0.2f, 0.5f, 0.5f, 0.f); +F32 LLDrawPoolWater::sWaterFogEnd = 0.f; + LLVector3 LLDrawPoolWater::sLightDir; LLDrawPoolWater::LLDrawPoolWater() : @@ -219,7 +221,7 @@ void LLDrawPoolWater::render(S32 pass) water_color.setVec(1.f, 1.f, 1.f, 0.5f*(1.f + up_dot)); } - glColor4fv(water_color.mV); + gGL.diffuseColor4fv(water_color.mV); // Automatically generate texture coords for detail map glEnable(GL_TEXTURE_GEN_S); //texture unit 1 @@ -275,15 +277,15 @@ void LLDrawPoolWater::render(S32 pass) gSky.mVOSkyp->getCubeMap()->enable(0); gSky.mVOSkyp->getCubeMap()->bind(); - glMatrixMode(GL_TEXTURE); - glLoadIdentity(); + gGL.matrixMode(LLRender::MM_TEXTURE); + gGL.loadIdentity(); LLMatrix4 camera_mat = LLViewerCamera::getInstance()->getModelview(); LLMatrix4 camera_rot(camera_mat.getMat3()); camera_rot.invert(); - glLoadMatrixf((F32 *)camera_rot.mMatrix); + gGL.loadMatrix((F32 *)camera_rot.mMatrix); - glMatrixMode(GL_MODELVIEW); + gGL.matrixMode(LLRender::MM_MODELVIEW); LLOverrideFaceColor overrid(this, 1.f, 1.f, 1.f, 0.5f*up_dot); gGL.getTexUnit(0)->setTextureBlendType(LLTexUnit::TB_MULT); @@ -310,9 +312,9 @@ void LLDrawPoolWater::render(S32 pass) gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); gGL.getTexUnit(0)->enable(LLTexUnit::TT_TEXTURE); - glMatrixMode(GL_TEXTURE); - glLoadIdentity(); - glMatrixMode(GL_MODELVIEW); + gGL.matrixMode(LLRender::MM_TEXTURE); + gGL.loadIdentity(); + gGL.matrixMode(LLRender::MM_MODELVIEW); } @@ -332,6 +334,21 @@ void LLDrawPoolWater::renderOpaqueLegacyWater() { LLVOSky *voskyp = gSky.mVOSkyp; + LLGLSLShader* shader = NULL; + if (LLGLSLShader::sNoFixedFunction) + { + if (LLPipeline::sUnderWaterRender) + { + shader = &gObjectSimpleNonIndexedTexGenWaterProgram; + } + else + { + shader = &gObjectSimpleNonIndexedTexGenProgram; + } + + shader->bind(); + } + stop_glerror(); // Depth sorting and write to depth buffer @@ -354,10 +371,13 @@ void LLDrawPoolWater::renderOpaqueLegacyWater() gGL.getTexUnit(0)->bind(mOpaqueWaterImagep); // Automatically generate texture coords for water texture - glEnable(GL_TEXTURE_GEN_S); //texture unit 0 - glEnable(GL_TEXTURE_GEN_T); //texture unit 0 - glTexGenf(GL_S, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR); - glTexGenf(GL_T, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR); + if (!shader) + { + glEnable(GL_TEXTURE_GEN_S); //texture unit 0 + glEnable(GL_TEXTURE_GEN_T); //texture unit 0 + glTexGenf(GL_S, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR); + glTexGenf(GL_T, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR); + } // Use the fact that we know all water faces are the same size // to save some computation @@ -380,10 +400,18 @@ void LLDrawPoolWater::renderOpaqueLegacyWater() F32 tp0[4] = { 16.f / 256.f, 0.0f, 0.0f, offset }; F32 tp1[4] = { 0.0f, 16.f / 256.f, 0.0f, offset }; - glTexGenfv(GL_S, GL_OBJECT_PLANE, tp0); - glTexGenfv(GL_T, GL_OBJECT_PLANE, tp1); + if (!shader) + { + glTexGenfv(GL_S, GL_OBJECT_PLANE, tp0); + glTexGenfv(GL_T, GL_OBJECT_PLANE, tp1); + } + else + { + shader->uniform4fv("object_plane_s", 1, tp0); + shader->uniform4fv("object_plane_t", 1, tp1); + } - glColor3f(1.f, 1.f, 1.f); + gGL.diffuseColor3f(1.f, 1.f, 1.f); for (std::vector<LLFace*>::iterator iter = mDrawFace.begin(); iter != mDrawFace.end(); iter++) @@ -399,9 +427,12 @@ void LLDrawPoolWater::renderOpaqueLegacyWater() stop_glerror(); - // Reset the settings back to expected values - glDisable(GL_TEXTURE_GEN_S); //texture unit 0 - glDisable(GL_TEXTURE_GEN_T); //texture unit 0 + if (!shader) + { + // Reset the settings back to expected values + glDisable(GL_TEXTURE_GEN_S); //texture unit 0 + glDisable(GL_TEXTURE_GEN_T); //texture unit 0 + } gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); gGL.getTexUnit(0)->setTextureBlendType(LLTexUnit::TB_MULT); @@ -623,8 +654,6 @@ void LLDrawPoolWater::shade() water_color.mV[3] = 0.9f; } - glColor4fv(water_color.mV); - { LLGLEnable depth_clamp(gGLManager.mHasDepthClamp ? GL_DEPTH_CLAMP : 0); LLGLDisable cullface(GL_CULL_FACE); diff --git a/indra/newview/lldrawpoolwater.h b/indra/newview/lldrawpoolwater.h index 99b541ca5a..aeeba179d6 100644 --- a/indra/newview/lldrawpoolwater.h +++ b/indra/newview/lldrawpoolwater.h @@ -49,6 +49,7 @@ public: static LLVector3 sLightDir; static LLColor4 sWaterFogColor; + static F32 sWaterFogEnd; enum { diff --git a/indra/newview/lldrawpoolwlsky.cpp b/indra/newview/lldrawpoolwlsky.cpp index 79a835fd14..caf15fe1cb 100644 --- a/indra/newview/lldrawpoolwlsky.cpp +++ b/indra/newview/lldrawpoolwlsky.cpp @@ -100,12 +100,12 @@ void LLDrawPoolWLSky::beginRenderPass( S32 pass ) { sky_shader = LLPipeline::sUnderWaterRender ? - &gObjectSimpleWaterProgram : + &gObjectFullbrightNoColorWaterProgram : &gWLSkyProgram; cloud_shader = LLPipeline::sUnderWaterRender ? - &gObjectSimpleWaterProgram : + &gObjectFullbrightNoColorWaterProgram : &gWLCloudProgram; } @@ -130,33 +130,33 @@ void LLDrawPoolWLSky::renderDome(F32 camHeightLocal, LLGLSLShader * shader) cons llassert_always(NULL != shader); - glPushMatrix(); + gGL.pushMatrix(); //chop off translation if (LLPipeline::sReflectionRender && origin.mV[2] > 256.f) { - glTranslatef(origin.mV[0], origin.mV[1], 256.f-origin.mV[2]*0.5f); + gGL.translatef(origin.mV[0], origin.mV[1], 256.f-origin.mV[2]*0.5f); } else { - glTranslatef(origin.mV[0], origin.mV[1], origin.mV[2]); + gGL.translatef(origin.mV[0], origin.mV[1], origin.mV[2]); } // the windlight sky dome works most conveniently in a coordinate system // where Y is up, so permute our basis vectors accordingly. - glRotatef(120.f, 1.f / F_SQRT3, 1.f / F_SQRT3, 1.f / F_SQRT3); + gGL.rotatef(120.f, 1.f / F_SQRT3, 1.f / F_SQRT3, 1.f / F_SQRT3); - glScalef(0.333f, 0.333f, 0.333f); + gGL.scalef(0.333f, 0.333f, 0.333f); - glTranslatef(0.f,-camHeightLocal, 0.f); + gGL.translatef(0.f,-camHeightLocal, 0.f); // Draw WL Sky shader->uniform3f("camPosLocal", 0.f, camHeightLocal, 0.f); gSky.mVOWLSkyp->drawDome(); - glPopMatrix(); + gGL.popMatrix(); } void LLDrawPoolWLSky::renderSkyHaze(F32 camHeightLocal) const @@ -197,7 +197,7 @@ void LLDrawPoolWLSky::renderStars(void) const gGL.getTexUnit(0)->bind(gSky.mVOSkyp->getBloomTex()); gGL.pushMatrix(); - glRotatef(gFrameTimeSeconds*0.01f, 0.f, 0.f, 1.f); + gGL.rotatef(gFrameTimeSeconds*0.01f, 0.f, 0.f, 1.f); // gl_FragColor.rgb = gl_Color.rgb; // gl_FragColor.a = gl_Color.a * star_alpha.a; if (LLGLSLShader::sNoFixedFunction) @@ -267,10 +267,6 @@ void LLDrawPoolWLSky::renderHeavenlyBodies() if (gSky.mVOSkyp->getMoon().getDraw() && face->getGeomCount()) { - if (gPipeline.canUseVertexShaders()) - { - gUIProgram.bind(); - } // *NOTE: even though we already bound this texture above for the // stars register combiners, we bind again here for defensive reasons, // since LLImageGL::bind detects that it's a noop, and optimizes it out. @@ -284,12 +280,18 @@ void LLDrawPoolWLSky::renderHeavenlyBodies() color.mV[3] = llclamp(a, 0.f, 1.f); + if (gPipeline.canUseVertexShaders()) + { + gHighlightProgram.bind(); + } + LLFacePool::LLOverrideFaceColor color_override(this, color); + face->renderIndexed(); if (gPipeline.canUseVertexShaders()) { - gUIProgram.unbind(); + gHighlightProgram.unbind(); } } } @@ -315,10 +317,10 @@ void LLDrawPoolWLSky::renderDeferred(S32 pass) renderSkyHaze(camHeightLocal); LLVector3 const & origin = LLViewerCamera::getInstance()->getOrigin(); - glPushMatrix(); + gGL.pushMatrix(); - glTranslatef(origin.mV[0], origin.mV[1], origin.mV[2]); + gGL.translatef(origin.mV[0], origin.mV[1], origin.mV[2]); gDeferredStarProgram.bind(); // *NOTE: have to bind a texture here since register combiners blending in @@ -332,7 +334,7 @@ void LLDrawPoolWLSky::renderDeferred(S32 pass) gDeferredStarProgram.unbind(); - glPopMatrix(); + gGL.popMatrix(); renderSkyClouds(camHeightLocal); @@ -360,9 +362,9 @@ void LLDrawPoolWLSky::render(S32 pass) renderSkyHaze(camHeightLocal); LLVector3 const & origin = LLViewerCamera::getInstance()->getOrigin(); - glPushMatrix(); + gGL.pushMatrix(); - glTranslatef(origin.mV[0], origin.mV[1], origin.mV[2]); + gGL.translatef(origin.mV[0], origin.mV[1], origin.mV[2]); // *NOTE: have to bind a texture here since register combiners blending in // renderStars() requires something to be bound and we might as well only @@ -374,7 +376,7 @@ void LLDrawPoolWLSky::render(S32 pass) renderStars(); - glPopMatrix(); + gGL.popMatrix(); renderSkyClouds(camHeightLocal); diff --git a/indra/newview/lldynamictexture.cpp b/indra/newview/lldynamictexture.cpp index fb9958ee9d..5d6081a35c 100644 --- a/indra/newview/lldynamictexture.cpp +++ b/indra/newview/lldynamictexture.cpp @@ -41,6 +41,7 @@ #include "llviewerdisplay.h" #include "llrender.h" #include "pipeline.h" +#include "llglslshader.h" // static LLViewerDynamicTexture::instance_list_t LLViewerDynamicTexture::sInstances[ LLViewerDynamicTexture::ORDER_COUNT ]; @@ -207,6 +208,9 @@ BOOL LLViewerDynamicTexture::updateAllInstances() return TRUE; } + LLGLSLShader::bindNoShader(); + LLVertexBuffer::unbind(); + BOOL result = FALSE; BOOL ret = FALSE ; for( S32 order = 0; order < ORDER_COUNT; order++ ) diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp index 432e61f6d8..6dbeae6677 100644 --- a/indra/newview/llface.cpp +++ b/indra/newview/llface.cpp @@ -496,14 +496,14 @@ void LLFace::renderSelected(LLViewerTexture *imagep, const LLColor4& color) gGL.pushMatrix(); if (mDrawablep->isActive()) { - glMultMatrixf((GLfloat*)mDrawablep->getRenderMatrix().mMatrix); + gGL.multMatrix((GLfloat*)mDrawablep->getRenderMatrix().mMatrix); } else { - glMultMatrixf((GLfloat*)mDrawablep->getRegion()->mRenderMatrix.mMatrix); + gGL.multMatrix((GLfloat*)mDrawablep->getRegion()->mRenderMatrix.mMatrix); } - glColor4fv(color.mV); + gGL.diffuseColor4fv(color.mV); if (mDrawablep->isState(LLDrawable::RIGGED)) { @@ -515,7 +515,7 @@ void LLFace::renderSelected(LLViewerTexture *imagep, const LLColor4& color) { LLGLEnable offset(GL_POLYGON_OFFSET_FILL); glPolygonOffset(-1.f, -1.f); - glMultMatrixf((F32*) volume->getRelativeXform().mMatrix); + gGL.multMatrix((F32*) volume->getRelativeXform().mMatrix); const LLVolumeFace& vol_face = rigged->getVolumeFace(getTEOffset()); LLVertexBuffer::unbind(); glVertexPointer(3, GL_FLOAT, 16, vol_face.mPositions); @@ -524,6 +524,7 @@ void LLFace::renderSelected(LLViewerTexture *imagep, const LLColor4& color) glEnableClientState(GL_TEXTURE_COORD_ARRAY); glTexCoordPointer(2, GL_FLOAT, 8, vol_face.mTexCoords); } + gGL.syncMatrices(); glDrawElements(GL_TRIANGLES, vol_face.mNumIndices, GL_UNSIGNED_SHORT, vol_face.mIndices); glDisableClientState(GL_TEXTURE_COORD_ARRAY); } @@ -557,17 +558,17 @@ void LLFace::renderSelectedUV() // add green dither pattern on top of red/blue gradient gGL.blendFunc(LLRender::BF_ONE, LLRender::BF_ONE); - glMatrixMode(GL_TEXTURE); - glPushMatrix(); + gGL.matrixMode(LLRender::MM_TEXTURE); + gGL.pushMatrix(); // make green pattern repeat once per texel in red/blue texture - glScalef(256.f, 256.f, 1.f); - glMatrixMode(GL_MODELVIEW); + gGL.scalef(256.f, 256.f, 1.f); + gGL.matrixMode(LLRender::MM_MODELVIEW); renderSelected(green_imagep, LLColor4::white); - glMatrixMode(GL_TEXTURE); - glPopMatrix(); - glMatrixMode(GL_MODELVIEW); + gGL.matrixMode(LLRender::MM_TEXTURE); + gGL.popMatrix(); + gGL.matrixMode(LLRender::MM_MODELVIEW); gGL.blendFunc(LLRender::BF_SOURCE_ALPHA, LLRender::BF_ONE_MINUS_SOURCE_ALPHA); } */ @@ -1055,6 +1056,7 @@ static LLFastTimer::DeclareTimer FTM_FACE_GEOM_POSITION("Position"); static LLFastTimer::DeclareTimer FTM_FACE_GEOM_NORMAL("Normal"); static LLFastTimer::DeclareTimer FTM_FACE_GEOM_TEXTURE("Texture"); static LLFastTimer::DeclareTimer FTM_FACE_GEOM_COLOR("Color"); +static LLFastTimer::DeclareTimer FTM_FACE_GEOM_EMISSIVE("Emissive"); static LLFastTimer::DeclareTimer FTM_FACE_GEOM_WEIGHTS("Weights"); static LLFastTimer::DeclareTimer FTM_FACE_GEOM_BINORMAL("Binormal"); static LLFastTimer::DeclareTimer FTM_FACE_GEOM_INDEX("Index"); @@ -1071,6 +1073,11 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume, S32 num_vertices = (S32)vf.mNumVertices; S32 num_indices = (S32) vf.mNumIndices; + if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_OCTREE)) + { + updateRebuildFlags(); + } + bool map_range = gGLManager.mHasMapBufferRange || gGLManager.mHasFlushBufferRange; if (mVertexBuffer.notNull()) @@ -1124,6 +1131,7 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume, bool rebuild_pos = full_rebuild || mDrawablep->isState(LLDrawable::REBUILD_POSITION); bool rebuild_color = full_rebuild || mDrawablep->isState(LLDrawable::REBUILD_COLOR); + bool rebuild_emissive = rebuild_color && mVertexBuffer->hasDataType(LLVertexBuffer::TYPE_EMISSIVE); bool rebuild_tcoord = full_rebuild || mDrawablep->isState(LLDrawable::REBUILD_TCOORD); bool rebuild_normal = rebuild_pos && mVertexBuffer->hasDataType(LLVertexBuffer::TYPE_NORMAL); bool rebuild_binormal = rebuild_pos && mVertexBuffer->hasDataType(LLVertexBuffer::TYPE_BINORMAL); @@ -1213,7 +1221,7 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume, if (map_range) { - mVertexBuffer->setBuffer(0); + mVertexBuffer->flush(); } } @@ -1438,7 +1446,7 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume, if (map_range) { - mVertexBuffer->setBuffer(0); + mVertexBuffer->flush(); } } else @@ -1585,7 +1593,7 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume, if (map_range) { - mVertexBuffer->setBuffer(0); + mVertexBuffer->flush(); } if (do_bump) @@ -1622,7 +1630,7 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume, if (map_range) { - mVertexBuffer->setBuffer(0); + mVertexBuffer->flush(); } } } @@ -1650,6 +1658,8 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume, while(dst < end); F32 index = (F32) (mTextureIndex < 255 ? mTextureIndex : 0); + + llassert(index <= LLGLSLShader::sIndexedTextureChannels-1); F32 *index_dst = (F32*) vertices; F32 *index_end = (F32*) end; @@ -1672,7 +1682,7 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume, if (map_range) { - mVertexBuffer->setBuffer(0); + mVertexBuffer->flush(); } } @@ -1692,7 +1702,7 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume, if (map_range) { - mVertexBuffer->setBuffer(0); + mVertexBuffer->flush(); } } @@ -1712,7 +1722,7 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume, if (map_range) { - mVertexBuffer->setBuffer(0); + mVertexBuffer->flush(); } } @@ -1724,7 +1734,7 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume, LLVector4a::memcpyNonAliased16((F32*) weights, (F32*) vf.mWeights, num_vertices*4*sizeof(F32)); if (map_range) { - mVertexBuffer->setBuffer(0); + mVertexBuffer->flush(); } } @@ -1754,10 +1764,48 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume, if (map_range) { - mVertexBuffer->setBuffer(0); + mVertexBuffer->flush(); } } + if (rebuild_emissive) + { + LLFastTimer t(FTM_FACE_GEOM_EMISSIVE); + LLStrider<LLColor4U> emissive; + mVertexBuffer->getEmissiveStrider(emissive, mGeomIndex, mGeomCount, map_range); + + U8 glow = (U8) llclamp((S32) (getTextureEntry()->getGlow()*255), 0, 255); + + LLVector4a src; + + + U32 glow32 = glow | + (glow << 8) | + (glow << 16) | + (glow << 24); + + U32 vec[4]; + vec[0] = vec[1] = vec[2] = vec[3] = glow32; + + src.loadua((F32*) vec); + + LLVector4a* dst = (LLVector4a*) emissive.get(); + S32 num_vecs = num_vertices/4; + if (num_vertices%4 > 0) + { + ++num_vecs; + } + + for (S32 i = 0; i < num_vecs; i++) + { + dst[i] = src; + } + + if (map_range) + { + mVertexBuffer->flush(); + } + } if (rebuild_tcoord) { mTexExtents[0].setVec(0,0); @@ -2014,7 +2062,7 @@ BOOL LLFace::verify(const U32* indices_array) const } // First, check whether the face data fits within the pool's range. - if ((mGeomIndex + mGeomCount) > mVertexBuffer->getRequestedVerts()) + if ((mGeomIndex + mGeomCount) > mVertexBuffer->getNumVerts()) { ok = FALSE; llinfos << "Face references invalid vertices!" << llendl; @@ -2033,7 +2081,7 @@ BOOL LLFace::verify(const U32* indices_array) const llinfos << "Face has bogus indices count" << llendl; } - if (mIndicesIndex + mIndicesCount > mVertexBuffer->getRequestedIndices()) + if (mIndicesIndex + mIndicesCount > mVertexBuffer->getNumIndices()) { ok = FALSE; llinfos << "Face references invalid indices!" << llendl; @@ -2095,7 +2143,7 @@ void LLFace::renderSetColor() const { const LLColor4* color = &(getRenderColor()); - glColor4fv(color->mV); + gGL.diffuseColor4fv(color->mV); } } @@ -2130,10 +2178,10 @@ S32 LLFace::renderElements(const U16 *index_array) const } else { - glPushMatrix(); - glMultMatrixf((float*)getRenderMatrix().mMatrix); + gGL.pushMatrix(); + gGL.multMatrix((float*)getRenderMatrix().mMatrix); ret = pushVertices(index_array); - glPopMatrix(); + gGL.popMatrix(); } return ret; diff --git a/indra/newview/llface.h b/indra/newview/llface.h index b5eaeecd60..82e4ab61b7 100644 --- a/indra/newview/llface.h +++ b/indra/newview/llface.h @@ -329,13 +329,9 @@ public: { return lhs->getTexture() < rhs->getTexture(); } - else if (lte->getBumpShinyFullbright() != rte->getBumpShinyFullbright()) - { - return lte->getBumpShinyFullbright() < rte->getBumpShinyFullbright(); - } else { - return lte->getGlow() < rte->getGlow(); + return lte->getBumpShinyFullbright() < rte->getBumpShinyFullbright(); } } }; diff --git a/indra/newview/llfasttimerview.cpp b/indra/newview/llfasttimerview.cpp index a161428c2b..233038daba 100644 --- a/indra/newview/llfasttimerview.cpp +++ b/indra/newview/llfasttimerview.cpp @@ -105,6 +105,7 @@ void LLFastTimerView::onPause() if (!LLFastTimer::sPauseHistory) { mScrollIndex = 0; + LLFastTimer::sResetHistory = true; getChild<LLButton>("pause_btn")->setLabel(getString("pause")); } else @@ -591,6 +592,7 @@ void LLFastTimerView::draw() { mAvgCountTotal = ticks; mMaxCountTotal = ticks; + LLFastTimer::sResetHistory = false; } } @@ -1125,10 +1127,10 @@ void LLFastTimerView::exportCharts(const std::string& base, const std::string& t LLPointer<LLImageRaw> scratch = new LLImageRaw(1024, 512, 3); gGL.pushMatrix(); - glLoadIdentity(); - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glOrtho(-0.05, 1.05, -0.05, 1.05, -1.0, 1.0); + gGL.loadIdentity(); + gGL.matrixMode(LLRender::MM_PROJECTION); + gGL.loadIdentity(); + gGL.ortho(-0.05f, 1.05f, -0.05f, 1.05f, -1.0f, 1.0f); //render charts gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); @@ -1367,7 +1369,7 @@ void LLFastTimerView::exportCharts(const std::string& base, const std::string& t buffer.flush(); gGL.popMatrix(); - glMatrixMode(GL_MODELVIEW); + gGL.matrixMode(LLRender::MM_MODELVIEW); gGL.popMatrix(); } diff --git a/indra/newview/llfavoritesbar.cpp b/indra/newview/llfavoritesbar.cpp index 98de418878..4f2fd47488 100644 --- a/indra/newview/llfavoritesbar.cpp +++ b/indra/newview/llfavoritesbar.cpp @@ -443,17 +443,17 @@ BOOL LLFavoritesBarCtrl::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, { setLandingTab(dest); } - /* - * the condition dest == NULL can be satisfied not only in the case - * of dragging to the right from the last tab of the favbar. there is a - * small gap between each tab. if the user drags something exactly there - * then mLandingTab will be set to NULL and the dragged item will be pushed - * to the end of the favorites bar. this is incorrect behavior. that's why - * we need an additional check which excludes the case described previously - * making sure that the mouse pointer is beyond the last tab. - */ - else if (mLastTab && x >= mLastTab->getRect().mRight) + else if (mLastTab && (x >= mLastTab->getRect().mRight)) { + /* + * the condition dest == NULL can be satisfied not only in the case + * of dragging to the right from the last tab of the favbar. there is a + * small gap between each tab. if the user drags something exactly there + * then mLandingTab will be set to NULL and the dragged item will be pushed + * to the end of the favorites bar. this is incorrect behavior. that's why + * we need an additional check which excludes the case described previously + * making sure that the mouse pointer is beyond the last tab. + */ setLandingTab(NULL); } @@ -467,7 +467,6 @@ BOOL LLFavoritesBarCtrl::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, if (drop) { handleExistingFavoriteDragAndDrop(x, y); - showDragMarker(FALSE); } } else @@ -490,7 +489,6 @@ BOOL LLFavoritesBarCtrl::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, setLandingTab(NULL); } handleNewFavoriteDragAndDrop(item, favorites_id, x, y); - showDragMarker(FALSE); } } } @@ -504,20 +502,29 @@ BOOL LLFavoritesBarCtrl::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, void LLFavoritesBarCtrl::handleExistingFavoriteDragAndDrop(S32 x, S32 y) { + // Identify the button hovered and the side to drop LLFavoriteLandmarkButton* dest = dynamic_cast<LLFavoriteLandmarkButton*>(mLandingTab); + bool insert_before = true; + if (!dest) + { + insert_before = false; + dest = dynamic_cast<LLFavoriteLandmarkButton*>(mLastTab); + } - // there is no need to handle if an item was dragged onto itself + // There is no need to handle if an item was dragged onto itself if (dest && dest->getLandmarkId() == mDragItemId) { return; } + // Insert the dragged item in the right place if (dest) { - LLInventoryModel::updateItemsOrder(mItems, mDragItemId, dest->getLandmarkId()); + LLInventoryModel::updateItemsOrder(mItems, mDragItemId, dest->getLandmarkId(), insert_before); } else { + // This can happen when the item list is empty mItems.push_back(gInventory.getItem(mDragItemId)); } @@ -534,22 +541,35 @@ void LLFavoritesBarCtrl::handleExistingFavoriteDragAndDrop(S32 x, S32 y) void LLFavoritesBarCtrl::handleNewFavoriteDragAndDrop(LLInventoryItem *item, const LLUUID& favorites_id, S32 x, S32 y) { - LLFavoriteLandmarkButton* dest = dynamic_cast<LLFavoriteLandmarkButton*>(mLandingTab); - - // there is no need to handle if an item was dragged onto itself + // Identify the button hovered and the side to drop + LLFavoriteLandmarkButton* dest = NULL; + bool insert_before = true; + if (!mItems.empty()) + { + dest = dynamic_cast<LLFavoriteLandmarkButton*>(mLandingTab); + if (!dest) + { + insert_before = false; + dest = dynamic_cast<LLFavoriteLandmarkButton*>(mLastTab); + } + } + + // There is no need to handle if an item was dragged onto itself if (dest && dest->getLandmarkId() == mDragItemId) { return; } - + LLPointer<LLViewerInventoryItem> viewer_item = new LLViewerInventoryItem(item); + // Insert the dragged item in the right place if (dest) { - insertBeforeItem(mItems, dest->getLandmarkId(), viewer_item); + insertItem(mItems, dest->getLandmarkId(), viewer_item, insert_before); } else { + // This can happen when the item list is empty mItems.push_back(viewer_item); } @@ -579,7 +599,11 @@ void LLFavoritesBarCtrl::handleNewFavoriteDragAndDrop(LLInventoryItem *item, con if (tool_dad->getSource() == LLToolDragAndDrop::SOURCE_NOTECARD) { viewer_item->setType(LLAssetType::AT_LANDMARK); - copy_inventory_from_notecard(tool_dad->getObjectID(), tool_dad->getSourceID(), viewer_item.get(), gInventoryCallbacks.registerCB(cb)); + copy_inventory_from_notecard(favorites_id, + tool_dad->getObjectID(), + tool_dad->getSourceID(), + viewer_item.get(), + gInventoryCallbacks.registerCB(cb)); } else { @@ -642,7 +666,7 @@ void LLFavoritesBarCtrl::draw() { // mouse pointer hovers over an existing tab LLRect rect = mLandingTab->getRect(); - mImageDragIndication->draw(rect.mLeft - w/2, rect.getHeight(), w, h); + mImageDragIndication->draw(rect.mLeft, rect.getHeight(), w, h); } else if (mLastTab) { @@ -650,6 +674,8 @@ void LLFavoritesBarCtrl::draw() LLRect rect = mLastTab->getRect(); mImageDragIndication->draw(rect.mRight, rect.getHeight(), w, h); } + // Once drawn, mark this false so we won't draw it again (unless we hit the favorite bar again) + mShowDragMarker = FALSE; } } @@ -721,7 +747,7 @@ void LLFavoritesBarCtrl::updateButtons() if (first_changed_item_index <= mItems.count()) { // Rebuild the buttons only - // child_list_t is a linked list, so safe to erase from the middle if we pre-incrament the iterator + // child_list_t is a linked list, so safe to erase from the middle if we pre-increment the iterator while (child_it != childs->end()) { @@ -810,9 +836,9 @@ LLButton* LLFavoritesBarCtrl::createButton(const LLPointer<LLViewerInventoryItem /** * WORKAROUND: - * there are some problem with displaying of fonts in buttons. - * Empty space (or ...) is displaying instead of last symbols, even though the width of the button is enough. - * Problem will gone, if we stretch out the button. For that reason I have to put additional 20 pixels. + * There are some problem with displaying of fonts in buttons. + * Empty space or ellipsis might be displayed instead of last symbols, even though the width of the button is enough. + * The problem disappears if we pad the button with 20 pixels. */ int required_width = mFont->getWidth(item->getName()) + 20; int width = required_width > def_button_width? def_button_width : required_width; @@ -840,7 +866,6 @@ LLButton* LLFavoritesBarCtrl::createButton(const LLPointer<LLViewerInventoryItem fav_btn->setRect(butt_rect); // change only left and save bottom fav_btn->setFont(mFont); - fav_btn->setName(item->getName()); fav_btn->setLabel(item->getName()); fav_btn->setToolTip(item->getName()); fav_btn->setCommitCallback(boost::bind(&LLFavoritesBarCtrl::onButtonClick, this, item->getUUID())); @@ -995,7 +1020,9 @@ void LLFavoritesBarCtrl::addOpenLandmarksMenuItem(LLToggleableMenu* menu) LLMenuItemCallGL::Params item_params; item_params.name("open_my_landmarks"); item_params.label(translated ? label_transl: label_untrans); - item_params.on_click.function(boost::bind(&LLFloaterSidePanelContainer::showPanel, "places", LLSD())); + LLSD key; + key["type"] = "open_landmark_tab"; + item_params.on_click.function(boost::bind(&LLFloaterSidePanelContainer::showPanel, "places", key)); LLMenuItemCallGL* menu_item = LLUICtrlFactory::create<LLMenuItemCallGL>(item_params); fitLabelWidth(menu_item); @@ -1176,7 +1203,9 @@ void LLFavoritesBarCtrl::doToSelected(const LLSD& userdata) LLToggleableMenu* menu = (LLToggleableMenu*) mOverflowMenuHandle.get(); if (mRestoreOverflowMenu && menu && !menu->getVisible()) { + menu->resetScrollPositionOnShow(false); showDropDownMenu(); + menu->resetScrollPositionOnShow(true); } } @@ -1298,25 +1327,24 @@ BOOL LLFavoritesBarCtrl::handleHover(S32 x, S32 y, MASK mask) LLUICtrl* LLFavoritesBarCtrl::findChildByLocalCoords(S32 x, S32 y) { - LLUICtrl* ctrl = 0; - S32 screenX, screenY; + LLUICtrl* ctrl = NULL; const child_list_t* list = getChildList(); - localPointToScreen(x, y, &screenX, &screenY); - - // look for a child which contains the point (screenX, screenY) in it's rectangle for (child_list_const_iter_t i = list->begin(); i != list->end(); ++i) { - LLRect rect; - localRectToScreen((*i)->getRect(), &rect); - - if (rect.pointInRect(screenX, screenY)) + // Look only for children that are favorite buttons + if ((*i)->getName() == "favorites_bar_btn") { - ctrl = dynamic_cast<LLUICtrl*>(*i); - break; + LLRect rect = (*i)->getRect(); + // We consider a button hit if the cursor is left of the right side + // This makes the hit a bit less finicky than hitting directly on the button itself + if (x <= rect.mRight) + { + ctrl = dynamic_cast<LLUICtrl*>(*i); + break; + } } } - return ctrl; } @@ -1337,29 +1365,28 @@ BOOL LLFavoritesBarCtrl::needToSaveItemsOrder(const LLInventoryModel::item_array return result; } -LLInventoryModel::item_array_t::iterator LLFavoritesBarCtrl::findItemByUUID(LLInventoryModel::item_array_t& items, const LLUUID& id) +void LLFavoritesBarCtrl::insertItem(LLInventoryModel::item_array_t& items, const LLUUID& dest_item_id, LLViewerInventoryItem* insertedItem, bool insert_before) { - LLInventoryModel::item_array_t::iterator result = items.end(); + // Get the iterator to the destination item + LLInventoryModel::item_array_t::iterator it_dest = LLInventoryModel::findItemIterByUUID(items, dest_item_id); + if (it_dest == items.end()) + return; - for (LLInventoryModel::item_array_t::iterator i = items.begin(); i != items.end(); ++i) + // Go to the next element if one wishes to insert after the dest element + if (!insert_before) { - if ((*i)->getUUID() == id) - { - result = i; - break; - } + ++it_dest; } - - return result; -} - -void LLFavoritesBarCtrl::insertBeforeItem(LLInventoryModel::item_array_t& items, const LLUUID& beforeItemId, LLViewerInventoryItem* insertedItem) -{ - LLViewerInventoryItem* beforeItem = gInventory.getItem(beforeItemId); - llassert(beforeItem); - if (beforeItem) + + // Insert the source item in the right place + if (it_dest != items.end()) + { + items.insert(it_dest, insertedItem); + } + else { - items.insert(findItemByUUID(items, beforeItem->getUUID()), insertedItem); + // Append to the list if it_dest reached the end + items.push_back(insertedItem); } } diff --git a/indra/newview/llfavoritesbar.h b/indra/newview/llfavoritesbar.h index 1b11d6196e..2f75b3bb0e 100644 --- a/indra/newview/llfavoritesbar.h +++ b/indra/newview/llfavoritesbar.h @@ -130,7 +130,7 @@ private: * inserts an item identified by insertedItemId BEFORE an item identified by beforeItemId. * this function assumes that an item identified by insertedItemId doesn't exist in items array. */ - void insertBeforeItem(LLInventoryModel::item_array_t& items, const LLUUID& beforeItemId, LLViewerInventoryItem* insertedItem); + void insertItem(LLInventoryModel::item_array_t& items, const LLUUID& dest_item_id, LLViewerInventoryItem* insertedItem, bool insert_before); // finds an item by it's UUID in the items array LLInventoryModel::item_array_t::iterator findItemByUUID(LLInventoryModel::item_array_t& items, const LLUUID& id); diff --git a/indra/newview/llfeaturemanager.cpp b/indra/newview/llfeaturemanager.cpp index db9a0424c0..08f9d26705 100644 --- a/indra/newview/llfeaturemanager.cpp +++ b/indra/newview/llfeaturemanager.cpp @@ -51,6 +51,7 @@ #include "llcontrol.h" #include "llboost.h" #include "llweb.h" +#include "llviewershadermgr.h" #if LL_WINDOWS #include "lldxhardware.h" @@ -662,8 +663,10 @@ void LLFeatureManager::applyFeatures(bool skipFeatures) void LLFeatureManager::setGraphicsLevel(S32 level, bool skipFeatures) { - applyBaseMasks(); + LLViewerShaderMgr::sSkipReload = true; + applyBaseMasks(); + switch (level) { case 0: @@ -684,6 +687,9 @@ void LLFeatureManager::setGraphicsLevel(S32 level, bool skipFeatures) } applyFeatures(skipFeatures); + + LLViewerShaderMgr::sSkipReload = false; + LLViewerShaderMgr::instance()->setShaders(); } void LLFeatureManager::applyBaseMasks() @@ -725,7 +731,7 @@ void LLFeatureManager::applyBaseMasks() { maskFeatures("NoPixelShaders"); } - if (!gGLManager.mHasVertexShader) + if (!gGLManager.mHasVertexShader || !mGPUSupported) { maskFeatures("NoVertexShaders"); } diff --git a/indra/newview/llfloaterabout.cpp b/indra/newview/llfloaterabout.cpp index 22f500ba15..83fb887d81 100644 --- a/indra/newview/llfloaterabout.cpp +++ b/indra/newview/llfloaterabout.cpp @@ -384,6 +384,9 @@ void LLFloaterAbout::setSupportText(const std::string& server_release_notes_url) // Render the LLSD from getInfo() as a format_map_t LLStringUtil::format_map_t args; + // allow the "Release Notes" URL label to be localized + args["ReleaseNotes"] = LLTrans::getString("ReleaseNotes"); + for (LLSD::map_const_iterator ii(info.beginMap()), iend(info.endMap()); ii != iend; ++ii) { diff --git a/indra/newview/llfloateranimpreview.cpp b/indra/newview/llfloateranimpreview.cpp index 1f334815d6..2a3512e21a 100644 --- a/indra/newview/llfloateranimpreview.cpp +++ b/indra/newview/llfloateranimpreview.cpp @@ -1063,14 +1063,19 @@ BOOL LLPreviewAnimation::render() mNeedsUpdate = FALSE; LLVOAvatar* avatarp = mDummyAvatar; - glMatrixMode(GL_PROJECTION); + gGL.matrixMode(LLRender::MM_PROJECTION); gGL.pushMatrix(); - glLoadIdentity(); - glOrtho(0.0f, mFullWidth, 0.0f, mFullHeight, -1.0f, 1.0f); + gGL.loadIdentity(); + gGL.ortho(0.0f, mFullWidth, 0.0f, mFullHeight, -1.0f, 1.0f); - glMatrixMode(GL_MODELVIEW); + gGL.matrixMode(LLRender::MM_MODELVIEW); gGL.pushMatrix(); - glLoadIdentity(); + gGL.loadIdentity(); + + if (LLGLSLShader::sNoFixedFunction) + { + gUIProgram.bind(); + } LLGLSUIDefault def; gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); @@ -1078,10 +1083,10 @@ BOOL LLPreviewAnimation::render() gl_rect_2d_simple( mFullWidth, mFullHeight ); - glMatrixMode(GL_PROJECTION); + gGL.matrixMode(LLRender::MM_PROJECTION); gGL.popMatrix(); - glMatrixMode(GL_MODELVIEW); + gGL.matrixMode(LLRender::MM_MODELVIEW); gGL.popMatrix(); gGL.flush(); diff --git a/indra/newview/llfloatercamera.cpp b/indra/newview/llfloatercamera.cpp index b33dea4890..21b58d3e3d 100644 --- a/indra/newview/llfloatercamera.cpp +++ b/indra/newview/llfloatercamera.cpp @@ -346,7 +346,7 @@ LLFloaterCamera::LLFloaterCamera(const LLSD& val) mCurrMode(CAMERA_CTRL_MODE_PAN), mPrevMode(CAMERA_CTRL_MODE_PAN) { - LLHints::registerHintTarget("view_popup", LLView::getHandle()); + LLHints::registerHintTarget("view_popup", getHandle()); mCommitCallbackRegistrar.add("CameraPresets.ChangeView", boost::bind(&LLFloaterCamera::onClickCameraItem, _2)); } @@ -433,26 +433,6 @@ void LLFloaterCamera::setMode(ECameraControlMode mode) updateState(); } -void LLFloaterCamera::setModeTitle(const ECameraControlMode mode) -{ - std::string title; - switch(mode) - { - case CAMERA_CTRL_MODE_MODES: - title = getString("camera_modes_title"); - break; - case CAMERA_CTRL_MODE_PAN: - title = getString("pan_mode_title"); - break; - case CAMERA_CTRL_MODE_PRESETS: - title = getString("presets_mode_title"); - break; - default: - break; - } - setTitle(title); -} - void LLFloaterCamera::switchMode(ECameraControlMode mode) { setMode(mode); @@ -532,7 +512,6 @@ void LLFloaterCamera::updateState() { iter->second->setToggleState(iter->first == mCurrMode); } - setModeTitle(mCurrMode); } void LLFloaterCamera::updateItemsSelection() diff --git a/indra/newview/llfloatercamera.h b/indra/newview/llfloatercamera.h index 4572932853..4d6d03f22d 100644 --- a/indra/newview/llfloatercamera.h +++ b/indra/newview/llfloatercamera.h @@ -102,9 +102,6 @@ private: /* sets a new mode preserving previous one and updates ui*/ void setMode(ECameraControlMode mode); - /** set title appropriate to passed mode */ - void setModeTitle(const ECameraControlMode mode); - /* updates the state (UI) according to the current mode */ void updateState(); diff --git a/indra/newview/llfloaterchat.cpp b/indra/newview/llfloaterchat.cpp deleted file mode 100644 index 2679dbb78b..0000000000 --- a/indra/newview/llfloaterchat.cpp +++ /dev/null @@ -1,485 +0,0 @@ -/** - * @file llfloaterchat.cpp - * @brief LLFloaterChat class implementation - * - * $LicenseInfo:firstyear=2002&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2010, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -/** - * Actually the "Chat History" floater. - * Should be llfloaterchathistory, not llfloaterchat. - */ - -#include "llviewerprecompiledheaders.h" - -// project include -#include "llagent.h" -#include "llappviewer.h" -#include "llbutton.h" -#include "llcheckboxctrl.h" -#include "llcombobox.h" -#include "llconsole.h" -#include "llfloateractivespeakers.h" -#include "llfloaterchatterbox.h" -#include "llfloaterreg.h" -#include "llfloaterscriptdebug.h" -#include "llkeyboard.h" -//#include "lllineeditor.h" -#include "llmutelist.h" -//#include "llresizehandle.h" -#include "llchatbar.h" -#include "llrecentpeople.h" -#include "llpanelblockedlist.h" -#include "llslurl.h" -#include "llstatusbar.h" -#include "llviewertexteditor.h" -#include "llviewergesture.h" // for triggering gestures -#include "llviewermessage.h" -#include "llviewerwindow.h" -#include "llviewercontrol.h" -#include "lluictrlfactory.h" -#include "lllogchat.h" -#include "lltexteditor.h" -#include "lltextparser.h" -#include "llweb.h" -#include "llstylemap.h" - -// linden library includes -#include "llaudioengine.h" -#include "llchat.h" -#include "llfontgl.h" -#include "llrect.h" -#include "llerror.h" -#include "llstring.h" -#include "llwindow.h" -#include "message.h" - -// -// Constants -// -const F32 INSTANT_MSG_SIZE = 8.0f; -const F32 CHAT_MSG_SIZE = 8.0f; - - -// -// Global statics -// -LLColor4 get_text_color(const LLChat& chat); - -// -// Member Functions -// -LLFloaterChat::LLFloaterChat(const LLSD& seed) - : LLFloater(seed), - mPanel(NULL) -{ - mFactoryMap["chat_panel"] = LLCallbackMap(createChatPanel, NULL); - mFactoryMap["active_speakers_panel"] = LLCallbackMap(createSpeakersPanel, NULL); - //Called from floater reg: LLUICtrlFactory::getInstance()->buildFloater(this,"floater_chat_history.xml"); - -} - -LLFloaterChat::~LLFloaterChat() -{ - // Children all cleaned up by default view destructor. -} - -void LLFloaterChat::draw() -{ - // enable say and shout only when text available - - childSetValue("toggle_active_speakers_btn", childIsVisible("active_speakers_panel")); - - LLChatBar* chat_barp = findChild<LLChatBar>("chat_panel", TRUE); - if (chat_barp) - { - chat_barp->refresh(); - } - - mPanel->refreshSpeakers(); - LLFloater::draw(); -} - -BOOL LLFloaterChat::postBuild() -{ - // Hide the chat overlay when our history is visible. - setVisibleCallback(boost::bind(&LLFloaterChat::updateConsoleVisibility, this)); - - mPanel = (LLPanelActiveSpeakers*)getChild<LLPanel>("active_speakers_panel"); - - childSetCommitCallback("show mutes",onClickToggleShowMute,this); //show mutes - childSetVisible("Chat History Editor with mute",FALSE); - childSetAction("toggle_active_speakers_btn", onClickToggleActiveSpeakers, this); - - return TRUE; -} - -void LLFloaterChat::updateConsoleVisibility() -{ - if(gDisconnected) - { - return; - } - // determine whether we should show console due to not being visible - gConsole->setVisible( !isInVisibleChain() // are we not in part of UI being drawn? - || isMinimized() // are we minimized? - || (getHost() && getHost()->isMinimized() )); // are we hosted in a minimized floater? -} - -void add_timestamped_line(LLViewerTextEditor* edit, LLChat chat, const LLColor4& color) -{ - std::string line = chat.mText; - bool prepend_newline = true; - if (gSavedSettings.getBOOL("ChatShowTimestamps")) - { - edit->appendTime(prepend_newline); - prepend_newline = false; - } - - // If the msg is from an agent (not yourself though), - // extract out the sender name and replace it with the hotlinked name. - if (chat.mSourceType == CHAT_SOURCE_AGENT && - chat.mFromID != LLUUID::null) - { - chat.mURL = LLSLURL("agent", chat.mFromID, "inspect").getSLURLString(); - } - - // If the chat line has an associated url, link it up to the name. - if (!chat.mURL.empty() - && (line.length() > chat.mFromName.length() && line.find(chat.mFromName,0) == 0)) - { - std::string start_line = line.substr(0, chat.mFromName.length() + 1); - line = line.substr(chat.mFromName.length() + 1); - edit->appendText(start_line, prepend_newline, LLStyleMap::instance().lookup(chat.mFromID,chat.mURL)); - edit->blockUndo(); - prepend_newline = false; - } - edit->appendText(line, prepend_newline, LLStyle::Params().color(color)); - edit->blockUndo(); -} - -// static -void LLFloaterChat::addChatHistory(const LLChat& chat, bool log_to_file) -{ - if (log_to_file && (gSavedPerAccountSettings.getBOOL("LogChat"))) - { - if (chat.mChatType != CHAT_TYPE_WHISPER && chat.mChatType != CHAT_TYPE_SHOUT) - { - LLLogChat::saveHistory("chat", chat.mFromName, chat.mFromID, chat.mText); - } - else - { - LLLogChat::saveHistory("chat", "", chat.mFromID, chat.mFromName + " " + chat.mText); - } - } - - LLColor4 color = get_text_color(chat); - - if (!log_to_file) color = LLColor4::grey; //Recap from log file. - - if (chat.mChatType == CHAT_TYPE_DEBUG_MSG) - { - if(gSavedSettings.getBOOL("ShowScriptErrors") == FALSE) - return; - if (gSavedSettings.getS32("ShowScriptErrorsLocation") == 1) - { - LLFloaterScriptDebug::addScriptLine(chat.mText, - chat.mFromName, - color, - chat.mFromID); - return; - } - } - - // could flash the chat button in the status bar here. JC - LLFloaterChat* chat_floater = LLFloaterChat::getInstance(); - LLViewerTextEditor* history_editor = chat_floater->getChild<LLViewerTextEditor>("Chat History Editor"); - LLViewerTextEditor* history_editor_with_mute = chat_floater->getChild<LLViewerTextEditor>("Chat History Editor with mute"); - - if (!chat.mMuted) - { - add_timestamped_line(history_editor, chat, color); - add_timestamped_line(history_editor_with_mute, chat, color); - } - else - { - // desaturate muted chat - LLColor4 muted_color = lerp(color, LLColor4::grey, 0.5f); - add_timestamped_line(history_editor_with_mute, chat, color); - } - - // add objects as transient speakers that can be muted - if (chat.mSourceType == CHAT_SOURCE_OBJECT) - { - chat_floater->mPanel->setSpeaker(chat.mFromID, chat.mFromName, LLSpeaker::STATUS_NOT_IN_CHANNEL, LLSpeaker::SPEAKER_OBJECT); - } - - // start tab flashing on incoming text from other users (ignoring system text, etc) - if (!chat_floater->isInVisibleChain() && chat.mSourceType == CHAT_SOURCE_AGENT) - { - LLFloaterChatterBox::getInstance()->setFloaterFlashing(chat_floater, TRUE); - } -} - -// static -void LLFloaterChat::setHistoryCursorAndScrollToEnd() -{ - LLViewerTextEditor* history_editor = LLFloaterChat::getInstance()->getChild<LLViewerTextEditor>("Chat History Editor"); - LLViewerTextEditor* history_editor_with_mute = LLFloaterChat::getInstance()->getChild<LLViewerTextEditor>("Chat History Editor with mute"); - - if (history_editor) - { - history_editor->setCursorAndScrollToEnd(); - } - if (history_editor_with_mute) - { - history_editor_with_mute->setCursorAndScrollToEnd(); - } -} - - -//static -void LLFloaterChat::onClickMute(void *data) -{ - LLFloaterChat* self = (LLFloaterChat*)data; - - LLComboBox* chatter_combo = self->getChild<LLComboBox>("chatter combobox"); - - const std::string& name = chatter_combo->getSimple(); - LLUUID id = chatter_combo->getCurrentID(); - - if (name.empty()) return; - - LLMute mute(id); - mute.setFromDisplayName(name); - LLMuteList::getInstance()->add(mute); - LLPanelBlockedList::showPanelAndSelect(mute.mID); -} - -//static -void LLFloaterChat::onClickToggleShowMute(LLUICtrl* caller, void *data) -{ - LLFloaterChat* floater = (LLFloaterChat*)data; - - - //LLCheckBoxCtrl* - BOOL show_mute = floater->getChild<LLCheckBoxCtrl>("show mutes")->get(); - LLViewerTextEditor* history_editor = floater->getChild<LLViewerTextEditor>("Chat History Editor"); - LLViewerTextEditor* history_editor_with_mute = floater->getChild<LLViewerTextEditor>("Chat History Editor with mute"); - - if (!history_editor || !history_editor_with_mute) - return; - - //BOOL show_mute = floater->mShowMuteCheckBox->get(); - if (show_mute) - { - history_editor->setVisible(FALSE); - history_editor_with_mute->setVisible(TRUE); - history_editor_with_mute->setCursorAndScrollToEnd(); - } - else - { - history_editor->setVisible(TRUE); - history_editor_with_mute->setVisible(FALSE); - history_editor->setCursorAndScrollToEnd(); - } -} - -// Put a line of chat in all the right places -void LLFloaterChat::addChat(const LLChat& chat, BOOL local_agent) -{ - triggerAlerts(chat.mText); - - // Add the sender to the list of people with which we've recently interacted. - // this is not the best place to add _all_ messages to recent list - // comment this for now, may remove later on code cleanup - //if(chat.mSourceType == CHAT_SOURCE_AGENT && chat.mFromID.notNull()) - // LLRecentPeople::instance().add(chat.mFromID); - - addChatHistory(chat, true); -} - -// Moved from lltextparser.cpp to break llui/llaudio library dependency. -//static -void LLFloaterChat::triggerAlerts(const std::string& text) -{ - LLTextParser* parser = LLTextParser::getInstance(); -// bool spoken=FALSE; - for (S32 i=0;i<parser->mHighlights.size();i++) - { - LLSD& highlight = parser->mHighlights[i]; - if (parser->findPattern(text,highlight) >= 0 ) - { - if(gAudiop) - { - if ((std::string)highlight["sound_lluuid"] != LLUUID::null.asString()) - { - gAudiop->triggerSound(highlight["sound_lluuid"].asUUID(), - gAgent.getID(), - 1.f, - LLAudioEngine::AUDIO_TYPE_UI, - gAgent.getPositionGlobal() ); - } -/* - if (!spoken) - { - LLTextToSpeech* text_to_speech = NULL; - text_to_speech = LLTextToSpeech::getInstance(); - spoken = text_to_speech->speak((LLString)highlight["voice"],text); - } - */ - } - if (highlight["flash"]) - { - LLWindow* viewer_window = gViewerWindow->getWindow(); - if (viewer_window && viewer_window->getMinimized()) - { - viewer_window->flashIcon(5.f); - } - } - } - } -} - -LLColor4 get_text_color(const LLChat& chat) -{ - LLColor4 text_color; - - if(chat.mMuted) - { - text_color.setVec(0.8f, 0.8f, 0.8f, 1.f); - } - else - { - switch(chat.mSourceType) - { - case CHAT_SOURCE_SYSTEM: - text_color = LLUIColorTable::instance().getColor("SystemChatColor"); - break; - case CHAT_SOURCE_AGENT: - if (chat.mFromID.isNull()) - { - text_color = LLUIColorTable::instance().getColor("SystemChatColor"); - } - else - { - if(gAgent.getID() == chat.mFromID) - { - text_color = LLUIColorTable::instance().getColor("UserChatColor"); - } - else - { - text_color = LLUIColorTable::instance().getColor("AgentChatColor"); - } - } - break; - case CHAT_SOURCE_OBJECT: - if (chat.mChatType == CHAT_TYPE_DEBUG_MSG) - { - text_color = LLUIColorTable::instance().getColor("ScriptErrorColor"); - } - else if ( chat.mChatType == CHAT_TYPE_OWNER ) - { - text_color = LLUIColorTable::instance().getColor("llOwnerSayChatColor"); - } - else - { - text_color = LLUIColorTable::instance().getColor("ObjectChatColor"); - } - break; - default: - text_color.setToWhite(); - } - - if (!chat.mPosAgent.isExactlyZero()) - { - LLVector3 pos_agent = gAgent.getPositionAgent(); - F32 distance_squared = dist_vec_squared(pos_agent, chat.mPosAgent); - F32 dist_near_chat = gAgent.getNearChatRadius(); - if (distance_squared > dist_near_chat * dist_near_chat) - { - // diminish far-off chat - text_color.mV[VALPHA] = 0.8f; - } - } - } - - return text_color; -} - -//static -void LLFloaterChat::loadHistory() -{ - LLLogChat::loadHistory(std::string("chat"), &chatFromLogFile, (void *)LLFloaterChat::getInstance()); -} - -//static -void LLFloaterChat::chatFromLogFile(LLLogChat::ELogLineType type , const LLSD& line, void* userdata) -{ - switch (type) - { - case LLLogChat::LOG_EMPTY: - case LLLogChat::LOG_END: - // *TODO: nice message from XML file here - break; - case LLLogChat::LOG_LINE: - case LLLogChat::LOG_LLSD: - { - LLChat chat; - chat.mText = line["message"].asString(); - get_text_color(chat); - addChatHistory(chat, FALSE); - } - break; - default: - // nothing - break; - } -} - -//static -void* LLFloaterChat::createSpeakersPanel(void* data) -{ - return new LLPanelActiveSpeakers(LLLocalSpeakerMgr::getInstance(), TRUE); -} - -//static -void* LLFloaterChat::createChatPanel(void* data) -{ - LLChatBar* chatp = new LLChatBar(); - return chatp; -} - -// static -void LLFloaterChat::onClickToggleActiveSpeakers(void* userdata) -{ - LLFloaterChat* self = (LLFloaterChat*)userdata; - - self->childSetVisible("active_speakers_panel", !self->childIsVisible("active_speakers_panel")); -} - -//static - LLFloaterChat* LLFloaterChat::getInstance() - { - return LLFloaterReg::getTypedInstance<LLFloaterChat>("chat", LLSD()) ; - - } diff --git a/indra/newview/llfloaterchat.h b/indra/newview/llfloaterchat.h deleted file mode 100644 index fb2aabbfdf..0000000000 --- a/indra/newview/llfloaterchat.h +++ /dev/null @@ -1,78 +0,0 @@ -/** - * @file llfloaterchat.h - * @brief LLFloaterChat class definition - * - * $LicenseInfo:firstyear=2002&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2010, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -/* - * Actually the "Chat History" floater. - * Should be llfloaterchathistory, not llfloaterchat. - */ - -#ifndef LL_LLFLOATERCHAT_H -#define LL_LLFLOATERCHAT_H - -#include "llfloater.h" -#include "lllogchat.h" - -class LLChat; -class LLPanelActiveSpeakers; -class LLLogChat; - -class LLFloaterChat : public LLFloater -{ -public: - LLFloaterChat(const LLSD& seed); - ~LLFloaterChat(); - - virtual void draw(); - virtual BOOL postBuild(); - - void updateConsoleVisibility(); - - static void setHistoryCursorAndScrollToEnd(); - - // *TODO:Skinning - move these to LLChat (or LLViewerChat?) - // Add chat to console and history list. - // Color based on source, type, distance. - static void addChat(const LLChat& chat, BOOL local_agent = FALSE); - // Add chat to history alone. - static void addChatHistory(const LLChat& chat, bool log_to_file = true); - - static void triggerAlerts(const std::string& text); - - static void onClickMute(void *data); - static void onClickToggleShowMute(LLUICtrl* caller, void *data); - static void onClickToggleActiveSpeakers(void* userdata); - static void chatFromLogFile(LLLogChat::ELogLineType type, const LLSD& line, void* userdata); - static void loadHistory(); - static void* createSpeakersPanel(void* data); - static void* createChatPanel(void* data); - - static LLFloaterChat* getInstance(); // *TODO:Skinning Deprecate - - LLPanelActiveSpeakers* mPanel; - BOOL mScrolledToEnd; -}; - -#endif diff --git a/indra/newview/llfloaterchatterbox.cpp b/indra/newview/llfloaterchatterbox.cpp deleted file mode 100644 index dc33e45dd4..0000000000 --- a/indra/newview/llfloaterchatterbox.cpp +++ /dev/null @@ -1,344 +0,0 @@ -/** - * @file llfloaterchatterbox.cpp - * @author Richard - * @date 2007-05-08 - * @brief Implementation of the chatterbox integrated conversation ui - * - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2010, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - - -#include "llviewerprecompiledheaders.h" - -#include "llfloaterreg.h" -#include "llfloaterchatterbox.h" -#include "lluictrlfactory.h" -#include "llfloaterfriends.h" -#include "llfloatergroups.h" -#include "llviewercontrol.h" -#include "llvoicechannel.h" -#include "llimpanel.h" -#include "llimview.h" - -// -// LLFloaterMyFriends -// - -LLFloaterMyFriends::LLFloaterMyFriends(const LLSD& seed) - : LLFloater(seed) -{ - mFactoryMap["friends_panel"] = LLCallbackMap(LLFloaterMyFriends::createFriendsPanel, NULL); - mFactoryMap["groups_panel"] = LLCallbackMap(LLFloaterMyFriends::createGroupsPanel, NULL); - //Called from floater reg: LLUICtrlFactory::getInstance()->buildFloater(this, "floater_my_friends.xml"); -} - -LLFloaterMyFriends::~LLFloaterMyFriends() -{ -} - -BOOL LLFloaterMyFriends::postBuild() -{ - return TRUE; -} - -void LLFloaterMyFriends::onOpen(const LLSD& key) -{ - if (key.asString() == "friends") - { - childShowTab("friends_and_groups", "friends_panel"); - } - else if (key.asString() == "groups") - { - childShowTab("friends_and_groups", "groups_panel"); - } -} - -//static -void* LLFloaterMyFriends::createFriendsPanel(void* data) -{ - return new LLPanelFriends(); -} - -//static -void* LLFloaterMyFriends::createGroupsPanel(void* data) -{ - return new LLPanelGroups(); -} - -//static -LLFloaterMyFriends* LLFloaterMyFriends::getInstance() -{ - return LLFloaterReg::getTypedInstance<LLFloaterMyFriends>("contacts", "friends") ; -} - -// -// LLFloaterChatterBox -// -LLFloaterChatterBox::LLFloaterChatterBox(const LLSD& seed) -: LLMultiFloater(seed), - mActiveVoiceFloater(NULL) -{ - mAutoResize = FALSE; - - //Called from floater reg: LLUICtrlFactory::getInstance()->buildFloater(this, "floater_chatterbox.xml", FALSE); -} - -LLFloaterChatterBox::~LLFloaterChatterBox() -{ -} - -BOOL LLFloaterChatterBox::postBuild() -{ - setVisibleCallback(boost::bind(&LLFloaterChatterBox::onVisibilityChange, this, _2)); - - if (gSavedSettings.getBOOL("ContactsTornOff")) - { - LLFloaterMyFriends* floater_contacts = LLFloaterMyFriends::getInstance(); - if(floater_contacts) - { - // add then remove to set up relationship for re-attach - addFloater(floater_contacts, FALSE); - removeFloater(floater_contacts); - // reparent to floater view - gFloaterView->addChild(floater_contacts); - } - } - else - { - addFloater(LLFloaterMyFriends::getInstance(), TRUE); - } - - mTabContainer->lockTabs(); - return TRUE; -} - -BOOL LLFloaterChatterBox::handleKeyHere(KEY key, MASK mask) -{ - if (key == 'W' && mask == MASK_CONTROL) - { - LLFloater* floater = getActiveFloater(); - // is user closeable and is system closeable - if (floater && floater->canClose()) - { - if (floater->isCloseable()) - { - floater->closeFloater(); - } - else - { - // close chatterbox window if frontmost tab is reserved, non-closeable tab - // such as contacts or near me - closeFloater(); - } - } - return TRUE; - } - - return LLMultiFloater::handleKeyHere(key, mask); -} - -void LLFloaterChatterBox::draw() -{ - // clear new im notifications when chatterbox is visible - if (!isMinimized()) - { - gIMMgr->clearNewIMNotification(); - } - LLFloater* current_active_floater = getCurrentVoiceFloater(); - // set icon on tab for floater currently associated with active voice channel - if(mActiveVoiceFloater != current_active_floater) - { - // remove image from old floater's tab - if (mActiveVoiceFloater) - { - mTabContainer->setTabImage(mActiveVoiceFloater, ""); - } - } - - // update image on current active tab - if (current_active_floater) - { - LLColor4 icon_color = LLColor4::white; - LLVoiceChannel* channelp = LLVoiceChannel::getCurrentVoiceChannel(); - if (channelp) - { - if (channelp->isActive()) - { - icon_color = LLColor4::green; - } - else if (channelp->getState() == LLVoiceChannel::STATE_ERROR) - { - icon_color = LLColor4::red; - } - else // active, but not connected - { - icon_color = LLColor4::yellow; - } - } - mTabContainer->setTabImage(current_active_floater, "active_voice_tab.tga", icon_color); - } - - mActiveVoiceFloater = current_active_floater; - - LLMultiFloater::draw(); -} - -void LLFloaterChatterBox::onOpen(const LLSD& key) -{ - //*TODO:Skinning show the session id associated with key - if (key.asString() == "local") - { - } - else if (key.isDefined()) - { - /*LLFloaterIMPanel* impanel = gIMMgr->findFloaterBySession(key.asUUID()); - if (impanel) - { - impanel->openFloater(); - }*/ - } -} - -void LLFloaterChatterBox::onVisibilityChange ( const LLSD& new_visibility ) -{ -} - -void LLFloaterChatterBox::removeFloater(LLFloater* floaterp) -{ - if(!floaterp) return; - - if (floaterp->getName() == "chat floater") - { - // only my friends floater now locked - mTabContainer->lockTabs(mTabContainer->getNumLockedTabs() - 1); - gSavedSettings.setBOOL("ChatHistoryTornOff", TRUE); - floaterp->setCanClose(TRUE); - } - else if (floaterp->getName() == "floater_my_friends") - { - // only chat floater now locked - mTabContainer->lockTabs(mTabContainer->getNumLockedTabs() - 1); - gSavedSettings.setBOOL("ContactsTornOff", TRUE); - floaterp->setCanClose(TRUE); - } - LLMultiFloater::removeFloater(floaterp); -} - -void LLFloaterChatterBox::addFloater(LLFloater* floaterp, - BOOL select_added_floater, - LLTabContainer::eInsertionPoint insertion_point) -{ - if(!floaterp) return; - - S32 num_locked_tabs = mTabContainer->getNumLockedTabs(); - - // already here - if (floaterp->getHost() == this) - { - openFloater(floaterp->getKey()); - return; - } - - // make sure my friends and chat history both locked when re-attaching chat history - if (floaterp->getName() == "chat floater") - { - mTabContainer->unlockTabs(); - // add chat history as second tab if contact window is present, first tab otherwise - if (getChildView("floater_my_friends")) - { - // assuming contacts window is first tab, select it - mTabContainer->selectFirstTab(); - // and add ourselves after - LLMultiFloater::addFloater(floaterp, select_added_floater, LLTabContainer::RIGHT_OF_CURRENT); - } - else - { - LLMultiFloater::addFloater(floaterp, select_added_floater, LLTabContainer::START); - } - - // make sure first two tabs are now locked - mTabContainer->lockTabs(num_locked_tabs + 1); - gSavedSettings.setBOOL("ChatHistoryTornOff", FALSE); - floaterp->setCanClose(FALSE); - } - else if (floaterp->getName() == "floater_my_friends") - { - mTabContainer->unlockTabs(); - // add contacts window as first tab - LLMultiFloater::addFloater(floaterp, select_added_floater, LLTabContainer::START); - // make sure first two tabs are now locked - mTabContainer->lockTabs(num_locked_tabs + 1); - gSavedSettings.setBOOL("ContactsTornOff", FALSE); - floaterp->setCanClose(FALSE); - } - else - { - LLMultiFloater::addFloater(floaterp, select_added_floater, insertion_point); - // openFloater(floaterp->getKey()); - } - - // make sure active voice icon shows up for new tab - if (floaterp == mActiveVoiceFloater) - { - mTabContainer->setTabImage(floaterp, "active_voice_tab.tga"); - } -} - -//static -LLFloaterChatterBox* LLFloaterChatterBox::getInstance() -{ - return LLFloaterReg::getTypedInstance<LLFloaterChatterBox>("communicate", LLSD()) ; -} - -//static -LLFloater* LLFloaterChatterBox::getCurrentVoiceFloater() -{ - if (!LLVoiceClient::getInstance()->voiceEnabled()) - { - return NULL; - } - if (LLVoiceChannelProximal::getInstance() == LLVoiceChannel::getCurrentVoiceChannel()) - { - return NULL; - } - else - { - LLFloaterChatterBox* floater = LLFloaterChatterBox::getInstance(); - if(!floater) return NULL; - // iterator over all IM tabs (skip friends and near me) - for (S32 i = 0; i < floater->getFloaterCount(); i++) - { - LLPanel* panelp = floater->mTabContainer->getPanelByIndex(i); - if (panelp->getName() == "im_floater") - { - // only LLFloaterIMPanels are called "im_floater" - LLFloaterIMPanel* im_floaterp = (LLFloaterIMPanel*)panelp; - LLVoiceChannel* voice_channel = LLIMModel::getInstance()->getVoiceChannel(im_floaterp->getSessionID()); - if (voice_channel == LLVoiceChannel::getCurrentVoiceChannel()) - { - return im_floaterp; - } - } - } - } - return NULL; -} diff --git a/indra/newview/llfloaterchatterbox.h b/indra/newview/llfloaterchatterbox.h deleted file mode 100644 index 3a8bfe2fa4..0000000000 --- a/indra/newview/llfloaterchatterbox.h +++ /dev/null @@ -1,80 +0,0 @@ -/** - * @file llfloaterchatterbox.h - * @author Richard - * @date 2007-05-04 - * @brief Integrated friends and group management/communication tool - * - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2010, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -#ifndef LL_LLFLOATERCHATTERBOX_H -#define LL_LLFLOATERCHATTERBOX_H - -#include "llfloater.h" -#include "llmultifloater.h" -#include "llstring.h" -#include "llimpanel.h" - -class LLTabContainer; - -class LLFloaterChatterBox : public LLMultiFloater -{ -public: - LLFloaterChatterBox(const LLSD& seed); - virtual ~LLFloaterChatterBox(); - - /*virtual*/ BOOL postBuild(); - /*virtual*/ BOOL handleKeyHere(KEY key, MASK mask); - /*virtual*/ void draw(); - /*virtual*/ void onOpen(const LLSD& key); - - /*virtual*/ void removeFloater(LLFloater* floaterp); - /*virtual*/ void addFloater(LLFloater* floaterp, - BOOL select_added_floater, - LLTabContainer::eInsertionPoint insertion_point = LLTabContainer::END); - - static LLFloaterChatterBox* getInstance(); // *TODO:Skinning Deprecate - static LLFloater* getCurrentVoiceFloater(); - -protected: - void onVisibilityChange ( const LLSD& new_visibility ); - - LLFloater* mActiveVoiceFloater; -}; - - -class LLFloaterMyFriends : public LLFloater -{ -public: - LLFloaterMyFriends(const LLSD& seed); - virtual ~LLFloaterMyFriends(); - - /*virtual*/ BOOL postBuild(); - /*virtual*/ void onOpen(const LLSD& key); - - static LLFloaterMyFriends* getInstance(); // *TODO:Skinning Deprecate - - static void* createFriendsPanel(void* data); - static void* createGroupsPanel(void* data); -}; - -#endif // LL_LLFLOATERCHATTERBOX_H diff --git a/indra/newview/llfloaterfriends.cpp b/indra/newview/llfloaterfriends.cpp deleted file mode 100644 index f93568d617..0000000000 --- a/indra/newview/llfloaterfriends.cpp +++ /dev/null @@ -1,807 +0,0 @@ -/** - * @file llfloaterfriends.cpp - * @author Phoenix - * @date 2005-01-13 - * @brief Implementation of the friends floater - * - * $LicenseInfo:firstyear=2005&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2010, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - - -#include "llviewerprecompiledheaders.h" - -#include "llfloaterfriends.h" - -#include <sstream> - -#include "lldir.h" - -#include "llagent.h" -#include "llappviewer.h" // for gLastVersionChannel -#include "llfloateravatarpicker.h" -#include "llviewerwindow.h" -#include "llbutton.h" -#include "llavataractions.h" -#include "llinventorymodel.h" -#include "llnamelistctrl.h" -#include "llnotificationsutil.h" -#include "llresmgr.h" -#include "llscrolllistctrl.h" -#include "llscrolllistitem.h" -#include "llscrolllistcell.h" -#include "lluictrlfactory.h" -#include "llmenucommands.h" -#include "llviewercontrol.h" -#include "llviewermessage.h" -#include "lleventtimer.h" -#include "lltextbox.h" -#include "llvoiceclient.h" - -// *TODO: Move more common stuff to LLAvatarActions? - -//Maximum number of people you can select to do an operation on at once. -#define MAX_FRIEND_SELECT 20 -#define DEFAULT_PERIOD 5.0 -#define RIGHTS_CHANGE_TIMEOUT 5.0 -#define OBSERVER_TIMEOUT 0.5 - -#define ONLINE_SIP_ICON_NAME "slim_icon_16_viewer.tga" - -// simple class to observe the calling cards. -class LLLocalFriendsObserver : public LLFriendObserver, public LLEventTimer -{ -public: - LLLocalFriendsObserver(LLPanelFriends* floater) : mFloater(floater), LLEventTimer(OBSERVER_TIMEOUT) - { - mEventTimer.stop(); - } - virtual ~LLLocalFriendsObserver() - { - mFloater = NULL; - } - virtual void changed(U32 mask) - { - // events can arrive quickly in bulk - we need not process EVERY one of them - - // so we wait a short while to let others pile-in, and process them in aggregate. - mEventTimer.start(); - - // save-up all the mask-bits which have come-in - mMask |= mask; - } - virtual BOOL tick() - { - mFloater->updateFriends(mMask); - - mEventTimer.stop(); - mMask = 0; - - return FALSE; - } - -protected: - LLPanelFriends* mFloater; - U32 mMask; -}; - -LLPanelFriends::LLPanelFriends() : - LLPanel(), - LLEventTimer(DEFAULT_PERIOD), - mObserver(NULL), - mShowMaxSelectWarning(TRUE), - mAllowRightsChange(TRUE), - mNumRightsChanged(0) -{ - mEventTimer.stop(); - mObserver = new LLLocalFriendsObserver(this); - LLAvatarTracker::instance().addObserver(mObserver); - // For notification when SIP online status changes. - LLVoiceClient::getInstance()->addObserver(mObserver); -} - -LLPanelFriends::~LLPanelFriends() -{ - // For notification when SIP online status changes. - LLVoiceClient::getInstance()->removeObserver(mObserver); - LLAvatarTracker::instance().removeObserver(mObserver); - delete mObserver; -} - -BOOL LLPanelFriends::tick() -{ - mEventTimer.stop(); - mPeriod = DEFAULT_PERIOD; - mAllowRightsChange = TRUE; - updateFriends(LLFriendObserver::ADD); - return FALSE; -} - -void LLPanelFriends::updateFriends(U32 changed_mask) -{ - LLUUID selected_id; - LLCtrlListInterface *friends_list = childGetListInterface("friend_list"); - if (!friends_list) return; - LLCtrlScrollInterface *friends_scroll = childGetScrollInterface("friend_list"); - if (!friends_scroll) return; - - // We kill the selection warning, otherwise we'll spam with warning popups - // if the maximum amount of friends are selected - mShowMaxSelectWarning = false; - - std::vector<LLUUID> selected_friends = getSelectedIDs(); - if(changed_mask & (LLFriendObserver::ADD | LLFriendObserver::REMOVE | LLFriendObserver::ONLINE)) - { - refreshNames(changed_mask); - } - else if(changed_mask & LLFriendObserver::POWERS) - { - --mNumRightsChanged; - if(mNumRightsChanged > 0) - { - mPeriod = RIGHTS_CHANGE_TIMEOUT; - mEventTimer.start(); - mAllowRightsChange = FALSE; - } - else - { - tick(); - } - } - if(selected_friends.size() > 0) - { - // only non-null if friends was already found. This may fail, - // but we don't really care here, because refreshUI() will - // clean up the interface. - friends_list->setCurrentByID(selected_id); - for(std::vector<LLUUID>::iterator itr = selected_friends.begin(); itr != selected_friends.end(); ++itr) - { - friends_list->setSelectedByValue(*itr, true); - } - } - - refreshUI(); - mShowMaxSelectWarning = true; -} - -// virtual -BOOL LLPanelFriends::postBuild() -{ - mFriendsList = getChild<LLScrollListCtrl>("friend_list"); - mFriendsList->setMaxSelectable(MAX_FRIEND_SELECT); - mFriendsList->setMaximumSelectCallback(boost::bind(&LLPanelFriends::onMaximumSelect)); - mFriendsList->setCommitOnSelectionChange(TRUE); - mFriendsList->setContextMenu(LLScrollListCtrl::MENU_AVATAR); - childSetCommitCallback("friend_list", onSelectName, this); - getChild<LLScrollListCtrl>("friend_list")->setDoubleClickCallback(onClickIM, this); - - U32 changed_mask = LLFriendObserver::ADD | LLFriendObserver::REMOVE | LLFriendObserver::ONLINE; - refreshNames(changed_mask); - - childSetAction("im_btn", onClickIM, this); - childSetAction("profile_btn", onClickProfile, this); - childSetAction("offer_teleport_btn", onClickOfferTeleport, this); - childSetAction("pay_btn", onClickPay, this); - childSetAction("add_btn", onClickAddFriend, this); - childSetAction("remove_btn", onClickRemove, this); - - setDefaultBtn("im_btn"); - - updateFriends(LLFriendObserver::ADD); - refreshUI(); - - // primary sort = online status, secondary sort = name - mFriendsList->sortByColumn(std::string("friend_name"), TRUE); - mFriendsList->sortByColumn(std::string("icon_online_status"), FALSE); - - return TRUE; -} - -BOOL LLPanelFriends::addFriend(const LLUUID& agent_id) -{ - LLAvatarTracker& at = LLAvatarTracker::instance(); - const LLRelationship* relationInfo = at.getBuddyInfo(agent_id); - if(!relationInfo) return FALSE; - - bool isOnlineSIP = LLVoiceClient::getInstance()->isOnlineSIP(agent_id); - bool isOnline = relationInfo->isOnline(); - - std::string fullname; - BOOL have_name = gCacheName->getFullName(agent_id, fullname); - - LLSD element; - element["id"] = agent_id; - LLSD& friend_column = element["columns"][LIST_FRIEND_NAME]; - friend_column["column"] = "friend_name"; - friend_column["value"] = fullname; - friend_column["font"]["name"] = "SANSSERIF"; - friend_column["font"]["style"] = "NORMAL"; - - LLSD& online_status_column = element["columns"][LIST_ONLINE_STATUS]; - online_status_column["column"] = "icon_online_status"; - online_status_column["type"] = "icon"; - - if (isOnline) - { - friend_column["font"]["style"] = "BOLD"; - online_status_column["value"] = "icon_avatar_online.tga"; - } - else if(isOnlineSIP) - { - friend_column["font"]["style"] = "BOLD"; - online_status_column["value"] = ONLINE_SIP_ICON_NAME; - } - - LLSD& online_column = element["columns"][LIST_VISIBLE_ONLINE]; - online_column["column"] = "icon_visible_online"; - online_column["type"] = "checkbox"; - online_column["value"] = relationInfo->isRightGrantedTo(LLRelationship::GRANT_ONLINE_STATUS); - - LLSD& visible_map_column = element["columns"][LIST_VISIBLE_MAP]; - visible_map_column["column"] = "icon_visible_map"; - visible_map_column["type"] = "checkbox"; - visible_map_column["value"] = relationInfo->isRightGrantedTo(LLRelationship::GRANT_MAP_LOCATION); - - LLSD& edit_my_object_column = element["columns"][LIST_EDIT_MINE]; - edit_my_object_column["column"] = "icon_edit_mine"; - edit_my_object_column["type"] = "checkbox"; - edit_my_object_column["value"] = relationInfo->isRightGrantedTo(LLRelationship::GRANT_MODIFY_OBJECTS); - - LLSD& edit_their_object_column = element["columns"][LIST_EDIT_THEIRS]; - edit_their_object_column["column"] = "icon_edit_theirs"; - edit_their_object_column["type"] = "checkbox"; - edit_their_object_column["enabled"] = ""; - edit_their_object_column["value"] = relationInfo->isRightGrantedFrom(LLRelationship::GRANT_MODIFY_OBJECTS); - - LLSD& update_gen_column = element["columns"][LIST_FRIEND_UPDATE_GEN]; - update_gen_column["column"] = "friend_last_update_generation"; - update_gen_column["value"] = have_name ? relationInfo->getChangeSerialNum() : -1; - - mFriendsList->addElement(element, ADD_BOTTOM); - return have_name; -} - -// propagate actual relationship to UI. -// Does not resort the UI list because it can be called frequently. JC -BOOL LLPanelFriends::updateFriendItem(const LLUUID& agent_id, const LLRelationship* info) -{ - if (!info) return FALSE; - LLScrollListItem* itemp = mFriendsList->getItem(agent_id); - if (!itemp) return FALSE; - - bool isOnlineSIP = LLVoiceClient::getInstance()->isOnlineSIP(itemp->getUUID()); - bool isOnline = info->isOnline(); - - std::string fullname; - BOOL have_name = gCacheName->getFullName(agent_id, fullname); - - // Name of the status icon to use - std::string statusIcon; - - if(isOnline) - { - statusIcon = "icon_avatar_online.tga"; - } - else if(isOnlineSIP) - { - statusIcon = ONLINE_SIP_ICON_NAME; - } - - itemp->getColumn(LIST_ONLINE_STATUS)->setValue(statusIcon); - - itemp->getColumn(LIST_FRIEND_NAME)->setValue(fullname); - // render name of online friends in bold text - ((LLScrollListText*)itemp->getColumn(LIST_FRIEND_NAME))->setFontStyle((isOnline || isOnlineSIP) ? LLFontGL::BOLD : LLFontGL::NORMAL); - itemp->getColumn(LIST_VISIBLE_ONLINE)->setValue(info->isRightGrantedTo(LLRelationship::GRANT_ONLINE_STATUS)); - itemp->getColumn(LIST_VISIBLE_MAP)->setValue(info->isRightGrantedTo(LLRelationship::GRANT_MAP_LOCATION)); - itemp->getColumn(LIST_EDIT_MINE)->setValue(info->isRightGrantedTo(LLRelationship::GRANT_MODIFY_OBJECTS)); - S32 change_generation = have_name ? info->getChangeSerialNum() : -1; - itemp->getColumn(LIST_FRIEND_UPDATE_GEN)->setValue(change_generation); - - // enable this item, in case it was disabled after user input - itemp->setEnabled(TRUE); - - // Do not resort, this function can be called frequently. - return have_name; -} - -void LLPanelFriends::refreshRightsChangeList() -{ - std::vector<LLUUID> friends = getSelectedIDs(); - S32 num_selected = friends.size(); - - bool can_offer_teleport = num_selected >= 1; - bool selected_friends_online = true; - - const LLRelationship* friend_status = NULL; - for(std::vector<LLUUID>::iterator itr = friends.begin(); itr != friends.end(); ++itr) - { - friend_status = LLAvatarTracker::instance().getBuddyInfo(*itr); - if (friend_status) - { - if(!friend_status->isOnline()) - { - can_offer_teleport = false; - selected_friends_online = false; - } - } - else // missing buddy info, don't allow any operations - { - can_offer_teleport = false; - } - } - - if (num_selected == 0) // nothing selected - { - childSetEnabled("im_btn", FALSE); - childSetEnabled("offer_teleport_btn", FALSE); - } - else // we have at least one friend selected... - { - // only allow IMs to groups when everyone in the group is online - // to be consistent with context menus in inventory and because otherwise - // offline friends would be silently dropped from the session - childSetEnabled("im_btn", selected_friends_online || num_selected == 1); - childSetEnabled("offer_teleport_btn", can_offer_teleport); - } -} - -struct SortFriendsByID -{ - bool operator() (const LLScrollListItem* const a, const LLScrollListItem* const b) const - { - return a->getValue().asUUID() < b->getValue().asUUID(); - } -}; - -void LLPanelFriends::refreshNames(U32 changed_mask) -{ - std::vector<LLUUID> selected_ids = getSelectedIDs(); - S32 pos = mFriendsList->getScrollPos(); - - // get all buddies we know about - LLAvatarTracker::buddy_map_t all_buddies; - LLAvatarTracker::instance().copyBuddyList(all_buddies); - - BOOL have_names = TRUE; - - if(changed_mask & (LLFriendObserver::ADD | LLFriendObserver::REMOVE)) - { - have_names &= refreshNamesSync(all_buddies); - } - - if(changed_mask & LLFriendObserver::ONLINE) - { - have_names &= refreshNamesPresence(all_buddies); - } - - if (!have_names) - { - mEventTimer.start(); - } - // Changed item in place, need to request sort and update columns - // because we might have changed data in a column on which the user - // has already sorted. JC - mFriendsList->updateSort(); - - // re-select items - mFriendsList->selectMultiple(selected_ids); - mFriendsList->setScrollPos(pos); -} - -BOOL LLPanelFriends::refreshNamesSync(const LLAvatarTracker::buddy_map_t & all_buddies) -{ - mFriendsList->deleteAllItems(); - - BOOL have_names = TRUE; - LLAvatarTracker::buddy_map_t::const_iterator buddy_it = all_buddies.begin(); - - for(; buddy_it != all_buddies.end(); ++buddy_it) - { - have_names &= addFriend(buddy_it->first); - } - - return have_names; -} - -BOOL LLPanelFriends::refreshNamesPresence(const LLAvatarTracker::buddy_map_t & all_buddies) -{ - std::vector<LLScrollListItem*> items = mFriendsList->getAllData(); - std::sort(items.begin(), items.end(), SortFriendsByID()); - - LLAvatarTracker::buddy_map_t::const_iterator buddy_it = all_buddies.begin(); - std::vector<LLScrollListItem*>::const_iterator item_it = items.begin(); - BOOL have_names = TRUE; - - while(true) - { - if(item_it == items.end() || buddy_it == all_buddies.end()) - { - break; - } - - const LLUUID & buddy_uuid = buddy_it->first; - const LLUUID & item_uuid = (*item_it)->getValue().asUUID(); - if(item_uuid == buddy_uuid) - { - const LLRelationship* info = buddy_it->second; - if (!info) - { - ++item_it; - continue; - } - - S32 last_change_generation = (*item_it)->getColumn(LIST_FRIEND_UPDATE_GEN)->getValue().asInteger(); - if (last_change_generation < info->getChangeSerialNum()) - { - // update existing item in UI - have_names &= updateFriendItem(buddy_it->first, info); - } - - ++buddy_it; - ++item_it; - } - else if(item_uuid < buddy_uuid) - { - ++item_it; - } - else //if(item_uuid > buddy_uuid) - { - ++buddy_it; - } - } - - return have_names; -} - -void LLPanelFriends::refreshUI() -{ - BOOL single_selected = FALSE; - BOOL multiple_selected = FALSE; - int num_selected = mFriendsList->getAllSelected().size(); - if(num_selected > 0) - { - single_selected = TRUE; - if(num_selected > 1) - { - multiple_selected = TRUE; - } - } - - - //Options that can only be performed with one friend selected - childSetEnabled("profile_btn", single_selected && !multiple_selected); - childSetEnabled("pay_btn", single_selected && !multiple_selected); - - //Options that can be performed with up to MAX_FRIEND_SELECT friends selected - //(single_selected will always be true in this situations) - childSetEnabled("remove_btn", single_selected); - childSetEnabled("im_btn", single_selected); -// childSetEnabled("friend_rights", single_selected); - - refreshRightsChangeList(); -} - -std::vector<LLUUID> LLPanelFriends::getSelectedIDs() -{ - LLUUID selected_id; - std::vector<LLUUID> friend_ids; - std::vector<LLScrollListItem*> selected = mFriendsList->getAllSelected(); - for(std::vector<LLScrollListItem*>::iterator itr = selected.begin(); itr != selected.end(); ++itr) - { - friend_ids.push_back((*itr)->getUUID()); - } - return friend_ids; -} - -// static -void LLPanelFriends::onSelectName(LLUICtrl* ctrl, void* user_data) -{ - LLPanelFriends* panelp = (LLPanelFriends*)user_data; - - if(panelp) - { - panelp->refreshUI(); - // check to see if rights have changed - panelp->applyRightsToFriends(); - } -} - -//static -void LLPanelFriends::onMaximumSelect() -{ - LLSD args; - args["MAX_SELECT"] = llformat("%d", MAX_FRIEND_SELECT); - LLNotificationsUtil::add("MaxListSelectMessage", args); -}; - -// static -void LLPanelFriends::onClickProfile(void* user_data) -{ - LLPanelFriends* panelp = (LLPanelFriends*)user_data; - - std::vector<LLUUID> ids = panelp->getSelectedIDs(); - if(ids.size() > 0) - { - LLUUID agent_id = ids[0]; - LLAvatarActions::showProfile(agent_id); - } -} - -// static -void LLPanelFriends::onClickIM(void* user_data) -{ - LLPanelFriends* panelp = (LLPanelFriends*)user_data; - - std::vector<LLUUID> ids = panelp->getSelectedIDs(); - if(ids.size() > 0) - { - if(ids.size() == 1) - { - LLAvatarActions::startIM(ids[0]); - } - else - { - LLAvatarActions::startConference(ids); - } - } -} - -// static -void LLPanelFriends::onPickAvatar(const std::vector<std::string>& names, - const std::vector<LLUUID>& ids) -{ - if (names.empty()) return; - if (ids.empty()) return; - LLAvatarActions::requestFriendshipDialog(ids[0], names[0]); -} - -// static -void LLPanelFriends::onClickAddFriend(void* user_data) -{ - LLPanelFriends* panelp = (LLPanelFriends*)user_data; - LLFloater* root_floater = gFloaterView->getParentFloater(panelp); - LLFloaterAvatarPicker* picker = LLFloaterAvatarPicker::show(boost::bind(&LLPanelFriends::onPickAvatar, _1,_2), FALSE, TRUE); - if (root_floater) - { - root_floater->addDependentFloater(picker); - } -} - -// static -void LLPanelFriends::onClickRemove(void* user_data) -{ - LLPanelFriends* panelp = (LLPanelFriends*)user_data; - LLAvatarActions::removeFriendsDialog(panelp->getSelectedIDs()); -} - -// static -void LLPanelFriends::onClickOfferTeleport(void* user_data) -{ - LLPanelFriends* panelp = (LLPanelFriends*)user_data; - LLAvatarActions::offerTeleport(panelp->getSelectedIDs()); -} - -// static -void LLPanelFriends::onClickPay(void* user_data) -{ - LLPanelFriends* panelp = (LLPanelFriends*)user_data; - - std::vector<LLUUID> ids = panelp->getSelectedIDs(); - if(ids.size() == 1) - { - LLAvatarActions::pay(ids[0]); - } -} - -void LLPanelFriends::confirmModifyRights(rights_map_t& ids, EGrantRevoke command) -{ - if (ids.empty()) return; - - LLSD args; - if(ids.size() > 0) - { - rights_map_t* rights = new rights_map_t(ids); - - // for single friend, show their name - if(ids.size() == 1) - { - LLUUID agent_id = ids.begin()->first; - std::string first, last; - if(gCacheName->getName(agent_id, first, last)) - { - args["FIRST_NAME"] = first; - args["LAST_NAME"] = last; - } - if (command == GRANT) - { - LLNotificationsUtil::add("GrantModifyRights", - args, - LLSD(), - boost::bind(&LLPanelFriends::modifyRightsConfirmation, this, _1, _2, rights)); - } - else - { - LLNotificationsUtil::add("RevokeModifyRights", - args, - LLSD(), - boost::bind(&LLPanelFriends::modifyRightsConfirmation, this, _1, _2, rights)); - } - } - else - { - if (command == GRANT) - { - LLNotificationsUtil::add("GrantModifyRightsMultiple", - args, - LLSD(), - boost::bind(&LLPanelFriends::modifyRightsConfirmation, this, _1, _2, rights)); - } - else - { - LLNotificationsUtil::add("RevokeModifyRightsMultiple", - args, - LLSD(), - boost::bind(&LLPanelFriends::modifyRightsConfirmation, this, _1, _2, rights)); - } - } - } -} - -bool LLPanelFriends::modifyRightsConfirmation(const LLSD& notification, const LLSD& response, rights_map_t* rights) -{ - S32 option = LLNotificationsUtil::getSelectedOption(notification, response); - if(0 == option) - { - sendRightsGrant(*rights); - } - else - { - // need to resync view with model, since user cancelled operation - rights_map_t::iterator rights_it; - for (rights_it = rights->begin(); rights_it != rights->end(); ++rights_it) - { - const LLRelationship* info = LLAvatarTracker::instance().getBuddyInfo(rights_it->first); - updateFriendItem(rights_it->first, info); - } - } - refreshUI(); - - delete rights; - return false; -} - -void LLPanelFriends::applyRightsToFriends() -{ - BOOL rights_changed = FALSE; - - // store modify rights separately for confirmation - rights_map_t rights_updates; - - BOOL need_confirmation = FALSE; - EGrantRevoke confirmation_type = GRANT; - - // this assumes that changes only happened to selected items - std::vector<LLScrollListItem*> selected = mFriendsList->getAllSelected(); - for(std::vector<LLScrollListItem*>::iterator itr = selected.begin(); itr != selected.end(); ++itr) - { - LLUUID id = (*itr)->getValue(); - const LLRelationship* buddy_relationship = LLAvatarTracker::instance().getBuddyInfo(id); - if (buddy_relationship == NULL) continue; - - bool show_online_staus = (*itr)->getColumn(LIST_VISIBLE_ONLINE)->getValue().asBoolean(); - bool show_map_location = (*itr)->getColumn(LIST_VISIBLE_MAP)->getValue().asBoolean(); - bool allow_modify_objects = (*itr)->getColumn(LIST_EDIT_MINE)->getValue().asBoolean(); - - S32 rights = buddy_relationship->getRightsGrantedTo(); - if(buddy_relationship->isRightGrantedTo(LLRelationship::GRANT_ONLINE_STATUS) != show_online_staus) - { - rights_changed = TRUE; - if(show_online_staus) - { - rights |= LLRelationship::GRANT_ONLINE_STATUS; - } - else - { - // ONLINE_STATUS necessary for MAP_LOCATION - rights &= ~LLRelationship::GRANT_ONLINE_STATUS; - rights &= ~LLRelationship::GRANT_MAP_LOCATION; - // propagate rights constraint to UI - (*itr)->getColumn(LIST_VISIBLE_MAP)->setValue(FALSE); - } - } - if(buddy_relationship->isRightGrantedTo(LLRelationship::GRANT_MAP_LOCATION) != show_map_location) - { - rights_changed = TRUE; - if(show_map_location) - { - // ONLINE_STATUS necessary for MAP_LOCATION - rights |= LLRelationship::GRANT_MAP_LOCATION; - rights |= LLRelationship::GRANT_ONLINE_STATUS; - (*itr)->getColumn(LIST_VISIBLE_ONLINE)->setValue(TRUE); - } - else - { - rights &= ~LLRelationship::GRANT_MAP_LOCATION; - } - } - - // now check for change in modify object rights, which requires confirmation - if(buddy_relationship->isRightGrantedTo(LLRelationship::GRANT_MODIFY_OBJECTS) != allow_modify_objects) - { - rights_changed = TRUE; - need_confirmation = TRUE; - - if(allow_modify_objects) - { - rights |= LLRelationship::GRANT_MODIFY_OBJECTS; - confirmation_type = GRANT; - } - else - { - rights &= ~LLRelationship::GRANT_MODIFY_OBJECTS; - confirmation_type = REVOKE; - } - } - - if (rights_changed) - { - rights_updates.insert(std::make_pair(id, rights)); - // disable these ui elements until response from server - // to avoid race conditions - (*itr)->setEnabled(FALSE); - } - } - - // separately confirm grant and revoke of modify rights - if (need_confirmation) - { - confirmModifyRights(rights_updates, confirmation_type); - } - else - { - sendRightsGrant(rights_updates); - } -} - -void LLPanelFriends::sendRightsGrant(rights_map_t& ids) -{ - if (ids.empty()) return; - - LLMessageSystem* msg = gMessageSystem; - - // setup message header - msg->newMessageFast(_PREHASH_GrantUserRights); - msg->nextBlockFast(_PREHASH_AgentData); - msg->addUUID(_PREHASH_AgentID, gAgent.getID()); - msg->addUUID(_PREHASH_SessionID, gAgent.getSessionID()); - - rights_map_t::iterator id_it; - rights_map_t::iterator end_it = ids.end(); - for(id_it = ids.begin(); id_it != end_it; ++id_it) - { - msg->nextBlockFast(_PREHASH_Rights); - msg->addUUID(_PREHASH_AgentRelated, id_it->first); - msg->addS32(_PREHASH_RelatedRights, id_it->second); - } - - mNumRightsChanged = ids.size(); - gAgent.sendReliableMessage(); -} diff --git a/indra/newview/llfloaterfriends.h b/indra/newview/llfloaterfriends.h deleted file mode 100644 index a303477c95..0000000000 --- a/indra/newview/llfloaterfriends.h +++ /dev/null @@ -1,140 +0,0 @@ -/** - * @file llfloaterfriends.h - * @author Phoenix - * @date 2005-01-13 - * @brief Declaration of class for displaying the local agent's friends. - * - * $LicenseInfo:firstyear=2005&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2010, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -#ifndef LL_LLFLOATERFRIENDS_H -#define LL_LLFLOATERFRIENDS_H - -#include "llpanel.h" -#include "llstring.h" -#include "lluuid.h" -#include "lltimer.h" -#include "llcallingcard.h" - -class LLFriendObserver; -class LLRelationship; -class LLScrollListItem; -class LLScrollListCtrl; - -/** - * @class LLPanelFriends - * @brief An instance of this class is used for displaying your friends - * and gives you quick access to all agents which a user relationship. - * - * @sa LLFloater - */ -class LLPanelFriends : public LLPanel, public LLEventTimer -{ -public: - LLPanelFriends(); - virtual ~LLPanelFriends(); - - /** - * @brief This method either creates or brings to the front the - * current instantiation of this floater. There is only once since - * you can currently only look at your local friends. - */ - virtual BOOL tick(); - - /** - * @brief This method is called in response to the LLAvatarTracker - * sending out a changed() message. - */ - void updateFriends(U32 changed_mask); - - virtual BOOL postBuild(); - - // *HACK Made public to remove friends from LLAvatarIconCtrl context menu - static bool handleRemove(const LLSD& notification, const LLSD& response); - -private: - - enum FRIENDS_COLUMN_ORDER - { - LIST_ONLINE_STATUS, - LIST_FRIEND_NAME, - LIST_VISIBLE_ONLINE, - LIST_VISIBLE_MAP, - LIST_EDIT_MINE, - LIST_EDIT_THEIRS, - LIST_FRIEND_UPDATE_GEN - }; - - // protected members - typedef std::map<LLUUID, S32> rights_map_t; - void refreshNames(U32 changed_mask); - BOOL refreshNamesSync(const LLAvatarTracker::buddy_map_t & all_buddies); - BOOL refreshNamesPresence(const LLAvatarTracker::buddy_map_t & all_buddies); - void refreshUI(); - void refreshRightsChangeList(); - void applyRightsToFriends(); - BOOL addFriend(const LLUUID& agent_id); - BOOL updateFriendItem(const LLUUID& agent_id, const LLRelationship* relationship); - - typedef enum - { - GRANT, - REVOKE - } EGrantRevoke; - void confirmModifyRights(rights_map_t& ids, EGrantRevoke command); - void sendRightsGrant(rights_map_t& ids); - - // return empty vector if nothing is selected - std::vector<LLUUID> getSelectedIDs(); - - // callback methods - static void onSelectName(LLUICtrl* ctrl, void* user_data); - static bool callbackAddFriend(const LLSD& notification, const LLSD& response); - static bool callbackAddFriendWithMessage(const LLSD& notification, const LLSD& response); - static void onPickAvatar(const std::vector<std::string>& names, const std::vector<LLUUID>& ids); - static void onMaximumSelect(); - - static void onClickIM(void* user_data); - static void onClickProfile(void* user_data); - static void onClickAddFriend(void* user_data); - static void onClickRemove(void* user_data); - - static void onClickOfferTeleport(void* user_data); - static void onClickPay(void* user_data); - - static void onClickModifyStatus(LLUICtrl* ctrl, void* user_data); - - bool modifyRightsConfirmation(const LLSD& notification, const LLSD& response, rights_map_t* rights); - -private: - // member data - LLFriendObserver* mObserver; - LLUUID mAddFriendID; - std::string mAddFriendName; - LLScrollListCtrl* mFriendsList; - BOOL mShowMaxSelectWarning; - BOOL mAllowRightsChange; - S32 mNumRightsChanged; -}; - - -#endif // LL_LLFLOATERFRIENDS_H diff --git a/indra/newview/llfloaterhardwaresettings.cpp b/indra/newview/llfloaterhardwaresettings.cpp index 42ec7d765b..f9a403cf9f 100644 --- a/indra/newview/llfloaterhardwaresettings.cpp +++ b/indra/newview/llfloaterhardwaresettings.cpp @@ -34,7 +34,9 @@ #include "llviewercontrol.h" #include "llviewertexturelist.h" #include "llfeaturemanager.h" +#include "llspinctrl.h" #include "llstartup.h" +#include "lltextbox.h" #include "pipeline.h" // Linden library includes @@ -98,18 +100,40 @@ void LLFloaterHardwareSettings::refreshEnabledState() } // if no windlight shaders, turn off nighttime brightness, gamma, and fog distance - getChildView("gamma")->setEnabled(!gPipeline.canUseWindLightShaders()); + LLSpinCtrl* gamma_ctrl = getChild<LLSpinCtrl>("gamma"); + gamma_ctrl->setEnabled(!gPipeline.canUseWindLightShaders()); getChildView("(brightness, lower is brighter)")->setEnabled(!gPipeline.canUseWindLightShaders()); getChildView("fog")->setEnabled(!gPipeline.canUseWindLightShaders()); - getChildView("fsaa")->setEnabled(gPipeline.canUseAntiAliasing()); - getChildView("antialiasing restart")->setVisible(!gSavedSettings.getBOOL("RenderDeferred")); - /* Enable to reset fsaa value to disabled when feature is not available. - if (!gPipeline.canUseAntiAliasing()) + // anti-aliasing { - getChild<LLUICtrl>("fsaa")->setValue((LLSD::Integer) 0); + LLUICtrl* fsaa_ctrl = getChild<LLUICtrl>("fsaa"); + LLTextBox* fsaa_text = getChild<LLTextBox>("antialiasing label"); + LLView* fsaa_restart = getChildView("antialiasing restart"); + + // Enable or disable the control, the "Antialiasing:" label and the restart warning + // based on code support for the feature on the current hardware. + + if (gPipeline.canUseAntiAliasing()) + { + fsaa_ctrl->setEnabled(TRUE); + + // borrow the text color from the gamma control for consistency + fsaa_text->setColor(gamma_ctrl->getEnabledTextColor()); + + fsaa_restart->setVisible(!gSavedSettings.getBOOL("RenderDeferred")); + } + else + { + fsaa_ctrl->setEnabled(FALSE); + fsaa_ctrl->setValue((LLSD::Integer) 0); + + // borrow the text color from the gamma control for consistency + fsaa_text->setColor(gamma_ctrl->getDisabledTextColor()); + + fsaa_restart->setVisible(FALSE); + } } - */ } //============================================================================ diff --git a/indra/newview/llfloaterhelpbrowser.h b/indra/newview/llfloaterhelpbrowser.h index 80b0ecc06b..bf4f544a14 100644 --- a/indra/newview/llfloaterhelpbrowser.h +++ b/indra/newview/llfloaterhelpbrowser.h @@ -1,5 +1,5 @@ /** - * @file llfloatermediabrowser.h + * @file llfloaterhelpbrowser.h * @brief HTML Help floater - uses embedded web browser control * * $LicenseInfo:firstyear=2006&license=viewerlgpl$ diff --git a/indra/newview/llfloaterimagepreview.cpp b/indra/newview/llfloaterimagepreview.cpp index e4d8e3513d..69de15d9ea 100644 --- a/indra/newview/llfloaterimagepreview.cpp +++ b/indra/newview/llfloaterimagepreview.cpp @@ -50,6 +50,7 @@ #include "llvoavatar.h" #include "pipeline.h" #include "lluictrlfactory.h" +#include "llviewershadermgr.h" #include "llviewertexturelist.h" #include "llstring.h" @@ -649,25 +650,30 @@ BOOL LLImagePreviewAvatar::render() gGL.pushUIMatrix(); gGL.loadUIIdentity(); - glMatrixMode(GL_PROJECTION); + gGL.matrixMode(LLRender::MM_PROJECTION); gGL.pushMatrix(); - glLoadIdentity(); - glOrtho(0.0f, mFullWidth, 0.0f, mFullHeight, -1.0f, 1.0f); + gGL.loadIdentity(); + gGL.ortho(0.0f, mFullWidth, 0.0f, mFullHeight, -1.0f, 1.0f); - glMatrixMode(GL_MODELVIEW); + gGL.matrixMode(LLRender::MM_MODELVIEW); gGL.pushMatrix(); - glLoadIdentity(); + gGL.loadIdentity(); LLGLSUIDefault def; gGL.color4f(0.15f, 0.2f, 0.3f, 1.f); + if (LLGLSLShader::sNoFixedFunction) + { + gUIProgram.bind(); + } + gl_rect_2d_simple( mFullWidth, mFullHeight ); - glMatrixMode(GL_PROJECTION); + gGL.matrixMode(LLRender::MM_PROJECTION); gGL.popMatrix(); - glMatrixMode(GL_MODELVIEW); + gGL.matrixMode(LLRender::MM_MODELVIEW); gGL.popMatrix(); gGL.flush(); @@ -690,8 +696,7 @@ BOOL LLImagePreviewAvatar::render() LLVertexBuffer::unbind(); avatarp->updateLOD(); - - + if (avatarp->mDrawable.notNull()) { LLGLDepthTest gls_depth(GL_TRUE, GL_TRUE); @@ -699,7 +704,7 @@ BOOL LLImagePreviewAvatar::render() LLGLDisable no_blend(GL_BLEND); LLDrawPoolAvatar *avatarPoolp = (LLDrawPoolAvatar *)avatarp->mDrawable->getFace(0)->getPool(); - + gPipeline.enableLightsPreview(); avatarPoolp->renderAvatars(avatarp); // renders only one avatar } @@ -790,15 +795,17 @@ void LLImagePreviewSculpted::setPreviewTarget(LLImageRaw* imagep, F32 distance) U32 num_indices = vf.mNumIndices; U32 num_vertices = vf.mNumVertices; - mVertexBuffer = new LLVertexBuffer(LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_NORMAL, 0); + mVertexBuffer = new LLVertexBuffer(LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_NORMAL | LLVertexBuffer::MAP_TEXCOORD0, 0); mVertexBuffer->allocateBuffer(num_vertices, num_indices, TRUE); LLStrider<LLVector3> vertex_strider; LLStrider<LLVector3> normal_strider; + LLStrider<LLVector2> tc_strider; LLStrider<U16> index_strider; mVertexBuffer->getVertexStrider(vertex_strider); mVertexBuffer->getNormalStrider(normal_strider); + mVertexBuffer->getTexCoord0Strider(tc_strider); mVertexBuffer->getIndexStrider(index_strider); // build vertices and normals @@ -806,7 +813,8 @@ void LLImagePreviewSculpted::setPreviewTarget(LLImageRaw* imagep, F32 distance) pos = (LLVector3*) vf.mPositions; pos.setStride(16); LLStrider<LLVector3> norm; norm = (LLVector3*) vf.mNormals; norm.setStride(16); - + LLStrider<LLVector2> tc; + tc = (LLVector2*) vf.mTexCoords; tc.setStride(8); for (U32 i = 0; i < num_vertices; i++) { @@ -814,6 +822,7 @@ void LLImagePreviewSculpted::setPreviewTarget(LLImageRaw* imagep, F32 distance) LLVector3 normal = *norm++; normal.normalize(); *(normal_strider++) = normal; + *(tc_strider++) = *tc++; } // build indices @@ -835,23 +844,28 @@ BOOL LLImagePreviewSculpted::render() LLGLEnable cull(GL_CULL_FACE); LLGLDepthTest depth(GL_TRUE); - glMatrixMode(GL_PROJECTION); + gGL.matrixMode(LLRender::MM_PROJECTION); gGL.pushMatrix(); - glLoadIdentity(); - glOrtho(0.0f, mFullWidth, 0.0f, mFullHeight, -1.0f, 1.0f); + gGL.loadIdentity(); + gGL.ortho(0.0f, mFullWidth, 0.0f, mFullHeight, -1.0f, 1.0f); - glMatrixMode(GL_MODELVIEW); + gGL.matrixMode(LLRender::MM_MODELVIEW); gGL.pushMatrix(); - glLoadIdentity(); + gGL.loadIdentity(); gGL.color4f(0.15f, 0.2f, 0.3f, 1.f); - gl_rect_2d_simple( mFullWidth, mFullHeight ); + if (LLGLSLShader::sNoFixedFunction) + { + gUIProgram.bind(); + } - glMatrixMode(GL_PROJECTION); + gl_rect_2d_simple( mFullWidth, mFullHeight ); + + gGL.matrixMode(LLRender::MM_PROJECTION); gGL.popMatrix(); - glMatrixMode(GL_MODELVIEW); + gGL.matrixMode(LLRender::MM_MODELVIEW); gGL.popMatrix(); glClear(GL_DEPTH_BUFFER_BIT); @@ -876,17 +890,28 @@ BOOL LLImagePreviewSculpted::render() const LLVolumeFace &vf = mVolume->getVolumeFace(0); U32 num_indices = vf.mNumIndices; - mVertexBuffer->setBuffer(LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_NORMAL); - gPipeline.enableLightsAvatar(); + + if (LLGLSLShader::sNoFixedFunction) + { + gObjectPreviewProgram.bind(); + } gGL.pushMatrix(); const F32 SCALE = 1.25f; gGL.scalef(SCALE, SCALE, SCALE); const F32 BRIGHTNESS = 0.9f; gGL.color3f(BRIGHTNESS, BRIGHTNESS, BRIGHTNESS); + + mVertexBuffer->setBuffer(LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_NORMAL | LLVertexBuffer::MAP_TEXCOORD0); mVertexBuffer->draw(LLRender::TRIANGLES, num_indices, 0); gGL.popMatrix(); + + if (LLGLSLShader::sNoFixedFunction) + { + gObjectPreviewProgram.unbind(); + } + return TRUE; } diff --git a/indra/newview/llfloaterinspect.cpp b/indra/newview/llfloaterinspect.cpp index a09b9ea235..cece8d299c 100644 --- a/indra/newview/llfloaterinspect.cpp +++ b/indra/newview/llfloaterinspect.cpp @@ -37,6 +37,7 @@ #include "llselectmgr.h" #include "lltoolcomp.h" #include "lltoolmgr.h" +#include "lltrans.h" #include "llviewercontrol.h" #include "llviewerobject.h" #include "lluictrlfactory.h" @@ -166,6 +167,15 @@ LLUUID LLFloaterInspect::getSelectedUUID() return LLUUID::null; } +void LLFloaterInspect::onGetAvNameCallback(const LLUUID& idCreator, const LLAvatarName& av_name, void* FloaterPtr) +{ + if (FloaterPtr) + { + LLFloaterInspect* floater = (LLFloaterInspect*)FloaterPtr; + floater->dirty(); + } +} + void LLFloaterInspect::refresh() { LLUUID creator_id; @@ -205,11 +215,32 @@ void LLFloaterInspect::refresh() substitution["datetime"] = (S32) timestamp; LLStringUtil::format (timeStr, substitution); + const LLUUID& idOwner = obj->mPermissions->getOwner(); + const LLUUID& idCreator = obj->mPermissions->getCreator(); LLAvatarName av_name; - LLAvatarNameCache::get(obj->mPermissions->getOwner(), &av_name); - owner_name = av_name.getCompleteName(); - LLAvatarNameCache::get(obj->mPermissions->getCreator(), &av_name); - creator_name = av_name.getCompleteName(); + + // Only work with the names if we actually get a result + // from the name cache. If not, defer setting the + // actual name and set a placeholder. + if (LLAvatarNameCache::get(idOwner, &av_name)) + { + owner_name = av_name.getCompleteName(); + } + else + { + owner_name = LLTrans::getString("RetrievingData"); + LLAvatarNameCache::get(idOwner, boost::bind(&LLFloaterInspect::onGetAvNameCallback, _1, _2, this)); + } + + if (LLAvatarNameCache::get(idCreator, &av_name)) + { + creator_name = av_name.getCompleteName(); + } + else + { + creator_name = LLTrans::getString("RetrievingData"); + LLAvatarNameCache::get(idCreator, boost::bind(&LLFloaterInspect::onGetAvNameCallback, _1, _2, this)); + } row["id"] = obj->getObject()->getID(); row["columns"][0]["column"] = "object_name"; diff --git a/indra/newview/llfloaterinspect.h b/indra/newview/llfloaterinspect.h index d9ffdf114b..7ee83ccdb4 100644 --- a/indra/newview/llfloaterinspect.h +++ b/indra/newview/llfloaterinspect.h @@ -29,6 +29,7 @@ #ifndef LL_LLFLOATERINSPECT_H #define LL_LLFLOATERINSPECT_H +#include "llavatarname.h" #include "llfloater.h" //class LLTool; @@ -53,6 +54,9 @@ public: void onClickCreatorProfile(); void onClickOwnerProfile(); void onSelectObject(); + + static void onGetAvNameCallback(const LLUUID& idCreator, const LLAvatarName& av_name, void* FloaterPtr); + LLScrollListCtrl* mObjectList; protected: // protected members diff --git a/indra/newview/llfloaterland.cpp b/indra/newview/llfloaterland.cpp index 4746f93009..b13a9aab88 100644 --- a/indra/newview/llfloaterland.cpp +++ b/indra/newview/llfloaterland.cpp @@ -433,7 +433,6 @@ BOOL LLPanelLandGeneral::postBuild() mTextDwell = getChild<LLTextBox>("DwellText"); - mBtnBuyLand = getChild<LLButton>("Buy Land..."); mBtnBuyLand->setClickedCallback(onClickBuyLand, (void*)&BUY_PERSONAL_LAND); @@ -696,20 +695,26 @@ void LLPanelLandGeneral::refresh() S32 area; S32 claim_price; S32 rent_price; - F32 dwell; + F32 dwell = DWELL_NAN; LLViewerParcelMgr::getInstance()->getDisplayInfo(&area, &claim_price, &rent_price, &for_sale, &dwell); - // Area LLUIString price = getString("area_size_text"); price.setArg("[AREA]", llformat("%d",area)); mTextPriceLabel->setText(getString("area_text")); mTextPrice->setText(price.getString()); - mTextDwell->setText(llformat("%.0f", dwell)); + if (dwell == DWELL_NAN) + { + mTextDwell->setText(LLTrans::getString("LoadingData")); + } + else + { + mTextDwell->setText(llformat("%.0f", dwell)); + } if (for_sale) { @@ -1801,7 +1806,6 @@ LLPanelLandOptions::LLPanelLandOptions(LLParcelSelectionHandle& parcel) mCheckEditGroupObjects(NULL), mCheckAllObjectEntry(NULL), mCheckGroupObjectEntry(NULL), - mCheckEditLand(NULL), mCheckSafe(NULL), mCheckFly(NULL), mCheckGroupScripts(NULL), @@ -1835,10 +1839,6 @@ BOOL LLPanelLandOptions::postBuild() mCheckGroupObjectEntry = getChild<LLCheckBoxCtrl>( "group object entry check"); childSetCommitCallback("group object entry check", onCommitAny, this); - mCheckEditLand = getChild<LLCheckBoxCtrl>( "edit land check"); - childSetCommitCallback("edit land check", onCommitAny, this); - - mCheckGroupScripts = getChild<LLCheckBoxCtrl>( "check group scripts"); childSetCommitCallback("check group scripts", onCommitAny, this); @@ -1951,9 +1951,6 @@ void LLPanelLandOptions::refresh() mCheckGroupObjectEntry ->set(FALSE); mCheckGroupObjectEntry ->setEnabled(FALSE); - mCheckEditLand ->set(FALSE); - mCheckEditLand ->setEnabled(FALSE); - mCheckSafe ->set(FALSE); mCheckSafe ->setEnabled(FALSE); @@ -2001,10 +1998,6 @@ void LLPanelLandOptions::refresh() mCheckGroupObjectEntry ->set( parcel->getAllowGroupObjectEntry() || parcel->getAllowAllObjectEntry()); mCheckGroupObjectEntry ->setEnabled( can_change_options && !parcel->getAllowAllObjectEntry() ); - - BOOL can_change_terraform = LLViewerParcelMgr::isParcelModifiableByAgent(parcel, GP_LAND_EDIT); - mCheckEditLand ->set( parcel->getAllowTerraform() ); - mCheckEditLand ->setEnabled( can_change_terraform ); mCheckSafe ->set( !parcel->getAllowDamage() ); mCheckSafe ->setEnabled( can_change_options ); @@ -2230,7 +2223,7 @@ void LLPanelLandOptions::onCommitAny(LLUICtrl *ctrl, void *userdata) BOOL create_group_objects = self->mCheckEditGroupObjects->get() || self->mCheckEditObjects->get(); BOOL all_object_entry = self->mCheckAllObjectEntry->get(); BOOL group_object_entry = self->mCheckGroupObjectEntry->get() || self->mCheckAllObjectEntry->get(); - BOOL allow_terraform = self->mCheckEditLand->get(); + BOOL allow_terraform = false; // removed from UI so always off now - self->mCheckEditLand->get(); BOOL allow_damage = !self->mCheckSafe->get(); BOOL allow_fly = self->mCheckFly->get(); BOOL allow_landmark = TRUE; // cannot restrict landmark creation diff --git a/indra/newview/llfloaterland.h b/indra/newview/llfloaterland.h index 6fceca1acd..4f1c10274a 100644 --- a/indra/newview/llfloaterland.h +++ b/indra/newview/llfloaterland.h @@ -330,7 +330,6 @@ private: LLCheckBoxCtrl* mCheckEditGroupObjects; LLCheckBoxCtrl* mCheckAllObjectEntry; LLCheckBoxCtrl* mCheckGroupObjectEntry; - LLCheckBoxCtrl* mCheckEditLand; LLCheckBoxCtrl* mCheckSafe; LLCheckBoxCtrl* mCheckFly; LLCheckBoxCtrl* mCheckGroupScripts; diff --git a/indra/newview/llfloatermediabrowser.cpp b/indra/newview/llfloatermediabrowser.cpp deleted file mode 100644 index 7a670dd90c..0000000000 --- a/indra/newview/llfloatermediabrowser.cpp +++ /dev/null @@ -1,462 +0,0 @@ -/** - * @file llfloatermediabrowser.cpp - * @brief media browser floater - uses embedded media browser control - * - * $LicenseInfo:firstyear=2006&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2010, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -#include "llviewerprecompiledheaders.h" - -#include "llfloatermediabrowser.h" - -#include "llfloaterreg.h" -#include "llparcel.h" -#include "llpluginclassmedia.h" -#include "lluictrlfactory.h" -#include "llmediactrl.h" -#include "llviewerwindow.h" -#include "llviewercontrol.h" -#include "llviewerparcelmgr.h" -#include "llweb.h" -#include "llui.h" -#include "roles_constants.h" - -#include "llurlhistory.h" -#include "llmediactrl.h" -#include "llviewermedia.h" -#include "llviewerparcelmedia.h" -#include "llcombobox.h" -#include "llwindow.h" -#include "lllayoutstack.h" -#include "llcheckboxctrl.h" - -#include "llnotifications.h" - -// TEMP -#include "llsdutil.h" - -LLFloaterMediaBrowser::LLFloaterMediaBrowser(const LLSD& key) - : LLFloater(key) -{ -} - -//static -void LLFloaterMediaBrowser::create(const std::string &url, const std::string& target, const std::string& uuid) -{ - lldebugs << "url = " << url << ", target = " << target << ", uuid = " << uuid << llendl; - - std::string tag = target; - - if(target.empty() || target == "_blank") - { - if(!uuid.empty()) - { - tag = uuid; - } - else - { - // create a unique tag for this instance - LLUUID id; - id.generate(); - tag = id.asString(); - } - } - - S32 browser_window_limit = gSavedSettings.getS32("MediaBrowserWindowLimit"); - - if(LLFloaterReg::findInstance("media_browser", tag) != NULL) - { - // There's already a media browser for this tag, so we won't be opening a new window. - } - else if(browser_window_limit != 0) - { - // showInstance will open a new window. Figure out how many media browsers are already open, - // and close the least recently opened one if this will put us over the limit. - - LLFloaterReg::const_instance_list_t &instances = LLFloaterReg::getFloaterList("media_browser"); - lldebugs << "total instance count is " << instances.size() << llendl; - - for(LLFloaterReg::const_instance_list_t::const_iterator iter = instances.begin(); iter != instances.end(); iter++) - { - lldebugs << " " << (*iter)->getKey() << llendl; - } - - if(instances.size() >= (size_t)browser_window_limit) - { - // Destroy the least recently opened instance - (*instances.begin())->closeFloater(); - } - } - - LLFloaterMediaBrowser *browser = dynamic_cast<LLFloaterMediaBrowser*> (LLFloaterReg::showInstance("media_browser", tag)); - llassert(browser); - if(browser) - { - browser->mUUID = uuid; - - // tell the browser instance to load the specified URL - browser->openMedia(url, target); - LLViewerMedia::proxyWindowOpened(target, uuid); - } -} - -//static -void LLFloaterMediaBrowser::closeRequest(const std::string &uuid) -{ - LLFloaterReg::const_instance_list_t& inst_list = LLFloaterReg::getFloaterList("media_browser"); - lldebugs << "instance list size is " << inst_list.size() << ", incoming uuid is " << uuid << llendl; - for (LLFloaterReg::const_instance_list_t::const_iterator iter = inst_list.begin(); iter != inst_list.end(); ++iter) - { - LLFloaterMediaBrowser* i = dynamic_cast<LLFloaterMediaBrowser*>(*iter); - lldebugs << " " << i->mUUID << llendl; - if (i && i->mUUID == uuid) - { - i->closeFloater(false); - return; - } - } -} - -//static -void LLFloaterMediaBrowser::geometryChanged(const std::string &uuid, S32 x, S32 y, S32 width, S32 height) -{ - LLFloaterReg::const_instance_list_t& inst_list = LLFloaterReg::getFloaterList("media_browser"); - lldebugs << "instance list size is " << inst_list.size() << ", incoming uuid is " << uuid << llendl; - for (LLFloaterReg::const_instance_list_t::const_iterator iter = inst_list.begin(); iter != inst_list.end(); ++iter) - { - LLFloaterMediaBrowser* i = dynamic_cast<LLFloaterMediaBrowser*>(*iter); - lldebugs << " " << i->mUUID << llendl; - if (i && i->mUUID == uuid) - { - i->geometryChanged(x, y, width, height); - return; - } -} -} - -void LLFloaterMediaBrowser::geometryChanged(S32 x, S32 y, S32 width, S32 height) -{ - // Make sure the layout of the browser control is updated, so this calculation is correct. - LLLayoutStack::updateClass(); - - // TODO: need to adjust size and constrain position to make sure floaters aren't moved outside the window view, etc. - LLCoordWindow window_size; - getWindow()->getSize(&window_size); - - // Adjust width and height for the size of the chrome on the Media Browser window. - width += getRect().getWidth() - mBrowser->getRect().getWidth(); - height += getRect().getHeight() - mBrowser->getRect().getHeight(); - - LLRect geom; - geom.setOriginAndSize(x, window_size.mY - (y + height), width, height); - - lldebugs << "geometry change: " << geom << llendl; - - handleReshape(geom,false); -} - - -void LLFloaterMediaBrowser::draw() -{ - getChildView("go")->setEnabled(!mAddressCombo->getValue().asString().empty()); - LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); - if(parcel) - { - getChildView("parcel_owner_controls")->setVisible( LLViewerParcelMgr::isParcelModifiableByAgent(parcel, GP_LAND_CHANGE_MEDIA)); - getChildView("assign")->setEnabled(!mAddressCombo->getValue().asString().empty()); - } - bool show_time_controls = false; - bool media_playing = false; - if(mBrowser) - { - LLPluginClassMedia* media_plugin = mBrowser->getMediaPlugin(); - if(media_plugin) - { - show_time_controls = media_plugin->pluginSupportsMediaTime(); - media_playing = media_plugin->getStatus() == LLPluginClassMediaOwner::MEDIA_PLAYING; - } - } - getChildView("rewind")->setVisible( show_time_controls); - getChildView("play")->setVisible( show_time_controls && ! media_playing); - getChildView("pause")->setVisible( show_time_controls && media_playing); - getChildView("stop")->setVisible( show_time_controls); - getChildView("seek")->setVisible( show_time_controls); - - getChildView("play")->setEnabled(! media_playing); - getChildView("stop")->setEnabled(media_playing); - - getChildView("back")->setEnabled(mBrowser->canNavigateBack()); - getChildView("forward")->setEnabled(mBrowser->canNavigateForward()); - - LLFloater::draw(); -} - -BOOL LLFloaterMediaBrowser::postBuild() -{ - mBrowser = getChild<LLMediaCtrl>("browser"); - mBrowser->addObserver(this); - - mAddressCombo = getChild<LLComboBox>("address"); - mAddressCombo->setCommitCallback(onEnterAddress, this); - mAddressCombo->sortByName(); - - childSetAction("back", onClickBack, this); - childSetAction("forward", onClickForward, this); - childSetAction("reload", onClickRefresh, this); - childSetAction("rewind", onClickRewind, this); - childSetAction("play", onClickPlay, this); - childSetAction("stop", onClickStop, this); - childSetAction("pause", onClickPlay, this); - childSetAction("seek", onClickSeek, this); - childSetAction("go", onClickGo, this); - childSetAction("close", onClickClose, this); - childSetAction("open_browser", onClickOpenWebBrowser, this); - childSetAction("assign", onClickAssign, this); - - buildURLHistory(); - - return TRUE; -} - -void LLFloaterMediaBrowser::buildURLHistory() -{ - LLCtrlListInterface* url_list = childGetListInterface("address"); - if (url_list) - { - url_list->operateOnAll(LLCtrlListInterface::OP_DELETE); - } - - // Get all of the entries in the "browser" collection - LLSD browser_history = LLURLHistory::getURLHistory("browser"); - - LLSD::array_iterator iter_history = - browser_history.beginArray(); - LLSD::array_iterator end_history = - browser_history.endArray(); - for(; iter_history != end_history; ++iter_history) - { - std::string url = (*iter_history).asString(); - if(! url.empty()) - url_list->addSimpleElement(url); - } - - // initialize URL history in the plugin - if(mBrowser && mBrowser->getMediaPlugin()) - { - mBrowser->getMediaPlugin()->initializeUrlHistory(browser_history); - } -} - -std::string LLFloaterMediaBrowser::getSupportURL() -{ - return getString("support_page_url"); -} - -//virtual -void LLFloaterMediaBrowser::onClose(bool app_quitting) -{ - LLViewerMedia::proxyWindowClosed(mUUID); - //setVisible(FALSE); - destroy(); -} - -void LLFloaterMediaBrowser::handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event) -{ - if(event == MEDIA_EVENT_LOCATION_CHANGED) - { - setCurrentURL(self->getLocation()); - } - else if(event == MEDIA_EVENT_NAVIGATE_COMPLETE) - { - // This is the event these flags are sent with. - getChildView("back")->setEnabled(self->getHistoryBackAvailable()); - getChildView("forward")->setEnabled(self->getHistoryForwardAvailable()); - } - else if(event == MEDIA_EVENT_CLOSE_REQUEST) - { - // The browser instance wants its window closed. - closeFloater(); - } - else if(event == MEDIA_EVENT_GEOMETRY_CHANGE) - { - geometryChanged(self->getGeometryX(), self->getGeometryY(), self->getGeometryWidth(), self->getGeometryHeight()); - } -} - -void LLFloaterMediaBrowser::setCurrentURL(const std::string& url) -{ - mCurrentURL = url; - - mAddressCombo->remove(mCurrentURL); - mAddressCombo->add(mCurrentURL); - mAddressCombo->selectByValue(mCurrentURL); - - // Serialize url history - LLURLHistory::removeURL("browser", mCurrentURL); - LLURLHistory::addURL("browser", mCurrentURL); - - getChildView("back")->setEnabled(mBrowser->canNavigateBack()); - getChildView("forward")->setEnabled(mBrowser->canNavigateForward()); - getChildView("reload")->setEnabled(TRUE); -} - -//static -void LLFloaterMediaBrowser::onEnterAddress(LLUICtrl* ctrl, void* user_data) -{ - LLFloaterMediaBrowser* self = (LLFloaterMediaBrowser*)user_data; - self->mBrowser->navigateTo(self->mAddressCombo->getValue().asString()); -} - -//static -void LLFloaterMediaBrowser::onClickRefresh(void* user_data) -{ - LLFloaterMediaBrowser* self = (LLFloaterMediaBrowser*)user_data; - - if( self->mBrowser->getMediaPlugin() && self->mBrowser->getMediaPlugin()->pluginSupportsMediaBrowser()) - { - bool ignore_cache = true; - self->mBrowser->getMediaPlugin()->browse_reload( ignore_cache ); - } - else - { - self->mBrowser->navigateTo(self->mCurrentURL); - } -} - -//static -void LLFloaterMediaBrowser::onClickForward(void* user_data) -{ - LLFloaterMediaBrowser* self = (LLFloaterMediaBrowser*)user_data; - - self->mBrowser->navigateForward(); -} - -//static -void LLFloaterMediaBrowser::onClickBack(void* user_data) -{ - LLFloaterMediaBrowser* self = (LLFloaterMediaBrowser*)user_data; - - self->mBrowser->navigateBack(); -} - -//static -void LLFloaterMediaBrowser::onClickGo(void* user_data) -{ - LLFloaterMediaBrowser* self = (LLFloaterMediaBrowser*)user_data; - - self->mBrowser->navigateTo(self->mAddressCombo->getValue().asString()); -} - -//static -void LLFloaterMediaBrowser::onClickClose(void* user_data) -{ - LLFloaterMediaBrowser* self = (LLFloaterMediaBrowser*)user_data; - - self->closeFloater(); -} - -//static -void LLFloaterMediaBrowser::onClickOpenWebBrowser(void* user_data) -{ - LLFloaterMediaBrowser* self = (LLFloaterMediaBrowser*)user_data; - - std::string url = self->mCurrentURL.empty() ? - self->mBrowser->getHomePageUrl() : - self->mCurrentURL; - LLWeb::loadURLExternal(url); -} - -void LLFloaterMediaBrowser::onClickAssign(void* user_data) -{ - LLFloaterMediaBrowser* self = (LLFloaterMediaBrowser*)user_data; - - LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); - if (!parcel) - { - return; - } - std::string media_url = self->mAddressCombo->getValue().asString(); - LLStringUtil::trim(media_url); - - if(parcel->getMediaType() != "text/html") - { - parcel->setMediaURL(media_url); - parcel->setMediaCurrentURL(media_url); - parcel->setMediaType(std::string("text/html")); - LLViewerParcelMgr::getInstance()->sendParcelPropertiesUpdate( parcel, true ); - LLViewerParcelMedia::sendMediaNavigateMessage(media_url); - LLViewerParcelMedia::stop(); - // LLViewerParcelMedia::update( parcel ); - } - LLViewerParcelMedia::sendMediaNavigateMessage(media_url); -} -//static -void LLFloaterMediaBrowser::onClickRewind(void* user_data) -{ - LLFloaterMediaBrowser* self = (LLFloaterMediaBrowser*)user_data; - - if(self->mBrowser->getMediaPlugin()) - self->mBrowser->getMediaPlugin()->start(-2.0f); -} -//static -void LLFloaterMediaBrowser::onClickPlay(void* user_data) -{ - LLFloaterMediaBrowser* self = (LLFloaterMediaBrowser*)user_data; - - LLPluginClassMedia* plugin = self->mBrowser->getMediaPlugin(); - if(plugin) - { - if(plugin->getStatus() == LLPluginClassMediaOwner::MEDIA_PLAYING) - { - plugin->pause(); - } - else - { - plugin->start(); - } - } -} -//static -void LLFloaterMediaBrowser::onClickStop(void* user_data) -{ - LLFloaterMediaBrowser* self = (LLFloaterMediaBrowser*)user_data; - - if(self->mBrowser->getMediaPlugin()) - self->mBrowser->getMediaPlugin()->stop(); -} -//static -void LLFloaterMediaBrowser::onClickSeek(void* user_data) -{ - LLFloaterMediaBrowser* self = (LLFloaterMediaBrowser*)user_data; - - if(self->mBrowser->getMediaPlugin()) - self->mBrowser->getMediaPlugin()->start(2.0f); -} -void LLFloaterMediaBrowser::openMedia(const std::string& media_url, const std::string& target) -{ - mBrowser->setHomePageUrl(media_url); - mBrowser->setTarget(target); - mBrowser->navigateTo(media_url); - setCurrentURL(media_url); -} - - diff --git a/indra/newview/llfloatermediabrowser.h b/indra/newview/llfloatermediabrowser.h deleted file mode 100644 index 152d221a01..0000000000 --- a/indra/newview/llfloatermediabrowser.h +++ /dev/null @@ -1,86 +0,0 @@ -/** - * @file llfloatermediabrowser.h - * @brief media browser floater - uses embedded media browser control - * - * $LicenseInfo:firstyear=2006&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2010, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -#ifndef LL_LLFLOATERMEDIABROWSER_H -#define LL_LLFLOATERMEDIABROWSER_H - -#include "llfloater.h" -#include "llmediactrl.h" - - -class LLComboBox; -class LLMediaCtrl; -class LLNotification; - -class LLFloaterMediaBrowser : - public LLFloater, - public LLViewerMediaObserver -{ -public: - LOG_CLASS(LLFloaterMediaBrowser); - LLFloaterMediaBrowser(const LLSD& key); - - static void create(const std::string &url, const std::string& target, const std::string& uuid = LLStringUtil::null); - - static void closeRequest(const std::string &uuid); - static void geometryChanged(const std::string &uuid, S32 x, S32 y, S32 width, S32 height); - void geometryChanged(S32 x, S32 y, S32 width, S32 height); - - /*virtual*/ BOOL postBuild(); - /*virtual*/ void onClose(bool app_quitting); - /*virtual*/ void draw(); - - // inherited from LLViewerMediaObserver - /*virtual*/ void handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event); - - void openMedia(const std::string& media_url, const std::string& target); - void buildURLHistory(); - std::string getSupportURL(); - void setCurrentURL(const std::string& url); - - static void onEnterAddress(LLUICtrl* ctrl, void* user_data); - static void onClickRefresh(void* user_data); - static void onClickBack(void* user_data); - static void onClickForward(void* user_data); - static void onClickGo(void* user_data); - static void onClickClose(void* user_data); - static void onClickOpenWebBrowser(void* user_data); - static void onClickAssign(void* user_data); - static void onClickRewind(void* user_data); - static void onClickPlay(void* user_data); - static void onClickStop(void* user_data); - static void onClickSeek(void* user_data); - -private: - LLMediaCtrl* mBrowser; - LLComboBox* mAddressCombo; - std::string mCurrentURL; - boost::shared_ptr<LLNotification> mCurNotification; - std::string mUUID; -}; - -#endif // LL_LLFLOATERMEDIABROWSER_H - diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp index 881f087d7b..64bdcccd9f 100644..100755 --- a/indra/newview/llfloatermodelpreview.cpp +++ b/indra/newview/llfloatermodelpreview.cpp @@ -26,6 +26,10 @@ #include "llviewerprecompiledheaders.h" +#if LL_MSVC +#pragma warning (disable : 4263) +#pragma warning (disable : 4264) +#endif #include "dae.h" //#include "dom.h" #include "dom/domAsset.h" @@ -47,6 +51,10 @@ #include "dom/domScale.h" #include "dom/domTranslate.h" #include "dom/domVisual_scene.h" +#if LL_MSVC +#pragma warning (default : 4263) +#pragma warning (default : 4264) +#endif #include "llfloatermodelpreview.h" @@ -103,6 +111,7 @@ #include "llviewerobjectlist.h" #include "llanimationstates.h" #include "llviewernetwork.h" +#include "llviewershadermgr.h" #include "glod/glod.h" #include <boost/algorithm/string.hpp> @@ -496,6 +505,11 @@ BOOL LLFloaterModelPreview::postBuild() { validate_url = "http://secondlife.com/my/account/mesh.php"; } + else if (current_grid == "damballah") + { + // Staging grid has its own naming scheme. + validate_url = "http://secondlife-staging.com/my/account/mesh.php"; + } else { validate_url = llformat("http://secondlife.%s.lindenlab.com/my/account/mesh.php",current_grid.c_str()); @@ -744,6 +758,11 @@ void LLFloaterModelPreview::draw() if (!mModelPreview->mLoading) { + if ( mModelPreview->getLoadState() == LLModelLoader::ERROR_MATERIALS ) + { + childSetTextArg("status", "[STATUS]", getString("status_material_mismatch")); + } + else if ( mModelPreview->getLoadState() > LLModelLoader::ERROR_PARSING ) { childSetTextArg("status", "[STATUS]", getString(LLModel::getStatusString(mModelPreview->getLoadState() - LLModelLoader::ERROR_PARSING))); @@ -995,38 +1014,38 @@ void LLFloaterModelPreview::onPhysicsBrowse(LLUICtrl* ctrl, void* userdata) //static void LLFloaterModelPreview::onPhysicsUseLOD(LLUICtrl* ctrl, void* userdata) { - S32 num_modes = 4; - S32 which_mode = 3; - static S32 previous_mode = which_mode; + S32 num_lods = 4; + S32 which_mode; LLCtrlSelectionInterface* iface = sInstance->childGetSelectionInterface("physics_lod_combo"); if (iface) { which_mode = iface->getFirstSelectedIndex(); } + else + { + llwarns << "no iface" << llendl; + return; + } - S32 file_mode = iface->getItemCount() - 1; - bool file_browse = which_mode == file_mode; - bool lod_to_file = file_browse && (previous_mode != file_mode); - bool file_to_lod = !file_browse && (previous_mode == file_mode); - - if (!lod_to_file) + if (which_mode <= 0) { - which_mode = num_modes - which_mode; - sInstance->mModelPreview->setPhysicsFromLOD(which_mode); + llwarns << "which_mode out of range, " << which_mode << llendl; } - if (lod_to_file || file_to_lod) + S32 file_mode = iface->getItemCount() - 1; + if (which_mode < file_mode) { - LLModelPreview *model_preview = sInstance->mModelPreview; - if (model_preview) - { - model_preview->refresh(); - model_preview->updateStatusMessages(); - } + S32 which_lod = num_lods - which_mode; + sInstance->mModelPreview->setPhysicsFromLOD(which_lod); } - previous_mode = which_mode; + LLModelPreview *model_preview = sInstance->mModelPreview; + if (model_preview) + { + model_preview->refresh(); + model_preview->updateStatusMessages(); + } } //static @@ -3304,7 +3323,7 @@ void LLModelPreview::rebuildUploadData() F32 max_scale = 0.f; //reorder materials to match mBaseModel - for (U32 i = 0; i < LLModel::NUM_LODS; i++) + for (U32 i = 0; i < LLModel::NUM_LODS-1; i++) { if (mBaseModel.size() == mModel[i].size()) { @@ -3316,6 +3335,7 @@ void LLModelPreview::rebuildUploadData() if ( !mModel[i][j]->matchMaterialOrder(mBaseModel[j], refFaceCnt, modelFaceCnt ) ) { + setLoadState( LLModelLoader::ERROR_MATERIALS ); mFMP->childDisable( "calculate_btn" ); } } @@ -3840,6 +3860,15 @@ void LLModelPreview::genLODs(S32 which_lod, U32 decimation, bool enforce_tri_lim LLVertexBuffer::unbind(); + bool no_ff = LLGLSLShader::sNoFixedFunction; + LLGLSLShader* shader = LLGLSLShader::sCurBoundShaderPtr; + LLGLSLShader::sNoFixedFunction = false; + + if (shader) + { + shader->unbind(); + } + stop_gloderror(); static U32 cur_name = 1; @@ -4138,6 +4167,13 @@ void LLModelPreview::genLODs(S32 which_lod, U32 decimation, bool enforce_tri_lim mResourceCost = calcResourceCost(); + LLVertexBuffer::unbind(); + LLGLSLShader::sNoFixedFunction = no_ff; + if (shader) + { + shader->bind(); + } + /*if (which_lod == -1 && mScene[LLModel::LOD_PHYSICS].empty()) { //build physics scene mScene[LLModel::LOD_PHYSICS] = mScene[LLModel::LOD_LOW]; @@ -4351,11 +4387,6 @@ void LLModelPreview::updateStatusMessages() { skinAndRigOk = false; } - else - if ( !isLegacyRigValid() ) - { - mFMP->childDisable("calculate_btn"); - } } if(upload_ok && mModelLoader) @@ -4888,6 +4919,8 @@ BOOL LLModelPreview::render() LLMutexLock lock(this); mNeedsUpdate = FALSE; + bool use_shaders = LLGLSLShader::sNoFixedFunction; + bool edges = mViewOption["show_edges"]; bool joint_positions = mViewOption["show_joint_positions"]; bool skin_weight = mViewOption["show_skin_weight"]; @@ -4904,25 +4937,33 @@ BOOL LLModelPreview::render() LLGLDisable fog(GL_FOG); { + if (use_shaders) + { + gUIProgram.bind(); + } //clear background to blue - glMatrixMode(GL_PROJECTION); + gGL.matrixMode(LLRender::MM_PROJECTION); gGL.pushMatrix(); - glLoadIdentity(); - glOrtho(0.0f, width, 0.0f, height, -1.0f, 1.0f); + gGL.loadIdentity(); + gGL.ortho(0.0f, width, 0.0f, height, -1.0f, 1.0f); - glMatrixMode(GL_MODELVIEW); + gGL.matrixMode(LLRender::MM_MODELVIEW); gGL.pushMatrix(); - glLoadIdentity(); + gGL.loadIdentity(); gGL.color4f(0.169f, 0.169f, 0.169f, 1.f); gl_rect_2d_simple( width, height ); - glMatrixMode(GL_PROJECTION); + gGL.matrixMode(LLRender::MM_PROJECTION); gGL.popMatrix(); - glMatrixMode(GL_MODELVIEW); + gGL.matrixMode(LLRender::MM_MODELVIEW); gGL.popMatrix(); + if (use_shaders) + { + gUIProgram.unbind(); + } } LLFloaterModelPreview* fmp = LLFloaterModelPreview::sInstance; @@ -5035,7 +5076,7 @@ BOOL LLModelPreview::render() refresh(); } - glLoadIdentity(); + gGL.loadIdentity(); gPipeline.enableLightsPreview(); LLQuaternion camera_rot = LLQuaternion(mCameraPitch, LLVector3::y_axis) * @@ -5060,6 +5101,11 @@ BOOL LLModelPreview::render() const U32 type_mask = LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_NORMAL | LLVertexBuffer::MAP_TEXCOORD0; + if (use_shaders) + { + gObjectPreviewProgram.bind(); + } + LLGLEnable normalize(GL_NORMALIZE); if (!mBaseModel.empty() && mVertexBuffer[5].empty()) @@ -5071,6 +5117,8 @@ BOOL LLModelPreview::render() if (!mModel[mPreviewLOD].empty()) { + mFMP->childEnable("reset_btn"); + bool regen = mVertexBuffer[mPreviewLOD].empty(); if (!regen) { @@ -5083,7 +5131,7 @@ BOOL LLModelPreview::render() } //make sure material lists all match - for (U32 i = 0; i < LLModel::NUM_LODS; i++) + for (U32 i = 0; i < LLModel::NUM_LODS-1; i++) { if (mBaseModel.size() == mModel[i].size()) { @@ -5121,7 +5169,7 @@ BOOL LLModelPreview::render() gGL.pushMatrix(); LLMatrix4 mat = instance.mTransform; - glMultMatrixf((GLfloat*) mat.mMatrix); + gGL.multMatrix((GLfloat*) mat.mMatrix); for (U32 i = 0; i < mVertexBuffer[mPreviewLOD][model].size(); ++i) { @@ -5137,7 +5185,8 @@ BOOL LLModelPreview::render() const std::string& binding = instance.mModel->mMaterialList[i]; const LLImportMaterial& material = instance.mMaterial[binding]; - glColor4fv(material.mDiffuseColor.mV); + gGL.diffuseColor4fv(material.mDiffuseColor.mV); + if (material.mDiffuseMap.notNull()) { if (material.mDiffuseMap->getDiscardLevel() > -1) @@ -5150,12 +5199,12 @@ BOOL LLModelPreview::render() } else { - glColor4f(1,1,1,1); + gGL.diffuseColor4f(1,1,1,1); } buffer->drawRange(LLRender::TRIANGLES, 0, buffer->getNumVerts()-1, buffer->getNumIndices(), 0); gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); - glColor3f(0.4f, 0.4f, 0.4f); + gGL.diffuseColor3f(0.4f, 0.4f, 0.4f); if (edges) { @@ -5203,7 +5252,7 @@ BOOL LLModelPreview::render() gGL.pushMatrix(); LLMatrix4 mat = instance.mTransform; - glMultMatrixf((GLfloat*) mat.mMatrix); + gGL.multMatrix((GLfloat*) mat.mMatrix); bool render_mesh = true; @@ -5268,12 +5317,12 @@ BOOL LLModelPreview::render() LLVertexBuffer* buffer = mVertexBuffer[LLModel::LOD_PHYSICS][model][i]; gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); - glColor4f(0.4f, 0.4f, 0.0f, 0.4f); + gGL.diffuseColor4f(0.4f, 0.4f, 0.0f, 0.4f); buffer->setBuffer(type_mask & buffer->getTypeMask()); buffer->drawRange(LLRender::TRIANGLES, 0, buffer->getNumVerts()-1, buffer->getNumIndices(), 0); - glColor3f(1.f, 1.f, 0.f); + gGL.diffuseColor3f(1.f, 1.f, 0.f); glLineWidth(2.f); glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); @@ -5293,7 +5342,7 @@ BOOL LLModelPreview::render() //show degenerate triangles LLGLDepthTest depth(GL_TRUE, GL_TRUE, GL_ALWAYS); LLGLDisable cull(GL_CULL_FACE); - glColor4f(1.f,0.f,0.f,1.f); + gGL.diffuseColor4f(1.f,0.f,0.f,1.f); const LLVector4a scale(0.5f); for (LLMeshUploadThread::instance_list::iterator iter = mUploadData.begin(); iter != mUploadData.end(); ++iter) @@ -5310,7 +5359,7 @@ BOOL LLModelPreview::render() gGL.pushMatrix(); LLMatrix4 mat = instance.mTransform; - glMultMatrixf((GLfloat*) mat.mMatrix); + gGL.multMatrix((GLfloat*) mat.mMatrix); LLPhysicsDecomp* decomp = gMeshRepo.mDecompThread; @@ -5376,7 +5425,16 @@ BOOL LLModelPreview::render() if (joint_positions) { + LLGLSLShader* shader = LLGLSLShader::sCurBoundShaderPtr; + if (shader) + { + gDebugProgram.bind(); + } getPreviewAvatar()->renderCollisionVolumes(); + if (shader) + { + shader->bind(); + } } for (LLModelLoader::scene::iterator iter = mScene[mPreviewLOD].begin(); iter != mScene[mPreviewLOD].end(); ++iter) @@ -5415,7 +5473,7 @@ BOOL LLModelPreview::render() } } - for (U32 j = 0; j < buffer->getRequestedVerts(); ++j) + for (U32 j = 0; j < buffer->getNumVerts(); ++j) { LLMatrix4 final_mat; final_mat.mMatrix[0][0] = final_mat.mMatrix[1][1] = final_mat.mMatrix[2][2] = final_mat.mMatrix[3][3] = 0.f; @@ -5459,11 +5517,12 @@ BOOL LLModelPreview::render() const std::string& binding = instance.mModel->mMaterialList[i]; const LLImportMaterial& material = instance.mMaterial[binding]; + buffer->setBuffer(type_mask & buffer->getTypeMask()); - glColor4fv(material.mDiffuseColor.mV); + gGL.diffuseColor4fv(material.mDiffuseColor.mV); gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); buffer->draw(LLRender::TRIANGLES, buffer->getNumIndices(), 0); - glColor3f(0.4f, 0.4f, 0.4f); + gGL.diffuseColor3f(0.4f, 0.4f, 0.4f); if (edges) { @@ -5480,6 +5539,11 @@ BOOL LLModelPreview::render() } } + if (use_shaders) + { + gObjectPreviewProgram.unbind(); + } + gGL.popMatrix(); return TRUE; @@ -5568,6 +5632,7 @@ void LLFloaterModelPreview::onReset(void* user_data) assert_main_thread(); LLFloaterModelPreview* fmp = (LLFloaterModelPreview*) user_data; + fmp->childDisable("reset_btn"); LLModelPreview* mp = fmp->mModelPreview; std::string filename = mp->mLODFile[3]; diff --git a/indra/newview/llfloatermodelpreview.h b/indra/newview/llfloatermodelpreview.h index 47de99ce25..64324854a5 100644 --- a/indra/newview/llfloatermodelpreview.h +++ b/indra/newview/llfloatermodelpreview.h @@ -70,7 +70,8 @@ public: GENERATING_VERTEX_BUFFERS, GENERATING_LOD, DONE, - ERROR_PARSING //basically loading failed + ERROR_PARSING, //basically loading failed + ERROR_MATERIALS, } eLoadState; U32 mState; diff --git a/indra/newview/llfloaterpostcard.cpp b/indra/newview/llfloaterpostcard.cpp deleted file mode 100644 index 3bcbb987f7..0000000000 --- a/indra/newview/llfloaterpostcard.cpp +++ /dev/null @@ -1,384 +0,0 @@ -/** - * @file llfloaterpostcard.cpp - * @brief Postcard send floater, allows setting name, e-mail address, etc. - * - * $LicenseInfo:firstyear=2004&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2010, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -#include "llviewerprecompiledheaders.h" - -#include "llfloaterpostcard.h" - -#include "llfontgl.h" -#include "llsys.h" -#include "llgl.h" -#include "v3dmath.h" -#include "lldir.h" - -#include "llagent.h" -#include "llui.h" -#include "lllineeditor.h" -#include "llbutton.h" -#include "lltexteditor.h" -#include "llfloaterreg.h" -#include "llnotificationsutil.h" -#include "llviewercontrol.h" -#include "llviewernetwork.h" -#include "lluictrlfactory.h" -#include "lluploaddialog.h" -#include "llviewerstats.h" -#include "llviewerwindow.h" -#include "llstatusbar.h" -#include "llviewerregion.h" -#include "lleconomy.h" -#include "message.h" - -#include "llimagejpeg.h" -#include "llimagej2c.h" -#include "llvfile.h" -#include "llvfs.h" -#include "llviewertexture.h" -#include "llassetuploadresponders.h" -#include "llagentui.h" - -#include <boost/regex.hpp> //boost.regex lib - -///---------------------------------------------------------------------------- -/// Local function declarations, constants, enums, and typedefs -///---------------------------------------------------------------------------- - -///---------------------------------------------------------------------------- -/// Class LLFloaterPostcard -///---------------------------------------------------------------------------- - -LLFloaterPostcard::LLFloaterPostcard(const LLSD& key) -: LLFloater(key), - mJPEGImage(NULL), - mViewerImage(NULL), - mHasFirstMsgFocus(false) -{ -} - -// Destroys the object -LLFloaterPostcard::~LLFloaterPostcard() -{ - mJPEGImage = NULL; // deletes image -} - -BOOL LLFloaterPostcard::postBuild() -{ - // pick up the user's up-to-date email address - gAgent.sendAgentUserInfoRequest(); - - childSetAction("cancel_btn", onClickCancel, this); - childSetAction("send_btn", onClickSend, this); - - getChildView("from_form")->setEnabled(FALSE); - - std::string name_string; - LLAgentUI::buildFullname(name_string); - getChild<LLUICtrl>("name_form")->setValue(LLSD(name_string)); - - // For the first time a user focusess to .the msg box, all text will be selected. - getChild<LLUICtrl>("msg_form")->setFocusChangedCallback(boost::bind(onMsgFormFocusRecieved, _1, this)); - - getChild<LLUICtrl>("to_form")->setFocus(TRUE); - - return TRUE; -} - -// static -LLFloaterPostcard* LLFloaterPostcard::showFromSnapshot(LLImageJPEG *jpeg, LLViewerTexture *img, const LLVector2 &image_scale, const LLVector3d& pos_taken_global) -{ - // Take the images from the caller - // It's now our job to clean them up - LLFloaterPostcard* instance = LLFloaterReg::showTypedInstance<LLFloaterPostcard>("postcard", LLSD(img->getID())); - - if (instance) // may be 0 if we're in mouselook mode - { - instance->mJPEGImage = jpeg; - instance->mViewerImage = img; - instance->mImageScale = image_scale; - instance->mPosTakenGlobal = pos_taken_global; - } - - return instance; -} - -void LLFloaterPostcard::draw() -{ - LLGLSUIDefault gls_ui; - LLFloater::draw(); - - if(!isMinimized() && mViewerImage.notNull() && mJPEGImage.notNull()) - { - // Force the texture to be 100% opaque when the floater is focused. - F32 alpha = getTransparencyType() == TT_ACTIVE ? 1.0f : getCurrentTransparency(); - LLRect rect(getRect()); - - // first set the max extents of our preview - rect.translate(-rect.mLeft, -rect.mBottom); - rect.mLeft += 320; - rect.mRight -= 10; - rect.mTop -= 27; - rect.mBottom = rect.mTop - 130; - - // then fix the aspect ratio - F32 ratio = (F32)mJPEGImage->getWidth() / (F32)mJPEGImage->getHeight(); - if ((F32)rect.getWidth() / (F32)rect.getHeight() >= ratio) - { - rect.mRight = LLRect::tCoordType((F32)rect.mLeft + ((F32)rect.getHeight() * ratio)); - } - else - { - rect.mBottom = LLRect::tCoordType((F32)rect.mTop - ((F32)rect.getWidth() / ratio)); - } - { - gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); - gl_rect_2d(rect, LLColor4(0.f, 0.f, 0.f, 1.f) % alpha); - rect.stretch(-1); - } - { - - glMatrixMode(GL_TEXTURE); - glPushMatrix(); - { - glScalef(mImageScale.mV[VX], mImageScale.mV[VY], 1.f); - glMatrixMode(GL_MODELVIEW); - gl_draw_scaled_image(rect.mLeft, - rect.mBottom, - rect.getWidth(), - rect.getHeight(), - mViewerImage.get(), - LLColor4::white % alpha); - } - glMatrixMode(GL_TEXTURE); - glPopMatrix(); - glMatrixMode(GL_MODELVIEW); - } - } -} - -// static -void LLFloaterPostcard::onClickCancel(void* data) -{ - if (data) - { - LLFloaterPostcard *self = (LLFloaterPostcard *)data; - - self->closeFloater(false); - } -} - -class LLSendPostcardResponder : public LLAssetUploadResponder -{ -public: - LLSendPostcardResponder(const LLSD &post_data, - const LLUUID& vfile_id, - LLAssetType::EType asset_type): - LLAssetUploadResponder(post_data, vfile_id, asset_type) - { - } - // *TODO define custom uploadFailed here so it's not such a generic message - void uploadComplete(const LLSD& content) - { - // we don't care about what the server returns from this post, just clean up the UI - LLUploadDialog::modalUploadFinished(); - } -}; - -// static -void LLFloaterPostcard::onClickSend(void* data) -{ - if (data) - { - LLFloaterPostcard *self = (LLFloaterPostcard *)data; - - std::string from(self->getChild<LLUICtrl>("from_form")->getValue().asString()); - std::string to(self->getChild<LLUICtrl>("to_form")->getValue().asString()); - - boost::regex emailFormat("[A-Za-z0-9.%+-_]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}(,[ \t]*[A-Za-z0-9.%+-_]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,})*"); - - if (to.empty() || !boost::regex_match(to, emailFormat)) - { - LLNotificationsUtil::add("PromptRecipientEmail"); - return; - } - - if (from.empty() || !boost::regex_match(from, emailFormat)) - { - LLNotificationsUtil::add("PromptSelfEmail"); - return; - } - - std::string subject(self->getChild<LLUICtrl>("subject_form")->getValue().asString()); - if(subject.empty() || !self->mHasFirstMsgFocus) - { - LLNotificationsUtil::add("PromptMissingSubjMsg", LLSD(), LLSD(), boost::bind(&LLFloaterPostcard::missingSubjMsgAlertCallback, self, _1, _2)); - return; - } - - if (self->mJPEGImage.notNull()) - { - self->sendPostcard(); - } - else - { - LLNotificationsUtil::add("ErrorProcessingSnapshot"); - } - } -} - -// static -void LLFloaterPostcard::uploadCallback(const LLUUID& asset_id, void *user_data, S32 result, LLExtStat ext_status) // StoreAssetData callback (fixed) -{ - LLFloaterPostcard *self = (LLFloaterPostcard *)user_data; - - LLUploadDialog::modalUploadFinished(); - - if (result) - { - LLSD args; - args["REASON"] = std::string(LLAssetStorage::getErrorString(result)); - LLNotificationsUtil::add("ErrorUploadingPostcard", args); - } - else - { - // only create the postcard once the upload succeeds - - // request the postcard - LLMessageSystem* msg = gMessageSystem; - msg->newMessage("SendPostcard"); - msg->nextBlock("AgentData"); - msg->addUUID("AgentID", gAgent.getID()); - msg->addUUID("SessionID", gAgent.getSessionID()); - msg->addUUID("AssetID", self->mAssetID); - msg->addVector3d("PosGlobal", self->mPosTakenGlobal); - msg->addString("To", self->getChild<LLUICtrl>("to_form")->getValue().asString()); - msg->addString("From", self->getChild<LLUICtrl>("from_form")->getValue().asString()); - msg->addString("Name", self->getChild<LLUICtrl>("name_form")->getValue().asString()); - msg->addString("Subject", self->getChild<LLUICtrl>("subject_form")->getValue().asString()); - msg->addString("Msg", self->getChild<LLUICtrl>("msg_form")->getValue().asString()); - msg->addBOOL("AllowPublish", FALSE); - msg->addBOOL("MaturePublish", FALSE); - gAgent.sendReliableMessage(); - } - - self->closeFloater(); -} - -// static -void LLFloaterPostcard::updateUserInfo(const std::string& email) -{ - LLFloaterReg::const_instance_list_t& inst_list = LLFloaterReg::getFloaterList("postcard"); - for (LLFloaterReg::const_instance_list_t::const_iterator iter = inst_list.begin(); - iter != inst_list.end(); ++iter) - { - LLFloater* instance = *iter; - const std::string& text = instance->getChild<LLUICtrl>("from_form")->getValue().asString(); - if (text.empty()) - { - // there's no text in this field yet, pre-populate - instance->getChild<LLUICtrl>("from_form")->setValue(LLSD(email)); - } - } -} - -void LLFloaterPostcard::onMsgFormFocusRecieved(LLFocusableElement* receiver, void* data) -{ - LLFloaterPostcard* self = (LLFloaterPostcard *)data; - if(self) - { - LLTextEditor* msgForm = self->getChild<LLTextEditor>("msg_form"); - if(msgForm && msgForm == receiver && msgForm->hasFocus() && !(self->mHasFirstMsgFocus)) - { - self->mHasFirstMsgFocus = true; - msgForm->setText(LLStringUtil::null); - } - } -} - -bool LLFloaterPostcard::missingSubjMsgAlertCallback(const LLSD& notification, const LLSD& response) -{ - S32 option = LLNotificationsUtil::getSelectedOption(notification, response); - if(0 == option) - { - // User clicked OK - if((getChild<LLUICtrl>("subject_form")->getValue().asString()).empty()) - { - // Stuff the subject back into the form. - getChild<LLUICtrl>("subject_form")->setValue(getString("default_subject")); - } - - if(!mHasFirstMsgFocus) - { - // The user never switched focus to the messagee window. - // Using the default string. - getChild<LLUICtrl>("msg_form")->setValue(getString("default_message")); - } - - sendPostcard(); - } - return false; -} - -void LLFloaterPostcard::sendPostcard() -{ - mTransactionID.generate(); - mAssetID = mTransactionID.makeAssetID(gAgent.getSecureSessionID()); - LLVFile::writeFile(mJPEGImage->getData(), mJPEGImage->getDataSize(), gVFS, mAssetID, LLAssetType::AT_IMAGE_JPEG); - - // upload the image - std::string url = gAgent.getRegion()->getCapability("SendPostcard"); - if(!url.empty()) - { - llinfos << "Send Postcard via capability" << llendl; - LLSD body = LLSD::emptyMap(); - // the capability already encodes: agent ID, region ID - body["pos-global"] = mPosTakenGlobal.getValue(); - body["to"] = getChild<LLUICtrl>("to_form")->getValue().asString(); - body["from"] = getChild<LLUICtrl>("from_form")->getValue().asString(); - body["name"] = getChild<LLUICtrl>("name_form")->getValue().asString(); - body["subject"] = getChild<LLUICtrl>("subject_form")->getValue().asString(); - body["msg"] = getChild<LLUICtrl>("msg_form")->getValue().asString(); - LLHTTPClient::post(url, body, new LLSendPostcardResponder(body, mAssetID, LLAssetType::AT_IMAGE_JPEG)); - } - else - { - gAssetStorage->storeAssetData(mTransactionID, LLAssetType::AT_IMAGE_JPEG, &uploadCallback, (void *)this, FALSE); - } - - // give user feedback of the event - gViewerWindow->playSnapshotAnimAndSound(); - LLUploadDialog::modalUploadDialog(getString("upload_message")); - - // don't destroy the window until the upload is done - // this way we keep the information in the form - setVisible(FALSE); - - // also remove any dependency on another floater - // so that we can be sure to outlive it while we - // need to. - LLFloater* dependee = getDependee(); - if (dependee) - dependee->removeDependentFloater(this); -} diff --git a/indra/newview/llfloaterpostcard.h b/indra/newview/llfloaterpostcard.h deleted file mode 100644 index 472592154f..0000000000 --- a/indra/newview/llfloaterpostcard.h +++ /dev/null @@ -1,79 +0,0 @@ -/** - * @file llfloaterpostcard.h - * @brief Postcard send floater, allows setting name, e-mail address, etc. - * - * $LicenseInfo:firstyear=2004&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2010, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -#ifndef LL_LLFLOATERPOSTCARD_H -#define LL_LLFLOATERPOSTCARD_H - -#include "llfloater.h" -#include "llcheckboxctrl.h" - -#include "llpointer.h" - -class LLTextEditor; -class LLLineEditor; -class LLButton; -class LLViewerTexture; -class LLImageJPEG; - -class LLFloaterPostcard -: public LLFloater -{ -public: - LLFloaterPostcard(const LLSD& key); - virtual ~LLFloaterPostcard(); - - virtual BOOL postBuild(); - virtual void draw(); - - static LLFloaterPostcard* showFromSnapshot(LLImageJPEG *jpeg, LLViewerTexture *img, const LLVector2& img_scale, const LLVector3d& pos_taken_global); - - static void onClickCancel(void* data); - static void onClickSend(void* data); - - static void uploadCallback(const LLUUID& asset_id, - void *user_data, - S32 result, LLExtStat ext_status); - - static void updateUserInfo(const std::string& email); - - static void onMsgFormFocusRecieved(LLFocusableElement* receiver, void* data); - bool missingSubjMsgAlertCallback(const LLSD& notification, const LLSD& response); - - void sendPostcard(); - -private: - - LLPointer<LLImageJPEG> mJPEGImage; - LLPointer<LLViewerTexture> mViewerImage; - LLTransactionID mTransactionID; - LLAssetID mAssetID; - LLVector2 mImageScale; - LLVector3d mPosTakenGlobal; - bool mHasFirstMsgFocus; -}; - - -#endif // LL_LLFLOATERPOSTCARD_H diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index 5fdeb46daa..a333989e7e 100755 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -345,6 +345,7 @@ LLFloaterPreference::LLFloaterPreference(const LLSD& key) mCommitCallbackRegistrar.add("Pref.MaturitySettings", boost::bind(&LLFloaterPreference::onChangeMaturity, this)); mCommitCallbackRegistrar.add("Pref.BlockList", boost::bind(&LLFloaterPreference::onClickBlockList, this)); mCommitCallbackRegistrar.add("Pref.Proxy", boost::bind(&LLFloaterPreference::onClickProxySettings, this)); + mCommitCallbackRegistrar.add("Pref.TranslationSettings", boost::bind(&LLFloaterPreference::onClickTranslationSettings, this)); sSkin = gSavedSettings.getString("SkinCurrent"); @@ -599,6 +600,9 @@ void LLFloaterPreference::cancel() } // hide joystick pref floater LLFloaterReg::hideInstance("pref_joystick"); + + // hide translation settings floater + LLFloaterReg::hideInstance("prefs_translation"); // cancel hardware menu LLFloaterHardwareSettings* hardware_settings = LLFloaterReg::getTypedInstance<LLFloaterHardwareSettings>("prefs_hardware_settings"); @@ -1505,6 +1509,11 @@ void LLFloaterPreference::onClickProxySettings() LLFloaterReg::showInstance("prefs_proxy"); } +void LLFloaterPreference::onClickTranslationSettings() +{ + LLFloaterReg::showInstance("prefs_translation"); +} + void LLFloaterPreference::onClickActionChange() { mClickActionDirty = true; diff --git a/indra/newview/llfloaterpreference.h b/indra/newview/llfloaterpreference.h index 5c74e9f60c..7ee3294478 100644 --- a/indra/newview/llfloaterpreference.h +++ b/indra/newview/llfloaterpreference.h @@ -156,6 +156,7 @@ public: void onChangeMaturity(); void onClickBlockList(); void onClickProxySettings(); + void onClickTranslationSettings(); void applyUIColor(LLUICtrl* ctrl, const LLSD& param); void getUIColor(LLUICtrl* ctrl, const LLSD& param); diff --git a/indra/newview/llfloatersnapshot.cpp b/indra/newview/llfloatersnapshot.cpp index 8105844b0d..1b3290d5a8 100644 --- a/indra/newview/llfloatersnapshot.cpp +++ b/indra/newview/llfloatersnapshot.cpp @@ -42,6 +42,8 @@ #include "llcombobox.h" #include "lleconomy.h" #include "lllandmarkactions.h" +#include "llpanelsnapshot.h" +#include "llsidetraypanelcontainer.h" #include "llsliderctrl.h" #include "llspinctrl.h" #include "llviewercontrol.h" @@ -50,9 +52,7 @@ #include "llviewercamera.h" #include "llviewerwindow.h" #include "llviewermenufile.h" // upload_new_resource() -#include "llfloaterpostcard.h" #include "llcheckboxctrl.h" -#include "llradiogroup.h" #include "llslurl.h" #include "lltoolfocus.h" #include "lltoolmgr.h" @@ -76,18 +76,17 @@ #include "llimagej2c.h" #include "lllocalcliprect.h" #include "llnotificationsutil.h" +#include "llpostcard.h" #include "llresmgr.h" // LLLocale #include "llvfile.h" #include "llvfs.h" +#include "llwebprofile.h" #include "llwindow.h" ///---------------------------------------------------------------------------- /// Local function declarations, constants, enums, and typedefs ///---------------------------------------------------------------------------- -S32 LLFloaterSnapshot::sUIWinHeightLong = 530 ; -S32 LLFloaterSnapshot::sUIWinHeightShort = LLFloaterSnapshot::sUIWinHeightLong - 240 ; -S32 LLFloaterSnapshot::sUIWinWidth = 215 ; - +LLUICtrl* LLFloaterSnapshot::sThumbnailPlaceholder = NULL; LLSnapshotFloaterView* gSnapshotFloaterView = NULL; const F32 AUTO_SNAPSHOT_TIME_DELAY = 1.f; @@ -108,6 +107,7 @@ static LLDefaultChildRegistry::Register<LLSnapshotFloaterView> r("snapshot_float ///---------------------------------------------------------------------------- class LLSnapshotLivePreview : public LLView { + LOG_CLASS(LLSnapshotLivePreview); public: enum ESnapshotType { @@ -135,7 +135,11 @@ public: /*virtual*/ void reshape(S32 width, S32 height, BOOL called_from_parent); void setSize(S32 w, S32 h); + void setWidth(S32 w) { mWidth[mCurImageIndex] = w; } + void setHeight(S32 h) { mHeight[mCurImageIndex] = h; } void getSize(S32& w, S32& h) const; + S32 getWidth() const { return mWidth[mCurImageIndex]; } + S32 getHeight() const { return mHeight[mCurImageIndex]; } S32 getDataSize() const { return mDataSize; } void setMaxImageSize(S32 size) ; S32 getMaxImageSize() {return mMaxImageSize ;} @@ -152,8 +156,10 @@ public: LLViewerTexture* getCurrentImage(); F32 getImageAspect(); F32 getAspect() ; - LLRect getImageRect(); - BOOL isImageScaled(); + const LLRect& getImageRect() const { return mImageRect[mCurImageIndex]; } + BOOL isImageScaled() const { return mImageScaled[mCurImageIndex]; } + void setImageScaled(BOOL scaled) { mImageScaled[mCurImageIndex] = scaled; } + const LLVector3d& getPosTakenGlobal() const { return mPosTakenGlobal; } void setSnapshotType(ESnapshotType type) { mSnapshotType = type; } void setSnapshotFormat(LLFloaterSnapshot::ESnapshotFormat type) { mSnapshotFormat = type; } @@ -161,10 +167,13 @@ public: void setSnapshotBufferType(LLViewerWindow::ESnapshotType type) { mSnapshotBufferType = type; } void updateSnapshot(BOOL new_snapshot, BOOL new_thumbnail = FALSE, F32 delay = 0.f); void saveWeb(); - LLFloaterPostcard* savePostcard(); void saveTexture(); BOOL saveLocal(); + LLPointer<LLImageFormatted> getFormattedImage() const { return mFormattedImage; } + LLPointer<LLImageRaw> getEncodedImage() const { return mPreviewImageEncoded; } + + /// Sets size of preview thumbnail image and thhe surrounding rect. BOOL setThumbnailImageSize() ; void generateThumbnailImage(BOOL force_update = FALSE) ; void resetThumbnailImage() { mThumbnailImage = NULL ; } @@ -293,7 +302,7 @@ LLViewerTexture* LLSnapshotLivePreview::getCurrentImage() F32 LLSnapshotLivePreview::getAspect() { - F32 image_aspect_ratio = ((F32)mWidth[mCurImageIndex]) / ((F32)mHeight[mCurImageIndex]); + F32 image_aspect_ratio = ((F32)getWidth()) / ((F32)getHeight()); F32 window_aspect_ratio = ((F32)getRect().getWidth()) / ((F32)getRect().getHeight()); if (!mKeepAspectRatio)//gSavedSettings.getBOOL("KeepAspectForSnapshot")) @@ -308,7 +317,7 @@ F32 LLSnapshotLivePreview::getAspect() F32 LLSnapshotLivePreview::getImageAspect() { - if (!mViewerImage[mCurImageIndex]) + if (!getCurrentImage()) { return 0.f; } @@ -316,32 +325,25 @@ F32 LLSnapshotLivePreview::getImageAspect() return getAspect() ; } -LLRect LLSnapshotLivePreview::getImageRect() -{ - return mImageRect[mCurImageIndex]; -} - -BOOL LLSnapshotLivePreview::isImageScaled() -{ - return mImageScaled[mCurImageIndex]; -} - void LLSnapshotLivePreview::updateSnapshot(BOOL new_snapshot, BOOL new_thumbnail, F32 delay) -{ - if (mSnapshotUpToDate) +{ + // Invalidate current image. + lldebugs << "updateSnapshot: mSnapshotUpToDate = " << getSnapshotUpToDate() << llendl; + if (getSnapshotUpToDate()) { S32 old_image_index = mCurImageIndex; mCurImageIndex = (mCurImageIndex + 1) % 2; - mWidth[mCurImageIndex] = mWidth[old_image_index]; - mHeight[mCurImageIndex] = mHeight[old_image_index]; + setWidth(mWidth[old_image_index]); + setHeight(mHeight[old_image_index]); mFallAnimTimer.start(); } mSnapshotUpToDate = FALSE; + // Update snapshot source rect depending on whether we keep the aspect ratio. LLRect& rect = mImageRect[mCurImageIndex]; rect.set(0, getRect().getHeight(), getRect().getWidth(), 0); - F32 image_aspect_ratio = ((F32)mWidth[mCurImageIndex]) / ((F32)mHeight[mCurImageIndex]); + F32 image_aspect_ratio = ((F32)getWidth()) / ((F32)getHeight()); F32 window_aspect_ratio = ((F32)getRect().getWidth()) / ((F32)getRect().getHeight()); if (mKeepAspectRatio)//gSavedSettings.getBOOL("KeepAspectForSnapshot")) @@ -362,17 +364,22 @@ void LLSnapshotLivePreview::updateSnapshot(BOOL new_snapshot, BOOL new_thumbnail } } + // Stop shining animation. mShineAnimTimer.stop(); + + // Update snapshot if requested. if (new_snapshot) { mSnapshotDelayTimer.start(); mSnapshotDelayTimer.setTimerExpirySec(delay); + LLFloaterSnapshot::preUpdate(); } + + // Update thumbnail if requested. if(new_thumbnail) { mThumbnailUpToDate = FALSE ; } - setThumbnailImageSize(); } void LLSnapshotLivePreview::setSnapshotQuality(S32 quality) @@ -428,26 +435,26 @@ void LLSnapshotLivePreview::drawPreviewRect(S32 offset_x, S32 offset_y) //called when the frame is frozen. void LLSnapshotLivePreview::draw() { - if (mViewerImage[mCurImageIndex].notNull() && + if (getCurrentImage() && mPreviewImageEncoded.notNull() && - mSnapshotUpToDate) + getSnapshotUpToDate()) { LLColor4 bg_color(0.f, 0.f, 0.3f, 0.4f); gl_rect_2d(getRect(), bg_color); - LLRect &rect = mImageRect[mCurImageIndex]; - LLRect shadow_rect = mImageRect[mCurImageIndex]; + const LLRect& rect = getImageRect(); + LLRect shadow_rect = rect; shadow_rect.stretch(BORDER_WIDTH); gl_drop_shadow(shadow_rect.mLeft, shadow_rect.mTop, shadow_rect.mRight, shadow_rect.mBottom, LLColor4(0.f, 0.f, 0.f, mNeedsFlash ? 0.f :0.5f), 10); LLColor4 image_color(1.f, 1.f, 1.f, 1.f); gGL.color4fv(image_color.mV); - gGL.getTexUnit(0)->bind(mViewerImage[mCurImageIndex]); + gGL.getTexUnit(0)->bind(getCurrentImage()); // calculate UV scale - F32 uv_width = mImageScaled[mCurImageIndex] ? 1.f : llmin((F32)mWidth[mCurImageIndex] / (F32)mViewerImage[mCurImageIndex]->getWidth(), 1.f); - F32 uv_height = mImageScaled[mCurImageIndex] ? 1.f : llmin((F32)mHeight[mCurImageIndex] / (F32)mViewerImage[mCurImageIndex]->getHeight(), 1.f); - glPushMatrix(); + F32 uv_width = isImageScaled() ? 1.f : llmin((F32)getWidth() / (F32)getCurrentImage()->getWidth(), 1.f); + F32 uv_height = isImageScaled() ? 1.f : llmin((F32)getHeight() / (F32)getCurrentImage()->getHeight(), 1.f); + gGL.pushMatrix(); { - glTranslatef((F32)rect.mLeft, (F32)rect.mBottom, 0.f); + gGL.translatef((F32)rect.mLeft, (F32)rect.mBottom, 0.f); gGL.begin(LLRender::QUADS); { gGL.texCoord2f(uv_width, uv_height); @@ -464,7 +471,7 @@ void LLSnapshotLivePreview::draw() } gGL.end(); } - glPopMatrix(); + gGL.popMatrix(); gGL.color4f(1.f, 1.f, 1.f, mFlashAlpha); gl_rect_2d(getRect()); @@ -484,6 +491,7 @@ void LLSnapshotLivePreview::draw() mFlashAlpha = lerp(mFlashAlpha, 0.f, LLCriticalDamp::getInterpolant(0.15f)); } + // Draw shining animation if appropriate. if (mShineCountdown > 0) { mShineCountdown--; @@ -494,6 +502,7 @@ void LLSnapshotLivePreview::draw() } else if (mShineAnimTimer.getStarted()) { + lldebugs << "Drawing shining animation" << llendl; F32 shine_interp = llmin(1.f, mShineAnimTimer.getElapsedTimeF32() / SHINE_TIME); // draw "shine" effect @@ -538,7 +547,7 @@ void LLSnapshotLivePreview::draw() { gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); gGL.color4f(1.f, 1.f, 1.f, 1.f); - LLRect outline_rect = mImageRect[mCurImageIndex]; + const LLRect& outline_rect = getImageRect(); gGL.begin(LLRender::QUADS); { gGL.vertex2i(outline_rect.mLeft - BORDER_WIDTH, outline_rect.mTop + BORDER_WIDTH); @@ -570,6 +579,7 @@ void LLSnapshotLivePreview::draw() S32 old_image_index = (mCurImageIndex + 1) % 2; if (mViewerImage[old_image_index].notNull() && mFallAnimTimer.getElapsedTimeF32() < FALL_TIME) { + lldebugs << "Drawing fall animation" << llendl; F32 fall_interp = mFallAnimTimer.getElapsedTimeF32() / FALL_TIME; F32 alpha = clamp_rescale(fall_interp, 0.f, 1.f, 0.8f, 0.4f); LLColor4 image_color(1.f, 1.f, 1.f, alpha); @@ -580,11 +590,11 @@ void LLSnapshotLivePreview::draw() BOOL rescale = !mImageScaled[old_image_index] && mViewerImage[mCurImageIndex].notNull(); F32 uv_width = rescale ? llmin((F32)mWidth[old_image_index] / (F32)mViewerImage[mCurImageIndex]->getWidth(), 1.f) : 1.f; F32 uv_height = rescale ? llmin((F32)mHeight[old_image_index] / (F32)mViewerImage[mCurImageIndex]->getHeight(), 1.f) : 1.f; - glPushMatrix(); + gGL.pushMatrix(); { LLRect& rect = mImageRect[old_image_index]; - glTranslatef((F32)rect.mLeft, (F32)rect.mBottom - llround(getRect().getHeight() * 2.f * (fall_interp * fall_interp)), 0.f); - glRotatef(-45.f * fall_interp, 0.f, 0.f, 1.f); + gGL.translatef((F32)rect.mLeft, (F32)rect.mBottom - llround(getRect().getHeight() * 2.f * (fall_interp * fall_interp)), 0.f); + gGL.rotatef(-45.f * fall_interp, 0.f, 0.f, 1.f); gGL.begin(LLRender::QUADS); { gGL.texCoord2f(uv_width, uv_height); @@ -601,7 +611,7 @@ void LLSnapshotLivePreview::draw() } gGL.end(); } - glPopMatrix(); + gGL.popMatrix(); } } } @@ -613,13 +623,14 @@ void LLSnapshotLivePreview::reshape(S32 width, S32 height, BOOL called_from_pare LLView::reshape(width, height, called_from_parent); if (old_rect.getWidth() != width || old_rect.getHeight() != height) { + lldebugs << "window reshaped, updating thumbnail" << llendl; updateSnapshot(FALSE, TRUE); } } BOOL LLSnapshotLivePreview::setThumbnailImageSize() { - if(mWidth[mCurImageIndex] < 10 || mHeight[mCurImageIndex] < 10) + if(getWidth() < 10 || getHeight() < 10) { return FALSE ; } @@ -629,8 +640,10 @@ BOOL LLSnapshotLivePreview::setThumbnailImageSize() F32 window_aspect_ratio = ((F32)window_width) / ((F32)window_height); // UI size for thumbnail - S32 max_width = LLFloaterSnapshot::getUIWinWidth() - 20; - S32 max_height = 90; + // *FIXME: the rect does not change, so maybe there's no need to recalculate max w/h. + const LLRect& thumbnail_rect = LLFloaterSnapshot::getThumbnailPlaceholderRect(); + S32 max_width = thumbnail_rect.getWidth(); + S32 max_height = thumbnail_rect.getHeight(); if (window_aspect_ratio > (F32)max_width / max_height) { @@ -653,11 +666,11 @@ BOOL LLSnapshotLivePreview::setThumbnailImageSize() S32 left = 0 , top = mThumbnailHeight, right = mThumbnailWidth, bottom = 0 ; if(!mKeepAspectRatio) { - F32 ratio_x = (F32)mWidth[mCurImageIndex] / window_width ; - F32 ratio_y = (F32)mHeight[mCurImageIndex] / window_height ; + F32 ratio_x = (F32)getWidth() / window_width ; + F32 ratio_y = (F32)getHeight() / window_height ; - //if(mWidth[mCurImageIndex] > window_width || - // mHeight[mCurImageIndex] > window_height ) + //if(getWidth() > window_width || + // getHeight() > window_height ) { if(ratio_x > ratio_y) { @@ -689,11 +702,11 @@ void LLSnapshotLivePreview::generateThumbnailImage(BOOL force_update) { return ; } - if(mThumbnailUpToDate && !force_update)//already updated + if(getThumbnailUpToDate() && !force_update)//already updated { return ; } - if(mWidth[mCurImageIndex] < 10 || mHeight[mCurImageIndex] < 10) + if(getWidth() < 10 || getHeight() < 10) { return ; } @@ -713,25 +726,19 @@ void LLSnapshotLivePreview::generateThumbnailImage(BOOL force_update) resetThumbnailImage() ; } - LLPointer<LLImageRaw> raw = NULL ; - S32 w , h ; - w = get_lower_power_two(mThumbnailWidth, 512) * 2 ; - h = get_lower_power_two(mThumbnailHeight, 512) * 2 ; - + LLPointer<LLImageRaw> raw = new LLImageRaw; + if(!gViewerWindow->thumbnailSnapshot(raw, + mThumbnailWidth, mThumbnailHeight, + gSavedSettings.getBOOL("RenderUIInSnapshot"), + FALSE, + mSnapshotBufferType) ) { - raw = new LLImageRaw ; - if(!gViewerWindow->thumbnailSnapshot(raw, - w, h, - gSavedSettings.getBOOL("RenderUIInSnapshot"), - FALSE, - mSnapshotBufferType) ) - { - raw = NULL ; - } + raw = NULL ; } if(raw) { + raw->expandToPowerOfTwo(); mThumbnailImage = LLViewerTextureManager::getLocalTexture(raw.get(), FALSE); mThumbnailUpToDate = TRUE ; } @@ -746,8 +753,14 @@ void LLSnapshotLivePreview::generateThumbnailImage(BOOL force_update) //static BOOL LLSnapshotLivePreview::onIdle( void* snapshot_preview ) { - LLSnapshotLivePreview* previewp = (LLSnapshotLivePreview*)snapshot_preview; + LLSnapshotLivePreview* previewp = (LLSnapshotLivePreview*)snapshot_preview; + if (previewp->getWidth() == 0 || previewp->getHeight() == 0) + { + llwarns << "Incorrect dimensions: " << previewp->getWidth() << "x" << previewp->getHeight() << llendl; + return FALSE; + } + // If we're in freeze-frame mode and camera has moved, update snapshot. LLVector3 new_camera_pos = LLViewerCamera::getInstance()->getOrigin(); LLQuaternion new_camera_rot = LLViewerCamera::getInstance()->getQuaternion(); if (gSavedSettings.getBOOL("FreezeTime") && @@ -757,6 +770,7 @@ BOOL LLSnapshotLivePreview::onIdle( void* snapshot_preview ) previewp->mCameraRot = new_camera_rot; // request a new snapshot whenever the camera moves, with a time delay BOOL autosnap = gSavedSettings.getBOOL("AutoSnapshot"); + lldebugs << "camera moved, updating thumbnail" << llendl; previewp->updateSnapshot( autosnap, // whether a new snapshot is needed or merely invalidate the existing one FALSE, // or if 1st arg is false, whether to produce a new thumbnail image. @@ -773,7 +787,9 @@ BOOL LLSnapshotLivePreview::onIdle( void* snapshot_preview ) } // time to produce a snapshot + previewp->setThumbnailImageSize(); + lldebugs << "producing snapshot" << llendl; if (!previewp->mPreviewImage) { previewp->mPreviewImage = new LLImageRaw; @@ -788,13 +804,13 @@ BOOL LLSnapshotLivePreview::onIdle( void* snapshot_preview ) previewp->setEnabled(FALSE); previewp->getWindow()->incBusyCount(); - previewp->mImageScaled[previewp->mCurImageIndex] = FALSE; + previewp->setImageScaled(FALSE); // grab the raw image and encode it into desired format if(gViewerWindow->rawSnapshot( previewp->mPreviewImage, - previewp->mWidth[previewp->mCurImageIndex], - previewp->mHeight[previewp->mCurImageIndex], + previewp->getWidth(), + previewp->getHeight(), previewp->mKeepAspectRatio,//gSavedSettings.getBOOL("KeepAspectForSnapshot"), previewp->getSnapshotType() == LLSnapshotLivePreview::SNAPSHOT_TEXTURE, gSavedSettings.getBOOL("RenderUIInSnapshot"), @@ -809,6 +825,7 @@ BOOL LLSnapshotLivePreview::onIdle( void* snapshot_preview ) if(previewp->getSnapshotType() == SNAPSHOT_TEXTURE) { + lldebugs << "Encoding new image of format J2C" << llendl; LLPointer<LLImageJ2C> formatted = new LLImageJ2C; LLPointer<LLImageRaw> scaled = new LLImageRaw( previewp->mPreviewImage->getData(), @@ -817,7 +834,7 @@ BOOL LLSnapshotLivePreview::onIdle( void* snapshot_preview ) previewp->mPreviewImage->getComponents()); scaled->biasedScaleToPowerOfTwo(512); - previewp->mImageScaled[previewp->mCurImageIndex] = TRUE; + previewp->setImageScaled(TRUE); if (formatted->encode(scaled, 0.f)) { previewp->mDataSize = formatted->getDataSize(); @@ -829,18 +846,8 @@ BOOL LLSnapshotLivePreview::onIdle( void* snapshot_preview ) // delete any existing image previewp->mFormattedImage = NULL; // now create the new one of the appropriate format. - // note: postcards and web hardcoded to use jpeg always. - LLFloaterSnapshot::ESnapshotFormat format; - - if (previewp->getSnapshotType() == SNAPSHOT_POSTCARD || - previewp->getSnapshotType() == SNAPSHOT_WEB) - { - format = LLFloaterSnapshot::SNAPSHOT_FORMAT_JPEG; - } - else - { - format = previewp->getSnapshotFormat(); - } + LLFloaterSnapshot::ESnapshotFormat format = previewp->getSnapshotFormat(); + lldebugs << "Encoding new image of format " << format << llendl; switch(format) { @@ -882,7 +889,7 @@ BOOL LLSnapshotLivePreview::onIdle( void* snapshot_preview ) { // go ahead and shrink image to appropriate power of 2 for display scaled->biasedScaleToPowerOfTwo(1024); - previewp->mImageScaled[previewp->mCurImageIndex] = TRUE; + previewp->setImageScaled(TRUE); } else { @@ -920,56 +927,28 @@ BOOL LLSnapshotLivePreview::onIdle( void* snapshot_preview ) { previewp->generateThumbnailImage() ; } + lldebugs << "done creating snapshot" << llendl; + LLFloaterSnapshot::postUpdate(); return TRUE; } void LLSnapshotLivePreview::setSize(S32 w, S32 h) { - mWidth[mCurImageIndex] = w; - mHeight[mCurImageIndex] = h; + lldebugs << "setSize(" << w << ", " << h << ")" << llendl; + setWidth(w); + setHeight(h); } void LLSnapshotLivePreview::getSize(S32& w, S32& h) const { - w = mWidth[mCurImageIndex]; - h = mHeight[mCurImageIndex]; -} - -LLFloaterPostcard* LLSnapshotLivePreview::savePostcard() -{ - if(mViewerImage[mCurImageIndex].isNull()) - { - //this should never happen!! - llwarns << "The snapshot image has not been generated!" << llendl ; - return NULL ; - } - - // calculate and pass in image scale in case image data only use portion - // of viewerimage buffer - LLVector2 image_scale(1.f, 1.f); - if (!isImageScaled()) - { - image_scale.setVec(llmin(1.f, (F32)mWidth[mCurImageIndex] / (F32)getCurrentImage()->getWidth()), llmin(1.f, (F32)mHeight[mCurImageIndex] / (F32)getCurrentImage()->getHeight())); - } - - LLImageJPEG* jpg = dynamic_cast<LLImageJPEG*>(mFormattedImage.get()); - if(!jpg) - { - llwarns << "Formatted image not a JPEG" << llendl; - return NULL; - } - LLFloaterPostcard* floater = LLFloaterPostcard::showFromSnapshot(jpg, mViewerImage[mCurImageIndex], image_scale, mPosTakenGlobal); - // relinquish lifetime of jpeg image to postcard floater - mFormattedImage = NULL; - mDataSize = 0; - updateSnapshot(FALSE, FALSE); - - return floater; + w = getWidth(); + h = getHeight(); } void LLSnapshotLivePreview::saveTexture() { + lldebugs << "saving texture: " << mPreviewImage->getWidth() << "x" << mPreviewImage->getHeight() << llendl; // gen a new uuid for this asset LLTransactionID tid; tid.generate(); @@ -982,7 +961,8 @@ void LLSnapshotLivePreview::saveTexture() mPreviewImage->getComponents()); scaled->biasedScaleToPowerOfTwo(512); - + lldebugs << "scaled texture to " << scaled->getWidth() << "x" << scaled->getHeight() << llendl; + if (formatted->encode(scaled, 0.0f)) { LLVFile::writeFile(formatted->getData(), formatted->getDataSize(), gVFS, new_asset_id, LLAssetType::AT_TEXTURE); @@ -1022,11 +1002,6 @@ BOOL LLSnapshotLivePreview::saveLocal() { BOOL success = gViewerWindow->saveImageNumbered(mFormattedImage); - // Relinquish image memory. Save button will be disabled as a side-effect. - mFormattedImage = NULL; - mDataSize = 0; - updateSnapshot(FALSE, FALSE); - if(success) { gViewerWindow->playSnapshotAnimAndSound(); @@ -1067,11 +1042,21 @@ void LLSnapshotLivePreview::regionNameCallback(LLImageJPEG* snapshot, LLSD& meta class LLFloaterSnapshot::Impl { + LOG_CLASS(LLFloaterSnapshot::Impl); public: + typedef enum e_status + { + STATUS_READY, + STATUS_WORKING, + STATUS_FINISHED + } EStatus; + Impl() : mAvatarPauseHandles(), mLastToolset(NULL), - mAspectRatioCheckOff(false) + mAspectRatioCheckOff(false), + mNeedRefresh(false), + mStatus(STATUS_READY) { } ~Impl() @@ -1080,43 +1065,49 @@ public: mAvatarPauseHandles.clear(); } - static void onClickDiscard(void* data); - static void onClickKeep(void* data); - static void onCommitSave(LLUICtrl* ctrl, void* data); static void onClickNewSnapshot(void* data); static void onClickAutoSnap(LLUICtrl *ctrl, void* data); //static void onClickAdvanceSnap(LLUICtrl *ctrl, void* data); - static void onClickLess(void* data) ; static void onClickMore(void* data) ; static void onClickUICheck(LLUICtrl *ctrl, void* data); static void onClickHUDCheck(LLUICtrl *ctrl, void* data); - static void onClickKeepOpenCheck(LLUICtrl *ctrl, void* data); - static void onClickKeepAspectCheck(LLUICtrl *ctrl, void* data); - static void onCommitQuality(LLUICtrl* ctrl, void* data); - static void onCommitResolution(LLUICtrl* ctrl, void* data) { updateResolution(ctrl, data); } + static void applyKeepAspectCheck(LLFloaterSnapshot* view, BOOL checked); static void updateResolution(LLUICtrl* ctrl, void* data, BOOL do_update = TRUE); static void onCommitFreezeFrame(LLUICtrl* ctrl, void* data); static void onCommitLayerTypes(LLUICtrl* ctrl, void*data); - static void onCommitSnapshotType(LLUICtrl* ctrl, void* data); - static void onCommitSnapshotFormat(LLUICtrl* ctrl, void* data); - static void onCommitCustomResolution(LLUICtrl *ctrl, void* data); - static void resetSnapshotSizeOnUI(LLFloaterSnapshot *view, S32 width, S32 height) ; + static void onImageQualityChange(LLFloaterSnapshot* view, S32 quality_val); + static void onImageFormatChange(LLFloaterSnapshot* view); + static void applyCustomResolution(LLFloaterSnapshot* view, S32 w, S32 h); + static void onSnapshotUploadFinished(bool status); + static void onSendingPostcardFinished(bool status); static BOOL checkImageSize(LLSnapshotLivePreview* previewp, S32& width, S32& height, BOOL isWidthChanged, S32 max_value); + static void setImageSizeSpinnersValues(LLFloaterSnapshot *view, S32 width, S32 height) ; + static void updateSpinners(LLFloaterSnapshot* view, LLSnapshotLivePreview* previewp, S32& width, S32& height, BOOL is_width_changed); + + static LLPanelSnapshot* getActivePanel(LLFloaterSnapshot* floater, bool ok_if_not_found = true); + static LLSnapshotLivePreview::ESnapshotType getActiveSnapshotType(LLFloaterSnapshot* floater); + static LLFloaterSnapshot::ESnapshotFormat getImageFormat(LLFloaterSnapshot* floater); + static LLSpinCtrl* getWidthSpinner(LLFloaterSnapshot* floater); + static LLSpinCtrl* getHeightSpinner(LLFloaterSnapshot* floater); + static void enableAspectRatioCheckbox(LLFloaterSnapshot* floater, BOOL enable); + static void setAspectRatioCheckboxValue(LLFloaterSnapshot* floater, BOOL checked); static LLSnapshotLivePreview* getPreviewView(LLFloaterSnapshot *floater); static void setResolution(LLFloaterSnapshot* floater, const std::string& comboname); static void updateControls(LLFloaterSnapshot* floater); static void updateLayout(LLFloaterSnapshot* floater); - static void updateResolutionTextEntry(LLFloaterSnapshot* floater); + static void setStatus(EStatus status, bool ok = true, const std::string& msg = LLStringUtil::null); + EStatus getStatus() const { return mStatus; } + static void setNeedRefresh(LLFloaterSnapshot* floater, bool need); private: - static LLSnapshotLivePreview::ESnapshotType getTypeIndex(LLFloaterSnapshot* floater); - static LLSD getTypeName(LLSnapshotLivePreview::ESnapshotType index); - static ESnapshotFormat getFormatIndex(LLFloaterSnapshot* floater); static LLViewerWindow::ESnapshotType getLayerType(LLFloaterSnapshot* floater); static void comboSetCustom(LLFloaterSnapshot *floater, const std::string& comboname); static void checkAutoSnapshot(LLSnapshotLivePreview* floater, BOOL update_thumbnail = FALSE); static void checkAspectRatio(LLFloaterSnapshot *view, S32 index) ; + static void setWorking(LLFloaterSnapshot* floater, bool working); + static void setFinished(LLFloaterSnapshot* floater, bool finished, bool ok = true, const std::string& msg = LLStringUtil::null); + public: std::vector<LLAnimPauseRequest> mAvatarPauseHandles; @@ -1124,84 +1115,98 @@ public: LLToolset* mLastToolset; LLHandle<LLView> mPreviewHandle; bool mAspectRatioCheckOff ; + bool mNeedRefresh; + EStatus mStatus; }; // static -LLSnapshotLivePreview* LLFloaterSnapshot::Impl::getPreviewView(LLFloaterSnapshot *floater) +LLPanelSnapshot* LLFloaterSnapshot::Impl::getActivePanel(LLFloaterSnapshot* floater, bool ok_if_not_found) { - LLSnapshotLivePreview* previewp = (LLSnapshotLivePreview*)floater->impl.mPreviewHandle.get(); - return previewp; + LLSideTrayPanelContainer* panel_container = floater->getChild<LLSideTrayPanelContainer>("panel_container"); + LLPanelSnapshot* active_panel = dynamic_cast<LLPanelSnapshot*>(panel_container->getCurrentPanel()); + if (!ok_if_not_found) + { + llassert_always(active_panel != NULL); + } + return active_panel; } // static -LLSnapshotLivePreview::ESnapshotType LLFloaterSnapshot::Impl::getTypeIndex(LLFloaterSnapshot* floater) +LLSnapshotLivePreview::ESnapshotType LLFloaterSnapshot::Impl::getActiveSnapshotType(LLFloaterSnapshot* floater) { - LLSnapshotLivePreview::ESnapshotType index = LLSnapshotLivePreview::SNAPSHOT_POSTCARD; - LLSD value = floater->getChild<LLUICtrl>("snapshot_type_radio")->getValue(); + LLSnapshotLivePreview::ESnapshotType type = LLSnapshotLivePreview::SNAPSHOT_WEB; + std::string name; + LLPanelSnapshot* spanel = getActivePanel(floater); - const std::string id = value.asString(); - if (id == "postcard") + if (spanel) { - index = LLSnapshotLivePreview::SNAPSHOT_POSTCARD; + name = spanel->getName(); } - else if (id == "texture") + + if (name == "panel_snapshot_postcard") { - index = LLSnapshotLivePreview::SNAPSHOT_TEXTURE; + type = LLSnapshotLivePreview::SNAPSHOT_POSTCARD; } - else if (id == "local") + else if (name == "panel_snapshot_inventory") { - index = LLSnapshotLivePreview::SNAPSHOT_LOCAL; + type = LLSnapshotLivePreview::SNAPSHOT_TEXTURE; } - else if (id == "share_to_web") + else if (name == "panel_snapshot_local") { - index = LLSnapshotLivePreview::SNAPSHOT_WEB; + type = LLSnapshotLivePreview::SNAPSHOT_LOCAL; } - return index; + return type; +} + +// static +LLFloaterSnapshot::ESnapshotFormat LLFloaterSnapshot::Impl::getImageFormat(LLFloaterSnapshot* floater) +{ + LLPanelSnapshot* active_panel = getActivePanel(floater); + // FIXME: if the default is not PNG, profile uploads may fail. + return active_panel ? active_panel->getImageFormat() : LLFloaterSnapshot::SNAPSHOT_FORMAT_PNG; } // static -LLSD LLFloaterSnapshot::Impl::getTypeName(LLSnapshotLivePreview::ESnapshotType index) +LLSpinCtrl* LLFloaterSnapshot::Impl::getWidthSpinner(LLFloaterSnapshot* floater) { - std::string id; - switch (index) + LLPanelSnapshot* active_panel = getActivePanel(floater); + return active_panel ? active_panel->getWidthSpinner() : floater->getChild<LLSpinCtrl>("snapshot_width"); +} + +// static +LLSpinCtrl* LLFloaterSnapshot::Impl::getHeightSpinner(LLFloaterSnapshot* floater) +{ + LLPanelSnapshot* active_panel = getActivePanel(floater); + return active_panel ? active_panel->getHeightSpinner() : floater->getChild<LLSpinCtrl>("snapshot_height"); +} + +// static +void LLFloaterSnapshot::Impl::enableAspectRatioCheckbox(LLFloaterSnapshot* floater, BOOL enable) +{ + LLPanelSnapshot* active_panel = getActivePanel(floater); + if (active_panel) { - case LLSnapshotLivePreview::SNAPSHOT_WEB: - id = "share_to_web"; - break; - case LLSnapshotLivePreview::SNAPSHOT_POSTCARD: - id = "postcard"; - break; - case LLSnapshotLivePreview::SNAPSHOT_TEXTURE: - id = "texture"; - break; - case LLSnapshotLivePreview::SNAPSHOT_LOCAL: - default: - id = "local"; - break; + active_panel->enableAspectRatioCheckbox(enable); } - return LLSD(id); } // static -LLFloaterSnapshot::ESnapshotFormat LLFloaterSnapshot::Impl::getFormatIndex(LLFloaterSnapshot* floater) +void LLFloaterSnapshot::Impl::setAspectRatioCheckboxValue(LLFloaterSnapshot* floater, BOOL checked) { - ESnapshotFormat index = SNAPSHOT_FORMAT_PNG; - if(floater->hasChild("local_format_combo")) + LLPanelSnapshot* active_panel = getActivePanel(floater); + if (active_panel) { - LLComboBox* local_format_combo = floater->findChild<LLComboBox>("local_format_combo"); - const std::string id = local_format_combo->getSelectedItemLabel(); - if (id == "PNG") - index = SNAPSHOT_FORMAT_PNG; - else if (id == "JPEG") - index = SNAPSHOT_FORMAT_JPEG; - else if (id == "BMP") - index = SNAPSHOT_FORMAT_BMP; + active_panel->getChild<LLUICtrl>(active_panel->getAspectRatioCBName())->setValue(checked); } - return index; } - +// static +LLSnapshotLivePreview* LLFloaterSnapshot::Impl::getPreviewView(LLFloaterSnapshot *floater) +{ + LLSnapshotLivePreview* previewp = (LLSnapshotLivePreview*)floater->impl.mPreviewHandle.get(); + return previewp; +} // static LLViewerWindow::ESnapshotType LLFloaterSnapshot::Impl::getLayerType(LLFloaterSnapshot* floater) @@ -1229,20 +1234,28 @@ void LLFloaterSnapshot::Impl::updateLayout(LLFloaterSnapshot* floaterp) { LLSnapshotLivePreview* previewp = getPreviewView(floaterp); - S32 delta_height = gSavedSettings.getBOOL("AdvanceSnapshot") ? 0 : floaterp->getUIWinHeightShort() - floaterp->getUIWinHeightLong() ; + BOOL advanced = gSavedSettings.getBOOL("AdvanceSnapshot"); + + // Show/hide advanced options. + LLPanel* advanced_options_panel = floaterp->getChild<LLPanel>("advanced_options_panel"); + floaterp->getChild<LLButton>("advanced_options_btn")->setImageOverlay(advanced ? "TabIcon_Open_Off" : "TabIcon_Close_Off"); + if (advanced != advanced_options_panel->getVisible()) + { + S32 panel_width = advanced_options_panel->getRect().getWidth(); + floaterp->getChild<LLPanel>("advanced_options_panel")->setVisible(advanced); + S32 floater_width = floaterp->getRect().getWidth(); + floater_width += (advanced ? panel_width : -panel_width); + floaterp->reshape(floater_width, floaterp->getRect().getHeight()); + } - if(!gSavedSettings.getBOOL("AdvanceSnapshot")) //set to original window resolution + if(!advanced) //set to original window resolution { previewp->mKeepAspectRatio = TRUE; + floaterp->getChild<LLComboBox>("profile_size_combo")->setCurrentByIndex(0); floaterp->getChild<LLComboBox>("postcard_size_combo")->setCurrentByIndex(0); - gSavedSettings.setS32("SnapshotPostcardLastResolution", 0); - floaterp->getChild<LLComboBox>("texture_size_combo")->setCurrentByIndex(0); - gSavedSettings.setS32("SnapshotTextureLastResolution", 0); - floaterp->getChild<LLComboBox>("local_size_combo")->setCurrentByIndex(0); - gSavedSettings.setS32("SnapshotLocalLastResolution", 0); LLSnapshotLivePreview* previewp = getPreviewView(floaterp); previewp->setSize(gViewerWindow->getWindowWidthRaw(), gViewerWindow->getWindowHeightRaw()); @@ -1256,7 +1269,8 @@ void LLFloaterSnapshot::Impl::updateLayout(LLFloaterSnapshot* floaterp) floaterp->getParent()->setMouseOpaque(TRUE); // shrink to smaller layout - floaterp->reshape(floaterp->getRect().getWidth(), floaterp->getUIWinHeightLong() + delta_height); + // *TODO: unneeded? + floaterp->reshape(floaterp->getRect().getWidth(), floaterp->getRect().getHeight()); // can see and interact with fullscreen preview now if (previewp) @@ -1286,7 +1300,8 @@ void LLFloaterSnapshot::Impl::updateLayout(LLFloaterSnapshot* floaterp) else // turning off freeze frame mode { floaterp->getParent()->setMouseOpaque(FALSE); - floaterp->reshape(floaterp->getRect().getWidth(), floaterp->getUIWinHeightLong() + delta_height); + // *TODO: unneeded? + floaterp->reshape(floaterp->getRect().getWidth(), floaterp->getRect().getHeight()); if (previewp) { previewp->setVisible(FALSE); @@ -1312,86 +1327,67 @@ void LLFloaterSnapshot::Impl::updateLayout(LLFloaterSnapshot* floaterp) // No other methods should be changing any of the controls directly except for helpers called by this method. // The basic pattern for programmatically changing the GUI settings is to first set the // appropriate saved settings and then call this method to sync the GUI with them. +// FIXME: The above comment seems obsolete now. // static void LLFloaterSnapshot::Impl::updateControls(LLFloaterSnapshot* floater) { - LLRadioGroup* snapshot_type_radio = floater->getChild<LLRadioGroup>("snapshot_type_radio"); - LLSnapshotLivePreview::ESnapshotType shot_type = (LLSnapshotLivePreview::ESnapshotType)gSavedSettings.getS32("LastSnapshotType"); - snapshot_type_radio->setSelectedByValue(getTypeName(shot_type), true); - + LLSnapshotLivePreview::ESnapshotType shot_type = getActiveSnapshotType(floater); ESnapshotFormat shot_format = (ESnapshotFormat)gSavedSettings.getS32("SnapshotFormat"); LLViewerWindow::ESnapshotType layer_type = getLayerType(floater); +#if 0 floater->getChildView("share_to_web")->setVisible( gSavedSettings.getBOOL("SnapshotSharingEnabled")); +#endif - floater->getChildView("postcard_size_combo")->setVisible( FALSE); - floater->getChildView("texture_size_combo")->setVisible( FALSE); - floater->getChildView("local_size_combo")->setVisible( FALSE); - - floater->getChild<LLComboBox>("postcard_size_combo")->selectNthItem(gSavedSettings.getS32("SnapshotPostcardLastResolution")); - floater->getChild<LLComboBox>("texture_size_combo")->selectNthItem(gSavedSettings.getS32("SnapshotTextureLastResolution")); - floater->getChild<LLComboBox>("local_size_combo")->selectNthItem(gSavedSettings.getS32("SnapshotLocalLastResolution")); floater->getChild<LLComboBox>("local_format_combo")->selectNthItem(gSavedSettings.getS32("SnapshotFormat")); - - // *TODO: Separate settings for Web images from postcards - floater->getChildView("send_btn")->setVisible( shot_type == LLSnapshotLivePreview::SNAPSHOT_POSTCARD || - shot_type == LLSnapshotLivePreview::SNAPSHOT_WEB); - floater->getChildView("upload_btn")->setVisible(shot_type == LLSnapshotLivePreview::SNAPSHOT_TEXTURE); - floater->getChildView("save_btn")->setVisible( shot_type == LLSnapshotLivePreview::SNAPSHOT_LOCAL); - floater->getChildView("keep_aspect_check")->setEnabled(shot_type != LLSnapshotLivePreview::SNAPSHOT_TEXTURE && !floater->impl.mAspectRatioCheckOff); + enableAspectRatioCheckbox(floater, !floater->impl.mAspectRatioCheckOff); + setAspectRatioCheckboxValue(floater, gSavedSettings.getBOOL("KeepAspectForSnapshot")); floater->getChildView("layer_types")->setEnabled(shot_type == LLSnapshotLivePreview::SNAPSHOT_LOCAL); - BOOL is_advance = gSavedSettings.getBOOL("AdvanceSnapshot"); - BOOL is_local = shot_type == LLSnapshotLivePreview::SNAPSHOT_LOCAL; - BOOL show_slider = (shot_type == LLSnapshotLivePreview::SNAPSHOT_POSTCARD || - shot_type == LLSnapshotLivePreview::SNAPSHOT_WEB || - (is_local && shot_format == LLFloaterSnapshot::SNAPSHOT_FORMAT_JPEG)); - - floater->getChildView("more_btn")->setVisible( !is_advance); // the only item hidden in advanced mode - floater->getChildView("less_btn")->setVisible( is_advance); - floater->getChildView("type_label2")->setVisible( is_advance); - floater->getChildView("format_label")->setVisible( is_advance && is_local); - floater->getChildView("local_format_combo")->setVisible( is_advance && is_local); - floater->getChildView("layer_types")->setVisible( is_advance); - floater->getChildView("layer_type_label")->setVisible( is_advance); - floater->getChildView("snapshot_width")->setVisible( is_advance); - floater->getChildView("snapshot_height")->setVisible( is_advance); - floater->getChildView("keep_aspect_check")->setVisible( is_advance); - floater->getChildView("ui_check")->setVisible( is_advance); - floater->getChildView("hud_check")->setVisible( is_advance); - floater->getChildView("keep_open_check")->setVisible( is_advance); - floater->getChildView("freeze_frame_check")->setVisible( is_advance); - floater->getChildView("auto_snapshot_check")->setVisible( is_advance); - floater->getChildView("image_quality_slider")->setVisible( is_advance && show_slider); - - if (gSavedSettings.getBOOL("RenderUIInSnapshot") || gSavedSettings.getBOOL("RenderHUDInSnapshot")) - { //clamp snapshot resolution to window size when showing UI or HUD in snapshot - - LLSpinCtrl* width_ctrl = floater->getChild<LLSpinCtrl>("snapshot_width"); - LLSpinCtrl* height_ctrl = floater->getChild<LLSpinCtrl>("snapshot_height"); - - S32 width = gViewerWindow->getWindowWidthRaw(); - S32 height = gViewerWindow->getWindowHeightRaw(); - - width_ctrl->setMaxValue(width); - - height_ctrl->setMaxValue(height); + LLPanelSnapshot* active_panel = getActivePanel(floater); + if (active_panel) + { + LLSpinCtrl* width_ctrl = getWidthSpinner(floater); + LLSpinCtrl* height_ctrl = getHeightSpinner(floater); - if (width_ctrl->getValue().asInteger() > width) + // Initialize spinners. + if (width_ctrl->getValue().asInteger() == 0) { - width_ctrl->forceSetValue(width); + S32 w = gViewerWindow->getWindowWidthRaw(); + lldebugs << "Initializing width spinner (" << width_ctrl->getName() << "): " << w << llendl; + width_ctrl->setValue(w); } - if (height_ctrl->getValue().asInteger() > height) + if (height_ctrl->getValue().asInteger() == 0) { - height_ctrl->forceSetValue(height); + S32 h = gViewerWindow->getWindowHeightRaw(); + lldebugs << "Initializing height spinner (" << height_ctrl->getName() << "): " << h << llendl; + height_ctrl->setValue(h); + } + + // Сlamp snapshot resolution to window size when showing UI or HUD in snapshot. + if (gSavedSettings.getBOOL("RenderUIInSnapshot") || gSavedSettings.getBOOL("RenderHUDInSnapshot")) + { + S32 width = gViewerWindow->getWindowWidthRaw(); + S32 height = gViewerWindow->getWindowHeightRaw(); + + width_ctrl->setMaxValue(width); + + height_ctrl->setMaxValue(height); + + if (width_ctrl->getValue().asInteger() > width) + { + width_ctrl->forceSetValue(width); + } + if (height_ctrl->getValue().asInteger() > height) + { + height_ctrl->forceSetValue(height); + } + } + else + { + width_ctrl->setMaxValue(6016); + height_ctrl->setMaxValue(6016); } - } - else - { - LLSpinCtrl* width = floater->getChild<LLSpinCtrl>("snapshot_width"); - width->setMaxValue(6016); - LLSpinCtrl* height = floater->getChild<LLSpinCtrl>("snapshot_height"); - height->setMaxValue(6016); } LLSnapshotLivePreview* previewp = getPreviewView(floater); @@ -1399,11 +1395,7 @@ void LLFloaterSnapshot::Impl::updateControls(LLFloaterSnapshot* floater) BOOL got_snap = previewp && previewp->getSnapshotUpToDate(); // *TODO: Separate maximum size for Web images from postcards - floater->getChildView("send_btn")->setEnabled((shot_type == LLSnapshotLivePreview::SNAPSHOT_POSTCARD || - shot_type == LLSnapshotLivePreview::SNAPSHOT_WEB) && - got_snap && previewp->getDataSize() <= MAX_POSTCARD_DATASIZE); - floater->getChildView("upload_btn")->setEnabled(shot_type == LLSnapshotLivePreview::SNAPSHOT_TEXTURE && got_snap); - floater->getChildView("save_btn")->setEnabled(shot_type == LLSnapshotLivePreview::SNAPSHOT_LOCAL && got_snap); + lldebugs << "Is snapshot up-to-date? " << got_snap << llendl; LLLocale locale(LLLocale::USER_LOCALE); std::string bytes_string; @@ -1411,155 +1403,105 @@ void LLFloaterSnapshot::Impl::updateControls(LLFloaterSnapshot* floater) { LLResMgr::getInstance()->getIntegerString(bytes_string, (previewp->getDataSize()) >> 10 ); } - S32 upload_cost = LLGlobalEconomy::Singleton::getInstance()->getPriceUpload(); - floater->getChild<LLUICtrl>("texture")->setLabelArg("[AMOUNT]", llformat("%d",upload_cost)); - floater->getChild<LLUICtrl>("upload_btn")->setLabelArg("[AMOUNT]", llformat("%d",upload_cost)); + + // Update displayed image resolution. + LLTextBox* image_res_tb = floater->getChild<LLTextBox>("image_res_text"); + image_res_tb->setVisible(got_snap); + if (got_snap) + { + LLPointer<LLImageRaw> img = previewp->getEncodedImage(); + image_res_tb->setTextArg("[WIDTH]", llformat("%d", img->getWidth())); + image_res_tb->setTextArg("[HEIGHT]", llformat("%d", img->getHeight())); + } + floater->getChild<LLUICtrl>("file_size_label")->setTextArg("[SIZE]", got_snap ? bytes_string : floater->getString("unknown")); floater->getChild<LLUICtrl>("file_size_label")->setColor( shot_type == LLSnapshotLivePreview::SNAPSHOT_POSTCARD && got_bytes && previewp->getDataSize() > MAX_POSTCARD_DATASIZE ? LLUIColor(LLColor4::red) : LLUIColorTable::instance().getColor( "LabelTextColor" )); + // Update the width and height spinners based on the corresponding resolution combos. (?) switch(shot_type) { - // *TODO: Separate settings for Web images from postcards case LLSnapshotLivePreview::SNAPSHOT_WEB: + layer_type = LLViewerWindow::SNAPSHOT_TYPE_COLOR; + floater->getChild<LLUICtrl>("layer_types")->setValue("colors"); + setResolution(floater, "profile_size_combo"); + break; case LLSnapshotLivePreview::SNAPSHOT_POSTCARD: layer_type = LLViewerWindow::SNAPSHOT_TYPE_COLOR; floater->getChild<LLUICtrl>("layer_types")->setValue("colors"); - if(is_advance) - { - setResolution(floater, "postcard_size_combo"); - } + setResolution(floater, "postcard_size_combo"); break; case LLSnapshotLivePreview::SNAPSHOT_TEXTURE: layer_type = LLViewerWindow::SNAPSHOT_TYPE_COLOR; floater->getChild<LLUICtrl>("layer_types")->setValue("colors"); - if(is_advance) - { - setResolution(floater, "texture_size_combo"); - } + setResolution(floater, "texture_size_combo"); break; case LLSnapshotLivePreview::SNAPSHOT_LOCAL: - if(is_advance) - { - setResolution(floater, "local_size_combo"); - } + setResolution(floater, "local_size_combo"); break; default: break; } - updateResolutionTextEntry(floater); - if (previewp) { + lldebugs << "Setting snapshot type (" << shot_type << "), format (" << shot_format << ")" << llendl; previewp->setSnapshotType(shot_type); previewp->setSnapshotFormat(shot_format); previewp->setSnapshotBufferType(layer_type); } -} -// static -void LLFloaterSnapshot::Impl::updateResolutionTextEntry(LLFloaterSnapshot* floater) -{ - LLSpinCtrl* width_spinner = floater->getChild<LLSpinCtrl>("snapshot_width"); - LLSpinCtrl* height_spinner = floater->getChild<LLSpinCtrl>("snapshot_height"); - - if(getTypeIndex(floater) == LLSnapshotLivePreview::SNAPSHOT_TEXTURE) - { - width_spinner->setAllowEdit(FALSE); - height_spinner->setAllowEdit(FALSE); - } - else + LLPanelSnapshot* current_panel = Impl::getActivePanel(floater); + if (current_panel) { - width_spinner->setAllowEdit(TRUE); - height_spinner->setAllowEdit(TRUE); + LLSD info; + info["have-snapshot"] = got_snap; + current_panel->updateControls(info); } } // static -void LLFloaterSnapshot::Impl::checkAutoSnapshot(LLSnapshotLivePreview* previewp, BOOL update_thumbnail) +void LLFloaterSnapshot::Impl::setStatus(EStatus status, bool ok, const std::string& msg) { - if (previewp) + LLFloaterSnapshot* floater = LLFloaterSnapshot::getInstance(); + switch (status) { - BOOL autosnap = gSavedSettings.getBOOL("AutoSnapshot"); - previewp->updateSnapshot(autosnap, update_thumbnail, autosnap ? AUTO_SNAPSHOT_TIME_DELAY : 0.f); + case STATUS_READY: + setWorking(floater, false); + setFinished(floater, false); + break; + case STATUS_WORKING: + setWorking(floater, true); + setFinished(floater, false); + break; + case STATUS_FINISHED: + setWorking(floater, false); + setFinished(floater, true, ok, msg); + break; } -} -// static -void LLFloaterSnapshot::Impl::onClickDiscard(void* data) -{ - LLFloaterSnapshot *view = (LLFloaterSnapshot *)data; - - if (view) - { - view->closeFloater(); - } + floater->impl.mStatus = status; } - // static -void LLFloaterSnapshot::Impl::onCommitSave(LLUICtrl* ctrl, void* data) +void LLFloaterSnapshot::Impl::setNeedRefresh(LLFloaterSnapshot* floater, bool need) { - if (ctrl->getValue().asString() == "save as") - { - gViewerWindow->resetSnapshotLoc(); - } - onClickKeep(data); + if (!floater) return; + + floater->mRefreshLabel->setVisible(need); + floater->impl.mNeedRefresh = need; } // static -void LLFloaterSnapshot::Impl::onClickKeep(void* data) +void LLFloaterSnapshot::Impl::checkAutoSnapshot(LLSnapshotLivePreview* previewp, BOOL update_thumbnail) { - LLFloaterSnapshot *view = (LLFloaterSnapshot *)data; - LLSnapshotLivePreview* previewp = getPreviewView(view); - if (previewp) { - switch (previewp->getSnapshotType()) - { - case LLSnapshotLivePreview::SNAPSHOT_WEB: - previewp->saveWeb(); - break; - - case LLSnapshotLivePreview::SNAPSHOT_POSTCARD: - { - LLFloaterPostcard* floater = previewp->savePostcard(); - // if still in snapshot mode, put postcard floater in snapshot floaterview - // and link it to snapshot floater - if (floater && !gSavedSettings.getBOOL("CloseSnapshotOnKeep")) - { - gFloaterView->removeChild(floater); - gSnapshotFloaterView->addChild(floater); - view->addDependentFloater(floater, FALSE); - } - } - break; - - case LLSnapshotLivePreview::SNAPSHOT_TEXTURE: - previewp->saveTexture(); - break; - - case LLSnapshotLivePreview::SNAPSHOT_LOCAL: - previewp->saveLocal(); - break; - - default: - break; - } - - if (gSavedSettings.getBOOL("CloseSnapshotOnKeep")) - { - view->closeFloater(); - } - else - { - checkAutoSnapshot(previewp); - } - - updateControls(view); + BOOL autosnap = gSavedSettings.getBOOL("AutoSnapshot"); + lldebugs << "updating " << (autosnap ? "snapshot" : "thumbnail") << llendl; + previewp->updateSnapshot(autosnap, update_thumbnail, autosnap ? AUTO_SNAPSHOT_TIME_DELAY : 0.f); } } @@ -1570,6 +1512,8 @@ void LLFloaterSnapshot::Impl::onClickNewSnapshot(void* data) LLFloaterSnapshot *view = (LLFloaterSnapshot *)data; if (previewp && view) { + view->impl.setStatus(Impl::STATUS_READY); + lldebugs << "updating snapshot" << llendl; previewp->updateSnapshot(TRUE); } } @@ -1590,36 +1534,15 @@ void LLFloaterSnapshot::Impl::onClickAutoSnap(LLUICtrl *ctrl, void* data) void LLFloaterSnapshot::Impl::onClickMore(void* data) { - gSavedSettings.setBOOL( "AdvanceSnapshot", TRUE ); - - LLFloaterSnapshot *view = (LLFloaterSnapshot *)data; - if (view) - { - view->translate( 0, view->getUIWinHeightShort() - view->getUIWinHeightLong() ); - view->reshape(view->getRect().getWidth(), view->getUIWinHeightLong()); - updateControls(view) ; - updateLayout(view) ; - if(getPreviewView(view)) - { - getPreviewView(view)->setThumbnailImageSize() ; - } - } -} -void LLFloaterSnapshot::Impl::onClickLess(void* data) -{ - gSavedSettings.setBOOL( "AdvanceSnapshot", FALSE ); + BOOL visible = gSavedSettings.getBOOL("AdvanceSnapshot"); - LLFloaterSnapshot *view = (LLFloaterSnapshot *)data; + LLFloaterSnapshot *view = (LLFloaterSnapshot *)data; if (view) { - view->translate( 0, view->getUIWinHeightLong() - view->getUIWinHeightShort() ); - view->reshape(view->getRect().getWidth(), view->getUIWinHeightShort()); + view->impl.setStatus(Impl::STATUS_READY); + gSavedSettings.setBOOL("AdvanceSnapshot", !visible); updateControls(view) ; updateLayout(view) ; - if(getPreviewView(view)) - { - getPreviewView(view)->setThumbnailImageSize() ; - } } } @@ -1652,20 +1575,10 @@ void LLFloaterSnapshot::Impl::onClickHUDCheck(LLUICtrl *ctrl, void* data) } // static -void LLFloaterSnapshot::Impl::onClickKeepOpenCheck(LLUICtrl* ctrl, void* data) +void LLFloaterSnapshot::Impl::applyKeepAspectCheck(LLFloaterSnapshot* view, BOOL checked) { - LLCheckBoxCtrl *check = (LLCheckBoxCtrl *)ctrl; - - gSavedSettings.setBOOL( "CloseSnapshotOnKeep", !check->get() ); -} + gSavedSettings.setBOOL("KeepAspectForSnapshot", checked); -// static -void LLFloaterSnapshot::Impl::onClickKeepAspectCheck(LLUICtrl* ctrl, void* data) -{ - LLCheckBoxCtrl *check = (LLCheckBoxCtrl *)ctrl; - gSavedSettings.setBOOL( "KeepAspectForSnapshot", check->get() ); - - LLFloaterSnapshot *view = (LLFloaterSnapshot *)data; if (view) { LLSnapshotLivePreview* previewp = getPreviewView(view) ; @@ -1675,11 +1588,9 @@ void LLFloaterSnapshot::Impl::onClickKeepAspectCheck(LLUICtrl* ctrl, void* data) S32 w, h ; previewp->getSize(w, h) ; - if(checkImageSize(previewp, w, h, TRUE, previewp->getMaxImageSize())) - { - resetSnapshotSizeOnUI(view, w, h) ; - } + updateSpinners(view, previewp, w, h, TRUE); // may change w and h + lldebugs << "updating thumbnail" << llendl; previewp->setSize(w, h) ; previewp->updateSnapshot(FALSE, TRUE); checkAutoSnapshot(previewp, TRUE); @@ -1688,20 +1599,6 @@ void LLFloaterSnapshot::Impl::onClickKeepAspectCheck(LLUICtrl* ctrl, void* data) } // static -void LLFloaterSnapshot::Impl::onCommitQuality(LLUICtrl* ctrl, void* data) -{ - LLSliderCtrl* slider = (LLSliderCtrl*)ctrl; - S32 quality_val = llfloor((F32)slider->getValue().asReal()); - - LLSnapshotLivePreview* previewp = getPreviewView((LLFloaterSnapshot *)data); - if (previewp) - { - previewp->setSnapshotQuality(quality_val); - } - checkAutoSnapshot(previewp, TRUE); -} - -// static void LLFloaterSnapshot::Impl::onCommitFreezeFrame(LLUICtrl* ctrl, void* data) { LLCheckBoxCtrl* check_box = (LLCheckBoxCtrl*)ctrl; @@ -1723,71 +1620,79 @@ void LLFloaterSnapshot::Impl::checkAspectRatio(LLFloaterSnapshot *view, S32 inde LLSnapshotLivePreview *previewp = getPreviewView(view) ; // Don't round texture sizes; textures are commonly stretched in world, profiles, etc and need to be "squashed" during upload, not cropped here -#if 0 - if(LLSnapshotLivePreview::SNAPSHOT_TEXTURE == getTypeIndex(view)) + if(LLSnapshotLivePreview::SNAPSHOT_TEXTURE == getActiveSnapshotType(view)) { previewp->mKeepAspectRatio = FALSE ; return ; } -#endif - - if(0 == index) //current window size - { - view->impl.mAspectRatioCheckOff = true ; - view->getChildView("keep_aspect_check")->setEnabled(FALSE) ; - if(previewp) - { - previewp->mKeepAspectRatio = TRUE ; - } + BOOL keep_aspect = FALSE, enable_cb = FALSE; + + if (0 == index) // current window size + { + enable_cb = FALSE; + keep_aspect = TRUE; } - else if(-1 == index) //custom + else if (-1 == index) // custom { - view->impl.mAspectRatioCheckOff = false ; - //if(LLSnapshotLivePreview::SNAPSHOT_TEXTURE != gSavedSettings.getS32("LastSnapshotType")) - { - view->getChildView("keep_aspect_check")->setEnabled(TRUE) ; - - if(previewp) - { - previewp->mKeepAspectRatio = gSavedSettings.getBOOL("KeepAspectForSnapshot") ; - } - } + enable_cb = TRUE; + keep_aspect = gSavedSettings.getBOOL("KeepAspectForSnapshot"); } - else + else // predefined resolution { - view->impl.mAspectRatioCheckOff = true ; - view->getChildView("keep_aspect_check")->setEnabled(FALSE) ; - - if(previewp) - { - previewp->mKeepAspectRatio = FALSE ; - } + enable_cb = FALSE; + keep_aspect = FALSE; } - return ; + view->impl.mAspectRatioCheckOff = !enable_cb; + enableAspectRatioCheckbox(view, enable_cb); + if (previewp) + { + previewp->mKeepAspectRatio = keep_aspect; + } } -static std::string lastSnapshotWidthName() +// Show/hide upload progress indicators. +// static +void LLFloaterSnapshot::Impl::setWorking(LLFloaterSnapshot* floater, bool working) { - switch(gSavedSettings.getS32("LastSnapshotType")) + LLUICtrl* working_lbl = floater->getChild<LLUICtrl>("working_lbl"); + working_lbl->setVisible(working); + floater->getChild<LLUICtrl>("working_indicator")->setVisible(working); + + if (working) + { + const std::string panel_name = getActivePanel(floater, false)->getName(); + const std::string prefix = panel_name.substr(std::string("panel_snapshot_").size()); + std::string progress_text = floater->getString(prefix + "_" + "progress_str"); + working_lbl->setValue(progress_text); + } + + // All controls should be disabled while posting. + floater->setCtrlsEnabled(!working); + LLPanelSnapshot* active_panel = getActivePanel(floater); + if (active_panel) { - // *TODO: Separate settings for Web snapshots and postcards - case LLSnapshotLivePreview::SNAPSHOT_WEB: return "LastSnapshotToEmailWidth"; - case LLSnapshotLivePreview::SNAPSHOT_POSTCARD: return "LastSnapshotToEmailWidth"; - case LLSnapshotLivePreview::SNAPSHOT_TEXTURE: return "LastSnapshotToInventoryWidth"; - default: return "LastSnapshotToDiskWidth"; + active_panel->enableControls(!working); } } -static std::string lastSnapshotHeightName() + +// Show/hide upload status message. +// static +void LLFloaterSnapshot::Impl::setFinished(LLFloaterSnapshot* floater, bool finished, bool ok, const std::string& msg) { - switch(gSavedSettings.getS32("LastSnapshotType")) + floater->mSucceessLblPanel->setVisible(finished && ok); + floater->mFailureLblPanel->setVisible(finished && !ok); + + if (finished) { - // *TODO: Separate settings for Web snapshots and postcards - case LLSnapshotLivePreview::SNAPSHOT_WEB: return "LastSnapshotToEmailHeight"; - case LLSnapshotLivePreview::SNAPSHOT_POSTCARD: return "LastSnapshotToEmailHeight"; - case LLSnapshotLivePreview::SNAPSHOT_TEXTURE: return "LastSnapshotToInventoryHeight"; - default: return "LastSnapshotToDiskHeight"; + LLUICtrl* finished_lbl = floater->getChild<LLUICtrl>(ok ? "succeeded_lbl" : "failed_lbl"); + std::string result_text = floater->getString(msg + "_" + (ok ? "succeeded_str" : "failed_str")); + finished_lbl->setValue(result_text); + + LLSideTrayPanelContainer* panel_container = floater->getChild<LLSideTrayPanelContainer>("panel_container"); + panel_container->openPreviousPanel(); + panel_container->getCurrentPanel()->onOpen(LLSD()); } } @@ -1799,14 +1704,10 @@ void LLFloaterSnapshot::Impl::updateResolution(LLUICtrl* ctrl, void* data, BOOL if (!view || !combobox) { + llassert(view && combobox); return; } - // save off all selected resolution values - gSavedSettings.setS32("SnapshotPostcardLastResolution", view->getChild<LLComboBox>("postcard_size_combo")->getCurrentIndex()); - gSavedSettings.setS32("SnapshotTextureLastResolution", view->getChild<LLComboBox>("texture_size_combo")->getCurrentIndex()); - gSavedSettings.setS32("SnapshotLocalLastResolution", view->getChild<LLComboBox>("local_size_combo")->getCurrentIndex()); - std::string sdstring = combobox->getSelectedValue(); LLSD sdres; std::stringstream sstream(sdstring); @@ -1824,16 +1725,35 @@ void LLFloaterSnapshot::Impl::updateResolution(LLUICtrl* ctrl, void* data, BOOL if (width == 0 || height == 0) { // take resolution from current window size + lldebugs << "Setting preview res from window: " << gViewerWindow->getWindowWidthRaw() << "x" << gViewerWindow->getWindowHeightRaw() << llendl; previewp->setSize(gViewerWindow->getWindowWidthRaw(), gViewerWindow->getWindowHeightRaw()); } else if (width == -1 || height == -1) { // load last custom value - previewp->setSize(gSavedSettings.getS32(lastSnapshotWidthName()), gSavedSettings.getS32(lastSnapshotHeightName())); + S32 new_width = 0, new_height = 0; + LLPanelSnapshot* spanel = getActivePanel(view); + if (spanel) + { + lldebugs << "Loading typed res from panel " << spanel->getName() << llendl; + new_width = spanel->getTypedPreviewWidth(); + new_height = spanel->getTypedPreviewHeight(); + } + else + { + lldebugs << "No custom res chosen, setting preview res from window: " + << gViewerWindow->getWindowWidthRaw() << "x" << gViewerWindow->getWindowHeightRaw() << llendl; + new_width = gViewerWindow->getWindowWidthRaw(); + new_height = gViewerWindow->getWindowHeightRaw(); + } + + llassert(new_width > 0 && new_height > 0); + previewp->setSize(new_width, new_height); } else { // use the resolution from the selected pre-canned drop-down choice + lldebugs << "Setting preview res selected from combo: " << width << "x" << height << llendl; previewp->setSize(width, height); } @@ -1847,16 +1767,12 @@ void LLFloaterSnapshot::Impl::updateResolution(LLUICtrl* ctrl, void* data, BOOL height = llmin(height, gViewerWindow->getWindowHeightRaw()); } + updateSpinners(view, previewp, width, height, TRUE); // may change width and height - if(checkImageSize(previewp, width, height, TRUE, previewp->getMaxImageSize())) + if(getWidthSpinner(view)->getValue().asInteger() != width || getHeightSpinner(view)->getValue().asInteger() != height) { - resetSnapshotSizeOnUI(view, width, height) ; - } - - if(view->getChild<LLUICtrl>("snapshot_width")->getValue().asInteger() != width || view->getChild<LLUICtrl>("snapshot_height")->getValue().asInteger() != height) - { - view->getChild<LLUICtrl>("snapshot_width")->setValue(width); - view->getChild<LLUICtrl>("snapshot_height")->setValue(height); + getWidthSpinner(view)->setValue(width); + getHeightSpinner(view)->setValue(height); } if(original_width != width || original_height != height) @@ -1865,10 +1781,13 @@ void LLFloaterSnapshot::Impl::updateResolution(LLUICtrl* ctrl, void* data, BOOL // hide old preview as the aspect ratio could be wrong checkAutoSnapshot(previewp, FALSE); + lldebugs << "updating thumbnail" << llendl; getPreviewView(view)->updateSnapshot(FALSE, TRUE); if(do_update) { + lldebugs << "Will update controls" << llendl; updateControls(view); + setNeedRefresh(view, true); } } } @@ -1892,96 +1811,46 @@ void LLFloaterSnapshot::Impl::onCommitLayerTypes(LLUICtrl* ctrl, void*data) } } -//static -void LLFloaterSnapshot::Impl::onCommitSnapshotType(LLUICtrl* ctrl, void* data) +// static +void LLFloaterSnapshot::Impl::onImageQualityChange(LLFloaterSnapshot* view, S32 quality_val) { - LLFloaterSnapshot *view = (LLFloaterSnapshot *)data; - if (view) + LLSnapshotLivePreview* previewp = getPreviewView(view); + if (previewp) { - gSavedSettings.setS32("LastSnapshotType", getTypeIndex(view)); - getPreviewView(view)->updateSnapshot(TRUE); - updateControls(view); + previewp->setSnapshotQuality(quality_val); } + checkAutoSnapshot(previewp, TRUE); } - -//static -void LLFloaterSnapshot::Impl::onCommitSnapshotFormat(LLUICtrl* ctrl, void* data) +// static +void LLFloaterSnapshot::Impl::onImageFormatChange(LLFloaterSnapshot* view) { - LLFloaterSnapshot *view = (LLFloaterSnapshot *)data; if (view) { - gSavedSettings.setS32("SnapshotFormat", getFormatIndex(view)); + gSavedSettings.setS32("SnapshotFormat", getImageFormat(view)); + lldebugs << "image format changed, updating snapshot" << llendl; getPreviewView(view)->updateSnapshot(TRUE); updateControls(view); + setNeedRefresh(view, false); // we're refreshing } } - - // Sets the named size combo to "custom" mode. // static void LLFloaterSnapshot::Impl::comboSetCustom(LLFloaterSnapshot* floater, const std::string& comboname) { LLComboBox* combo = floater->getChild<LLComboBox>(comboname); - combo->setCurrentByIndex(combo->getItemCount() - 1); // "custom" is always the last index - - if(comboname == "postcard_size_combo") - { - gSavedSettings.setS32("SnapshotPostcardLastResolution", combo->getCurrentIndex()); - } - else if(comboname == "texture_size_combo") - { - gSavedSettings.setS32("SnapshotTextureLastResolution", combo->getCurrentIndex()); - } - else if(comboname == "local_size_combo") - { - gSavedSettings.setS32("SnapshotLocalLastResolution", combo->getCurrentIndex()); - } - checkAspectRatio(floater, -1); // -1 means custom } - - +// Update supplied width and height according to the constrain proportions flag; limit them by max_val. //static BOOL LLFloaterSnapshot::Impl::checkImageSize(LLSnapshotLivePreview* previewp, S32& width, S32& height, BOOL isWidthChanged, S32 max_value) { S32 w = width ; S32 h = height ; - //if texture, ignore aspect ratio setting, round image size to power of 2. -#if 0 // Don't round texture sizes; textures are commonly stretched in world, profiles, etc and need to be "squashed" during upload, not cropped here - if(LLSnapshotLivePreview::SNAPSHOT_TEXTURE == gSavedSettings.getS32("LastSnapshotType")) - { - if(width > max_value) - { - width = max_value ; - } - if(height > max_value) - { - height = max_value ; - } - - //round to nearest power of 2 based on the direction of movement - // i.e. higher power of two if increasing texture resolution - if(gSavedSettings.getS32("LastSnapshotToInventoryWidth") < width || - gSavedSettings.getS32("LastSnapshotToInventoryHeight") < height) - { - // Up arrow pressed - width = get_next_power_two(width, MAX_TEXTURE_SIZE) ; - height = get_next_power_two(height, MAX_TEXTURE_SIZE) ; - } - else - { - // Down or no change - width = get_lower_power_two(width, MAX_TEXTURE_SIZE) ; - height = get_lower_power_two(height, MAX_TEXTURE_SIZE) ; - } - } - else -#endif if(previewp && previewp->mKeepAspectRatio) { if(gViewerWindow->getWindowWidthRaw() < 1 || gViewerWindow->getWindowHeightRaw() < 1) @@ -2017,87 +1886,79 @@ BOOL LLFloaterSnapshot::Impl::checkImageSize(LLSnapshotLivePreview* previewp, S3 } } } - else - { - } return (w != width || h != height) ; } //static -void LLFloaterSnapshot::Impl::resetSnapshotSizeOnUI(LLFloaterSnapshot *view, S32 width, S32 height) +void LLFloaterSnapshot::Impl::setImageSizeSpinnersValues(LLFloaterSnapshot *view, S32 width, S32 height) { - view->getChild<LLSpinCtrl>("snapshot_width")->forceSetValue(width); - view->getChild<LLSpinCtrl>("snapshot_height")->forceSetValue(height); - gSavedSettings.setS32(lastSnapshotWidthName(), width); - gSavedSettings.setS32(lastSnapshotHeightName(), height); + getWidthSpinner(view)->forceSetValue(width); + getHeightSpinner(view)->forceSetValue(height); } -//static -void LLFloaterSnapshot::Impl::onCommitCustomResolution(LLUICtrl *ctrl, void* data) +// static +void LLFloaterSnapshot::Impl::updateSpinners(LLFloaterSnapshot* view, LLSnapshotLivePreview* previewp, S32& width, S32& height, BOOL is_width_changed) { - LLFloaterSnapshot *view = (LLFloaterSnapshot *)data; - if (view) + if (checkImageSize(previewp, width, height, is_width_changed, previewp->getMaxImageSize())) { - S32 w = llfloor((F32)view->getChild<LLUICtrl>("snapshot_width")->getValue().asReal()); - S32 h = llfloor((F32)view->getChild<LLUICtrl>("snapshot_height")->getValue().asReal()); + setImageSizeSpinnersValues(view, width, height); + } +} - LLSnapshotLivePreview* previewp = getPreviewView(view); - if (previewp) +// static +void LLFloaterSnapshot::Impl::applyCustomResolution(LLFloaterSnapshot* view, S32 w, S32 h) +{ + bool need_refresh = false; + + lldebugs << "applyCustomResolution(" << w << ", " << h << ")" << llendl; + if (!view) return; + + LLSnapshotLivePreview* previewp = getPreviewView(view); + if (previewp) + { + S32 curw,curh; + previewp->getSize(curw, curh); + + if (w != curw || h != curh) { - S32 curw,curh; - previewp->getSize(curw, curh); - - if (w != curw || h != curh) - { - BOOL update_ = FALSE ; - //if to upload a snapshot, process spinner input in a special way. -#if 0 // Don't round texture sizes; textures are commonly stretched in world, profiles, etc and need to be "squashed" during upload, not cropped here - if(LLSnapshotLivePreview::SNAPSHOT_TEXTURE == gSavedSettings.getS32("LastSnapshotType")) - { - S32 spinner_increment = (S32)((LLSpinCtrl*)ctrl)->getIncrement() ; - S32 dw = w - curw ; - S32 dh = h - curh ; - dw = (dw == spinner_increment) ? 1 : ((dw == -spinner_increment) ? -1 : 0) ; - dh = (dh == spinner_increment) ? 1 : ((dh == -spinner_increment) ? -1 : 0) ; - - if(dw) - { - w = (dw > 0) ? curw << dw : curw >> -dw ; - update_ = TRUE ; - } - if(dh) - { - h = (dh > 0) ? curh << dh : curh >> -dh ; - update_ = TRUE ; - } - } -#endif - previewp->setMaxImageSize((S32)((LLSpinCtrl *)ctrl)->getMaxValue()) ; - - // Check image size changes the value of height and width - if(checkImageSize(previewp, w, h, w != curw, previewp->getMaxImageSize()) - || update_) - { - resetSnapshotSizeOnUI(view, w, h) ; - } + //if to upload a snapshot, process spinner input in a special way. + previewp->setMaxImageSize((S32) getWidthSpinner(view)->getMaxValue()) ; - previewp->setSize(w,h); - checkAutoSnapshot(previewp, FALSE); - previewp->updateSnapshot(FALSE, TRUE); - comboSetCustom(view, "postcard_size_combo"); - comboSetCustom(view, "texture_size_combo"); - comboSetCustom(view, "local_size_combo"); - } - } + updateSpinners(view, previewp, w, h, w != curw); // may change w and h - gSavedSettings.setS32(lastSnapshotWidthName(), w); - gSavedSettings.setS32(lastSnapshotHeightName(), h); + previewp->setSize(w,h); + checkAutoSnapshot(previewp, FALSE); + lldebugs << "applied custom resolution, updating thumbnail" << llendl; + previewp->updateSnapshot(FALSE, TRUE); + comboSetCustom(view, "profile_size_combo"); + comboSetCustom(view, "postcard_size_combo"); + comboSetCustom(view, "texture_size_combo"); + comboSetCustom(view, "local_size_combo"); + need_refresh = true; + } + } - updateControls(view); + updateControls(view); + if (need_refresh) + { + setNeedRefresh(view, true); // need to do this after updateControls() } } +// static +void LLFloaterSnapshot::Impl::onSnapshotUploadFinished(bool status) +{ + setStatus(STATUS_FINISHED, status, "profile"); +} + + +// static +void LLFloaterSnapshot::Impl::onSendingPostcardFinished(bool status) +{ + setStatus(STATUS_FINISHED, status, "postcard"); +} + ///---------------------------------------------------------------------------- /// Class LLFloaterSnapshot ///---------------------------------------------------------------------------- @@ -2105,6 +1966,10 @@ void LLFloaterSnapshot::Impl::onCommitCustomResolution(LLUICtrl *ctrl, void* dat // Default constructor LLFloaterSnapshot::LLFloaterSnapshot(const LLSD& key) : LLFloater(key), + mRefreshBtn(NULL), + mRefreshLabel(NULL), + mSucceessLblPanel(NULL), + mFailureLblPanel(NULL), impl (*(new Impl)) { } @@ -2134,24 +1999,13 @@ BOOL LLFloaterSnapshot::postBuild() LLWebSharing::instance().init(); } - childSetCommitCallback("snapshot_type_radio", Impl::onCommitSnapshotType, this); - childSetCommitCallback("local_format_combo", Impl::onCommitSnapshotFormat, this); - + mRefreshBtn = getChild<LLUICtrl>("new_snapshot_btn"); childSetAction("new_snapshot_btn", Impl::onClickNewSnapshot, this); + mRefreshLabel = getChild<LLUICtrl>("refresh_lbl"); + mSucceessLblPanel = getChild<LLUICtrl>("succeeded_panel"); + mFailureLblPanel = getChild<LLUICtrl>("failed_panel"); - childSetAction("more_btn", Impl::onClickMore, this); - childSetAction("less_btn", Impl::onClickLess, this); - - childSetAction("upload_btn", Impl::onClickKeep, this); - childSetAction("send_btn", Impl::onClickKeep, this); - childSetCommitCallback("save_btn", Impl::onCommitSave, this); - childSetAction("discard_btn", Impl::onClickDiscard, this); - - childSetCommitCallback("image_quality_slider", Impl::onCommitQuality, this); - getChild<LLUICtrl>("image_quality_slider")->setValue(gSavedSettings.getS32("SnapshotQuality")); - - childSetCommitCallback("snapshot_width", Impl::onCommitCustomResolution, this); - childSetCommitCallback("snapshot_height", Impl::onCommitCustomResolution, this); + childSetAction("advanced_options_btn", Impl::onClickMore, this); childSetCommitCallback("ui_check", Impl::onClickUICheck, this); getChild<LLUICtrl>("ui_check")->setValue(gSavedSettings.getBOOL("RenderUIInSnapshot")); @@ -2159,28 +2013,22 @@ BOOL LLFloaterSnapshot::postBuild() childSetCommitCallback("hud_check", Impl::onClickHUDCheck, this); getChild<LLUICtrl>("hud_check")->setValue(gSavedSettings.getBOOL("RenderHUDInSnapshot")); - childSetCommitCallback("keep_open_check", Impl::onClickKeepOpenCheck, this); - getChild<LLUICtrl>("keep_open_check")->setValue(!gSavedSettings.getBOOL("CloseSnapshotOnKeep")); - - childSetCommitCallback("keep_aspect_check", Impl::onClickKeepAspectCheck, this); - getChild<LLUICtrl>("keep_aspect_check")->setValue(gSavedSettings.getBOOL("KeepAspectForSnapshot")); + impl.setAspectRatioCheckboxValue(this, gSavedSettings.getBOOL("KeepAspectForSnapshot")); childSetCommitCallback("layer_types", Impl::onCommitLayerTypes, this); getChild<LLUICtrl>("layer_types")->setValue("colors"); getChildView("layer_types")->setEnabled(FALSE); - getChild<LLUICtrl>("snapshot_width")->setValue(gSavedSettings.getS32(lastSnapshotWidthName())); - getChild<LLUICtrl>("snapshot_height")->setValue(gSavedSettings.getS32(lastSnapshotHeightName())); - getChild<LLUICtrl>("freeze_frame_check")->setValue(gSavedSettings.getBOOL("UseFreezeFrame")); childSetCommitCallback("freeze_frame_check", Impl::onCommitFreezeFrame, this); getChild<LLUICtrl>("auto_snapshot_check")->setValue(gSavedSettings.getBOOL("AutoSnapshot")); childSetCommitCallback("auto_snapshot_check", Impl::onClickAutoSnap, this); - childSetCommitCallback("postcard_size_combo", Impl::onCommitResolution, this); - childSetCommitCallback("texture_size_combo", Impl::onCommitResolution, this); - childSetCommitCallback("local_size_combo", Impl::onCommitResolution, this); + LLWebProfile::setImageUploadResultCallback(boost::bind(&LLFloaterSnapshot::Impl::onSnapshotUploadFinished, _1)); + LLPostCard::setPostResultCallback(boost::bind(&LLFloaterSnapshot::Impl::onSendingPostcardFinished, _1)); + + sThumbnailPlaceholder = getChild<LLUICtrl>("thumbnail_placeholder"); // create preview window LLRect full_screen_rect = getRootView()->getRect(); @@ -2221,19 +2069,65 @@ void LLFloaterSnapshot::draw() { if(previewp->getThumbnailImage()) { - LLRect thumbnail_rect = getChild<LLUICtrl>("thumbnail_placeholder")->getRect(); + bool working = impl.getStatus() == Impl::STATUS_WORKING; + const LLRect& thumbnail_rect = getThumbnailPlaceholderRect(); + const S32 thumbnail_w = previewp->getThumbnailWidth(); + const S32 thumbnail_h = previewp->getThumbnailHeight(); + + // calc preview offset within the preview rect + const S32 local_offset_x = (thumbnail_rect.getWidth() - thumbnail_w) / 2 ; + const S32 local_offset_y = (thumbnail_rect.getHeight() - thumbnail_h) / 2 ; // preview y pos within the preview rect - S32 offset_x = (getRect().getWidth() - previewp->getThumbnailWidth()) / 2 ; - S32 offset_y = thumbnail_rect.mBottom + (thumbnail_rect.getHeight() - previewp->getThumbnailHeight()) / 2 ; + // calc preview offset within the floater rect + S32 offset_x = thumbnail_rect.mLeft + local_offset_x; + S32 offset_y = thumbnail_rect.mBottom + local_offset_y; - glMatrixMode(GL_MODELVIEW); + gGL.matrixMode(LLRender::MM_MODELVIEW); // Apply floater transparency to the texture unless the floater is focused. F32 alpha = getTransparencyType() == TT_ACTIVE ? 1.0f : getCurrentTransparency(); + LLColor4 color = working ? LLColor4::grey4 : LLColor4::white; gl_draw_scaled_image(offset_x, offset_y, - previewp->getThumbnailWidth(), previewp->getThumbnailHeight(), - previewp->getThumbnailImage(), LLColor4::white % alpha); + thumbnail_w, thumbnail_h, + previewp->getThumbnailImage(), color % alpha); previewp->drawPreviewRect(offset_x, offset_y) ; + + // Draw some controls on top of the preview thumbnail. + static const S32 PADDING = 5; + static const S32 REFRESH_LBL_BG_HEIGHT = 32; + + // Reshape and position the posting result message panels at the top of the thumbnail. + // Do this regardless of current posting status (finished or not) to avoid flicker + // when the result message is displayed for the first time. + // if (impl.getStatus() == Impl::STATUS_FINISHED) + { + LLRect result_lbl_rect = mSucceessLblPanel->getRect(); + const S32 result_lbl_h = result_lbl_rect.getHeight(); + result_lbl_rect.setLeftTopAndSize(local_offset_x, local_offset_y + thumbnail_h, thumbnail_w - 1, result_lbl_h); + mSucceessLblPanel->reshape(result_lbl_rect.getWidth(), result_lbl_h); + mSucceessLblPanel->setRect(result_lbl_rect); + mFailureLblPanel->reshape(result_lbl_rect.getWidth(), result_lbl_h); + mFailureLblPanel->setRect(result_lbl_rect); + } + + // Position the refresh button in the bottom left corner of the thumbnail. + mRefreshBtn->setOrigin(local_offset_x + PADDING, local_offset_y + PADDING); + + if (impl.mNeedRefresh) + { + // Place the refresh hint text to the right of the refresh button. + const LLRect& refresh_btn_rect = mRefreshBtn->getRect(); + mRefreshLabel->setOrigin(refresh_btn_rect.mLeft + refresh_btn_rect.getWidth() + PADDING, refresh_btn_rect.mBottom); + + // Draw the refresh hint background. + LLRect refresh_label_bg_rect(offset_x, offset_y + REFRESH_LBL_BG_HEIGHT, offset_x + thumbnail_w - 1, offset_y); + gl_rect_2d(refresh_label_bg_rect, LLColor4::white % 0.9f, TRUE); + } + + gGL.pushUIMatrix(); + LLUI::translate((F32) thumbnail_rect.mLeft, (F32) thumbnail_rect.mBottom); + sThumbnailPlaceholder->draw(); + gGL.popUIMatrix(); } } } @@ -2243,12 +2137,16 @@ void LLFloaterSnapshot::onOpen(const LLSD& key) LLSnapshotLivePreview* preview = LLFloaterSnapshot::Impl::getPreviewView(this); if(preview) { + lldebugs << "opened, updating snapshot" << llendl; preview->updateSnapshot(TRUE); } focusFirstItem(FALSE); gSnapshotFloaterView->setEnabled(TRUE); gSnapshotFloaterView->setVisible(TRUE); gSnapshotFloaterView->adjustToFitScreen(this, FALSE); + + // Initialize default tab. + getChild<LLSideTrayPanelContainer>("panel_container")->getCurrentPanel()->onOpen(LLSD()); } void LLFloaterSnapshot::onClose(bool app_quitting) @@ -2256,6 +2154,62 @@ void LLFloaterSnapshot::onClose(bool app_quitting) getParent()->setMouseOpaque(FALSE); } +// virtual +S32 LLFloaterSnapshot::notify(const LLSD& info) +{ + // A child panel wants to change snapshot resolution. + if (info.has("combo-res-change")) + { + std::string combo_name = info["combo-res-change"]["control-name"].asString(); + impl.updateResolution(getChild<LLUICtrl>(combo_name), this); + return 1; + } + + if (info.has("custom-res-change")) + { + LLSD res = info["custom-res-change"]; + impl.applyCustomResolution(this, res["w"].asInteger(), res["h"].asInteger()); + return 1; + } + + if (info.has("keep-aspect-change")) + { + impl.applyKeepAspectCheck(this, info["keep-aspect-change"].asBoolean()); + return 1; + } + + if (info.has("image-quality-change")) + { + impl.onImageQualityChange(this, info["image-quality-change"].asInteger()); + return 1; + } + + if (info.has("image-format-change")) + { + impl.onImageFormatChange(this); + return 1; + } + + if (info.has("set-ready")) + { + impl.setStatus(Impl::STATUS_READY); + return 1; + } + + if (info.has("set-working")) + { + impl.setStatus(Impl::STATUS_WORKING); + return 1; + } + + if (info.has("set-finished")) + { + LLSD data = info["set-finished"]; + impl.setStatus(Impl::STATUS_FINISHED, data["ok"].asBoolean(), data["msg"].asString()); + return 1; + } + return 0; +} //static void LLFloaterSnapshot::update() @@ -2265,6 +2219,7 @@ void LLFloaterSnapshot::update() return; BOOL changed = FALSE; + lldebugs << "npreviews: " << LLSnapshotLivePreview::sList.size() << llendl; for (std::set<LLSnapshotLivePreview*>::iterator iter = LLSnapshotLivePreview::sList.begin(); iter != LLSnapshotLivePreview::sList.end(); ++iter) { @@ -2272,10 +2227,181 @@ void LLFloaterSnapshot::update() } if(changed) { + lldebugs << "changed" << llendl; inst->impl.updateControls(inst); } } +// static +LLFloaterSnapshot* LLFloaterSnapshot::getInstance() +{ + return LLFloaterReg::getTypedInstance<LLFloaterSnapshot>("snapshot"); +} + +// static +void LLFloaterSnapshot::saveTexture() +{ + lldebugs << "saveTexture" << llendl; + + // FIXME: duplicated code + LLFloaterSnapshot* instance = LLFloaterReg::findTypedInstance<LLFloaterSnapshot>("snapshot"); + if (!instance) + { + llassert(instance != NULL); + return; + } + LLSnapshotLivePreview* previewp = Impl::getPreviewView(instance); + if (!previewp) + { + llassert(previewp != NULL); + return; + } + + previewp->saveTexture(); +} + +// static +BOOL LLFloaterSnapshot::saveLocal() +{ + lldebugs << "saveLocal" << llendl; + // FIXME: duplicated code + LLFloaterSnapshot* instance = LLFloaterReg::findTypedInstance<LLFloaterSnapshot>("snapshot"); + if (!instance) + { + llassert(instance != NULL); + return FALSE; + } + LLSnapshotLivePreview* previewp = Impl::getPreviewView(instance); + if (!previewp) + { + llassert(previewp != NULL); + return FALSE; + } + + return previewp->saveLocal(); +} + +// static +void LLFloaterSnapshot::preUpdate() +{ + // FIXME: duplicated code + LLFloaterSnapshot* instance = LLFloaterReg::findTypedInstance<LLFloaterSnapshot>("snapshot"); + if (instance) + { + // Disable the send/post/save buttons until snapshot is ready. + Impl::updateControls(instance); + + // Force hiding the "Refresh to save" hint because we know we've just started refresh. + Impl::setNeedRefresh(instance, false); + } +} + +// static +void LLFloaterSnapshot::postUpdate() +{ + // FIXME: duplicated code + LLFloaterSnapshot* instance = LLFloaterReg::findTypedInstance<LLFloaterSnapshot>("snapshot"); + if (instance) + { + // Enable the send/post/save buttons. + Impl::updateControls(instance); + + // We've just done refresh. + Impl::setNeedRefresh(instance, false); + + // The refresh button is initially hidden. We show it after the first update, + // i.e. when preview appears. + if (!instance->mRefreshBtn->getVisible()) + { + instance->mRefreshBtn->setVisible(true); + } + } +} + +// static +void LLFloaterSnapshot::postSave() +{ + LLFloaterSnapshot* instance = LLFloaterReg::findTypedInstance<LLFloaterSnapshot>("snapshot"); + if (!instance) + { + llassert(instance != NULL); + return; + } + + instance->impl.updateControls(instance); + instance->impl.setStatus(Impl::STATUS_WORKING); +} + +// static +void LLFloaterSnapshot::postPanelSwitch() +{ + LLFloaterSnapshot* instance = getInstance(); + instance->impl.updateControls(instance); + + // Remove the success/failure indicator whenever user presses a snapshot option button. + instance->impl.setStatus(Impl::STATUS_READY); +} + +// static +LLPointer<LLImageFormatted> LLFloaterSnapshot::getImageData() +{ + // FIXME: May not work for textures. + + LLFloaterSnapshot* instance = LLFloaterReg::findTypedInstance<LLFloaterSnapshot>("snapshot"); + if (!instance) + { + llassert(instance != NULL); + return NULL; + } + + LLSnapshotLivePreview* previewp = Impl::getPreviewView(instance); + if (!previewp) + { + llassert(previewp != NULL); + return NULL; + } + + LLPointer<LLImageFormatted> img = previewp->getFormattedImage(); + if (!img.get()) + { + llwarns << "Empty snapshot image data" << llendl; + llassert(img.get() != NULL); + } + + return img; +} + +// static +const LLVector3d& LLFloaterSnapshot::getPosTakenGlobal() +{ + LLFloaterSnapshot* instance = LLFloaterReg::findTypedInstance<LLFloaterSnapshot>("snapshot"); + if (!instance) + { + llassert(instance != NULL); + return LLVector3d::zero; + } + + LLSnapshotLivePreview* previewp = Impl::getPreviewView(instance); + if (!previewp) + { + llassert(previewp != NULL); + return LLVector3d::zero; + } + + return previewp->getPosTakenGlobal(); +} + +// static +void LLFloaterSnapshot::setAgentEmail(const std::string& email) +{ + LLFloaterSnapshot* instance = LLFloaterReg::findTypedInstance<LLFloaterSnapshot>("snapshot"); + if (instance) + { + LLSideTrayPanelContainer* panel_container = instance->getChild<LLSideTrayPanelContainer>("panel_container"); + LLPanel* postcard_panel = panel_container->getPanelByName("panel_snapshot_postcard"); + postcard_panel->notify(LLSD().with("agent-email", email)); + } +} ///---------------------------------------------------------------------------- /// Class LLSnapshotFloaterView diff --git a/indra/newview/llfloatersnapshot.h b/indra/newview/llfloatersnapshot.h index c92d9efde5..afe135fa40 100644 --- a/indra/newview/llfloatersnapshot.h +++ b/indra/newview/llfloatersnapshot.h @@ -27,11 +27,15 @@ #ifndef LL_LLFLOATERSNAPSHOT_H #define LL_LLFLOATERSNAPSHOT_H +#include "llimage.h" #include "llfloater.h" +class LLSpinCtrl; class LLFloaterSnapshot : public LLFloater { + LOG_CLASS(LLFloaterSnapshot); + public: typedef enum e_snapshot_format { @@ -47,20 +51,31 @@ public: /*virtual*/ void draw(); /*virtual*/ void onOpen(const LLSD& key); /*virtual*/ void onClose(bool app_quitting); + /*virtual*/ S32 notify(const LLSD& info); static void update(); - - static S32 getUIWinHeightLong() {return sUIWinHeightLong ;} - static S32 getUIWinHeightShort() {return sUIWinHeightShort ;} - static S32 getUIWinWidth() {return sUIWinWidth ;} + + // TODO: create a snapshot model instead + static LLFloaterSnapshot* getInstance(); + static void saveTexture(); + static BOOL saveLocal(); + static void preUpdate(); + static void postUpdate(); + static void postSave(); + static void postPanelSwitch(); + static LLPointer<LLImageFormatted> getImageData(); + static const LLVector3d& getPosTakenGlobal(); + static void setAgentEmail(const std::string& email); + + static const LLRect& getThumbnailPlaceholderRect() { return sThumbnailPlaceholder->getRect(); } private: + static LLUICtrl* sThumbnailPlaceholder; + LLUICtrl *mRefreshBtn, *mRefreshLabel; + LLUICtrl *mSucceessLblPanel, *mFailureLblPanel; + class Impl; Impl& impl; - - static S32 sUIWinHeightLong ; - static S32 sUIWinHeightShort ; - static S32 sUIWinWidth ; }; class LLSnapshotFloaterView : public LLFloaterView diff --git a/indra/newview/llfloatertoybox.cpp b/indra/newview/llfloatertoybox.cpp index 66f644748e..324afe661f 100644 --- a/indra/newview/llfloatertoybox.cpp +++ b/indra/newview/llfloatertoybox.cpp @@ -42,6 +42,7 @@ LLFloaterToybox::LLFloaterToybox(const LLSD& key) , mToolBar(NULL) { mCommitCallbackRegistrar.add("Toybox.RestoreDefaults", boost::bind(&LLFloaterToybox::onBtnRestoreDefaults, this)); + mCommitCallbackRegistrar.add("Toybox.ClearAll", boost::bind(&LLFloaterToybox::onBtnClearAll, this)); } LLFloaterToybox::~LLFloaterToybox() @@ -63,6 +64,7 @@ BOOL LLFloaterToybox::postBuild() mToolBar->setStartDragCallback(boost::bind(LLToolBarView::startDragTool,_1,_2,_3)); mToolBar->setHandleDragCallback(boost::bind(LLToolBarView::handleDragTool,_1,_2,_3,_4)); mToolBar->setHandleDropCallback(boost::bind(LLToolBarView::handleDropTool,_1,_2,_3,_4)); + mToolBar->setButtonEnterCallback(boost::bind(&LLFloaterToybox::onToolBarButtonEnter,this,_1)); // // Sort commands by localized labels so they will appear alphabetized in all languages @@ -105,8 +107,8 @@ void LLFloaterToybox::draw() { const LLCommandId& id = *it; - const bool commandOnToolbar = gToolBarView->hasCommand(id); - mToolBar->enableCommand(id, !commandOnToolbar); + const bool command_not_present = (gToolBarView->hasCommand(id) == LLToolBarView::TOOLBAR_NONE); + mToolBar->enableCommand(id, command_not_present); } LLFloater::draw(); @@ -120,15 +122,35 @@ static bool finish_restore_toybox(const LLSD& notification, const LLSD& response { LLToolBarView::loadDefaultToolbars(); } + + return false; +} + +static bool finish_clear_all_toybox(const LLSD& notification, const LLSD& response) +{ + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); + + if (option == 0) + { + LLToolBarView::clearAllToolbars(); + } + return false; } + static LLNotificationFunctorRegistration finish_restore_toybox_reg("ConfirmRestoreToybox", finish_restore_toybox); +static LLNotificationFunctorRegistration finish_clear_all_toybox_reg("ConfirmClearAllToybox", finish_clear_all_toybox); void LLFloaterToybox::onBtnRestoreDefaults() { LLNotificationsUtil::add("ConfirmRestoreToybox"); } +void LLFloaterToybox::onBtnClearAll() +{ + LLNotificationsUtil::add("ConfirmClearAllToybox"); +} + BOOL LLFloaterToybox::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType cargo_type, void* cargo_data, @@ -140,5 +162,30 @@ BOOL LLFloaterToybox::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, return mToolBar->handleDragAndDrop(local_x, local_y, mask, drop, cargo_type, cargo_data, accept, tooltip_msg); } +void LLFloaterToybox::onToolBarButtonEnter(LLView* button) +{ + std::string suffix = ""; + + LLCommandId commandId(button->getName()); + LLCommand* command = LLCommandManager::instance().getCommand(commandId); + + if (command) + { + S32 command_loc = gToolBarView->hasCommand(commandId); + + switch(command_loc) + { + case LLToolBarView::TOOLBAR_BOTTOM: suffix = LLTrans::getString("Toolbar_Bottom_Tooltip"); break; + case LLToolBarView::TOOLBAR_LEFT: suffix = LLTrans::getString("Toolbar_Left_Tooltip"); break; + case LLToolBarView::TOOLBAR_RIGHT: suffix = LLTrans::getString("Toolbar_Right_Tooltip"); break; + + default: + break; + } + } + + mToolBar->setTooltipButtonSuffix(suffix); +} + // eof diff --git a/indra/newview/llfloatertoybox.h b/indra/newview/llfloatertoybox.h index 62bf68680d..10aee0e6f5 100644 --- a/indra/newview/llfloatertoybox.h +++ b/indra/newview/llfloatertoybox.h @@ -50,8 +50,11 @@ public: std::string& tooltip_msg); protected: + void onBtnClearAll(); void onBtnRestoreDefaults(); + void onToolBarButtonEnter(LLView* button); + public: LLToolBar * mToolBar; }; diff --git a/indra/newview/llfloatertranslationsettings.cpp b/indra/newview/llfloatertranslationsettings.cpp new file mode 100644 index 0000000000..959edff713 --- /dev/null +++ b/indra/newview/llfloatertranslationsettings.cpp @@ -0,0 +1,296 @@ +/** + * @file llfloatertranslationsettings.cpp + * @brief Machine translation settings for chat + * + * $LicenseInfo:firstyear=2011&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2011, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" + +#include "llfloatertranslationsettings.h" + +// Viewer includes +#include "lltranslate.h" +#include "llviewercontrol.h" // for gSavedSettings + +// Linden library includes +#include "llbutton.h" +#include "llcheckboxctrl.h" +#include "llcombobox.h" +#include "llfloaterreg.h" +#include "lllineeditor.h" +#include "llnotificationsutil.h" +#include "llradiogroup.h" + +class EnteredKeyVerifier : public LLTranslate::KeyVerificationReceiver +{ +public: + EnteredKeyVerifier(LLTranslate::EService service, bool alert) + : LLTranslate::KeyVerificationReceiver(service) + , mAlert(alert) + { + } + +private: + /*virtual*/ void setVerificationStatus(bool ok) + { + LLFloaterTranslationSettings* floater = + LLFloaterReg::getTypedInstance<LLFloaterTranslationSettings>("prefs_translation"); + + if (!floater) + { + llwarns << "Cannot find translation settings floater" << llendl; + return; + } + + switch (getService()) + { + case LLTranslate::SERVICE_BING: + floater->setBingVerified(ok, mAlert); + break; + case LLTranslate::SERVICE_GOOGLE: + floater->setGoogleVerified(ok, mAlert); + break; + } + } + + bool mAlert; +}; + +LLFloaterTranslationSettings::LLFloaterTranslationSettings(const LLSD& key) +: LLFloater(key) +, mMachineTranslationCB(NULL) +, mLanguageCombo(NULL) +, mTranslationServiceRadioGroup(NULL) +, mBingAPIKeyEditor(NULL) +, mGoogleAPIKeyEditor(NULL) +, mBingVerifyBtn(NULL) +, mGoogleVerifyBtn(NULL) +, mOKBtn(NULL) +, mBingKeyVerified(false) +, mGoogleKeyVerified(false) +{ +} + +// virtual +BOOL LLFloaterTranslationSettings::postBuild() +{ + mMachineTranslationCB = getChild<LLCheckBoxCtrl>("translate_chat_checkbox"); + mLanguageCombo = getChild<LLComboBox>("translate_language_combo"); + mTranslationServiceRadioGroup = getChild<LLRadioGroup>("translation_service_rg"); + mBingAPIKeyEditor = getChild<LLLineEditor>("bing_api_key"); + mGoogleAPIKeyEditor = getChild<LLLineEditor>("google_api_key"); + mBingVerifyBtn = getChild<LLButton>("verify_bing_api_key_btn"); + mGoogleVerifyBtn = getChild<LLButton>("verify_google_api_key_btn"); + mOKBtn = getChild<LLButton>("ok_btn"); + + mMachineTranslationCB->setCommitCallback(boost::bind(&LLFloaterTranslationSettings::updateControlsEnabledState, this)); + mTranslationServiceRadioGroup->setCommitCallback(boost::bind(&LLFloaterTranslationSettings::updateControlsEnabledState, this)); + mOKBtn->setClickedCallback(boost::bind(&LLFloaterTranslationSettings::onBtnOK, this)); + getChild<LLButton>("cancel_btn")->setClickedCallback(boost::bind(&LLFloater::closeFloater, this, false)); + mBingVerifyBtn->setClickedCallback(boost::bind(&LLFloaterTranslationSettings::onBtnBingVerify, this)); + mGoogleVerifyBtn->setClickedCallback(boost::bind(&LLFloaterTranslationSettings::onBtnGoogleVerify, this)); + + mBingAPIKeyEditor->setFocusReceivedCallback(boost::bind(&LLFloaterTranslationSettings::onEditorFocused, this, _1)); + mBingAPIKeyEditor->setKeystrokeCallback(boost::bind(&LLFloaterTranslationSettings::onBingKeyEdited, this), NULL); + mGoogleAPIKeyEditor->setFocusReceivedCallback(boost::bind(&LLFloaterTranslationSettings::onEditorFocused, this, _1)); + mGoogleAPIKeyEditor->setKeystrokeCallback(boost::bind(&LLFloaterTranslationSettings::onGoogleKeyEdited, this), NULL); + + center(); + return TRUE; +} + +// virtual +void LLFloaterTranslationSettings::onOpen(const LLSD& key) +{ + mMachineTranslationCB->setValue(gSavedSettings.getBOOL("TranslateChat")); + mLanguageCombo->setSelectedByValue(gSavedSettings.getString("TranslateLanguage"), TRUE); + mTranslationServiceRadioGroup->setSelectedByValue(gSavedSettings.getString("TranslationService"), TRUE); + + std::string bing_key = gSavedSettings.getString("BingTranslateAPIKey"); + if (!bing_key.empty()) + { + mBingAPIKeyEditor->setText(bing_key); + mBingAPIKeyEditor->setTentative(FALSE); + verifyKey(LLTranslate::SERVICE_BING, bing_key, false); + } + else + { + mBingAPIKeyEditor->setTentative(TRUE); + mBingKeyVerified = FALSE; + } + + std::string google_key = gSavedSettings.getString("GoogleTranslateAPIKey"); + if (!google_key.empty()) + { + mGoogleAPIKeyEditor->setText(google_key); + mGoogleAPIKeyEditor->setTentative(FALSE); + verifyKey(LLTranslate::SERVICE_GOOGLE, google_key, false); + } + else + { + mGoogleAPIKeyEditor->setTentative(TRUE); + mGoogleKeyVerified = FALSE; + } + + updateControlsEnabledState(); +} + +void LLFloaterTranslationSettings::setBingVerified(bool ok, bool alert) +{ + if (alert) + { + showAlert(ok ? "bing_api_key_verified" : "bing_api_key_not_verified"); + } + + mBingKeyVerified = ok; + updateControlsEnabledState(); +} + +void LLFloaterTranslationSettings::setGoogleVerified(bool ok, bool alert) +{ + if (alert) + { + showAlert(ok ? "google_api_key_verified" : "google_api_key_not_verified"); + } + + mGoogleKeyVerified = ok; + updateControlsEnabledState(); +} + +std::string LLFloaterTranslationSettings::getSelectedService() const +{ + return mTranslationServiceRadioGroup->getSelectedValue().asString(); +} + +std::string LLFloaterTranslationSettings::getEnteredBingKey() const +{ + return mBingAPIKeyEditor->getTentative() ? LLStringUtil::null : mBingAPIKeyEditor->getText(); +} + +std::string LLFloaterTranslationSettings::getEnteredGoogleKey() const +{ + return mGoogleAPIKeyEditor->getTentative() ? LLStringUtil::null : mGoogleAPIKeyEditor->getText(); +} + +void LLFloaterTranslationSettings::showAlert(const std::string& msg_name) const +{ + LLSD args; + args["MESSAGE"] = getString(msg_name); + LLNotificationsUtil::add("GenericAlert", args); +} + +void LLFloaterTranslationSettings::updateControlsEnabledState() +{ + // Enable/disable controls based on the checkbox value. + bool on = mMachineTranslationCB->getValue().asBoolean(); + std::string service = getSelectedService(); + bool bing_selected = service == "bing"; + bool google_selected = service == "google"; + + mTranslationServiceRadioGroup->setEnabled(on); + mLanguageCombo->setEnabled(on); + + getChild<LLTextBox>("bing_api_key_label")->setEnabled(on); + mBingAPIKeyEditor->setEnabled(on); + + getChild<LLTextBox>("google_api_key_label")->setEnabled(on); + mGoogleAPIKeyEditor->setEnabled(on); + + mBingAPIKeyEditor->setEnabled(on && bing_selected); + mGoogleAPIKeyEditor->setEnabled(on && google_selected); + + mBingVerifyBtn->setEnabled(on && bing_selected && + !mBingKeyVerified && !getEnteredBingKey().empty()); + mGoogleVerifyBtn->setEnabled(on && google_selected && + !mGoogleKeyVerified && !getEnteredGoogleKey().empty()); + + mOKBtn->setEnabled( + !on || ( + (bing_selected && mBingKeyVerified) || + (google_selected && mGoogleKeyVerified) + )); +} + +void LLFloaterTranslationSettings::verifyKey(int service, const std::string& key, bool alert) +{ + LLTranslate::KeyVerificationReceiverPtr receiver = + new EnteredKeyVerifier((LLTranslate::EService) service, alert); + LLTranslate::verifyKey(receiver, key); +} + +void LLFloaterTranslationSettings::onEditorFocused(LLFocusableElement* control) +{ + LLLineEditor* editor = dynamic_cast<LLLineEditor*>(control); + if (editor && editor->hasTabStop()) // if enabled. getEnabled() doesn't work + { + if (editor->getTentative()) + { + editor->setText(LLStringUtil::null); + editor->setTentative(FALSE); + } + } +} + +void LLFloaterTranslationSettings::onBingKeyEdited() +{ + if (mBingAPIKeyEditor->isDirty()) + { + setBingVerified(false, false); + } +} + +void LLFloaterTranslationSettings::onGoogleKeyEdited() +{ + if (mGoogleAPIKeyEditor->isDirty()) + { + setGoogleVerified(false, false); + } +} + +void LLFloaterTranslationSettings::onBtnBingVerify() +{ + std::string key = getEnteredBingKey(); + if (!key.empty()) + { + verifyKey(LLTranslate::SERVICE_BING, key); + } +} + +void LLFloaterTranslationSettings::onBtnGoogleVerify() +{ + std::string key = getEnteredGoogleKey(); + if (!key.empty()) + { + verifyKey(LLTranslate::SERVICE_GOOGLE, key); + } +} + +void LLFloaterTranslationSettings::onBtnOK() +{ + gSavedSettings.setBOOL("TranslateChat", mMachineTranslationCB->getValue().asBoolean()); + gSavedSettings.setString("TranslateLanguage", mLanguageCombo->getSelectedValue().asString()); + gSavedSettings.setString("TranslationService", getSelectedService()); + gSavedSettings.setString("BingTranslateAPIKey", getEnteredBingKey()); + gSavedSettings.setString("GoogleTranslateAPIKey", getEnteredGoogleKey()); + closeFloater(false); +} diff --git a/indra/newview/llfloatertranslationsettings.h b/indra/newview/llfloatertranslationsettings.h new file mode 100644 index 0000000000..9b47ad72ed --- /dev/null +++ b/indra/newview/llfloatertranslationsettings.h @@ -0,0 +1,76 @@ +/** + * @file llfloatertranslationsettings.h + * @brief Machine translation settings for chat + * + * $LicenseInfo:firstyear=2011&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2011, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#ifndef LL_LLFLOATERTRANSLATIONSETTINGS_H +#define LL_LLFLOATERTRANSLATIONSETTINGS_H + +#include "llfloater.h" + +class LLButton; +class LLCheckBoxCtrl; +class LLComboBox; +class LLLineEditor; +class LLRadioGroup; + +class LLFloaterTranslationSettings : public LLFloater +{ +public: + LLFloaterTranslationSettings(const LLSD& key); + /*virtual*/ BOOL postBuild(); + /*virtual*/ void onOpen(const LLSD& key); + + void setBingVerified(bool ok, bool alert); + void setGoogleVerified(bool ok, bool alert); + +private: + std::string getSelectedService() const; + std::string getEnteredBingKey() const; + std::string getEnteredGoogleKey() const; + void showAlert(const std::string& msg_name) const; + void updateControlsEnabledState(); + void verifyKey(int service, const std::string& key, bool alert = true); + + void onEditorFocused(LLFocusableElement* control); + void onBingKeyEdited(); + void onGoogleKeyEdited(); + void onBtnBingVerify(); + void onBtnGoogleVerify(); + void onBtnOK(); + + LLCheckBoxCtrl* mMachineTranslationCB; + LLComboBox* mLanguageCombo; + LLLineEditor* mBingAPIKeyEditor; + LLLineEditor* mGoogleAPIKeyEditor; + LLRadioGroup* mTranslationServiceRadioGroup; + LLButton* mBingVerifyBtn; + LLButton* mGoogleVerifyBtn; + LLButton* mOKBtn; + + bool mBingKeyVerified; + bool mGoogleKeyVerified; +}; + +#endif // LL_LLFLOATERTRANSLATIONSETTINGS_H diff --git a/indra/newview/llfloaterwebcontent.cpp b/indra/newview/llfloaterwebcontent.cpp index f410c31f44..3b5c3663fb 100644 --- a/indra/newview/llfloaterwebcontent.cpp +++ b/indra/newview/llfloaterwebcontent.cpp @@ -55,6 +55,15 @@ LLFloaterWebContent::_Params::_Params() LLFloaterWebContent::LLFloaterWebContent( const Params& params ) : LLFloater( params ), LLInstanceTracker<LLFloaterWebContent, std::string>(params.id()), + mWebBrowser(NULL), + mAddressCombo(NULL), + mSecureLockIcon(NULL), + mStatusBarText(NULL), + mStatusBarProgress(NULL), + mBtnBack(NULL), + mBtnForward(NULL), + mBtnReload(NULL), + mBtnStop(NULL), mUUID(params.id()), mShowPageTitle(params.show_page_title) { @@ -74,11 +83,16 @@ BOOL LLFloaterWebContent::postBuild() mStatusBarText = getChild< LLTextBox >( "statusbartext" ); mStatusBarProgress = getChild<LLProgressBar>("statusbarprogress" ); + mBtnBack = getChildView( "back" ); + mBtnForward = getChildView( "forward" ); + mBtnReload = getChildView( "reload" ); + mBtnStop = getChildView( "stop" ); + // observe browser events mWebBrowser->addObserver( this ); // these buttons are always enabled - getChildView("reload")->setEnabled( true ); + mBtnReload->setEnabled( true ); getChildView("popexternal")->setEnabled( true ); // cache image for secure browsing @@ -128,46 +142,14 @@ bool LLFloaterWebContent::matchesKey(const LLSD& key) //static LLFloater* LLFloaterWebContent::create( Params p) { - lldebugs << "url = " << p.url() << ", target = " << p.target() << ", uuid = " << p.id() << llendl; - - if (!p.id.isProvided()) - { - p.id = LLUUID::generateNewID().asString(); - } - - if(p.target().empty() || p.target() == "_blank") - { - p.target = p.id(); - } - - S32 browser_window_limit = gSavedSettings.getS32("WebContentWindowLimit"); - if(browser_window_limit != 0) - { - // showInstance will open a new window. Figure out how many web browsers are already open, - // and close the least recently opened one if this will put us over the limit. - - LLFloaterReg::const_instance_list_t &instances = LLFloaterReg::getFloaterList(p.window_class); - lldebugs << "total instance count is " << instances.size() << llendl; - - for(LLFloaterReg::const_instance_list_t::const_iterator iter = instances.begin(); iter != instances.end(); iter++) - { - lldebugs << " " << (*iter)->getKey()["target"] << llendl; - } - - if(instances.size() >= (size_t)browser_window_limit) - { - // Destroy the least recently opened instance - (*instances.begin())->closeFloater(); - } - } - + preCreate(p); return new LLFloaterWebContent(p); } //static void LLFloaterWebContent::closeRequest(const std::string &uuid) { - LLFloaterWebContent* floaterp = getInstance(uuid); + LLFloaterWebContent* floaterp = instance_tracker_t::getInstance(uuid); if (floaterp) { floaterp->closeFloater(false); @@ -177,7 +159,7 @@ void LLFloaterWebContent::closeRequest(const std::string &uuid) //static void LLFloaterWebContent::geometryChanged(const std::string &uuid, S32 x, S32 y, S32 width, S32 height) { - LLFloaterWebContent* floaterp = getInstance(uuid); + LLFloaterWebContent* floaterp = instance_tracker_t::getInstance(uuid); if (floaterp) { floaterp->geometryChanged(x, y, width, height); @@ -211,6 +193,43 @@ void LLFloaterWebContent::geometryChanged(S32 x, S32 y, S32 width, S32 height) setShape(new_rect); } +// static +void LLFloaterWebContent::preCreate(LLFloaterWebContent::Params& p) +{ + lldebugs << "url = " << p.url() << ", target = " << p.target() << ", uuid = " << p.id() << llendl; + + if (!p.id.isProvided()) + { + p.id = LLUUID::generateNewID().asString(); + } + + if(p.target().empty() || p.target() == "_blank") + { + p.target = p.id(); + } + + S32 browser_window_limit = gSavedSettings.getS32("WebContentWindowLimit"); + if(browser_window_limit != 0) + { + // showInstance will open a new window. Figure out how many web browsers are already open, + // and close the least recently opened one if this will put us over the limit. + + LLFloaterReg::const_instance_list_t &instances = LLFloaterReg::getFloaterList(p.window_class); + lldebugs << "total instance count is " << instances.size() << llendl; + + for(LLFloaterReg::const_instance_list_t::const_iterator iter = instances.begin(); iter != instances.end(); iter++) + { + lldebugs << " " << (*iter)->getKey()["target"] << llendl; + } + + if(instances.size() >= (size_t)browser_window_limit) + { + // Destroy the least recently opened instance + (*instances.begin())->closeFloater(); + } + } +} + void LLFloaterWebContent::open_media(const Params& p) { // Specifying a mime type of text/html here causes the plugin system to skip the MIME type probe and just open a browser plugin. @@ -276,8 +295,8 @@ void LLFloaterWebContent::onClose(bool app_quitting) void LLFloaterWebContent::draw() { // this is asynchronous so we need to keep checking - getChildView( "back" )->setEnabled( mWebBrowser->canNavigateBack() ); - getChildView( "forward" )->setEnabled( mWebBrowser->canNavigateForward() ); + mBtnBack->setEnabled( mWebBrowser->canNavigateBack() ); + mBtnForward->setEnabled( mWebBrowser->canNavigateForward() ); LLFloater::draw(); } @@ -297,12 +316,12 @@ void LLFloaterWebContent::handleMediaEvent(LLPluginClassMedia* self, EMediaEvent else if(event == MEDIA_EVENT_NAVIGATE_BEGIN) { // flags are sent with this event - getChildView("back")->setEnabled( self->getHistoryBackAvailable() ); - getChildView("forward")->setEnabled( self->getHistoryForwardAvailable() ); + mBtnBack->setEnabled( self->getHistoryBackAvailable() ); + mBtnForward->setEnabled( self->getHistoryForwardAvailable() ); // toggle visibility of these buttons based on browser state - getChildView("reload")->setVisible( false ); - getChildView("stop")->setVisible( true ); + mBtnReload->setVisible( false ); + mBtnStop->setVisible( true ); // turn "on" progress bar now we're about to start loading mStatusBarProgress->setVisible( true ); @@ -310,12 +329,12 @@ void LLFloaterWebContent::handleMediaEvent(LLPluginClassMedia* self, EMediaEvent else if(event == MEDIA_EVENT_NAVIGATE_COMPLETE) { // flags are sent with this event - getChildView("back")->setEnabled( self->getHistoryBackAvailable() ); - getChildView("forward")->setEnabled( self->getHistoryForwardAvailable() ); + mBtnBack->setEnabled( self->getHistoryBackAvailable() ); + mBtnForward->setEnabled( self->getHistoryForwardAvailable() ); // toggle visibility of these buttons based on browser state - getChildView("reload")->setVisible( true ); - getChildView("stop")->setVisible( false ); + mBtnReload->setVisible( true ); + mBtnStop->setVisible( false ); // turn "off" progress bar now we're loaded mStatusBarProgress->setVisible( false ); @@ -421,8 +440,8 @@ void LLFloaterWebContent::onClickStop() // still should happen when we catch the navigate complete event // but sometimes (don't know why) that event isn't sent from Qt // and we ghetto a point where the stop button stays active. - getChildView("reload")->setVisible( true ); - getChildView("stop")->setVisible( false ); + mBtnReload->setVisible( true ); + mBtnStop->setVisible( false ); } void LLFloaterWebContent::onEnterAddress() diff --git a/indra/newview/llfloaterwebcontent.h b/indra/newview/llfloaterwebcontent.h index 6fc66d1ad8..cfc87e9015 100644 --- a/indra/newview/llfloaterwebcontent.h +++ b/indra/newview/llfloaterwebcontent.h @@ -43,6 +43,7 @@ class LLFloaterWebContent : public LLInstanceTracker<LLFloaterWebContent, std::string> { public: + typedef LLInstanceTracker<LLFloaterWebContent, std::string> instance_tracker_t; LOG_CLASS(LLFloaterWebContent); struct _Params : public LLInitParam::Block<_Params> @@ -89,6 +90,7 @@ protected: void onEnterAddress(); void onPopExternal(); + static void preCreate(Params& p); void open_media(const Params& ); void set_current_url(const std::string& url); @@ -97,6 +99,12 @@ protected: LLIconCtrl* mSecureLockIcon; LLTextBox* mStatusBarText; LLProgressBar* mStatusBarProgress; + + LLView* mBtnBack; + LLView* mBtnForward; + LLView* mBtnReload; + LLView* mBtnStop; + std::string mCurrentURL; std::string mUUID; bool mShowPageTitle; diff --git a/indra/newview/llfloaterwebprofile.cpp b/indra/newview/llfloaterwebprofile.cpp new file mode 100644 index 0000000000..c41f6f148f --- /dev/null +++ b/indra/newview/llfloaterwebprofile.cpp @@ -0,0 +1,79 @@ +/** + * @file llfloaterwebprofile.cpp + * @brief Avatar profile floater. + * + * $LicenseInfo:firstyear=2009&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2010, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" + +#include "llfloaterwebprofile.h" + +#include "llviewercontrol.h" + +LLFloaterWebProfile::LLFloaterWebProfile(const Params& key) : + LLFloaterWebContent(key) +{ +} + +void LLFloaterWebProfile::onOpen(const LLSD& key) +{ + Params p(key); + p.show_chrome(false). + window_class("profile"); + LLFloaterWebContent::onOpen(p); + applyPreferredRect(); +} + +// virtual +void LLFloaterWebProfile::handleReshape(const LLRect& new_rect, bool by_user) +{ + lldebugs << "handleReshape: " << new_rect << llendl; + + if (by_user && !isMinimized()) + { + lldebugs << "Storing new rect" << llendl; + gSavedSettings.setRect("WebProfileFloaterRect", new_rect); + } + + LLFloaterWebContent::handleReshape(new_rect, by_user); +} + +LLFloater* LLFloaterWebProfile::create(const LLSD& key) +{ + LLFloaterWebContent::Params p(key); + preCreate(p); + return new LLFloaterWebProfile(p); +} + +void LLFloaterWebProfile::applyPreferredRect() +{ + const LLRect preferred_rect = gSavedSettings.getRect("WebProfileFloaterRect"); + lldebugs << "Applying preferred rect: " << preferred_rect << llendl; + + // Don't override position that may have been set by floater stacking code. + LLRect new_rect = getRect(); + new_rect.setLeftTopAndSize( + new_rect.mLeft, new_rect.mTop, + preferred_rect.getWidth(), preferred_rect.getHeight()); + setShape(new_rect); +} diff --git a/indra/newview/llmenucommands.h b/indra/newview/llfloaterwebprofile.h index fa845c6f02..4c355e401b 100644 --- a/indra/newview/llmenucommands.h +++ b/indra/newview/llfloaterwebprofile.h @@ -1,8 +1,8 @@ /** - * @file llmenucommands.h - * @brief Implementations of menu commands. + * @file llfloaterwebprofile.h + * @brief Avatar profile floater. * - * $LicenseInfo:firstyear=2003&license=viewerlgpl$ + * $LicenseInfo:firstyear=2009&license=viewerlgpl$ * Second Life Viewer Source Code * Copyright (C) 2010, Linden Research, Inc. * @@ -24,14 +24,36 @@ * $/LicenseInfo$ */ -#ifndef LL_LLMENUCOMMANDS_H -#define LL_LLMENUCOMMANDS_H +#ifndef LL_LLFLOATERWEBPROFILE_H +#define LL_LLFLOATERWEBPROFILE_H -class LLUUID; +#include "llfloaterwebcontent.h" +#include "llviewermediaobserver.h" -void handle_mouselook(void*); -void handle_chat(void*); -void handle_return_key(void*); -void handle_slash_key(void*); +#include <string> + +class LLMediaCtrl; + +/** + * Displays avatar profile web page. + */ +class LLFloaterWebProfile +: public LLFloaterWebContent +{ + LOG_CLASS(LLFloaterWebProfile); +public: + typedef LLFloaterWebContent::Params Params; + + LLFloaterWebProfile(const Params& key); + + /*virtual*/ void onOpen(const LLSD& key); + /*virtual*/ void handleReshape(const LLRect& new_rect, bool by_user = false); + + static LLFloater* create(const LLSD& key); + +private: + void applyPreferredRect(); +}; + +#endif // LL_LLFLOATERWEBPROFILE_H -#endif diff --git a/indra/newview/llfloaterwindowsize.cpp b/indra/newview/llfloaterwindowsize.cpp index a70f2af11a..ec161018b8 100644 --- a/indra/newview/llfloaterwindowsize.cpp +++ b/indra/newview/llfloaterwindowsize.cpp @@ -58,33 +58,12 @@ bool extractWindowSizeFromString(const std::string& instr, U32 *width, U32 *heig } -///---------------------------------------------------------------------------- -/// Class LLFloaterWindowSize -///---------------------------------------------------------------------------- -class LLFloaterWindowSize -: public LLFloater -{ - friend class LLFloaterReg; -private: - LLFloaterWindowSize(const LLSD& key); - virtual ~LLFloaterWindowSize(); - -public: - /*virtual*/ BOOL postBuild(); - void initWindowSizeControls(); - void onClickSet(); - void onClickCancel(); -}; - - LLFloaterWindowSize::LLFloaterWindowSize(const LLSD& key) : LLFloater(key) -{ -} +{} LLFloaterWindowSize::~LLFloaterWindowSize() -{ -} +{} BOOL LLFloaterWindowSize::postBuild() { @@ -145,13 +124,3 @@ void LLFloaterWindowSize::onClickCancel() { closeFloater(); } - -///---------------------------------------------------------------------------- -/// LLFloaterWindowSizeUtil -///---------------------------------------------------------------------------- -void LLFloaterWindowSizeUtil::registerFloater() -{ - LLFloaterReg::add("window_size", "floater_window_size.xml", - &LLFloaterReg::build<LLFloaterWindowSize>); - -} diff --git a/indra/newview/llfloaterwindowsize.h b/indra/newview/llfloaterwindowsize.h index 40f1a25bb3..a71e5e273c 100644 --- a/indra/newview/llfloaterwindowsize.h +++ b/indra/newview/llfloaterwindowsize.h @@ -26,10 +26,24 @@ #ifndef LLFLOATERWINDOWSIZE_H #define LLFLOATERWINDOWSIZE_H -// Allow user to set the window size for filming tutorials, machinima, etc -namespace LLFloaterWindowSizeUtil +#include "llfloater.h" + +///---------------------------------------------------------------------------- +/// Class LLFloaterWindowSize +///---------------------------------------------------------------------------- +class LLFloaterWindowSize + : public LLFloater { - void registerFloater(); -} + friend class LLFloaterReg; +private: + LLFloaterWindowSize(const LLSD& key); + virtual ~LLFloaterWindowSize(); + +public: + /*virtual*/ BOOL postBuild(); + void initWindowSizeControls(); + void onClickSet(); + void onClickCancel(); +}; #endif diff --git a/indra/newview/llfolderviewitem.cpp b/indra/newview/llfolderviewitem.cpp index 622dcfe8dd..f27fd035db 100644 --- a/indra/newview/llfolderviewitem.cpp +++ b/indra/newview/llfolderviewitem.cpp @@ -658,7 +658,7 @@ LLViewerInventoryItem * LLFolderViewItem::getInventoryItem(void) return gInventory.getItem(getListener()->getUUID()); } -std::string LLFolderViewItem::getName( void ) const +const std::string& LLFolderViewItem::getName( void ) const { if(mListener) { @@ -1173,8 +1173,8 @@ BOOL LLFolderViewFolder::addToFolder(LLFolderViewFolder* folder, LLFolderView* r return folder->addFolder(this); } -// Finds width and height of this object and it's children. Also -// makes sure that this view and it's children are the right size. +// Finds width and height of this object and its children. Also +// makes sure that this view and its children are the right size. S32 LLFolderViewFolder::arrange( S32* width, S32* height, S32 filter_generation) { // sort before laying out contents diff --git a/indra/newview/llfolderviewitem.h b/indra/newview/llfolderviewitem.h index 676eaf825d..3433e3f7f3 100644 --- a/indra/newview/llfolderviewitem.h +++ b/indra/newview/llfolderviewitem.h @@ -267,7 +267,7 @@ public: // This method returns the actual name of the thing being // viewed. This method will ask the viewed object itself. - std::string getName( void ) const; + const std::string& getName( void ) const; const std::string& getSearchableLabel( void ) const; @@ -556,6 +556,10 @@ public: folders_t::const_iterator getFoldersBegin() const { return mFolders.begin(); } folders_t::const_iterator getFoldersEnd() const { return mFolders.end(); } folders_t::size_type getFoldersCount() const { return mFolders.size(); } + + items_t::const_iterator getItemsBegin() const { return mItems.begin(); } + items_t::const_iterator getItemsEnd() const { return mItems.end(); } + items_t::size_type getItemsCount() const { return mItems.size(); } }; //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/indra/newview/llglsandbox.cpp b/indra/newview/llglsandbox.cpp index fa3f546157..1208c9378e 100644 --- a/indra/newview/llglsandbox.cpp +++ b/indra/newview/llglsandbox.cpp @@ -115,7 +115,7 @@ void LLToolSelectRect::handleRectangleSelection(S32 x, S32 y, MASK mask) S32 center_y = (top + bottom) / 2; // save drawing mode - glMatrixMode(GL_PROJECTION); + gGL.matrixMode(LLRender::MM_PROJECTION); gGL.pushMatrix(); BOOL limit_select_distance = gSavedSettings.getBOOL("LimitSelectDistance"); @@ -230,9 +230,9 @@ void LLToolSelectRect::handleRectangleSelection(S32 x, S32 y, MASK mask) } // restore drawing mode - glMatrixMode(GL_PROJECTION); + gGL.matrixMode(LLRender::MM_PROJECTION); gGL.popMatrix(); - glMatrixMode(GL_MODELVIEW); + gGL.matrixMode(LLRender::MM_MODELVIEW); // restore camera LLViewerCamera::getInstance()->setFar(old_far_plane); @@ -240,7 +240,7 @@ void LLToolSelectRect::handleRectangleSelection(S32 x, S32 y, MASK mask) gViewerWindow->setup3DRender(); } -const F32 WIND_ALTITUDE = 180.f; +const F32 WIND_RELATIVE_ALTITUDE = 25.f; void LLWind::renderVectors() { @@ -254,13 +254,13 @@ void LLWind::renderVectors() gGL.pushMatrix(); LLVector3 origin_agent; origin_agent = gAgent.getPosAgentFromGlobal(mOriginGlobal); - gGL.translatef(origin_agent.mV[VX], origin_agent.mV[VY], WIND_ALTITUDE); + gGL.translatef(origin_agent.mV[VX], origin_agent.mV[VY], gAgent.getPositionAgent().mV[VZ] + WIND_RELATIVE_ALTITUDE); for (j = 0; j < mSize; j++) { for (i = 0; i < mSize; i++) { - x = mCloudVelX[i + j*mSize] * WIND_SCALE_HACK; - y = mCloudVelY[i + j*mSize] * WIND_SCALE_HACK; + x = mVelX[i + j*mSize] * WIND_SCALE_HACK; + y = mVelY[i + j*mSize] * WIND_SCALE_HACK; gGL.pushMatrix(); gGL.translatef((F32)i * region_width_meters/mSize, (F32)j * region_width_meters/mSize, 0.0); gGL.color3f(0,1,0); @@ -777,13 +777,17 @@ void LLViewerObjectList::renderObjectBeacons() LLGLSUIDefault gls_ui; + if (LLGLSLShader::sNoFixedFunction) + { + gUIProgram.bind(); + } + { gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); S32 last_line_width = -1; // gGL.begin(LLRender::LINES); // Always happens in (line_width != last_line_width) - BOOL flush = FALSE; for (std::vector<LLDebugBeacon>::iterator iter = mDebugBeacons.begin(); iter != mDebugBeacons.end(); ++iter) { const LLDebugBeacon &debug_beacon = *iter; @@ -792,18 +796,14 @@ void LLViewerObjectList::renderObjectBeacons() S32 line_width = debug_beacon.mLineWidth; if (line_width != last_line_width) { - if (flush) - { - gGL.end(); - } - flush = TRUE; gGL.flush(); glLineWidth( (F32)line_width ); last_line_width = line_width; - gGL.begin(LLRender::LINES); } const LLVector3 &thisline = debug_beacon.mPositionAgent; + + gGL.begin(LLRender::LINES); gGL.color4fv(color.mV); gGL.vertex3f(thisline.mV[VX],thisline.mV[VY],thisline.mV[VZ] - 50.f); gGL.vertex3f(thisline.mV[VX],thisline.mV[VY],thisline.mV[VZ] + 50.f); @@ -813,8 +813,9 @@ void LLViewerObjectList::renderObjectBeacons() gGL.vertex3f(thisline.mV[VX],thisline.mV[VY] + 2.f,thisline.mV[VZ]); draw_line_cube(0.10f, thisline); + + gGL.end(); } - gGL.end(); } { @@ -824,7 +825,6 @@ void LLViewerObjectList::renderObjectBeacons() S32 last_line_width = -1; // gGL.begin(LLRender::LINES); // Always happens in (line_width != last_line_width) - BOOL flush = FALSE; for (std::vector<LLDebugBeacon>::iterator iter = mDebugBeacons.begin(); iter != mDebugBeacons.end(); ++iter) { const LLDebugBeacon &debug_beacon = *iter; @@ -832,18 +832,13 @@ void LLViewerObjectList::renderObjectBeacons() S32 line_width = debug_beacon.mLineWidth; if (line_width != last_line_width) { - if (flush) - { - gGL.end(); - } - flush = TRUE; gGL.flush(); glLineWidth( (F32)line_width ); last_line_width = line_width; - gGL.begin(LLRender::LINES); } const LLVector3 &thisline = debug_beacon.mPositionAgent; + gGL.begin(LLRender::LINES); gGL.color4fv(debug_beacon.mColor.mV); gGL.vertex3f(thisline.mV[VX],thisline.mV[VY],thisline.mV[VZ] - 0.5f); gGL.vertex3f(thisline.mV[VX],thisline.mV[VY],thisline.mV[VZ] + 0.5f); @@ -853,9 +848,10 @@ void LLViewerObjectList::renderObjectBeacons() gGL.vertex3f(thisline.mV[VX],thisline.mV[VY] + 0.5f,thisline.mV[VZ]); draw_line_cube(0.10f, thisline); + + gGL.end(); } - gGL.end(); gGL.flush(); glLineWidth(1.f); diff --git a/indra/newview/llhudeffectbeam.cpp b/indra/newview/llhudeffectbeam.cpp index 37b7b2e75d..8abad3d292 100644 --- a/indra/newview/llhudeffectbeam.cpp +++ b/indra/newview/llhudeffectbeam.cpp @@ -295,13 +295,13 @@ void LLHUDEffectBeam::render() F32 alpha = mFadeInterp.getCurVal()*mColor.mV[3]; alpha *= mInterpFade[i].getCurVal(); coloru.mV[3] = (U8)alpha; - glColor4ubv(coloru.mV); + gGL.color4ubv(coloru.mV); - glPushMatrix(); - glTranslatef(pos_agent.mV[0], pos_agent.mV[1], pos_agent.mV[2]); - glScalef(scale, scale, scale); - gSphere.render(0); - glPopMatrix(); + gGL.pushMatrix(); + gGL.translatef(pos_agent.mV[0], pos_agent.mV[1], pos_agent.mV[2]); + gGL.scalef(scale, scale, scale); + gSphere.render(); + gGL.popMatrix(); } } diff --git a/indra/newview/llhudeffectlookat.cpp b/indra/newview/llhudeffectlookat.cpp index b380b3fe20..bc3b220dc0 100644 --- a/indra/newview/llhudeffectlookat.cpp +++ b/indra/newview/llhudeffectlookat.cpp @@ -498,10 +498,10 @@ void LLHUDEffectLookAt::render() gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); LLVector3 target = mTargetPos + ((LLVOAvatar*)(LLViewerObject*)mSourceObject)->mHeadp->getWorldPosition(); - glMatrixMode(GL_MODELVIEW); + gGL.matrixMode(LLRender::MM_MODELVIEW); gGL.pushMatrix(); gGL.translatef(target.mV[VX], target.mV[VY], target.mV[VZ]); - glScalef(0.3f, 0.3f, 0.3f); + gGL.scalef(0.3f, 0.3f, 0.3f); gGL.begin(LLRender::LINES); { LLColor3 color = (*mAttentions)[mTargetType].mColor; diff --git a/indra/newview/llhudeffectpointat.cpp b/indra/newview/llhudeffectpointat.cpp index 28fe8e1c01..114a633821 100644 --- a/indra/newview/llhudeffectpointat.cpp +++ b/indra/newview/llhudeffectpointat.cpp @@ -327,7 +327,7 @@ void LLHUDEffectPointAt::render() LLVector3 target = mTargetPos + mSourceObject->getRenderPosition(); gGL.pushMatrix(); gGL.translatef(target.mV[VX], target.mV[VY], target.mV[VZ]); - glScalef(0.3f, 0.3f, 0.3f); + gGL.scalef(0.3f, 0.3f, 0.3f); gGL.begin(LLRender::LINES); { gGL.color3f(1.f, 0.f, 0.f); diff --git a/indra/newview/llhudrender.cpp b/indra/newview/llhudrender.cpp index 1156e764a1..122711a86d 100644 --- a/indra/newview/llhudrender.cpp +++ b/indra/newview/llhudrender.cpp @@ -107,14 +107,24 @@ void hud_render_text(const LLWString &wstr, const LLVector3 &pos_agent, viewport[1] = world_view_rect.mBottom; viewport[2] = world_view_rect.getWidth(); viewport[3] = world_view_rect.getHeight(); + + F64 mdlv[16]; + F64 proj[16]; + + for (U32 i = 0; i < 16; i++) + { + mdlv[i] = (F64) gGLModelView[i]; + proj[i] = (F64) gGLProjection[i]; + } + gluProject(render_pos.mV[0], render_pos.mV[1], render_pos.mV[2], - gGLModelView, gGLProjection, (GLint*) viewport, + mdlv, proj, (GLint*) viewport, &winX, &winY, &winZ); //fonts all render orthographically, set up projection`` - glMatrixMode(GL_PROJECTION); - glPushMatrix(); - glMatrixMode(GL_MODELVIEW); + gGL.matrixMode(LLRender::MM_PROJECTION); + gGL.pushMatrix(); + gGL.matrixMode(LLRender::MM_MODELVIEW); gGL.pushMatrix(); LLUI::pushMatrix(); @@ -124,7 +134,7 @@ void hud_render_text(const LLWString &wstr, const LLVector3 &pos_agent, winX -= world_view_rect.mLeft; winY -= world_view_rect.mBottom; LLUI::loadIdentity(); - glLoadIdentity(); + gGL.loadIdentity(); LLUI::translate((F32) winX*1.0f/LLFontGL::sScaleX, (F32) winY*1.0f/(LLFontGL::sScaleY), -(((F32) winZ*2.f)-1.f)); F32 right_x; @@ -133,7 +143,7 @@ void hud_render_text(const LLWString &wstr, const LLVector3 &pos_agent, LLUI::popMatrix(); gGL.popMatrix(); - glMatrixMode(GL_PROJECTION); - glPopMatrix(); - glMatrixMode(GL_MODELVIEW); + gGL.matrixMode(LLRender::MM_PROJECTION); + gGL.popMatrix(); + gGL.matrixMode(LLRender::MM_MODELVIEW); } diff --git a/indra/newview/llimfloatercontainer.cpp b/indra/newview/llimfloatercontainer.cpp index 33cb3a54a7..c8e48b0d42 100644 --- a/indra/newview/llimfloatercontainer.cpp +++ b/indra/newview/llimfloatercontainer.cpp @@ -47,12 +47,13 @@ LLIMFloaterContainer::LLIMFloaterContainer(const LLSD& seed) LLIMFloaterContainer::~LLIMFloaterContainer() { + mNewMessageConnection.disconnect(); LLTransientFloaterMgr::getInstance()->removeControlView(LLTransientFloaterMgr::IM, this); } BOOL LLIMFloaterContainer::postBuild() { - LLIMModel::instance().mNewMsgSignal.connect(boost::bind(&LLIMFloaterContainer::onNewMessageReceived, this, _1)); + mNewMessageConnection = LLIMModel::instance().mNewMsgSignal.connect(boost::bind(&LLIMFloaterContainer::onNewMessageReceived, this, _1)); // Do not call base postBuild to not connect to mCloseSignal to not close all floaters via Close button // mTabContainer will be initialized in LLMultiFloater::addChild() return TRUE; diff --git a/indra/newview/llimfloatercontainer.h b/indra/newview/llimfloatercontainer.h index 53dfcd78ff..892ecef48d 100644 --- a/indra/newview/llimfloatercontainer.h +++ b/indra/newview/llimfloatercontainer.h @@ -62,7 +62,7 @@ public: private: typedef std::map<LLUUID,LLFloater*> avatarID_panel_map_t; avatarID_panel_map_t mSessions; - + boost::signals2::connection mNewMessageConnection; void onNewMessageReceived(const LLSD& data); }; diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index 6e9baed5f2..ed4bb727cd 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -1679,13 +1679,44 @@ BOOL LLCallDialog::postBuild() { if (!LLDockableFloater::postBuild() || !gToolBarView) return FALSE; + + dockToToolbarButton("speak"); + + return TRUE; +} + +void LLCallDialog::dockToToolbarButton(const std::string& toolbarButtonName) +{ + LLDockControl::DocAt dock_pos = getDockControlPos(toolbarButtonName); + LLView *anchor_panel = gToolBarView->findChildView(toolbarButtonName); - LLView *anchor_panel = gToolBarView->findChildView("speak"); - setDockControl(new LLDockControl(anchor_panel, this, getDockTongue(), LLDockControl::TOP)); + setUseTongue(anchor_panel); - return TRUE; + setDockControl(new LLDockControl(anchor_panel, this, getDockTongue(dock_pos), dock_pos)); } +LLDockControl::DocAt LLCallDialog::getDockControlPos(const std::string& toolbarButtonName) +{ + LLCommandId command_id(toolbarButtonName); + S32 toolbar_loc = gToolBarView->hasCommand(command_id); + + LLDockControl::DocAt doc_at = LLDockControl::TOP; + + switch (toolbar_loc) + { + case LLToolBarView::TOOLBAR_LEFT: + doc_at = LLDockControl::RIGHT; + break; + + case LLToolBarView::TOOLBAR_RIGHT: + doc_at = LLDockControl::LEFT; + break; + } + + return doc_at; +} + + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Class LLOutgoingCallDialog //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/indra/newview/llimview.h b/indra/newview/llimview.h index 93b604d36a..b1be26a169 100644 --- a/indra/newview/llimview.h +++ b/indra/newview/llimview.h @@ -491,14 +491,16 @@ class LLCallDialog : public LLDockableFloater { public: LLCallDialog(const LLSD& payload); - ~LLCallDialog(); + virtual ~LLCallDialog(); virtual BOOL postBuild(); + void dockToToolbarButton(const std::string& toolbarButtonName); + // check timer state /*virtual*/ void draw(); /*virtual*/ void onOpen(const LLSD& key); - + protected: // lifetime timer for a notification LLTimer mLifetimeTimer; @@ -519,6 +521,9 @@ protected: void setIcon(const LLSD& session_id, const LLSD& participant_id); LLSD mPayload; + +private: + LLDockControl::DocAt getDockControlPos(const std::string& toolbarButtonName); }; class LLIncomingCallDialog : public LLCallDialog diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 0e27bd81be..0c092e9a56 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -2027,7 +2027,7 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat, #endif } } - if (move_is_into_outbox && !move_is_from_outbox) + else if (move_is_into_outbox && !move_is_from_outbox) { dropFolderToOutbox(inv_cat); } @@ -3544,10 +3544,12 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, // because they must contain only links to wearable items. accept = !(move_is_into_current_outfit || move_is_into_outfit); - if(drop) + if(accept && drop) { - copy_inventory_from_notecard(LLToolDragAndDrop::getInstance()->getObjectID(), - LLToolDragAndDrop::getInstance()->getSourceID(), inv_item); + copy_inventory_from_notecard(mUUID, // Drop to the chosen destination folder + LLToolDragAndDrop::getInstance()->getObjectID(), + LLToolDragAndDrop::getInstance()->getSourceID(), + inv_item); } } else if(LLToolDragAndDrop::SOURCE_LIBRARY == source) diff --git a/indra/newview/llinventoryfilter.cpp b/indra/newview/llinventoryfilter.cpp index 516b47e616..d54bce4619 100644 --- a/indra/newview/llinventoryfilter.cpp +++ b/indra/newview/llinventoryfilter.cpp @@ -36,6 +36,7 @@ #include "llviewercontrol.h" #include "llfolderview.h" #include "llinventorybridge.h" +#include "llviewerfoldertype.h" // linden library includes #include "lltrans.h" @@ -117,7 +118,7 @@ bool LLInventoryFilter::checkFolder(const LLFolderViewFolder* folder) const LLFolderViewEventListener* listener = folder->getListener(); const LLUUID folder_id = listener->getUUID(); - + if (mFilterOps.mFilterTypes & FILTERTYPE_CATEGORY) { // Can only filter categories for items in your inventory @@ -206,6 +207,23 @@ BOOL LLInventoryFilter::checkAgainstFilterType(const LLFolderViewItem* item) con } } + //////////////////////////////////////////////////////////////////////////////// + // FILTERTYPE_EMPTYFOLDERS + // Pass if this item is a folder and is not a system folder that should be hidden + if (filterTypes & FILTERTYPE_EMPTYFOLDERS) + { + if (object_type == LLInventoryType::IT_CATEGORY) + { + bool is_hidden_if_empty = LLViewerFolderType::lookupIsHiddenIfEmpty(listener->getPreferredType()); + if (is_hidden_if_empty) + { + // Force the fetching of those folders so they are hidden iff they really are empty... + gInventory.fetchDescendentsOf(object_id); + return FALSE; + } + } + } + return TRUE; } @@ -343,6 +361,11 @@ void LLInventoryFilter::setFilterWearableTypes(U64 types) mFilterOps.mFilterTypes |= FILTERTYPE_WEARABLE; } +void LLInventoryFilter::setFilterEmptySystemFolders() +{ + mFilterOps.mFilterTypes |= FILTERTYPE_EMPTYFOLDERS; +} + void LLInventoryFilter::setFilterUUID(const LLUUID& object_id) { if (mFilterOps.mFilterUUID == LLUUID::null) diff --git a/indra/newview/llinventoryfilter.h b/indra/newview/llinventoryfilter.h index f9460822f7..bba24ac652 100644 --- a/indra/newview/llinventoryfilter.h +++ b/indra/newview/llinventoryfilter.h @@ -57,7 +57,8 @@ public: FILTERTYPE_CATEGORY = 0x1 << 1, // search by folder type FILTERTYPE_UUID = 0x1 << 2, // find the object with UUID and any links to it FILTERTYPE_DATE = 0x1 << 3, // search by date range - FILTERTYPE_WEARABLE = 0x1 << 4 // search by wearable type + FILTERTYPE_WEARABLE = 0x1 << 4, // search by wearable type + FILTERTYPE_EMPTYFOLDERS = 0x1 << 5 // pass if folder is not a system folder to be hidden if empty }; enum EFilterLink @@ -88,6 +89,7 @@ public: void setFilterCategoryTypes(U64 types); void setFilterUUID(const LLUUID &object_id); void setFilterWearableTypes(U64 types); + void setFilterEmptySystemFolders(); void updateFilterTypes(U64 types, U64& current_types); void setFilterSubString(const std::string& string); diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index e86c427ae2..dc25689fa3 100644 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -2528,9 +2528,9 @@ void LLInventoryModel::processBulkUpdateInventory(LLMessageSystem* msg, void**) { LLPointer<LLViewerInventoryCategory> tfolder = new LLViewerInventoryCategory(gAgent.getID()); tfolder->unpackMessage(msg, _PREHASH_FolderData, i); - //llinfos << "unpaked folder '" << tfolder->getName() << "' (" - // << tfolder->getUUID() << ") in " << tfolder->getParentUUID() - // << llendl; + llinfos << "unpacked folder '" << tfolder->getName() << "' (" + << tfolder->getUUID() << ") in " << tfolder->getParentUUID() + << llendl; if(tfolder->getUUID().notNull()) { folders.push_back(tfolder); @@ -2570,8 +2570,8 @@ void LLInventoryModel::processBulkUpdateInventory(LLMessageSystem* msg, void**) { LLPointer<LLViewerInventoryItem> titem = new LLViewerInventoryItem; titem->unpackMessage(msg, _PREHASH_ItemData, i); - //llinfos << "unpaked item '" << titem->getName() << "' in " - // << titem->getParentUUID() << llendl; + llinfos << "unpaked item '" << titem->getName() << "' in " + << titem->getParentUUID() << llendl; U32 callback_id; msg->getU32Fast(_PREHASH_ItemData, _PREHASH_CallbackID, callback_id); if(titem->getUUID().notNull()) @@ -2879,40 +2879,62 @@ BOOL LLInventoryModel::getIsFirstTimeInViewer2() return sFirstTimeInViewer2; } -static LLInventoryModel::item_array_t::iterator find_item_iter_by_uuid(LLInventoryModel::item_array_t& items, const LLUUID& id) +LLInventoryModel::item_array_t::iterator LLInventoryModel::findItemIterByUUID(LLInventoryModel::item_array_t& items, const LLUUID& id) { - LLInventoryModel::item_array_t::iterator result = items.end(); + LLInventoryModel::item_array_t::iterator curr_item = items.begin(); - for (LLInventoryModel::item_array_t::iterator i = items.begin(); i != items.end(); ++i) + while (curr_item != items.end()) { - if ((*i)->getUUID() == id) + if ((*curr_item)->getUUID() == id) { - result = i; break; } + ++curr_item; } - return result; + return curr_item; } // static // * @param[in, out] items - vector with items to be updated. It should be sorted in a right way // * before calling this method. // * @param src_item_id - LLUUID of inventory item to be moved in new position -// * @param dest_item_id - LLUUID of inventory item before which source item should be placed. -void LLInventoryModel::updateItemsOrder(LLInventoryModel::item_array_t& items, const LLUUID& src_item_id, const LLUUID& dest_item_id) +// * @param dest_item_id - LLUUID of inventory item before (or after) which source item should +// * be placed. +// * @param insert_before - bool indicating if src_item_id should be placed before or after +// * dest_item_id. Default is true. +void LLInventoryModel::updateItemsOrder(LLInventoryModel::item_array_t& items, const LLUUID& src_item_id, const LLUUID& dest_item_id, bool insert_before) { - LLInventoryModel::item_array_t::iterator it_src = find_item_iter_by_uuid(items, src_item_id); - LLInventoryModel::item_array_t::iterator it_dest = find_item_iter_by_uuid(items, dest_item_id); + LLInventoryModel::item_array_t::iterator it_src = findItemIterByUUID(items, src_item_id); + LLInventoryModel::item_array_t::iterator it_dest = findItemIterByUUID(items, dest_item_id); - if (it_src == items.end() || it_dest == items.end()) return; + // If one of the passed UUID is not in the item list, bail out + if ((it_src == items.end()) || (it_dest == items.end())) + return; + // Erase the source element from the list, keep a copy before erasing. LLViewerInventoryItem* src_item = *it_src; items.erase(it_src); - // target iterator can not be valid because the container was changed, so update it. - it_dest = find_item_iter_by_uuid(items, dest_item_id); - items.insert(it_dest, src_item); + // Note: Target iterator is not valid anymore because the container was changed, so update it. + it_dest = findItemIterByUUID(items, dest_item_id); + + // Go to the next element if one wishes to insert after the dest element + if (!insert_before) + { + ++it_dest; + } + + // Reinsert the source item in the right place + if (it_dest != items.end()) + { + items.insert(it_dest, src_item); + } + else + { + // Append to the list if it_dest reached the end + items.push_back(src_item); + } } //* @param[in] items vector of items in order to be saved. diff --git a/indra/newview/llinventorymodel.h b/indra/newview/llinventorymodel.h index e0e81f1006..340c1b0c22 100644 --- a/indra/newview/llinventorymodel.h +++ b/indra/newview/llinventorymodel.h @@ -332,11 +332,16 @@ protected: //-------------------------------------------------------------------- public: // Changes items order by insertion of the item identified by src_item_id - // before the item identified by dest_item_id. Both items must exist in items array. - // Sorting is stored after method is finished. Only src_item_id is moved before dest_item_id. + // before (or after) the item identified by dest_item_id. Both items must exist in items array. + // Sorting is stored after method is finished. Only src_item_id is moved before (or after) dest_item_id. + // The parameter "insert_before" controls on which side of dest_item_id src_item_id gets rensinserted. static void updateItemsOrder(LLInventoryModel::item_array_t& items, const LLUUID& src_item_id, - const LLUUID& dest_item_id); + const LLUUID& dest_item_id, + bool insert_before = true); + // Gets an iterator on an item vector knowing only the item UUID. + // Returns end() of the vector if not found. + static LLInventoryModel::item_array_t::iterator findItemIterByUUID(LLInventoryModel::item_array_t& items, const LLUUID& id); // Saves current order of the passed items using inventory item sort field. // Resets 'items' sort fields and saves them on server. @@ -406,7 +411,7 @@ public: // Return (yes/no/maybe) child status of category children. EHasChildren categoryHasChildren(const LLUUID& cat_id) const; - // Returns true iff category version is known and theoretical + // Returns true if category version is known and theoretical // descendents == actual descendents. bool isCategoryComplete(const LLUUID& cat_id) const; diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index 18c3f76826..d06374d232 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -240,6 +240,12 @@ void LLInventoryPanel::initFromParams(const LLInventoryPanel::Params& params) getFilter()->setFilterCategoryTypes(getFilter()->getFilterCategoryTypes() & ~(1ULL << LLFolderType::FT_INBOX)); getFilter()->setFilterCategoryTypes(getFilter()->getFilterCategoryTypes() & ~(1ULL << LLFolderType::FT_OUTBOX)); + // set the filter for the empty folder if the debug setting is on + if (gSavedSettings.getBOOL("DebugHideEmptySystemFolders")) + { + getFilter()->setFilterEmptySystemFolders(); + } + // Initialize base class params. LLPanel::initFromParams(params); } @@ -697,7 +703,10 @@ LLFolderViewItem* LLInventoryPanel::buildNewViews(const LLUUID& id) if (new_listener) { LLFolderViewFolder* folderp = createFolderViewFolder(new_listener); - folderp->setItemSortOrder(mFolderRoot->getSortOrder()); + if (folderp) + { + folderp->setItemSortOrder(mFolderRoot->getSortOrder()); + } itemp = folderp; } } @@ -1128,19 +1137,78 @@ LLInventoryPanel* LLInventoryPanel::getActiveInventoryPanel(BOOL auto_open) { // Make sure the floater is not minimized (STORM-438). if (active_inv_floaterp && active_inv_floaterp->isMinimized()) + { active_inv_floaterp->setMinimized(FALSE); + } + } + else if (auto_open) + { + floater_inventory->openFloater(); - return res; + res = sidepanel_inventory->getActivePanel(); } + + return res; +} + +//static +void LLInventoryPanel::openInventoryPanelAndSetSelection(BOOL auto_open, const LLUUID& obj_id) +{ + LLInventoryPanel *active_panel = LLInventoryPanel::getActiveInventoryPanel(auto_open); + + if (active_panel) + { + LL_DEBUGS("Messaging") << "Highlighting" << obj_id << LL_ENDL; - // C. If no panels are open and we don't want to force open a panel, then just abort out. - if (!auto_open) return NULL; - - // D. Open the inventory side panel floater and use that. - floater_inventory->openFloater(); - return sidepanel_inventory->getActivePanel(); + LLViewerInventoryItem * item = gInventory.getItem(obj_id); + LLViewerInventoryCategory * cat = gInventory.getCategory(obj_id); + + bool in_inbox = false; + bool in_outbox = false; + + LLViewerInventoryCategory * parent_cat = NULL; + + if (item) + { + parent_cat = gInventory.getCategory(item->getParentUUID()); + } + else if (cat) + { + parent_cat = gInventory.getCategory(cat->getParentUUID()); + } + + if (parent_cat) + { + in_inbox = (LLFolderType::FT_INBOX == parent_cat->getPreferredType()); + in_outbox = (LLFolderType::FT_OUTBOX == parent_cat->getPreferredType()); + } + + if (in_inbox || in_outbox) + { + LLSidepanelInventory * sidepanel_inventory = LLFloaterSidePanelContainer::getPanel<LLSidepanelInventory>("inventory"); + LLInventoryPanel * inventory_panel = NULL; + + if (in_inbox) + { + sidepanel_inventory->openInbox(); + inventory_panel = sidepanel_inventory->getInboxPanel(); + } + else + { + sidepanel_inventory->openOutbox(); + inventory_panel = sidepanel_inventory->getOutboxPanel(); + } - return NULL; + if (inventory_panel) + { + inventory_panel->setSelection(obj_id, TAKE_FOCUS_YES); + } + } + else + { + active_panel->setSelection(obj_id, TAKE_FOCUS_YES); + } + } } void LLInventoryPanel::addHideFolderType(LLFolderType::EType folder_type) diff --git a/indra/newview/llinventorypanel.h b/indra/newview/llinventorypanel.h index 8635ebc5c8..2a24327115 100644 --- a/indra/newview/llinventorypanel.h +++ b/indra/newview/llinventorypanel.h @@ -175,6 +175,8 @@ public: // Find whichever inventory panel is active / on top. // "Auto_open" determines if we open an inventory panel if none are open. static LLInventoryPanel *getActiveInventoryPanel(BOOL auto_open = TRUE); + + static void openInventoryPanelAndSetSelection(BOOL auto_open, const LLUUID& obj_id); protected: void openStartFolderOrMyInventory(); // open the first level of inventory diff --git a/indra/newview/llmanip.cpp b/indra/newview/llmanip.cpp index 85e0043651..6e0f360cbc 100644 --- a/indra/newview/llmanip.cpp +++ b/indra/newview/llmanip.cpp @@ -372,14 +372,14 @@ void LLManip::renderGuidelines(BOOL draw_x, BOOL draw_y, BOOL draw_z) //LLVector3 center_agent = LLSelectMgr::getInstance()->getBBoxOfSelection().getCenterAgent(); LLVector3 center_agent = getPivotPoint(); - glPushMatrix(); + gGL.pushMatrix(); { - glTranslatef(center_agent.mV[VX], center_agent.mV[VY], center_agent.mV[VZ]); + gGL.translatef(center_agent.mV[VX], center_agent.mV[VY], center_agent.mV[VZ]); F32 angle_radians, x, y, z; grid_rot.getAngleAxis(&angle_radians, &x, &y, &z); - glRotatef(angle_radians * RAD_TO_DEG, x, y, z); + gGL.rotatef(angle_radians * RAD_TO_DEG, x, y, z); F32 region_size = LLWorld::getInstance()->getRegionWidthInMeters(); @@ -416,7 +416,7 @@ void LLManip::renderGuidelines(BOOL draw_x, BOOL draw_y, BOOL draw_z) } LLUI::setLineWidth(1.0f); } - glPopMatrix(); + gGL.popMatrix(); } void LLManip::renderXYZ(const LLVector3 &vec) @@ -466,11 +466,11 @@ void LLManip::renderXYZ(const LLVector3 &vec) feedback_string = llformat("X: %.3f", vec.mV[VX]); hud_render_text(utf8str_to_wstring(feedback_string), camera_pos, *font, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, -102.f, (F32)vertical_offset, LLColor4(1.f, 0.5f, 0.5f, 1.f), FALSE); - glColor3f(0.5f, 1.f, 0.5f); + gGL.diffuseColor3f(0.5f, 1.f, 0.5f); feedback_string = llformat("Y: %.3f", vec.mV[VY]); hud_render_text(utf8str_to_wstring(feedback_string), camera_pos, *font, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, -27.f, (F32)vertical_offset, LLColor4(0.5f, 1.f, 0.5f, 1.f), FALSE); - glColor3f(0.5f, 0.5f, 1.f); + gGL.diffuseColor3f(0.5f, 0.5f, 1.f); feedback_string = llformat("Z: %.3f", vec.mV[VZ]); hud_render_text(utf8str_to_wstring(feedback_string), camera_pos, *font, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, 48.f, (F32)vertical_offset, LLColor4(0.5f, 0.5f, 1.f, 1.f), FALSE); } @@ -481,8 +481,8 @@ void LLManip::renderTickText(const LLVector3& pos, const std::string& text, cons const LLFontGL* big_fontp = LLFontGL::getFontSansSerif(); BOOL hud_selection = mObjectSelection->getSelectType() == SELECT_TYPE_HUD; - glMatrixMode(GL_MODELVIEW); - glPushMatrix(); + gGL.matrixMode(LLRender::MM_MODELVIEW); + gGL.pushMatrix(); LLVector3 render_pos = pos; if (hud_selection) { @@ -490,7 +490,7 @@ void LLManip::renderTickText(const LLVector3& pos, const std::string& text, cons F32 inv_zoom_amt = 1.f / zoom_amt; // scale text back up to counter-act zoom level render_pos = pos * zoom_amt; - glScalef(inv_zoom_amt, inv_zoom_amt, inv_zoom_amt); + gGL.scalef(inv_zoom_amt, inv_zoom_amt, inv_zoom_amt); } // render shadow first @@ -501,7 +501,7 @@ void LLManip::renderTickText(const LLVector3& pos, const std::string& text, cons gViewerWindow->setup3DViewport(); hud_render_utf8text(text, render_pos, *big_fontp, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, -0.5f * big_fontp->getWidthF32(text), 3.f, color, mObjectSelection->getSelectType() == SELECT_TYPE_HUD); - glPopMatrix(); + gGL.popMatrix(); } void LLManip::renderTickValue(const LLVector3& pos, F32 value, const std::string& suffix, const LLColor4 &color) @@ -539,8 +539,8 @@ void LLManip::renderTickValue(const LLVector3& pos, F32 value, const std::string } BOOL hud_selection = mObjectSelection->getSelectType() == SELECT_TYPE_HUD; - glMatrixMode(GL_MODELVIEW); - glPushMatrix(); + gGL.matrixMode(LLRender::MM_MODELVIEW); + gGL.pushMatrix(); LLVector3 render_pos = pos; if (hud_selection) { @@ -548,7 +548,7 @@ void LLManip::renderTickValue(const LLVector3& pos, F32 value, const std::string F32 inv_zoom_amt = 1.f / zoom_amt; // scale text back up to counter-act zoom level render_pos = pos * zoom_amt; - glScalef(inv_zoom_amt, inv_zoom_amt, inv_zoom_amt); + gGL.scalef(inv_zoom_amt, inv_zoom_amt, inv_zoom_amt); } LLColor4 shadow_color = LLColor4::black; @@ -573,7 +573,7 @@ void LLManip::renderTickValue(const LLVector3& pos, F32 value, const std::string gViewerWindow->setup3DViewport(); hud_render_utf8text(val_string, render_pos, *big_fontp, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, -0.5f * big_fontp->getWidthF32(val_string), 3.f, color, hud_selection); } - glPopMatrix(); + gGL.popMatrix(); } LLColor4 LLManip::setupSnapGuideRenderPass(S32 pass) diff --git a/indra/newview/llmaniprotate.cpp b/indra/newview/llmaniprotate.cpp index 6ee095475f..a8da94f75e 100644 --- a/indra/newview/llmaniprotate.cpp +++ b/indra/newview/llmaniprotate.cpp @@ -53,6 +53,7 @@ #include "llviewercamera.h" #include "llviewerobject.h" #include "llviewerobject.h" +#include "llviewershadermgr.h" #include "llviewerwindow.h" #include "llworld.h" #include "pipeline.h" @@ -113,7 +114,7 @@ void LLManipRotate::handleSelect() void LLManipRotate::render() { LLGLSUIDefault gls_ui; - gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); + gGL.getTexUnit(0)->bind(LLViewerFetchedTexture::sWhiteImagep); LLGLDepthTest gls_depth(GL_TRUE); LLGLEnable gl_blend(GL_BLEND); LLGLEnable gls_alpha_test(GL_ALPHA_TEST); @@ -130,12 +131,12 @@ void LLManipRotate::render() return; } - glMatrixMode(GL_MODELVIEW); - glPushMatrix(); + gGL.matrixMode(LLRender::MM_MODELVIEW); + gGL.pushMatrix(); if (mObjectSelection->getSelectType() == SELECT_TYPE_HUD) { F32 zoom = gAgentCamera.mHUDCurZoom; - glScalef(zoom, zoom, zoom); + gGL.scalef(zoom, zoom, zoom); } @@ -145,8 +146,9 @@ void LLManipRotate::render() LLColor4 highlight_inside( 0.7f, 0.7f, 0.f, 0.5f ); F32 width_meters = WIDTH_PIXELS * mRadiusMeters / RADIUS_PIXELS; - glPushMatrix(); + gGL.pushMatrix(); { + // are we in the middle of a constrained drag? if (mManipPart >= LL_ROT_X && mManipPart <= LL_ROT_Z) { @@ -154,13 +156,18 @@ void LLManipRotate::render() } else { + if (LLGLSLShader::sNoFixedFunction) + { + gDebugProgram.bind(); + } + LLGLEnable cull_face(GL_CULL_FACE); LLGLDepthTest gls_depth(GL_FALSE); - glPushMatrix(); + gGL.pushMatrix(); { // Draw "sphere" (intersection of sphere with tangent cone that has apex at camera) - glTranslatef( mCenterToProfilePlane.mV[VX], mCenterToProfilePlane.mV[VY], mCenterToProfilePlane.mV[VZ] ); - glTranslatef( center.mV[VX], center.mV[VY], center.mV[VZ] ); + gGL.translatef( mCenterToProfilePlane.mV[VX], mCenterToProfilePlane.mV[VY], mCenterToProfilePlane.mV[VZ] ); + gGL.translatef( center.mV[VX], center.mV[VY], center.mV[VZ] ); // Inverse change of basis vectors LLVector3 forward = mCenterToCamNorm; @@ -177,35 +184,41 @@ void LLManipRotate::render() LLMatrix4 mat; mat.initRows(a, b, c, LLVector4(0.f, 0.f, 0.f, 1.f)); - glMultMatrixf( &mat.mMatrix[0][0] ); + gGL.multMatrix( &mat.mMatrix[0][0] ); - glRotatef( -90, 0.f, 1.f, 0.f); + gGL.rotatef( -90, 0.f, 1.f, 0.f); LLColor4 color; if (mManipPart == LL_ROT_ROLL || mHighlightedPart == LL_ROT_ROLL) { color.setVec(0.8f, 0.8f, 0.8f, 0.8f); - glScalef(mManipulatorScales.mV[VW], mManipulatorScales.mV[VW], mManipulatorScales.mV[VW]); + gGL.scalef(mManipulatorScales.mV[VW], mManipulatorScales.mV[VW], mManipulatorScales.mV[VW]); } else { color.setVec( 0.7f, 0.7f, 0.7f, 0.6f ); } + gGL.diffuseColor4fv(color.mV); gl_washer_2d(mRadiusMeters + width_meters, mRadiusMeters, CIRCLE_STEPS, color, color); if (mManipPart == LL_NO_PART) { gGL.color4f( 0.7f, 0.7f, 0.7f, 0.3f ); + gGL.diffuseColor4f(0.7f, 0.7f, 0.7f, 0.3f); gl_circle_2d( 0, 0, mRadiusMeters, CIRCLE_STEPS, TRUE ); } - GLdouble plane_eqn[] = { 0, 0, 1, 0 }; - glClipPlane( GL_CLIP_PLANE0, plane_eqn ); + gGL.flush(); } - glPopMatrix(); - } + gGL.popMatrix(); - glTranslatef( center.mV[VX], center.mV[VY], center.mV[VZ] ); + if (LLGLSLShader::sNoFixedFunction) + { + gUIProgram.bind(); + } + } + + gGL.translatef( center.mV[VX], center.mV[VY], center.mV[VZ] ); LLQuaternion rot; F32 angle_radians, x, y, z; @@ -217,41 +230,46 @@ void LLManipRotate::render() LLSelectMgr::getInstance()->getGrid(grid_origin, grid_rotation, grid_scale); grid_rotation.getAngleAxis(&angle_radians, &x, &y, &z); - glRotatef(angle_radians * RAD_TO_DEG, x, y, z); + gGL.rotatef(angle_radians * RAD_TO_DEG, x, y, z); + if (LLGLSLShader::sNoFixedFunction) + { + gDebugProgram.bind(); + } + if (mManipPart == LL_ROT_Z) { mManipulatorScales = lerp(mManipulatorScales, LLVector4(1.f, 1.f, SELECTED_MANIPULATOR_SCALE, 1.f), LLCriticalDamp::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE)); - glPushMatrix(); + gGL.pushMatrix(); { // selected part - glScalef(mManipulatorScales.mV[VZ], mManipulatorScales.mV[VZ], mManipulatorScales.mV[VZ]); + gGL.scalef(mManipulatorScales.mV[VZ], mManipulatorScales.mV[VZ], mManipulatorScales.mV[VZ]); renderActiveRing( mRadiusMeters, width_meters, LLColor4( 0.f, 0.f, 1.f, 1.f) , LLColor4( 0.f, 0.f, 1.f, 0.3f )); } - glPopMatrix(); + gGL.popMatrix(); } else if (mManipPart == LL_ROT_Y) { mManipulatorScales = lerp(mManipulatorScales, LLVector4(1.f, SELECTED_MANIPULATOR_SCALE, 1.f, 1.f), LLCriticalDamp::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE)); - glPushMatrix(); + gGL.pushMatrix(); { - glRotatef( 90.f, 1.f, 0.f, 0.f ); - glScalef(mManipulatorScales.mV[VY], mManipulatorScales.mV[VY], mManipulatorScales.mV[VY]); + gGL.rotatef( 90.f, 1.f, 0.f, 0.f ); + gGL.scalef(mManipulatorScales.mV[VY], mManipulatorScales.mV[VY], mManipulatorScales.mV[VY]); renderActiveRing( mRadiusMeters, width_meters, LLColor4( 0.f, 1.f, 0.f, 1.f), LLColor4( 0.f, 1.f, 0.f, 0.3f)); } - glPopMatrix(); + gGL.popMatrix(); } else if (mManipPart == LL_ROT_X) { mManipulatorScales = lerp(mManipulatorScales, LLVector4(SELECTED_MANIPULATOR_SCALE, 1.f, 1.f, 1.f), LLCriticalDamp::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE)); - glPushMatrix(); + gGL.pushMatrix(); { - glRotatef( 90.f, 0.f, 1.f, 0.f ); - glScalef(mManipulatorScales.mV[VX], mManipulatorScales.mV[VX], mManipulatorScales.mV[VX]); + gGL.rotatef( 90.f, 0.f, 1.f, 0.f ); + gGL.scalef(mManipulatorScales.mV[VX], mManipulatorScales.mV[VX], mManipulatorScales.mV[VX]); renderActiveRing( mRadiusMeters, width_meters, LLColor4( 1.f, 0.f, 0.f, 1.f), LLColor4( 1.f, 0.f, 0.f, 0.3f)); } - glPopMatrix(); + gGL.popMatrix(); } else if (mManipPart == LL_ROT_ROLL) { @@ -271,12 +289,13 @@ void LLManipRotate::render() // First pass: centers. Second pass: sides. for( S32 i=0; i<2; i++ ) { - glPushMatrix(); + + gGL.pushMatrix(); { if (mHighlightedPart == LL_ROT_Z) { mManipulatorScales = lerp(mManipulatorScales, LLVector4(1.f, 1.f, SELECTED_MANIPULATOR_SCALE, 1.f), LLCriticalDamp::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE)); - glScalef(mManipulatorScales.mV[VZ], mManipulatorScales.mV[VZ], mManipulatorScales.mV[VZ]); + gGL.scalef(mManipulatorScales.mV[VZ], mManipulatorScales.mV[VZ], mManipulatorScales.mV[VZ]); // hovering over part gl_ring( mRadiusMeters, width_meters, LLColor4( 0.f, 0.f, 1.f, 1.f ), LLColor4( 0.f, 0.f, 1.f, 0.5f ), CIRCLE_STEPS, i); } @@ -286,15 +305,15 @@ void LLManipRotate::render() gl_ring( mRadiusMeters, width_meters, LLColor4( 0.f, 0.f, 0.8f, 0.8f ), LLColor4( 0.f, 0.f, 0.8f, 0.4f ), CIRCLE_STEPS, i); } } - glPopMatrix(); - - glPushMatrix(); + gGL.popMatrix(); + + gGL.pushMatrix(); { - glRotatef( 90.f, 1.f, 0.f, 0.f ); + gGL.rotatef( 90.f, 1.f, 0.f, 0.f ); if (mHighlightedPart == LL_ROT_Y) { mManipulatorScales = lerp(mManipulatorScales, LLVector4(1.f, SELECTED_MANIPULATOR_SCALE, 1.f, 1.f), LLCriticalDamp::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE)); - glScalef(mManipulatorScales.mV[VY], mManipulatorScales.mV[VY], mManipulatorScales.mV[VY]); + gGL.scalef(mManipulatorScales.mV[VY], mManipulatorScales.mV[VY], mManipulatorScales.mV[VY]); // hovering over part gl_ring( mRadiusMeters, width_meters, LLColor4( 0.f, 1.f, 0.f, 1.f ), LLColor4( 0.f, 1.f, 0.f, 0.5f ), CIRCLE_STEPS, i); } @@ -304,15 +323,15 @@ void LLManipRotate::render() gl_ring( mRadiusMeters, width_meters, LLColor4( 0.f, 0.8f, 0.f, 0.8f ), LLColor4( 0.f, 0.8f, 0.f, 0.4f ), CIRCLE_STEPS, i); } } - glPopMatrix(); + gGL.popMatrix(); - glPushMatrix(); + gGL.pushMatrix(); { - glRotatef( 90.f, 0.f, 1.f, 0.f ); + gGL.rotatef( 90.f, 0.f, 1.f, 0.f ); if (mHighlightedPart == LL_ROT_X) { mManipulatorScales = lerp(mManipulatorScales, LLVector4(SELECTED_MANIPULATOR_SCALE, 1.f, 1.f, 1.f), LLCriticalDamp::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE)); - glScalef(mManipulatorScales.mV[VX], mManipulatorScales.mV[VX], mManipulatorScales.mV[VX]); + gGL.scalef(mManipulatorScales.mV[VX], mManipulatorScales.mV[VX], mManipulatorScales.mV[VX]); // hovering over part gl_ring( mRadiusMeters, width_meters, LLColor4( 1.f, 0.f, 0.f, 1.f ), LLColor4( 1.f, 0.f, 0.f, 0.5f ), CIRCLE_STEPS, i); @@ -323,17 +342,26 @@ void LLManipRotate::render() gl_ring( mRadiusMeters, width_meters, LLColor4( 0.8f, 0.f, 0.f, 0.8f ), LLColor4( 0.8f, 0.f, 0.f, 0.4f ), CIRCLE_STEPS, i); } } - glPopMatrix(); + gGL.popMatrix(); if (mHighlightedPart == LL_ROT_ROLL) { mManipulatorScales = lerp(mManipulatorScales, LLVector4(1.f, 1.f, 1.f, SELECTED_MANIPULATOR_SCALE), LLCriticalDamp::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE)); } + } + } + + if (LLGLSLShader::sNoFixedFunction) + { + gUIProgram.bind(); + } + } - glPopMatrix(); - glPopMatrix(); + gGL.popMatrix(); + gGL.popMatrix(); + LLVector3 euler_angles; LLQuaternion object_rot = first_object->getRotationEdit(); @@ -796,14 +824,14 @@ void LLManipRotate::renderSnapGuides() for (S32 pass = 0; pass < 3; pass++) { // render snap guide ring - glPushMatrix(); + gGL.pushMatrix(); LLQuaternion snap_guide_rot; F32 angle_radians, x, y, z; snap_guide_rot.shortestArc(LLVector3::z_axis, getConstraintAxis()); snap_guide_rot.getAngleAxis(&angle_radians, &x, &y, &z); - glTranslatef(center.mV[VX], center.mV[VY], center.mV[VZ]); - glRotatef(angle_radians * RAD_TO_DEG, x, y, z); + gGL.translatef(center.mV[VX], center.mV[VY], center.mV[VZ]); + gGL.rotatef(angle_radians * RAD_TO_DEG, x, y, z); LLColor4 line_color = setupSnapGuideRenderPass(pass); @@ -826,7 +854,7 @@ void LLManipRotate::renderSnapGuides() { gl_circle_2d(0.f, 0.f, mRadiusMeters * SNAP_GUIDE_INNER_RADIUS, CIRCLE_STEPS, FALSE); } - glPopMatrix(); + gGL.popMatrix(); for (S32 i = 0; i < 64; i++) { diff --git a/indra/newview/llmanipscale.cpp b/indra/newview/llmanipscale.cpp index 4eb94dfb8e..f6df4cdfbf 100644 --- a/indra/newview/llmanipscale.cpp +++ b/indra/newview/llmanipscale.cpp @@ -217,12 +217,12 @@ void LLManipScale::render() if( canAffectSelection() ) { - glMatrixMode(GL_MODELVIEW); - glPushMatrix(); + gGL.matrixMode(LLRender::MM_MODELVIEW); + gGL.pushMatrix(); if (mObjectSelection->getSelectType() == SELECT_TYPE_HUD) { F32 zoom = gAgentCamera.mHUDCurZoom; - glScalef(zoom, zoom, zoom); + gGL.scalef(zoom, zoom, zoom); } //////////////////////////////////////////////////////////////////////// @@ -274,14 +274,14 @@ void LLManipScale::render() LLVector3 pos_agent = bbox.getPositionAgent(); LLQuaternion rot = bbox.getRotation(); - glMatrixMode(GL_MODELVIEW); - glPushMatrix(); + gGL.matrixMode(LLRender::MM_MODELVIEW); + gGL.pushMatrix(); { - glTranslatef(pos_agent.mV[VX], pos_agent.mV[VY], pos_agent.mV[VZ]); + gGL.translatef(pos_agent.mV[VX], pos_agent.mV[VY], pos_agent.mV[VZ]); F32 angle_radians, x, y, z; rot.getAngleAxis(&angle_radians, &x, &y, &z); - glRotatef(angle_radians * RAD_TO_DEG, x, y, z); + gGL.rotatef(angle_radians * RAD_TO_DEG, x, y, z); { @@ -303,13 +303,13 @@ void LLManipScale::render() glPolygonOffset( 0.f, 0.f); } } - glPopMatrix(); + gGL.popMatrix(); if (mManipPart != LL_NO_PART) { renderSnapGuides(bbox); } - glPopMatrix(); + gGL.popMatrix(); renderXYZ(bbox.getExtentLocal()); } @@ -719,17 +719,17 @@ void LLManipScale::renderEdges( const LLBBox& bbox ) LLVector3 direction = edgeToUnitVector( part ); LLVector3 center_to_edge = unitVectorToLocalBBoxExtent( direction, bbox ); - glPushMatrix(); + gGL.pushMatrix(); { - glTranslatef( center_to_edge.mV[0], center_to_edge.mV[1], center_to_edge.mV[2] ); + gGL.translatef( center_to_edge.mV[0], center_to_edge.mV[1], center_to_edge.mV[2] ); conditionalHighlight( part ); - glScalef( + gGL.scalef( direction.mV[0] ? edge_width : extent.mV[VX], direction.mV[1] ? edge_width : extent.mV[VY], direction.mV[2] ? edge_width : extent.mV[VZ] ); gBox.render(); } - glPopMatrix(); + gGL.popMatrix(); } } @@ -766,13 +766,13 @@ void LLManipScale::renderBoxHandle( F32 x, F32 y, F32 z ) gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); LLGLDepthTest gls_depth(GL_FALSE); - glPushMatrix(); + gGL.pushMatrix(); { - glTranslatef( x, y, z ); - glScalef( mScaledBoxHandleSize, mScaledBoxHandleSize, mScaledBoxHandleSize ); + gGL.translatef( x, y, z ); + gGL.scalef( mScaledBoxHandleSize, mScaledBoxHandleSize, mScaledBoxHandleSize ); gBox.render(); } - glPopMatrix(); + gGL.popMatrix(); } @@ -788,16 +788,16 @@ void LLManipScale::renderAxisHandle( const LLVector3& start, const LLVector3& en LLVector3 delta = end - offset_start; LLVector3 pos = offset_start + 0.5f * delta; - glPushMatrix(); + gGL.pushMatrix(); { - glTranslatef( pos.mV[VX], pos.mV[VY], pos.mV[VZ] ); - glScalef( + gGL.translatef( pos.mV[VX], pos.mV[VY], pos.mV[VZ] ); + gGL.scalef( mBoxHandleSize + llabs(delta.mV[VX]), mBoxHandleSize + llabs(delta.mV[VY]), mBoxHandleSize + llabs(delta.mV[VZ])); gBox.render(); } - glPopMatrix(); + gGL.popMatrix(); } else { diff --git a/indra/newview/llmaniptranslate.cpp b/indra/newview/llmaniptranslate.cpp index f871df0c36..3a88fbd96d 100644 --- a/indra/newview/llmaniptranslate.cpp +++ b/indra/newview/llmaniptranslate.cpp @@ -1066,12 +1066,12 @@ BOOL LLManipTranslate::handleMouseUp(S32 x, S32 y, MASK mask) void LLManipTranslate::render() { - glMatrixMode(GL_MODELVIEW); + gGL.matrixMode(LLRender::MM_MODELVIEW); gGL.pushMatrix(); if (mObjectSelection->getSelectType() == SELECT_TYPE_HUD) { F32 zoom = gAgentCamera.mHUDCurZoom; - glScalef(zoom, zoom, zoom); + gGL.scalef(zoom, zoom, zoom); } { LLGLDepthTest gls_depth(GL_TRUE, GL_FALSE); @@ -1515,11 +1515,12 @@ void LLManipTranslate::renderSnapGuides() F32 x,y,z,angle_radians; grid_rotation.getAngleAxis(&angle_radians, &x, &y, &z); gGL.translatef(selection_center.mV[VX], selection_center.mV[VY], selection_center.mV[VZ]); - glRotatef(angle_radians * RAD_TO_DEG, x, y, z); + gGL.rotatef(angle_radians * RAD_TO_DEG, x, y, z); F32 sz = mGridSizeMeters; F32 tiles = sz; - glMatrixMode(GL_TEXTURE); + + gGL.matrixMode(LLRender::MM_TEXTURE); gGL.pushMatrix(); usc = 1.0f/usc; vsc = 1.0f/vsc; @@ -1533,7 +1534,7 @@ void LLManipTranslate::renderSnapGuides() vsc *= 0.5f; } - glScalef(usc, vsc, 1.0f); + gGL.scalef(usc, vsc, 1.0f); gGL.translatef(u, v, 0); float a = line_alpha; @@ -1566,7 +1567,7 @@ void LLManipTranslate::renderSnapGuides() renderGrid(u,v,tiles,1,1,1,a); gGL.popMatrix(); - glMatrixMode(GL_MODELVIEW); + gGL.matrixMode(LLRender::MM_MODELVIEW); gGL.popMatrix(); } @@ -1665,7 +1666,7 @@ void LLManipTranslate::highlightIntersection(LLVector3 normal, glStencilFunc(GL_ALWAYS, 0, stencil_mask); gGL.setColorMask(false, false); gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); - glColor4f(1,1,1,1); + gGL.diffuseColor4f(1,1,1,1); //setup clip plane normal = normal * grid_rotation; @@ -1723,7 +1724,7 @@ void LLManipTranslate::highlightIntersection(LLVector3 normal, F32 x,y,z,angle_radians; grid_rotation.getAngleAxis(&angle_radians, &x, &y, &z); gGL.translatef(selection_center.mV[VX], selection_center.mV[VY], selection_center.mV[VZ]); - glRotatef(angle_radians * RAD_TO_DEG, x, y, z); + gGL.rotatef(angle_radians * RAD_TO_DEG, x, y, z); F32 sz = mGridSizeMeters; F32 tiles = sz; @@ -1852,7 +1853,7 @@ void LLManipTranslate::renderTranslationHandles() mGridSizeMeters = gSavedSettings.getF32("GridDrawSize"); mConeSize = mArrowLengthMeters / 4.f; - glMatrixMode(GL_MODELVIEW); + gGL.matrixMode(LLRender::MM_MODELVIEW); gGL.pushMatrix(); { gGL.translatef(selection_center.mV[VX], selection_center.mV[VY], selection_center.mV[VZ]); @@ -1860,7 +1861,7 @@ void LLManipTranslate::renderTranslationHandles() F32 angle_radians, x, y, z; grid_rotation.getAngleAxis(&angle_radians, &x, &y, &z); - glRotatef(angle_radians * RAD_TO_DEG, x, y, z); + gGL.rotatef(angle_radians * RAD_TO_DEG, x, y, z); LLQuaternion invRotation = grid_rotation; invRotation.conjQuat(); @@ -1908,9 +1909,9 @@ void LLManipTranslate::renderTranslationHandles() { // render YZ plane manipulator gGL.pushMatrix(); - glScalef(mPlaneManipPositions.mV[VX], mPlaneManipPositions.mV[VY], mPlaneManipPositions.mV[VZ]); + gGL.scalef(mPlaneManipPositions.mV[VX], mPlaneManipPositions.mV[VY], mPlaneManipPositions.mV[VZ]); gGL.translatef(0.f, mPlaneManipOffsetMeters, mPlaneManipOffsetMeters); - glScalef(mPlaneScales.mV[VX], mPlaneScales.mV[VX], mPlaneScales.mV[VX]); + gGL.scalef(mPlaneScales.mV[VX], mPlaneScales.mV[VX], mPlaneScales.mV[VX]); if (mHighlightedPart == LL_YZ_PLANE) { color1.setVec(0.f, 1.f, 0.f, 1.f); @@ -1962,9 +1963,9 @@ void LLManipTranslate::renderTranslationHandles() { // render XZ plane manipulator gGL.pushMatrix(); - glScalef(mPlaneManipPositions.mV[VX], mPlaneManipPositions.mV[VY], mPlaneManipPositions.mV[VZ]); + gGL.scalef(mPlaneManipPositions.mV[VX], mPlaneManipPositions.mV[VY], mPlaneManipPositions.mV[VZ]); gGL.translatef(mPlaneManipOffsetMeters, 0.f, mPlaneManipOffsetMeters); - glScalef(mPlaneScales.mV[VY], mPlaneScales.mV[VY], mPlaneScales.mV[VY]); + gGL.scalef(mPlaneScales.mV[VY], mPlaneScales.mV[VY], mPlaneScales.mV[VY]); if (mHighlightedPart == LL_XZ_PLANE) { color1.setVec(0.f, 0.f, 1.f, 1.f); @@ -2018,7 +2019,7 @@ void LLManipTranslate::renderTranslationHandles() { // render XY plane manipulator gGL.pushMatrix(); - glScalef(mPlaneManipPositions.mV[VX], mPlaneManipPositions.mV[VY], mPlaneManipPositions.mV[VZ]); + gGL.scalef(mPlaneManipPositions.mV[VX], mPlaneManipPositions.mV[VY], mPlaneManipPositions.mV[VZ]); /* Y ^ @@ -2043,7 +2044,7 @@ void LLManipTranslate::renderTranslationHandles() v2 = LLVector3(mPlaneManipOffsetMeters * ( PLANE_TICK_SIZE * 0.25f), mPlaneManipOffsetMeters * ( PLANE_TICK_SIZE * 0.25f), 0.f); v3 = LLVector3(mPlaneManipOffsetMeters * (-PLANE_TICK_SIZE * 0.75f), mPlaneManipOffsetMeters * ( PLANE_TICK_SIZE * 0.25f), 0.f); #endif - glScalef(mPlaneScales.mV[VZ], mPlaneScales.mV[VZ], mPlaneScales.mV[VZ]); + gGL.scalef(mPlaneScales.mV[VZ], mPlaneScales.mV[VZ], mPlaneScales.mV[VZ]); if (mHighlightedPart == LL_XY_PLANE) { color1.setVec(1.f, 0.f, 0.f, 1.f); @@ -2215,7 +2216,7 @@ void LLManipTranslate::renderArrow(S32 which_arrow, S32 selected_arrow, F32 box_ } gGL.translatef(vec.mV[0], vec.mV[1], vec.mV[2]); - glScalef(handle_size, handle_size, handle_size); + gGL.scalef(handle_size, handle_size, handle_size); F32 rot = 0.0f; LLVector3 axis; @@ -2239,11 +2240,11 @@ void LLManipTranslate::renderArrow(S32 which_arrow, S32 selected_arrow, F32 box_ break; } - glColor4fv(color.mV); - glRotatef(rot, axis.mV[0], axis.mV[1], axis.mV[2]); - glScalef(mArrowScales.mV[index], mArrowScales.mV[index], mArrowScales.mV[index] * 1.5f); + gGL.diffuseColor4fv(color.mV); + gGL.rotatef(rot, axis.mV[0], axis.mV[1], axis.mV[2]); + gGL.scalef(mArrowScales.mV[index], mArrowScales.mV[index], mArrowScales.mV[index] * 1.5f); - gCone.render(CONE_LOD_HIGHEST); + gCone.render(); gGL.popMatrix(); } diff --git a/indra/newview/llmediactrl.cpp b/indra/newview/llmediactrl.cpp index 1f1e49726d..74fa5d350a 100644 --- a/indra/newview/llmediactrl.cpp +++ b/indra/newview/llmediactrl.cpp @@ -57,7 +57,6 @@ #include "llcheckboxctrl.h" #include "llnotifications.h" #include "lllineeditor.h" -#include "llfloatermediabrowser.h" #include "llfloaterwebcontent.h" #include "llwindowshade.h" @@ -68,7 +67,6 @@ static LLDefaultChildRegistry::Register<LLMediaCtrl> r("web_browser"); LLMediaCtrl::Params::Params() : start_url("start_url"), border_visible("border_visible", true), - ignore_ui_scale("ignore_ui_scale", true), decouple_texture_size("decouple_texture_size", false), texture_width("texture_width", 1024), texture_height("texture_height", 1024), @@ -89,7 +87,6 @@ LLMediaCtrl::LLMediaCtrl( const Params& p) : mFrequentUpdates( true ), mForceUpdate( false ), mHomePageUrl( "" ), - mIgnoreUIScale( true ), mAlwaysRefresh( false ), mMediaSource( 0 ), mTakeFocusOnClick( p.focus_on_click ), @@ -112,8 +109,6 @@ LLMediaCtrl::LLMediaCtrl( const Params& p) : setCaretColor( (unsigned int)color.mV[0], (unsigned int)color.mV[1], (unsigned int)color.mV[2] ); } - setIgnoreUIScale(p.ignore_ui_scale); - setHomePageUrl(p.start_url, p.initial_mime_type); setBorderVisible(p.border_visible); @@ -124,10 +119,8 @@ LLMediaCtrl::LLMediaCtrl( const Params& p) : if(!getDecoupleTextureSize()) { - S32 screen_width = mIgnoreUIScale ? - llround((F32)getRect().getWidth() * LLUI::sGLScaleFactor.mV[VX]) : getRect().getWidth(); - S32 screen_height = mIgnoreUIScale ? - llround((F32)getRect().getHeight() * LLUI::sGLScaleFactor.mV[VY]) : getRect().getHeight(); + S32 screen_width = llround((F32)getRect().getWidth() * LLUI::sGLScaleFactor.mV[VX]); + S32 screen_height = llround((F32)getRect().getHeight() * LLUI::sGLScaleFactor.mV[VY]); setTextureSize(screen_width, screen_height); } @@ -471,8 +464,8 @@ void LLMediaCtrl::reshape( S32 width, S32 height, BOOL called_from_parent ) { if(!getDecoupleTextureSize()) { - S32 screen_width = mIgnoreUIScale ? llround((F32)width * LLUI::sGLScaleFactor.mV[VX]) : width; - S32 screen_height = mIgnoreUIScale ? llround((F32)height * LLUI::sGLScaleFactor.mV[VY]) : height; + S32 screen_width = llround((F32)width * LLUI::sGLScaleFactor.mV[VX]); + S32 screen_height = llround((F32)height * LLUI::sGLScaleFactor.mV[VY]); // when floater is minimized, these sizes are negative if ( screen_height > 0 && screen_width > 0 ) @@ -689,6 +682,8 @@ bool LLMediaCtrl::ensureMediaSourceExists() mMediaSource->addObserver( this ); mMediaSource->setBackgroundColor( getBackgroundColor() ); mMediaSource->setTrustedBrowser(mTrusted); + mMediaSource->setPageZoomFactor( LLUI::sGLScaleFactor.mV[ VX ] ); + if(mClearCache) { mMediaSource->clearCache(); @@ -770,15 +765,7 @@ void LLMediaCtrl::draw() { gGL.pushUIMatrix(); { - if (mIgnoreUIScale) - { - gGL.loadUIIdentity(); - // font system stores true screen origin, need to scale this by UI scale factor - // to get render origin for this view (with unit scale) - gGL.translateUI(floorf(LLFontGL::sCurOrigin.mX * LLUI::sGLScaleFactor.mV[VX]), - floorf(LLFontGL::sCurOrigin.mY * LLUI::sGLScaleFactor.mV[VY]), - LLFontGL::sCurOrigin.mZ); - } + mMediaSource->setPageZoomFactor( LLUI::sGLScaleFactor.mV[ VX ] ); // scale texture to fit the space using texture coords gGL.getTexUnit(0)->bind(media_texture); @@ -826,14 +813,6 @@ void LLMediaCtrl::draw() x_offset = (r.getWidth() - width) / 2; y_offset = (r.getHeight() - height) / 2; - if(mIgnoreUIScale) - { - x_offset = llround((F32)x_offset * LLUI::sGLScaleFactor.mV[VX]); - y_offset = llround((F32)y_offset * LLUI::sGLScaleFactor.mV[VY]); - width = llround((F32)width * LLUI::sGLScaleFactor.mV[VX]); - height = llround((F32)height * LLUI::sGLScaleFactor.mV[VY]); - } - // draw the browser gGL.begin( LLRender::QUADS ); if (! media_plugin->getTextureCoordsOpenGL()) @@ -900,14 +879,14 @@ void LLMediaCtrl::convertInputCoords(S32& x, S32& y) coords_opengl = mMediaSource->getMediaPlugin()->getTextureCoordsOpenGL(); } - x = mIgnoreUIScale ? llround((F32)x * LLUI::sGLScaleFactor.mV[VX]) : x; + x = llround((F32)x * LLUI::sGLScaleFactor.mV[VX]); if ( ! coords_opengl ) { - y = mIgnoreUIScale ? llround((F32)(y) * LLUI::sGLScaleFactor.mV[VY]) : y; + y = llround((F32)(y) * LLUI::sGLScaleFactor.mV[VY]); } else { - y = mIgnoreUIScale ? llround((F32)(getRect().getHeight() - y) * LLUI::sGLScaleFactor.mV[VY]) : getRect().getHeight() - y; + y = llround((F32)(getRect().getHeight() - y) * LLUI::sGLScaleFactor.mV[VY]); }; } @@ -1102,26 +1081,6 @@ void LLMediaCtrl::onPopup(const LLSD& notification, const LLSD& response) { if (response["open"]) { - // name of default floater to open - std::string floater_name = "media_browser"; - - // look for parent floater name - if ( gFloaterView ) - { - if ( gFloaterView->getParentFloater(this) ) - { - floater_name = gFloaterView->getParentFloater(this)->getInstanceName(); - } - else - { - lldebugs << "No gFloaterView->getParentFloater(this) for onPopuup()" << llendl; - }; - } - else - { - lldebugs << "No gFloaterView for onPopuup()" << llendl; - }; - LLWeb::loadURL(notification["payload"]["url"], notification["payload"]["target"], notification["payload"]["uuid"]); } else diff --git a/indra/newview/llmediactrl.h b/indra/newview/llmediactrl.h index 3c0436e27a..7f2a5e1642 100644 --- a/indra/newview/llmediactrl.h +++ b/indra/newview/llmediactrl.h @@ -51,7 +51,6 @@ public: Optional<std::string> start_url; Optional<bool> border_visible, - ignore_ui_scale, hide_loading, decouple_texture_size, trusted_content, @@ -125,9 +124,6 @@ public: bool getFrequentUpdates() { return mFrequentUpdates; }; void setFrequentUpdates( bool frequentUpdatesIn ) { mFrequentUpdates = frequentUpdatesIn; }; - void setIgnoreUIScale(bool ignore) { mIgnoreUIScale = ignore; } - bool getIgnoreUIScale() { return mIgnoreUIScale; } - void setAlwaysRefresh(bool refresh) { mAlwaysRefresh = refresh; } bool getAlwaysRefresh() { return mAlwaysRefresh; } @@ -181,28 +177,29 @@ public: const S32 mTextureDepthBytes; LLUUID mMediaTextureID; LLViewBorder* mBorder; - bool mFrequentUpdates; - bool mForceUpdate; - bool mTrusted; - std::string mHomePageUrl; - std::string mHomePageMimeType; - std::string mCurrentNavUrl; - std::string mErrorPageURL; - std::string mTarget; - bool mIgnoreUIScale; - bool mAlwaysRefresh; + bool mFrequentUpdates, + mForceUpdate, + mTrusted, + mAlwaysRefresh, + mTakeFocusOnClick, + mStretchToFill, + mMaintainAspectRatio, + mHideLoading, + mHidingInitialLoad, + mClearCache, + mHoverTextChanged, + mDecoupleTextureSize; + + std::string mHomePageUrl, + mHomePageMimeType, + mCurrentNavUrl, + mErrorPageURL, + mTarget; viewer_media_t mMediaSource; - bool mTakeFocusOnClick; - bool mStretchToFill; - bool mMaintainAspectRatio; - bool mHideLoading; - bool mHidingInitialLoad; - bool mDecoupleTextureSize; - S32 mTextureWidth; - S32 mTextureHeight; - bool mClearCache; + S32 mTextureWidth, + mTextureHeight; + class LLWindowShade* mWindowShade; - bool mHoverTextChanged; LLContextMenu* mContextMenu; }; diff --git a/indra/newview/llmenucommands.cpp b/indra/newview/llmenucommands.cpp deleted file mode 100644 index 4b7f9432e3..0000000000 --- a/indra/newview/llmenucommands.cpp +++ /dev/null @@ -1,94 +0,0 @@ -/** - * @file llmenucommands.cpp - * @brief Implementations of menu commands. - * - * $LicenseInfo:firstyear=2003&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2010, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -#include "llviewerprecompiledheaders.h" - -#include "llmenucommands.h" - -#include "imageids.h" -#include "llfloaterreg.h" -#include "llfontgl.h" -#include "llrect.h" -#include "llerror.h" -#include "llstring.h" -#include "message.h" - -#include "llagentcamera.h" -#include "llcallingcard.h" -#include "llviewercontrol.h" -//#include "llfirstuse.h" -#include "llfloaterworldmap.h" -#include "lllineeditor.h" -#include "llstatusbar.h" -#include "llimview.h" -#include "lltextbox.h" -#include "llui.h" -#include "llviewergesture.h" // for triggering gestures -#include "llviewermessage.h" -#include "llviewerparceloverlay.h" -#include "llviewerregion.h" -#include "llviewerstats.h" -#include "lluictrlfactory.h" -#include "llviewerwindow.h" -#include "llworld.h" -#include "llworldmap.h" -#include "llfocusmgr.h" -#include "llnearbychatbar.h" - -void handle_mouselook(void*) -{ - gAgentCamera.changeCameraToMouselook(); -} - - -void handle_chat(void*) -{ - // give focus to chatbar if it's open but not focused - if (gSavedSettings.getBOOL("ChatVisible") && - gFocusMgr.childHasKeyboardFocus(LLNearbyChatBar::getInstance()->getChatBox())) - { - LLNearbyChatBar::stopChat(); - } - else - { - LLNearbyChatBar::startChat(NULL); - } -} - -void handle_slash_key(void*) -{ - // LLBottomTray::startChat("/"); - // - // Don't do this, it results in a double-slash in the input field. - // Another "/" will be automatically typed for us, because the WM_KEYDOWN event - // that generated the menu accelerator call (and hence puts focus in - // the chat edtior) will be followed by a "/" WM_CHAR character message, - // which will type the slash. Yes, it's weird. It only matters for - // menu accelerators that put input focus into a field. And Mac works - // the same way. JC - - LLNearbyChatBar::startChat(NULL); -} diff --git a/indra/newview/llnavigationbar.cpp b/indra/newview/llnavigationbar.cpp index fc264db5af..2a08cb1845 100644 --- a/indra/newview/llnavigationbar.cpp +++ b/indra/newview/llnavigationbar.cpp @@ -54,7 +54,6 @@ #include "llworldmapmessage.h" #include "llappviewer.h" #include "llviewercontrol.h" -#include "llfloatermediabrowser.h" #include "llweb.h" #include "llhints.h" @@ -318,7 +317,7 @@ BOOL LLNavigationBar::postBuild() LLTeleportHistory::getInstance()->setHistoryChangedCallback( boost::bind(&LLNavigationBar::onTeleportHistoryChanged, this)); - LLHints::registerHintTarget("nav_bar", LLView::getHandle()); + LLHints::registerHintTarget("nav_bar", getHandle()); return TRUE; } diff --git a/indra/newview/llnavmeshstation.cpp b/indra/newview/llnavmeshstation.cpp index 9ae8492380..24c4979298 100644 --- a/indra/newview/llnavmeshstation.cpp +++ b/indra/newview/llnavmeshstation.cpp @@ -42,7 +42,6 @@ public: LLNavMeshUploadResponder( const LLHandle<LLNavMeshObserver>& observer_handle )
: mObserverHandle( observer_handle )
{
- LLNavMeshObserver* pObserver = mObserverHandle.get();
}
void clearPendingRequests ( void )
@@ -85,7 +84,6 @@ public: LLNavMeshDownloadResponder( const LLHandle<LLNavMeshDownloadObserver>& observer_handle )
: mObserverHandle( observer_handle )
{
- LLNavMeshDownloadObserver* pObserver = mObserverHandle.get();
}
void clearPendingRequests ( void )
diff --git a/indra/newview/llnearbychat.cpp b/indra/newview/llnearbychat.cpp index 3418462192..a7303ad035 100644 --- a/indra/newview/llnearbychat.cpp +++ b/indra/newview/llnearbychat.cpp @@ -60,13 +60,9 @@ static const S32 RESIZE_BAR_THICKNESS = 3; static LLRegisterPanelClassWrapper<LLNearbyChat> t_panel_nearby_chat("panel_nearby_chat"); -LLNearbyChat::LLNearbyChat() - : LLPanel() - ,mChatHistory(NULL) -{ -} - -LLNearbyChat::~LLNearbyChat() +LLNearbyChat::LLNearbyChat(const LLNearbyChat::Params& p) +: LLPanel(p), + mChatHistory(NULL) { } @@ -178,15 +174,20 @@ bool LLNearbyChat::onNearbyChatCheckContextMenuItem(const LLSD& userdata) return false; } +void LLNearbyChat::removeScreenChat() +{ + LLNotificationsUI::LLScreenChannelBase* chat_channel = LLNotificationsUI::LLChannelManager::getInstance()->findChannelByID(LLUUID(gSavedSettings.getString("NearByChatChannelUUID"))); + if(chat_channel) + { + chat_channel->removeToastsFromChannel(); + } +} + void LLNearbyChat::setVisible(BOOL visible) { if(visible) { - LLNotificationsUI::LLScreenChannelBase* chat_channel = LLNotificationsUI::LLChannelManager::getInstance()->findChannelByID(LLUUID(gSavedSettings.getString("NearByChatChannelUUID"))); - if(chat_channel) - { - chat_channel->removeToastsFromChannel(); - } + removeScreenChat(); } LLPanel::setVisible(visible); diff --git a/indra/newview/llnearbychat.h b/indra/newview/llnearbychat.h index 5ef584c8ff..7c5975cbc5 100644 --- a/indra/newview/llnearbychat.h +++ b/indra/newview/llnearbychat.h @@ -37,8 +37,7 @@ class LLChatHistory; class LLNearbyChat: public LLPanel { public: - LLNearbyChat(); - ~LLNearbyChat(); + LLNearbyChat(const Params& p = LLPanel::getDefaultParams()); BOOL postBuild (); @@ -63,13 +62,14 @@ public: void loadHistory(); static LLNearbyChat* getInstance(); + void removeScreenChat(); private: void getAllowedRect (LLRect& rect); void onNearbySpeakers (); - + private: LLHandle<LLView> mPopupMenuHandle; diff --git a/indra/newview/llnearbychatbar.cpp b/indra/newview/llnearbychatbar.cpp index a811332261..183063f1db 100644 --- a/indra/newview/llnearbychatbar.cpp +++ b/indra/newview/llnearbychatbar.cpp @@ -47,6 +47,7 @@ #include "llviewerwindow.h" #include "llrootview.h" #include "llviewerchat.h" +#include "llnearbychat.h" #include "llresizehandle.h" @@ -70,9 +71,14 @@ static LLChatTypeTrigger sChatTypeTriggers[] = { }; LLNearbyChatBar::LLNearbyChatBar(const LLSD& key) - : LLFloater(key), - mChatBox(NULL) -{ mSpeakerMgr = LLLocalSpeakerMgr::getInstance(); +: LLFloater(key), + mChatBox(NULL), + mNearbyChat(NULL), + mOutputMonitor(NULL), + mSpeakerMgr(NULL), + mExpandedHeight(COLLAPSED_HEIGHT + EXPANDED_HEIGHT) +{ + mSpeakerMgr = LLLocalSpeakerMgr::getInstance(); } //virtual @@ -94,6 +100,7 @@ BOOL LLNearbyChatBar::postBuild() mChatBox->setEnableLineHistory(TRUE); mChatBox->setFont(LLViewerChat::getChatFont()); + mNearbyChat = getChildView("nearby_chat"); LLUICtrl* show_btn = getChild<LLUICtrl>("show_nearby_chat"); show_btn->setCommitCallback(boost::bind(&LLNearbyChatBar::onToggleNearbyChatPanel, this)); @@ -104,8 +111,6 @@ BOOL LLNearbyChatBar::postBuild() // Register for font change notifications LLViewerChat::setFontChangedCallback(boost::bind(&LLNearbyChatBar::onChatFontChange, this, _1)); - mExpandedHeight = COLLAPSED_HEIGHT + EXPANDED_HEIGHT; - enableResizeCtrls(true, true, false); return TRUE; @@ -115,8 +120,7 @@ bool LLNearbyChatBar::applyRectControl() { bool rect_controlled = LLFloater::applyRectControl(); - LLView* nearby_chat = getChildView("nearby_chat"); - if (!nearby_chat->getVisible()) + if (!mNearbyChat->getVisible()) { reshape(getRect().getWidth(), getMinHeight()); enableResizeCtrls(true, true, false); @@ -147,12 +151,12 @@ LLNearbyChatBar* LLNearbyChatBar::getInstance() void LLNearbyChatBar::showHistory() { + openFloater(); + if (!getChildView("nearby_chat")->getVisible()) { onToggleNearbyChatPanel(); } - - openFloater(); } void LLNearbyChatBar::draw() @@ -379,7 +383,10 @@ void LLNearbyChatBar::onToggleNearbyChatPanel() if (nearby_chat->getVisible()) { - mExpandedHeight = getRect().getHeight(); + if (!isMinimized()) + { + mExpandedHeight = getRect().getHeight(); + } setResizeLimits(getMinWidth(), COLLAPSED_HEIGHT); nearby_chat->setVisible(FALSE); reshape(getRect().getWidth(), COLLAPSED_HEIGHT); @@ -396,6 +403,17 @@ void LLNearbyChatBar::onToggleNearbyChatPanel() } } +void LLNearbyChatBar::setMinimized(BOOL b) +{ + LLNearbyChat* nearby_chat = getChild<LLNearbyChat>("nearby_chat"); + // when unminimizing with nearby chat visible, go ahead and kill off screen chats + if (!b && nearby_chat->getVisible()) + { + nearby_chat->removeScreenChat(); + } + LLFloater::setMinimized(b); +} + void LLNearbyChatBar::onChatBoxCommit() { if (mChatBox->getText().length() > 0) diff --git a/indra/newview/llnearbychatbar.h b/indra/newview/llnearbychatbar.h index bc00c1b9fc..c2f57dc4ca 100644 --- a/indra/newview/llnearbychatbar.h +++ b/indra/newview/llnearbychatbar.h @@ -60,6 +60,7 @@ public: static void sendChatFromViewer(const LLWString &wtext, EChatType type, BOOL animate); void showHistory(); + /*virtual*/void setMinimized(BOOL b); protected: static BOOL matchChatTypeTrigger(const std::string& in_str, std::string* out_str); @@ -83,9 +84,10 @@ protected: // Which non-zero channel did we last chat on? static S32 sLastSpecialChatChannel; - LLLineEditor* mChatBox; - LLOutputMonitorCtrl* mOutputMonitor; - LLLocalSpeakerMgr* mSpeakerMgr; + LLLineEditor* mChatBox; + LLView* mNearbyChat; + LLOutputMonitorCtrl* mOutputMonitor; + LLLocalSpeakerMgr* mSpeakerMgr; S32 mExpandedHeight; }; diff --git a/indra/newview/llnearbychathandler.cpp b/indra/newview/llnearbychathandler.cpp index 330a21ef65..240a7c7a35 100644 --- a/indra/newview/llnearbychathandler.cpp +++ b/indra/newview/llnearbychathandler.cpp @@ -63,7 +63,8 @@ public: typedef std::vector<LLHandle<LLToast> > toast_vec_t; typedef std::list<LLHandle<LLToast> > toast_list_t; - LLNearbyChatScreenChannel(const Params& p):LLScreenChannelBase(p) + LLNearbyChatScreenChannel(const Params& p) + : LLScreenChannelBase(p) { mStopProcessing = false; @@ -365,12 +366,15 @@ void LLNearbyChatScreenChannel::arrangeToasts() if(mStopProcessing || isHovering()) return; - LLView* floater_snap_region = gViewerWindow->getRootView()->getChildView("floater_snap_region"); - + if (mFloaterSnapRegion == NULL) + { + mFloaterSnapRegion = gViewerWindow->getRootView()->getChildView("floater_snap_region"); + } + if (!getParent()) { // connect to floater snap region just to get resize events, we don't care about being a proper widget - floater_snap_region->addChild(this); + mFloaterSnapRegion->addChild(this); setFollows(FOLLOWS_ALL); } @@ -378,13 +382,13 @@ void LLNearbyChatScreenChannel::arrangeToasts() updateRect(); LLRect channel_rect; - floater_snap_region->localRectToOtherView(floater_snap_region->getLocalRect(), &channel_rect, gFloaterView); + mFloaterSnapRegion->localRectToOtherView(mFloaterSnapRegion->getLocalRect(), &channel_rect, gFloaterView); channel_rect.mLeft += 10; channel_rect.mRight = channel_rect.mLeft + 300; S32 channel_bottom = channel_rect.mBottom; - S32 bottom = channel_bottom + 10; + S32 bottom = channel_bottom + 80; S32 margin = gSavedSettings.getS32("ToastGap"); //sort active toasts @@ -470,7 +474,7 @@ void LLNearbyChatHandler::initChannel() -void LLNearbyChatHandler::processChat(const LLChat& chat_msg, // WARNING - not really const, see hack below changing chat_msg.mText +void LLNearbyChatHandler::processChat(const LLChat& chat_msg, const LLSD &args) { if(chat_msg.mMuted == TRUE) @@ -479,28 +483,10 @@ void LLNearbyChatHandler::processChat(const LLChat& chat_msg, // WARNING - not if(chat_msg.mText.empty()) return;//don't process empty messages - // Handle irc styled messages for toast panel - // HACK ALERT - changes mText, stripping out IRC style "/me" prefixes - LLChat& tmp_chat = const_cast<LLChat&>(chat_msg); - std::string original_message = tmp_chat.mText; // Save un-modified version of chat text - if (tmp_chat.mChatStyle == CHAT_STYLE_IRC) - { - if(!tmp_chat.mFromName.empty()) - tmp_chat.mText = tmp_chat.mFromName + tmp_chat.mText.substr(3); - else - tmp_chat.mText = tmp_chat.mText.substr(3); - } - LLFloater* chat_bar = LLFloaterReg::getInstance("chat_bar"); LLNearbyChat* nearby_chat = chat_bar->findChild<LLNearbyChat>("nearby_chat"); - { - //sometimes its usefull to have no name at all... - //if(tmp_chat.mFromName.empty() && tmp_chat.mFromID!= LLUUID::null) - // tmp_chat.mFromName = tmp_chat.mFromID.asString(); - } - // Build notification data LLSD notification; notification["message"] = chat_msg.mText; @@ -543,7 +529,7 @@ void LLNearbyChatHandler::processChat(const LLChat& chat_msg, // WARNING - not LLViewerChat::getChatColor(chat_msg,txt_color); - LLFloaterScriptDebug::addScriptLine(original_message, // Send full message with "/me" style prefix + LLFloaterScriptDebug::addScriptLine(chat_msg.mText, chat_msg.mFromName, txt_color, chat_msg.mFromID); @@ -568,7 +554,8 @@ void LLNearbyChatHandler::processChat(const LLChat& chat_msg, // WARNING - not sChatWatcher->post(notification); - if( chat_bar->getVisible() && nearby_chat->getVisible() + if( !chat_bar->isMinimized() + && nearby_chat->isInVisibleChain() || ( chat_msg.mSourceType == CHAT_SOURCE_AGENT && gSavedSettings.getBOOL("UseChatBubbles") ) || !mChannel->getShowToasts() ) // to prevent toasts in Busy mode @@ -596,6 +583,21 @@ void LLNearbyChatHandler::processChat(const LLChat& chat_msg, // WARNING - not if(channel) { + // Handle IRC styled messages. + std::string toast_msg; + if (chat_msg.mChatStyle == CHAT_STYLE_IRC) + { + if (!chat_msg.mFromName.empty()) + { + toast_msg += chat_msg.mFromName; + } + toast_msg += chat_msg.mText.substr(3); + } + else + { + toast_msg = chat_msg.mText; + } + // Add a nearby chat toast. LLUUID id; id.generate(); @@ -607,6 +609,7 @@ void LLNearbyChatHandler::processChat(const LLChat& chat_msg, // WARNING - not notification["text_color"] = r_color_name; notification["color_alpha"] = r_color_alpha; notification["font_size"] = (S32)LLViewerChat::getChatFontSize() ; + notification["message"] = toast_msg; channel->addNotification(notification); } } diff --git a/indra/newview/llnetmap.cpp b/indra/newview/llnetmap.cpp index 5fe5c9b1e8..15d5d7c162 100644 --- a/indra/newview/llnetmap.cpp +++ b/indra/newview/llnetmap.cpp @@ -172,10 +172,10 @@ void LLNetMap::draw() LLVector3 offset = gGL.getUITranslation(); LLVector3 scale = gGL.getUIScale(); - glLoadIdentity(); + gGL.loadIdentity(); gGL.loadUIIdentity(); - glScalef(scale.mV[0], scale.mV[1], scale.mV[2]); + gGL.scalef(scale.mV[0], scale.mV[1], scale.mV[2]); gGL.translatef(offset.mV[0], offset.mV[1], offset.mV[2]); { @@ -183,7 +183,7 @@ void LLNetMap::draw() { gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); - glMatrixMode(GL_MODELVIEW); + gGL.matrixMode(LLRender::MM_MODELVIEW); // Draw background rectangle LLColor4 background_color = mBackgroundColor.get(); @@ -204,7 +204,7 @@ void LLNetMap::draw() { // rotate subsequent draws to agent rotation rotation = atan2( LLViewerCamera::getInstance()->getAtAxis().mV[VX], LLViewerCamera::getInstance()->getAtAxis().mV[VY] ); - glRotatef( rotation * RAD_TO_DEG, 0.f, 0.f, 1.f); + gGL.rotatef( rotation * RAD_TO_DEG, 0.f, 0.f, 1.f); } // figure out where agent is @@ -492,7 +492,7 @@ void LLNetMap::draw() // If we don't rotate the map, we have to rotate the frustum. gGL.pushMatrix(); gGL.translatef( ctr_x, ctr_y, 0 ); - glRotatef( atan2( LLViewerCamera::getInstance()->getAtAxis().mV[VX], LLViewerCamera::getInstance()->getAtAxis().mV[VY] ) * RAD_TO_DEG, 0.f, 0.f, -1.f); + gGL.rotatef( atan2( LLViewerCamera::getInstance()->getAtAxis().mV[VX], LLViewerCamera::getInstance()->getAtAxis().mV[VY] ) * RAD_TO_DEG, 0.f, 0.f, -1.f); gGL.begin( LLRender::TRIANGLES ); gGL.vertex2f( 0, 0 ); gGL.vertex2f( -half_width_pixels, far_clip_pixels ); diff --git a/indra/newview/llnotificationtiphandler.cpp b/indra/newview/llnotificationtiphandler.cpp index 2a08a29842..fb0891c4c5 100644 --- a/indra/newview/llnotificationtiphandler.cpp +++ b/indra/newview/llnotificationtiphandler.cpp @@ -29,6 +29,7 @@ #include "llfloaterreg.h" #include "llnearbychat.h" +#include "llnearbychatbar.h" #include "llnotificationhandler.h" #include "llnotifications.h" #include "lltoastnotifypanel.h" @@ -93,7 +94,8 @@ bool LLTipHandler::processNotification(const LLSD& notify) // don't show toast if Nearby Chat is opened LLNearbyChat* nearby_chat = LLNearbyChat::getInstance(); - if (nearby_chat->getVisible()) + LLNearbyChatBar* nearby_chat_bar = LLNearbyChatBar::getInstance(); + if (!nearby_chat_bar->isMinimized() && nearby_chat_bar->getVisible() && nearby_chat->getVisible()) { return false; } diff --git a/indra/newview/lloverlaybar.cpp b/indra/newview/lloverlaybar.cpp deleted file mode 100644 index c2bbec0470..0000000000 --- a/indra/newview/lloverlaybar.cpp +++ /dev/null @@ -1,378 +0,0 @@ -/** - * @file lloverlaybar.cpp - * @brief LLOverlayBar class implementation - * - * $LicenseInfo:firstyear=2002&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2010, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -// Temporary buttons that appear at the bottom of the screen when you -// are in a mode. - -#include "llviewerprecompiledheaders.h" - -#include "lloverlaybar.h" - -#include "llaudioengine.h" -#include "llrender.h" -#include "llagent.h" -#include "llbutton.h" -#include "llfocusmgr.h" -#include "llimview.h" -#include "llmediaremotectrl.h" -#include "llparcel.h" -#include "lltextbox.h" -#include "llui.h" -#include "llviewercontrol.h" -#include "llviewertexturelist.h" -#include "llviewerjoystick.h" -#include "llviewermedia.h" -#include "llviewermenu.h" // handle_reset_view() -#include "llviewermedia.h" -#include "llviewerparcelmedia.h" -#include "llviewerparcelmgr.h" -#include "lluictrlfactory.h" -#include "llviewerwindow.h" -#include "llvoiceclient.h" -#include "llvoavatarself.h" -#include "llvoiceremotectrl.h" -#include "llmediactrl.h" -#include "llselectmgr.h" - -// -// Globals -// - -LLOverlayBar *gOverlayBar = NULL; - -extern S32 MENU_BAR_HEIGHT; - -// -// Functions -// - - - -void* LLOverlayBar::createMediaRemote(void* userdata) -{ - LLOverlayBar *self = (LLOverlayBar*)userdata; - self->mMediaRemote = new LLMediaRemoteCtrl (); - return self->mMediaRemote; -} - -void* LLOverlayBar::createVoiceRemote(void* userdata) -{ - LLOverlayBar *self = (LLOverlayBar*)userdata; - self->mVoiceRemote = new LLVoiceRemoteCtrl(); - return self->mVoiceRemote; -} - -LLOverlayBar::LLOverlayBar() - : LLPanel(), - mMediaRemote(NULL), - mVoiceRemote(NULL), - mMusicState(STOPPED) -{ - setMouseOpaque(FALSE); - setIsChrome(TRUE); - - mBuilt = false; - - mFactoryMap["media_remote"] = LLCallbackMap(LLOverlayBar::createMediaRemote, this); - mFactoryMap["voice_remote"] = LLCallbackMap(LLOverlayBar::createVoiceRemote, this); - - LLUICtrlFactory::getInstance()->buildPanel(this, "panel_overlaybar.xml"); -} - -BOOL LLOverlayBar::postBuild() -{ - childSetAction("Set Not Busy",onClickSetNotBusy,this); - childSetAction("Mouselook",onClickMouselook,this); - childSetAction("Stand Up",onClickStandUp,this); - childSetAction("Flycam",onClickFlycam,this); - childSetVisible("chat_bar", gSavedSettings.getBOOL("ChatVisible")); - - mVoiceRemote->expandOrCollapse(); - mMediaRemote->expandOrCollapse(); - - setFocusRoot(TRUE); - mBuilt = true; - - layoutButtons(); - return TRUE; -} - -LLOverlayBar::~LLOverlayBar() -{ - // LLView destructor cleans up children -} - -// virtual -void LLOverlayBar::reshape(S32 width, S32 height, BOOL called_from_parent) -{ - LLView::reshape(width, height, called_from_parent); - - if (mBuilt) - { - layoutButtons(); - } -} - -void LLOverlayBar::layoutButtons() -{ - LLView* state_buttons_panel = getChildView("state_buttons"); - - if (state_buttons_panel->getVisible()) - { - LLViewQuery query; - LLWidgetTypeFilter<LLButton> widget_filter; - query.addPreFilter(LLEnabledFilter::getInstance()); - query.addPreFilter(&widget_filter); - - child_list_t button_list = query(state_buttons_panel); - - const S32 MAX_BAR_WIDTH = 600; - S32 bar_width = llclamp(state_buttons_panel->getRect().getWidth(), 0, MAX_BAR_WIDTH); - - // calculate button widths - const S32 MAX_BUTTON_WIDTH = 150; - const S32 STATUS_BAR_PAD = 10; - S32 segment_width = llclamp(lltrunc((F32)(bar_width) / (F32)button_list.size()), 0, MAX_BUTTON_WIDTH); - S32 btn_width = segment_width - STATUS_BAR_PAD; - - // Evenly space all buttons, starting from left - S32 left = 0; - S32 bottom = 1; - - for (child_list_reverse_iter_t child_iter = button_list.rbegin(); - child_iter != button_list.rend(); ++child_iter) - { - LLView *view = *child_iter; - LLRect r = view->getRect(); - r.setOriginAndSize(left, bottom, btn_width, r.getHeight()); - view->setRect(r); - left += segment_width; - } - } -} - -// Per-frame updates of visibility -void LLOverlayBar::refresh() -{ - BOOL buttons_changed = FALSE; - - BOOL im_received = gIMMgr->getIMReceived(); - LLButton* button = getChild<LLButton>("IM Received"); - if (button && button->getVisible() != im_received) - { - button->setVisible(im_received); - sendChildToFront(button); - moveChildToBackOfTabGroup(button); - buttons_changed = TRUE; - } - - BOOL busy = gAgent.getBusy(); - button = getChild<LLButton>("Set Not Busy"); - if (button && button->getVisible() != busy) - { - button->setVisible(busy); - sendChildToFront(button); - moveChildToBackOfTabGroup(button); - buttons_changed = TRUE; - } - - BOOL flycam = LLViewerJoystick::getInstance()->getOverrideCamera(); - button = getChild<LLButton>("Flycam"); - if (button && button->getVisible() != flycam) - { - button->setVisible(flycam); - sendChildToFront(button); - moveChildToBackOfTabGroup(button); - buttons_changed = TRUE; - } - - BOOL mouselook_grabbed; - mouselook_grabbed = gAgent.isControlGrabbed(CONTROL_ML_LBUTTON_DOWN_INDEX) - || gAgent.isControlGrabbed(CONTROL_ML_LBUTTON_UP_INDEX); - button = getChild<LLButton>("Mouselook"); - - if (button && button->getVisible() != mouselook_grabbed) - { - button->setVisible(mouselook_grabbed); - sendChildToFront(button); - moveChildToBackOfTabGroup(button); - buttons_changed = TRUE; - } - - BOOL sitting = FALSE; - if (gAgent.getAvatarObject()) - { - sitting = gAgent.getAvatarObject()->isSitting(); - } - button = getChild<LLButton>("Stand Up"); - - if (button && button->getVisible() != sitting) - { - button->setVisible(sitting); - sendChildToFront(button); - moveChildToBackOfTabGroup(button); - buttons_changed = TRUE; - } - - - moveChildToBackOfTabGroup(mMediaRemote); - moveChildToBackOfTabGroup(mVoiceRemote); - - // turn off the whole bar in mouselook - if (gAgent.cameraMouselook()) - { - childSetVisible("media_remote_container", FALSE); - childSetVisible("voice_remote_container", FALSE); - childSetVisible("state_buttons", FALSE); - } - else - { - // update "remotes" - childSetVisible("media_remote_container", TRUE); - childSetVisible("voice_remote_container", LLVoiceClient::getInstance()->voiceEnabled()); - childSetVisible("state_buttons", TRUE); - } - - // always let user toggle into and out of chatbar - childSetVisible("chat_bar", gSavedSettings.getBOOL("ChatVisible")); - - if (buttons_changed) - { - layoutButtons(); - } -} - -//----------------------------------------------------------------------- -// Static functions -//----------------------------------------------------------------------- - -// static -void LLOverlayBar::onClickSetNotBusy(void*) -{ - gAgent.clearBusy(); -} - - -// static -void LLOverlayBar::onClickFlycam(void*) -{ - LLViewerJoystick::getInstance()->toggleFlycam(); -} - -// static -void LLOverlayBar::onClickResetView(void* data) -{ - handle_reset_view(); -} - -//static -void LLOverlayBar::onClickMouselook(void*) -{ - gAgent.changeCameraToMouselook(); -} - -//static -void LLOverlayBar::onClickStandUp(void*) -{ - LLSelectMgr::getInstance()->deselectAllForStandingUp(); - gAgent.setControlFlags(AGENT_CONTROL_STAND_UP); -} - -//////////////////////////////////////////////////////////////////////////////// -// static media helpers -// *TODO: Move this into an audio manager abstraction -//static -void LLOverlayBar::mediaStop(void*) -{ - if (!gOverlayBar) - { - // return; - } - LLViewerParcelMedia::stop(); -} -//static -void LLOverlayBar::toggleMediaPlay(void*) -{ - if (!gOverlayBar) - { - // return; - } - - - if (LLViewerParcelMedia::getStatus() == LLViewerMediaImpl::MEDIA_PAUSED) - { - LLViewerParcelMedia::start(); - } - else if(LLViewerParcelMedia::getStatus() == LLViewerMediaImpl::MEDIA_PLAYING) - { - LLViewerParcelMedia::pause(); - } - else - { - LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); - if (parcel) - { - LLViewerParcelMedia::play(parcel); - } - } -} - -//static -void LLOverlayBar::toggleMusicPlay(void*) -{ - if (gAudiop->isInternetStreamPlaying() != 1) - { - if (gAudiop) - { - LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); - if ( parcel ) - { - // this doesn't work properly when crossing parcel boundaries - even when the - // stream is stopped, it doesn't return the right thing - commenting out for now. - // if ( gAudiop->isInternetStreamPlaying() == 0 ) - { - gAudiop->startInternetStream(parcel->getMusicURL()); - } - } - } - } - //else - //{ - // gOverlayBar->mMusicState = PAUSED; // desired state - // if (gAudiop) - // { - // gAudiop->pauseInternetStream(1); - // } - //} - else - { - if (gAudiop) - { - gAudiop->stopInternetStream(); - } - } -} - diff --git a/indra/newview/lloverlaybar.h b/indra/newview/lloverlaybar.h deleted file mode 100644 index b36f5ebb73..0000000000 --- a/indra/newview/lloverlaybar.h +++ /dev/null @@ -1,95 +0,0 @@ -/** - * @file lloverlaybar.h - * @brief LLOverlayBar class definition - * - * $LicenseInfo:firstyear=2002&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2010, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -#ifndef LL_LLOVERLAYBAR_H -#define LL_LLOVERLAYBAR_H - -#include "llpanel.h" - -// "Constants" loaded from settings.xml at start time -extern S32 STATUS_BAR_HEIGHT; - -class LLButton; -class LLLineEditor; -class LLMediaRemoteCtrl; -class LLMessageSystem; -class LLTextBox; -class LLTextEditor; -class LLUICtrl; -class LLUUID; -class LLFrameTimer; -class LLStatGraph; -class LLSlider; -class LLVoiceRemoteCtrl; - -class LLOverlayBar -: public LLPanel -{ -public: - LLOverlayBar(); - ~LLOverlayBar(); - - /*virtual*/ void refresh(); - /*virtual*/ void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE); - /*virtual*/ BOOL postBuild(); - - void layoutButtons(); - - // helpers for returning desired state - BOOL musicPlaying() { return mMusicState == PLAYING; } - - static void onClickSetNotBusy(void* data); - static void onClickMouselook(void* data); - static void onClickStandUp(void* data); - static void onClickResetView(void* data); - static void onClickFlycam(void* data); - - //static media helper functions - static void toggleMediaPlay(void*); - static void toggleMusicPlay(void*); - static void musicPause(void*); - static void musicStop(void*); - static void mediaStop(void*); - - static void toggleAudioVolumeFloater(void*); - -protected: - static void* createMediaRemote(void* userdata); - static void* createVoiceRemote(void* userdata); - - void enableMediaButtons(); - -protected: - LLMediaRemoteCtrl* mMediaRemote; - LLVoiceRemoteCtrl* mVoiceRemote; - bool mBuilt; // dialog constructed yet? - enum { STOPPED=0, PLAYING=1, PAUSED=2 }; - S32 mMusicState; -}; - -extern LLOverlayBar* gOverlayBar; - -#endif diff --git a/indra/newview/llpanelavatar.cpp b/indra/newview/llpanelavatar.cpp index 988e801b61..679b1bdcda 100644 --- a/indra/newview/llpanelavatar.cpp +++ b/indra/newview/llpanelavatar.cpp @@ -120,269 +120,6 @@ BOOL LLDropTarget::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, static LLDefaultChildRegistry::Register<LLDropTarget> r("drop_target"); -static LLRegisterPanelClassWrapper<LLPanelAvatarProfile> t_panel_profile("panel_profile"); -static LLRegisterPanelClassWrapper<LLPanelMyProfile> t_panel_my_profile("panel_my_profile"); -static LLRegisterPanelClassWrapper<LLPanelAvatarNotes> t_panel_notes("panel_notes"); - -//----------------------------------------------------------------------------- -// LLPanelAvatarNotes() -//----------------------------------------------------------------------------- -LLPanelAvatarNotes::LLPanelAvatarNotes() -: LLPanelProfileTab() -{ - -} - -void LLPanelAvatarNotes::updateData() -{ - LLAvatarPropertiesProcessor::getInstance()-> - sendAvatarNotesRequest(getAvatarId()); -} - -BOOL LLPanelAvatarNotes::postBuild() -{ - childSetCommitCallback("status_check", boost::bind(&LLPanelAvatarNotes::onCommitRights, this), NULL); - childSetCommitCallback("map_check", boost::bind(&LLPanelAvatarNotes::onCommitRights, this), NULL); - childSetCommitCallback("objects_check", boost::bind(&LLPanelAvatarNotes::onCommitRights, this), NULL); - - childSetCommitCallback("add_friend", boost::bind(&LLPanelAvatarNotes::onAddFriendButtonClick, this),NULL); - childSetCommitCallback("im", boost::bind(&LLPanelAvatarNotes::onIMButtonClick, this), NULL); - childSetCommitCallback("call", boost::bind(&LLPanelAvatarNotes::onCallButtonClick, this), NULL); - childSetCommitCallback("teleport", boost::bind(&LLPanelAvatarNotes::onTeleportButtonClick, this), NULL); - childSetCommitCallback("share", boost::bind(&LLPanelAvatarNotes::onShareButtonClick, this), NULL); - childSetCommitCallback("show_on_map_btn", (boost::bind( - &LLPanelAvatarNotes::onMapButtonClick, this)), NULL); - - LLTextEditor* te = getChild<LLTextEditor>("notes_edit"); - te->setCommitCallback(boost::bind(&LLPanelAvatarNotes::onCommitNotes,this)); - te->setCommitOnFocusLost(TRUE); - - resetControls(); - resetData(); - - LLVoiceClient::getInstance()->addObserver((LLVoiceClientStatusObserver*)this); - - return TRUE; -} - -void LLPanelAvatarNotes::onOpen(const LLSD& key) -{ - LLPanelProfileTab::onOpen(key); - - fillRightsData(); - - //Disable "Add Friend" button for friends. - getChildView("add_friend")->setEnabled(!LLAvatarActions::isFriend(getAvatarId())); -} - -void LLPanelAvatarNotes::fillRightsData() -{ - getChild<LLUICtrl>("status_check")->setValue(FALSE); - getChild<LLUICtrl>("map_check")->setValue(FALSE); - getChild<LLUICtrl>("objects_check")->setValue(FALSE); - - const LLRelationship* relation = LLAvatarTracker::instance().getBuddyInfo(getAvatarId()); - // If true - we are viewing friend's profile, enable check boxes and set values. - if(relation) - { - S32 rights = relation->getRightsGrantedTo(); - - getChild<LLUICtrl>("status_check")->setValue(LLRelationship::GRANT_ONLINE_STATUS & rights ? TRUE : FALSE); - getChild<LLUICtrl>("map_check")->setValue(LLRelationship::GRANT_MAP_LOCATION & rights ? TRUE : FALSE); - getChild<LLUICtrl>("objects_check")->setValue(LLRelationship::GRANT_MODIFY_OBJECTS & rights ? TRUE : FALSE); - - } - - enableCheckboxes(NULL != relation); -} - -void LLPanelAvatarNotes::onCommitNotes() -{ - std::string notes = getChild<LLUICtrl>("notes_edit")->getValue().asString(); - LLAvatarPropertiesProcessor::getInstance()-> sendNotes(getAvatarId(),notes); -} - -void LLPanelAvatarNotes::rightsConfirmationCallback(const LLSD& notification, - const LLSD& response, S32 rights) -{ - S32 option = LLNotificationsUtil::getSelectedOption(notification, response); - if (option == 0) - { - LLAvatarPropertiesProcessor::getInstance()->sendFriendRights( - getAvatarId(), rights); - } - else - { - getChild<LLUICtrl>("objects_check")->setValue( - getChild<LLUICtrl>("objects_check")->getValue().asBoolean() ? FALSE : TRUE); - } -} - -void LLPanelAvatarNotes::confirmModifyRights(bool grant, S32 rights) -{ - LLSD args; - args["NAME"] = LLSLURL("agent", getAvatarId(), "displayname").getSLURLString(); - - if (grant) - { - LLNotificationsUtil::add("GrantModifyRights", args, LLSD(), - boost::bind(&LLPanelAvatarNotes::rightsConfirmationCallback, this, - _1, _2, rights)); - } - else - { - LLNotificationsUtil::add("RevokeModifyRights", args, LLSD(), - boost::bind(&LLPanelAvatarNotes::rightsConfirmationCallback, this, - _1, _2, rights)); - } -} - -void LLPanelAvatarNotes::onCommitRights() -{ - const LLRelationship* buddy_relationship = - LLAvatarTracker::instance().getBuddyInfo(getAvatarId()); - - if (NULL == buddy_relationship) - { - // Lets have a warning log message instead of having a crash. EXT-4947. - llwarns << "Trying to modify rights for non-friend avatar. Skipped." << llendl; - return; - } - - - S32 rights = 0; - - if(getChild<LLUICtrl>("status_check")->getValue().asBoolean()) - rights |= LLRelationship::GRANT_ONLINE_STATUS; - if(getChild<LLUICtrl>("map_check")->getValue().asBoolean()) - rights |= LLRelationship::GRANT_MAP_LOCATION; - if(getChild<LLUICtrl>("objects_check")->getValue().asBoolean()) - rights |= LLRelationship::GRANT_MODIFY_OBJECTS; - - bool allow_modify_objects = getChild<LLUICtrl>("objects_check")->getValue().asBoolean(); - - // if modify objects checkbox clicked - if (buddy_relationship->isRightGrantedTo( - LLRelationship::GRANT_MODIFY_OBJECTS) != allow_modify_objects) - { - confirmModifyRights(allow_modify_objects, rights); - } - // only one checkbox can trigger commit, so store the rest of rights - else - { - LLAvatarPropertiesProcessor::getInstance()->sendFriendRights( - getAvatarId(), rights); - } -} - -void LLPanelAvatarNotes::processProperties(void* data, EAvatarProcessorType type) -{ - if(APT_NOTES == type) - { - LLAvatarNotes* avatar_notes = static_cast<LLAvatarNotes*>(data); - if(avatar_notes && getAvatarId() == avatar_notes->target_id) - { - getChild<LLUICtrl>("notes_edit")->setValue(avatar_notes->notes); - getChildView("notes edit")->setEnabled(true); - - LLAvatarPropertiesProcessor::getInstance()->removeObserver(getAvatarId(),this); - } - } -} - -void LLPanelAvatarNotes::resetData() -{ - getChild<LLUICtrl>("notes_edit")->setValue(LLStringUtil::null); - // Default value is TRUE - getChild<LLUICtrl>("status_check")->setValue(TRUE); -} - -void LLPanelAvatarNotes::resetControls() -{ - //Disable "Add Friend" button for friends. - getChildView("add_friend")->setEnabled(TRUE); - - enableCheckboxes(false); -} - -void LLPanelAvatarNotes::onAddFriendButtonClick() -{ - LLAvatarActions::requestFriendshipDialog(getAvatarId()); -} - -void LLPanelAvatarNotes::onIMButtonClick() -{ - LLAvatarActions::startIM(getAvatarId()); -} - -void LLPanelAvatarNotes::onTeleportButtonClick() -{ - LLAvatarActions::offerTeleport(getAvatarId()); -} - -void LLPanelAvatarNotes::onCallButtonClick() -{ - LLAvatarActions::startCall(getAvatarId()); -} - -void LLPanelAvatarNotes::onShareButtonClick() -{ - //*TODO not implemented. -} - -void LLPanelAvatarNotes::enableCheckboxes(bool enable) -{ - getChildView("status_check")->setEnabled(enable); - getChildView("map_check")->setEnabled(enable); - getChildView("objects_check")->setEnabled(enable); -} - -LLPanelAvatarNotes::~LLPanelAvatarNotes() -{ - if(getAvatarId().notNull()) - { - LLAvatarTracker::instance().removeParticularFriendObserver(getAvatarId(), this); - } - - if(LLVoiceClient::instanceExists()) - { - LLVoiceClient::getInstance()->removeObserver((LLVoiceClientStatusObserver*)this); - } -} - -// virtual, called by LLAvatarTracker -void LLPanelAvatarNotes::changed(U32 mask) -{ - getChildView("teleport")->setEnabled(LLAvatarTracker::instance().isBuddyOnline(getAvatarId())); - - // update rights to avoid have checkboxes enabled when friendship is terminated. EXT-4947. - fillRightsData(); -} - -// virtual -void LLPanelAvatarNotes::onChange(EStatusType status, const std::string &channelURI, bool proximal) -{ - if(status == STATUS_JOINING || status == STATUS_LEFT_CHANNEL) - { - return; - } - - getChildView("call")->setEnabled(LLVoiceClient::getInstance()->voiceEnabled() && LLVoiceClient::getInstance()->isVoiceWorking()); -} - -void LLPanelAvatarNotes::setAvatarId(const LLUUID& id) -{ - if(id.notNull()) - { - if(getAvatarId().notNull()) - { - LLAvatarTracker::instance().removeParticularFriendObserver(getAvatarId(), this); - } - LLPanelProfileTab::setAvatarId(id); - LLAvatarTracker::instance().addParticularFriendObserver(getAvatarId(), this); - } -} - ////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////// @@ -461,449 +198,3 @@ void LLPanelProfileTab::updateButtons() || gAgent.isGodlike(); getChildView("show_on_map_btn")->setEnabled(enable_map_btn); } - -////////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////// - -bool enable_god() -{ - return gAgent.isGodlike(); -} - -LLPanelAvatarProfile::LLPanelAvatarProfile() -: LLPanelProfileTab() -{ -} - -BOOL LLPanelAvatarProfile::postBuild() -{ - childSetCommitCallback("see_profile_btn",(boost::bind(&LLPanelAvatarProfile::onSeeProfileBtnClick,this)),NULL); - childSetCommitCallback("add_friend",(boost::bind(&LLPanelAvatarProfile::onAddFriendButtonClick,this)),NULL); - childSetCommitCallback("im",(boost::bind(&LLPanelAvatarProfile::onIMButtonClick,this)),NULL); - childSetCommitCallback("call",(boost::bind(&LLPanelAvatarProfile::onCallButtonClick,this)),NULL); - childSetCommitCallback("teleport",(boost::bind(&LLPanelAvatarProfile::onTeleportButtonClick,this)),NULL); - childSetCommitCallback("share",(boost::bind(&LLPanelAvatarProfile::onShareButtonClick,this)),NULL); - childSetCommitCallback("show_on_map_btn", (boost::bind( - &LLPanelAvatarProfile::onMapButtonClick, this)), NULL); - - LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar; - registrar.add("Profile.ShowOnMap", boost::bind(&LLPanelAvatarProfile::onMapButtonClick, this)); - registrar.add("Profile.Pay", boost::bind(&LLPanelAvatarProfile::pay, this)); - registrar.add("Profile.Share", boost::bind(&LLPanelAvatarProfile::share, this)); - registrar.add("Profile.BlockUnblock", boost::bind(&LLPanelAvatarProfile::toggleBlock, this)); - registrar.add("Profile.Kick", boost::bind(&LLPanelAvatarProfile::kick, this)); - registrar.add("Profile.Freeze", boost::bind(&LLPanelAvatarProfile::freeze, this)); - registrar.add("Profile.Unfreeze", boost::bind(&LLPanelAvatarProfile::unfreeze, this)); - registrar.add("Profile.CSR", boost::bind(&LLPanelAvatarProfile::csr, this)); - - LLUICtrl::EnableCallbackRegistry::ScopedRegistrar enable; - enable.add("Profile.EnableShowOnMap", boost::bind(&LLPanelAvatarProfile::enableShowOnMap, this)); - enable.add("Profile.EnableGod", boost::bind(&enable_god)); - enable.add("Profile.EnableBlock", boost::bind(&LLPanelAvatarProfile::enableBlock, this)); - enable.add("Profile.EnableUnblock", boost::bind(&LLPanelAvatarProfile::enableUnblock, this)); - - LLToggleableMenu* profile_menu = LLUICtrlFactory::getInstance()->createFromFile<LLToggleableMenu>("menu_profile_overflow.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance()); - getChild<LLMenuButton>("overflow_btn")->setMenu(profile_menu, LLMenuButton::MP_TOP_RIGHT); - - LLVoiceClient::getInstance()->addObserver((LLVoiceClientStatusObserver*)this); - - resetControls(); - resetData(); - - return TRUE; -} - -void LLPanelAvatarProfile::onOpen(const LLSD& key) -{ - LLPanelProfileTab::onOpen(key); - - mGroups.clear(); - - //Disable "Add Friend" button for friends. - getChildView("add_friend")->setEnabled(!LLAvatarActions::isFriend(getAvatarId())); -} - -void LLPanelAvatarProfile::updateData() -{ - if (getAvatarId().notNull()) - { - LLAvatarPropertiesProcessor::getInstance()-> - sendAvatarPropertiesRequest(getAvatarId()); - LLAvatarPropertiesProcessor::getInstance()-> - sendAvatarGroupsRequest(getAvatarId()); - } -} - -void LLPanelAvatarProfile::resetControls() -{ - getChildView("status_panel")->setVisible( true); - getChildView("profile_buttons_panel")->setVisible( true); - getChildView("title_groups_text")->setVisible( true); - getChildView("sl_groups")->setVisible( true); - getChildView("add_friend")->setEnabled(true); - - getChildView("status_me_panel")->setVisible( false); - getChildView("profile_me_buttons_panel")->setVisible( false); - getChildView("account_actions_panel")->setVisible( false); -} - -void LLPanelAvatarProfile::resetData() -{ - mGroups.clear(); - getChild<LLUICtrl>("2nd_life_pic")->setValue(LLUUID::null); - getChild<LLUICtrl>("real_world_pic")->setValue(LLUUID::null); - getChild<LLUICtrl>("online_status")->setValue(LLStringUtil::null); - getChild<LLUICtrl>("status_message")->setValue(LLStringUtil::null); - getChild<LLUICtrl>("sl_description_edit")->setValue(LLStringUtil::null); - getChild<LLUICtrl>("fl_description_edit")->setValue(LLStringUtil::null); - getChild<LLUICtrl>("sl_groups")->setValue(LLStringUtil::null); - getChild<LLUICtrl>("homepage_edit")->setValue(LLStringUtil::null); - getChild<LLUICtrl>("register_date")->setValue(LLStringUtil::null); - getChild<LLUICtrl>("acc_status_text")->setValue(LLStringUtil::null); - getChild<LLUICtrl>("partner_text")->setValue(LLStringUtil::null); -} - -void LLPanelAvatarProfile::processProperties(void* data, EAvatarProcessorType type) -{ - if(APT_PROPERTIES == type) - { - const LLAvatarData* avatar_data = static_cast<const LLAvatarData*>(data); - if(avatar_data && getAvatarId() == avatar_data->avatar_id) - { - processProfileProperties(avatar_data); - } - } - else if(APT_GROUPS == type) - { - LLAvatarGroups* avatar_groups = static_cast<LLAvatarGroups*>(data); - if(avatar_groups && getAvatarId() == avatar_groups->avatar_id) - { - processGroupProperties(avatar_groups); - } - } -} - -void LLPanelAvatarProfile::processProfileProperties(const LLAvatarData* avatar_data) -{ - fillCommonData(avatar_data); - - fillPartnerData(avatar_data); - - fillAccountStatus(avatar_data); -} - -void LLPanelAvatarProfile::processGroupProperties(const LLAvatarGroups* avatar_groups) -{ - // *NOTE dzaporozhan - // Group properties may arrive in two callbacks, we need to save them across - // different calls. We can't do that in textbox as textbox may change the text. - - LLAvatarGroups::group_list_t::const_iterator it = avatar_groups->group_list.begin(); - const LLAvatarGroups::group_list_t::const_iterator it_end = avatar_groups->group_list.end(); - - for(; it_end != it; ++it) - { - LLAvatarGroups::LLGroupData group_data = *it; - mGroups[group_data.group_name] = group_data.group_id; - } - - // Creating string, containing group list - std::string groups = ""; - for (group_map_t::iterator it = mGroups.begin(); it != mGroups.end(); ++it) - { - if (it != mGroups.begin()) - groups += ", "; - - std::string group_name = LLURI::escape(it->first); - std::string group_url= it->second.notNull() - ? "[secondlife:///app/group/" + it->second.asString() + "/about " + group_name + "]" - : getString("no_group_text"); - - groups += group_url; - } - - getChild<LLUICtrl>("sl_groups")->setValue(groups); -} - -static void got_full_name_callback( LLHandle<LLPanel> profile_panel_handle, const std::string& full_name ) -{ - if (profile_panel_handle.isDead() ) return; - - LLPanelAvatarProfile* profile_panel = dynamic_cast<LLPanelAvatarProfile*>(profile_panel_handle.get()); - if ( ! profile_panel ) return; - - LLStringUtil::format_map_t args; - - std::string name; - if (LLAvatarNameCache::useDisplayNames()) - { - name = LLCacheName::buildUsername(full_name); - } - else - { - name = full_name; - } - - args["[NAME]"] = name; - - std::string linden_name = profile_panel->getString("name_text_args", args); - profile_panel->getChild<LLUICtrl>("name_descr_text")->setValue(linden_name); -} - -void LLPanelAvatarProfile::onNameCache(const LLUUID& agent_id, const LLAvatarName& av_name) -{ - LLStringUtil::format_map_t args; - args["[DISPLAY_NAME]"] = av_name.mDisplayName; - - std::string display_name = getString("display_name_text_args", args); - getChild<LLUICtrl>("display_name_descr_text")->setValue(display_name); -} - -void LLPanelAvatarProfile::fillCommonData(const LLAvatarData* avatar_data) -{ - //remove avatar id from cache to get fresh info - LLAvatarIconIDCache::getInstance()->remove(avatar_data->avatar_id); - - LLStringUtil::format_map_t args; - { - std::string birth_date = LLTrans::getString("AvatarBirthDateFormat"); - LLStringUtil::format(birth_date, LLSD().with("datetime", (S32) avatar_data->born_on.secondsSinceEpoch())); - args["[REG_DATE]"] = birth_date; - } - - // ask (asynchronously) for the avatar name - LLHandle<LLPanel> profile_panel_handle = getHandle(); - std::string full_name; - if (gCacheName->getFullName(avatar_data->agent_id, full_name)) - { - // name in cache, call callback directly - got_full_name_callback( profile_panel_handle, full_name ); - } - else - { - // not in cache, lookup name - gCacheName->get(avatar_data->agent_id, false, boost::bind( got_full_name_callback, profile_panel_handle, _2 )); - } - - // get display name - LLAvatarNameCache::get(avatar_data->avatar_id, - boost::bind(&LLPanelAvatarProfile::onNameCache, this, _1, _2)); - - args["[AGE]"] = LLDateUtil::ageFromDate( avatar_data->born_on, LLDate::now()); - std::string register_date = getString("RegisterDateFormat", args); - getChild<LLUICtrl>("register_date")->setValue(register_date ); - getChild<LLUICtrl>("sl_description_edit")->setValue(avatar_data->about_text); - getChild<LLUICtrl>("fl_description_edit")->setValue(avatar_data->fl_about_text); - getChild<LLUICtrl>("2nd_life_pic")->setValue(avatar_data->image_id); - getChild<LLUICtrl>("real_world_pic")->setValue(avatar_data->fl_image_id); - getChild<LLUICtrl>("homepage_edit")->setValue(avatar_data->profile_url); - - // Hide home page textbox if no page was set to fix "homepage URL appears clickable without URL - EXT-4734" - getChildView("homepage_edit")->setVisible( !avatar_data->profile_url.empty()); -} - -void LLPanelAvatarProfile::fillPartnerData(const LLAvatarData* avatar_data) -{ - LLTextBox* partner_text = getChild<LLTextBox>("partner_text"); - if (avatar_data->partner_id.notNull()) - { - partner_text->setText(LLSLURL("agent", avatar_data->partner_id, "inspect").getSLURLString()); - } - else - { - partner_text->setText(getString("no_partner_text")); - } -} - -void LLPanelAvatarProfile::fillAccountStatus(const LLAvatarData* avatar_data) -{ - LLStringUtil::format_map_t args; - args["[ACCTTYPE]"] = LLAvatarPropertiesProcessor::accountType(avatar_data); - args["[PAYMENTINFO]"] = LLAvatarPropertiesProcessor::paymentInfo(avatar_data); - // *NOTE: AVATAR_AGEVERIFIED not currently getting set in - // dataserver/lldataavatar.cpp for privacy considerations - args["[AGEVERIFICATION]"] = ""; - std::string caption_text = getString("CaptionTextAcctInfo", args); - getChild<LLUICtrl>("acc_status_text")->setValue(caption_text); -} - -void LLPanelAvatarProfile::pay() -{ - LLAvatarActions::pay(getAvatarId()); -} - -void LLPanelAvatarProfile::share() -{ - LLAvatarActions::share(getAvatarId()); -} - -void LLPanelAvatarProfile::toggleBlock() -{ - LLAvatarActions::toggleBlock(getAvatarId()); -} - -bool LLPanelAvatarProfile::enableShowOnMap() -{ - bool is_buddy_online = LLAvatarTracker::instance().isBuddyOnline(getAvatarId()); - - bool enable_map_btn = (is_buddy_online && is_agent_mappable(getAvatarId())) - || gAgent.isGodlike(); - return enable_map_btn; -} - -bool LLPanelAvatarProfile::enableBlock() -{ - return LLAvatarActions::canBlock(getAvatarId()) && !LLAvatarActions::isBlocked(getAvatarId()); -} - -bool LLPanelAvatarProfile::enableUnblock() -{ - return LLAvatarActions::isBlocked(getAvatarId()); -} - -void LLPanelAvatarProfile::kick() -{ - LLAvatarActions::kick(getAvatarId()); -} - -void LLPanelAvatarProfile::freeze() -{ - LLAvatarActions::freeze(getAvatarId()); -} - -void LLPanelAvatarProfile::unfreeze() -{ - LLAvatarActions::unfreeze(getAvatarId()); -} - -void LLPanelAvatarProfile::csr() -{ - std::string name; - gCacheName->getFullName(getAvatarId(), name); - LLAvatarActions::csr(getAvatarId(), name); -} - -void LLPanelAvatarProfile::onAddFriendButtonClick() -{ - LLAvatarActions::requestFriendshipDialog(getAvatarId()); -} - -void LLPanelAvatarProfile::onSeeProfileBtnClick() -{ - LLAvatarActions::showProfile(getAvatarId()); -} - -void LLPanelAvatarProfile::onIMButtonClick() -{ - LLAvatarActions::startIM(getAvatarId()); -} - -void LLPanelAvatarProfile::onTeleportButtonClick() -{ - LLAvatarActions::offerTeleport(getAvatarId()); -} - -void LLPanelAvatarProfile::onCallButtonClick() -{ - LLAvatarActions::startCall(getAvatarId()); -} - -void LLPanelAvatarProfile::onShareButtonClick() -{ - //*TODO not implemented -} - -LLPanelAvatarProfile::~LLPanelAvatarProfile() -{ - if(getAvatarId().notNull()) - { - LLAvatarTracker::instance().removeParticularFriendObserver(getAvatarId(), this); - } - - if(LLVoiceClient::instanceExists()) - { - LLVoiceClient::getInstance()->removeObserver((LLVoiceClientStatusObserver*)this); - } -} - -// virtual, called by LLAvatarTracker -void LLPanelAvatarProfile::changed(U32 mask) -{ - getChildView("teleport")->setEnabled(LLAvatarTracker::instance().isBuddyOnline(getAvatarId())); -} - -// virtual -void LLPanelAvatarProfile::onChange(EStatusType status, const std::string &channelURI, bool proximal) -{ - if(status == STATUS_JOINING || status == STATUS_LEFT_CHANNEL) - { - return; - } - - getChildView("call")->setEnabled(LLVoiceClient::getInstance()->voiceEnabled() && LLVoiceClient::getInstance()->isVoiceWorking()); -} - -void LLPanelAvatarProfile::setAvatarId(const LLUUID& id) -{ - if(id.notNull()) - { - if(getAvatarId().notNull()) - { - LLAvatarTracker::instance().removeParticularFriendObserver(getAvatarId(), this); - } - LLPanelProfileTab::setAvatarId(id); - LLAvatarTracker::instance().addParticularFriendObserver(getAvatarId(), this); - } -} - -////////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////// - -LLPanelMyProfile::LLPanelMyProfile() -: LLPanelAvatarProfile() -{ -} - -BOOL LLPanelMyProfile::postBuild() -{ - LLPanelAvatarProfile::postBuild(); - - childSetCommitCallback("status_me_message_text", boost::bind(&LLPanelMyProfile::onStatusMessageChanged, this), NULL); - - resetControls(); - resetData(); - - return TRUE; -} - -void LLPanelMyProfile::onOpen(const LLSD& key) -{ - LLPanelProfileTab::onOpen(key); -} - -void LLPanelMyProfile::processProfileProperties(const LLAvatarData* avatar_data) -{ - fillCommonData(avatar_data); - - fillPartnerData(avatar_data); - - fillAccountStatus(avatar_data); -} - -void LLPanelMyProfile::resetControls() -{ - getChildView("status_panel")->setVisible( false); - getChildView("profile_buttons_panel")->setVisible( false); - getChildView("title_groups_text")->setVisible( false); - getChildView("sl_groups")->setVisible( false); - getChildView("status_me_panel")->setVisible( true); - getChildView("profile_me_buttons_panel")->setVisible( true); -} - - -void LLPanelMyProfile::onStatusMessageChanged() -{ - updateData(); -} diff --git a/indra/newview/llpanelavatar.h b/indra/newview/llpanelavatar.h index e95441cd58..e33a850cfa 100644 --- a/indra/newview/llpanelavatar.h +++ b/indra/newview/llpanelavatar.h @@ -36,14 +36,8 @@ class LLComboBox; class LLLineEditor; -enum EOnlineStatus -{ - ONLINE_STATUS_NO = 0, - ONLINE_STATUS_YES = 1 -}; - /** -* Base class for any Profile View or My Profile Panel. +* Base class for any Profile View. */ class LLPanelProfileTab : public LLPanel @@ -111,187 +105,4 @@ private: LLUUID mAvatarId; }; -/** -* Panel for displaying Avatar's first and second life related info. -*/ -class LLPanelAvatarProfile - : public LLPanelProfileTab - , public LLFriendObserver - , public LLVoiceClientStatusObserver -{ -public: - LLPanelAvatarProfile(); - /*virtual*/ ~LLPanelAvatarProfile(); - - /*virtual*/ void onOpen(const LLSD& key); - - /** - * LLFriendObserver trigger - */ - virtual void changed(U32 mask); - - // Implements LLVoiceClientStatusObserver::onChange() to enable the call - // button when voice is available - /*virtual*/ void onChange(EStatusType status, const std::string &channelURI, bool proximal); - - /*virtual*/ void setAvatarId(const LLUUID& id); - - /** - * Processes data received from server. - */ - /*virtual*/ void processProperties(void* data, EAvatarProcessorType type); - - /*virtual*/ BOOL postBuild(); - - /*virtual*/ void updateData(); - - /*virtual*/ void resetControls(); - - /*virtual*/ void resetData(); - -protected: - - /** - * Process profile related data received from server. - */ - virtual void processProfileProperties(const LLAvatarData* avatar_data); - - /** - * Processes group related data received from server. - */ - virtual void processGroupProperties(const LLAvatarGroups* avatar_groups); - - /** - * Fills common for Avatar profile and My Profile fields. - */ - virtual void fillCommonData(const LLAvatarData* avatar_data); - - /** - * Fills partner data. - */ - virtual void fillPartnerData(const LLAvatarData* avatar_data); - - /** - * Fills account status. - */ - virtual void fillAccountStatus(const LLAvatarData* avatar_data); - - /** - * Opens "Pay Resident" dialog. - */ - void pay(); - - /** - * opens inventory and IM for sharing items - */ - void share(); - - /** - * Add/remove resident to/from your block list. - */ - void toggleBlock(); - - void kick(); - void freeze(); - void unfreeze(); - void csr(); - - bool enableShowOnMap(); - bool enableBlock(); - bool enableUnblock(); - bool enableGod(); - - void onSeeProfileBtnClick(); - void onAddFriendButtonClick(); - void onIMButtonClick(); - void onCallButtonClick(); - void onTeleportButtonClick(); - void onShareButtonClick(); - -private: - void onNameCache(const LLUUID& agent_id, const LLAvatarName& av_name); - - typedef std::map< std::string,LLUUID> group_map_t; - group_map_t mGroups; -}; - -/** - * Panel for displaying own first and second life related info. - */ -class LLPanelMyProfile - : public LLPanelAvatarProfile -{ -public: - LLPanelMyProfile(); - - /*virtual*/ BOOL postBuild(); - -protected: - - /*virtual*/ void onOpen(const LLSD& key); - - /*virtual*/ void processProfileProperties(const LLAvatarData* avatar_data); - - /*virtual*/ void resetControls(); - -protected: - void onStatusMessageChanged(); -}; - -/** - * Panel for displaying Avatar's notes and modifying friend's rights. - */ -class LLPanelAvatarNotes - : public LLPanelProfileTab - , public LLFriendObserver - , public LLVoiceClientStatusObserver -{ -public: - LLPanelAvatarNotes(); - /*virtual*/ ~LLPanelAvatarNotes(); - - virtual void setAvatarId(const LLUUID& id); - - /** - * LLFriendObserver trigger - */ - virtual void changed(U32 mask); - - // Implements LLVoiceClientStatusObserver::onChange() to enable the call - // button when voice is available - /*virtual*/ void onChange(EStatusType status, const std::string &channelURI, bool proximal); - - /*virtual*/ void onOpen(const LLSD& key); - - /*virtual*/ BOOL postBuild(); - - /*virtual*/ void processProperties(void* data, EAvatarProcessorType type); - - /*virtual*/ void updateData(); - -protected: - - /*virtual*/ void resetControls(); - - /*virtual*/ void resetData(); - - /** - * Fills rights data for friends. - */ - void fillRightsData(); - - void rightsConfirmationCallback(const LLSD& notification, - const LLSD& response, S32 rights); - void confirmModifyRights(bool grant, S32 rights); - void onCommitRights(); - void onCommitNotes(); - - void onAddFriendButtonClick(); - void onIMButtonClick(); - void onCallButtonClick(); - void onTeleportButtonClick(); - void onShareButtonClick(); - void enableCheckboxes(bool enable); -}; - #endif // LL_LLPANELAVATAR_H diff --git a/indra/newview/llpanelgrouplandmoney.cpp b/indra/newview/llpanelgrouplandmoney.cpp index 8477219f87..e66dd5690c 100644 --- a/indra/newview/llpanelgrouplandmoney.cpp +++ b/indra/newview/llpanelgrouplandmoney.cpp @@ -1431,7 +1431,7 @@ void LLGroupMoneyPlanningTabEventHandler::processReply(LLMessageSystem* msg, LLSD substitution; // We don't do time zone corrections of the calculated number of seconds // because we don't have a full time stamp, only a date. - substitution["datetime"] = LLDateUtil::secondsSinceEpochFromString("%m/%d/%Y", start_date); + substitution["datetime"] = LLDateUtil::secondsSinceEpochFromString("%Y-%m-%d", start_date); LLStringUtil::format (time_str, substitution); text.append(time_str); @@ -1442,7 +1442,7 @@ void LLGroupMoneyPlanningTabEventHandler::processReply(LLMessageSystem* msg, text.append(LLTrans::getString("NextStipendDay")); time_str = date_format_str; - substitution["datetime"] = LLDateUtil::secondsSinceEpochFromString("%m/%d/%Y", next_stipend_date); + substitution["datetime"] = LLDateUtil::secondsSinceEpochFromString("%Y-%m-%d", next_stipend_date); LLStringUtil::format (time_str, substitution); text.append(time_str); diff --git a/indra/newview/llpanellandmarks.cpp b/indra/newview/llpanellandmarks.cpp index a65631b8d8..c7454e85a9 100644 --- a/indra/newview/llpanellandmarks.cpp +++ b/indra/newview/llpanellandmarks.cpp @@ -1399,10 +1399,6 @@ static void filter_list(LLPlacesInventoryPanel* inventory_list, const std::strin inventory_list->restoreFolderState(); } - // Open the immediate children of the root folder, since those - // are invisible in the UI and thus must always be open. - inventory_list->getRootFolder()->openTopLevelFolders(); - if (inventory_list->getFilterSubString().empty() && string.empty()) { // current filter and new filter empty, do nothing diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp index bef809f3a7..058d1ad6bc 100644 --- a/indra/newview/llpanellogin.cpp +++ b/indra/newview/llpanellogin.cpp @@ -283,15 +283,15 @@ LLPanelLogin::~LLPanelLogin() // virtual void LLPanelLogin::draw() { - glPushMatrix(); + gGL.pushMatrix(); { F32 image_aspect = 1.333333f; F32 view_aspect = (F32)getRect().getWidth() / (F32)getRect().getHeight(); // stretch image to maintain aspect ratio if (image_aspect > view_aspect) { - glTranslatef(-0.5f * (image_aspect / view_aspect - 1.f) * getRect().getWidth(), 0.f, 0.f); - glScalef(image_aspect / view_aspect, 1.f, 1.f); + gGL.translatef(-0.5f * (image_aspect / view_aspect - 1.f) * getRect().getWidth(), 0.f, 0.f); + gGL.scalef(image_aspect / view_aspect, 1.f, 1.f); } S32 width = getRect().getWidth(); @@ -306,7 +306,7 @@ void LLPanelLogin::draw() mLogoImage->draw(0, -264, width + 8, mLogoImage->getHeight()); }; } - glPopMatrix(); + gGL.popMatrix(); LLPanel::draw(); } diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index d6c407d548..9944b51902 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -111,7 +111,7 @@ LLPanelMainInventory::LLPanelMainInventory(const LLPanel::Params& p) mCommitCallbackRegistrar.add("Inventory.EmptyTrash", boost::bind(&LLInventoryModel::emptyFolderType, &gInventory, "ConfirmEmptyTrash", LLFolderType::FT_TRASH)); mCommitCallbackRegistrar.add("Inventory.EmptyLostAndFound", boost::bind(&LLInventoryModel::emptyFolderType, &gInventory, "ConfirmEmptyLostAndFound", LLFolderType::FT_LOST_AND_FOUND)); mCommitCallbackRegistrar.add("Inventory.DoCreate", boost::bind(&LLPanelMainInventory::doCreate, this, _2)); - mCommitCallbackRegistrar.add("Inventory.NewWindow", boost::bind(&LLPanelMainInventory::newWindow, this)); + //mCommitCallbackRegistrar.add("Inventory.NewWindow", boost::bind(&LLPanelMainInventory::newWindow, this)); mCommitCallbackRegistrar.add("Inventory.ShowFilters", boost::bind(&LLPanelMainInventory::toggleFindOptions, this)); mCommitCallbackRegistrar.add("Inventory.ResetFilters", boost::bind(&LLPanelMainInventory::resetFilters, this)); mCommitCallbackRegistrar.add("Inventory.SetSortBy", boost::bind(&LLPanelMainInventory::setSortBy, this, _2)); diff --git a/indra/newview/llpanelmarketplaceinbox.cpp b/indra/newview/llpanelmarketplaceinbox.cpp index ac528947a4..7cb4bbf891 100644 --- a/indra/newview/llpanelmarketplaceinbox.cpp +++ b/indra/newview/llpanelmarketplaceinbox.cpp @@ -151,6 +151,20 @@ U32 LLPanelMarketplaceInbox::getFreshItemCount() const fresh_item_count++; } } + + LLFolderViewFolder::items_t::const_iterator items_it = inbox_folder->getItemsBegin(); + LLFolderViewFolder::items_t::const_iterator items_end = inbox_folder->getItemsEnd(); + + for (; items_it != items_end; ++items_it) + { + const LLFolderViewItem * item_view = *items_it; + const LLInboxFolderViewItem * inbox_item_view = dynamic_cast<const LLInboxFolderViewItem*>(item_view); + + if (inbox_item_view && inbox_item_view->isFresh()) + { + fresh_item_count++; + } + } } } @@ -171,6 +185,7 @@ U32 LLPanelMarketplaceInbox::getTotalItemCount() const if (inbox_folder) { item_count += inbox_folder->getFoldersCount(); + item_count += inbox_folder->getItemsCount(); } } diff --git a/indra/newview/llpanelmarketplaceinboxinventory.cpp b/indra/newview/llpanelmarketplaceinboxinventory.cpp index 2e4bf55d51..678e4f2843 100644 --- a/indra/newview/llpanelmarketplaceinboxinventory.cpp +++ b/indra/newview/llpanelmarketplaceinboxinventory.cpp @@ -45,6 +45,7 @@ static LLDefaultChildRegistry::Register<LLInboxInventoryPanel> r1("inbox_inventory_panel"); static LLDefaultChildRegistry::Register<LLInboxFolderViewFolder> r2("inbox_folder_view_folder"); +static LLDefaultChildRegistry::Register<LLInboxFolderViewItem> r3("inbox_folder_view_item"); // @@ -137,7 +138,7 @@ LLFolderViewFolder * LLInboxInventoryPanel::createFolderViewFolder(LLInvFVBridge LLFolderViewItem * LLInboxInventoryPanel::createFolderViewItem(LLInvFVBridge * bridge) { - LLFolderViewItem::Params params; + LLInboxFolderViewItem::Params params; params.name = bridge->getDisplayName(); params.icon = bridge->getIcon(); @@ -171,10 +172,6 @@ LLInboxFolderViewFolder::LLInboxFolderViewFolder(const Params& p) #endif } -LLInboxFolderViewFolder::~LLInboxFolderViewFolder() -{ -} - // virtual void LLInboxFolderViewFolder::draw() { @@ -190,6 +187,20 @@ void LLInboxFolderViewFolder::draw() LLFolderViewFolder::draw(); } +void LLInboxFolderViewFolder::selectItem() +{ + deFreshify(); + + LLFolderViewFolder::selectItem(); +} + +void LLInboxFolderViewFolder::toggleOpen() +{ + deFreshify(); + + LLFolderViewFolder::toggleOpen(); +} + void LLInboxFolderViewFolder::computeFreshness() { const U32 last_expansion_utc = gSavedPerAccountSettings.getU32("LastInventoryInboxActivity"); @@ -218,20 +229,6 @@ void LLInboxFolderViewFolder::deFreshify() gSavedPerAccountSettings.setU32("LastInventoryInboxActivity", time_corrected()); } -void LLInboxFolderViewFolder::selectItem() -{ - LLFolderViewFolder::selectItem(); - - deFreshify(); -} - -void LLInboxFolderViewFolder::toggleOpen() -{ - LLFolderViewFolder::toggleOpen(); - - deFreshify(); -} - void LLInboxFolderViewFolder::setCreationDate(time_t creation_date_utc) { mCreationDate = creation_date_utc; @@ -246,9 +243,87 @@ void LLInboxFolderViewFolder::setCreationDate(time_t creation_date_utc) // LLInboxFolderViewItem Implementation // +LLInboxFolderViewItem::LLInboxFolderViewItem(const Params& p) + : LLFolderViewItem(p) + , LLBadgeOwner(getHandle()) + , mFresh(false) +{ +#if SUPPORTING_FRESH_ITEM_COUNT + initBadgeParams(p.new_badge()); +#endif +} + +BOOL LLInboxFolderViewItem::addToFolder(LLFolderViewFolder* folder, LLFolderView* root) +{ + BOOL retval = LLFolderViewItem::addToFolder(folder, root); + +#if SUPPORTING_FRESH_ITEM_COUNT + // Compute freshness if our parent is the root folder for the inbox + if (mParentFolder == mRoot) + { + computeFreshness(); + } +#endif + + return retval; +} + BOOL LLInboxFolderViewItem::handleDoubleClick(S32 x, S32 y, MASK mask) { - return TRUE; + deFreshify(); + + return LLFolderViewItem::handleDoubleClick(x, y, mask); +} + +// virtual +void LLInboxFolderViewItem::draw() +{ +#if SUPPORTING_FRESH_ITEM_COUNT + if (!badgeHasParent()) + { + addBadgeToParentPanel(); + } + + setBadgeVisibility(mFresh); +#endif + + LLFolderViewItem::draw(); +} + +void LLInboxFolderViewItem::selectItem() +{ + deFreshify(); + + LLFolderViewItem::selectItem(); +} + +void LLInboxFolderViewItem::computeFreshness() +{ + const U32 last_expansion_utc = gSavedPerAccountSettings.getU32("LastInventoryInboxActivity"); + + if (last_expansion_utc > 0) + { + mFresh = (mCreationDate > last_expansion_utc); + +#if DEBUGGING_FRESHNESS + if (mFresh) + { + llinfos << "Item is fresh! -- creation " << mCreationDate << ", saved_freshness_date " << last_expansion_utc << llendl; + } +#endif + } + else + { + mFresh = true; + } +} + +void LLInboxFolderViewItem::deFreshify() +{ + mFresh = false; + + gSavedPerAccountSettings.setU32("LastInventoryInboxActivity", time_corrected()); } + // eof diff --git a/indra/newview/llpanelmarketplaceinboxinventory.h b/indra/newview/llpanelmarketplaceinboxinventory.h index 46eeb9ea7f..d6b827ee3e 100644 --- a/indra/newview/llpanelmarketplaceinboxinventory.h +++ b/indra/newview/llpanelmarketplaceinboxinventory.h @@ -69,16 +69,15 @@ public: }; LLInboxFolderViewFolder(const Params& p); - ~LLInboxFolderViewFolder(); - + void draw(); - void computeFreshness(); - void deFreshify(); - void selectItem(); void toggleOpen(); + void computeFreshness(); + void deFreshify(); + bool isFresh() const { return mFresh; } protected: @@ -88,15 +87,35 @@ protected: }; -class LLInboxFolderViewItem : public LLFolderViewItem +class LLInboxFolderViewItem : public LLFolderViewItem, public LLBadgeOwner { public: - LLInboxFolderViewItem(const Params& p) - : LLFolderViewItem(p) + struct Params : public LLInitParam::Block<Params, LLFolderViewItem::Params> { - } + Optional<LLBadge::Params> new_badge; + + Params() + : new_badge("new_badge") + { + } + }; + LLInboxFolderViewItem(const Params& p); + + BOOL addToFolder(LLFolderViewFolder* folder, LLFolderView* root); BOOL handleDoubleClick(S32 x, S32 y, MASK mask); + + void draw(); + + void selectItem(); + + void computeFreshness(); + void deFreshify(); + + bool isFresh() const { return mFresh; } + +protected: + bool mFresh; }; #endif //LL_INBOXINVENTORYPANEL_H diff --git a/indra/newview/llpanelme.cpp b/indra/newview/llpanelme.cpp index 7e47a96f44..a9af56f750 100644 --- a/indra/newview/llpanelme.cpp +++ b/indra/newview/llpanelme.cpp @@ -48,16 +48,10 @@ #include "lltabcontainer.h" #include "lltexturectrl.h" -#define PICKER_SECOND_LIFE "2nd_life_pic" -#define PICKER_FIRST_LIFE "real_world_pic" -#define PANEL_PROFILE "panel_profile" - -static LLRegisterPanelClassWrapper<LLPanelMyProfileEdit> t_panel_me_profile_edit("edit_profile_panel"); static LLRegisterPanelClassWrapper<LLPanelMe> t_panel_me_profile("panel_me"); LLPanelMe::LLPanelMe(void) : LLPanelProfile() - , mEditPanel(NULL) { setAvatarId(gAgent.getID()); } @@ -73,282 +67,3 @@ void LLPanelMe::onOpen(const LLSD& key) { LLPanelProfile::onOpen(key); } - -void LLPanelMe::buildEditPanel() -{ - if (NULL == mEditPanel) - { - mEditPanel = new LLPanelMyProfileEdit(); - - // Note: Remove support for editing profile through this method. - // All profile editing should go through the web. - //mEditPanel->childSetAction("save_btn", boost::bind(&LLPanelMe::onSaveChangesClicked, this), this); - - //mEditPanel->childSetAction("cancel_btn", boost::bind(&LLPanelMe::onCancelClicked, this), this); - } -} - - -void LLPanelMe::onEditProfileClicked() -{ - buildEditPanel(); -} - -////////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////// - -LLPanelMyProfileEdit::LLPanelMyProfileEdit() - : LLPanelMyProfile() -{ - buildFromFile( "panel_edit_profile.xml"); - - setAvatarId(gAgent.getID()); - - LLAvatarNameCache::addUseDisplayNamesCallback(boost::bind(&LLPanelMyProfileEdit::onAvatarNameChanged, this)); -} - -void LLPanelMyProfileEdit::onOpen(const LLSD& key) -{ - resetData(); - - // Disable editing until data is loaded, or edited fields will be overwritten when data - // is loaded. - enableEditing(false); - - // force new avatar name fetch so we have latest update time - LLAvatarNameCache::fetch(gAgent.getID()); - LLPanelMyProfile::onOpen(getAvatarId()); - - LLAvatarName av_name; - if (LLAvatarNameCache::useDisplayNames()) - { - if (LLAvatarNameCache::get(gAgent.getID(), &av_name) && av_name.mIsDisplayNameDefault) - { - LLFirstUse::setDisplayName(); - } - else - { - LLFirstUse::setDisplayName(false); - } - } - - if (LLAvatarNameCache::useDisplayNames()) - { - getChild<LLUICtrl>("user_label")->setVisible( true ); - getChild<LLUICtrl>("user_slid")->setVisible( true ); - getChild<LLUICtrl>("display_name_label")->setVisible( true ); - getChild<LLUICtrl>("set_name")->setVisible( true ); - getChild<LLUICtrl>("set_name")->setEnabled( true ); - getChild<LLUICtrl>("solo_user_name")->setVisible( false ); - getChild<LLUICtrl>("solo_username_label")->setVisible( false ); - } - else - { - getChild<LLUICtrl>("user_label")->setVisible( false ); - getChild<LLUICtrl>("user_slid")->setVisible( false ); - getChild<LLUICtrl>("display_name_label")->setVisible( false ); - getChild<LLUICtrl>("set_name")->setVisible( false ); - getChild<LLUICtrl>("set_name")->setEnabled( false ); - getChild<LLUICtrl>("solo_user_name")->setVisible( true ); - getChild<LLUICtrl>("solo_username_label")->setVisible( true ); - } -} - -void LLPanelMyProfileEdit::onClose(const LLSD& key) -{ - if (LLAvatarNameCache::useDisplayNames()) - { - LLFirstUse::setDisplayName(false); - } -} - -void LLPanelMyProfileEdit::processProperties(void* data, EAvatarProcessorType type) -{ - if(APT_PROPERTIES == type) - { - const LLAvatarData* avatar_data = static_cast<const LLAvatarData*>(data); - if(avatar_data && getAvatarId() == avatar_data->avatar_id) - { - // *TODO dzaporozhan - // Workaround for ticket EXT-1099, waiting for fix for ticket EXT-1128 - enableEditing(true); - processProfileProperties(avatar_data); - LLAvatarPropertiesProcessor::getInstance()->removeObserver(getAvatarId(),this); - } - } -} - -void LLPanelMyProfileEdit::processProfileProperties(const LLAvatarData* avatar_data) -{ - fillCommonData(avatar_data); - - // 'Home page' was hidden in LLPanelAvatarProfile::fillCommonData() to fix EXT-4734 - // Show 'Home page' in Edit My Profile (EXT-4873) - getChildView("homepage_edit")->setVisible( true); - - fillPartnerData(avatar_data); - - fillAccountStatus(avatar_data); - - getChild<LLUICtrl>("show_in_search_checkbox")->setValue((BOOL)(avatar_data->flags & AVATAR_ALLOW_PUBLISH)); - - LLAvatarNameCache::get(avatar_data->avatar_id, - boost::bind(&LLPanelMyProfileEdit::onNameCache, this, _1, _2)); -} - -void LLPanelMyProfileEdit::onNameCache(const LLUUID& agent_id, const LLAvatarName& av_name) -{ - getChild<LLUICtrl>("user_name")->setValue( av_name.mDisplayName ); - getChild<LLUICtrl>("user_slid")->setValue( av_name.mUsername ); - getChild<LLUICtrl>("user_name_small")->setValue( av_name.mDisplayName ); - getChild<LLUICtrl>("solo_user_name")->setValue( av_name.mDisplayName ); - - - if (LLAvatarNameCache::useDisplayNames()) - { - getChild<LLUICtrl>("user_label")->setVisible( true ); - getChild<LLUICtrl>("user_slid")->setVisible( true ); - getChild<LLUICtrl>("display_name_label")->setVisible( true ); - getChild<LLUICtrl>("set_name")->setVisible( true ); - getChild<LLUICtrl>("set_name")->setEnabled( true ); - - getChild<LLUICtrl>("solo_user_name")->setVisible( false ); - getChild<LLUICtrl>("solo_username_label")->setVisible( false ); - - // show smaller display name if too long to display in regular size - if (getChild<LLTextBox>("user_name")->getTextPixelWidth() > getChild<LLTextBox>("user_name")->getRect().getWidth()) - { - getChild<LLUICtrl>("user_name_small")->setVisible( true ); - getChild<LLUICtrl>("user_name")->setVisible( false ); - } - else - { - getChild<LLUICtrl>("user_name_small")->setVisible( false ); - getChild<LLUICtrl>("user_name")->setVisible( true ); - } - } - else - { - getChild<LLUICtrl>("user_label")->setVisible( false ); - getChild<LLUICtrl>("user_slid")->setVisible( false ); - getChild<LLUICtrl>("display_name_label")->setVisible( false ); - getChild<LLUICtrl>("set_name")->setVisible( false ); - getChild<LLUICtrl>("set_name")->setEnabled( false ); - - getChild<LLUICtrl>("solo_user_name")->setVisible( true ); - getChild<LLUICtrl>("user_name_small")->setVisible( false ); - getChild<LLUICtrl>("user_name")->setVisible( false ); - getChild<LLUICtrl>("solo_username_label")->setVisible( true ); - } -} - - -void LLPanelMyProfileEdit::onAvatarNameChanged() -{ - LLAvatarNameCache::get(getAvatarId(), - boost::bind(&LLPanelMyProfileEdit::onNameCache, this, _1, _2)); -} - -BOOL LLPanelMyProfileEdit::postBuild() -{ - initTexturePickerMouseEvents(); - - getChild<LLUICtrl>("partner_edit_link")->setTextArg("[URL]", getString("partner_edit_link_url")); - getChild<LLUICtrl>("my_account_link")->setTextArg("[URL]", getString("my_account_link_url")); - - getChild<LLUICtrl>("set_name")->setCommitCallback( - boost::bind(&LLPanelMyProfileEdit::onClickSetName, this)); - - LLHints::registerHintTarget("set_display_name", getChild<LLUICtrl>("set_name")->getHandle()); - LLViewerDisplayName::addNameChangedCallback(boost::bind(&LLPanelMyProfileEdit::onAvatarNameChanged, this)); - return LLPanelAvatarProfile::postBuild(); -} -/** - * Inits map with texture picker and appropriate edit icon. - * Sets callbacks of Mouse Enter and Mouse Leave signals of Texture Pickers - */ -void LLPanelMyProfileEdit::initTexturePickerMouseEvents() -{ - LLTextureCtrl* text_pic = getChild<LLTextureCtrl>(PICKER_SECOND_LIFE); - LLIconCtrl* text_icon = getChild<LLIconCtrl>("2nd_life_edit_icon"); - mTextureEditIconMap[text_pic->getName()] = text_icon; - text_pic->setMouseEnterCallback(boost::bind(&LLPanelMyProfileEdit::onTexturePickerMouseEnter, this, _1)); - text_pic->setMouseLeaveCallback(boost::bind(&LLPanelMyProfileEdit::onTexturePickerMouseLeave, this, _1)); - text_icon->setVisible(FALSE); - - text_pic = getChild<LLTextureCtrl>(PICKER_FIRST_LIFE); - text_icon = getChild<LLIconCtrl>("real_world_edit_icon"); - mTextureEditIconMap[text_pic->getName()] = text_icon; - text_pic->setMouseEnterCallback(boost::bind(&LLPanelMyProfileEdit::onTexturePickerMouseEnter, this, _1)); - text_pic->setMouseLeaveCallback(boost::bind(&LLPanelMyProfileEdit::onTexturePickerMouseLeave, this, _1)); - text_icon->setVisible(FALSE); -} - -void LLPanelMyProfileEdit::resetData() -{ - LLPanelMyProfile::resetData(); - - //childSetTextArg("name_text", "[FIRST]", LLStringUtil::null); - //childSetTextArg("name_text", "[LAST]", LLStringUtil::null); - getChild<LLUICtrl>("user_name")->setValue( LLSD() ); - getChild<LLUICtrl>("user_slid")->setValue( LLSD() ); - getChild<LLUICtrl>("solo_user_name")->setValue( LLSD() ); - getChild<LLUICtrl>("user_name_small")->setValue( LLSD() ); -} - -void LLPanelMyProfileEdit::onTexturePickerMouseEnter(LLUICtrl* ctrl) -{ - mTextureEditIconMap[ctrl->getName()]->setVisible(TRUE); -} -void LLPanelMyProfileEdit::onTexturePickerMouseLeave(LLUICtrl* ctrl) -{ - mTextureEditIconMap[ctrl->getName()]->setVisible(FALSE); -} - -void LLPanelMyProfileEdit::onClickSetName() -{ - LLAvatarNameCache::get(getAvatarId(), - boost::bind(&LLPanelMyProfileEdit::onAvatarNameCache, - this, _1, _2)); - - LLFirstUse::setDisplayName(false); -} - -void LLPanelMyProfileEdit::onAvatarNameCache(const LLUUID& agent_id, const LLAvatarName& av_name) -{ - if (av_name.mDisplayName.empty()) - { - // something is wrong, tell user to try again later - LLNotificationsUtil::add("SetDisplayNameFailedGeneric"); - return; - } - - llinfos << "name-change now " << LLDate::now() << " next_update " - << LLDate(av_name.mNextUpdate) << llendl; - F64 now_secs = LLDate::now().secondsSinceEpoch(); - - if (now_secs < av_name.mNextUpdate) - { - // if the update time is more than a year in the future, it means updates have been blocked - // show a more general message - const int YEAR = 60*60*24*365; - if (now_secs + YEAR < av_name.mNextUpdate) - { - LLNotificationsUtil::add("SetDisplayNameBlocked"); - return; - } - } - - LLFloaterReg::showInstance("display_name"); -} - -void LLPanelMyProfileEdit::enableEditing(bool enable) -{ - getChildView("2nd_life_pic")->setEnabled(enable); - getChildView("real_world_pic")->setEnabled(enable); - getChildView("sl_description_edit")->setEnabled(enable); - getChildView("fl_description_edit")->setEnabled(enable); - getChildView("homepage_edit")->setEnabled(enable); - getChildView("show_in_search_checkbox")->setEnabled(enable); -} diff --git a/indra/newview/llpanelme.h b/indra/newview/llpanelme.h index b0f5d184cc..60e9d4317d 100644 --- a/indra/newview/llpanelme.h +++ b/indra/newview/llpanelme.h @@ -30,15 +30,9 @@ #include "llpanel.h" #include "llpanelprofile.h" -class LLAvatarName; -class LLPanelMyProfileEdit; -class LLPanelProfile; -class LLIconCtrl; - /** -* Panel for displaying Agent's profile, it consists of two sub panels - Profile -* and Picks. -* LLPanelMe allows user to edit his profile and picks. +* Panel for displaying Agent's Picks and Classifieds panel. +* LLPanelMe allows user to edit his picks and classifieds. */ class LLPanelMe : public LLPanelProfile { @@ -51,60 +45,6 @@ public: /*virtual*/ void onOpen(const LLSD& key); /*virtual*/ BOOL postBuild(); - -private: - - void buildEditPanel(); - - void onEditProfileClicked(); - - LLPanelMyProfileEdit * mEditPanel; - -}; - -class LLPanelMyProfileEdit : public LLPanelMyProfile -{ - LOG_CLASS(LLPanelMyProfileEdit); - -public: - - LLPanelMyProfileEdit(); - - /*virtual*/void processProperties(void* data, EAvatarProcessorType type); - - /*virtual*/BOOL postBuild(); - - /*virtual*/ void onOpen(const LLSD& key); - /*virtual*/ void onClose(const LLSD& key); - - void onAvatarNameChanged(); - -protected: - - /*virtual*/void resetData(); - - void processProfileProperties(const LLAvatarData* avatar_data); - void onNameCache(const LLUUID& agent_id, const LLAvatarName& av_name); - -private: - void initTexturePickerMouseEvents(); - void onTexturePickerMouseEnter(LLUICtrl* ctrl); - void onTexturePickerMouseLeave(LLUICtrl* ctrl); - void onClickSetName(); - void onAvatarNameCache(const LLUUID& id, const LLAvatarName& av_name); - - /** - * Enabled/disables controls to prevent overwriting edited data upon receiving - * current data from server. - */ - void enableEditing(bool enable); - - - -private: - // map TexturePicker name => Edit Icon pointer should be visible while hovering Texture Picker - typedef std::map<std::string, LLIconCtrl*> texture_edit_icon_map_t; - texture_edit_icon_map_t mTextureEditIconMap; }; #endif // LL_LLPANELMEPROFILE_H diff --git a/indra/newview/llpanelnearbymedia.cpp b/indra/newview/llpanelnearbymedia.cpp index 2bbd15ae11..c01adc3c35 100644 --- a/indra/newview/llpanelnearbymedia.cpp +++ b/indra/newview/llpanelnearbymedia.cpp @@ -52,6 +52,7 @@ #include "llvovolume.h" #include "llstatusbar.h" #include "llsdutil.h" +#include "llvieweraudio.h" #include "llfloaterreg.h" #include "llfloaterpreference.h" // for the gear icon @@ -807,14 +808,26 @@ bool LLPanelNearByMedia::setDisabled(const LLUUID &row_id, bool disabled) { if (row_id == PARCEL_AUDIO_LIST_ITEM_UUID) { - if (disabled) onClickParcelAudioStop(); - else onClickParcelAudioStart(); + if (disabled) + { + onClickParcelAudioStop(); + } + else + { + onClickParcelAudioPlay(); + } return true; } else if (row_id == PARCEL_MEDIA_LIST_ITEM_UUID) { - if (disabled) onClickDisableParcelMedia(); - else onClickEnableParcelMedia(); + if (disabled) + { + onClickDisableParcelMedia(); + } + else + { + onClickEnableParcelMedia(); + } return true; } else { @@ -857,24 +870,11 @@ void LLPanelNearByMedia::onClickParcelMediaPause() LLViewerParcelMedia::pause(); } -void LLPanelNearByMedia::onClickParcelAudioStart() -{ - // User *explicitly* started the internet stream, so keep the stream - // playing and updated as they cross to other parcels etc. - mParcelAudioAutoStart = true; - - if (!gAudiop) - return; - - gAudiop->startInternetStream(LLViewerMedia::getParcelAudioURL()); -} - void LLPanelNearByMedia::onClickParcelAudioPlay() { // User *explicitly* started the internet stream, so keep the stream // playing and updated as they cross to other parcels etc. mParcelAudioAutoStart = true; - if (!gAudiop) return; @@ -883,8 +883,9 @@ void LLPanelNearByMedia::onClickParcelAudioPlay() // 'false' means unpause gAudiop->pauseInternetStream(false); } - else { - gAudiop->startInternetStream(LLViewerMedia::getParcelAudioURL()); + else + { + LLViewerAudio::getInstance()->startInternetStreamWithAutoFade(LLViewerMedia::getParcelAudioURL()); } } @@ -894,11 +895,10 @@ void LLPanelNearByMedia::onClickParcelAudioStop() // re-start audio when i.e. they move to another parcel, until // they explicitly start it again. mParcelAudioAutoStart = false; - if (!gAudiop) return; - gAudiop->stopInternetStream(); + LLViewerAudio::getInstance()->stopInternetStreamWithAutoFade(); } void LLPanelNearByMedia::onClickParcelAudioPause() diff --git a/indra/newview/llpanelnearbymedia.h b/indra/newview/llpanelnearbymedia.h index be4d313743..c3634de9b4 100644 --- a/indra/newview/llpanelnearbymedia.h +++ b/indra/newview/llpanelnearbymedia.h @@ -115,7 +115,6 @@ private: void onClickParcelMediaPause(); void onClickParcelAudioPlay(); void onClickParcelAudioStop(); - void onClickParcelAudioStart(); void onClickParcelAudioPause(); void onCheckAutoPlay(); void onAdvancedButtonClick(); diff --git a/indra/newview/llpanelpicks.cpp b/indra/newview/llpanelpicks.cpp index 72c6be4c79..cfbc8f1a94 100755 --- a/indra/newview/llpanelpicks.cpp +++ b/indra/newview/llpanelpicks.cpp @@ -130,11 +130,14 @@ public: void createPick() { - LLSD params; - params["id"] = gAgent.getID(); - params["open_tab_name"] = "panel_picks"; - params["show_tab_panel"] = "create_pick"; - LLFloaterSidePanelContainer::showPanel("my_profile", params); + // open the new pick panel on the Picks floater + LLFloater* picks_floater = LLFloaterReg::showInstance("picks"); + + LLPanelPicks* picks = picks_floater->findChild<LLPanelPicks>("panel_picks"); + if (picks) + { + picks->createNewPick(); + } } void editPick(LLPickData* pick_info) @@ -147,7 +150,7 @@ public: params["snapshot_id"] = pick_info->snapshot_id; params["pick_name"] = pick_info->name; params["pick_desc"] = pick_info->desc; - LLFloaterSidePanelContainer::showPanel("my_profile", params); + LLFloaterSidePanelContainer::showPanel("picks", params); } /*virtual*/ void processProperties(void* data, EAvatarProcessorType type) @@ -247,12 +250,14 @@ public: void createClassified() { - // open the new classified panel on the Me > Picks sidetray - LLSD params; - params["id"] = gAgent.getID(); - params["open_tab_name"] = "panel_picks"; - params["show_tab_panel"] = "create_classified"; - LLFloaterSidePanelContainer::showPanel("my_profile", params); + // open the new classified panel on the Picks floater + LLFloater* picks_floater = LLFloaterReg::showInstance("picks"); + + LLPanelPicks* picks = picks_floater->findChild<LLPanelPicks>("panel_picks"); + if (picks) + { + picks->createNewClassified(); + } } void openClassified(LLAvatarClassifiedInfo* c_info) @@ -270,7 +275,7 @@ public: params["classified_name"] = c_info->name; params["classified_desc"] = c_info->description; params["from_search"] = true; - LLFloaterSidePanelContainer::showPanel("people", "panel_profile_view", params); + LLFloaterSidePanelContainer::showPanel("picks", params); } else if (mRequestVerb == "edit") { @@ -1043,13 +1048,10 @@ void LLPanelPicks::createPickInfoPanel() void LLPanelPicks::createClassifiedInfoPanel() { - if(!mPanelClassifiedInfo) - { - mPanelClassifiedInfo = LLPanelClassifiedInfo::create(); - mPanelClassifiedInfo->setExitCallback(boost::bind(&LLPanelPicks::onPanelClassifiedClose, this, mPanelClassifiedInfo)); - mPanelClassifiedInfo->setEditClassifiedCallback(boost::bind(&LLPanelPicks::onPanelClassifiedEdit, this)); - mPanelClassifiedInfo->setVisible(FALSE); - } + mPanelClassifiedInfo = LLPanelClassifiedInfo::create(); + mPanelClassifiedInfo->setExitCallback(boost::bind(&LLPanelPicks::onPanelClassifiedClose, this, mPanelClassifiedInfo)); + mPanelClassifiedInfo->setEditClassifiedCallback(boost::bind(&LLPanelPicks::onPanelClassifiedEdit, this)); + mPanelClassifiedInfo->setVisible(FALSE); } void LLPanelPicks::createClassifiedEditPanel(LLPanelClassifiedEdit** panel) @@ -1067,14 +1069,11 @@ void LLPanelPicks::createClassifiedEditPanel(LLPanelClassifiedEdit** panel) void LLPanelPicks::createPickEditPanel() { - if(!mPanelPickEdit) - { - mPanelPickEdit = LLPanelPickEdit::create(); - mPanelPickEdit->setExitCallback(boost::bind(&LLPanelPicks::onPanelPickClose, this, mPanelPickEdit)); - mPanelPickEdit->setSaveCallback(boost::bind(&LLPanelPicks::onPanelPickSave, this, mPanelPickEdit)); - mPanelPickEdit->setCancelCallback(boost::bind(&LLPanelPicks::onPanelPickClose, this, mPanelPickEdit)); - mPanelPickEdit->setVisible(FALSE); - } + mPanelPickEdit = LLPanelPickEdit::create(); + mPanelPickEdit->setExitCallback(boost::bind(&LLPanelPicks::onPanelPickClose, this, mPanelPickEdit)); + mPanelPickEdit->setSaveCallback(boost::bind(&LLPanelPicks::onPanelPickSave, this, mPanelPickEdit)); + mPanelPickEdit->setCancelCallback(boost::bind(&LLPanelPicks::onPanelPickClose, this, mPanelPickEdit)); + mPanelPickEdit->setVisible(FALSE); } // void LLPanelPicks::openPickEditPanel(LLPickItem* pick) diff --git a/indra/newview/llpanelpicks.h b/indra/newview/llpanelpicks.h index 29db110523..3bb7413ac3 100755 --- a/indra/newview/llpanelpicks.h +++ b/indra/newview/llpanelpicks.h @@ -82,6 +82,9 @@ public: // parent panels failed to work (picks related code was in my profile panel) void setProfilePanel(LLPanelProfile* profile_panel); + void createNewPick(); + void createNewClassified(); + protected: /*virtual*/void updateButtons(); @@ -115,9 +118,6 @@ private: bool onEnableMenuItem(const LLSD& user_data); - void createNewPick(); - void createNewClassified(); - void openPickInfo(); void openClassifiedInfo(); void openClassifiedInfo(const LLSD& params); diff --git a/indra/newview/llpanelplaces.cpp b/indra/newview/llpanelplaces.cpp index 7f8f9b29af..6d321d4716 100644 --- a/indra/newview/llpanelplaces.cpp +++ b/indra/newview/llpanelplaces.cpp @@ -82,6 +82,7 @@ static const std::string CREATE_LANDMARK_INFO_TYPE = "create_landmark"; static const std::string LANDMARK_INFO_TYPE = "landmark"; static const std::string REMOTE_PLACE_INFO_TYPE = "remote_place"; static const std::string TELEPORT_HISTORY_INFO_TYPE = "teleport_history"; +static const std::string LANDMARK_TAB_INFO_TYPE = "open_landmark_tab"; // Support for secondlife:///app/parcel/{UUID}/about SLapps class LLParcelHandler : public LLCommandHandler @@ -365,83 +366,104 @@ void LLPanelPlaces::onOpen(const LLSD& key) if (key.size() != 0) { - mFilterEditor->clear(); - onFilterEdit("", false); - - mPlaceInfoType = key["type"].asString(); - mPosGlobal.setZero(); - mItem = NULL; - isLandmarkEditModeOn = false; - togglePlaceInfoPanel(TRUE); - - if (mPlaceInfoType == AGENT_INFO_TYPE) + std::string key_type = key["type"].asString(); + if (key_type == LANDMARK_TAB_INFO_TYPE) { - mPlaceProfile->setInfoType(LLPanelPlaceInfo::AGENT); + // Small hack: We need to toggle twice. The first toggle moves from the Landmark + // or Teleport History info panel to the Landmark or Teleport History list panel. + // For this first toggle, the mPlaceInfoType should be the one previously used so + // that the state can be corretly set. + // The second toggle forces the list to be set to Landmark. + // This avoids extracting and duplicating all the state logic from togglePlaceInfoPanel() + // here or some specific private method + togglePlaceInfoPanel(FALSE); + mPlaceInfoType = key_type; + togglePlaceInfoPanel(FALSE); + // Update the active tab + onTabSelected(); + // Update the buttons at the bottom of the panel + updateVerbs(); } - else if (mPlaceInfoType == CREATE_LANDMARK_INFO_TYPE) + else { - mLandmarkInfo->setInfoType(LLPanelPlaceInfo::CREATE_LANDMARK); + mFilterEditor->clear(); + onFilterEdit("", false); - if (key.has("x") && key.has("y") && key.has("z")) + mPlaceInfoType = key_type; + mPosGlobal.setZero(); + mItem = NULL; + isLandmarkEditModeOn = false; + togglePlaceInfoPanel(TRUE); + + if (mPlaceInfoType == AGENT_INFO_TYPE) { - mPosGlobal = LLVector3d(key["x"].asReal(), - key["y"].asReal(), - key["z"].asReal()); + mPlaceProfile->setInfoType(LLPanelPlaceInfo::AGENT); } - else + else if (mPlaceInfoType == CREATE_LANDMARK_INFO_TYPE) { - mPosGlobal = gAgent.getPositionGlobal(); + mLandmarkInfo->setInfoType(LLPanelPlaceInfo::CREATE_LANDMARK); + + if (key.has("x") && key.has("y") && key.has("z")) + { + mPosGlobal = LLVector3d(key["x"].asReal(), + key["y"].asReal(), + key["z"].asReal()); + } + else + { + mPosGlobal = gAgent.getPositionGlobal(); + } + + mLandmarkInfo->displayParcelInfo(LLUUID(), mPosGlobal); + + mSaveBtn->setEnabled(FALSE); } - - mLandmarkInfo->displayParcelInfo(LLUUID(), mPosGlobal); - - mSaveBtn->setEnabled(FALSE); - } - else if (mPlaceInfoType == LANDMARK_INFO_TYPE) - { - mLandmarkInfo->setInfoType(LLPanelPlaceInfo::LANDMARK); - - LLInventoryItem* item = gInventory.getItem(key["id"].asUUID()); - if (!item) - return; - - setItem(item); - } - else if (mPlaceInfoType == REMOTE_PLACE_INFO_TYPE) - { - if (key.has("id")) + else if (mPlaceInfoType == LANDMARK_INFO_TYPE) { - LLUUID parcel_id = key["id"].asUUID(); - mPlaceProfile->setParcelID(parcel_id); + mLandmarkInfo->setInfoType(LLPanelPlaceInfo::LANDMARK); - // query the server to get the global 3D position of this - // parcel - we need this for teleport/mapping functions. - mRemoteParcelObserver->setParcelID(parcel_id); + LLInventoryItem* item = gInventory.getItem(key["id"].asUUID()); + if (!item) + return; + + setItem(item); } - else + else if (mPlaceInfoType == REMOTE_PLACE_INFO_TYPE) { - mPosGlobal = LLVector3d(key["x"].asReal(), - key["y"].asReal(), - key["z"].asReal()); - mPlaceProfile->displayParcelInfo(LLUUID(), mPosGlobal); + if (key.has("id")) + { + LLUUID parcel_id = key["id"].asUUID(); + mPlaceProfile->setParcelID(parcel_id); + + // query the server to get the global 3D position of this + // parcel - we need this for teleport/mapping functions. + mRemoteParcelObserver->setParcelID(parcel_id); + } + else + { + mPosGlobal = LLVector3d(key["x"].asReal(), + key["y"].asReal(), + key["z"].asReal()); + mPlaceProfile->displayParcelInfo(LLUUID(), mPosGlobal); + } + + mPlaceProfile->setInfoType(LLPanelPlaceInfo::PLACE); } + else if (mPlaceInfoType == TELEPORT_HISTORY_INFO_TYPE) + { + S32 index = key["id"].asInteger(); - mPlaceProfile->setInfoType(LLPanelPlaceInfo::PLACE); - } - else if (mPlaceInfoType == TELEPORT_HISTORY_INFO_TYPE) - { - S32 index = key["id"].asInteger(); + const LLTeleportHistoryStorage::slurl_list_t& hist_items = + LLTeleportHistoryStorage::getInstance()->getItems(); - const LLTeleportHistoryStorage::slurl_list_t& hist_items = - LLTeleportHistoryStorage::getInstance()->getItems(); + mPosGlobal = hist_items[index].mGlobalPos; - mPosGlobal = hist_items[index].mGlobalPos; + mPlaceProfile->setInfoType(LLPanelPlaceInfo::TELEPORT_HISTORY); + mPlaceProfile->displayParcelInfo(LLUUID(), mPosGlobal); + } - mPlaceProfile->setInfoType(LLPanelPlaceInfo::TELEPORT_HISTORY); - mPlaceProfile->displayParcelInfo(LLUUID(), mPosGlobal); + updateVerbs(); } - - updateVerbs(); } LLViewerParcelMgr* parcel_mgr = LLViewerParcelMgr::getInstance(); @@ -942,7 +964,8 @@ void LLPanelPlaces::togglePlaceInfoPanel(BOOL visible) } } else if (mPlaceInfoType == CREATE_LANDMARK_INFO_TYPE || - mPlaceInfoType == LANDMARK_INFO_TYPE) + mPlaceInfoType == LANDMARK_INFO_TYPE || + mPlaceInfoType == LANDMARK_TAB_INFO_TYPE) { mLandmarkInfo->setVisible(visible); @@ -960,13 +983,15 @@ void LLPanelPlaces::togglePlaceInfoPanel(BOOL visible) { LLLandmarksPanel* landmarks_panel = dynamic_cast<LLLandmarksPanel*>(mTabContainer->getPanelByName("Landmarks")); - if (landmarks_panel && mItem.notNull()) + if (landmarks_panel) { // If a landmark info is being closed we open the landmarks tab // and set this landmark selected. mTabContainer->selectTabPanel(landmarks_panel); - - landmarks_panel->setItemSelected(mItem->getUUID(), TRUE); + if (mItem.notNull()) + { + landmarks_panel->setItemSelected(mItem->getUUID(), TRUE); + } } } } @@ -1163,7 +1188,8 @@ LLPanelPlaceInfo* LLPanelPlaces::getCurrentInfoPanel() return mPlaceProfile; } else if (mPlaceInfoType == CREATE_LANDMARK_INFO_TYPE || - mPlaceInfoType == LANDMARK_INFO_TYPE) + mPlaceInfoType == LANDMARK_INFO_TYPE || + mPlaceInfoType == LANDMARK_TAB_INFO_TYPE) { return mLandmarkInfo; } diff --git a/indra/newview/llpanelprofile.cpp b/indra/newview/llpanelprofile.cpp index 5ce59d8959..b1eeabb028 100755 --- a/indra/newview/llpanelprofile.cpp +++ b/indra/newview/llpanelprofile.cpp @@ -38,7 +38,6 @@ #include "llviewernetwork.h" static const std::string PANEL_PICKS = "panel_picks"; -static const std::string PANEL_PROFILE = "panel_profile"; std::string getProfileURL(const std::string& agent_name) { @@ -168,6 +167,23 @@ LLPanelProfile::ChildStack::ChildStack() { } +LLPanelProfile::ChildStack::~ChildStack() +{ + while (mStack.size() != 0) + { + view_list_t& top = mStack.back(); + for (view_list_t::const_iterator it = top.begin(); it != top.end(); ++it) + { + LLView* viewp = *it; + if (viewp) + { + delete viewp; + } + } + mStack.pop_back(); + } +} + void LLPanelProfile::ChildStack::setParent(LLPanel* parent) { llassert_always(parent != NULL); @@ -272,7 +288,6 @@ BOOL LLPanelProfile::postBuild() panel_picks->setProfilePanel(this); getTabContainer()[PANEL_PICKS] = panel_picks; - getTabContainer()[PANEL_PROFILE] = findChild<LLPanelAvatarProfile>(PANEL_PROFILE); return TRUE; } diff --git a/indra/newview/llpanelprofile.h b/indra/newview/llpanelprofile.h index bd4457c240..d97f60ed22 100755 --- a/indra/newview/llpanelprofile.h +++ b/indra/newview/llpanelprofile.h @@ -74,6 +74,7 @@ private: LOG_CLASS(LLPanelProfile::ChildStack); public: ChildStack(); + ~ChildStack(); void setParent(LLPanel* parent); bool push(); diff --git a/indra/newview/llpanelprofileview.cpp b/indra/newview/llpanelprofileview.cpp deleted file mode 100644 index 7635aedf58..0000000000 --- a/indra/newview/llpanelprofileview.cpp +++ /dev/null @@ -1,247 +0,0 @@ -/** -* @file llpanelprofileview.cpp -* @brief Side tray "Profile View" panel -* -* $LicenseInfo:firstyear=2009&license=viewerlgpl$ -* Second Life Viewer Source Code -* Copyright (C) 2010, Linden Research, Inc. -* -* This library is free software; you can redistribute it and/or -* modify it under the terms of the GNU Lesser General Public -* License as published by the Free Software Foundation; -* version 2.1 of the License only. -* -* This library is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -* Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public -* License along with this library; if not, write to the Free Software -* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -* -* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA -* $/LicenseInfo$ -*/ - -#include "llviewerprecompiledheaders.h" - -#include "llpanelprofileview.h" - -#include "llavatarconstants.h" -#include "llavatarnamecache.h" // IDEVO -#include "llclipboard.h" -#include "lluserrelations.h" - -#include "llavatarpropertiesprocessor.h" -#include "llcallingcard.h" -#include "llpanelavatar.h" -#include "llpanelpicks.h" -#include "llpanelprofile.h" -#include "llsidetraypanelcontainer.h" - -static LLRegisterPanelClassWrapper<LLPanelProfileView> t_panel_target_profile("panel_profile_view"); - -static std::string PANEL_NOTES = "panel_notes"; -static const std::string PANEL_PROFILE = "panel_profile"; -static const std::string PANEL_PICKS = "panel_picks"; - - -class AvatarStatusObserver : public LLAvatarPropertiesObserver -{ -public: - AvatarStatusObserver(LLPanelProfileView* profile_view) - { - mProfileView = profile_view; - } - - void processProperties(void* data, EAvatarProcessorType type) - { - if(APT_PROPERTIES != type) return; - const LLAvatarData* avatar_data = static_cast<const LLAvatarData*>(data); - if(avatar_data && mProfileView->getAvatarId() == avatar_data->avatar_id) - { - mProfileView->processOnlineStatus(avatar_data->flags & AVATAR_ONLINE); - LLAvatarPropertiesProcessor::instance().removeObserver(mProfileView->getAvatarId(), this); - } - } - - void subscribe() - { - LLAvatarPropertiesProcessor::instance().addObserver(mProfileView->getAvatarId(), this); - } - -private: - LLPanelProfileView* mProfileView; -}; - -LLPanelProfileView::LLPanelProfileView() -: LLPanelProfile() -, mStatusText(NULL) -, mAvatarStatusObserver(NULL) -{ - mAvatarStatusObserver = new AvatarStatusObserver(this); -} - -LLPanelProfileView::~LLPanelProfileView(void) -{ - delete mAvatarStatusObserver; -} - -/*virtual*/ -void LLPanelProfileView::onOpen(const LLSD& key) -{ - LLUUID id; - if(key.has("id")) - { - id = key["id"]; - } - - if(id.notNull() && getAvatarId() != id) - { - setAvatarId(id); - - // clear name fields, which might have old data - getChild<LLUICtrl>("user_name")->setValue( LLSD() ); - getChild<LLUICtrl>("user_slid")->setValue( LLSD() ); - } - - // Update the avatar name. - LLAvatarNameCache::get(getAvatarId(), - boost::bind(&LLPanelProfileView::onAvatarNameCache, this, _1, _2)); - - updateOnlineStatus(); - - - LLPanelProfile::onOpen(key); -} - -BOOL LLPanelProfileView::postBuild() -{ - LLPanelProfile::postBuild(); - - getTabContainer()[PANEL_NOTES] = findChild<LLPanelAvatarNotes>(PANEL_NOTES); - - //*TODO remove this, according to style guide we don't use status combobox - getTabContainer()[PANEL_PROFILE]->getChildView("online_me_status_text")->setVisible( FALSE); - getTabContainer()[PANEL_PROFILE]->getChildView("status_combo")->setVisible( FALSE); - - mStatusText = getChild<LLTextBox>("status"); - mStatusText->setVisible(false); - - childSetCommitCallback("back",boost::bind(&LLPanelProfileView::onBackBtnClick,this),NULL); - childSetCommitCallback("copy_to_clipboard",boost::bind(&LLPanelProfileView::onCopyToClipboard,this),NULL); - - return TRUE; -} - - -//private - -void LLPanelProfileView::onBackBtnClick() -{ - // Set dummy value to make picks panel dirty, - // This will make Picks reload on next open. - getTabContainer()[PANEL_PICKS]->setValue(LLSD()); - - LLSideTrayPanelContainer* parent = dynamic_cast<LLSideTrayPanelContainer*>(getParent()); - if(parent) - { - parent->openPreviousPanel(); - } -} - -void LLPanelProfileView::onCopyToClipboard() -{ - std::string name = getChild<LLUICtrl>("user_name")->getValue().asString() + " (" + getChild<LLUICtrl>("user_slid")->getValue().asString() + ")"; - gClipboard.copyFromString(utf8str_to_wstring(name)); -} - -bool LLPanelProfileView::isGrantedToSeeOnlineStatus() -{ - const LLRelationship* relationship = LLAvatarTracker::instance().getBuddyInfo(getAvatarId()); - if (NULL == relationship) - return false; - - // *NOTE: GRANT_ONLINE_STATUS is always set to false while changing any other status. - // When avatar disallow me to see her online status processOfflineNotification Message is received by the viewer - // see comments for ChangeUserRights template message. EXT-453. - // If GRANT_ONLINE_STATUS flag is changed it will be applied when viewer restarts. EXT-3880 - return relationship->isRightGrantedFrom(LLRelationship::GRANT_ONLINE_STATUS); -} - -// method was disabled according to EXT-2022. Re-enabled & improved according to EXT-3880 -void LLPanelProfileView::updateOnlineStatus() -{ - // set text box visible to show online status for non-friends who has not set in Preferences - // "Only Friends & Groups can see when I am online" - mStatusText->setVisible(TRUE); - - const LLRelationship* relationship = LLAvatarTracker::instance().getBuddyInfo(getAvatarId()); - if (NULL == relationship) - { - // this is non-friend avatar. Status will be updated from LLAvatarPropertiesProcessor. - // in LLPanelProfileView::processOnlineStatus() - - // subscribe observer to get online status. Request will be sent by LLPanelAvatarProfile itself. - // do not subscribe for friend avatar because online status can be wrong overridden - // via LLAvatarData::flags if Preferences: "Only Friends & Groups can see when I am online" is set. - mAvatarStatusObserver->subscribe(); - return; - } - // For friend let check if he allowed me to see his status - - // status should only show if viewer has permission to view online/offline. EXT-453, EXT-3880 - mStatusText->setVisible(isGrantedToSeeOnlineStatus()); - - bool online = relationship->isOnline(); - processOnlineStatus(online); -} - -void LLPanelProfileView::processOnlineStatus(bool online) -{ - std::string status = getString(online ? "status_online" : "status_offline"); - - mStatusText->setValue(status); -} - -void LLPanelProfileView::onAvatarNameCache(const LLUUID& agent_id, - const LLAvatarName& av_name) -{ - getChild<LLUICtrl>("user_name")->setValue( av_name.mDisplayName ); - getChild<LLUICtrl>("user_name_small")->setValue( av_name.mDisplayName ); - getChild<LLUICtrl>("user_slid")->setValue( av_name.mUsername ); - - // show smaller display name if too long to display in regular size - if (getChild<LLTextBox>("user_name")->getTextPixelWidth() > getChild<LLTextBox>("user_name")->getRect().getWidth()) - { - getChild<LLUICtrl>("user_name_small")->setVisible( true ); - getChild<LLUICtrl>("user_name")->setVisible( false ); - } - else - { - getChild<LLUICtrl>("user_name_small")->setVisible( false ); - getChild<LLUICtrl>("user_name")->setVisible( true ); - } - - if (LLAvatarNameCache::useDisplayNames()) - { - getChild<LLUICtrl>("user_label")->setVisible( true ); - getChild<LLUICtrl>("user_slid")->setVisible( true ); - getChild<LLUICtrl>("display_name_label")->setVisible( true ); - getChild<LLUICtrl>("copy_to_clipboard")->setVisible( true ); - getChild<LLUICtrl>("copy_to_clipboard")->setEnabled( true ); - getChild<LLUICtrl>("solo_username_label")->setVisible( false ); - } - else - { - getChild<LLUICtrl>("user_label")->setVisible( false ); - getChild<LLUICtrl>("user_slid")->setVisible( false ); - getChild<LLUICtrl>("display_name_label")->setVisible( false ); - getChild<LLUICtrl>("copy_to_clipboard")->setVisible( false ); - getChild<LLUICtrl>("copy_to_clipboard")->setEnabled( false ); - getChild<LLUICtrl>("solo_username_label")->setVisible( true ); - } -} - -// EOF diff --git a/indra/newview/llpanelprofileview.h b/indra/newview/llpanelprofileview.h deleted file mode 100644 index c6d921fdc4..0000000000 --- a/indra/newview/llpanelprofileview.h +++ /dev/null @@ -1,108 +0,0 @@ -/** -* @file llpanelprofileview.h -* @brief Side tray "Profile View" panel -* -* $LicenseInfo:firstyear=2009&license=viewerlgpl$ -* Second Life Viewer Source Code -* Copyright (C) 2010, Linden Research, Inc. -* -* This library is free software; you can redistribute it and/or -* modify it under the terms of the GNU Lesser General Public -* License as published by the Free Software Foundation; -* version 2.1 of the License only. -* -* This library is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -* Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public -* License along with this library; if not, write to the Free Software -* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -* -* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA -* $/LicenseInfo$ -*/ - -#ifndef LL_LLPANELPROFILEVIEW_H -#define LL_LLPANELPROFILEVIEW_H - -#include "llpanel.h" -#include "llpanelprofile.h" -#include "llavatarpropertiesprocessor.h" -#include "llagent.h" -#include "lltooldraganddrop.h" - -class LLAvatarName; -class LLPanelProfile; -class LLPanelProfileTab; -class LLTextBox; -class AvatarStatusObserver; - -/** -* Panel for displaying Avatar's profile. It consists of three sub panels - Profile, -* Picks and Notes. -*/ -class LLPanelProfileView : public LLPanelProfile -{ - LOG_CLASS(LLPanelProfileView); - friend class LLUICtrlFactory; - friend class AvatarStatusObserver; - -public: - - LLPanelProfileView(); - - /*virtual*/ ~LLPanelProfileView(); - - /*virtual*/ void onOpen(const LLSD& key); - - /*virtual*/ BOOL postBuild(); - - BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, - BOOL drop, EDragAndDropType cargo_type, - void *cargo_data, EAcceptance *accept, - std::string& tooltip_msg) - { - LLToolDragAndDrop::handleGiveDragAndDrop(getAvatarId(), gAgent.getSessionID(), drop, - cargo_type, cargo_data, accept); - - return TRUE; - } - - -protected: - - void onBackBtnClick(); - void onCopyToClipboard(); - bool isGrantedToSeeOnlineStatus(); - - /** - * Displays avatar's online status if possible. - * - * Requirements from EXT-3880: - * For friends: - * - Online when online and privacy settings allow to show - * - Offline when offline and privacy settings allow to show - * - Else: nothing - * For other avatars: - * - Online when online and was not set in Preferences/"Only Friends & Groups can see when I am online" - * - Else: Offline - */ - void updateOnlineStatus(); - void processOnlineStatus(bool online); - -private: - // LLCacheName will call this function when avatar name is loaded from server. - // This is required to display names that have not been cached yet. -// void onNameCache( -// const LLUUID& id, -// const std::string& full_name, -// bool is_group); - void onAvatarNameCache(const LLUUID& agent_id, const LLAvatarName& av_name); - - LLTextBox* mStatusText; - AvatarStatusObserver* mAvatarStatusObserver; -}; - -#endif //LL_LLPANELPROFILEVIEW_H diff --git a/indra/newview/llpanelsnapshot.cpp b/indra/newview/llpanelsnapshot.cpp new file mode 100644 index 0000000000..2f29e758c6 --- /dev/null +++ b/indra/newview/llpanelsnapshot.cpp @@ -0,0 +1,201 @@ +/** + * @file llpanelsnapshot.cpp + * @brief Snapshot panel base class + * + * $LicenseInfo:firstyear=2011&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2011, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" +#include "llpanelsnapshot.h" + +// libs +#include "llcombobox.h" +#include "llsliderctrl.h" +#include "llspinctrl.h" +#include "lltrans.h" + +// newview +#include "llsidetraypanelcontainer.h" +#include "llviewercontrol.h" // gSavedSettings + +// virtual +BOOL LLPanelSnapshot::postBuild() +{ + getChild<LLUICtrl>(getImageSizeComboName())->setCommitCallback(boost::bind(&LLPanelSnapshot::onResolutionComboCommit, this, _1)); + getChild<LLUICtrl>(getWidthSpinnerName())->setCommitCallback(boost::bind(&LLPanelSnapshot::onCustomResolutionCommit, this)); + getChild<LLUICtrl>(getHeightSpinnerName())->setCommitCallback(boost::bind(&LLPanelSnapshot::onCustomResolutionCommit, this)); + getChild<LLUICtrl>(getAspectRatioCBName())->setCommitCallback(boost::bind(&LLPanelSnapshot::onKeepAspectRatioCommit, this, _1)); + + updateControls(LLSD()); + return TRUE; +} + +// virtual +void LLPanelSnapshot::onOpen(const LLSD& key) +{ + S32 old_format = gSavedSettings.getS32("SnapshotFormat"); + S32 new_format = (S32) getImageFormat(); + + gSavedSettings.setS32("SnapshotFormat", new_format); + setCtrlsEnabled(true); + + // Switching panels will likely change image format. + // Not updating preview right away may lead to errors, + // e.g. attempt to send a large BMP image by email. + if (old_format != new_format) + { + LLFloaterSnapshot::getInstance()->notify(LLSD().with("image-format-change", true)); + } + + updateCustomResControls(); +} + +LLFloaterSnapshot::ESnapshotFormat LLPanelSnapshot::getImageFormat() const +{ + return LLFloaterSnapshot::SNAPSHOT_FORMAT_JPEG; +} + +void LLPanelSnapshot::enableControls(BOOL enable) +{ + setCtrlsEnabled(enable); + if (enable) + { + // Make sure only relevant controls are enabled/shown. + updateCustomResControls(); + } +} + +LLSpinCtrl* LLPanelSnapshot::getWidthSpinner() +{ + return getChild<LLSpinCtrl>(getWidthSpinnerName()); +} + +LLSpinCtrl* LLPanelSnapshot::getHeightSpinner() +{ + return getChild<LLSpinCtrl>(getHeightSpinnerName()); +} + +S32 LLPanelSnapshot::getTypedPreviewWidth() const +{ + return getChild<LLUICtrl>(getWidthSpinnerName())->getValue().asInteger(); +} + +S32 LLPanelSnapshot::getTypedPreviewHeight() const +{ + return getChild<LLUICtrl>(getHeightSpinnerName())->getValue().asInteger(); +} + +void LLPanelSnapshot::enableAspectRatioCheckbox(BOOL enable) +{ + getChild<LLUICtrl>(getAspectRatioCBName())->setEnabled(enable); +} + +LLSideTrayPanelContainer* LLPanelSnapshot::getParentContainer() +{ + LLSideTrayPanelContainer* parent = dynamic_cast<LLSideTrayPanelContainer*>(getParent()); + if (!parent) + { + llwarns << "Cannot find panel container" << llendl; + return NULL; + } + + return parent; +} + +// virtual +void LLPanelSnapshot::updateCustomResControls() +{ + // Only show width/height spinners and the aspect ratio checkbox + // when a custom resolution is chosen. + LLComboBox* combo = getChild<LLComboBox>(getImageSizeComboName()); + const bool show = combo->getFirstSelectedIndex() == (combo->getItemCount() - 1); + getChild<LLUICtrl>(getImageSizePanelName())->setVisible(show); +} + +void LLPanelSnapshot::updateImageQualityLevel() +{ + LLSliderCtrl* quality_slider = getChild<LLSliderCtrl>("image_quality_slider"); + S32 quality_val = llfloor((F32) quality_slider->getValue().asReal()); + + std::string quality_lvl; + + if (quality_val < 20) + { + quality_lvl = LLTrans::getString("snapshot_quality_very_low"); + } + else if (quality_val < 40) + { + quality_lvl = LLTrans::getString("snapshot_quality_low"); + } + else if (quality_val < 60) + { + quality_lvl = LLTrans::getString("snapshot_quality_medium"); + } + else if (quality_val < 80) + { + quality_lvl = LLTrans::getString("snapshot_quality_high"); + } + else + { + quality_lvl = LLTrans::getString("snapshot_quality_very_high"); + } + + getChild<LLTextBox>("image_quality_level")->setTextArg("[QLVL]", quality_lvl); +} + +void LLPanelSnapshot::goBack() +{ + LLSideTrayPanelContainer* parent = getParentContainer(); + if (parent) + { + parent->openPreviousPanel(); + parent->getCurrentPanel()->onOpen(LLSD()); + } +} + +void LLPanelSnapshot::cancel() +{ + goBack(); + LLFloaterSnapshot::getInstance()->notify(LLSD().with("set-ready", true)); +} + +void LLPanelSnapshot::onCustomResolutionCommit() +{ + LLSD info; + info["w"] = getChild<LLUICtrl>(getWidthSpinnerName())->getValue().asInteger(); + info["h"] = getChild<LLUICtrl>(getHeightSpinnerName())->getValue().asInteger(); + LLFloaterSnapshot::getInstance()->notify(LLSD().with("custom-res-change", info)); +} + +void LLPanelSnapshot::onResolutionComboCommit(LLUICtrl* ctrl) +{ + updateCustomResControls(); + + LLSD info; + info["combo-res-change"]["control-name"] = ctrl->getName(); + LLFloaterSnapshot::getInstance()->notify(info); +} + +void LLPanelSnapshot::onKeepAspectRatioCommit(LLUICtrl* ctrl) +{ + LLFloaterSnapshot::getInstance()->notify(LLSD().with("keep-aspect-change", ctrl->getValue().asBoolean())); +} diff --git a/indra/newview/llpanelsnapshot.h b/indra/newview/llpanelsnapshot.h new file mode 100644 index 0000000000..f3274cf594 --- /dev/null +++ b/indra/newview/llpanelsnapshot.h @@ -0,0 +1,71 @@ +/** + * @file llpanelsnapshot.h + * @brief Snapshot panel base class + * + * $LicenseInfo:firstyear=2011&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2011, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#ifndef LL_LLPANELSNAPSHOT_H +#define LL_LLPANELSNAPSHOT_H + +#include "llfloatersnapshot.h" + +class LLSideTrayPanelContainer; + +/** + * Snapshot panel base class. + */ +class LLPanelSnapshot: public LLPanel +{ +public: + /*virtual*/ BOOL postBuild(); + /*virtual*/ void onOpen(const LLSD& key); + + virtual std::string getWidthSpinnerName() const = 0; + virtual std::string getHeightSpinnerName() const = 0; + virtual std::string getAspectRatioCBName() const = 0; + virtual std::string getImageSizeComboName() const = 0; + virtual std::string getImageSizePanelName() const = 0; + + virtual S32 getTypedPreviewWidth() const; + virtual S32 getTypedPreviewHeight() const; + virtual LLSpinCtrl* getWidthSpinner(); + virtual LLSpinCtrl* getHeightSpinner(); + virtual void enableAspectRatioCheckbox(BOOL enable); + virtual LLFloaterSnapshot::ESnapshotFormat getImageFormat() const; + virtual void updateControls(const LLSD& info) = 0; ///< Update controls from saved settings + void enableControls(BOOL enable); + +protected: + LLSideTrayPanelContainer* getParentContainer(); + virtual void updateCustomResControls(); + void updateImageQualityLevel(); + void goBack(); ///< Switch to the default (Snapshot Options) panel + void cancel(); + + // common UI callbacks + void onCustomResolutionCommit(); + void onResolutionComboCommit(LLUICtrl* ctrl); + void onKeepAspectRatioCommit(LLUICtrl* ctrl); +}; + +#endif // LL_LLPANELSNAPSHOT_H diff --git a/indra/newview/llpanelsnapshotinventory.cpp b/indra/newview/llpanelsnapshotinventory.cpp new file mode 100644 index 0000000000..381c11348d --- /dev/null +++ b/indra/newview/llpanelsnapshotinventory.cpp @@ -0,0 +1,109 @@ +/** + * @file llpanelsnapshotinventory.cpp + * @brief The panel provides UI for saving snapshot as an inventory texture. + * + * $LicenseInfo:firstyear=2011&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2011, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" + +#include "llcombobox.h" +#include "lleconomy.h" +#include "llsidetraypanelcontainer.h" +#include "llspinctrl.h" + +#include "llfloatersnapshot.h" // FIXME: replace with a snapshot storage model +#include "llpanelsnapshot.h" +#include "llviewercontrol.h" // gSavedSettings + +/** + * The panel provides UI for saving snapshot as an inventory texture. + */ +class LLPanelSnapshotInventory +: public LLPanelSnapshot +{ + LOG_CLASS(LLPanelSnapshotInventory); + +public: + LLPanelSnapshotInventory(); + /*virtual*/ BOOL postBuild(); + /*virtual*/ void onOpen(const LLSD& key); + +private: + /*virtual*/ void updateCustomResControls(); ///< Show/hide custom resolution controls (spinners and checkbox) + /*virtual*/ std::string getWidthSpinnerName() const { return "inventory_snapshot_width"; } + /*virtual*/ std::string getHeightSpinnerName() const { return "inventory_snapshot_height"; } + /*virtual*/ std::string getAspectRatioCBName() const { return "inventory_keep_aspect_check"; } + /*virtual*/ std::string getImageSizeComboName() const { return "texture_size_combo"; } + /*virtual*/ std::string getImageSizePanelName() const { return LLStringUtil::null; } + /*virtual*/ void updateControls(const LLSD& info); + + void onSend(); +}; + +static LLRegisterPanelClassWrapper<LLPanelSnapshotInventory> panel_class("llpanelsnapshotinventory"); + +LLPanelSnapshotInventory::LLPanelSnapshotInventory() +{ + mCommitCallbackRegistrar.add("Inventory.Save", boost::bind(&LLPanelSnapshotInventory::onSend, this)); + mCommitCallbackRegistrar.add("Inventory.Cancel", boost::bind(&LLPanelSnapshotInventory::cancel, this)); +} + +// virtual +BOOL LLPanelSnapshotInventory::postBuild() +{ + getChild<LLSpinCtrl>(getWidthSpinnerName())->setAllowEdit(FALSE); + getChild<LLSpinCtrl>(getHeightSpinnerName())->setAllowEdit(FALSE); + getChild<LLUICtrl>(getAspectRatioCBName())->setVisible(FALSE); // we don't keep aspect ratio for inventory textures + return LLPanelSnapshot::postBuild(); +} + +// virtual +void LLPanelSnapshotInventory::onOpen(const LLSD& key) +{ + getChild<LLUICtrl>("hint_lbl")->setTextArg("[UPLOAD_COST]", llformat("%d", LLGlobalEconomy::Singleton::getInstance()->getPriceUpload())); + LLPanelSnapshot::onOpen(key); +} + +// virtual +void LLPanelSnapshotInventory::updateCustomResControls() +{ + LLComboBox* combo = getChild<LLComboBox>(getImageSizeComboName()); + S32 selected_idx = combo->getFirstSelectedIndex(); + const bool show = selected_idx == (combo->getItemCount() - 1); // Custom selected + + getChild<LLUICtrl>(getWidthSpinnerName())->setVisible(show); + getChild<LLUICtrl>(getHeightSpinnerName())->setVisible(show); +} + +// virtual +void LLPanelSnapshotInventory::updateControls(const LLSD& info) +{ + const bool have_snapshot = info.has("have-snapshot") ? info["have-snapshot"].asBoolean() : true; + getChild<LLUICtrl>("save_btn")->setEnabled(have_snapshot); +} + +void LLPanelSnapshotInventory::onSend() +{ + LLFloaterSnapshot::saveTexture(); + LLFloaterSnapshot::postSave(); +} diff --git a/indra/newview/llpanelsnapshotlocal.cpp b/indra/newview/llpanelsnapshotlocal.cpp new file mode 100644 index 0000000000..d153ff598d --- /dev/null +++ b/indra/newview/llpanelsnapshotlocal.cpp @@ -0,0 +1,168 @@ +/** + * @file llpanelsnapshotlocal.cpp + * @brief The panel provides UI for saving snapshot to a local folder. + * + * $LicenseInfo:firstyear=2011&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2011, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" + +#include "llcombobox.h" +#include "llsidetraypanelcontainer.h" +#include "llsliderctrl.h" +#include "llspinctrl.h" + +#include "llfloatersnapshot.h" // FIXME: replace with a snapshot storage model +#include "llpanelsnapshot.h" +#include "llviewercontrol.h" // gSavedSettings +#include "llviewerwindow.h" + +/** + * The panel provides UI for saving snapshot to a local folder. + */ +class LLPanelSnapshotLocal +: public LLPanelSnapshot +{ + LOG_CLASS(LLPanelSnapshotLocal); + +public: + LLPanelSnapshotLocal(); + /*virtual*/ BOOL postBuild(); + /*virtual*/ void onOpen(const LLSD& key); + +private: + /*virtual*/ std::string getWidthSpinnerName() const { return "local_snapshot_width"; } + /*virtual*/ std::string getHeightSpinnerName() const { return "local_snapshot_height"; } + /*virtual*/ std::string getAspectRatioCBName() const { return "local_keep_aspect_check"; } + /*virtual*/ std::string getImageSizeComboName() const { return "local_size_combo"; } + /*virtual*/ std::string getImageSizePanelName() const { return "local_image_size_lp"; } + /*virtual*/ LLFloaterSnapshot::ESnapshotFormat getImageFormat() const; + /*virtual*/ void updateControls(const LLSD& info); + + void onFormatComboCommit(LLUICtrl* ctrl); + void onQualitySliderCommit(LLUICtrl* ctrl); + void onSaveFlyoutCommit(LLUICtrl* ctrl); +}; + +static LLRegisterPanelClassWrapper<LLPanelSnapshotLocal> panel_class("llpanelsnapshotlocal"); + +LLPanelSnapshotLocal::LLPanelSnapshotLocal() +{ + mCommitCallbackRegistrar.add("Local.Cancel", boost::bind(&LLPanelSnapshotLocal::cancel, this)); +} + +// virtual +BOOL LLPanelSnapshotLocal::postBuild() +{ + getChild<LLUICtrl>("image_quality_slider")->setCommitCallback(boost::bind(&LLPanelSnapshotLocal::onQualitySliderCommit, this, _1)); + getChild<LLUICtrl>("local_format_combo")->setCommitCallback(boost::bind(&LLPanelSnapshotLocal::onFormatComboCommit, this, _1)); + getChild<LLUICtrl>("save_btn")->setCommitCallback(boost::bind(&LLPanelSnapshotLocal::onSaveFlyoutCommit, this, _1)); + + return LLPanelSnapshot::postBuild(); +} + +// virtual +void LLPanelSnapshotLocal::onOpen(const LLSD& key) +{ + LLPanelSnapshot::onOpen(key); +} + +// virtual +LLFloaterSnapshot::ESnapshotFormat LLPanelSnapshotLocal::getImageFormat() const +{ + LLFloaterSnapshot::ESnapshotFormat fmt = LLFloaterSnapshot::SNAPSHOT_FORMAT_PNG; + + LLComboBox* local_format_combo = getChild<LLComboBox>("local_format_combo"); + const std::string id = local_format_combo->getValue().asString(); + if (id == "PNG") + { + fmt = LLFloaterSnapshot::SNAPSHOT_FORMAT_PNG; + } + else if (id == "JPEG") + { + fmt = LLFloaterSnapshot::SNAPSHOT_FORMAT_JPEG; + } + else if (id == "BMP") + { + fmt = LLFloaterSnapshot::SNAPSHOT_FORMAT_BMP; + } + + return fmt; +} + +// virtual +void LLPanelSnapshotLocal::updateControls(const LLSD& info) +{ + LLFloaterSnapshot::ESnapshotFormat fmt = + (LLFloaterSnapshot::ESnapshotFormat) gSavedSettings.getS32("SnapshotFormat"); + getChild<LLComboBox>("local_format_combo")->selectNthItem((S32) fmt); + + const bool show_quality_ctrls = (fmt == LLFloaterSnapshot::SNAPSHOT_FORMAT_JPEG); + getChild<LLUICtrl>("image_quality_slider")->setVisible(show_quality_ctrls); + getChild<LLUICtrl>("image_quality_level")->setVisible(show_quality_ctrls); + + getChild<LLUICtrl>("image_quality_slider")->setValue(gSavedSettings.getS32("SnapshotQuality")); + updateImageQualityLevel(); + + const bool have_snapshot = info.has("have-snapshot") ? info["have-snapshot"].asBoolean() : true; + getChild<LLUICtrl>("save_btn")->setEnabled(have_snapshot); +} + +void LLPanelSnapshotLocal::onFormatComboCommit(LLUICtrl* ctrl) +{ + // will call updateControls() + LLFloaterSnapshot::getInstance()->notify(LLSD().with("image-format-change", true)); +} + +void LLPanelSnapshotLocal::onQualitySliderCommit(LLUICtrl* ctrl) +{ + updateImageQualityLevel(); + + LLSliderCtrl* slider = (LLSliderCtrl*)ctrl; + S32 quality_val = llfloor((F32)slider->getValue().asReal()); + LLSD info; + info["image-quality-change"] = quality_val; + LLFloaterSnapshot::getInstance()->notify(info); +} + +void LLPanelSnapshotLocal::onSaveFlyoutCommit(LLUICtrl* ctrl) +{ + if (ctrl->getValue().asString() == "save as") + { + gViewerWindow->resetSnapshotLoc(); + } + + LLFloaterSnapshot* floater = LLFloaterSnapshot::getInstance(); + + floater->notify(LLSD().with("set-working", true)); + BOOL saved = LLFloaterSnapshot::saveLocal(); + if (saved) + { + LLFloaterSnapshot::postSave(); + goBack(); + floater->notify(LLSD().with("set-finished", LLSD().with("ok", true).with("msg", "local"))); + } + else + { + cancel(); + } +} diff --git a/indra/newview/llpanelsnapshotoptions.cpp b/indra/newview/llpanelsnapshotoptions.cpp new file mode 100644 index 0000000000..554fabe5b3 --- /dev/null +++ b/indra/newview/llpanelsnapshotoptions.cpp @@ -0,0 +1,120 @@ +/** + * @file llpanelsnapshotoptions.cpp + * @brief Snapshot posting options panel. + * + * $LicenseInfo:firstyear=2011&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2011, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" + +#include "lleconomy.h" +#include "llpanel.h" +#include "llsidetraypanelcontainer.h" + +#include "llfloatersnapshot.h" // FIXME: create a snapshot model + +/** + * Provides several ways to save a snapshot. + */ +class LLPanelSnapshotOptions +: public LLPanel +, public LLEconomyObserver +{ + LOG_CLASS(LLPanelSnapshotOptions); + +public: + LLPanelSnapshotOptions(); + ~LLPanelSnapshotOptions(); + /*virtual*/ void onOpen(const LLSD& key); + /*virtual*/ void onEconomyDataChange() { updateUploadCost(); } + +private: + void updateUploadCost(); + void openPanel(const std::string& panel_name); + void onSaveToProfile(); + void onSaveToEmail(); + void onSaveToInventory(); + void onSaveToComputer(); +}; + +static LLRegisterPanelClassWrapper<LLPanelSnapshotOptions> panel_class("llpanelsnapshotoptions"); + +LLPanelSnapshotOptions::LLPanelSnapshotOptions() +{ + mCommitCallbackRegistrar.add("Snapshot.SaveToProfile", boost::bind(&LLPanelSnapshotOptions::onSaveToProfile, this)); + mCommitCallbackRegistrar.add("Snapshot.SaveToEmail", boost::bind(&LLPanelSnapshotOptions::onSaveToEmail, this)); + mCommitCallbackRegistrar.add("Snapshot.SaveToInventory", boost::bind(&LLPanelSnapshotOptions::onSaveToInventory, this)); + mCommitCallbackRegistrar.add("Snapshot.SaveToComputer", boost::bind(&LLPanelSnapshotOptions::onSaveToComputer, this)); + + LLGlobalEconomy::Singleton::getInstance()->addObserver(this); +} + +LLPanelSnapshotOptions::~LLPanelSnapshotOptions() +{ + LLGlobalEconomy::Singleton::getInstance()->removeObserver(this); +} + +// virtual +void LLPanelSnapshotOptions::onOpen(const LLSD& key) +{ + updateUploadCost(); +} + +void LLPanelSnapshotOptions::updateUploadCost() +{ + S32 upload_cost = LLGlobalEconomy::Singleton::getInstance()->getPriceUpload(); + getChild<LLUICtrl>("save_to_inventory_btn")->setLabelArg("[AMOUNT]", llformat("%d", upload_cost)); +} + +void LLPanelSnapshotOptions::openPanel(const std::string& panel_name) +{ + LLSideTrayPanelContainer* parent = dynamic_cast<LLSideTrayPanelContainer*>(getParent()); + if (!parent) + { + llwarns << "Cannot find panel container" << llendl; + return; + } + + parent->openPanel(panel_name); + parent->getCurrentPanel()->onOpen(LLSD()); + LLFloaterSnapshot::postPanelSwitch(); +} + +void LLPanelSnapshotOptions::onSaveToProfile() +{ + openPanel("panel_snapshot_profile"); +} + +void LLPanelSnapshotOptions::onSaveToEmail() +{ + openPanel("panel_snapshot_postcard"); +} + +void LLPanelSnapshotOptions::onSaveToInventory() +{ + openPanel("panel_snapshot_inventory"); +} + +void LLPanelSnapshotOptions::onSaveToComputer() +{ + openPanel("panel_snapshot_local"); +} diff --git a/indra/newview/llpanelsnapshotpostcard.cpp b/indra/newview/llpanelsnapshotpostcard.cpp new file mode 100644 index 0000000000..f2bb8f530b --- /dev/null +++ b/indra/newview/llpanelsnapshotpostcard.cpp @@ -0,0 +1,270 @@ +/** + * @file llpanelsnapshotpostcard.cpp + * @brief Postcard sending panel. + * + * $LicenseInfo:firstyear=2011&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2011, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" + +#include "llcombobox.h" +#include "llnotificationsutil.h" +#include "llsidetraypanelcontainer.h" +#include "llsliderctrl.h" +#include "llspinctrl.h" +#include "lltexteditor.h" + +#include "llagent.h" +#include "llagentui.h" +#include "llfloatersnapshot.h" // FIXME: replace with a snapshot storage model +#include "llpanelsnapshot.h" +#include "llpostcard.h" +#include "llviewercontrol.h" // gSavedSettings +#include "llviewerwindow.h" + +#include <boost/regex.hpp> + +/** + * Sends postcard via email. + */ +class LLPanelSnapshotPostcard +: public LLPanelSnapshot +{ + LOG_CLASS(LLPanelSnapshotPostcard); + +public: + LLPanelSnapshotPostcard(); + /*virtual*/ BOOL postBuild(); + /*virtual*/ void onOpen(const LLSD& key); + /*virtual*/ S32 notify(const LLSD& info); + +private: + /*virtual*/ std::string getWidthSpinnerName() const { return "postcard_snapshot_width"; } + /*virtual*/ std::string getHeightSpinnerName() const { return "postcard_snapshot_height"; } + /*virtual*/ std::string getAspectRatioCBName() const { return "postcard_keep_aspect_check"; } + /*virtual*/ std::string getImageSizeComboName() const { return "postcard_size_combo"; } + /*virtual*/ std::string getImageSizePanelName() const { return "postcard_image_size_lp"; } + /*virtual*/ LLFloaterSnapshot::ESnapshotFormat getImageFormat() const { return LLFloaterSnapshot::SNAPSHOT_FORMAT_JPEG; } + /*virtual*/ void updateControls(const LLSD& info); + + bool missingSubjMsgAlertCallback(const LLSD& notification, const LLSD& response); + void sendPostcard(); + + void onMsgFormFocusRecieved(); + void onFormatComboCommit(LLUICtrl* ctrl); + void onQualitySliderCommit(LLUICtrl* ctrl); + void onTabButtonPress(S32 btn_idx); + void onSend(); + + bool mHasFirstMsgFocus; + std::string mAgentEmail; +}; + +static LLRegisterPanelClassWrapper<LLPanelSnapshotPostcard> panel_class("llpanelsnapshotpostcard"); + +LLPanelSnapshotPostcard::LLPanelSnapshotPostcard() +: mHasFirstMsgFocus(false) +{ + mCommitCallbackRegistrar.add("Postcard.Send", boost::bind(&LLPanelSnapshotPostcard::onSend, this)); + mCommitCallbackRegistrar.add("Postcard.Cancel", boost::bind(&LLPanelSnapshotPostcard::cancel, this)); + mCommitCallbackRegistrar.add("Postcard.Message", boost::bind(&LLPanelSnapshotPostcard::onTabButtonPress, this, 0)); + mCommitCallbackRegistrar.add("Postcard.Settings", boost::bind(&LLPanelSnapshotPostcard::onTabButtonPress, this, 1)); + +} + +// virtual +BOOL LLPanelSnapshotPostcard::postBuild() +{ + // pick up the user's up-to-date email address + gAgent.sendAgentUserInfoRequest(); + + std::string name_string; + LLAgentUI::buildFullname(name_string); + getChild<LLUICtrl>("name_form")->setValue(LLSD(name_string)); + + // For the first time a user focuses to .the msg box, all text will be selected. + getChild<LLUICtrl>("msg_form")->setFocusChangedCallback(boost::bind(&LLPanelSnapshotPostcard::onMsgFormFocusRecieved, this)); + + getChild<LLUICtrl>("to_form")->setFocus(TRUE); + + getChild<LLUICtrl>("image_quality_slider")->setCommitCallback(boost::bind(&LLPanelSnapshotPostcard::onQualitySliderCommit, this, _1)); + + getChild<LLButton>("message_btn")->setToggleState(TRUE); + + return LLPanelSnapshot::postBuild(); +} + +// virtual +void LLPanelSnapshotPostcard::onOpen(const LLSD& key) +{ + LLPanelSnapshot::onOpen(key); +} + +// virtual +S32 LLPanelSnapshotPostcard::notify(const LLSD& info) +{ + if (!info.has("agent-email")) + { + llassert(info.has("agent-email")); + return 0; + } + + if (mAgentEmail.empty()) + { + mAgentEmail = info["agent-email"].asString(); + } + + return 1; +} + +// virtual +void LLPanelSnapshotPostcard::updateControls(const LLSD& info) +{ + getChild<LLUICtrl>("image_quality_slider")->setValue(gSavedSettings.getS32("SnapshotQuality")); + updateImageQualityLevel(); + + const bool have_snapshot = info.has("have-snapshot") ? info["have-snapshot"].asBoolean() : true; + getChild<LLUICtrl>("send_btn")->setEnabled(have_snapshot); +} + +bool LLPanelSnapshotPostcard::missingSubjMsgAlertCallback(const LLSD& notification, const LLSD& response) +{ + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); + if(0 == option) + { + // User clicked OK + if((getChild<LLUICtrl>("subject_form")->getValue().asString()).empty()) + { + // Stuff the subject back into the form. + getChild<LLUICtrl>("subject_form")->setValue(getString("default_subject")); + } + + if (!mHasFirstMsgFocus) + { + // The user never switched focus to the message window. + // Using the default string. + getChild<LLUICtrl>("msg_form")->setValue(getString("default_message")); + } + + sendPostcard(); + } + return false; +} + + +void LLPanelSnapshotPostcard::sendPostcard() +{ + std::string to(getChild<LLUICtrl>("to_form")->getValue().asString()); + std::string subject(getChild<LLUICtrl>("subject_form")->getValue().asString()); + + LLSD postcard = LLSD::emptyMap(); + postcard["pos-global"] = LLFloaterSnapshot::getPosTakenGlobal().getValue(); + postcard["to"] = to; + postcard["from"] = mAgentEmail; + postcard["name"] = getChild<LLUICtrl>("name_form")->getValue().asString(); + postcard["subject"] = subject; + postcard["msg"] = getChild<LLUICtrl>("msg_form")->getValue().asString(); + LLPostCard::send(LLFloaterSnapshot::getImageData(), postcard); + + // Give user feedback of the event. + gViewerWindow->playSnapshotAnimAndSound(); + + LLFloaterSnapshot::postSave(); +} + +void LLPanelSnapshotPostcard::onMsgFormFocusRecieved() +{ + LLTextEditor* msg_form = getChild<LLTextEditor>("msg_form"); + if (msg_form->hasFocus() && !mHasFirstMsgFocus) + { + mHasFirstMsgFocus = true; + msg_form->setText(LLStringUtil::null); + } +} + +void LLPanelSnapshotPostcard::onFormatComboCommit(LLUICtrl* ctrl) +{ + // will call updateControls() + LLFloaterSnapshot::getInstance()->notify(LLSD().with("image-format-change", true)); +} + +void LLPanelSnapshotPostcard::onQualitySliderCommit(LLUICtrl* ctrl) +{ + updateImageQualityLevel(); + + LLSliderCtrl* slider = (LLSliderCtrl*)ctrl; + S32 quality_val = llfloor((F32)slider->getValue().asReal()); + LLSD info; + info["image-quality-change"] = quality_val; + LLFloaterSnapshot::getInstance()->notify(info); // updates the "SnapshotQuality" setting +} + +void LLPanelSnapshotPostcard::onTabButtonPress(S32 btn_idx) +{ + LLButton* buttons[2] = { + getChild<LLButton>("message_btn"), + getChild<LLButton>("settings_btn"), + }; + + // Switch between Message and Settings tabs. + LLButton* clicked_btn = buttons[btn_idx]; + LLButton* other_btn = buttons[!btn_idx]; + LLSideTrayPanelContainer* container = + getChild<LLSideTrayPanelContainer>("postcard_panel_container"); + + container->selectTab(clicked_btn->getToggleState() ? btn_idx : !btn_idx); + //clicked_btn->setEnabled(FALSE); + other_btn->toggleState(); + //other_btn->setEnabled(TRUE); + + lldebugs << "Button #" << btn_idx << " (" << clicked_btn->getName() << ") clicked" << llendl; +} + +void LLPanelSnapshotPostcard::onSend() +{ + // Validate input. + std::string to(getChild<LLUICtrl>("to_form")->getValue().asString()); + + boost::regex email_format("[A-Za-z0-9.%+-_]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}(,[ \t]*[A-Za-z0-9.%+-_]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,})*"); + + if (to.empty() || !boost::regex_match(to, email_format)) + { + LLNotificationsUtil::add("PromptRecipientEmail"); + return; + } + + if (mAgentEmail.empty() || !boost::regex_match(mAgentEmail, email_format)) + { + LLNotificationsUtil::add("PromptSelfEmail"); + return; + } + + std::string subject(getChild<LLUICtrl>("subject_form")->getValue().asString()); + if(subject.empty() || !mHasFirstMsgFocus) + { + LLNotificationsUtil::add("PromptMissingSubjMsg", LLSD(), LLSD(), boost::bind(&LLPanelSnapshotPostcard::missingSubjMsgAlertCallback, this, _1, _2)); + return; + } + + // Send postcard. + sendPostcard(); +} diff --git a/indra/newview/llpanelsnapshotprofile.cpp b/indra/newview/llpanelsnapshotprofile.cpp new file mode 100644 index 0000000000..a706318369 --- /dev/null +++ b/indra/newview/llpanelsnapshotprofile.cpp @@ -0,0 +1,101 @@ +/** + * @file llpanelsnapshotprofile.cpp + * @brief Posts a snapshot to My Profile feed. + * + * $LicenseInfo:firstyear=2011&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2011, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" + +// libs +#include "llcombobox.h" +#include "llfloaterreg.h" +#include "llpanel.h" +#include "llspinctrl.h" + +// newview +#include "llfloatersnapshot.h" +#include "llpanelsnapshot.h" +#include "llsidetraypanelcontainer.h" +#include "llwebprofile.h" + +/** + * Posts a snapshot to My Profile feed. + */ +class LLPanelSnapshotProfile +: public LLPanelSnapshot +{ + LOG_CLASS(LLPanelSnapshotProfile); + +public: + LLPanelSnapshotProfile(); + + /*virtual*/ BOOL postBuild(); + /*virtual*/ void onOpen(const LLSD& key); + +private: + /*virtual*/ std::string getWidthSpinnerName() const { return "profile_snapshot_width"; } + /*virtual*/ std::string getHeightSpinnerName() const { return "profile_snapshot_height"; } + /*virtual*/ std::string getAspectRatioCBName() const { return "profile_keep_aspect_check"; } + /*virtual*/ std::string getImageSizeComboName() const { return "profile_size_combo"; } + /*virtual*/ std::string getImageSizePanelName() const { return "profile_image_size_lp"; } + /*virtual*/ LLFloaterSnapshot::ESnapshotFormat getImageFormat() const { return LLFloaterSnapshot::SNAPSHOT_FORMAT_PNG; } + /*virtual*/ void updateControls(const LLSD& info); + + void onSend(); +}; + +static LLRegisterPanelClassWrapper<LLPanelSnapshotProfile> panel_class("llpanelsnapshotprofile"); + +LLPanelSnapshotProfile::LLPanelSnapshotProfile() +{ + mCommitCallbackRegistrar.add("PostToProfile.Send", boost::bind(&LLPanelSnapshotProfile::onSend, this)); + mCommitCallbackRegistrar.add("PostToProfile.Cancel", boost::bind(&LLPanelSnapshotProfile::cancel, this)); +} + +// virtual +BOOL LLPanelSnapshotProfile::postBuild() +{ + return LLPanelSnapshot::postBuild(); +} + +// virtual +void LLPanelSnapshotProfile::onOpen(const LLSD& key) +{ + LLPanelSnapshot::onOpen(key); +} + +// virtual +void LLPanelSnapshotProfile::updateControls(const LLSD& info) +{ + const bool have_snapshot = info.has("have-snapshot") ? info["have-snapshot"].asBoolean() : true; + getChild<LLUICtrl>("post_btn")->setEnabled(have_snapshot); +} + +void LLPanelSnapshotProfile::onSend() +{ + std::string caption = getChild<LLUICtrl>("caption")->getValue().asString(); + bool add_location = getChild<LLUICtrl>("add_location_cb")->getValue().asBoolean(); + + LLWebProfile::uploadImage(LLFloaterSnapshot::getImageData(), caption, add_location); + LLFloaterSnapshot::postSave(); +} diff --git a/indra/newview/llpaneltopinfobar.cpp b/indra/newview/llpaneltopinfobar.cpp index 5ed23d2f42..eb4c7572d4 100644 --- a/indra/newview/llpaneltopinfobar.cpp +++ b/indra/newview/llpaneltopinfobar.cpp @@ -203,6 +203,11 @@ void LLPanelTopInfoBar::onVisibilityChange(const LLSD& show) gFloaterView->setMinimizePositionVerticalOffset(minimize_pos_offset); } +boost::signals2::connection LLPanelTopInfoBar::setResizeCallback( const resize_signal_t::slot_type& cb ) +{ + return mResizeSignal.connect(cb); +} + void LLPanelTopInfoBar::draw() { updateParcelInfoText(); @@ -224,6 +229,7 @@ void LLPanelTopInfoBar::buildLocationString(std::string& loc_str, bool show_coor void LLPanelTopInfoBar::setParcelInfoText(const std::string& new_text) { + LLRect old_rect = getRect(); const LLFontGL* font = mParcelInfoText->getDefaultFont(); S32 new_text_width = font->getWidth(new_text); @@ -235,6 +241,11 @@ void LLPanelTopInfoBar::setParcelInfoText(const std::string& new_text) mParcelInfoText->reshape(rect.getWidth(), rect.getHeight(), TRUE); mParcelInfoText->setRect(rect); layoutParcelIcons(); + + if (old_rect != getRect()) + { + mResizeSignal(); + } } void LLPanelTopInfoBar::update() @@ -342,6 +353,8 @@ void LLPanelTopInfoBar::updateHealth() void LLPanelTopInfoBar::layoutParcelIcons() { + LLRect old_rect = getRect(); + // TODO: remove hard-coded values and read them as xml parameters static const int FIRST_ICON_HPAD = 32; static const int LAST_ICON_HPAD = 11; @@ -358,6 +371,11 @@ void LLPanelTopInfoBar::layoutParcelIcons() LLRect rect = getRect(); rect.set(rect.mLeft, rect.mTop, left + LAST_ICON_HPAD, rect.mBottom); setRect(rect); + + if (old_rect != getRect()) + { + mResizeSignal(); + } } S32 LLPanelTopInfoBar::layoutWidget(LLUICtrl* ctrl, S32 left) diff --git a/indra/newview/llpaneltopinfobar.h b/indra/newview/llpaneltopinfobar.h index e934b522be..d58d95be90 100644 --- a/indra/newview/llpaneltopinfobar.h +++ b/indra/newview/llpaneltopinfobar.h @@ -41,6 +41,8 @@ class LLPanelTopInfoBar : public LLPanel, public LLSingleton<LLPanelTopInfoBar>, friend class LLDestroyClass<LLPanelTopInfoBar>; public: + typedef boost::signals2::signal<void ()> resize_signal_t; + LLPanelTopInfoBar(); ~LLPanelTopInfoBar(); @@ -57,6 +59,8 @@ public: */ void onVisibilityChange(const LLSD& show); + boost::signals2::connection setResizeCallback( const resize_signal_t::slot_type& cb ); + private: class LLParcelChangeObserver; @@ -167,6 +171,8 @@ private: boost::signals2::connection mParcelPropsCtrlConnection; boost::signals2::connection mShowCoordsCtrlConnection; boost::signals2::connection mParcelMgrConnection; + + resize_signal_t mResizeSignal; }; #endif /* LLPANELTOPINFOBAR_H_ */ diff --git a/indra/newview/llparticipantlist.cpp b/indra/newview/llparticipantlist.cpp index fb1153980a..5c95e805ce 100644 --- a/indra/newview/llparticipantlist.cpp +++ b/indra/newview/llparticipantlist.cpp @@ -468,7 +468,7 @@ void LLParticipantList::setValidateSpeakerCallback(validate_speaker_callback_t c void LLParticipantList::updateRecentSpeakersOrder() { - if (E_SORT_BY_RECENT_SPEAKERS == getSortOrder()) + if (E_SORT_BY_RECENT_SPEAKERS == getSortOrder() && !isHovered()) { // Need to update speakers to sort list correctly mSpeakerMgr->update(true); @@ -477,6 +477,13 @@ void LLParticipantList::updateRecentSpeakersOrder() } } +bool LLParticipantList::isHovered() +{ + S32 x, y; + LLUI::getMousePositionScreen(&x, &y); + return mAvatarList->calcScreenRect().pointInRect(x, y); +} + bool LLParticipantList::onAddItemEvent(LLPointer<LLOldEvents::LLEvent> event, const LLSD& userdata) { LLUUID uu_id = event->getValue().asUUID(); diff --git a/indra/newview/llparticipantlist.h b/indra/newview/llparticipantlist.h index e0b3d42c25..a001d29b67 100644 --- a/indra/newview/llparticipantlist.h +++ b/indra/newview/llparticipantlist.h @@ -251,6 +251,8 @@ private: */ void adjustParticipant(const LLUUID& speaker_id); + bool isHovered(); + LLSpeakerMgr* mSpeakerMgr; LLAvatarList* mAvatarList; diff --git a/indra/newview/llpostcard.cpp b/indra/newview/llpostcard.cpp new file mode 100644 index 0000000000..4f2d6da7e5 --- /dev/null +++ b/indra/newview/llpostcard.cpp @@ -0,0 +1,155 @@ +/** + * @file llpostcard.cpp + * @brief Sending postcards. + * + * $LicenseInfo:firstyear=2011&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2011, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" + +#include "llpostcard.h" + +#include "llvfile.h" +#include "llvfs.h" +#include "llviewerregion.h" + +#include "message.h" + +#include "llagent.h" +#include "llassetuploadresponders.h" + +/////////////////////////////////////////////////////////////////////////////// +// misc + +static void postcard_upload_callback(const LLUUID& asset_id, void *user_data, S32 result, LLExtStat ext_status) +{ + LLSD* postcard_data = (LLSD*)user_data; + + if (result) + { + // TODO: display the error messages in UI + llwarns << "Failed to send postcard: " << LLAssetStorage::getErrorString(result) << llendl; + LLPostCard::reportPostResult(false); + } + else + { + // only create the postcard once the upload succeeds + + // request the postcard + const LLSD& data = *postcard_data; + LLMessageSystem* msg = gMessageSystem; + msg->newMessage("SendPostcard"); + msg->nextBlock("AgentData"); + msg->addUUID("AgentID", gAgent.getID()); + msg->addUUID("SessionID", gAgent.getSessionID()); + msg->addUUID("AssetID", data["asset-id"].asUUID()); + msg->addVector3d("PosGlobal", LLVector3d(data["pos-global"])); + msg->addString("To", data["to"]); + msg->addString("From", data["from"]); + msg->addString("Name", data["name"]); + msg->addString("Subject", data["subject"]); + msg->addString("Msg", data["msg"]); + msg->addBOOL("AllowPublish", FALSE); + msg->addBOOL("MaturePublish", FALSE); + gAgent.sendReliableMessage(); + + LLPostCard::reportPostResult(true); + } + + delete postcard_data; +} + + +/////////////////////////////////////////////////////////////////////////////// +// LLPostcardSendResponder + +class LLPostcardSendResponder : public LLAssetUploadResponder +{ + LOG_CLASS(LLPostcardSendResponder); + +public: + LLPostcardSendResponder(const LLSD &post_data, + const LLUUID& vfile_id, + LLAssetType::EType asset_type): + LLAssetUploadResponder(post_data, vfile_id, asset_type) + { + } + + /*virtual*/ void uploadComplete(const LLSD& content) + { + llinfos << "Postcard sent" << llendl; + LL_DEBUGS("Snapshots") << "content: " << content << llendl; + LLPostCard::reportPostResult(true); + } + + /*virtual*/ void uploadFailure(const LLSD& content) + { + llwarns << "Sending postcard failed: " << content << llendl; + LLPostCard::reportPostResult(false); + } +}; + +/////////////////////////////////////////////////////////////////////////////// +// LLPostCard + +LLPostCard::result_callback_t LLPostCard::mResultCallback; + +// static +void LLPostCard::send(LLPointer<LLImageFormatted> image, const LLSD& postcard_data) +{ + LLTransactionID transaction_id; + LLAssetID asset_id; + + transaction_id.generate(); + asset_id = transaction_id.makeAssetID(gAgent.getSecureSessionID()); + LLVFile::writeFile(image->getData(), image->getDataSize(), gVFS, asset_id, LLAssetType::AT_IMAGE_JPEG); + + // upload the image + std::string url = gAgent.getRegion()->getCapability("SendPostcard"); + if (!url.empty()) + { + llinfos << "Sending postcard via capability" << llendl; + // the capability already encodes: agent ID, region ID + LL_DEBUGS("Snapshots") << "url: " << url << llendl; + LL_DEBUGS("Snapshots") << "body: " << postcard_data << llendl; + LL_DEBUGS("Snapshots") << "data size: " << image->getDataSize() << llendl; + LLHTTPClient::post(url, postcard_data, + new LLPostcardSendResponder(postcard_data, asset_id, LLAssetType::AT_IMAGE_JPEG)); + } + else + { + llinfos << "Sending postcard" << llendl; + LLSD* data = new LLSD(postcard_data); + (*data)["asset-id"] = asset_id; + gAssetStorage->storeAssetData(transaction_id, LLAssetType::AT_IMAGE_JPEG, + &postcard_upload_callback, (void *)data, FALSE); + } +} + +// static +void LLPostCard::reportPostResult(bool ok) +{ + if (mResultCallback) + { + mResultCallback(ok); + } +} diff --git a/indra/newview/llpostcard.h b/indra/newview/llpostcard.h new file mode 100644 index 0000000000..0eb118b906 --- /dev/null +++ b/indra/newview/llpostcard.h @@ -0,0 +1,48 @@ +/** + * @file llpostcard.h + * @brief Sending postcards. + * + * $LicenseInfo:firstyear=2011&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2011, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#ifndef LL_LLPOSTCARD_H +#define LL_LLPOSTCARD_H + +#include "llimage.h" +#include "lluuid.h" + +class LLPostCard +{ + LOG_CLASS(LLPostCard); + +public: + typedef boost::function<void(bool ok)> result_callback_t; + + static void send(LLPointer<LLImageFormatted> image, const LLSD& postcard_data); + static void setPostResultCallback(result_callback_t cb) { mResultCallback = cb; } + static void reportPostResult(bool ok); + +private: + static result_callback_t mResultCallback; +}; + +#endif // LL_LLPOSTCARD_H diff --git a/indra/newview/llpreview.cpp b/indra/newview/llpreview.cpp index 119fc95cf0..18626e3273 100644 --- a/indra/newview/llpreview.cpp +++ b/indra/newview/llpreview.cpp @@ -363,8 +363,10 @@ void LLPreview::onBtnCopyToInv(void* userdata) // Copy to inventory if (self->mNotecardInventoryID.notNull()) { - copy_inventory_from_notecard(self->mNotecardObjectID, - self->mNotecardInventoryID, item); + copy_inventory_from_notecard(LLUUID::null, + self->mNotecardObjectID, + self->mNotecardInventoryID, + item); } else { diff --git a/indra/newview/llpreviewtexture.cpp b/indra/newview/llpreviewtexture.cpp index 18d6731fcb..3ff5a05d81 100644 --- a/indra/newview/llpreviewtexture.cpp +++ b/indra/newview/llpreviewtexture.cpp @@ -169,7 +169,7 @@ void LLPreviewTexture::draw() saveAs(); } // Draw the texture - glColor3f( 1.f, 1.f, 1.f ); + gGL.diffuseColor3f( 1.f, 1.f, 1.f ); gl_draw_scaled_image(interior.mLeft, interior.mBottom, interior.getWidth(), diff --git a/indra/newview/llprogressview.cpp b/indra/newview/llprogressview.cpp index a1f38f1854..5d7a5b1c59 100644 --- a/indra/newview/llprogressview.cpp +++ b/indra/newview/llprogressview.cpp @@ -187,7 +187,7 @@ void LLProgressView::setVisible(BOOL visible) void LLProgressView::drawStartTexture(F32 alpha) { - glPushMatrix(); + gGL.pushMatrix(); if (gStartTexture) { LLGLSUIDefault gls_ui; @@ -200,13 +200,13 @@ void LLProgressView::drawStartTexture(F32 alpha) // stretch image to maintain aspect ratio if (image_aspect > view_aspect) { - glTranslatef(-0.5f * (image_aspect / view_aspect - 1.f) * width, 0.f, 0.f); - glScalef(image_aspect / view_aspect, 1.f, 1.f); + gGL.translatef(-0.5f * (image_aspect / view_aspect - 1.f) * width, 0.f, 0.f); + gGL.scalef(image_aspect / view_aspect, 1.f, 1.f); } else { - glTranslatef(0.f, -0.5f * (view_aspect / image_aspect - 1.f) * height, 0.f); - glScalef(1.f, view_aspect / image_aspect, 1.f); + gGL.translatef(0.f, -0.5f * (view_aspect / image_aspect - 1.f) * height, 0.f); + gGL.scalef(1.f, view_aspect / image_aspect, 1.f); } gl_rect_2d_simple_tex( getRect().getWidth(), getRect().getHeight() ); gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); @@ -217,7 +217,7 @@ void LLProgressView::drawStartTexture(F32 alpha) gGL.color4f(0.f, 0.f, 0.f, 1.f); gl_rect_2d(getRect()); } - glPopMatrix(); + gGL.popMatrix(); } diff --git a/indra/newview/llscreenchannel.cpp b/indra/newview/llscreenchannel.cpp index 45cf81751b..5301955964 100644 --- a/indra/newview/llscreenchannel.cpp +++ b/indra/newview/llscreenchannel.cpp @@ -53,13 +53,22 @@ LLFastTimer::DeclareTimer FTM_GET_CHANNEL_RECT("Calculate Notification Channel R LLRect LLScreenChannelBase::getChannelRect() { LLFastTimer _(FTM_GET_CHANNEL_RECT); + + if (mFloaterSnapRegion == NULL) + { + mFloaterSnapRegion = gViewerWindow->getRootView()->getChildView("floater_snap_region"); + } + + if (mChicletRegion == NULL) + { + mChicletRegion = gViewerWindow->getRootView()->getChildView("chiclet_container"); + } + LLRect channel_rect; LLRect chiclet_rect; - LLView* floater_snap_region = gViewerWindow->getRootView()->getChildView("floater_snap_region"); - floater_snap_region->localRectToScreen(floater_snap_region->getLocalRect(), &channel_rect); - LLView* chiclet_region = gViewerWindow->getRootView()->getChildView("chiclet_container"); - chiclet_region->localRectToScreen(chiclet_region->getLocalRect(), &chiclet_rect); + mFloaterSnapRegion->localRectToScreen(mFloaterSnapRegion->getLocalRect(), &channel_rect); + mChicletRegion->localRectToScreen(mChicletRegion->getLocalRect(), &chiclet_rect); channel_rect.mTop = chiclet_rect.mBottom; return channel_rect; @@ -81,14 +90,31 @@ LLScreenChannelBase::LLScreenChannelBase(const Params& p) mShowToasts(true), mID(p.id), mDisplayToastsAlways(p.display_toasts_always), - mChannelAlignment(p.channel_align) -{ + mChannelAlignment(p.channel_align), + mFloaterSnapRegion(NULL), + mChicletRegion(NULL) +{ mID = p.id; setMouseOpaque( false ); setVisible(FALSE); } +BOOL LLScreenChannelBase::postBuild() +{ + if (mFloaterSnapRegion == NULL) + { + mFloaterSnapRegion = gViewerWindow->getRootView()->getChildView("floater_snap_region"); + } + + if (mChicletRegion == NULL) + { + mChicletRegion = gViewerWindow->getRootView()->getChildView("chiclet_container"); + } + + return TRUE; +} + void LLScreenChannelBase::reshape(S32 width, S32 height, BOOL called_from_parent) { redrawToasts(); @@ -473,12 +499,10 @@ void LLScreenChannel::modifyToastByNotificationID(LLUUID id, LLPanel* panel) //-------------------------------------------------------------------------- void LLScreenChannel::redrawToasts() { - LLView* floater_snap_region = gViewerWindow->getRootView()->getChildView("floater_snap_region"); - if (!getParent()) { // connect to floater snap region just to get resize events, we don't care about being a proper widget - floater_snap_region->addChild(this); + mFloaterSnapRegion->addChild(this); setFollows(FOLLOWS_ALL); } @@ -708,6 +732,8 @@ void LLScreenChannel::showToastsTop() //-------------------------------------------------------------------------- void LLScreenChannel::createStartUpToast(S32 notif_num, F32 timer) { + LLScreenChannelBase::updateRect(); + LLRect toast_rect; LLToast::Params p; p.lifetime_secs = timer; @@ -730,13 +756,10 @@ void LLScreenChannel::createStartUpToast(S32 notif_num, F32 timer) text_box->setValue(text); text_box->setVisible(TRUE); - S32 old_height = text_box->getRect().getHeight(); text_box->reshapeToFitText(); text_box->setOrigin(text_box->getRect().mLeft, (wrapper_panel->getRect().getHeight() - text_box->getRect().getHeight())/2); - S32 new_height = text_box->getRect().getHeight(); - S32 height_delta = new_height - old_height; - toast_rect.setLeftTopAndSize(0, toast_rect.getHeight() + height_delta +gSavedSettings.getS32("ToastGap"), getRect().getWidth(), toast_rect.getHeight()); + toast_rect.setLeftTopAndSize(0, getRect().getHeight() - gSavedSettings.getS32("ToastGap"), getRect().getWidth(), toast_rect.getHeight()); mStartUpToastPanel->setRect(toast_rect); addChild(mStartUpToastPanel); diff --git a/indra/newview/llscreenchannel.h b/indra/newview/llscreenchannel.h index 2f23552828..c9f8855fe6 100644 --- a/indra/newview/llscreenchannel.h +++ b/indra/newview/llscreenchannel.h @@ -69,6 +69,8 @@ public: }; LLScreenChannelBase(const Params&); + + BOOL postBuild(); void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE); @@ -123,7 +125,7 @@ protected: // Channel's flags bool mControlHovering; - LLToast* mHoveredToast; + LLToast* mHoveredToast; bool mCanStoreToasts; bool mDisplayToastsAlways; // controls whether a channel shows toasts or not @@ -137,6 +139,9 @@ protected: // channel's ID LLUUID mID; + + LLView* mFloaterSnapRegion; + LLView* mChicletRegion; }; diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index 733902ad30..5d0d1ef9a3 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -89,6 +89,7 @@ #include "llvoavatarself.h" #include "llvovolume.h" #include "pipeline.h" +#include "llviewershadermgr.h" #include "llglheaders.h" @@ -4837,7 +4838,7 @@ void LLSelectMgr::processForceObjectSelect(LLMessageSystem* msg, void**) LLSelectMgr::getInstance()->highlightObjectAndFamily(objects); } -extern LLGLdouble gGLModelView[16]; +extern F32 gGLModelView[16]; void LLSelectMgr::updateSilhouettes() { @@ -5133,20 +5134,20 @@ void LLSelectMgr::renderSilhouettes(BOOL for_hud) F32 cur_zoom = gAgentCamera.mHUDCurZoom; // set up transform to encompass bounding box of HUD - glMatrixMode(GL_PROJECTION); + gGL.matrixMode(LLRender::MM_PROJECTION); gGL.pushMatrix(); - glLoadIdentity(); + gGL.loadIdentity(); F32 depth = llmax(1.f, hud_bbox.getExtentLocal().mV[VX] * 1.1f); - glOrtho(-0.5f * LLViewerCamera::getInstance()->getAspect(), 0.5f * LLViewerCamera::getInstance()->getAspect(), -0.5f, 0.5f, 0.f, depth); + gGL.ortho(-0.5f * LLViewerCamera::getInstance()->getAspect(), 0.5f * LLViewerCamera::getInstance()->getAspect(), -0.5f, 0.5f, 0.f, depth); - glMatrixMode(GL_MODELVIEW); + gGL.matrixMode(LLRender::MM_MODELVIEW); gGL.pushMatrix(); gGL.pushUIMatrix(); gGL.loadUIIdentity(); - glLoadIdentity(); - glLoadMatrixf(OGL_TO_CFR_ROTATION); // Load Cory's favorite reference frame - glTranslatef(-hud_bbox.getCenterLocal().mV[VX] + (depth *0.5f), 0.f, 0.f); - glScalef(cur_zoom, cur_zoom, cur_zoom); + gGL.loadIdentity(); + gGL.loadMatrix(OGL_TO_CFR_ROTATION); // Load Cory's favorite reference frame + gGL.translatef(-hud_bbox.getCenterLocal().mV[VX] + (depth *0.5f), 0.f, 0.f); + gGL.scalef(cur_zoom, cur_zoom, cur_zoom); } if (mSelectedObjects->getNumNodes()) { @@ -5239,10 +5240,10 @@ void LLSelectMgr::renderSilhouettes(BOOL for_hud) if (isAgentAvatarValid() && for_hud) { - glMatrixMode(GL_PROJECTION); + gGL.matrixMode(LLRender::MM_PROJECTION); gGL.popMatrix(); - glMatrixMode(GL_MODELVIEW); + gGL.matrixMode(LLRender::MM_MODELVIEW); gGL.popMatrix(); gGL.popUIMatrix(); stop_glerror(); @@ -5566,12 +5567,11 @@ void pushWireframe(LLDrawable* drawable) { LLVertexBuffer::unbind(); gGL.pushMatrix(); - glMultMatrixf((F32*) vobj->getRelativeXform().mMatrix); + gGL.multMatrix((F32*) vobj->getRelativeXform().mMatrix); for (S32 i = 0; i < rigged_volume->getNumVolumeFaces(); ++i) { const LLVolumeFace& face = rigged_volume->getVolumeFace(i); - glVertexPointer(3, GL_FLOAT, 16, face.mPositions); - glDrawElements(GL_TRIANGLES, face.mNumIndices, GL_UNSIGNED_SHORT, face.mIndices); + LLVertexBuffer::drawElements(LLRender::TRIANGLES, face.mPositions, face.mTexCoords, face.mNumIndices, face.mIndices); } gGL.popMatrix(); } @@ -5584,7 +5584,7 @@ void pushWireframe(LLDrawable* drawable) LLFace* face = drawable->getFace(i); if (face->verify()) { - pushVerts(face, LLVertexBuffer::MAP_VERTEX); + pushVerts(face, LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_TEXCOORD0); } } } @@ -5604,22 +5604,29 @@ void LLSelectNode::renderOneWireframe(const LLColor4& color) return; } - glMatrixMode(GL_MODELVIEW); + LLGLSLShader* shader = LLGLSLShader::sCurBoundShaderPtr; + + if (shader) + { + gHighlightProgram.bind(); + } + + gGL.matrixMode(LLRender::MM_MODELVIEW); gGL.pushMatrix(); BOOL is_hud_object = objectp->isHUDAttachment(); if (drawable->isActive()) { - glLoadMatrixd(gGLModelView); - glMultMatrixf((F32*) objectp->getRenderMatrix().mMatrix); + gGL.loadMatrix(gGLModelView); + gGL.multMatrix((F32*) objectp->getRenderMatrix().mMatrix); } else if (!is_hud_object) { - glLoadIdentity(); - glMultMatrixd(gGLModelView); + gGL.loadIdentity(); + gGL.multMatrix(gGLModelView); LLVector3 trans = objectp->getRegion()->getOriginAgent(); - glTranslatef(trans.mV[0], trans.mV[1], trans.mV[2]); + gGL.translatef(trans.mV[0], trans.mV[1], trans.mV[2]); } glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); @@ -5627,26 +5634,35 @@ void LLSelectNode::renderOneWireframe(const LLColor4& color) if (LLSelectMgr::sRenderHiddenSelections) // && gFloaterTools && gFloaterTools->getVisible()) { gGL.blendFunc(LLRender::BF_SOURCE_COLOR, LLRender::BF_ONE); - LLGLEnable fog(GL_FOG); - glFogi(GL_FOG_MODE, GL_LINEAR); - float d = (LLViewerCamera::getInstance()->getPointOfInterest()-LLViewerCamera::getInstance()->getOrigin()).magVec(); - LLColor4 fogCol = color * (F32)llclamp((LLSelectMgr::getInstance()->getSelectionCenterGlobal()-gAgentCamera.getCameraPositionGlobal()).magVec()/(LLSelectMgr::getInstance()->getBBoxOfSelection().getExtentLocal().magVec()*4), 0.0, 1.0); - glFogf(GL_FOG_START, d); - glFogf(GL_FOG_END, d*(1 + (LLViewerCamera::getInstance()->getView() / LLViewerCamera::getInstance()->getDefaultFOV()))); - glFogfv(GL_FOG_COLOR, fogCol.mV); - LLGLDepthTest gls_depth(GL_TRUE, GL_FALSE, GL_GEQUAL); - gGL.setAlphaRejectSettings(LLRender::CF_DEFAULT); + if (shader) { - glColor4f(color.mV[VRED], color.mV[VGREEN], color.mV[VBLUE], 0.4f); + gGL.diffuseColor4f(color.mV[VRED], color.mV[VGREEN], color.mV[VBLUE], 0.4f); pushWireframe(drawable); } + else + { + LLGLEnable fog(GL_FOG); + glFogi(GL_FOG_MODE, GL_LINEAR); + float d = (LLViewerCamera::getInstance()->getPointOfInterest()-LLViewerCamera::getInstance()->getOrigin()).magVec(); + LLColor4 fogCol = color * (F32)llclamp((LLSelectMgr::getInstance()->getSelectionCenterGlobal()-gAgentCamera.getCameraPositionGlobal()).magVec()/(LLSelectMgr::getInstance()->getBBoxOfSelection().getExtentLocal().magVec()*4), 0.0, 1.0); + glFogf(GL_FOG_START, d); + glFogf(GL_FOG_END, d*(1 + (LLViewerCamera::getInstance()->getView() / LLViewerCamera::getInstance()->getDefaultFOV()))); + glFogfv(GL_FOG_COLOR, fogCol.mV); + + gGL.setAlphaRejectSettings(LLRender::CF_DEFAULT); + { + gGL.diffuseColor4f(color.mV[VRED], color.mV[VGREEN], color.mV[VBLUE], 0.4f); + pushWireframe(drawable); + } + } } gGL.flush(); gGL.setSceneBlendType(LLRender::BT_ALPHA); - glColor4f(color.mV[VRED]*2, color.mV[VGREEN]*2, color.mV[VBLUE]*2, LLSelectMgr::sHighlightAlpha*2); + gGL.diffuseColor4f(color.mV[VRED]*2, color.mV[VGREEN]*2, color.mV[VBLUE]*2, LLSelectMgr::sHighlightAlpha*2); + LLGLEnable offset(GL_POLYGON_OFFSET_LINE); glPolygonOffset(3.f, 3.f); glLineWidth(3.f); @@ -5654,6 +5670,11 @@ void LLSelectNode::renderOneWireframe(const LLColor4& color) glLineWidth(1.f); glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); gGL.popMatrix(); + + if (shader) + { + shader->bind(); + } } //----------------------------------------------------------------------------- @@ -5692,21 +5713,29 @@ void LLSelectNode::renderOneSilhouette(const LLColor4 &color) return; } - glMatrixMode(GL_MODELVIEW); + + LLGLSLShader* shader = LLGLSLShader::sCurBoundShaderPtr; + + if (shader) + { //switch to "solid color" program for SH-2690 -- works around driver bug causing bad triangles when rendering silhouettes + gSolidColorProgram.bind(); + } + + gGL.matrixMode(LLRender::MM_MODELVIEW); gGL.pushMatrix(); gGL.pushUIMatrix(); gGL.loadUIIdentity(); if (!is_hud_object) { - glLoadIdentity(); - glMultMatrixd(gGLModelView); + gGL.loadIdentity(); + gGL.multMatrix(gGLModelView); } if (drawable->isActive()) { - glMultMatrixf((F32*) objectp->getRenderMatrix().mMatrix); + gGL.multMatrix((F32*) objectp->getRenderMatrix().mMatrix); } LLVolume *volume = objectp->getVolume(); @@ -5814,6 +5843,11 @@ void LLSelectNode::renderOneSilhouette(const LLColor4 &color) } gGL.popMatrix(); gGL.popUIMatrix(); + + if (shader) + { + shader->bind(); + } } // @@ -6503,7 +6537,7 @@ F32 LLObjectSelection::getSelectedObjectStreamingCost(S32* total_bytes, S32* vis return cost; } -U32 LLObjectSelection::getSelectedObjectTriangleCount() +U32 LLObjectSelection::getSelectedObjectTriangleCount(S32* vcount) { U32 count = 0; for (list_t::iterator iter = mList.begin(); iter != mList.end(); ++iter) @@ -6513,7 +6547,7 @@ U32 LLObjectSelection::getSelectedObjectTriangleCount() if (object) { - count += object->getTriangleCount(); + count += object->getTriangleCount(vcount); } } diff --git a/indra/newview/llselectmgr.h b/indra/newview/llselectmgr.h index 166616e13e..87ada5ac6b 100644 --- a/indra/newview/llselectmgr.h +++ b/indra/newview/llselectmgr.h @@ -286,7 +286,7 @@ public: S32 getSelectedObjectRenderCost(); F32 getSelectedObjectStreamingCost(S32* total_bytes = NULL, S32* visible_bytes = NULL); - U32 getSelectedObjectTriangleCount(); + U32 getSelectedObjectTriangleCount(S32* vcount = NULL); S32 getTECount(); S32 getRootObjectCount(); diff --git a/indra/newview/llsidepanelinventory.cpp b/indra/newview/llsidepanelinventory.cpp index a24f6b24f0..9d069c3996 100644 --- a/indra/newview/llsidepanelinventory.cpp +++ b/indra/newview/llsidepanelinventory.cpp @@ -113,21 +113,13 @@ public: switch (added_category_type) { case LLFolderType::FT_INBOX: + mSidepanelInventory->enableInbox(true); mSidepanelInventory->observeInboxModifications(added_category->getUUID()); break; case LLFolderType::FT_OUTBOX: + mSidepanelInventory->enableOutbox(true); mSidepanelInventory->observeOutboxModifications(added_category->getUUID()); break; - case LLFolderType::FT_NONE: - // HACK until sim update to properly create folder with system type - if (added_category->getName() == "Received Items") - { - mSidepanelInventory->observeInboxModifications(added_category->getUUID()); - } - else if (added_category->getName() == "Merchant Outbox") - { - mSidepanelInventory->observeOutboxModifications(added_category->getUUID()); - } default: break; } @@ -288,7 +280,6 @@ BOOL LLSidepanelInventory::postBuild() gSavedSettings.getControl("InventoryDisplayInbox")->getCommitSignal()->connect(boost::bind(&handleInventoryDisplayInboxChanged)); gSavedSettings.getControl("InventoryDisplayOutbox")->getCommitSignal()->connect(boost::bind(&handleInventoryDisplayOutboxChanged)); - updateInboxOutbox(); // Update the verbs buttons state. updateVerbs(); @@ -316,20 +307,20 @@ void LLSidepanelInventory::updateInboxOutbox() // Set up observer for inbox changes, if we have an inbox already if (!inbox_id.isNull()) { - observeInboxModifications(inbox_id); - // Enable the display of the inbox if it exists enableInbox(true); + + observeInboxModifications(inbox_id); } #if ENABLE_MERCHANT_OUTBOX_PANEL // Set up observer for outbox changes, if we have an outbox already if (!outbox_id.isNull()) { - observeOutboxModifications(outbox_id); - // Enable the display of the outbox if it exists enableOutbox(true); + + observeOutboxModifications(outbox_id); } #endif } @@ -459,6 +450,24 @@ void LLSidepanelInventory::enableOutbox(bool enabled) } } +void LLSidepanelInventory::openInbox() +{ + if (mInboxEnabled) + { + getChild<LLButton>(INBOX_BUTTON_NAME)->setToggleState(true); + onToggleInboxBtn(); + } +} + +void LLSidepanelInventory::openOutbox() +{ + if (mOutboxEnabled) + { + getChild<LLButton>(OUTBOX_BUTTON_NAME)->setToggleState(true); + onToggleOutboxBtn(); + } +} + void LLSidepanelInventory::onInboxChanged(const LLUUID& inbox_id) { // Trigger a load of the entire inbox so we always know the contents and their creation dates for sorting diff --git a/indra/newview/llsidepanelinventory.h b/indra/newview/llsidepanelinventory.h index 4e34926a4b..2c6f807013 100644 --- a/indra/newview/llsidepanelinventory.h +++ b/indra/newview/llsidepanelinventory.h @@ -58,6 +58,9 @@ public: /*virtual*/ void onOpen(const LLSD& key); LLInventoryPanel* getActivePanel(); // Returns an active inventory panel, if any. + LLInventoryPanel* getInboxPanel() const { return mInventoryPanelInbox; } + LLInventoryPanel* getOutboxPanel() const { return mInventoryPanelOutbox; } + LLPanelMainInventory* getMainInventoryPanel() const { return mPanelMainInventory; } BOOL isMainInventoryPanelActive() const; @@ -77,6 +80,9 @@ public: void enableInbox(bool enabled); void enableOutbox(bool enabled); + void openInbox(); + void openOutbox(); + bool isInboxEnabled() const { return mInboxEnabled; } bool isOutboxEnabled() const { return mOutboxEnabled; } diff --git a/indra/newview/llsidepaneltaskinfo.cpp b/indra/newview/llsidepaneltaskinfo.cpp index 8774482acd..24cb559fd0 100644 --- a/indra/newview/llsidepaneltaskinfo.cpp +++ b/indra/newview/llsidepaneltaskinfo.cpp @@ -117,6 +117,42 @@ BOOL LLSidepanelTaskInfo::postBuild() childSetCommitCallback("checkbox next owner can transfer", &LLSidepanelTaskInfo::onCommitNextOwnerTransfer,this); childSetCommitCallback("clickaction", &LLSidepanelTaskInfo::onCommitClickAction,this); childSetCommitCallback("search_check", &LLSidepanelTaskInfo::onCommitIncludeInSearch,this); + + mDAPermModify = getChild<LLUICtrl>("perm_modify"); + mDACreator = getChildView("Creator:"); + mDACreatorName = getChild<LLUICtrl>("Creator Name"); + mDAOwner = getChildView("Owner:"); + mDAOwnerName = getChild<LLUICtrl>("Owner Name"); + mDAGroup = getChildView("Group:"); + mDAGroupName = getChild<LLUICtrl>("Group Name"); + mDAButtonSetGroup = getChildView("button set group"); + mDAObjectName = getChild<LLUICtrl>("Object Name"); + mDAName = getChildView("Name:"); + mDADescription = getChildView("Description:"); + mDAObjectDescription = getChild<LLUICtrl>("Object Description"); + mDAPermissions = getChildView("Permissions:"); + mDACheckboxShareWithGroup = getChild<LLUICtrl>("checkbox share with group"); + mDAButtonDeed = getChildView("button deed"); + mDACheckboxAllowEveryoneMove = getChild<LLUICtrl>("checkbox allow everyone move"); + mDACheckboxAllowEveryoneCopy = getChild<LLUICtrl>("checkbox allow everyone copy"); + mDANextOwnerCan = getChildView("Next owner can:"); + mDACheckboxNextOwnerCanModify = getChild<LLUICtrl>("checkbox next owner can modify"); + mDACheckboxNextOwnerCanCopy = getChild<LLUICtrl>("checkbox next owner can copy"); + mDACheckboxNextOwnerCanTransfer = getChild<LLUICtrl>("checkbox next owner can transfer"); + mDACheckboxForSale = getChild<LLUICtrl>("checkbox for sale"); + mDASearchCheck = getChild<LLUICtrl>("search_check"); + mDAComboSaleType = getChild<LLComboBox>("sale type"); + mDACost = getChild<LLUICtrl>("Cost"); + mDAEditCost = getChild<LLUICtrl>("Edit Cost"); + mDALabelClickAction = getChildView("label click action"); + mDAComboClickAction = getChild<LLComboBox>("clickaction"); + mDAB = getChildView("B:"); + mDAO = getChildView("O:"); + mDAG = getChildView("G:"); + mDAE = getChildView("E:"); + mDAN = getChildView("N:"); + mDAF = getChildView("F:"); + return TRUE; } @@ -138,81 +174,80 @@ BOOL LLSidepanelTaskInfo::postBuild() void LLSidepanelTaskInfo::disableAll() { - getChildView("perm_modify")->setEnabled(FALSE); - getChild<LLUICtrl>("perm_modify")->setValue(LLStringUtil::null); - - getChildView("Creator:")->setEnabled(FALSE); - getChild<LLUICtrl>("Creator Name")->setValue(LLStringUtil::null); - getChildView("Creator Name")->setEnabled(FALSE); - - getChildView("Owner:")->setEnabled(FALSE); - getChild<LLUICtrl>("Owner Name")->setValue(LLStringUtil::null); - getChildView("Owner Name")->setEnabled(FALSE); - - getChildView("Group:")->setEnabled(FALSE); - getChild<LLUICtrl>("Group Name")->setValue(LLStringUtil::null); - getChildView("Group Name")->setEnabled(FALSE); - getChildView("button set group")->setEnabled(FALSE); - - getChild<LLUICtrl>("Object Name")->setValue(LLStringUtil::null); - getChildView("Object Name")->setEnabled(FALSE); - getChildView("Name:")->setEnabled(FALSE); - getChild<LLUICtrl>("Group Name")->setValue(LLStringUtil::null); - getChildView("Group Name")->setEnabled(FALSE); - getChildView("Description:")->setEnabled(FALSE); - getChild<LLUICtrl>("Object Description")->setValue(LLStringUtil::null); - getChildView("Object Description")->setEnabled(FALSE); - - getChildView("Permissions:")->setEnabled(FALSE); + mDAPermModify->setEnabled(FALSE); + mDAPermModify->setValue(LLStringUtil::null); + + mDACreator->setEnabled(FALSE); + mDACreatorName->setValue(LLStringUtil::null); + mDACreatorName->setEnabled(FALSE); + + mDAOwner->setEnabled(FALSE); + mDAOwnerName->setValue(LLStringUtil::null); + mDAOwnerName->setEnabled(FALSE); + + mDAGroup->setEnabled(FALSE); + mDAGroupName->setValue(LLStringUtil::null); + mDAGroupName->setEnabled(FALSE); + mDAButtonSetGroup->setEnabled(FALSE); + + mDAObjectName->setValue(LLStringUtil::null); + mDAObjectName->setEnabled(FALSE); + mDAName->setEnabled(FALSE); + mDAGroupName->setValue(LLStringUtil::null); + mDAGroupName->setEnabled(FALSE); + mDADescription->setEnabled(FALSE); + mDAObjectDescription->setValue(LLStringUtil::null); + mDAObjectDescription->setEnabled(FALSE); + + mDAPermissions->setEnabled(FALSE); - getChild<LLUICtrl>("checkbox share with group")->setValue(FALSE); - getChildView("checkbox share with group")->setEnabled(FALSE); - getChildView("button deed")->setEnabled(FALSE); + mDACheckboxShareWithGroup->setValue(FALSE); + mDACheckboxShareWithGroup->setEnabled(FALSE); + mDAButtonDeed->setEnabled(FALSE); - getChild<LLUICtrl>("checkbox allow everyone move")->setValue(FALSE); - getChildView("checkbox allow everyone move")->setEnabled(FALSE); - getChild<LLUICtrl>("checkbox allow everyone copy")->setValue(FALSE); - getChildView("checkbox allow everyone copy")->setEnabled(FALSE); + mDACheckboxAllowEveryoneMove->setValue(FALSE); + mDACheckboxAllowEveryoneMove->setEnabled(FALSE); + mDACheckboxAllowEveryoneCopy->setValue(FALSE); + mDACheckboxAllowEveryoneCopy->setEnabled(FALSE); //Next owner can: - getChildView("Next owner can:")->setEnabled(FALSE); - getChild<LLUICtrl>("checkbox next owner can modify")->setValue(FALSE); - getChildView("checkbox next owner can modify")->setEnabled(FALSE); - getChild<LLUICtrl>("checkbox next owner can copy")->setValue(FALSE); - getChildView("checkbox next owner can copy")->setEnabled(FALSE); - getChild<LLUICtrl>("checkbox next owner can transfer")->setValue(FALSE); - getChildView("checkbox next owner can transfer")->setEnabled(FALSE); + mDANextOwnerCan->setEnabled(FALSE); + mDACheckboxNextOwnerCanModify->setValue(FALSE); + mDACheckboxNextOwnerCanModify->setEnabled(FALSE); + mDACheckboxNextOwnerCanCopy->setValue(FALSE); + mDACheckboxNextOwnerCanCopy->setEnabled(FALSE); + mDACheckboxNextOwnerCanTransfer->setValue(FALSE); + mDACheckboxNextOwnerCanTransfer->setEnabled(FALSE); //checkbox for sale - getChild<LLUICtrl>("checkbox for sale")->setValue(FALSE); - getChildView("checkbox for sale")->setEnabled(FALSE); + mDACheckboxForSale->setValue(FALSE); + mDACheckboxForSale->setEnabled(FALSE); //checkbox include in search - getChild<LLUICtrl>("search_check")->setValue(FALSE); - getChildView("search_check")->setEnabled(FALSE); + mDASearchCheck->setValue(FALSE); + mDASearchCheck->setEnabled(FALSE); - LLComboBox* combo_sale_type = getChild<LLComboBox>("sale type"); - combo_sale_type->setValue(LLSaleInfo::FS_COPY); - combo_sale_type->setEnabled(FALSE); + mDAComboSaleType->setValue(LLSaleInfo::FS_COPY); + mDAComboSaleType->setEnabled(FALSE); - getChildView("Cost")->setEnabled(FALSE); - getChild<LLUICtrl>("Cost")->setValue(getString("Cost Default")); - getChild<LLUICtrl>("Edit Cost")->setValue(LLStringUtil::null); - getChildView("Edit Cost")->setEnabled(FALSE); + mDACost->setEnabled(FALSE); + mDACost->setValue(getString("Cost Default")); + mDAEditCost->setValue(LLStringUtil::null); + mDAEditCost->setEnabled(FALSE); - getChildView("label click action")->setEnabled(FALSE); - LLComboBox* combo_click_action = getChild<LLComboBox>("clickaction"); - if (combo_click_action) + mDALabelClickAction->setEnabled(FALSE); + if (mDAComboClickAction) { - combo_click_action->setEnabled(FALSE); - combo_click_action->clear(); + mDAComboClickAction->setEnabled(FALSE); + mDAComboClickAction->clear(); } - getChildView("B:")->setVisible( FALSE); - getChildView("O:")->setVisible( FALSE); - getChildView("G:")->setVisible( FALSE); - getChildView("E:")->setVisible( FALSE); - getChildView("N:")->setVisible( FALSE); - getChildView("F:")->setVisible( FALSE); + + mDAB->setVisible(FALSE); + mDAO->setVisible(FALSE); + mDAG->setVisible(FALSE); + mDAE->setVisible(FALSE); + mDAN->setVisible(FALSE); + mDAF->setVisible(FALSE); mOpenBtn->setEnabled(FALSE); mPayBtn->setEnabled(FALSE); diff --git a/indra/newview/llsidepaneltaskinfo.h b/indra/newview/llsidepaneltaskinfo.h index 384bc479d6..be0fee2127 100644 --- a/indra/newview/llsidepaneltaskinfo.h +++ b/indra/newview/llsidepaneltaskinfo.h @@ -37,8 +37,9 @@ // Panel for permissions of an object. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -class LLNameBox; class LLCheckBoxCtrl; +class LLComboBox; +class LLNameBox; class LLViewerObject; class LLSidepanelTaskInfo : public LLSidepanelInventorySubpanel @@ -118,6 +119,43 @@ private: LLPointer<LLViewerObject> mObject; LLObjectSelectionHandle mObjectSelection; static LLSidepanelTaskInfo* sActivePanel; + +private: + // Pointers cached here to speed up the "disableAll" function which gets called on idle + LLUICtrl* mDAPermModify; + LLView* mDACreator; + LLUICtrl* mDACreatorName; + LLView* mDAOwner; + LLUICtrl* mDAOwnerName; + LLView* mDAGroup; + LLUICtrl* mDAGroupName; + LLView* mDAButtonSetGroup; + LLUICtrl* mDAObjectName; + LLView* mDAName; + LLView* mDADescription; + LLUICtrl* mDAObjectDescription; + LLView* mDAPermissions; + LLUICtrl* mDACheckboxShareWithGroup; + LLView* mDAButtonDeed; + LLUICtrl* mDACheckboxAllowEveryoneMove; + LLUICtrl* mDACheckboxAllowEveryoneCopy; + LLView* mDANextOwnerCan; + LLUICtrl* mDACheckboxNextOwnerCanModify; + LLUICtrl* mDACheckboxNextOwnerCanCopy; + LLUICtrl* mDACheckboxNextOwnerCanTransfer; + LLUICtrl* mDACheckboxForSale; + LLUICtrl* mDASearchCheck; + LLComboBox* mDAComboSaleType; + LLUICtrl* mDACost; + LLUICtrl* mDAEditCost; + LLView* mDALabelClickAction; + LLComboBox* mDAComboClickAction; + LLView* mDAB; + LLView* mDAO; + LLView* mDAG; + LLView* mDAE; + LLView* mDAN; + LLView* mDAF; }; diff --git a/indra/newview/llsidetraypanelcontainer.cpp b/indra/newview/llsidetraypanelcontainer.cpp index 95a12c7c23..e340333c2c 100644 --- a/indra/newview/llsidetraypanelcontainer.cpp +++ b/indra/newview/llsidetraypanelcontainer.cpp @@ -62,6 +62,13 @@ void LLSideTrayPanelContainer::onOpen(const LLSD& key) getCurrentPanel()->onOpen(key); } +void LLSideTrayPanelContainer::openPanel(const std::string& panel_name, const LLSD& key) +{ + LLSD combined_key = key; + combined_key[PARAM_SUB_PANEL_NAME] = panel_name; + onOpen(combined_key); +} + void LLSideTrayPanelContainer::openPreviousPanel() { if(!mDefaultPanelName.empty()) diff --git a/indra/newview/llsidetraypanelcontainer.h b/indra/newview/llsidetraypanelcontainer.h index 14269b002b..93a85ed374 100644 --- a/indra/newview/llsidetraypanelcontainer.h +++ b/indra/newview/llsidetraypanelcontainer.h @@ -57,6 +57,11 @@ public: /*virtual*/ void onOpen(const LLSD& key); /** + * Opens given subpanel. + */ + void openPanel(const std::string& panel_name, const LLSD& key = LLSD::emptyMap()); + + /** * Opens previous panel from panel navigation history. */ void openPreviousPanel(); diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp index ebe42f79f4..99af27a63c 100644 --- a/indra/newview/llspatialpartition.cpp +++ b/indra/newview/llspatialpartition.cpp @@ -1,4725 +1,4750 @@ -/** - * @file llspatialpartition.cpp - * @brief LLSpatialGroup class implementation and supporting functions - * - * $LicenseInfo:firstyear=2003&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2010, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -#include "llviewerprecompiledheaders.h" - -#include "llspatialpartition.h" - -#include "llviewerwindow.h" -#include "llviewerobjectlist.h" -#include "llvovolume.h" -#include "llvolume.h" -#include "llvolumeoctree.h" -#include "llviewercamera.h" -#include "llface.h" -#include "llfloatertools.h" -#include "llviewercontrol.h" -#include "llviewerregion.h" -#include "llcamera.h" -#include "pipeline.h" -#include "llmeshrepository.h" -#include "llrender.h" -#include "lloctree.h" -#include "llphysicsshapebuilderutil.h" -#include "llvoavatar.h" -#include "llvolumemgr.h" -#include "lltextureatlas.h" -#include "llglslshader.h" -#include "llagent.h" - -static LLFastTimer::DeclareTimer FTM_FRUSTUM_CULL("Frustum Culling"); -static LLFastTimer::DeclareTimer FTM_CULL_REBOUND("Cull Rebound"); - -const F32 SG_OCCLUSION_FUDGE = 0.25f; -#define SG_DISCARD_TOLERANCE 0.01f - -#if LL_OCTREE_PARANOIA_CHECK -#define assert_octree_valid(x) x->validate() -#define assert_states_valid(x) ((LLSpatialGroup*) x->mSpatialPartition->mOctree->getListener(0))->checkStates() -#else -#define assert_octree_valid(x) -#define assert_states_valid(x) -#endif - - -static U32 sZombieGroups = 0; -U32 LLSpatialGroup::sNodeCount = 0; - -#define LL_TRACK_PENDING_OCCLUSION_QUERIES 0 - -std::set<GLuint> LLSpatialGroup::sPendingQueries; - -U32 gOctreeMaxCapacity; - -BOOL LLSpatialGroup::sNoDelete = FALSE; - -static F32 sLastMaxTexPriority = 1.f; -static F32 sCurMaxTexPriority = 1.f; - -class LLOcclusionQueryPool : public LLGLNamePool -{ -protected: - virtual GLuint allocateName() - { - GLuint name; - glGenQueriesARB(1, &name); - return name; - } - - virtual void releaseName(GLuint name) - { -#if LL_TRACK_PENDING_OCCLUSION_QUERIES - LLSpatialGroup::sPendingQueries.erase(name); -#endif - glDeleteQueriesARB(1, &name); - } -}; - -static LLOcclusionQueryPool sQueryPool; - -//static counter for frame to switch LOD on - -void sg_assert(BOOL expr) -{ -#if LL_OCTREE_PARANOIA_CHECK - if (!expr) - { - llerrs << "Octree invalid!" << llendl; - } -#endif -} - -S32 AABBSphereIntersect(const LLVector3& min, const LLVector3& max, const LLVector3 &origin, const F32 &rad) -{ - return AABBSphereIntersectR2(min, max, origin, rad*rad); -} - -S32 AABBSphereIntersectR2(const LLVector3& min, const LLVector3& max, const LLVector3 &origin, const F32 &r) -{ - F32 d = 0.f; - F32 t; - - if ((min-origin).magVecSquared() < r && - (max-origin).magVecSquared() < r) - { - return 2; - } - - for (U32 i = 0; i < 3; i++) - { - if (origin.mV[i] < min.mV[i]) - { - t = min.mV[i] - origin.mV[i]; - d += t*t; - } - else if (origin.mV[i] > max.mV[i]) - { - t = origin.mV[i] - max.mV[i]; - d += t*t; - } - - if (d > r) - { - return 0; - } - } - - return 1; -} - - -S32 AABBSphereIntersect(const LLVector4a& min, const LLVector4a& max, const LLVector3 &origin, const F32 &rad) -{ - return AABBSphereIntersectR2(min, max, origin, rad*rad); -} - -S32 AABBSphereIntersectR2(const LLVector4a& min, const LLVector4a& max, const LLVector3 &origin, const F32 &r) -{ - F32 d = 0.f; - F32 t; - - LLVector4a origina; - origina.load3(origin.mV); - - LLVector4a v; - v.setSub(min, origina); - - if (v.dot3(v) < r) - { - v.setSub(max, origina); - if (v.dot3(v) < r) - { - return 2; - } - } - - - for (U32 i = 0; i < 3; i++) - { - if (origin.mV[i] < min[i]) - { - t = min[i] - origin.mV[i]; - d += t*t; - } - else if (origin.mV[i] > max[i]) - { - t = origin.mV[i] - max[i]; - d += t*t; - } - - if (d > r) - { - return 0; - } - } - - return 1; -} - - -typedef enum -{ - b000 = 0x00, - b001 = 0x01, - b010 = 0x02, - b011 = 0x03, - b100 = 0x04, - b101 = 0x05, - b110 = 0x06, - b111 = 0x07, -} eLoveTheBits; - -//contact Runitai Linden for a copy of the SL object used to write this table -//basically, you give the table a bitmask of the look-at vector to a node and it -//gives you a triangle fan index array -static U8 sOcclusionIndices[] = -{ - //000 - b111, b110, b010, b011, b001, b101, b100, b110, - //001 - b011, b010, b000, b001, b101, b111, b110, b010, - //010 - b101, b100, b110, b111, b011, b001, b000, b100, - //011 - b001, b000, b100, b101, b111, b011, b010, b000, - //100 - b110, b000, b010, b011, b111, b101, b100, b000, - //101 - b010, b100, b000, b001, b011, b111, b110, b100, - //110 - b100, b010, b110, b111, b101, b001, b000, b010, - //111 - b000, b110, b100, b101, b001, b011, b010, b110, -}; - -U32 get_box_fan_indices(LLCamera* camera, const LLVector4a& center) -{ - LLVector4a origin; - origin.load3(camera->getOrigin().mV); - - S32 cypher = center.greaterThan(origin).getGatheredBits() & 0x7; - - return cypher*8; -} - -U8* get_box_fan_indices_ptr(LLCamera* camera, const LLVector4a& center) -{ - LLVector4a origin; - origin.load3(camera->getOrigin().mV); - - S32 cypher = center.greaterThan(origin).getGatheredBits() & 0x7; - - return sOcclusionIndices+cypher*8; -} - - -static LLFastTimer::DeclareTimer FTM_BUILD_OCCLUSION("Build Occlusion"); - -void LLSpatialGroup::buildOcclusion() -{ - if (mOcclusionVerts.isNull()) - { - - mOcclusionVerts = new LLVertexBuffer(LLVertexBuffer::MAP_VERTEX, - LLVertexBuffer::sUseStreamDraw ? mBufferUsage : 0); //if GL has a hard time with VBOs, don't use them for occlusion culling. - mOcclusionVerts->allocateBuffer(8, 64, true); - - LLStrider<U16> idx; - mOcclusionVerts->getIndexStrider(idx); - for (U32 i = 0; i < 64; i++) - { - *idx++ = sOcclusionIndices[i]; - } - } - - LLVector4a fudge; - fudge.splat(SG_OCCLUSION_FUDGE); - - LLVector4a r; - r.setAdd(mBounds[1], fudge); - - LLStrider<LLVector3> pos; - - { - LLFastTimer t(FTM_BUILD_OCCLUSION); - mOcclusionVerts->getVertexStrider(pos); - } - - { - LLVector4a* v = (LLVector4a*) pos.get(); - - const LLVector4a& c = mBounds[0]; - const LLVector4a& s = r; - - static const LLVector4a octant[] = - { - LLVector4a(-1.f, -1.f, -1.f), - LLVector4a(-1.f, -1.f, 1.f), - LLVector4a(-1.f, 1.f, -1.f), - LLVector4a(-1.f, 1.f, 1.f), - - LLVector4a(1.f, -1.f, -1.f), - LLVector4a(1.f, -1.f, 1.f), - LLVector4a(1.f, 1.f, -1.f), - LLVector4a(1.f, 1.f, 1.f), - }; - - //vertex positions are encoded so the 3 bits of their vertex index - //correspond to their axis facing, with bit position 3,2,1 matching - //axis facing x,y,z, bit set meaning positive facing, bit clear - //meaning negative facing - - for (S32 i = 0; i < 8; ++i) - { - LLVector4a p; - p.setMul(s, octant[i]); - p.add(c); - v[i] = p; - } - } - - { - mOcclusionVerts->setBuffer(0); - } - - clearState(LLSpatialGroup::OCCLUSION_DIRTY); -} - - -BOOL earlyFail(LLCamera* camera, LLSpatialGroup* group); - -//returns: -// 0 if sphere and AABB are not intersecting -// 1 if they are -// 2 if AABB is entirely inside sphere - -S32 LLSphereAABB(const LLVector3& center, const LLVector3& size, const LLVector3& pos, const F32 &rad) -{ - S32 ret = 2; - - LLVector3 min = center - size; - LLVector3 max = center + size; - for (U32 i = 0; i < 3; i++) - { - if (min.mV[i] > pos.mV[i] + rad || - max.mV[i] < pos.mV[i] - rad) - { //totally outside - return 0; - } - - if (min.mV[i] < pos.mV[i] - rad || - max.mV[i] > pos.mV[i] + rad) - { //intersecting - ret = 1; - } - } - - return ret; -} - -LLSpatialGroup::~LLSpatialGroup() -{ - /*if (sNoDelete) - { - llerrs << "Illegal deletion of LLSpatialGroup!" << llendl; - }*/ - - if (gDebugGL) - { - gPipeline.checkReferences(this); - } - - if (isState(DEAD)) - { - sZombieGroups--; - } - - sNodeCount--; - - if (gGLManager.mHasOcclusionQuery) - { - for (U32 i = 0; i < LLViewerCamera::NUM_CAMERAS; ++i) - { - if (mOcclusionQuery[i]) - { - sQueryPool.release(mOcclusionQuery[i]); - } - } - } - - mOcclusionVerts = NULL; - - LLMemType mt(LLMemType::MTYPE_SPACE_PARTITION); - clearDrawMap(); - clearAtlasList() ; -} - -BOOL LLSpatialGroup::hasAtlas(LLTextureAtlas* atlasp) -{ - S8 type = atlasp->getComponents() - 1 ; - for(std::list<LLTextureAtlas*>::iterator iter = mAtlasList[type].begin(); iter != mAtlasList[type].end() ; ++iter) - { - if(atlasp == *iter) - { - return TRUE ; - } - } - return FALSE ; -} - -void LLSpatialGroup::addAtlas(LLTextureAtlas* atlasp, S8 recursive_level) -{ - if(!hasAtlas(atlasp)) - { - mAtlasList[atlasp->getComponents() - 1].push_back(atlasp) ; - atlasp->addSpatialGroup(this) ; - } - - --recursive_level; - if(recursive_level)//levels propagating up. - { - LLSpatialGroup* parent = getParent() ; - if(parent) - { - parent->addAtlas(atlasp, recursive_level) ; - } - } -} - -void LLSpatialGroup::removeAtlas(LLTextureAtlas* atlasp, BOOL remove_group, S8 recursive_level) -{ - mAtlasList[atlasp->getComponents() - 1].remove(atlasp) ; - if(remove_group) - { - atlasp->removeSpatialGroup(this) ; - } - - --recursive_level; - if(recursive_level)//levels propagating up. - { - LLSpatialGroup* parent = getParent() ; - if(parent) - { - parent->removeAtlas(atlasp, recursive_level) ; - } - } -} - -void LLSpatialGroup::clearAtlasList() -{ - std::list<LLTextureAtlas*>::iterator iter ; - for(S8 i = 0 ; i < 4 ; i++) - { - if(mAtlasList[i].size() > 0) - { - for(iter = mAtlasList[i].begin(); iter != mAtlasList[i].end() ; ++iter) - { - ((LLTextureAtlas*)*iter)->removeSpatialGroup(this) ; - } - mAtlasList[i].clear() ; - } - } -} - -LLTextureAtlas* LLSpatialGroup::getAtlas(S8 ncomponents, S8 to_be_reserved, S8 recursive_level) -{ - S8 type = ncomponents - 1 ; - if(mAtlasList[type].size() > 0) - { - for(std::list<LLTextureAtlas*>::iterator iter = mAtlasList[type].begin(); iter != mAtlasList[type].end() ; ++iter) - { - if(!((LLTextureAtlas*)*iter)->isFull(to_be_reserved)) - { - return *iter ; - } - } - } - - --recursive_level; - if(recursive_level) - { - LLSpatialGroup* parent = getParent() ; - if(parent) - { - return parent->getAtlas(ncomponents, to_be_reserved, recursive_level) ; - } - } - return NULL ; -} - -void LLSpatialGroup::setCurUpdatingSlot(LLTextureAtlasSlot* slotp) -{ - mCurUpdatingSlotp = slotp; - - //if(!hasAtlas(mCurUpdatingSlotp->getAtlas())) - //{ - // addAtlas(mCurUpdatingSlotp->getAtlas()) ; - //} -} - -LLTextureAtlasSlot* LLSpatialGroup::getCurUpdatingSlot(LLViewerTexture* imagep, S8 recursive_level) -{ - if(gFrameCount && mCurUpdatingTime == gFrameCount && mCurUpdatingTexture == imagep) - { - return mCurUpdatingSlotp ; - } - - //--recursive_level ; - //if(recursive_level) - //{ - // LLSpatialGroup* parent = getParent() ; - // if(parent) - // { - // return parent->getCurUpdatingSlot(imagep, recursive_level) ; - // } - //} - return NULL ; -} - -void LLSpatialGroup::clearDrawMap() -{ - mDrawMap.clear(); -} - -BOOL LLSpatialGroup::isHUDGroup() -{ - return mSpatialPartition && mSpatialPartition->isHUDPartition() ; -} - -BOOL LLSpatialGroup::isRecentlyVisible() const -{ - return (LLDrawable::getCurrentFrame() - mVisible[LLViewerCamera::sCurCameraID]) < LLDrawable::getMinVisFrameRange() ; -} - -BOOL LLSpatialGroup::isVisible() const -{ - return mVisible[LLViewerCamera::sCurCameraID] >= LLDrawable::getCurrentFrame() ? TRUE : FALSE; -} - -void LLSpatialGroup::setVisible() -{ - mVisible[LLViewerCamera::sCurCameraID] = LLDrawable::getCurrentFrame(); -} - -void LLSpatialGroup::validate() -{ -#if LL_OCTREE_PARANOIA_CHECK - - sg_assert(!isState(DIRTY)); - sg_assert(!isDead()); - - LLVector4a myMin; - myMin.setSub(mBounds[0], mBounds[1]); - LLVector4a myMax; - myMax.setAdd(mBounds[0], mBounds[1]); - - validateDrawMap(); - - for (element_iter i = getData().begin(); i != getData().end(); ++i) - { - LLDrawable* drawable = *i; - sg_assert(drawable->getSpatialGroup() == this); - if (drawable->getSpatialBridge()) - { - sg_assert(drawable->getSpatialBridge() == mSpatialPartition->asBridge()); - } - - /*if (drawable->isSpatialBridge()) - { - LLSpatialPartition* part = drawable->asPartition(); - if (!part) - { - llerrs << "Drawable reports it is a spatial bridge but not a partition." << llendl; - } - LLSpatialGroup* group = (LLSpatialGroup*) part->mOctree->getListener(0); - group->validate(); - }*/ - } - - for (U32 i = 0; i < mOctreeNode->getChildCount(); ++i) - { - LLSpatialGroup* group = (LLSpatialGroup*) mOctreeNode->getChild(i)->getListener(0); - - group->validate(); - - //ensure all children are enclosed in this node - LLVector4a center = group->mBounds[0]; - LLVector4a size = group->mBounds[1]; - - LLVector4a min; - min.setSub(center, size); - LLVector4a max; - max.setAdd(center, size); - - for (U32 j = 0; j < 3; j++) - { - sg_assert(min[j] >= myMin[j]-0.02f); - sg_assert(max[j] <= myMax[j]+0.02f); - } - } - -#endif -} - -void LLSpatialGroup::checkStates() -{ -#if LL_OCTREE_PARANOIA_CHECK - //LLOctreeStateCheck checker; - //checker.traverse(mOctreeNode); -#endif -} - -void LLSpatialGroup::validateDrawMap() -{ -#if LL_OCTREE_PARANOIA_CHECK - for (draw_map_t::iterator i = mDrawMap.begin(); i != mDrawMap.end(); ++i) - { - LLSpatialGroup::drawmap_elem_t& draw_vec = i->second; - for (drawmap_elem_t::iterator j = draw_vec.begin(); j != draw_vec.end(); ++j) - { - LLDrawInfo& params = **j; - - params.validate(); - } - } -#endif -} - -BOOL LLSpatialGroup::updateInGroup(LLDrawable *drawablep, BOOL immediate) -{ - LLMemType mt(LLMemType::MTYPE_SPACE_PARTITION); - - drawablep->updateSpatialExtents(); - - OctreeNode* parent = mOctreeNode->getOctParent(); - - if (mOctreeNode->isInside(drawablep->getPositionGroup()) && - (mOctreeNode->contains(drawablep) || - (drawablep->getBinRadius() > mOctreeNode->getSize()[0] && - parent && parent->getElementCount() >= gOctreeMaxCapacity))) - { - unbound(); - setState(OBJECT_DIRTY); - //setState(GEOM_DIRTY); - return TRUE; - } - - return FALSE; -} - - -BOOL LLSpatialGroup::addObject(LLDrawable *drawablep, BOOL add_all, BOOL from_octree) -{ - LLMemType mt(LLMemType::MTYPE_SPACE_PARTITION); - if (!from_octree) - { - mOctreeNode->insert(drawablep); - } - else - { - drawablep->setSpatialGroup(this); - setState(OBJECT_DIRTY | GEOM_DIRTY); - setOcclusionState(LLSpatialGroup::DISCARD_QUERY, LLSpatialGroup::STATE_MODE_ALL_CAMERAS); - gPipeline.markRebuild(this, TRUE); - if (drawablep->isSpatialBridge()) - { - mBridgeList.push_back((LLSpatialBridge*) drawablep); - } - if (drawablep->getRadius() > 1.f) - { - setState(IMAGE_DIRTY); - } - } - - return TRUE; -} - -void LLSpatialGroup::rebuildGeom() -{ - LLMemType mt(LLMemType::MTYPE_SPACE_PARTITION); - if (!isDead()) - { - mSpatialPartition->rebuildGeom(this); - } -} - -void LLSpatialGroup::rebuildMesh() -{ - if (!isDead()) - { - mSpatialPartition->rebuildMesh(this); - } -} - -static LLFastTimer::DeclareTimer FTM_REBUILD_VBO("VBO Rebuilt"); - -void LLSpatialPartition::rebuildGeom(LLSpatialGroup* group) -{ - if (group->isDead() || !group->isState(LLSpatialGroup::GEOM_DIRTY)) - { - return; - } - - if (group->changeLOD()) - { - group->mLastUpdateDistance = group->mDistance; - group->mLastUpdateViewAngle = group->mViewAngle; - } - - LLFastTimer ftm(FTM_REBUILD_VBO); - - group->clearDrawMap(); - - //get geometry count - U32 index_count = 0; - U32 vertex_count = 0; - - addGeometryCount(group, vertex_count, index_count); - - if (vertex_count > 0 && index_count > 0) - { //create vertex buffer containing volume geometry for this node - group->mBuilt = 1.f; - if (group->mVertexBuffer.isNull() || (group->mBufferUsage != group->mVertexBuffer->getUsage() && LLVertexBuffer::sEnableVBOs)) - { - group->mVertexBuffer = createVertexBuffer(mVertexDataMask, group->mBufferUsage); - group->mVertexBuffer->allocateBuffer(vertex_count, index_count, true); - stop_glerror(); - } - else - { - group->mVertexBuffer->resizeBuffer(vertex_count, index_count); - stop_glerror(); - } - - getGeometry(group); - } - else - { - group->mVertexBuffer = NULL; - group->mBufferMap.clear(); - } - - group->mLastUpdateTime = gFrameTimeSeconds; - group->clearState(LLSpatialGroup::GEOM_DIRTY); -} - - -void LLSpatialPartition::rebuildMesh(LLSpatialGroup* group) -{ - -} - -BOOL LLSpatialGroup::boundObjects(BOOL empty, LLVector4a& minOut, LLVector4a& maxOut) -{ - const OctreeNode* node = mOctreeNode; - - if (node->getData().empty()) - { //don't do anything if there are no objects - if (empty && mOctreeNode->getParent()) - { //only root is allowed to be empty - OCT_ERRS << "Empty leaf found in octree." << llendl; - } - return FALSE; - } - - LLVector4a& newMin = mObjectExtents[0]; - LLVector4a& newMax = mObjectExtents[1]; - - if (isState(OBJECT_DIRTY)) - { //calculate new bounding box - clearState(OBJECT_DIRTY); - - //initialize bounding box to first element - OctreeNode::const_element_iter i = node->getData().begin(); - LLDrawable* drawablep = *i; - const LLVector4a* minMax = drawablep->getSpatialExtents(); - - newMin = minMax[0]; - newMax = minMax[1]; - - for (++i; i != node->getData().end(); ++i) - { - drawablep = *i; - minMax = drawablep->getSpatialExtents(); - - update_min_max(newMin, newMax, minMax[0]); - update_min_max(newMin, newMax, minMax[1]); - - //bin up the object - /*for (U32 i = 0; i < 3; i++) - { - if (minMax[0].mV[i] < newMin.mV[i]) - { - newMin.mV[i] = minMax[0].mV[i]; - } - if (minMax[1].mV[i] > newMax.mV[i]) - { - newMax.mV[i] = minMax[1].mV[i]; - } - }*/ - } - - mObjectBounds[0].setAdd(newMin, newMax); - mObjectBounds[0].mul(0.5f); - mObjectBounds[1].setSub(newMax, newMin); - mObjectBounds[1].mul(0.5f); - } - - if (empty) - { - minOut = newMin; - maxOut = newMax; - } - else - { - minOut.setMin(minOut, newMin); - maxOut.setMax(maxOut, newMax); - } - - return TRUE; -} - -void LLSpatialGroup::unbound() -{ - if (isState(DIRTY)) - { - return; - } - - setState(DIRTY); - - //all the parent nodes need to rebound this child - if (mOctreeNode) - { - OctreeNode* parent = (OctreeNode*) mOctreeNode->getParent(); - while (parent != NULL) - { - LLSpatialGroup* group = (LLSpatialGroup*) parent->getListener(0); - if (group->isState(DIRTY)) - { - return; - } - - group->setState(DIRTY); - parent = (OctreeNode*) parent->getParent(); - } - } -} - -LLSpatialGroup* LLSpatialGroup::getParent() -{ - if (isDead()) - { - return NULL; - } - - if(!mOctreeNode) - { - return NULL; - } - OctreeNode* parent = mOctreeNode->getOctParent(); - - if (parent) - { - return (LLSpatialGroup*) parent->getListener(0); - } - - return NULL; -} - -BOOL LLSpatialGroup::removeObject(LLDrawable *drawablep, BOOL from_octree) -{ - LLMemType mt(LLMemType::MTYPE_SPACE_PARTITION); - unbound(); - if (mOctreeNode && !from_octree) - { - if (!mOctreeNode->remove(drawablep)) - { - OCT_ERRS << "Could not remove drawable from spatial group" << llendl; - } - } - else - { - drawablep->setSpatialGroup(NULL); - setState(GEOM_DIRTY); - gPipeline.markRebuild(this, TRUE); - - if (drawablep->isSpatialBridge()) - { - for (bridge_list_t::iterator i = mBridgeList.begin(); i != mBridgeList.end(); ++i) - { - if (*i == drawablep) - { - mBridgeList.erase(i); - break; - } - } - } - - if (getElementCount() == 0) - { //delete draw map on last element removal since a rebuild might never happen - clearDrawMap(); - } - } - return TRUE; -} - -void LLSpatialGroup::shift(const LLVector4a &offset) -{ - LLMemType mt(LLMemType::MTYPE_SPACE_PARTITION); - LLVector4a t = mOctreeNode->getCenter(); - t.add(offset); - mOctreeNode->setCenter(t); - mOctreeNode->updateMinMax(); - mBounds[0].add(offset); - mExtents[0].add(offset); - mExtents[1].add(offset); - mObjectBounds[0].add(offset); - mObjectExtents[0].add(offset); - mObjectExtents[1].add(offset); - - //if (!mSpatialPartition->mRenderByGroup) - { - setState(GEOM_DIRTY); - gPipeline.markRebuild(this, TRUE); - } - - if (mOcclusionVerts.notNull()) - { - setState(OCCLUSION_DIRTY); - } -} - -class LLSpatialSetState : public LLSpatialGroup::OctreeTraveler -{ -public: - U32 mState; - LLSpatialSetState(U32 state) : mState(state) { } - virtual void visit(const LLSpatialGroup::OctreeNode* branch) { ((LLSpatialGroup*) branch->getListener(0))->setState(mState); } -}; - -class LLSpatialSetStateDiff : public LLSpatialSetState -{ -public: - LLSpatialSetStateDiff(U32 state) : LLSpatialSetState(state) { } - - virtual void traverse(const LLSpatialGroup::OctreeNode* n) - { - LLSpatialGroup* group = (LLSpatialGroup*) n->getListener(0); - - if (!group->isState(mState)) - { - LLSpatialGroup::OctreeTraveler::traverse(n); - } - } -}; - -void LLSpatialGroup::setState(U32 state) -{ - mState |= state; - - llassert(state <= LLSpatialGroup::STATE_MASK); -} - -void LLSpatialGroup::setState(U32 state, S32 mode) -{ - LLMemType mt(LLMemType::MTYPE_SPACE_PARTITION); - - llassert(state <= LLSpatialGroup::STATE_MASK); - - if (mode > STATE_MODE_SINGLE) - { - if (mode == STATE_MODE_DIFF) - { - LLSpatialSetStateDiff setter(state); - setter.traverse(mOctreeNode); - } - else - { - LLSpatialSetState setter(state); - setter.traverse(mOctreeNode); - } - } - else - { - mState |= state; - } -} - -class LLSpatialClearState : public LLSpatialGroup::OctreeTraveler -{ -public: - U32 mState; - LLSpatialClearState(U32 state) : mState(state) { } - virtual void visit(const LLSpatialGroup::OctreeNode* branch) { ((LLSpatialGroup*) branch->getListener(0))->clearState(mState); } -}; - -class LLSpatialClearStateDiff : public LLSpatialClearState -{ -public: - LLSpatialClearStateDiff(U32 state) : LLSpatialClearState(state) { } - - virtual void traverse(const LLSpatialGroup::OctreeNode* n) - { - LLSpatialGroup* group = (LLSpatialGroup*) n->getListener(0); - - if (group->isState(mState)) - { - LLSpatialGroup::OctreeTraveler::traverse(n); - } - } -}; - -void LLSpatialGroup::clearState(U32 state) -{ - llassert(state <= LLSpatialGroup::STATE_MASK); - - mState &= ~state; -} - -void LLSpatialGroup::clearState(U32 state, S32 mode) -{ - llassert(state <= LLSpatialGroup::STATE_MASK); - - LLMemType mt(LLMemType::MTYPE_SPACE_PARTITION); - - if (mode > STATE_MODE_SINGLE) - { - if (mode == STATE_MODE_DIFF) - { - LLSpatialClearStateDiff clearer(state); - clearer.traverse(mOctreeNode); - } - else - { - LLSpatialClearState clearer(state); - clearer.traverse(mOctreeNode); - } - } - else - { - mState &= ~state; - } -} - -BOOL LLSpatialGroup::isState(U32 state) const -{ - llassert(state <= LLSpatialGroup::STATE_MASK); - - return mState & state ? TRUE : FALSE; -} - -//===================================== -// Occlusion State Set/Clear -//===================================== -class LLSpatialSetOcclusionState : public LLSpatialGroup::OctreeTraveler -{ -public: - U32 mState; - LLSpatialSetOcclusionState(U32 state) : mState(state) { } - virtual void visit(const LLSpatialGroup::OctreeNode* branch) { ((LLSpatialGroup*) branch->getListener(0))->setOcclusionState(mState); } -}; - -class LLSpatialSetOcclusionStateDiff : public LLSpatialSetOcclusionState -{ -public: - LLSpatialSetOcclusionStateDiff(U32 state) : LLSpatialSetOcclusionState(state) { } - - virtual void traverse(const LLSpatialGroup::OctreeNode* n) - { - LLSpatialGroup* group = (LLSpatialGroup*) n->getListener(0); - - if (!group->isOcclusionState(mState)) - { - LLSpatialGroup::OctreeTraveler::traverse(n); - } - } -}; - - -void LLSpatialGroup::setOcclusionState(U32 state, S32 mode) -{ - LLMemType mt(LLMemType::MTYPE_SPACE_PARTITION); - - if (mode > STATE_MODE_SINGLE) - { - if (mode == STATE_MODE_DIFF) - { - LLSpatialSetOcclusionStateDiff setter(state); - setter.traverse(mOctreeNode); - } - else if (mode == STATE_MODE_BRANCH) - { - LLSpatialSetOcclusionState setter(state); - setter.traverse(mOctreeNode); - } - else - { - for (U32 i = 0; i < LLViewerCamera::NUM_CAMERAS; i++) - { - mOcclusionState[i] |= state; - - if ((state & DISCARD_QUERY) && mOcclusionQuery[i]) - { - sQueryPool.release(mOcclusionQuery[i]); - mOcclusionQuery[i] = 0; - } - } - } - } - else - { - mOcclusionState[LLViewerCamera::sCurCameraID] |= state; - if ((state & DISCARD_QUERY) && mOcclusionQuery[LLViewerCamera::sCurCameraID]) - { - sQueryPool.release(mOcclusionQuery[LLViewerCamera::sCurCameraID]); - mOcclusionQuery[LLViewerCamera::sCurCameraID] = 0; - } - } -} - -class LLSpatialClearOcclusionState : public LLSpatialGroup::OctreeTraveler -{ -public: - U32 mState; - - LLSpatialClearOcclusionState(U32 state) : mState(state) { } - virtual void visit(const LLSpatialGroup::OctreeNode* branch) { ((LLSpatialGroup*) branch->getListener(0))->clearOcclusionState(mState); } -}; - -class LLSpatialClearOcclusionStateDiff : public LLSpatialClearOcclusionState -{ -public: - LLSpatialClearOcclusionStateDiff(U32 state) : LLSpatialClearOcclusionState(state) { } - - virtual void traverse(const LLSpatialGroup::OctreeNode* n) - { - LLSpatialGroup* group = (LLSpatialGroup*) n->getListener(0); - - if (group->isOcclusionState(mState)) - { - LLSpatialGroup::OctreeTraveler::traverse(n); - } - } -}; - -void LLSpatialGroup::clearOcclusionState(U32 state, S32 mode) -{ - LLMemType mt(LLMemType::MTYPE_SPACE_PARTITION); - - if (mode > STATE_MODE_SINGLE) - { - if (mode == STATE_MODE_DIFF) - { - LLSpatialClearOcclusionStateDiff clearer(state); - clearer.traverse(mOctreeNode); - } - else if (mode == STATE_MODE_BRANCH) - { - LLSpatialClearOcclusionState clearer(state); - clearer.traverse(mOctreeNode); - } - else - { - for (U32 i = 0; i < LLViewerCamera::NUM_CAMERAS; i++) - { - mOcclusionState[i] &= ~state; - } - } - } - else - { - mOcclusionState[LLViewerCamera::sCurCameraID] &= ~state; - } -} -//====================================== -// Octree Listener Implementation -//====================================== - -LLSpatialGroup::LLSpatialGroup(OctreeNode* node, LLSpatialPartition* part) : - mState(0), - mBuilt(0.f), - mOctreeNode(node), - mSpatialPartition(part), - mVertexBuffer(NULL), - mBufferUsage(part->mBufferUsage), - mDistance(0.f), - mDepth(0.f), - mLastUpdateDistance(-1.f), - mLastUpdateTime(gFrameTimeSeconds), - mAtlasList(4), - mCurUpdatingTime(0), - mCurUpdatingSlotp(NULL), - mCurUpdatingTexture (NULL) -{ - sNodeCount++; - LLMemType mt(LLMemType::MTYPE_SPACE_PARTITION); - - mViewAngle.splat(0.f); - mLastUpdateViewAngle.splat(-1.f); - mExtents[0] = mExtents[1] = mObjectBounds[0] = mObjectBounds[0] = mObjectBounds[1] = - mObjectExtents[0] = mObjectExtents[1] = mViewAngle; - - sg_assert(mOctreeNode->getListenerCount() == 0); - mOctreeNode->addListener(this); - setState(SG_INITIAL_STATE_MASK); - gPipeline.markRebuild(this, TRUE); - - mBounds[0] = node->getCenter(); - mBounds[1] = node->getSize(); - - part->mLODSeed = (part->mLODSeed+1)%part->mLODPeriod; - mLODHash = part->mLODSeed; - - OctreeNode* oct_parent = node->getOctParent(); - - LLSpatialGroup* parent = oct_parent ? (LLSpatialGroup*) oct_parent->getListener(0) : NULL; - - for (U32 i = 0; i < LLViewerCamera::NUM_CAMERAS; i++) - { - mOcclusionQuery[i] = 0; - mOcclusionState[i] = parent ? SG_STATE_INHERIT_MASK & parent->mOcclusionState[i] : 0; - mVisible[i] = 0; - } - - mOcclusionVerts = NULL; - - mRadius = 1; - mPixelArea = 1024.f; -} - -void LLSpatialGroup::updateDistance(LLCamera &camera) -{ - if (LLViewerCamera::sCurCameraID != LLViewerCamera::CAMERA_WORLD) - { - llwarns << "Attempted to update distance for camera other than world camera!" << llendl; - return; - } - -#if !LL_RELEASE_FOR_DOWNLOAD - if (isState(LLSpatialGroup::OBJECT_DIRTY)) - { - llerrs << "Spatial group dirty on distance update." << llendl; - } -#endif - if (!getData().empty()) - { - mRadius = mSpatialPartition->mRenderByGroup ? mObjectBounds[1].getLength3().getF32() : - (F32) mOctreeNode->getSize().getLength3().getF32(); - mDistance = mSpatialPartition->calcDistance(this, camera); - mPixelArea = mSpatialPartition->calcPixelArea(this, camera); - } -} - -F32 LLSpatialPartition::calcDistance(LLSpatialGroup* group, LLCamera& camera) -{ - LLVector4a eye; - LLVector4a origin; - origin.load3(camera.getOrigin().mV); - - eye.setSub(group->mObjectBounds[0], origin); - - F32 dist = 0.f; - - if (group->mDrawMap.find(LLRenderPass::PASS_ALPHA) != group->mDrawMap.end()) - { - LLVector4a v = eye; - - dist = eye.getLength3().getF32(); - eye.normalize3fast(); - - if (!group->isState(LLSpatialGroup::ALPHA_DIRTY)) - { - if (!group->mSpatialPartition->isBridge()) - { - LLVector4a view_angle = eye; - - LLVector4a diff; - diff.setSub(view_angle, group->mLastUpdateViewAngle); - - if (diff.getLength3().getF32() > 0.64f) - { - group->mViewAngle = view_angle; - group->mLastUpdateViewAngle = view_angle; - //for occasional alpha sorting within the group - //NOTE: If there is a trivial way to detect that alpha sorting here would not change the render order, - //not setting this node to dirty would be a very good thing - group->setState(LLSpatialGroup::ALPHA_DIRTY); - gPipeline.markRebuild(group, FALSE); - } - } - } - - //calculate depth of node for alpha sorting - - LLVector3 at = camera.getAtAxis(); - - LLVector4a ata; - ata.load3(at.mV); - - LLVector4a t = ata; - //front of bounding box - t.mul(0.25f); - t.mul(group->mObjectBounds[1]); - v.sub(t); - - group->mDepth = v.dot3(ata).getF32(); - } - else - { - dist = eye.getLength3().getF32(); - } - - if (dist < 16.f) - { - dist /= 16.f; - dist *= dist; - dist *= 16.f; - } - - return dist; -} - -F32 LLSpatialPartition::calcPixelArea(LLSpatialGroup* group, LLCamera& camera) -{ - return LLPipeline::calcPixelArea(group->mObjectBounds[0], group->mObjectBounds[1], camera); -} - -F32 LLSpatialGroup::getUpdateUrgency() const -{ - if (!isVisible()) - { - return 0.f; - } - else - { - F32 time = gFrameTimeSeconds-mLastUpdateTime+4.f; - return time + (mObjectBounds[1].dot3(mObjectBounds[1]).getF32()+1.f)/mDistance; - } -} - -BOOL LLSpatialGroup::needsUpdate() -{ - return (LLDrawable::getCurrentFrame()%mSpatialPartition->mLODPeriod == mLODHash) ? TRUE : FALSE; -} - -BOOL LLSpatialGroup::changeLOD() -{ - if (isState(ALPHA_DIRTY | OBJECT_DIRTY)) - { ///a rebuild is going to happen, update distance and LoD - return TRUE; - } - - if (mSpatialPartition->mSlopRatio > 0.f) - { - F32 ratio = (mDistance - mLastUpdateDistance)/(llmax(mLastUpdateDistance, mRadius)); - - if (fabsf(ratio) >= mSpatialPartition->mSlopRatio) - { - return TRUE; - } - - if (mDistance > mRadius*2.f) - { - return FALSE; - } - } - - if (needsUpdate()) - { - return TRUE; - } - - return FALSE; -} - -void LLSpatialGroup::handleInsertion(const TreeNode* node, LLDrawable* drawablep) -{ - LLMemType mt(LLMemType::MTYPE_SPACE_PARTITION); - addObject(drawablep, FALSE, TRUE); - unbound(); - setState(OBJECT_DIRTY); -} - -void LLSpatialGroup::handleRemoval(const TreeNode* node, LLDrawable* drawable) -{ - LLMemType mt(LLMemType::MTYPE_SPACE_PARTITION); - removeObject(drawable, TRUE); - setState(OBJECT_DIRTY); -} - -void LLSpatialGroup::handleDestruction(const TreeNode* node) -{ - LLMemType mt(LLMemType::MTYPE_SPACE_PARTITION); - setState(DEAD); - - for (element_iter i = getData().begin(); i != getData().end(); ++i) - { - LLDrawable* drawable = *i; - if (drawable->getSpatialGroup() == this) - { - drawable->setSpatialGroup(NULL); - } - } - - clearDrawMap(); - mVertexBuffer = NULL; - mBufferMap.clear(); - sZombieGroups++; - mOctreeNode = NULL; -} - -void LLSpatialGroup::handleStateChange(const TreeNode* node) -{ - //drop bounding box upon state change - if (mOctreeNode != node) - { - mOctreeNode = (OctreeNode*) node; - } - unbound(); -} - -void LLSpatialGroup::handleChildAddition(const OctreeNode* parent, OctreeNode* child) -{ - LLMemType mt(LLMemType::MTYPE_SPACE_PARTITION); - if (child->getListenerCount() == 0) - { - new LLSpatialGroup(child, mSpatialPartition); - } - else - { - OCT_ERRS << "LLSpatialGroup redundancy detected." << llendl; - } - - unbound(); - - assert_states_valid(this); -} - -void LLSpatialGroup::handleChildRemoval(const OctreeNode* parent, const OctreeNode* child) -{ - unbound(); -} - -void LLSpatialGroup::destroyGL() -{ - setState(LLSpatialGroup::GEOM_DIRTY | LLSpatialGroup::IMAGE_DIRTY); - gPipeline.markRebuild(this, TRUE); - - mLastUpdateTime = gFrameTimeSeconds; - mVertexBuffer = NULL; - mBufferMap.clear(); - - clearDrawMap(); - - for (U32 i = 0; i < LLViewerCamera::NUM_CAMERAS; i++) - { - if (mOcclusionQuery[i]) - { - sQueryPool.release(mOcclusionQuery[i]); - mOcclusionQuery[i] = 0; - } - } - - mOcclusionVerts = NULL; - - for (LLSpatialGroup::element_iter i = getData().begin(); i != getData().end(); ++i) - { - LLDrawable* drawable = *i; - for (S32 j = 0; j < drawable->getNumFaces(); j++) - { - LLFace* facep = drawable->getFace(j); - facep->clearVertexBuffer(); - } - } -} - -BOOL LLSpatialGroup::rebound() -{ - if (!isState(DIRTY)) - { //return TRUE if we're not empty - return TRUE; - } - - if (mOctreeNode->getChildCount() == 1 && mOctreeNode->getElementCount() == 0) - { - LLSpatialGroup* group = (LLSpatialGroup*) mOctreeNode->getChild(0)->getListener(0); - group->rebound(); - - //copy single child's bounding box - mBounds[0] = group->mBounds[0]; - mBounds[1] = group->mBounds[1]; - mExtents[0] = group->mExtents[0]; - mExtents[1] = group->mExtents[1]; - - group->setState(SKIP_FRUSTUM_CHECK); - } - else if (mOctreeNode->isLeaf()) - { //copy object bounding box if this is a leaf - boundObjects(TRUE, mExtents[0], mExtents[1]); - mBounds[0] = mObjectBounds[0]; - mBounds[1] = mObjectBounds[1]; - } - else - { - LLVector4a& newMin = mExtents[0]; - LLVector4a& newMax = mExtents[1]; - LLSpatialGroup* group = (LLSpatialGroup*) mOctreeNode->getChild(0)->getListener(0); - group->clearState(SKIP_FRUSTUM_CHECK); - group->rebound(); - //initialize to first child - newMin = group->mExtents[0]; - newMax = group->mExtents[1]; - - //first, rebound children - for (U32 i = 1; i < mOctreeNode->getChildCount(); i++) - { - group = (LLSpatialGroup*) mOctreeNode->getChild(i)->getListener(0); - group->clearState(SKIP_FRUSTUM_CHECK); - group->rebound(); - const LLVector4a& max = group->mExtents[1]; - const LLVector4a& min = group->mExtents[0]; - - newMax.setMax(newMax, max); - newMin.setMin(newMin, min); - } - - boundObjects(FALSE, newMin, newMax); - - mBounds[0].setAdd(newMin, newMax); - mBounds[0].mul(0.5f); - mBounds[1].setSub(newMax, newMin); - mBounds[1].mul(0.5f); - } - - setState(OCCLUSION_DIRTY); - - clearState(DIRTY); - - return TRUE; -} - -static LLFastTimer::DeclareTimer FTM_OCCLUSION_READBACK("Readback Occlusion"); -void LLSpatialGroup::checkOcclusion() -{ - if (LLPipeline::sUseOcclusion > 1) - { - LLFastTimer t(FTM_OCCLUSION_READBACK); - LLSpatialGroup* parent = getParent(); - if (parent && parent->isOcclusionState(LLSpatialGroup::OCCLUDED)) - { //if the parent has been marked as occluded, the child is implicitly occluded - clearOcclusionState(QUERY_PENDING | DISCARD_QUERY); - } - else if (isOcclusionState(QUERY_PENDING)) - { //otherwise, if a query is pending, read it back - - GLuint available = 0; - if (mOcclusionQuery[LLViewerCamera::sCurCameraID]) - { - glGetQueryObjectuivARB(mOcclusionQuery[LLViewerCamera::sCurCameraID], GL_QUERY_RESULT_AVAILABLE_ARB, &available); - } - else - { - available = 1; - } - - if (available) - { //result is available, read it back, otherwise wait until next frame - GLuint res = 1; - if (!isOcclusionState(DISCARD_QUERY) && mOcclusionQuery[LLViewerCamera::sCurCameraID]) - { - glGetQueryObjectuivARB(mOcclusionQuery[LLViewerCamera::sCurCameraID], GL_QUERY_RESULT_ARB, &res); -#if LL_TRACK_PENDING_OCCLUSION_QUERIES - sPendingQueries.erase(mOcclusionQuery[LLViewerCamera::sCurCameraID]); -#endif - } - else if (mOcclusionQuery[LLViewerCamera::sCurCameraID]) - { //delete the query to avoid holding onto hundreds of pending queries - sQueryPool.release(mOcclusionQuery[LLViewerCamera::sCurCameraID]); - mOcclusionQuery[LLViewerCamera::sCurCameraID] = 0; - } - - if (isOcclusionState(DISCARD_QUERY)) - { - res = 2; - } - - if (res > 0) - { - assert_states_valid(this); - clearOcclusionState(LLSpatialGroup::OCCLUDED, LLSpatialGroup::STATE_MODE_DIFF); - assert_states_valid(this); - } - else - { - assert_states_valid(this); - setOcclusionState(LLSpatialGroup::OCCLUDED, LLSpatialGroup::STATE_MODE_DIFF); - assert_states_valid(this); - } - - clearOcclusionState(QUERY_PENDING | DISCARD_QUERY); - } - } - else if (mSpatialPartition->isOcclusionEnabled() && isOcclusionState(LLSpatialGroup::OCCLUDED)) - { //check occlusion has been issued for occluded node that has not had a query issued - assert_states_valid(this); - clearOcclusionState(LLSpatialGroup::OCCLUDED, LLSpatialGroup::STATE_MODE_DIFF); - assert_states_valid(this); - } - } -} - -static LLFastTimer::DeclareTimer FTM_PUSH_OCCLUSION_VERTS("Push Occlusion"); -static LLFastTimer::DeclareTimer FTM_SET_OCCLUSION_STATE("Occlusion State"); -static LLFastTimer::DeclareTimer FTM_OCCLUSION_EARLY_FAIL("Occlusion Early Fail"); - -void LLSpatialGroup::doOcclusion(LLCamera* camera) -{ - if (mSpatialPartition->isOcclusionEnabled() && LLPipeline::sUseOcclusion > 1) - { - // Don't cull hole/edge water, unless we have the GL_ARB_depth_clamp extension - if (earlyFail(camera, this)) - { - LLFastTimer t(FTM_OCCLUSION_EARLY_FAIL); - setOcclusionState(LLSpatialGroup::DISCARD_QUERY); - assert_states_valid(this); - clearOcclusionState(LLSpatialGroup::OCCLUDED, LLSpatialGroup::STATE_MODE_DIFF); - assert_states_valid(this); - } - else - { - if (!isOcclusionState(QUERY_PENDING) || isOcclusionState(DISCARD_QUERY)) - { - { //no query pending, or previous query to be discarded - LLFastTimer t(FTM_RENDER_OCCLUSION); - - if (!mOcclusionQuery[LLViewerCamera::sCurCameraID]) - { - mOcclusionQuery[LLViewerCamera::sCurCameraID] = sQueryPool.allocate(); - } - - if (mOcclusionVerts.isNull() || isState(LLSpatialGroup::OCCLUSION_DIRTY)) - { - buildOcclusion(); - } - - // Depth clamp all water to avoid it being culled as a result of being - // behind the far clip plane, and in the case of edge water to avoid - // it being culled while still visible. - bool const use_depth_clamp = gGLManager.mHasDepthClamp && - (mSpatialPartition->mDrawableType == LLDrawPool::POOL_WATER || - mSpatialPartition->mDrawableType == LLDrawPool::POOL_VOIDWATER); - - LLGLEnable clamp(use_depth_clamp ? GL_DEPTH_CLAMP : 0); - -#if !LL_DARWIN - U32 mode = gGLManager.mHasOcclusionQuery2 ? GL_ANY_SAMPLES_PASSED : GL_SAMPLES_PASSED_ARB; -#else - U32 mode = GL_SAMPLES_PASSED_ARB; -#endif - -#if LL_TRACK_PENDING_OCCLUSION_QUERIES - sPendingQueries.insert(mOcclusionQuery[LLViewerCamera::sCurCameraID]); -#endif - - { - LLFastTimer t(FTM_PUSH_OCCLUSION_VERTS); - glBeginQueryARB(mode, mOcclusionQuery[LLViewerCamera::sCurCameraID]); - - mOcclusionVerts->setBuffer(LLVertexBuffer::MAP_VERTEX); - - if (!use_depth_clamp && mSpatialPartition->mDrawableType == LLDrawPool::POOL_VOIDWATER) - { - LLGLSquashToFarClip squash(glh_get_current_projection(), 1); - if (camera->getOrigin().isExactlyZero()) - { //origin is invalid, draw entire box - mOcclusionVerts->drawRange(LLRender::TRIANGLE_FAN, 0, 7, 8, 0); - mOcclusionVerts->drawRange(LLRender::TRIANGLE_FAN, 0, 7, 8, b111*8); - } - else - { - mOcclusionVerts->drawRange(LLRender::TRIANGLE_FAN, 0, 7, 8, get_box_fan_indices(camera, mBounds[0])); - } - } - else - { - if (camera->getOrigin().isExactlyZero()) - { //origin is invalid, draw entire box - mOcclusionVerts->drawRange(LLRender::TRIANGLE_FAN, 0, 7, 8, 0); - mOcclusionVerts->drawRange(LLRender::TRIANGLE_FAN, 0, 7, 8, b111*8); - } - else - { - mOcclusionVerts->drawRange(LLRender::TRIANGLE_FAN, 0, 7, 8, get_box_fan_indices(camera, mBounds[0])); - } - } - - glEndQueryARB(mode); - } - } - - { - LLFastTimer t(FTM_SET_OCCLUSION_STATE); - setOcclusionState(LLSpatialGroup::QUERY_PENDING); - clearOcclusionState(LLSpatialGroup::DISCARD_QUERY); - } - } - } - } -} - -//============================================== - -LLSpatialPartition::LLSpatialPartition(U32 data_mask, BOOL render_by_group, U32 buffer_usage) -: mRenderByGroup(render_by_group) -{ - LLMemType mt(LLMemType::MTYPE_SPACE_PARTITION); - mOcclusionEnabled = TRUE; - mDrawableType = 0; - mPartitionType = LLViewerRegion::PARTITION_NONE; - mLODSeed = 0; - mLODPeriod = 1; - mVertexDataMask = data_mask; - mBufferUsage = buffer_usage; - mDepthMask = FALSE; - mSlopRatio = 0.25f; - mInfiniteFarClip = FALSE; - - LLVector4a center, size; - center.splat(0.f); - size.splat(1.f); - - mOctree = new LLSpatialGroup::OctreeRoot(center,size, - NULL); - new LLSpatialGroup(mOctree, this); -} - - -LLSpatialPartition::~LLSpatialPartition() -{ - LLMemType mt(LLMemType::MTYPE_SPACE_PARTITION); - - delete mOctree; - mOctree = NULL; -} - - -LLSpatialGroup *LLSpatialPartition::put(LLDrawable *drawablep, BOOL was_visible) -{ - LLMemType mt(LLMemType::MTYPE_SPACE_PARTITION); - - drawablep->updateSpatialExtents(); - - //keep drawable from being garbage collected - LLPointer<LLDrawable> ptr = drawablep; - - assert_octree_valid(mOctree); - mOctree->insert(drawablep); - assert_octree_valid(mOctree); - - LLSpatialGroup* group = drawablep->getSpatialGroup(); - - if (group && was_visible && group->isOcclusionState(LLSpatialGroup::QUERY_PENDING)) - { - group->setOcclusionState(LLSpatialGroup::DISCARD_QUERY, LLSpatialGroup::STATE_MODE_ALL_CAMERAS); - } - - return group; -} - -BOOL LLSpatialPartition::remove(LLDrawable *drawablep, LLSpatialGroup *curp) -{ - LLMemType mt(LLMemType::MTYPE_SPACE_PARTITION); - - drawablep->setSpatialGroup(NULL); - - if (!curp->removeObject(drawablep)) - { - OCT_ERRS << "Failed to remove drawable from octree!" << llendl; - } - - assert_octree_valid(mOctree); - - return TRUE; -} - -void LLSpatialPartition::move(LLDrawable *drawablep, LLSpatialGroup *curp, BOOL immediate) -{ - LLMemType mt(LLMemType::MTYPE_SPACE_PARTITION); - - // sanity check submitted by open source user bushing Spatula - // who was seeing crashing here. (See VWR-424 reported by Bunny Mayne) - if (!drawablep) - { - OCT_ERRS << "LLSpatialPartition::move was passed a bad drawable." << llendl; - return; - } - - BOOL was_visible = curp ? curp->isVisible() : FALSE; - - if (curp && curp->mSpatialPartition != this) - { - //keep drawable from being garbage collected - LLPointer<LLDrawable> ptr = drawablep; - if (curp->mSpatialPartition->remove(drawablep, curp)) - { - put(drawablep, was_visible); - return; - } - else - { - OCT_ERRS << "Drawable lost between spatial partitions on outbound transition." << llendl; - } - } - - if (curp && curp->updateInGroup(drawablep, immediate)) - { - // Already updated, don't need to do anything - assert_octree_valid(mOctree); - return; - } - - //keep drawable from being garbage collected - LLPointer<LLDrawable> ptr = drawablep; - if (curp && !remove(drawablep, curp)) - { - OCT_ERRS << "Move couldn't find existing spatial group!" << llendl; - } - - put(drawablep, was_visible); -} - -class LLSpatialShift : public LLSpatialGroup::OctreeTraveler -{ -public: - const LLVector4a& mOffset; - - LLSpatialShift(const LLVector4a& offset) : mOffset(offset) { } - virtual void visit(const LLSpatialGroup::OctreeNode* branch) - { - ((LLSpatialGroup*) branch->getListener(0))->shift(mOffset); - } -}; - -void LLSpatialPartition::shift(const LLVector4a &offset) -{ //shift octree node bounding boxes by offset - LLMemType mt(LLMemType::MTYPE_SPACE_PARTITION); - LLSpatialShift shifter(offset); - shifter.traverse(mOctree); -} - -class LLOctreeCull : public LLSpatialGroup::OctreeTraveler -{ -public: - LLOctreeCull(LLCamera* camera) - : mCamera(camera), mRes(0) { } - - virtual bool earlyFail(LLSpatialGroup* group) - { - group->checkOcclusion(); - - if (group->mOctreeNode->getParent() && //never occlusion cull the root node - LLPipeline::sUseOcclusion && //ignore occlusion if disabled - group->isOcclusionState(LLSpatialGroup::OCCLUDED)) - { - gPipeline.markOccluder(group); - return true; - } - - return false; - } - - virtual void traverse(const LLSpatialGroup::OctreeNode* n) - { - LLSpatialGroup* group = (LLSpatialGroup*) n->getListener(0); - - if (earlyFail(group)) - { - return; - } - - if (mRes == 2 || - (mRes && group->isState(LLSpatialGroup::SKIP_FRUSTUM_CHECK))) - { //fully in, just add everything - LLSpatialGroup::OctreeTraveler::traverse(n); - } - else - { - mRes = frustumCheck(group); - - if (mRes) - { //at least partially in, run on down - LLSpatialGroup::OctreeTraveler::traverse(n); - } - - mRes = 0; - } - } - - virtual S32 frustumCheck(const LLSpatialGroup* group) - { - S32 res = mCamera->AABBInFrustumNoFarClip(group->mBounds[0], group->mBounds[1]); - if (res != 0) - { - res = llmin(res, AABBSphereIntersect(group->mExtents[0], group->mExtents[1], mCamera->getOrigin(), mCamera->mFrustumCornerDist)); - } - return res; - } - - virtual S32 frustumCheckObjects(const LLSpatialGroup* group) - { - S32 res = mCamera->AABBInFrustumNoFarClip(group->mObjectBounds[0], group->mObjectBounds[1]); - if (res != 0) - { - res = llmin(res, AABBSphereIntersect(group->mObjectExtents[0], group->mObjectExtents[1], mCamera->getOrigin(), mCamera->mFrustumCornerDist)); - } - return res; - } - - virtual bool checkObjects(const LLSpatialGroup::OctreeNode* branch, const LLSpatialGroup* group) - { - if (branch->getElementCount() == 0) //no elements - { - return false; - } - else if (branch->getChildCount() == 0) //leaf state, already checked tightest bounding box - { - return true; - } - else if (mRes == 1 && !frustumCheckObjects(group)) //no objects in frustum - { - return false; - } - - return true; - } - - virtual void preprocess(LLSpatialGroup* group) - { - - } - - virtual void processGroup(LLSpatialGroup* group) - { - if (group->needsUpdate() || - group->mVisible[LLViewerCamera::sCurCameraID] < LLDrawable::getCurrentFrame() - 1) - { - group->doOcclusion(mCamera); - } - gPipeline.markNotCulled(group, *mCamera); - } - - virtual void visit(const LLSpatialGroup::OctreeNode* branch) - { - LLSpatialGroup* group = (LLSpatialGroup*) branch->getListener(0); - - preprocess(group); - - if (checkObjects(branch, group)) - { - processGroup(group); - } - } - - LLCamera *mCamera; - S32 mRes; -}; - -class LLOctreeCullNoFarClip : public LLOctreeCull -{ -public: - LLOctreeCullNoFarClip(LLCamera* camera) - : LLOctreeCull(camera) { } - - virtual S32 frustumCheck(const LLSpatialGroup* group) - { - return mCamera->AABBInFrustumNoFarClip(group->mBounds[0], group->mBounds[1]); - } - - virtual S32 frustumCheckObjects(const LLSpatialGroup* group) - { - S32 res = mCamera->AABBInFrustumNoFarClip(group->mObjectBounds[0], group->mObjectBounds[1]); - return res; - } -}; - -class LLOctreeCullShadow : public LLOctreeCull -{ -public: - LLOctreeCullShadow(LLCamera* camera) - : LLOctreeCull(camera) { } - - virtual S32 frustumCheck(const LLSpatialGroup* group) - { - return mCamera->AABBInFrustum(group->mBounds[0], group->mBounds[1]); - } - - virtual S32 frustumCheckObjects(const LLSpatialGroup* group) - { - return mCamera->AABBInFrustum(group->mObjectBounds[0], group->mObjectBounds[1]); - } -}; - -class LLOctreeCullVisExtents: public LLOctreeCullShadow -{ -public: - LLOctreeCullVisExtents(LLCamera* camera, LLVector4a& min, LLVector4a& max) - : LLOctreeCullShadow(camera), mMin(min), mMax(max), mEmpty(TRUE) { } - - virtual bool earlyFail(LLSpatialGroup* group) - { - if (group->mOctreeNode->getParent() && //never occlusion cull the root node - LLPipeline::sUseOcclusion && //ignore occlusion if disabled - group->isOcclusionState(LLSpatialGroup::OCCLUDED)) - { - return true; - } - - return false; - } - - virtual void traverse(const LLSpatialGroup::OctreeNode* n) - { - LLSpatialGroup* group = (LLSpatialGroup*) n->getListener(0); - - if (earlyFail(group)) - { - return; - } - - if ((mRes && group->isState(LLSpatialGroup::SKIP_FRUSTUM_CHECK)) || - mRes == 2) - { //don't need to do frustum check - LLSpatialGroup::OctreeTraveler::traverse(n); - } - else - { - mRes = frustumCheck(group); - - if (mRes) - { //at least partially in, run on down - LLSpatialGroup::OctreeTraveler::traverse(n); - } - - mRes = 0; - } - } - - virtual void processGroup(LLSpatialGroup* group) - { - llassert(!group->isState(LLSpatialGroup::DIRTY) && !group->getData().empty()) - - if (mRes < 2) - { - if (mCamera->AABBInFrustum(group->mObjectBounds[0], group->mObjectBounds[1]) > 0) - { - mEmpty = FALSE; - update_min_max(mMin, mMax, group->mObjectExtents[0]); - update_min_max(mMin, mMax, group->mObjectExtents[1]); - } - } - else - { - mEmpty = FALSE; - update_min_max(mMin, mMax, group->mExtents[0]); - update_min_max(mMin, mMax, group->mExtents[1]); - } - } - - BOOL mEmpty; - LLVector4a& mMin; - LLVector4a& mMax; -}; - -class LLOctreeCullDetectVisible: public LLOctreeCullShadow -{ -public: - LLOctreeCullDetectVisible(LLCamera* camera) - : LLOctreeCullShadow(camera), mResult(FALSE) { } - - virtual bool earlyFail(LLSpatialGroup* group) - { - if (mResult || //already found a node, don't check any more - (group->mOctreeNode->getParent() && //never occlusion cull the root node - LLPipeline::sUseOcclusion && //ignore occlusion if disabled - group->isOcclusionState(LLSpatialGroup::OCCLUDED))) - { - return true; - } - - return false; - } - - virtual void processGroup(LLSpatialGroup* group) - { - if (group->isVisible()) - { - mResult = TRUE; - } - } - - BOOL mResult; -}; - -class LLOctreeSelect : public LLOctreeCull -{ -public: - LLOctreeSelect(LLCamera* camera, std::vector<LLDrawable*>* results) - : LLOctreeCull(camera), mResults(results) { } - - virtual bool earlyFail(LLSpatialGroup* group) { return false; } - virtual void preprocess(LLSpatialGroup* group) { } - - virtual void processGroup(LLSpatialGroup* group) - { - LLSpatialGroup::OctreeNode* branch = group->mOctreeNode; - - for (LLSpatialGroup::OctreeNode::const_element_iter i = branch->getData().begin(); i != branch->getData().end(); ++i) - { - LLDrawable* drawable = *i; - - if (!drawable->isDead()) - { - if (drawable->isSpatialBridge()) - { - drawable->setVisible(*mCamera, mResults, TRUE); - } - else - { - mResults->push_back(drawable); - } - } - } - } - - std::vector<LLDrawable*>* mResults; -}; - -void drawBox(const LLVector3& c, const LLVector3& r) -{ - LLVertexBuffer::unbind(); - - gGL.begin(LLRender::TRIANGLE_STRIP); - //left front - gGL.vertex3fv((c+r.scaledVec(LLVector3(-1,1,-1))).mV); - gGL.vertex3fv((c+r.scaledVec(LLVector3(-1,1,1))).mV); - //right front - gGL.vertex3fv((c+r.scaledVec(LLVector3(1,1,-1))).mV); - gGL.vertex3fv((c+r.scaledVec(LLVector3(1,1,1))).mV); - //right back - gGL.vertex3fv((c+r.scaledVec(LLVector3(1,-1,-1))).mV); - gGL.vertex3fv((c+r.scaledVec(LLVector3(1,-1,1))).mV); - //left back - gGL.vertex3fv((c+r.scaledVec(LLVector3(-1,-1,-1))).mV); - gGL.vertex3fv((c+r.scaledVec(LLVector3(-1,-1,1))).mV); - //left front - gGL.vertex3fv((c+r.scaledVec(LLVector3(-1,1,-1))).mV); - gGL.vertex3fv((c+r.scaledVec(LLVector3(-1,1,1))).mV); - gGL.end(); - - //bottom - gGL.begin(LLRender::TRIANGLE_STRIP); - gGL.vertex3fv((c+r.scaledVec(LLVector3(1,1,-1))).mV); - gGL.vertex3fv((c+r.scaledVec(LLVector3(1,-1,-1))).mV); - gGL.vertex3fv((c+r.scaledVec(LLVector3(-1,1,-1))).mV); - gGL.vertex3fv((c+r.scaledVec(LLVector3(-1,-1,-1))).mV); - gGL.end(); - - //top - gGL.begin(LLRender::TRIANGLE_STRIP); - gGL.vertex3fv((c+r.scaledVec(LLVector3(1,1,1))).mV); - gGL.vertex3fv((c+r.scaledVec(LLVector3(-1,1,1))).mV); - gGL.vertex3fv((c+r.scaledVec(LLVector3(1,-1,1))).mV); - gGL.vertex3fv((c+r.scaledVec(LLVector3(-1,-1,1))).mV); - gGL.end(); -} - -void drawBox(const LLVector4a& c, const LLVector4a& r) -{ - drawBox(reinterpret_cast<const LLVector3&>(c), reinterpret_cast<const LLVector3&>(r)); -} - -void drawBoxOutline(const LLVector3& pos, const LLVector3& size) -{ - LLVector3 v1 = size.scaledVec(LLVector3( 1, 1,1)); - LLVector3 v2 = size.scaledVec(LLVector3(-1, 1,1)); - LLVector3 v3 = size.scaledVec(LLVector3(-1,-1,1)); - LLVector3 v4 = size.scaledVec(LLVector3( 1,-1,1)); - - gGL.begin(LLRender::LINES); - - //top - gGL.vertex3fv((pos+v1).mV); - gGL.vertex3fv((pos+v2).mV); - gGL.vertex3fv((pos+v2).mV); - gGL.vertex3fv((pos+v3).mV); - gGL.vertex3fv((pos+v3).mV); - gGL.vertex3fv((pos+v4).mV); - gGL.vertex3fv((pos+v4).mV); - gGL.vertex3fv((pos+v1).mV); - - //bottom - gGL.vertex3fv((pos-v1).mV); - gGL.vertex3fv((pos-v2).mV); - gGL.vertex3fv((pos-v2).mV); - gGL.vertex3fv((pos-v3).mV); - gGL.vertex3fv((pos-v3).mV); - gGL.vertex3fv((pos-v4).mV); - gGL.vertex3fv((pos-v4).mV); - gGL.vertex3fv((pos-v1).mV); - - //right - gGL.vertex3fv((pos+v1).mV); - gGL.vertex3fv((pos-v3).mV); - - gGL.vertex3fv((pos+v4).mV); - gGL.vertex3fv((pos-v2).mV); - - //left - gGL.vertex3fv((pos+v2).mV); - gGL.vertex3fv((pos-v4).mV); - - gGL.vertex3fv((pos+v3).mV); - gGL.vertex3fv((pos-v1).mV); - - gGL.end(); -} - -void drawBoxOutline(const LLVector4a& pos, const LLVector4a& size) -{ - drawBoxOutline(reinterpret_cast<const LLVector3&>(pos), reinterpret_cast<const LLVector3&>(size)); -} - -class LLOctreeDirty : public LLOctreeTraveler<LLDrawable> -{ -public: - virtual void visit(const LLOctreeNode<LLDrawable>* state) - { - LLSpatialGroup* group = (LLSpatialGroup*) state->getListener(0); - group->destroyGL(); - - for (LLSpatialGroup::element_iter i = group->getData().begin(); i != group->getData().end(); ++i) - { - LLDrawable* drawable = *i; - if (drawable->getVObj().notNull() && !group->mSpatialPartition->mRenderByGroup) - { - gPipeline.markRebuild(drawable, LLDrawable::REBUILD_ALL, TRUE); - } - } - - for (LLSpatialGroup::bridge_list_t::iterator i = group->mBridgeList.begin(); i != group->mBridgeList.end(); ++i) - { - LLSpatialBridge* bridge = *i; - traverse(bridge->mOctree); - } - } -}; - -void LLSpatialPartition::restoreGL() -{ - LLMemType mt(LLMemType::MTYPE_SPACE_PARTITION); -} - -void LLSpatialPartition::resetVertexBuffers() -{ - LLOctreeDirty dirty; - dirty.traverse(mOctree); -} - -BOOL LLSpatialPartition::isOcclusionEnabled() -{ - return mOcclusionEnabled || LLPipeline::sUseOcclusion > 2; -} - -BOOL LLSpatialPartition::getVisibleExtents(LLCamera& camera, LLVector3& visMin, LLVector3& visMax) -{ - LLVector4a visMina, visMaxa; - visMina.load3(visMin.mV); - visMaxa.load3(visMax.mV); - - { - LLFastTimer ftm(FTM_CULL_REBOUND); - LLSpatialGroup* group = (LLSpatialGroup*) mOctree->getListener(0); - group->rebound(); - } - - LLOctreeCullVisExtents vis(&camera, visMina, visMaxa); - vis.traverse(mOctree); - - visMin.set(visMina.getF32ptr()); - visMax.set(visMaxa.getF32ptr()); - return vis.mEmpty; -} - -BOOL LLSpatialPartition::visibleObjectsInFrustum(LLCamera& camera) -{ - LLOctreeCullDetectVisible vis(&camera); - vis.traverse(mOctree); - return vis.mResult; -} - -S32 LLSpatialPartition::cull(LLCamera &camera, std::vector<LLDrawable *>* results, BOOL for_select) -{ - LLMemType mt(LLMemType::MTYPE_SPACE_PARTITION); -#if LL_OCTREE_PARANOIA_CHECK - ((LLSpatialGroup*)mOctree->getListener(0))->checkStates(); -#endif - { - LLFastTimer ftm(FTM_CULL_REBOUND); - LLSpatialGroup* group = (LLSpatialGroup*) mOctree->getListener(0); - group->rebound(); - } - -#if LL_OCTREE_PARANOIA_CHECK - ((LLSpatialGroup*)mOctree->getListener(0))->validate(); -#endif - - - if (for_select) - { - LLOctreeSelect selecter(&camera, results); - selecter.traverse(mOctree); - } - else if (LLPipeline::sShadowRender) - { - LLFastTimer ftm(FTM_FRUSTUM_CULL); - LLOctreeCullShadow culler(&camera); - culler.traverse(mOctree); - } - else if (mInfiniteFarClip || !LLPipeline::sUseFarClip) - { - LLFastTimer ftm(FTM_FRUSTUM_CULL); - LLOctreeCullNoFarClip culler(&camera); - culler.traverse(mOctree); - } - else - { - LLFastTimer ftm(FTM_FRUSTUM_CULL); - LLOctreeCull culler(&camera); - culler.traverse(mOctree); - } - - return 0; -} - -BOOL earlyFail(LLCamera* camera, LLSpatialGroup* group) -{ - if (camera->getOrigin().isExactlyZero()) - { - return FALSE; - } - - const F32 vel = SG_OCCLUSION_FUDGE*2.f; - LLVector4a fudge; - fudge.splat(vel); - - const LLVector4a& c = group->mBounds[0]; - LLVector4a r; - r.setAdd(group->mBounds[1], fudge); - - /*if (r.magVecSquared() > 1024.0*1024.0) - { - return TRUE; - }*/ - - LLVector4a e; - e.load3(camera->getOrigin().mV); - - LLVector4a min; - min.setSub(c,r); - LLVector4a max; - max.setAdd(c,r); - - S32 lt = e.lessThan(min).getGatheredBits() & 0x7; - if (lt) - { - return FALSE; - } - - S32 gt = e.greaterThan(max).getGatheredBits() & 0x7; - if (gt) - { - return FALSE; - } - - return TRUE; -} - - -void pushVerts(LLDrawInfo* params, U32 mask) -{ - LLRenderPass::applyModelMatrix(*params); - params->mVertexBuffer->setBuffer(mask); - params->mVertexBuffer->drawRange(params->mParticle ? LLRender::POINTS : LLRender::TRIANGLES, - params->mStart, params->mEnd, params->mCount, params->mOffset); -} - -void pushVerts(LLSpatialGroup* group, U32 mask) -{ - LLDrawInfo* params = NULL; - - for (LLSpatialGroup::draw_map_t::iterator i = group->mDrawMap.begin(); i != group->mDrawMap.end(); ++i) - { - for (LLSpatialGroup::drawmap_elem_t::iterator j = i->second.begin(); j != i->second.end(); ++j) - { - params = *j; - pushVerts(params, mask); - } - } -} - -void pushVerts(LLFace* face, U32 mask) -{ - llassert(face->verify()); - - LLVertexBuffer* buffer = face->getVertexBuffer(); - - if (buffer) - { - buffer->setBuffer(mask); - U16 start = face->getGeomStart(); - U16 end = start + face->getGeomCount()-1; - U32 count = face->getIndicesCount(); - U16 offset = face->getIndicesStart(); - buffer->drawRange(LLRender::TRIANGLES, start, end, count, offset); - } -} - -void pushVerts(LLDrawable* drawable, U32 mask) -{ - for (S32 i = 0; i < drawable->getNumFaces(); ++i) - { - pushVerts(drawable->getFace(i), mask); - } -} - -void pushVerts(LLVolume* volume) -{ - LLVertexBuffer::unbind(); - for (S32 i = 0; i < volume->getNumVolumeFaces(); ++i) - { - const LLVolumeFace& face = volume->getVolumeFace(i); - glVertexPointer(3, GL_FLOAT, 16, face.mPositions); - glDrawElements(GL_TRIANGLES, face.mNumIndices, GL_UNSIGNED_SHORT, face.mIndices); - } -} - -void pushBufferVerts(LLVertexBuffer* buffer, U32 mask) -{ - if (buffer) - { - buffer->setBuffer(mask); - buffer->drawRange(LLRender::TRIANGLES, 0, buffer->getRequestedVerts()-1, buffer->getRequestedIndices(), 0); - } -} - -void pushBufferVerts(LLSpatialGroup* group, U32 mask) -{ - if (group->mSpatialPartition->mRenderByGroup) - { - if (!group->mDrawMap.empty()) - { - LLDrawInfo* params = *(group->mDrawMap.begin()->second.begin()); - LLRenderPass::applyModelMatrix(*params); - - pushBufferVerts(group->mVertexBuffer, mask); - - for (LLSpatialGroup::buffer_map_t::iterator i = group->mBufferMap.begin(); i != group->mBufferMap.end(); ++i) - { - for (LLSpatialGroup::buffer_texture_map_t::iterator j = i->second.begin(); j != i->second.end(); ++j) - { - for (LLSpatialGroup::buffer_list_t::iterator k = j->second.begin(); k != j->second.end(); ++k) - { - pushBufferVerts(*k, mask); - } - } - } - } - } - else - { - drawBox(group->mBounds[0], group->mBounds[1]); - } -} - -void pushVertsColorCoded(LLSpatialGroup* group, U32 mask) -{ - LLDrawInfo* params = NULL; - - LLColor4 colors[] = { - LLColor4::green, - LLColor4::green1, - LLColor4::green2, - LLColor4::green3, - LLColor4::green4, - LLColor4::green5, - LLColor4::green6 - }; - - static const U32 col_count = LL_ARRAY_SIZE(colors); - - U32 col = 0; - - for (LLSpatialGroup::draw_map_t::iterator i = group->mDrawMap.begin(); i != group->mDrawMap.end(); ++i) - { - for (LLSpatialGroup::drawmap_elem_t::iterator j = i->second.begin(); j != i->second.end(); ++j) - { - params = *j; - LLRenderPass::applyModelMatrix(*params); - glColor4f(colors[col].mV[0], colors[col].mV[1], colors[col].mV[2], 0.5f); - params->mVertexBuffer->setBuffer(mask); - params->mVertexBuffer->drawRange(params->mParticle ? LLRender::POINTS : LLRender::TRIANGLES, - params->mStart, params->mEnd, params->mCount, params->mOffset); - col = (col+1)%col_count; - } - } -} - -void renderOctree(LLSpatialGroup* group) -{ - //render solid object bounding box, color - //coded by buffer usage and activity - gGL.setSceneBlendType(LLRender::BT_ADD_WITH_ALPHA); - LLVector4 col; - /*if (group->mBuilt > 0.f) - { - group->mBuilt -= 2.f * gFrameIntervalSeconds; - if (group->mBufferUsage == GL_STATIC_DRAW_ARB) - { - col.setVec(1.0f, 0, 0, group->mBuilt*0.5f); - } - else - { - col.setVec(0.1f,0.1f,1,0.1f); - //col.setVec(1.0f, 1.0f, 0, sinf(group->mBuilt*3.14159f)*0.5f); - } - - if (group->mBufferUsage != GL_STATIC_DRAW_ARB) - { - LLGLDepthTest gl_depth(FALSE, FALSE); - glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); - - gGL.color4f(1,0,0,group->mBuilt); - gGL.flush(); - glLineWidth(5.f); - drawBoxOutline(group->mObjectBounds[0], group->mObjectBounds[1]); - gGL.flush(); - glLineWidth(1.f); - gGL.flush(); - for (LLSpatialGroup::element_iter i = group->getData().begin(); i != group->getData().end(); ++i) - { - LLDrawable* drawable = *i; - if (!group->mSpatialPartition->isBridge()) - { - glPushMatrix(); - LLVector3 trans = drawable->getRegion()->getOriginAgent(); - glTranslatef(trans.mV[0], trans.mV[1], trans.mV[2]); - } - - for (S32 j = 0; j < drawable->getNumFaces(); j++) - { - LLFace* face = drawable->getFace(j); - if (face->getVertexBuffer()) - { - if (gFrameTimeSeconds - face->mLastUpdateTime < 0.5f) - { - glColor4f(0, 1, 0, group->mBuilt); - } - else if (gFrameTimeSeconds - face->mLastMoveTime < 0.5f) - { - glColor4f(1, 0, 0, group->mBuilt); - } - else - { - continue; - } - - face->getVertexBuffer()->setBuffer(LLVertexBuffer::MAP_VERTEX); - //drawBox((face->mExtents[0] + face->mExtents[1])*0.5f, - // (face->mExtents[1]-face->mExtents[0])*0.5f); - face->getVertexBuffer()->draw(LLRender::TRIANGLES, face->getIndicesCount(), face->getIndicesStart()); - } - } - - if (!group->mSpatialPartition->isBridge()) - { - glPopMatrix(); - } - } - glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); - gGL.color4f(1,1,1,1); - } - } - else*/ - { - if (group->mBufferUsage == GL_STATIC_DRAW_ARB && !group->getData().empty() - && group->mSpatialPartition->mRenderByGroup) - { - col.setVec(0.8f, 0.4f, 0.1f, 0.1f); - } - else - { - col.setVec(0.1f, 0.1f, 1.f, 0.1f); - } - } - - gGL.color4fv(col.mV); - LLVector4a fudge; - fudge.splat(0.001f); - LLVector4a size = group->mObjectBounds[1]; - size.mul(1.01f); - size.add(fudge); - - //{ - // LLGLDepthTest depth(GL_TRUE, GL_FALSE); - // drawBox(group->mObjectBounds[0], fudge); - //} - - gGL.setSceneBlendType(LLRender::BT_ALPHA); - - //if (group->mBuilt <= 0.f) - { - //draw opaque outline - //gGL.color4f(col.mV[0], col.mV[1], col.mV[2], 1.f); - //drawBoxOutline(group->mObjectBounds[0], group->mObjectBounds[1]); - - gGL.color4f(0,1,1,1); - drawBoxOutline(group->mBounds[0],group->mBounds[1]); - - //draw bounding box for draw info - /*if (group->mSpatialPartition->mRenderByGroup) - { - gGL.color4f(1.0f, 0.75f, 0.25f, 0.6f); - for (LLSpatialGroup::draw_map_t::iterator i = group->mDrawMap.begin(); i != group->mDrawMap.end(); ++i) - { - for (LLSpatialGroup::drawmap_elem_t::iterator j = i->second.begin(); j != i->second.end(); ++j) - { - LLDrawInfo* draw_info = *j; - LLVector4a center; - center.setAdd(draw_info->mExtents[1], draw_info->mExtents[0]); - center.mul(0.5f); - LLVector4a size; - size.setSub(draw_info->mExtents[1], draw_info->mExtents[0]); - size.mul(0.5f); - drawBoxOutline(center, size); - } - } - }*/ - } - -// LLSpatialGroup::OctreeNode* node = group->mOctreeNode; -// gGL.color4f(0,1,0,1); -// drawBoxOutline(LLVector3(node->getCenter()), LLVector3(node->getSize())); -} - -void renderVisibility(LLSpatialGroup* group, LLCamera* camera) -{ - LLGLEnable blend(GL_BLEND); - gGL.setSceneBlendType(LLRender::BT_ALPHA); - LLGLEnable cull(GL_CULL_FACE); - glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); - - BOOL render_objects = (!LLPipeline::sUseOcclusion || !group->isOcclusionState(LLSpatialGroup::OCCLUDED)) && group->isVisible() && - !group->getData().empty(); - if (render_objects) - { - LLGLDepthTest depth_under(GL_TRUE, GL_FALSE, GL_GREATER); - glColor4f(0, 0.5f, 0, 0.5f); - gGL.color4f(0, 0.5f, 0, 0.5f); - pushBufferVerts(group, LLVertexBuffer::MAP_VERTEX); - } - - { - LLGLDepthTest depth_over(GL_TRUE, GL_FALSE, GL_LEQUAL); - - if (render_objects) - { - glColor4f(0.f, 0.5f, 0.f,1.f); - gGL.color4f(0.f, 0.5f, 0.f, 1.f); - pushBufferVerts(group, LLVertexBuffer::MAP_VERTEX); - } - - glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); - - if (render_objects) - { - glColor4f(0.f, 0.75f, 0.f,0.5f); - gGL.color4f(0.f, 0.75f, 0.f, 0.5f); - pushBufferVerts(group, LLVertexBuffer::MAP_VERTEX); - } - /*else if (camera && group->mOcclusionVerts.notNull()) - { - LLVertexBuffer::unbind(); - group->mOcclusionVerts->setBuffer(LLVertexBuffer::MAP_VERTEX); - - glColor4f(1.0f, 0.f, 0.f, 0.5f); - group->mOcclusionVerts->drawRange(LLRender::TRIANGLE_FAN, 0, 7, 8, get_box_fan_indices(camera, group->mBounds[0])); - glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); - - glColor4f(1.0f, 1.f, 1.f, 1.0f); - group->mOcclusionVerts->drawRange(LLRender::TRIANGLE_FAN, 0, 7, 8, get_box_fan_indices(camera, group->mBounds[0])); - glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); - }*/ - } -} - -void renderCrossHairs(LLVector3 position, F32 size, LLColor4 color) -{ - gGL.color4fv(color.mV); - gGL.begin(LLRender::LINES); - { - gGL.vertex3fv((position - LLVector3(size, 0.f, 0.f)).mV); - gGL.vertex3fv((position + LLVector3(size, 0.f, 0.f)).mV); - gGL.vertex3fv((position - LLVector3(0.f, size, 0.f)).mV); - gGL.vertex3fv((position + LLVector3(0.f, size, 0.f)).mV); - gGL.vertex3fv((position - LLVector3(0.f, 0.f, size)).mV); - gGL.vertex3fv((position + LLVector3(0.f, 0.f, size)).mV); - } - gGL.end(); -} - -void renderUpdateType(LLDrawable* drawablep) -{ - LLViewerObject* vobj = drawablep->getVObj(); - if (!vobj || OUT_UNKNOWN == vobj->getLastUpdateType()) - { - return; - } - LLGLEnable blend(GL_BLEND); - switch (vobj->getLastUpdateType()) - { - case OUT_FULL: - glColor4f(0,1,0,0.5f); - break; - case OUT_TERSE_IMPROVED: - glColor4f(0,1,1,0.5f); - break; - case OUT_FULL_COMPRESSED: - if (vobj->getLastUpdateCached()) - { - glColor4f(1,0,0,0.5f); - } - else - { - glColor4f(1,1,0,0.5f); - } - break; - case OUT_FULL_CACHED: - glColor4f(0,0,1,0.5f); - break; - default: - llwarns << "Unknown update_type " << vobj->getLastUpdateType() << llendl; - break; - }; - S32 num_faces = drawablep->getNumFaces(); - if (num_faces) - { - for (S32 i = 0; i < num_faces; ++i) - { - pushVerts(drawablep->getFace(i), LLVertexBuffer::MAP_VERTEX); - } - } -} - -void renderComplexityDisplay(LLDrawable* drawablep) -{ - LLViewerObject* vobj = drawablep->getVObj(); - if (!vobj) - { - return; - } - - LLVOVolume *voVol = dynamic_cast<LLVOVolume*>(vobj); - - if (!voVol) - { - return; - } - - if (!voVol->isRoot()) - { - return; - } - - LLVOVolume::texture_cost_t textures; - F32 cost = (F32) voVol->getRenderCost(textures); - - // add any child volumes - LLViewerObject::const_child_list_t children = voVol->getChildren(); - for (LLViewerObject::const_child_list_t::const_iterator iter = children.begin(); iter != children.end(); ++iter) - { - const LLViewerObject *child = *iter; - const LLVOVolume *child_volume = dynamic_cast<const LLVOVolume*>(child); - if (child_volume) - { - cost += child_volume->getRenderCost(textures); - } - } - - // add texture cost - for (LLVOVolume::texture_cost_t::iterator iter = textures.begin(); iter != textures.end(); ++iter) - { - // add the cost of each individual texture in the linkset - cost += iter->second; - } - - F32 cost_max = (F32) LLVOVolume::getRenderComplexityMax(); - - - - // allow user to set a static color scale - if (gSavedSettings.getS32("RenderComplexityStaticMax") > 0) - { - cost_max = gSavedSettings.getS32("RenderComplexityStaticMax"); - } - - F32 cost_ratio = cost / cost_max; - - // cap cost ratio at 1.0f in case cost_max is at a low threshold - cost_ratio = cost_ratio > 1.0f ? 1.0f : cost_ratio; - - LLGLEnable blend(GL_BLEND); - - LLColor4 color; - const LLColor4 color_min = gSavedSettings.getColor4("RenderComplexityColorMin"); - const LLColor4 color_mid = gSavedSettings.getColor4("RenderComplexityColorMid"); - const LLColor4 color_max = gSavedSettings.getColor4("RenderComplexityColorMax"); - - if (cost_ratio < 0.5f) - { - color = color_min * (1 - cost_ratio * 2) + color_mid * (cost_ratio * 2); - } - else - { - color = color_mid * (1 - (cost_ratio - 0.5) * 2) + color_max * ((cost_ratio - 0.5) * 2); - } - - LLSD color_val = color.getValue(); - - // don't highlight objects below the threshold - if (cost > gSavedSettings.getS32("RenderComplexityThreshold")) - { - glColor4f(color[0],color[1],color[2],0.5f); - - - S32 num_faces = drawablep->getNumFaces(); - if (num_faces) - { - for (S32 i = 0; i < num_faces; ++i) - { - pushVerts(drawablep->getFace(i), LLVertexBuffer::MAP_VERTEX); - } - } - LLViewerObject::const_child_list_t children = voVol->getChildren(); - for (LLViewerObject::const_child_list_t::const_iterator iter = children.begin(); iter != children.end(); ++iter) - { - const LLViewerObject *child = *iter; - if (child) - { - num_faces = child->getNumFaces(); - if (num_faces) - { - for (S32 i = 0; i < num_faces; ++i) - { - pushVerts(child->mDrawable->getFace(i), LLVertexBuffer::MAP_VERTEX); - } - } - } - } - } - - voVol->setDebugText(llformat("%4.0f", cost)); -} - -void renderBoundingBox(LLDrawable* drawable, BOOL set_color = TRUE) -{ - if (set_color) - { - if (drawable->isSpatialBridge()) - { - gGL.color4f(1,0.5f,0,1); - } - else if (drawable->getVOVolume()) - { - if (drawable->isRoot()) - { - gGL.color4f(1,1,0,1); - } - else - { - gGL.color4f(0,1,0,1); - } - } - else if (drawable->getVObj()) - { - switch (drawable->getVObj()->getPCode()) - { - case LLViewerObject::LL_VO_SURFACE_PATCH: - gGL.color4f(0,1,1,1); - break; - case LLViewerObject::LL_VO_CLOUDS: - // no longer used - break; - case LLViewerObject::LL_VO_PART_GROUP: - case LLViewerObject::LL_VO_HUD_PART_GROUP: - gGL.color4f(0,0,1,1); - break; - case LLViewerObject::LL_VO_VOID_WATER: - case LLViewerObject::LL_VO_WATER: - gGL.color4f(0,0.5f,1,1); - break; - case LL_PCODE_LEGACY_TREE: - gGL.color4f(0,0.5f,0,1); - break; - default: - gGL.color4f(1,0,1,1); - break; - } - } - else - { - gGL.color4f(1,0,0,1); - } - } - - const LLVector4a* ext; - LLVector4a pos, size; - - //render face bounding boxes - for (S32 i = 0; i < drawable->getNumFaces(); i++) - { - LLFace* facep = drawable->getFace(i); - - ext = facep->mExtents; - - pos.setAdd(ext[0], ext[1]); - pos.mul(0.5f); - size.setSub(ext[1], ext[0]); - size.mul(0.5f); - - drawBoxOutline(pos,size); - } - - //render drawable bounding box - ext = drawable->getSpatialExtents(); - - pos.setAdd(ext[0], ext[1]); - pos.mul(0.5f); - size.setSub(ext[1], ext[0]); - size.mul(0.5f); - - LLViewerObject* vobj = drawable->getVObj(); - if (vobj && vobj->onActiveList()) - { - gGL.flush(); - glLineWidth(llmax(4.f*sinf(gFrameTimeSeconds*2.f)+1.f, 1.f)); - //glLineWidth(4.f*(sinf(gFrameTimeSeconds*2.f)*0.25f+0.75f)); - stop_glerror(); - drawBoxOutline(pos,size); - gGL.flush(); - glLineWidth(1.f); - } - else - { - drawBoxOutline(pos,size); - } -} - -void renderNormals(LLDrawable* drawablep) -{ - LLVertexBuffer::unbind(); - - LLVOVolume* vol = drawablep->getVOVolume(); - if (vol) - { - LLVolume* volume = vol->getVolume(); - gGL.pushMatrix(); - glMultMatrixf((F32*) vol->getRelativeXform().mMatrix); - - gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); - - LLVector4a scale(gSavedSettings.getF32("RenderDebugNormalScale")); - - for (S32 i = 0; i < volume->getNumVolumeFaces(); ++i) - { - const LLVolumeFace& face = volume->getVolumeFace(i); - - gGL.begin(LLRender::LINES); - - for (S32 j = 0; j < face.mNumVertices; ++j) - { - LLVector4a n,p; - - n.setMul(face.mNormals[j], scale); - p.setAdd(face.mPositions[j], n); - - gGL.color4f(1,1,1,1); - gGL.vertex3fv(face.mPositions[j].getF32ptr()); - gGL.vertex3fv(p.getF32ptr()); - - if (face.mBinormals) - { - n.setMul(face.mBinormals[j], scale); - p.setAdd(face.mPositions[j], n); - - gGL.color4f(0,1,1,1); - gGL.vertex3fv(face.mPositions[j].getF32ptr()); - gGL.vertex3fv(p.getF32ptr()); - } - } - - gGL.end(); - } - - gGL.popMatrix(); - } -} - -S32 get_physics_detail(const LLVolumeParams& volume_params, const LLVector3& scale) -{ - const S32 DEFAULT_DETAIL = 1; - const F32 LARGE_THRESHOLD = 5.f; - const F32 MEGA_THRESHOLD = 25.f; - - S32 detail = DEFAULT_DETAIL; - F32 avg_scale = (scale[0]+scale[1]+scale[2])/3.f; - - if (avg_scale > LARGE_THRESHOLD) - { - detail += 1; - if (avg_scale > MEGA_THRESHOLD) - { - detail += 1; - } - } - - return detail; -} - -void renderMeshBaseHull(LLVOVolume* volume, U32 data_mask, LLColor4& color, LLColor4& line_color) -{ - LLUUID mesh_id = volume->getVolume()->getParams().getSculptID(); - LLModel::Decomposition* decomp = gMeshRepo.getDecomposition(mesh_id); - - const LLVector3 center(0,0,0); - const LLVector3 size(0.25f,0.25f,0.25f); - - if (decomp) - { - if (!decomp->mBaseHullMesh.empty()) - { - glColor4fv(color.mV); - LLVertexBuffer::drawArrays(LLRender::TRIANGLES, decomp->mBaseHullMesh.mPositions, decomp->mBaseHullMesh.mNormals); - } - else - { - gMeshRepo.buildPhysicsMesh(*decomp); - gGL.color3f(0,1,1); - drawBoxOutline(center, size); - } - - } - else - { - gGL.color3f(1,0,1); - drawBoxOutline(center, size); - } -} - -void render_hull(LLModel::PhysicsMesh& mesh, const LLColor4& color, const LLColor4& line_color) -{ - glColor4fv(color.mV); - LLVertexBuffer::drawArrays(LLRender::TRIANGLES, mesh.mPositions, mesh.mNormals); - LLGLEnable offset(GL_POLYGON_OFFSET_LINE); - glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); - glPolygonOffset(3.f, 3.f); - glLineWidth(3.f); - glColor4fv(line_color.mV); - LLVertexBuffer::drawArrays(LLRender::TRIANGLES, mesh.mPositions, mesh.mNormals); - glLineWidth(1.f); - glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); -} - -void renderPhysicsShape(LLDrawable* drawable, LLVOVolume* volume) -{ - U8 physics_type = volume->getPhysicsShapeType(); - - if (physics_type == LLViewerObject::PHYSICS_SHAPE_NONE || volume->isFlexible()) - { - return; - } - - //not allowed to return at this point without rendering *something* - - F32 threshold = gSavedSettings.getF32("ObjectCostHighThreshold"); - F32 cost = volume->getObjectCost(); - - LLColor4 low = gSavedSettings.getColor4("ObjectCostLowColor"); - LLColor4 mid = gSavedSettings.getColor4("ObjectCostMidColor"); - LLColor4 high = gSavedSettings.getColor4("ObjectCostHighColor"); - - F32 normalizedCost = 1.f - exp( -(cost / threshold) ); - - LLColor4 color; - if ( normalizedCost <= 0.5f ) - { - color = lerp( low, mid, 2.f * normalizedCost ); - } - else - { - color = lerp( mid, high, 2.f * ( normalizedCost - 0.5f ) ); - } - - LLColor4 line_color = color*0.5f; - - U32 data_mask = LLVertexBuffer::MAP_VERTEX; - - LLVolumeParams volume_params = volume->getVolume()->getParams(); - - LLPhysicsVolumeParams physics_params(volume_params, - physics_type == LLViewerObject::PHYSICS_SHAPE_CONVEX_HULL); - - LLPhysicsShapeBuilderUtil::PhysicsShapeSpecification physics_spec; - LLPhysicsShapeBuilderUtil::determinePhysicsShape(physics_params, volume->getScale(), physics_spec); - - U32 type = physics_spec.getType(); - - LLVector3 center(0,0,0); - LLVector3 size(0.25f,0.25f,0.25f); - - gGL.pushMatrix(); - glMultMatrixf((F32*) volume->getRelativeXform().mMatrix); - - if (type == LLPhysicsShapeBuilderUtil::PhysicsShapeSpecification::USER_MESH) - { - LLUUID mesh_id = volume->getVolume()->getParams().getSculptID(); - LLModel::Decomposition* decomp = gMeshRepo.getDecomposition(mesh_id); - - if (decomp) - { //render a physics based mesh - - gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); - - if (!decomp->mHull.empty()) - { //decomposition exists, use that - - if (decomp->mMesh.empty()) - { - gMeshRepo.buildPhysicsMesh(*decomp); - } - - for (U32 i = 0; i < decomp->mMesh.size(); ++i) - { - render_hull(decomp->mMesh[i], color, line_color); - } - } - else if (!decomp->mPhysicsShapeMesh.empty()) - { - //decomp has physics mesh, render that mesh - glColor4fv(color.mV); - LLVertexBuffer::drawArrays(LLRender::TRIANGLES, decomp->mPhysicsShapeMesh.mPositions, decomp->mPhysicsShapeMesh.mNormals); - - glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); - glColor4fv(line_color.mV); - LLVertexBuffer::drawArrays(LLRender::TRIANGLES, decomp->mPhysicsShapeMesh.mPositions, decomp->mPhysicsShapeMesh.mNormals); - glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); - } - else - { //no mesh or decomposition, render base hull - renderMeshBaseHull(volume, data_mask, color, line_color); - - if (decomp->mPhysicsShapeMesh.empty()) - { - //attempt to fetch physics shape mesh if available - gMeshRepo.fetchPhysicsShape(mesh_id); - } - } - } - else - { - gGL.color3f(1,1,0); - drawBoxOutline(center, size); - } - } - else if (type == LLPhysicsShapeBuilderUtil::PhysicsShapeSpecification::USER_CONVEX || - type == LLPhysicsShapeBuilderUtil::PhysicsShapeSpecification::PRIM_CONVEX) - { - if (volume->isMesh()) - { - renderMeshBaseHull(volume, data_mask, color, line_color); - } -#if LL_WINDOWS - else - { - LLVolumeParams volume_params = volume->getVolume()->getParams(); - S32 detail = get_physics_detail(volume_params, volume->getScale()); - LLVolume* phys_volume = LLPrimitive::sVolumeManager->refVolume(volume_params, detail); - - if (!phys_volume->mHullPoints) - { //build convex hull - std::vector<LLVector3> pos; - std::vector<U16> index; - - S32 index_offset = 0; - - for (S32 i = 0; i < phys_volume->getNumVolumeFaces(); ++i) - { - const LLVolumeFace& face = phys_volume->getVolumeFace(i); - if (index_offset + face.mNumVertices > 65535) - { - continue; - } - - for (S32 j = 0; j < face.mNumVertices; ++j) - { - pos.push_back(LLVector3(face.mPositions[j].getF32ptr())); - } - - for (S32 j = 0; j < face.mNumIndices; ++j) - { - index.push_back(face.mIndices[j]+index_offset); - } - - index_offset += face.mNumVertices; - } - - if (!pos.empty() && !index.empty()) - { - LLCDMeshData mesh; - mesh.mIndexBase = &index[0]; - mesh.mVertexBase = pos[0].mV; - mesh.mNumVertices = pos.size(); - mesh.mVertexStrideBytes = 12; - mesh.mIndexStrideBytes = 6; - mesh.mIndexType = LLCDMeshData::INT_16; - - mesh.mNumTriangles = index.size()/3; - - LLCDMeshData res; - - LLConvexDecomposition::getInstance()->generateSingleHullMeshFromMesh( &mesh, &res ); - - //copy res into phys_volume - phys_volume->mHullPoints = (LLVector4a*) ll_aligned_malloc_16(sizeof(LLVector4a)*res.mNumVertices); - phys_volume->mNumHullPoints = res.mNumVertices; - - S32 idx_size = (res.mNumTriangles*3*2+0xF) & ~0xF; - phys_volume->mHullIndices = (U16*) ll_aligned_malloc_16(idx_size); - phys_volume->mNumHullIndices = res.mNumTriangles*3; - - const F32* v = res.mVertexBase; - - for (S32 i = 0; i < res.mNumVertices; ++i) - { - F32* p = (F32*) ((U8*)v+i*res.mVertexStrideBytes); - phys_volume->mHullPoints[i].load3(p); - } - - if (res.mIndexType == LLCDMeshData::INT_16) - { - for (S32 i = 0; i < res.mNumTriangles; ++i) - { - U16* idx = (U16*) (((U8*)res.mIndexBase)+i*res.mIndexStrideBytes); - - phys_volume->mHullIndices[i*3+0] = idx[0]; - phys_volume->mHullIndices[i*3+1] = idx[1]; - phys_volume->mHullIndices[i*3+2] = idx[2]; - } - } - else - { - for (S32 i = 0; i < res.mNumTriangles; ++i) - { - U32* idx = (U32*) (((U8*)res.mIndexBase)+i*res.mIndexStrideBytes); - - phys_volume->mHullIndices[i*3+0] = (U16) idx[0]; - phys_volume->mHullIndices[i*3+1] = (U16) idx[1]; - phys_volume->mHullIndices[i*3+2] = (U16) idx[2]; - } - } - } - } - - if (phys_volume->mHullPoints) - { - //render hull - - glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); - - glColor4fv(line_color.mV); - LLVertexBuffer::unbind(); - - llassert(!LLGLSLShader::sNoFixedFunction || LLGLSLShader::sCurBoundShader != 0); - - glVertexPointer(3, GL_FLOAT, 16, phys_volume->mHullPoints); - glDrawElements(GL_TRIANGLES, phys_volume->mNumHullIndices, GL_UNSIGNED_SHORT, phys_volume->mHullIndices); - - glColor4fv(color.mV); - glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); - glDrawElements(GL_TRIANGLES, phys_volume->mNumHullIndices, GL_UNSIGNED_SHORT, phys_volume->mHullIndices); - } - else - { - gGL.color3f(1,0,1); - drawBoxOutline(center, size); - } - - LLPrimitive::sVolumeManager->unrefVolume(phys_volume); - } -#endif //LL_WINDOWS - } - else if (type == LLPhysicsShapeBuilderUtil::PhysicsShapeSpecification::BOX) - { - LLVector3 center = physics_spec.getCenter(); - LLVector3 scale = physics_spec.getScale(); - LLVector3 vscale = volume->getScale()*2.f; - scale.set(scale[0]/vscale[0], scale[1]/vscale[1], scale[2]/vscale[2]); - - gGL.color4fv(color.mV); - drawBox(center, scale); - } - else if (type == LLPhysicsShapeBuilderUtil::PhysicsShapeSpecification::SPHERE) - { - LLVolumeParams volume_params; - volume_params.setType( LL_PCODE_PROFILE_CIRCLE_HALF, LL_PCODE_PATH_CIRCLE ); - volume_params.setBeginAndEndS( 0.f, 1.f ); - volume_params.setBeginAndEndT( 0.f, 1.f ); - volume_params.setRatio ( 1, 1 ); - volume_params.setShear ( 0, 0 ); - LLVolume* sphere = LLPrimitive::sVolumeManager->refVolume(volume_params, 3); - - glColor4fv(color.mV); - pushVerts(sphere); - LLPrimitive::sVolumeManager->unrefVolume(sphere); - } - else if (type == LLPhysicsShapeBuilderUtil::PhysicsShapeSpecification::CYLINDER) - { - LLVolumeParams volume_params; - volume_params.setType( LL_PCODE_PROFILE_CIRCLE, LL_PCODE_PATH_LINE ); - volume_params.setBeginAndEndS( 0.f, 1.f ); - volume_params.setBeginAndEndT( 0.f, 1.f ); - volume_params.setRatio ( 1, 1 ); - volume_params.setShear ( 0, 0 ); - LLVolume* cylinder = LLPrimitive::sVolumeManager->refVolume(volume_params, 3); - - glColor4fv(color.mV); - pushVerts(cylinder); - LLPrimitive::sVolumeManager->unrefVolume(cylinder); - } - else if (type == LLPhysicsShapeBuilderUtil::PhysicsShapeSpecification::PRIM_MESH) - { - LLVolumeParams volume_params = volume->getVolume()->getParams(); - S32 detail = get_physics_detail(volume_params, volume->getScale()); - - LLVolume* phys_volume = LLPrimitive::sVolumeManager->refVolume(volume_params, detail); - glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); - - glColor4fv(line_color.mV); - pushVerts(phys_volume); - - glColor4fv(color.mV); - glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); - pushVerts(phys_volume); - LLPrimitive::sVolumeManager->unrefVolume(phys_volume); - } - else if (type == LLPhysicsShapeBuilderUtil::PhysicsShapeSpecification::PRIM_CONVEX) - { - LLVolumeParams volume_params = volume->getVolume()->getParams(); - S32 detail = get_physics_detail(volume_params, volume->getScale()); - - LLVolume* phys_volume = LLPrimitive::sVolumeManager->refVolume(volume_params, detail); - - if (phys_volume->mHullPoints && phys_volume->mHullIndices) - { - glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); - llassert(!LLGLSLShader::sNoFixedFunction || LLGLSLShader::sCurBoundShader != 0); - LLVertexBuffer::unbind(); - glVertexPointer(3, GL_FLOAT, 16, phys_volume->mHullPoints); - glColor4fv(line_color.mV); - glDrawElements(GL_TRIANGLES, phys_volume->mNumHullIndices, GL_UNSIGNED_SHORT, phys_volume->mHullIndices); - - glColor4fv(color.mV); - glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); - glDrawElements(GL_TRIANGLES, phys_volume->mNumHullIndices, GL_UNSIGNED_SHORT, phys_volume->mHullIndices); - } - else - { - gGL.color3f(1,0,1); - drawBoxOutline(center, size); - gMeshRepo.buildHull(volume_params, detail); - } - LLPrimitive::sVolumeManager->unrefVolume(phys_volume); - } - else if (type == LLPhysicsShapeBuilderUtil::PhysicsShapeSpecification::SCULPT) - { - //TODO: implement sculpted prim physics display - } - else - { - llerrs << "Unhandled type" << llendl; - } - - gGL.popMatrix(); - - /*{ //analytical shape, just push visual rep. - glColor3fv(color.mV); - glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); - pushVerts(drawable, data_mask); - glColor4fv(color.mV); - glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); - pushVerts(drawable, data_mask); - }*/ -} - -void renderPhysicsShapes(LLSpatialGroup* group) -{ - for (LLSpatialGroup::OctreeNode::const_element_iter i = group->getData().begin(); i != group->getData().end(); ++i) - { - LLDrawable* drawable = *i; - LLVOVolume* volume = drawable->getVOVolume(); - if (volume && !volume->isAttachment() && volume->getPhysicsShapeType() != LLViewerObject::PHYSICS_SHAPE_NONE ) - { - if (!group->mSpatialPartition->isBridge()) - { - gGL.pushMatrix(); - LLVector3 trans = drawable->getRegion()->getOriginAgent(); - glTranslatef(trans.mV[0], trans.mV[1], trans.mV[2]); - renderPhysicsShape(drawable, volume); - gGL.popMatrix(); - } - else - { - renderPhysicsShape(drawable, volume); - } - } - else - { - LLViewerObject* object = drawable->getVObj(); - if (object && object->getPCode() == LLViewerObject::LL_VO_SURFACE_PATCH) - { - //push face vertices for terrain - for (S32 i = 0; i < drawable->getNumFaces(); ++i) - { - LLFace* face = drawable->getFace(i); - LLVertexBuffer* buff = face->getVertexBuffer(); - if (buff) - { - glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); - - buff->setBuffer(LLVertexBuffer::MAP_VERTEX); - glColor3f(0.2f, 0.5f, 0.3f); - buff->draw(LLRender::TRIANGLES, buff->getRequestedIndices(), 0); - - glColor3f(0.2f, 1.f, 0.3f); - glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); - buff->draw(LLRender::TRIANGLES, buff->getRequestedIndices(), 0); - } - } - } - } - } -} - -void renderTexturePriority(LLDrawable* drawable) -{ - for (int face=0; face<drawable->getNumFaces(); ++face) - { - LLFace *facep = drawable->getFace(face); - - LLVector4 cold(0,0,0.25f); - LLVector4 hot(1,0.25f,0.25f); - - LLVector4 boost_cold(0,0,0,0); - LLVector4 boost_hot(0,1,0,1); - - LLGLDisable blend(GL_BLEND); - - //LLViewerTexture* imagep = facep->getTexture(); - //if (imagep) - { - - //F32 vsize = imagep->mMaxVirtualSize; - F32 vsize = facep->getPixelArea(); - - if (vsize > sCurMaxTexPriority) - { - sCurMaxTexPriority = vsize; - } - - F32 t = vsize/sLastMaxTexPriority; - - LLVector4 col = lerp(cold, hot, t); - gGL.color4fv(col.mV); - } - //else - //{ - // gGL.color4f(1,0,1,1); - //} - - LLVector4a center; - center.setAdd(facep->mExtents[1],facep->mExtents[0]); - center.mul(0.5f); - LLVector4a size; - size.setSub(facep->mExtents[1],facep->mExtents[0]); - size.mul(0.5f); - size.add(LLVector4a(0.01f)); - drawBox(center, size); - - /*S32 boost = imagep->getBoostLevel(); - if (boost>LLViewerTexture::BOOST_NONE) - { - F32 t = (F32) boost / (F32) (LLViewerTexture::BOOST_MAX_LEVEL-1); - LLVector4 col = lerp(boost_cold, boost_hot, t); - LLGLEnable blend_on(GL_BLEND); - gGL.blendFunc(GL_SRC_ALPHA, GL_ONE); - gGL.color4fv(col.mV); - drawBox(center, size); - gGL.blendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - }*/ - } -} - -void renderPoints(LLDrawable* drawablep) -{ - LLGLDepthTest depth(GL_FALSE, GL_FALSE); - if (drawablep->getNumFaces()) - { - gGL.begin(LLRender::POINTS); - gGL.color3f(1,1,1); - for (S32 i = 0; i < drawablep->getNumFaces(); i++) - { - gGL.vertex3fv(drawablep->getFace(i)->mCenterLocal.mV); - } - gGL.end(); - } -} - -void renderTextureAnim(LLDrawInfo* params) -{ - if (!params->mTextureMatrix) - { - return; - } - - LLGLEnable blend(GL_BLEND); - glColor4f(1,1,0,0.5f); - pushVerts(params, LLVertexBuffer::MAP_VERTEX); -} - -void renderBatchSize(LLDrawInfo* params) -{ - LLGLEnable offset(GL_POLYGON_OFFSET_FILL); - glPolygonOffset(-1.f, 1.f); - glColor3ubv((GLubyte*) &(params->mDebugColor)); - pushVerts(params, LLVertexBuffer::MAP_VERTEX); -} - -void renderShadowFrusta(LLDrawInfo* params) -{ - LLGLEnable blend(GL_BLEND); - gGL.setSceneBlendType(LLRender::BT_ADD); - - LLVector4a center; - center.setAdd(params->mExtents[1], params->mExtents[0]); - center.mul(0.5f); - LLVector4a size; - size.setSub(params->mExtents[1],params->mExtents[0]); - size.mul(0.5f); - - if (gPipeline.mShadowCamera[4].AABBInFrustum(center, size)) - { - glColor3f(1,0,0); - pushVerts(params, LLVertexBuffer::MAP_VERTEX); - } - if (gPipeline.mShadowCamera[5].AABBInFrustum(center, size)) - { - glColor3f(0,1,0); - pushVerts(params, LLVertexBuffer::MAP_VERTEX); - } - if (gPipeline.mShadowCamera[6].AABBInFrustum(center, size)) - { - glColor3f(0,0,1); - pushVerts(params, LLVertexBuffer::MAP_VERTEX); - } - if (gPipeline.mShadowCamera[7].AABBInFrustum(center, size)) - { - glColor3f(1,0,1); - pushVerts(params, LLVertexBuffer::MAP_VERTEX); - } - - gGL.setSceneBlendType(LLRender::BT_ALPHA); -} - - -void renderLights(LLDrawable* drawablep) -{ - if (!drawablep->isLight()) - { - return; - } - - if (drawablep->getNumFaces()) - { - LLGLEnable blend(GL_BLEND); - glColor4f(0,1,1,0.5f); - - for (S32 i = 0; i < drawablep->getNumFaces(); i++) - { - pushVerts(drawablep->getFace(i), LLVertexBuffer::MAP_VERTEX); - } - - const LLVector4a* ext = drawablep->getSpatialExtents(); - - LLVector4a pos; - pos.setAdd(ext[0], ext[1]); - pos.mul(0.5f); - LLVector4a size; - size.setSub(ext[1], ext[0]); - size.mul(0.5f); - - { - LLGLDepthTest depth(GL_FALSE, GL_TRUE); - gGL.color4f(1,1,1,1); - drawBoxOutline(pos, size); - } - - gGL.color4f(1,1,0,1); - F32 rad = drawablep->getVOVolume()->getLightRadius(); - drawBoxOutline(pos, LLVector4a(rad)); - } -} - -class LLRenderOctreeRaycast : public LLOctreeTriangleRayIntersect -{ -public: - - - LLRenderOctreeRaycast(const LLVector4a& start, const LLVector4a& dir, F32* closest_t) - : LLOctreeTriangleRayIntersect(start, dir, NULL, closest_t, NULL, NULL, NULL, NULL) - { - - } - - void visit(const LLOctreeNode<LLVolumeTriangle>* branch) - { - LLVolumeOctreeListener* vl = (LLVolumeOctreeListener*) branch->getListener(0); - - LLVector3 center, size; - - if (branch->getData().empty()) - { - gGL.color3f(1.f,0.2f,0.f); - center.set(branch->getCenter().getF32ptr()); - size.set(branch->getSize().getF32ptr()); - } - else - { - gGL.color3f(0.75f, 1.f, 0.f); - center.set(vl->mBounds[0].getF32ptr()); - size.set(vl->mBounds[1].getF32ptr()); - } - - drawBoxOutline(center, size); - - for (U32 i = 0; i < 2; i++) - { - LLGLDepthTest depth(GL_TRUE, GL_FALSE, i == 1 ? GL_LEQUAL : GL_GREATER); - - if (i == 1) - { - gGL.color4f(0,1,1,0.5f); - } - else - { - gGL.color4f(0,0.5f,0.5f, 0.25f); - drawBoxOutline(center, size); - } - - if (i == 1) - { - gGL.flush(); - glLineWidth(3.f); - } - - gGL.begin(LLRender::TRIANGLES); - for (LLOctreeNode<LLVolumeTriangle>::const_element_iter iter = branch->getData().begin(); - iter != branch->getData().end(); - ++iter) - { - const LLVolumeTriangle* tri = *iter; - - gGL.vertex3fv(tri->mV[0]->getF32ptr()); - gGL.vertex3fv(tri->mV[1]->getF32ptr()); - gGL.vertex3fv(tri->mV[2]->getF32ptr()); - } - gGL.end(); - - if (i == 1) - { - gGL.flush(); - glLineWidth(1.f); - } - } - } -}; - -void renderRaycast(LLDrawable* drawablep) -{ - if (drawablep->getNumFaces()) - { - LLGLEnable blend(GL_BLEND); - gGL.color4f(0,1,1,0.5f); - - if (drawablep->getVOVolume()) - { - //glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); - //pushVerts(drawablep->getFace(gDebugRaycastFaceHit), LLVertexBuffer::MAP_VERTEX); - //glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); - - LLVOVolume* vobj = drawablep->getVOVolume(); - LLVolume* volume = vobj->getVolume(); - - bool transform = true; - if (drawablep->isState(LLDrawable::RIGGED)) - { - volume = vobj->getRiggedVolume(); - transform = false; - } - - if (volume) - { - LLVector3 trans = drawablep->getRegion()->getOriginAgent(); - - for (S32 i = 0; i < volume->getNumVolumeFaces(); ++i) - { - const LLVolumeFace& face = volume->getVolumeFace(i); - if (!face.mOctree) - { - ((LLVolumeFace*) &face)->createOctree(); - } - - gGL.pushMatrix(); - glTranslatef(trans.mV[0], trans.mV[1], trans.mV[2]); - glMultMatrixf((F32*) vobj->getRelativeXform().mMatrix); - - LLVector3 start, end; - if (transform) - { - start = vobj->agentPositionToVolume(gDebugRaycastStart); - end = vobj->agentPositionToVolume(gDebugRaycastEnd); - } - else - { - start = gDebugRaycastStart; - end = gDebugRaycastEnd; - } - - LLVector4a starta, enda; - starta.load3(start.mV); - enda.load3(end.mV); - LLVector4a dir; - dir.setSub(enda, starta); - - F32 t = 1.f; - - LLRenderOctreeRaycast render(starta, dir, &t); - gGL.flush(); - glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); - - { - //render face positions - LLVertexBuffer::unbind(); - glColor4f(0,1,1,0.5f); - glVertexPointer(3, GL_FLOAT, sizeof(LLVector4a), face.mPositions); - glDrawElements(GL_TRIANGLES, face.mNumIndices, GL_UNSIGNED_SHORT, face.mIndices); - } - - render.traverse(face.mOctree); - gGL.popMatrix(); - glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); - } - } - } - else if (drawablep->isAvatar()) - { - if (drawablep->getVObj() == gDebugRaycastObject) - { - LLGLDepthTest depth(GL_FALSE); - LLVOAvatar* av = (LLVOAvatar*) drawablep->getVObj().get(); - av->renderCollisionVolumes(); - } - } - - if (drawablep->getVObj() == gDebugRaycastObject) - { - // draw intersection point - glPushMatrix(); - glLoadMatrixd(gGLModelView); - LLVector3 translate = gDebugRaycastIntersection; - glTranslatef(translate.mV[0], translate.mV[1], translate.mV[2]); - LLCoordFrame orient; - orient.lookDir(gDebugRaycastNormal, gDebugRaycastBinormal); - LLMatrix4 rotation; - orient.getRotMatrixToParent(rotation); - glMultMatrixf((float*)rotation.mMatrix); - - gGL.color4f(1,0,0,0.5f); - drawBox(LLVector3(0, 0, 0), LLVector3(0.1f, 0.022f, 0.022f)); - gGL.color4f(0,1,0,0.5f); - drawBox(LLVector3(0, 0, 0), LLVector3(0.021f, 0.1f, 0.021f)); - gGL.color4f(0,0,1,0.5f); - drawBox(LLVector3(0, 0, 0), LLVector3(0.02f, 0.02f, 0.1f)); - glPopMatrix(); - - // draw bounding box of prim - const LLVector4a* ext = drawablep->getSpatialExtents(); - - LLVector4a pos; - pos.setAdd(ext[0], ext[1]); - pos.mul(0.5f); - LLVector4a size; - size.setSub(ext[1], ext[0]); - size.mul(0.5f); - - LLGLDepthTest depth(GL_FALSE, GL_TRUE); - gGL.color4f(0,0.5f,0.5f,1); - drawBoxOutline(pos, size); - } - } -} - - -void renderAvatarCollisionVolumes(LLVOAvatar* avatar) -{ - avatar->renderCollisionVolumes(); -} - -void renderAgentTarget(LLVOAvatar* avatar) -{ - // render these for self only (why, i don't know) - if (avatar->isSelf()) - { - renderCrossHairs(avatar->getPositionAgent(), 0.2f, LLColor4(1, 0, 0, 0.8f)); - renderCrossHairs(avatar->mDrawable->getPositionAgent(), 0.2f, LLColor4(1, 0, 0, 0.8f)); - renderCrossHairs(avatar->mRoot.getWorldPosition(), 0.2f, LLColor4(1, 1, 1, 0.8f)); - renderCrossHairs(avatar->mPelvisp->getWorldPosition(), 0.2f, LLColor4(0, 0, 1, 0.8f)); - } -} - -class LLOctreeRenderNonOccluded : public LLOctreeTraveler<LLDrawable> -{ -public: - LLCamera* mCamera; - LLOctreeRenderNonOccluded(LLCamera* camera): mCamera(camera) {} - - virtual void traverse(const LLSpatialGroup::OctreeNode* node) - { - LLSpatialGroup* group = (LLSpatialGroup*) node->getListener(0); - - if (!mCamera || mCamera->AABBInFrustumNoFarClip(group->mBounds[0], group->mBounds[1])) - { - node->accept(this); - stop_glerror(); - - for (U32 i = 0; i < node->getChildCount(); i++) - { - traverse(node->getChild(i)); - stop_glerror(); - } - - //draw tight fit bounding boxes for spatial group - if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_OCTREE)) - { - group->rebuildGeom(); - group->rebuildMesh(); - - renderOctree(group); - stop_glerror(); - } - - //render visibility wireframe - if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_OCCLUSION)) - { - group->rebuildGeom(); - group->rebuildMesh(); - - gGL.flush(); - glPushMatrix(); - gGLLastMatrix = NULL; - glLoadMatrixd(gGLModelView); - renderVisibility(group, mCamera); - stop_glerror(); - gGLLastMatrix = NULL; - glPopMatrix(); - gGL.color4f(1,1,1,1); - } - } - } - - virtual void visit(const LLSpatialGroup::OctreeNode* branch) - { - LLSpatialGroup* group = (LLSpatialGroup*) branch->getListener(0); - - if (group->isState(LLSpatialGroup::GEOM_DIRTY) || (mCamera && !mCamera->AABBInFrustumNoFarClip(group->mBounds[0], group->mBounds[1]))) - { - return; - } - - LLVector4a nodeCenter = group->mBounds[0]; - LLVector4a octCenter = group->mOctreeNode->getCenter(); - - group->rebuildGeom(); - group->rebuildMesh(); - - if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_BBOXES)) - { - if (!group->getData().empty()) - { - gGL.color3f(0,0,1); - drawBoxOutline(group->mObjectBounds[0], - group->mObjectBounds[1]); - } - } - - for (LLSpatialGroup::OctreeNode::const_element_iter i = branch->getData().begin(); i != branch->getData().end(); ++i) - { - LLDrawable* drawable = *i; - - if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_BBOXES)) - { - renderBoundingBox(drawable); - } - - if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_NORMALS)) - { - renderNormals(drawable); - } - - if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_BUILD_QUEUE)) - { - if (drawable->isState(LLDrawable::IN_REBUILD_Q2)) - { - gGL.color4f(0.6f, 0.6f, 0.1f, 1.f); - const LLVector4a* ext = drawable->getSpatialExtents(); - LLVector4a center; - center.setAdd(ext[0], ext[1]); - center.mul(0.5f); - LLVector4a size; - size.setSub(ext[1], ext[0]); - size.mul(0.5f); - drawBoxOutline(center, size); - } - } - - if (drawable->getVOVolume() && gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_TEXTURE_PRIORITY)) - { - renderTexturePriority(drawable); - } - - if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_POINTS)) - { - renderPoints(drawable); - } - - if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_LIGHTS)) - { - renderLights(drawable); - } - - if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_RAYCAST)) - { - renderRaycast(drawable); - } - if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_UPDATE_TYPE)) - { - renderUpdateType(drawable); - } - if(gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_RENDER_COMPLEXITY)) - { - renderComplexityDisplay(drawable); - } - - LLVOAvatar* avatar = dynamic_cast<LLVOAvatar*>(drawable->getVObj().get()); - - if (avatar && gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_AVATAR_VOLUME)) - { - renderAvatarCollisionVolumes(avatar); - } - - if (avatar && gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_AGENT_TARGET)) - { - renderAgentTarget(avatar); - } - - - if (gDebugGL) - { - for (U32 i = 0; i < drawable->getNumFaces(); ++i) - { - LLFace* facep = drawable->getFace(i); - U8 index = facep->getTextureIndex(); - if (facep->mDrawInfo) - { - if (index < 255) - { - if (facep->mDrawInfo->mTextureList.size() <= index) - { - llerrs << "Face texture index out of bounds." << llendl; - } - else if (facep->mDrawInfo->mTextureList[index] != facep->getTexture()) - { - llerrs << "Face texture index incorrect." << llendl; - } - } - } - } - } - } - - for (LLSpatialGroup::draw_map_t::iterator i = group->mDrawMap.begin(); i != group->mDrawMap.end(); ++i) - { - LLSpatialGroup::drawmap_elem_t& draw_vec = i->second; - for (LLSpatialGroup::drawmap_elem_t::iterator j = draw_vec.begin(); j != draw_vec.end(); ++j) - { - LLDrawInfo* draw_info = *j; - if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_TEXTURE_ANIM)) - { - renderTextureAnim(draw_info); - } - if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_BATCH_SIZE)) - { - renderBatchSize(draw_info); - } - if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_SHADOW_FRUSTA)) - { - renderShadowFrusta(draw_info); - } - } - } - } -}; - - -class LLOctreeRenderPhysicsShapes : public LLOctreeTraveler<LLDrawable> -{ -public: - LLCamera* mCamera; - LLOctreeRenderPhysicsShapes(LLCamera* camera): mCamera(camera) {} - - virtual void traverse(const LLSpatialGroup::OctreeNode* node) - { - LLSpatialGroup* group = (LLSpatialGroup*) node->getListener(0); - - if (!mCamera || mCamera->AABBInFrustumNoFarClip(group->mBounds[0], group->mBounds[1])) - { - node->accept(this); - stop_glerror(); - - for (U32 i = 0; i < node->getChildCount(); i++) - { - traverse(node->getChild(i)); - stop_glerror(); - } - - group->rebuildGeom(); - group->rebuildMesh(); - - renderPhysicsShapes(group); - } - } - - virtual void visit(const LLSpatialGroup::OctreeNode* branch) - { - - } -}; - -class LLOctreePushBBoxVerts : public LLOctreeTraveler<LLDrawable> -{ -public: - LLCamera* mCamera; - LLOctreePushBBoxVerts(LLCamera* camera): mCamera(camera) {} - - virtual void traverse(const LLSpatialGroup::OctreeNode* node) - { - LLSpatialGroup* group = (LLSpatialGroup*) node->getListener(0); - - if (!mCamera || mCamera->AABBInFrustum(group->mBounds[0], group->mBounds[1])) - { - node->accept(this); - - for (U32 i = 0; i < node->getChildCount(); i++) - { - traverse(node->getChild(i)); - } - } - } - - virtual void visit(const LLSpatialGroup::OctreeNode* branch) - { - LLSpatialGroup* group = (LLSpatialGroup*) branch->getListener(0); - - if (group->isState(LLSpatialGroup::GEOM_DIRTY) || (mCamera && !mCamera->AABBInFrustumNoFarClip(group->mBounds[0], group->mBounds[1]))) - { - return; - } - - for (LLSpatialGroup::OctreeNode::const_element_iter i = branch->getData().begin(); i != branch->getData().end(); ++i) - { - LLDrawable* drawable = *i; - - renderBoundingBox(drawable, FALSE); - } - } -}; - -void LLSpatialPartition::renderIntersectingBBoxes(LLCamera* camera) -{ - LLOctreePushBBoxVerts pusher(camera); - pusher.traverse(mOctree); -} - -class LLOctreeStateCheck : public LLOctreeTraveler<LLDrawable> -{ -public: - U32 mInheritedMask[LLViewerCamera::NUM_CAMERAS]; - - LLOctreeStateCheck() - { - for (U32 i = 0; i < LLViewerCamera::NUM_CAMERAS; i++) - { - mInheritedMask[i] = 0; - } - } - - virtual void traverse(const LLSpatialGroup::OctreeNode* node) - { - LLSpatialGroup* group = (LLSpatialGroup*) node->getListener(0); - - node->accept(this); - - - U32 temp[LLViewerCamera::NUM_CAMERAS]; - - for (U32 i = 0; i < LLViewerCamera::NUM_CAMERAS; i++) - { - temp[i] = mInheritedMask[i]; - mInheritedMask[i] |= group->mOcclusionState[i] & LLSpatialGroup::OCCLUDED; - } - - for (U32 i = 0; i < node->getChildCount(); i++) - { - traverse(node->getChild(i)); - } - - for (U32 i = 0; i < LLViewerCamera::NUM_CAMERAS; i++) - { - mInheritedMask[i] = temp[i]; - } - } - - - virtual void visit(const LLOctreeNode<LLDrawable>* state) - { - LLSpatialGroup* group = (LLSpatialGroup*) state->getListener(0); - - for (U32 i = 0; i < LLViewerCamera::NUM_CAMERAS; i++) - { - if (mInheritedMask[i] && !(group->mOcclusionState[i] & mInheritedMask[i])) - { - llerrs << "Spatial group failed inherited mask test." << llendl; - } - } - - if (group->isState(LLSpatialGroup::DIRTY)) - { - assert_parent_state(group, LLSpatialGroup::DIRTY); - } - } - - void assert_parent_state(LLSpatialGroup* group, U32 state) - { - LLSpatialGroup* parent = group->getParent(); - while (parent) - { - if (!parent->isState(state)) - { - llerrs << "Spatial group failed parent state check." << llendl; - } - parent = parent->getParent(); - } - } -}; - - -void LLSpatialPartition::renderPhysicsShapes() -{ - LLSpatialBridge* bridge = asBridge(); - LLCamera* camera = LLViewerCamera::getInstance(); - - if (bridge) - { - camera = NULL; - } - - gGL.flush(); - gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); - glLineWidth(3.f); - LLOctreeRenderPhysicsShapes render_physics(camera); - render_physics.traverse(mOctree); - gGL.flush(); - glLineWidth(1.f); -} - -void LLSpatialPartition::renderDebug() -{ - if (!gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_OCTREE | - LLPipeline::RENDER_DEBUG_OCCLUSION | - LLPipeline::RENDER_DEBUG_LIGHTS | - LLPipeline::RENDER_DEBUG_BATCH_SIZE | - LLPipeline::RENDER_DEBUG_UPDATE_TYPE | - LLPipeline::RENDER_DEBUG_BBOXES | - LLPipeline::RENDER_DEBUG_NORMALS | - LLPipeline::RENDER_DEBUG_POINTS | - LLPipeline::RENDER_DEBUG_TEXTURE_PRIORITY | - LLPipeline::RENDER_DEBUG_TEXTURE_ANIM | - LLPipeline::RENDER_DEBUG_RAYCAST | - LLPipeline::RENDER_DEBUG_AVATAR_VOLUME | - LLPipeline::RENDER_DEBUG_AGENT_TARGET | - //LLPipeline::RENDER_DEBUG_BUILD_QUEUE | - LLPipeline::RENDER_DEBUG_SHADOW_FRUSTA | - LLPipeline::RENDER_DEBUG_RENDER_COMPLEXITY)) - { - return; - } - - if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_TEXTURE_PRIORITY)) - { - //sLastMaxTexPriority = lerp(sLastMaxTexPriority, sCurMaxTexPriority, gFrameIntervalSeconds); - sLastMaxTexPriority = (F32) LLViewerCamera::getInstance()->getScreenPixelArea(); - sCurMaxTexPriority = 0.f; - } - - LLMemType mt(LLMemType::MTYPE_SPACE_PARTITION); - - LLGLDisable cullface(GL_CULL_FACE); - LLGLEnable blend(GL_BLEND); - gGL.setSceneBlendType(LLRender::BT_ALPHA); - gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); - gPipeline.disableLights(); - - LLSpatialBridge* bridge = asBridge(); - LLCamera* camera = LLViewerCamera::getInstance(); - - if (bridge) - { - camera = NULL; - } - - LLOctreeStateCheck checker; - checker.traverse(mOctree); - - LLOctreeRenderNonOccluded render_debug(camera); - render_debug.traverse(mOctree); -} - -void LLSpatialGroup::drawObjectBox(LLColor4 col) -{ - gGL.color4fv(col.mV); - LLVector4a size; - size = mObjectBounds[1]; - size.mul(1.01f); - size.add(LLVector4a(0.001f)); - drawBox(mObjectBounds[0], size); -} - -bool LLSpatialPartition::isHUDPartition() -{ - return mPartitionType == LLViewerRegion::PARTITION_HUD ; -} - -BOOL LLSpatialPartition::isVisible(const LLVector3& v) -{ - if (!LLViewerCamera::getInstance()->sphereInFrustum(v, 4.0f)) - { - return FALSE; - } - - return TRUE; -} - -class LLOctreeIntersect : public LLSpatialGroup::OctreeTraveler -{ -public: - LLVector3 mStart; - LLVector3 mEnd; - S32 *mFaceHit; - LLVector3 *mIntersection; - LLVector2 *mTexCoord; - LLVector3 *mNormal; - LLVector3 *mBinormal; - LLDrawable* mHit; - BOOL mPickTransparent; - - LLOctreeIntersect(LLVector3 start, LLVector3 end, BOOL pick_transparent, - S32* face_hit, LLVector3* intersection, LLVector2* tex_coord, LLVector3* normal, LLVector3* binormal) - : mStart(start), - mEnd(end), - mFaceHit(face_hit), - mIntersection(intersection), - mTexCoord(tex_coord), - mNormal(normal), - mBinormal(binormal), - mHit(NULL), - mPickTransparent(pick_transparent) - { - } - - virtual void visit(const LLSpatialGroup::OctreeNode* branch) - { - for (LLSpatialGroup::OctreeNode::const_element_iter i = branch->getData().begin(); i != branch->getData().end(); ++i) - { - check(*i); - } - } - - virtual LLDrawable* check(const LLSpatialGroup::OctreeNode* node) - { - node->accept(this); - - for (U32 i = 0; i < node->getChildCount(); i++) - { - const LLSpatialGroup::OctreeNode* child = node->getChild(i); - LLVector3 res; - - LLSpatialGroup* group = (LLSpatialGroup*) child->getListener(0); - - LLVector4a size; - LLVector4a center; - - size = group->mBounds[1]; - center = group->mBounds[0]; - - LLVector3 local_start = mStart; - LLVector3 local_end = mEnd; - - if (group->mSpatialPartition->isBridge()) - { - LLMatrix4 local_matrix = group->mSpatialPartition->asBridge()->mDrawable->getRenderMatrix(); - local_matrix.invert(); - - local_start = mStart * local_matrix; - local_end = mEnd * local_matrix; - } - - LLVector4a start, end; - start.load3(local_start.mV); - end.load3(local_end.mV); - - if (LLLineSegmentBoxIntersect(start, end, center, size)) - { - check(child); - } - } - - return mHit; - } - - virtual bool check(LLDrawable* drawable) - { - LLVector3 local_start = mStart; - LLVector3 local_end = mEnd; - - if (!gPipeline.hasRenderType(drawable->getRenderType()) || !drawable->isVisible()) - { - return false; - } - - if (drawable->isSpatialBridge()) - { - LLSpatialPartition *part = drawable->asPartition(); - LLSpatialBridge* bridge = part->asBridge(); - if (bridge && gPipeline.hasRenderType(bridge->mDrawableType)) - { - check(part->mOctree); - } - } - else - { - LLViewerObject* vobj = drawable->getVObj(); - - if (vobj) - { - LLVector3 intersection; - bool skip_check = false; - if (vobj->isAvatar()) - { - LLVOAvatar* avatar = (LLVOAvatar*) vobj; - if (avatar->isSelf() && LLFloater::isVisible(gFloaterTools)) - { - LLViewerObject* hit = avatar->lineSegmentIntersectRiggedAttachments(mStart, mEnd, -1, mPickTransparent, mFaceHit, &intersection, mTexCoord, mNormal, mBinormal); - if (hit) - { - mEnd = intersection; - if (mIntersection) - { - *mIntersection = intersection; - } - - mHit = hit->mDrawable; - skip_check = true; - } - - } - } - - if (!skip_check && vobj->lineSegmentIntersect(mStart, mEnd, -1, mPickTransparent, mFaceHit, &intersection, mTexCoord, mNormal, mBinormal)) - { - mEnd = intersection; // shorten ray so we only find CLOSER hits - if (mIntersection) - { - *mIntersection = intersection; - } - - mHit = vobj->mDrawable; - } - } - } - - return false; - } -}; - -LLDrawable* LLSpatialPartition::lineSegmentIntersect(const LLVector3& start, const LLVector3& end, - BOOL pick_transparent, - S32* face_hit, // return the face hit - LLVector3* intersection, // return the intersection point - LLVector2* tex_coord, // return the texture coordinates of the intersection point - LLVector3* normal, // return the surface normal at the intersection point - LLVector3* bi_normal // return the surface bi-normal at the intersection point - ) - -{ - LLOctreeIntersect intersect(start, end, pick_transparent, face_hit, intersection, tex_coord, normal, bi_normal); - LLDrawable* drawable = intersect.check(mOctree); - - return drawable; -} - -LLDrawInfo::LLDrawInfo(U16 start, U16 end, U32 count, U32 offset, - LLViewerTexture* texture, LLVertexBuffer* buffer, - BOOL fullbright, U8 bump, BOOL particle, F32 part_size) -: - mVertexBuffer(buffer), - mTexture(texture), - mTextureMatrix(NULL), - mModelMatrix(NULL), - mStart(start), - mEnd(end), - mCount(count), - mOffset(offset), - mFullbright(fullbright), - mBump(bump), - mParticle(particle), - mPartSize(part_size), - mVSize(0.f), - mGroup(NULL), - mFace(NULL), - mDistance(0.f), - mDrawMode(LLRender::TRIANGLES) -{ - mVertexBuffer->validateRange(mStart, mEnd, mCount, mOffset); - - mDebugColor = (rand() << 16) + rand(); -} - -LLDrawInfo::~LLDrawInfo() -{ - /*if (LLSpatialGroup::sNoDelete) - { - llerrs << "LLDrawInfo deleted illegally!" << llendl; - }*/ - - if (mFace) - { - mFace->setDrawInfo(NULL); - } - - if (gDebugGL) - { - gPipeline.checkReferences(this); - } -} - -void LLDrawInfo::validate() -{ - mVertexBuffer->validateRange(mStart, mEnd, mCount, mOffset); -} - -LLVertexBuffer* LLGeometryManager::createVertexBuffer(U32 type_mask, U32 usage) -{ - return new LLVertexBuffer(type_mask, usage); -} - -LLCullResult::LLCullResult() -{ - clear(); -} - -void LLCullResult::clear() -{ - mVisibleGroupsSize = 0; - mVisibleGroupsEnd = mVisibleGroups.begin(); - - mAlphaGroupsSize = 0; - mAlphaGroupsEnd = mAlphaGroups.begin(); - - mOcclusionGroupsSize = 0; - mOcclusionGroupsEnd = mOcclusionGroups.begin(); - - mDrawableGroupsSize = 0; - mDrawableGroupsEnd = mDrawableGroups.begin(); - - mVisibleListSize = 0; - mVisibleListEnd = mVisibleList.begin(); - - mVisibleBridgeSize = 0; - mVisibleBridgeEnd = mVisibleBridge.begin(); - - - for (U32 i = 0; i < LLRenderPass::NUM_RENDER_TYPES; i++) - { - for (U32 j = 0; j < mRenderMapSize[i]; j++) - { - mRenderMap[i][j] = 0; - } - mRenderMapSize[i] = 0; - mRenderMapEnd[i] = mRenderMap[i].begin(); - } -} - -LLCullResult::sg_list_t::iterator LLCullResult::beginVisibleGroups() -{ - return mVisibleGroups.begin(); -} - -LLCullResult::sg_list_t::iterator LLCullResult::endVisibleGroups() -{ - return mVisibleGroupsEnd; -} - -LLCullResult::sg_list_t::iterator LLCullResult::beginAlphaGroups() -{ - return mAlphaGroups.begin(); -} - -LLCullResult::sg_list_t::iterator LLCullResult::endAlphaGroups() -{ - return mAlphaGroupsEnd; -} - -LLCullResult::sg_list_t::iterator LLCullResult::beginOcclusionGroups() -{ - return mOcclusionGroups.begin(); -} - -LLCullResult::sg_list_t::iterator LLCullResult::endOcclusionGroups() -{ - return mOcclusionGroupsEnd; -} - -LLCullResult::sg_list_t::iterator LLCullResult::beginDrawableGroups() -{ - return mDrawableGroups.begin(); -} - -LLCullResult::sg_list_t::iterator LLCullResult::endDrawableGroups() -{ - return mDrawableGroupsEnd; -} - -LLCullResult::drawable_list_t::iterator LLCullResult::beginVisibleList() -{ - return mVisibleList.begin(); -} - -LLCullResult::drawable_list_t::iterator LLCullResult::endVisibleList() -{ - return mVisibleListEnd; -} - -LLCullResult::bridge_list_t::iterator LLCullResult::beginVisibleBridge() -{ - return mVisibleBridge.begin(); -} - -LLCullResult::bridge_list_t::iterator LLCullResult::endVisibleBridge() -{ - return mVisibleBridgeEnd; -} - -LLCullResult::drawinfo_list_t::iterator LLCullResult::beginRenderMap(U32 type) -{ - return mRenderMap[type].begin(); -} - -LLCullResult::drawinfo_list_t::iterator LLCullResult::endRenderMap(U32 type) -{ - return mRenderMapEnd[type]; -} - -void LLCullResult::pushVisibleGroup(LLSpatialGroup* group) -{ - if (mVisibleGroupsSize < mVisibleGroups.size()) - { - mVisibleGroups[mVisibleGroupsSize] = group; - } - else - { - mVisibleGroups.push_back(group); - } - ++mVisibleGroupsSize; - mVisibleGroupsEnd = mVisibleGroups.begin()+mVisibleGroupsSize; -} - -void LLCullResult::pushAlphaGroup(LLSpatialGroup* group) -{ - if (mAlphaGroupsSize < mAlphaGroups.size()) - { - mAlphaGroups[mAlphaGroupsSize] = group; - } - else - { - mAlphaGroups.push_back(group); - } - ++mAlphaGroupsSize; - mAlphaGroupsEnd = mAlphaGroups.begin()+mAlphaGroupsSize; -} - -void LLCullResult::pushOcclusionGroup(LLSpatialGroup* group) -{ - if (mOcclusionGroupsSize < mOcclusionGroups.size()) - { - mOcclusionGroups[mOcclusionGroupsSize] = group; - } - else - { - mOcclusionGroups.push_back(group); - } - ++mOcclusionGroupsSize; - mOcclusionGroupsEnd = mOcclusionGroups.begin()+mOcclusionGroupsSize; -} - -void LLCullResult::pushDrawableGroup(LLSpatialGroup* group) -{ - if (mDrawableGroupsSize < mDrawableGroups.size()) - { - mDrawableGroups[mDrawableGroupsSize] = group; - } - else - { - mDrawableGroups.push_back(group); - } - ++mDrawableGroupsSize; - mDrawableGroupsEnd = mDrawableGroups.begin()+mDrawableGroupsSize; -} - -void LLCullResult::pushDrawable(LLDrawable* drawable) -{ - if (mVisibleListSize < mVisibleList.size()) - { - mVisibleList[mVisibleListSize] = drawable; - } - else - { - mVisibleList.push_back(drawable); - } - ++mVisibleListSize; - mVisibleListEnd = mVisibleList.begin()+mVisibleListSize; -} - -void LLCullResult::pushBridge(LLSpatialBridge* bridge) -{ - if (mVisibleBridgeSize < mVisibleBridge.size()) - { - mVisibleBridge[mVisibleBridgeSize] = bridge; - } - else - { - mVisibleBridge.push_back(bridge); - } - ++mVisibleBridgeSize; - mVisibleBridgeEnd = mVisibleBridge.begin()+mVisibleBridgeSize; -} - -void LLCullResult::pushDrawInfo(U32 type, LLDrawInfo* draw_info) -{ - if (mRenderMapSize[type] < mRenderMap[type].size()) - { - mRenderMap[type][mRenderMapSize[type]] = draw_info; - } - else - { - mRenderMap[type].push_back(draw_info); - } - ++mRenderMapSize[type]; - mRenderMapEnd[type] = mRenderMap[type].begin() + mRenderMapSize[type]; -} - - -void LLCullResult::assertDrawMapsEmpty() -{ - for (U32 i = 0; i < LLRenderPass::NUM_RENDER_TYPES; i++) - { - if (mRenderMapSize[i] != 0) - { - llerrs << "Stale LLDrawInfo's in LLCullResult!" << llendl; - } - } -} - - - +/**
+ * @file llspatialpartition.cpp
+ * @brief LLSpatialGroup class implementation and supporting functions
+ *
+ * $LicenseInfo:firstyear=2003&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2010, Linden Research, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
+ * $/LicenseInfo$
+ */
+
+#include "llviewerprecompiledheaders.h"
+
+#include "llspatialpartition.h"
+
+#include "llviewerwindow.h"
+#include "llviewerobjectlist.h"
+#include "llvovolume.h"
+#include "llvolume.h"
+#include "llvolumeoctree.h"
+#include "llviewercamera.h"
+#include "llface.h"
+#include "llfloatertools.h"
+#include "llviewercontrol.h"
+#include "llviewerregion.h"
+#include "llcamera.h"
+#include "pipeline.h"
+#include "llmeshrepository.h"
+#include "llrender.h"
+#include "lloctree.h"
+#include "llphysicsshapebuilderutil.h"
+#include "llvoavatar.h"
+#include "llvolumemgr.h"
+#include "lltextureatlas.h"
+#include "llglslshader.h"
+#include "llagent.h"
+#include "llviewershadermgr.h"
+
+static LLFastTimer::DeclareTimer FTM_FRUSTUM_CULL("Frustum Culling");
+static LLFastTimer::DeclareTimer FTM_CULL_REBOUND("Cull Rebound");
+
+const F32 SG_OCCLUSION_FUDGE = 0.25f;
+#define SG_DISCARD_TOLERANCE 0.01f
+
+#if LL_OCTREE_PARANOIA_CHECK
+#define assert_octree_valid(x) x->validate()
+#define assert_states_valid(x) ((LLSpatialGroup*) x->mSpatialPartition->mOctree->getListener(0))->checkStates()
+#else
+#define assert_octree_valid(x)
+#define assert_states_valid(x)
+#endif
+
+
+static U32 sZombieGroups = 0;
+U32 LLSpatialGroup::sNodeCount = 0;
+
+#define LL_TRACK_PENDING_OCCLUSION_QUERIES 0
+
+std::set<GLuint> LLSpatialGroup::sPendingQueries;
+
+U32 gOctreeMaxCapacity;
+
+BOOL LLSpatialGroup::sNoDelete = FALSE;
+
+static F32 sLastMaxTexPriority = 1.f;
+static F32 sCurMaxTexPriority = 1.f;
+
+class LLOcclusionQueryPool : public LLGLNamePool
+{
+protected:
+ virtual GLuint allocateName()
+ {
+ GLuint name;
+ glGenQueriesARB(1, &name);
+ return name;
+ }
+
+ virtual void releaseName(GLuint name)
+ {
+#if LL_TRACK_PENDING_OCCLUSION_QUERIES
+ LLSpatialGroup::sPendingQueries.erase(name);
+#endif
+ glDeleteQueriesARB(1, &name);
+ }
+};
+
+static LLOcclusionQueryPool sQueryPool;
+
+//static counter for frame to switch LOD on
+
+void sg_assert(BOOL expr)
+{
+#if LL_OCTREE_PARANOIA_CHECK
+ if (!expr)
+ {
+ llerrs << "Octree invalid!" << llendl;
+ }
+#endif
+}
+
+S32 AABBSphereIntersect(const LLVector3& min, const LLVector3& max, const LLVector3 &origin, const F32 &rad)
+{
+ return AABBSphereIntersectR2(min, max, origin, rad*rad);
+}
+
+S32 AABBSphereIntersectR2(const LLVector3& min, const LLVector3& max, const LLVector3 &origin, const F32 &r)
+{
+ F32 d = 0.f;
+ F32 t;
+
+ if ((min-origin).magVecSquared() < r &&
+ (max-origin).magVecSquared() < r)
+ {
+ return 2;
+ }
+
+ for (U32 i = 0; i < 3; i++)
+ {
+ if (origin.mV[i] < min.mV[i])
+ {
+ t = min.mV[i] - origin.mV[i];
+ d += t*t;
+ }
+ else if (origin.mV[i] > max.mV[i])
+ {
+ t = origin.mV[i] - max.mV[i];
+ d += t*t;
+ }
+
+ if (d > r)
+ {
+ return 0;
+ }
+ }
+
+ return 1;
+}
+
+
+S32 AABBSphereIntersect(const LLVector4a& min, const LLVector4a& max, const LLVector3 &origin, const F32 &rad)
+{
+ return AABBSphereIntersectR2(min, max, origin, rad*rad);
+}
+
+S32 AABBSphereIntersectR2(const LLVector4a& min, const LLVector4a& max, const LLVector3 &origin, const F32 &r)
+{
+ F32 d = 0.f;
+ F32 t;
+
+ LLVector4a origina;
+ origina.load3(origin.mV);
+
+ LLVector4a v;
+ v.setSub(min, origina);
+
+ if (v.dot3(v) < r)
+ {
+ v.setSub(max, origina);
+ if (v.dot3(v) < r)
+ {
+ return 2;
+ }
+ }
+
+
+ for (U32 i = 0; i < 3; i++)
+ {
+ if (origin.mV[i] < min[i])
+ {
+ t = min[i] - origin.mV[i];
+ d += t*t;
+ }
+ else if (origin.mV[i] > max[i])
+ {
+ t = origin.mV[i] - max[i];
+ d += t*t;
+ }
+
+ if (d > r)
+ {
+ return 0;
+ }
+ }
+
+ return 1;
+}
+
+
+typedef enum
+{
+ b000 = 0x00,
+ b001 = 0x01,
+ b010 = 0x02,
+ b011 = 0x03,
+ b100 = 0x04,
+ b101 = 0x05,
+ b110 = 0x06,
+ b111 = 0x07,
+} eLoveTheBits;
+
+//contact Runitai Linden for a copy of the SL object used to write this table
+//basically, you give the table a bitmask of the look-at vector to a node and it
+//gives you a triangle fan index array
+static U16 sOcclusionIndices[] =
+{
+ //000
+ b111, b110, b010, b011, b001, b101, b100, b110,
+ //001
+ b011, b010, b000, b001, b101, b111, b110, b010,
+ //010
+ b101, b100, b110, b111, b011, b001, b000, b100,
+ //011
+ b001, b000, b100, b101, b111, b011, b010, b000,
+ //100
+ b110, b000, b010, b011, b111, b101, b100, b000,
+ //101
+ b010, b100, b000, b001, b011, b111, b110, b100,
+ //110
+ b100, b010, b110, b111, b101, b001, b000, b010,
+ //111
+ b000, b110, b100, b101, b001, b011, b010, b110,
+};
+
+U32 get_box_fan_indices(LLCamera* camera, const LLVector4a& center)
+{
+ LLVector4a origin;
+ origin.load3(camera->getOrigin().mV);
+
+ S32 cypher = center.greaterThan(origin).getGatheredBits() & 0x7;
+
+ return cypher*8;
+}
+
+U8* get_box_fan_indices_ptr(LLCamera* camera, const LLVector4a& center)
+{
+ LLVector4a origin;
+ origin.load3(camera->getOrigin().mV);
+
+ S32 cypher = center.greaterThan(origin).getGatheredBits() & 0x7;
+
+ return (U8*) (sOcclusionIndices+cypher*8);
+}
+
+
+static LLFastTimer::DeclareTimer FTM_BUILD_OCCLUSION("Build Occlusion");
+
+void LLSpatialGroup::buildOcclusion()
+{
+ if (mOcclusionVerts.isNull())
+ {
+ mOcclusionVerts = new LLVertexBuffer(LLVertexBuffer::MAP_VERTEX,
+ LLVertexBuffer::sUseStreamDraw ? mBufferUsage : 0); //if GL has a hard time with VBOs, don't use them for occlusion culling.
+ mOcclusionVerts->allocateBuffer(8, 64, true);
+
+ LLStrider<U16> idx;
+ mOcclusionVerts->getIndexStrider(idx);
+ for (U32 i = 0; i < 64; i++)
+ {
+ *idx++ = sOcclusionIndices[i];
+ }
+ }
+
+ LLVector4a fudge;
+ fudge.splat(SG_OCCLUSION_FUDGE);
+
+ LLVector4a r;
+ r.setAdd(mBounds[1], fudge);
+
+ LLStrider<LLVector3> pos;
+
+ {
+ LLFastTimer t(FTM_BUILD_OCCLUSION);
+ mOcclusionVerts->getVertexStrider(pos);
+ }
+
+ {
+ LLVector4a* v = (LLVector4a*) pos.get();
+
+ const LLVector4a& c = mBounds[0];
+ const LLVector4a& s = r;
+
+ static const LLVector4a octant[] =
+ {
+ LLVector4a(-1.f, -1.f, -1.f),
+ LLVector4a(-1.f, -1.f, 1.f),
+ LLVector4a(-1.f, 1.f, -1.f),
+ LLVector4a(-1.f, 1.f, 1.f),
+
+ LLVector4a(1.f, -1.f, -1.f),
+ LLVector4a(1.f, -1.f, 1.f),
+ LLVector4a(1.f, 1.f, -1.f),
+ LLVector4a(1.f, 1.f, 1.f),
+ };
+
+ //vertex positions are encoded so the 3 bits of their vertex index
+ //correspond to their axis facing, with bit position 3,2,1 matching
+ //axis facing x,y,z, bit set meaning positive facing, bit clear
+ //meaning negative facing
+
+ for (S32 i = 0; i < 8; ++i)
+ {
+ LLVector4a p;
+ p.setMul(s, octant[i]);
+ p.add(c);
+ v[i] = p;
+ }
+ }
+
+ {
+ mOcclusionVerts->flush();
+ LLVertexBuffer::unbind();
+ }
+
+ clearState(LLSpatialGroup::OCCLUSION_DIRTY);
+}
+
+
+BOOL earlyFail(LLCamera* camera, LLSpatialGroup* group);
+
+//returns:
+// 0 if sphere and AABB are not intersecting
+// 1 if they are
+// 2 if AABB is entirely inside sphere
+
+S32 LLSphereAABB(const LLVector3& center, const LLVector3& size, const LLVector3& pos, const F32 &rad)
+{
+ S32 ret = 2;
+
+ LLVector3 min = center - size;
+ LLVector3 max = center + size;
+ for (U32 i = 0; i < 3; i++)
+ {
+ if (min.mV[i] > pos.mV[i] + rad ||
+ max.mV[i] < pos.mV[i] - rad)
+ { //totally outside
+ return 0;
+ }
+
+ if (min.mV[i] < pos.mV[i] - rad ||
+ max.mV[i] > pos.mV[i] + rad)
+ { //intersecting
+ ret = 1;
+ }
+ }
+
+ return ret;
+}
+
+LLSpatialGroup::~LLSpatialGroup()
+{
+ /*if (sNoDelete)
+ {
+ llerrs << "Illegal deletion of LLSpatialGroup!" << llendl;
+ }*/
+
+ if (gDebugGL)
+ {
+ gPipeline.checkReferences(this);
+ }
+
+ if (isState(DEAD))
+ {
+ sZombieGroups--;
+ }
+
+ sNodeCount--;
+
+ if (gGLManager.mHasOcclusionQuery)
+ {
+ for (U32 i = 0; i < LLViewerCamera::NUM_CAMERAS; ++i)
+ {
+ if (mOcclusionQuery[i])
+ {
+ sQueryPool.release(mOcclusionQuery[i]);
+ }
+ }
+ }
+
+ mOcclusionVerts = NULL;
+
+ LLMemType mt(LLMemType::MTYPE_SPACE_PARTITION);
+ clearDrawMap();
+ clearAtlasList() ;
+}
+
+BOOL LLSpatialGroup::hasAtlas(LLTextureAtlas* atlasp)
+{
+ S8 type = atlasp->getComponents() - 1 ;
+ for(std::list<LLTextureAtlas*>::iterator iter = mAtlasList[type].begin(); iter != mAtlasList[type].end() ; ++iter)
+ {
+ if(atlasp == *iter)
+ {
+ return TRUE ;
+ }
+ }
+ return FALSE ;
+}
+
+void LLSpatialGroup::addAtlas(LLTextureAtlas* atlasp, S8 recursive_level)
+{
+ if(!hasAtlas(atlasp))
+ {
+ mAtlasList[atlasp->getComponents() - 1].push_back(atlasp) ;
+ atlasp->addSpatialGroup(this) ;
+ }
+
+ --recursive_level;
+ if(recursive_level)//levels propagating up.
+ {
+ LLSpatialGroup* parent = getParent() ;
+ if(parent)
+ {
+ parent->addAtlas(atlasp, recursive_level) ;
+ }
+ }
+}
+
+void LLSpatialGroup::removeAtlas(LLTextureAtlas* atlasp, BOOL remove_group, S8 recursive_level)
+{
+ mAtlasList[atlasp->getComponents() - 1].remove(atlasp) ;
+ if(remove_group)
+ {
+ atlasp->removeSpatialGroup(this) ;
+ }
+
+ --recursive_level;
+ if(recursive_level)//levels propagating up.
+ {
+ LLSpatialGroup* parent = getParent() ;
+ if(parent)
+ {
+ parent->removeAtlas(atlasp, recursive_level) ;
+ }
+ }
+}
+
+void LLSpatialGroup::clearAtlasList()
+{
+ std::list<LLTextureAtlas*>::iterator iter ;
+ for(S8 i = 0 ; i < 4 ; i++)
+ {
+ if(mAtlasList[i].size() > 0)
+ {
+ for(iter = mAtlasList[i].begin(); iter != mAtlasList[i].end() ; ++iter)
+ {
+ ((LLTextureAtlas*)*iter)->removeSpatialGroup(this) ;
+ }
+ mAtlasList[i].clear() ;
+ }
+ }
+}
+
+LLTextureAtlas* LLSpatialGroup::getAtlas(S8 ncomponents, S8 to_be_reserved, S8 recursive_level)
+{
+ S8 type = ncomponents - 1 ;
+ if(mAtlasList[type].size() > 0)
+ {
+ for(std::list<LLTextureAtlas*>::iterator iter = mAtlasList[type].begin(); iter != mAtlasList[type].end() ; ++iter)
+ {
+ if(!((LLTextureAtlas*)*iter)->isFull(to_be_reserved))
+ {
+ return *iter ;
+ }
+ }
+ }
+
+ --recursive_level;
+ if(recursive_level)
+ {
+ LLSpatialGroup* parent = getParent() ;
+ if(parent)
+ {
+ return parent->getAtlas(ncomponents, to_be_reserved, recursive_level) ;
+ }
+ }
+ return NULL ;
+}
+
+void LLSpatialGroup::setCurUpdatingSlot(LLTextureAtlasSlot* slotp)
+{
+ mCurUpdatingSlotp = slotp;
+
+ //if(!hasAtlas(mCurUpdatingSlotp->getAtlas()))
+ //{
+ // addAtlas(mCurUpdatingSlotp->getAtlas()) ;
+ //}
+}
+
+LLTextureAtlasSlot* LLSpatialGroup::getCurUpdatingSlot(LLViewerTexture* imagep, S8 recursive_level)
+{
+ if(gFrameCount && mCurUpdatingTime == gFrameCount && mCurUpdatingTexture == imagep)
+ {
+ return mCurUpdatingSlotp ;
+ }
+
+ //--recursive_level ;
+ //if(recursive_level)
+ //{
+ // LLSpatialGroup* parent = getParent() ;
+ // if(parent)
+ // {
+ // return parent->getCurUpdatingSlot(imagep, recursive_level) ;
+ // }
+ //}
+ return NULL ;
+}
+
+void LLSpatialGroup::clearDrawMap()
+{
+ mDrawMap.clear();
+}
+
+BOOL LLSpatialGroup::isHUDGroup()
+{
+ return mSpatialPartition && mSpatialPartition->isHUDPartition() ;
+}
+
+BOOL LLSpatialGroup::isRecentlyVisible() const
+{
+ return (LLDrawable::getCurrentFrame() - mVisible[LLViewerCamera::sCurCameraID]) < LLDrawable::getMinVisFrameRange() ;
+}
+
+BOOL LLSpatialGroup::isVisible() const
+{
+ return mVisible[LLViewerCamera::sCurCameraID] >= LLDrawable::getCurrentFrame() ? TRUE : FALSE;
+}
+
+void LLSpatialGroup::setVisible()
+{
+ mVisible[LLViewerCamera::sCurCameraID] = LLDrawable::getCurrentFrame();
+}
+
+void LLSpatialGroup::validate()
+{
+#if LL_OCTREE_PARANOIA_CHECK
+
+ sg_assert(!isState(DIRTY));
+ sg_assert(!isDead());
+
+ LLVector4a myMin;
+ myMin.setSub(mBounds[0], mBounds[1]);
+ LLVector4a myMax;
+ myMax.setAdd(mBounds[0], mBounds[1]);
+
+ validateDrawMap();
+
+ for (element_iter i = getData().begin(); i != getData().end(); ++i)
+ {
+ LLDrawable* drawable = *i;
+ sg_assert(drawable->getSpatialGroup() == this);
+ if (drawable->getSpatialBridge())
+ {
+ sg_assert(drawable->getSpatialBridge() == mSpatialPartition->asBridge());
+ }
+
+ /*if (drawable->isSpatialBridge())
+ {
+ LLSpatialPartition* part = drawable->asPartition();
+ if (!part)
+ {
+ llerrs << "Drawable reports it is a spatial bridge but not a partition." << llendl;
+ }
+ LLSpatialGroup* group = (LLSpatialGroup*) part->mOctree->getListener(0);
+ group->validate();
+ }*/
+ }
+
+ for (U32 i = 0; i < mOctreeNode->getChildCount(); ++i)
+ {
+ LLSpatialGroup* group = (LLSpatialGroup*) mOctreeNode->getChild(i)->getListener(0);
+
+ group->validate();
+
+ //ensure all children are enclosed in this node
+ LLVector4a center = group->mBounds[0];
+ LLVector4a size = group->mBounds[1];
+
+ LLVector4a min;
+ min.setSub(center, size);
+ LLVector4a max;
+ max.setAdd(center, size);
+
+ for (U32 j = 0; j < 3; j++)
+ {
+ sg_assert(min[j] >= myMin[j]-0.02f);
+ sg_assert(max[j] <= myMax[j]+0.02f);
+ }
+ }
+
+#endif
+}
+
+void LLSpatialGroup::checkStates()
+{
+#if LL_OCTREE_PARANOIA_CHECK
+ //LLOctreeStateCheck checker;
+ //checker.traverse(mOctreeNode);
+#endif
+}
+
+void LLSpatialGroup::validateDrawMap()
+{
+#if LL_OCTREE_PARANOIA_CHECK
+ for (draw_map_t::iterator i = mDrawMap.begin(); i != mDrawMap.end(); ++i)
+ {
+ LLSpatialGroup::drawmap_elem_t& draw_vec = i->second;
+ for (drawmap_elem_t::iterator j = draw_vec.begin(); j != draw_vec.end(); ++j)
+ {
+ LLDrawInfo& params = **j;
+
+ params.validate();
+ }
+ }
+#endif
+}
+
+BOOL LLSpatialGroup::updateInGroup(LLDrawable *drawablep, BOOL immediate)
+{
+ LLMemType mt(LLMemType::MTYPE_SPACE_PARTITION);
+
+ drawablep->updateSpatialExtents();
+
+ OctreeNode* parent = mOctreeNode->getOctParent();
+
+ if (mOctreeNode->isInside(drawablep->getPositionGroup()) &&
+ (mOctreeNode->contains(drawablep) ||
+ (drawablep->getBinRadius() > mOctreeNode->getSize()[0] &&
+ parent && parent->getElementCount() >= gOctreeMaxCapacity)))
+ {
+ unbound();
+ setState(OBJECT_DIRTY);
+ //setState(GEOM_DIRTY);
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+
+BOOL LLSpatialGroup::addObject(LLDrawable *drawablep, BOOL add_all, BOOL from_octree)
+{
+ LLMemType mt(LLMemType::MTYPE_SPACE_PARTITION);
+ if (!from_octree)
+ {
+ mOctreeNode->insert(drawablep);
+ }
+ else
+ {
+ drawablep->setSpatialGroup(this);
+ setState(OBJECT_DIRTY | GEOM_DIRTY);
+ setOcclusionState(LLSpatialGroup::DISCARD_QUERY, LLSpatialGroup::STATE_MODE_ALL_CAMERAS);
+ gPipeline.markRebuild(this, TRUE);
+ if (drawablep->isSpatialBridge())
+ {
+ mBridgeList.push_back((LLSpatialBridge*) drawablep);
+ }
+ if (drawablep->getRadius() > 1.f)
+ {
+ setState(IMAGE_DIRTY);
+ }
+ }
+
+ return TRUE;
+}
+
+void LLSpatialGroup::rebuildGeom()
+{
+ LLMemType mt(LLMemType::MTYPE_SPACE_PARTITION);
+ if (!isDead())
+ {
+ mSpatialPartition->rebuildGeom(this);
+ }
+}
+
+void LLSpatialGroup::rebuildMesh()
+{
+ if (!isDead())
+ {
+ mSpatialPartition->rebuildMesh(this);
+ }
+}
+
+static LLFastTimer::DeclareTimer FTM_REBUILD_VBO("VBO Rebuilt");
+
+void LLSpatialPartition::rebuildGeom(LLSpatialGroup* group)
+{
+ if (group->isDead() || !group->isState(LLSpatialGroup::GEOM_DIRTY))
+ {
+ return;
+ }
+
+ if (group->changeLOD())
+ {
+ group->mLastUpdateDistance = group->mDistance;
+ group->mLastUpdateViewAngle = group->mViewAngle;
+ }
+
+ LLFastTimer ftm(FTM_REBUILD_VBO);
+
+ group->clearDrawMap();
+
+ //get geometry count
+ U32 index_count = 0;
+ U32 vertex_count = 0;
+
+ addGeometryCount(group, vertex_count, index_count);
+
+ if (vertex_count > 0 && index_count > 0)
+ { //create vertex buffer containing volume geometry for this node
+ group->mBuilt = 1.f;
+ if (group->mVertexBuffer.isNull() || (group->mBufferUsage != group->mVertexBuffer->getUsage() && LLVertexBuffer::sEnableVBOs))
+ {
+ group->mVertexBuffer = createVertexBuffer(mVertexDataMask, group->mBufferUsage);
+ group->mVertexBuffer->allocateBuffer(vertex_count, index_count, true);
+ stop_glerror();
+ }
+ else
+ {
+ group->mVertexBuffer->resizeBuffer(vertex_count, index_count);
+ stop_glerror();
+ }
+
+ getGeometry(group);
+ }
+ else
+ {
+ group->mVertexBuffer = NULL;
+ group->mBufferMap.clear();
+ }
+
+ group->mLastUpdateTime = gFrameTimeSeconds;
+ group->clearState(LLSpatialGroup::GEOM_DIRTY);
+}
+
+
+void LLSpatialPartition::rebuildMesh(LLSpatialGroup* group)
+{
+
+}
+
+BOOL LLSpatialGroup::boundObjects(BOOL empty, LLVector4a& minOut, LLVector4a& maxOut)
+{
+ const OctreeNode* node = mOctreeNode;
+
+ if (node->getData().empty())
+ { //don't do anything if there are no objects
+ if (empty && mOctreeNode->getParent())
+ { //only root is allowed to be empty
+ OCT_ERRS << "Empty leaf found in octree." << llendl;
+ }
+ return FALSE;
+ }
+
+ LLVector4a& newMin = mObjectExtents[0];
+ LLVector4a& newMax = mObjectExtents[1];
+
+ if (isState(OBJECT_DIRTY))
+ { //calculate new bounding box
+ clearState(OBJECT_DIRTY);
+
+ //initialize bounding box to first element
+ OctreeNode::const_element_iter i = node->getData().begin();
+ LLDrawable* drawablep = *i;
+ const LLVector4a* minMax = drawablep->getSpatialExtents();
+
+ newMin = minMax[0];
+ newMax = minMax[1];
+
+ for (++i; i != node->getData().end(); ++i)
+ {
+ drawablep = *i;
+ minMax = drawablep->getSpatialExtents();
+
+ update_min_max(newMin, newMax, minMax[0]);
+ update_min_max(newMin, newMax, minMax[1]);
+
+ //bin up the object
+ /*for (U32 i = 0; i < 3; i++)
+ {
+ if (minMax[0].mV[i] < newMin.mV[i])
+ {
+ newMin.mV[i] = minMax[0].mV[i];
+ }
+ if (minMax[1].mV[i] > newMax.mV[i])
+ {
+ newMax.mV[i] = minMax[1].mV[i];
+ }
+ }*/
+ }
+
+ mObjectBounds[0].setAdd(newMin, newMax);
+ mObjectBounds[0].mul(0.5f);
+ mObjectBounds[1].setSub(newMax, newMin);
+ mObjectBounds[1].mul(0.5f);
+ }
+
+ if (empty)
+ {
+ minOut = newMin;
+ maxOut = newMax;
+ }
+ else
+ {
+ minOut.setMin(minOut, newMin);
+ maxOut.setMax(maxOut, newMax);
+ }
+
+ return TRUE;
+}
+
+void LLSpatialGroup::unbound()
+{
+ if (isState(DIRTY))
+ {
+ return;
+ }
+
+ setState(DIRTY);
+
+ //all the parent nodes need to rebound this child
+ if (mOctreeNode)
+ {
+ OctreeNode* parent = (OctreeNode*) mOctreeNode->getParent();
+ while (parent != NULL)
+ {
+ LLSpatialGroup* group = (LLSpatialGroup*) parent->getListener(0);
+ if (group->isState(DIRTY))
+ {
+ return;
+ }
+
+ group->setState(DIRTY);
+ parent = (OctreeNode*) parent->getParent();
+ }
+ }
+}
+
+LLSpatialGroup* LLSpatialGroup::getParent()
+{
+ if (isDead())
+ {
+ return NULL;
+ }
+
+ if(!mOctreeNode)
+ {
+ return NULL;
+ }
+ OctreeNode* parent = mOctreeNode->getOctParent();
+
+ if (parent)
+ {
+ return (LLSpatialGroup*) parent->getListener(0);
+ }
+
+ return NULL;
+}
+
+BOOL LLSpatialGroup::removeObject(LLDrawable *drawablep, BOOL from_octree)
+{
+ LLMemType mt(LLMemType::MTYPE_SPACE_PARTITION);
+ unbound();
+ if (mOctreeNode && !from_octree)
+ {
+ if (!mOctreeNode->remove(drawablep))
+ {
+ OCT_ERRS << "Could not remove drawable from spatial group" << llendl;
+ }
+ }
+ else
+ {
+ drawablep->setSpatialGroup(NULL);
+ setState(GEOM_DIRTY);
+ gPipeline.markRebuild(this, TRUE);
+
+ if (drawablep->isSpatialBridge())
+ {
+ for (bridge_list_t::iterator i = mBridgeList.begin(); i != mBridgeList.end(); ++i)
+ {
+ if (*i == drawablep)
+ {
+ mBridgeList.erase(i);
+ break;
+ }
+ }
+ }
+
+ if (getElementCount() == 0)
+ { //delete draw map on last element removal since a rebuild might never happen
+ clearDrawMap();
+ }
+ }
+ return TRUE;
+}
+
+void LLSpatialGroup::shift(const LLVector4a &offset)
+{
+ LLMemType mt(LLMemType::MTYPE_SPACE_PARTITION);
+ LLVector4a t = mOctreeNode->getCenter();
+ t.add(offset);
+ mOctreeNode->setCenter(t);
+ mOctreeNode->updateMinMax();
+ mBounds[0].add(offset);
+ mExtents[0].add(offset);
+ mExtents[1].add(offset);
+ mObjectBounds[0].add(offset);
+ mObjectExtents[0].add(offset);
+ mObjectExtents[1].add(offset);
+
+ //if (!mSpatialPartition->mRenderByGroup)
+ {
+ setState(GEOM_DIRTY);
+ gPipeline.markRebuild(this, TRUE);
+ }
+
+ if (mOcclusionVerts.notNull())
+ {
+ setState(OCCLUSION_DIRTY);
+ }
+}
+
+class LLSpatialSetState : public LLSpatialGroup::OctreeTraveler
+{
+public:
+ U32 mState;
+ LLSpatialSetState(U32 state) : mState(state) { }
+ virtual void visit(const LLSpatialGroup::OctreeNode* branch) { ((LLSpatialGroup*) branch->getListener(0))->setState(mState); }
+};
+
+class LLSpatialSetStateDiff : public LLSpatialSetState
+{
+public:
+ LLSpatialSetStateDiff(U32 state) : LLSpatialSetState(state) { }
+
+ virtual void traverse(const LLSpatialGroup::OctreeNode* n)
+ {
+ LLSpatialGroup* group = (LLSpatialGroup*) n->getListener(0);
+
+ if (!group->isState(mState))
+ {
+ LLSpatialGroup::OctreeTraveler::traverse(n);
+ }
+ }
+};
+
+void LLSpatialGroup::setState(U32 state)
+{
+ mState |= state;
+
+ llassert(state <= LLSpatialGroup::STATE_MASK);
+}
+
+void LLSpatialGroup::setState(U32 state, S32 mode)
+{
+ LLMemType mt(LLMemType::MTYPE_SPACE_PARTITION);
+
+ llassert(state <= LLSpatialGroup::STATE_MASK);
+
+ if (mode > STATE_MODE_SINGLE)
+ {
+ if (mode == STATE_MODE_DIFF)
+ {
+ LLSpatialSetStateDiff setter(state);
+ setter.traverse(mOctreeNode);
+ }
+ else
+ {
+ LLSpatialSetState setter(state);
+ setter.traverse(mOctreeNode);
+ }
+ }
+ else
+ {
+ mState |= state;
+ }
+}
+
+class LLSpatialClearState : public LLSpatialGroup::OctreeTraveler
+{
+public:
+ U32 mState;
+ LLSpatialClearState(U32 state) : mState(state) { }
+ virtual void visit(const LLSpatialGroup::OctreeNode* branch) { ((LLSpatialGroup*) branch->getListener(0))->clearState(mState); }
+};
+
+class LLSpatialClearStateDiff : public LLSpatialClearState
+{
+public:
+ LLSpatialClearStateDiff(U32 state) : LLSpatialClearState(state) { }
+
+ virtual void traverse(const LLSpatialGroup::OctreeNode* n)
+ {
+ LLSpatialGroup* group = (LLSpatialGroup*) n->getListener(0);
+
+ if (group->isState(mState))
+ {
+ LLSpatialGroup::OctreeTraveler::traverse(n);
+ }
+ }
+};
+
+void LLSpatialGroup::clearState(U32 state)
+{
+ llassert(state <= LLSpatialGroup::STATE_MASK);
+
+ mState &= ~state;
+}
+
+void LLSpatialGroup::clearState(U32 state, S32 mode)
+{
+ llassert(state <= LLSpatialGroup::STATE_MASK);
+
+ LLMemType mt(LLMemType::MTYPE_SPACE_PARTITION);
+
+ if (mode > STATE_MODE_SINGLE)
+ {
+ if (mode == STATE_MODE_DIFF)
+ {
+ LLSpatialClearStateDiff clearer(state);
+ clearer.traverse(mOctreeNode);
+ }
+ else
+ {
+ LLSpatialClearState clearer(state);
+ clearer.traverse(mOctreeNode);
+ }
+ }
+ else
+ {
+ mState &= ~state;
+ }
+}
+
+BOOL LLSpatialGroup::isState(U32 state) const
+{
+ llassert(state <= LLSpatialGroup::STATE_MASK);
+
+ return mState & state ? TRUE : FALSE;
+}
+
+//=====================================
+// Occlusion State Set/Clear
+//=====================================
+class LLSpatialSetOcclusionState : public LLSpatialGroup::OctreeTraveler
+{
+public:
+ U32 mState;
+ LLSpatialSetOcclusionState(U32 state) : mState(state) { }
+ virtual void visit(const LLSpatialGroup::OctreeNode* branch) { ((LLSpatialGroup*) branch->getListener(0))->setOcclusionState(mState); }
+};
+
+class LLSpatialSetOcclusionStateDiff : public LLSpatialSetOcclusionState
+{
+public:
+ LLSpatialSetOcclusionStateDiff(U32 state) : LLSpatialSetOcclusionState(state) { }
+
+ virtual void traverse(const LLSpatialGroup::OctreeNode* n)
+ {
+ LLSpatialGroup* group = (LLSpatialGroup*) n->getListener(0);
+
+ if (!group->isOcclusionState(mState))
+ {
+ LLSpatialGroup::OctreeTraveler::traverse(n);
+ }
+ }
+};
+
+
+void LLSpatialGroup::setOcclusionState(U32 state, S32 mode)
+{
+ LLMemType mt(LLMemType::MTYPE_SPACE_PARTITION);
+
+ if (mode > STATE_MODE_SINGLE)
+ {
+ if (mode == STATE_MODE_DIFF)
+ {
+ LLSpatialSetOcclusionStateDiff setter(state);
+ setter.traverse(mOctreeNode);
+ }
+ else if (mode == STATE_MODE_BRANCH)
+ {
+ LLSpatialSetOcclusionState setter(state);
+ setter.traverse(mOctreeNode);
+ }
+ else
+ {
+ for (U32 i = 0; i < LLViewerCamera::NUM_CAMERAS; i++)
+ {
+ mOcclusionState[i] |= state;
+
+ if ((state & DISCARD_QUERY) && mOcclusionQuery[i])
+ {
+ sQueryPool.release(mOcclusionQuery[i]);
+ mOcclusionQuery[i] = 0;
+ }
+ }
+ }
+ }
+ else
+ {
+ mOcclusionState[LLViewerCamera::sCurCameraID] |= state;
+ if ((state & DISCARD_QUERY) && mOcclusionQuery[LLViewerCamera::sCurCameraID])
+ {
+ sQueryPool.release(mOcclusionQuery[LLViewerCamera::sCurCameraID]);
+ mOcclusionQuery[LLViewerCamera::sCurCameraID] = 0;
+ }
+ }
+}
+
+class LLSpatialClearOcclusionState : public LLSpatialGroup::OctreeTraveler
+{
+public:
+ U32 mState;
+
+ LLSpatialClearOcclusionState(U32 state) : mState(state) { }
+ virtual void visit(const LLSpatialGroup::OctreeNode* branch) { ((LLSpatialGroup*) branch->getListener(0))->clearOcclusionState(mState); }
+};
+
+class LLSpatialClearOcclusionStateDiff : public LLSpatialClearOcclusionState
+{
+public:
+ LLSpatialClearOcclusionStateDiff(U32 state) : LLSpatialClearOcclusionState(state) { }
+
+ virtual void traverse(const LLSpatialGroup::OctreeNode* n)
+ {
+ LLSpatialGroup* group = (LLSpatialGroup*) n->getListener(0);
+
+ if (group->isOcclusionState(mState))
+ {
+ LLSpatialGroup::OctreeTraveler::traverse(n);
+ }
+ }
+};
+
+void LLSpatialGroup::clearOcclusionState(U32 state, S32 mode)
+{
+ LLMemType mt(LLMemType::MTYPE_SPACE_PARTITION);
+
+ if (mode > STATE_MODE_SINGLE)
+ {
+ if (mode == STATE_MODE_DIFF)
+ {
+ LLSpatialClearOcclusionStateDiff clearer(state);
+ clearer.traverse(mOctreeNode);
+ }
+ else if (mode == STATE_MODE_BRANCH)
+ {
+ LLSpatialClearOcclusionState clearer(state);
+ clearer.traverse(mOctreeNode);
+ }
+ else
+ {
+ for (U32 i = 0; i < LLViewerCamera::NUM_CAMERAS; i++)
+ {
+ mOcclusionState[i] &= ~state;
+ }
+ }
+ }
+ else
+ {
+ mOcclusionState[LLViewerCamera::sCurCameraID] &= ~state;
+ }
+}
+//======================================
+// Octree Listener Implementation
+//======================================
+
+LLSpatialGroup::LLSpatialGroup(OctreeNode* node, LLSpatialPartition* part) :
+ mState(0),
+ mBuilt(0.f),
+ mOctreeNode(node),
+ mSpatialPartition(part),
+ mVertexBuffer(NULL),
+ mBufferUsage(part->mBufferUsage),
+ mDistance(0.f),
+ mDepth(0.f),
+ mLastUpdateDistance(-1.f),
+ mLastUpdateTime(gFrameTimeSeconds),
+ mAtlasList(4),
+ mCurUpdatingTime(0),
+ mCurUpdatingSlotp(NULL),
+ mCurUpdatingTexture (NULL)
+{
+ sNodeCount++;
+ LLMemType mt(LLMemType::MTYPE_SPACE_PARTITION);
+
+ mViewAngle.splat(0.f);
+ mLastUpdateViewAngle.splat(-1.f);
+ mExtents[0] = mExtents[1] = mObjectBounds[0] = mObjectBounds[0] = mObjectBounds[1] =
+ mObjectExtents[0] = mObjectExtents[1] = mViewAngle;
+
+ sg_assert(mOctreeNode->getListenerCount() == 0);
+ mOctreeNode->addListener(this);
+ setState(SG_INITIAL_STATE_MASK);
+ gPipeline.markRebuild(this, TRUE);
+
+ mBounds[0] = node->getCenter();
+ mBounds[1] = node->getSize();
+
+ part->mLODSeed = (part->mLODSeed+1)%part->mLODPeriod;
+ mLODHash = part->mLODSeed;
+
+ OctreeNode* oct_parent = node->getOctParent();
+
+ LLSpatialGroup* parent = oct_parent ? (LLSpatialGroup*) oct_parent->getListener(0) : NULL;
+
+ for (U32 i = 0; i < LLViewerCamera::NUM_CAMERAS; i++)
+ {
+ mOcclusionQuery[i] = 0;
+ mOcclusionState[i] = parent ? SG_STATE_INHERIT_MASK & parent->mOcclusionState[i] : 0;
+ mVisible[i] = 0;
+ }
+
+ mOcclusionVerts = NULL;
+
+ mRadius = 1;
+ mPixelArea = 1024.f;
+}
+
+void LLSpatialGroup::updateDistance(LLCamera &camera)
+{
+ if (LLViewerCamera::sCurCameraID != LLViewerCamera::CAMERA_WORLD)
+ {
+ llwarns << "Attempted to update distance for camera other than world camera!" << llendl;
+ return;
+ }
+
+#if !LL_RELEASE_FOR_DOWNLOAD
+ if (isState(LLSpatialGroup::OBJECT_DIRTY))
+ {
+ llerrs << "Spatial group dirty on distance update." << llendl;
+ }
+#endif
+ if (!getData().empty())
+ {
+ mRadius = mSpatialPartition->mRenderByGroup ? mObjectBounds[1].getLength3().getF32() :
+ (F32) mOctreeNode->getSize().getLength3().getF32();
+ mDistance = mSpatialPartition->calcDistance(this, camera);
+ mPixelArea = mSpatialPartition->calcPixelArea(this, camera);
+ }
+}
+
+F32 LLSpatialPartition::calcDistance(LLSpatialGroup* group, LLCamera& camera)
+{
+ LLVector4a eye;
+ LLVector4a origin;
+ origin.load3(camera.getOrigin().mV);
+
+ eye.setSub(group->mObjectBounds[0], origin);
+
+ F32 dist = 0.f;
+
+ if (group->mDrawMap.find(LLRenderPass::PASS_ALPHA) != group->mDrawMap.end())
+ {
+ LLVector4a v = eye;
+
+ dist = eye.getLength3().getF32();
+ eye.normalize3fast();
+
+ if (!group->isState(LLSpatialGroup::ALPHA_DIRTY))
+ {
+ if (!group->mSpatialPartition->isBridge())
+ {
+ LLVector4a view_angle = eye;
+
+ LLVector4a diff;
+ diff.setSub(view_angle, group->mLastUpdateViewAngle);
+
+ if (diff.getLength3().getF32() > 0.64f)
+ {
+ group->mViewAngle = view_angle;
+ group->mLastUpdateViewAngle = view_angle;
+ //for occasional alpha sorting within the group
+ //NOTE: If there is a trivial way to detect that alpha sorting here would not change the render order,
+ //not setting this node to dirty would be a very good thing
+ group->setState(LLSpatialGroup::ALPHA_DIRTY);
+ gPipeline.markRebuild(group, FALSE);
+ }
+ }
+ }
+
+ //calculate depth of node for alpha sorting
+
+ LLVector3 at = camera.getAtAxis();
+
+ LLVector4a ata;
+ ata.load3(at.mV);
+
+ LLVector4a t = ata;
+ //front of bounding box
+ t.mul(0.25f);
+ t.mul(group->mObjectBounds[1]);
+ v.sub(t);
+
+ group->mDepth = v.dot3(ata).getF32();
+ }
+ else
+ {
+ dist = eye.getLength3().getF32();
+ }
+
+ if (dist < 16.f)
+ {
+ dist /= 16.f;
+ dist *= dist;
+ dist *= 16.f;
+ }
+
+ return dist;
+}
+
+F32 LLSpatialPartition::calcPixelArea(LLSpatialGroup* group, LLCamera& camera)
+{
+ return LLPipeline::calcPixelArea(group->mObjectBounds[0], group->mObjectBounds[1], camera);
+}
+
+F32 LLSpatialGroup::getUpdateUrgency() const
+{
+ if (!isVisible())
+ {
+ return 0.f;
+ }
+ else
+ {
+ F32 time = gFrameTimeSeconds-mLastUpdateTime+4.f;
+ return time + (mObjectBounds[1].dot3(mObjectBounds[1]).getF32()+1.f)/mDistance;
+ }
+}
+
+BOOL LLSpatialGroup::needsUpdate()
+{
+ return (LLDrawable::getCurrentFrame()%mSpatialPartition->mLODPeriod == mLODHash) ? TRUE : FALSE;
+}
+
+BOOL LLSpatialGroup::changeLOD()
+{
+ if (isState(ALPHA_DIRTY | OBJECT_DIRTY))
+ { ///a rebuild is going to happen, update distance and LoD
+ return TRUE;
+ }
+
+ if (mSpatialPartition->mSlopRatio > 0.f)
+ {
+ F32 ratio = (mDistance - mLastUpdateDistance)/(llmax(mLastUpdateDistance, mRadius));
+
+ if (fabsf(ratio) >= mSpatialPartition->mSlopRatio)
+ {
+ return TRUE;
+ }
+
+ if (mDistance > mRadius*2.f)
+ {
+ return FALSE;
+ }
+ }
+
+ if (needsUpdate())
+ {
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+void LLSpatialGroup::handleInsertion(const TreeNode* node, LLDrawable* drawablep)
+{
+ LLMemType mt(LLMemType::MTYPE_SPACE_PARTITION);
+ addObject(drawablep, FALSE, TRUE);
+ unbound();
+ setState(OBJECT_DIRTY);
+}
+
+void LLSpatialGroup::handleRemoval(const TreeNode* node, LLDrawable* drawable)
+{
+ LLMemType mt(LLMemType::MTYPE_SPACE_PARTITION);
+ removeObject(drawable, TRUE);
+ setState(OBJECT_DIRTY);
+}
+
+void LLSpatialGroup::handleDestruction(const TreeNode* node)
+{
+ LLMemType mt(LLMemType::MTYPE_SPACE_PARTITION);
+ setState(DEAD);
+
+ for (element_iter i = getData().begin(); i != getData().end(); ++i)
+ {
+ LLDrawable* drawable = *i;
+ if (drawable->getSpatialGroup() == this)
+ {
+ drawable->setSpatialGroup(NULL);
+ }
+ }
+
+ clearDrawMap();
+ mVertexBuffer = NULL;
+ mBufferMap.clear();
+ sZombieGroups++;
+ mOctreeNode = NULL;
+}
+
+void LLSpatialGroup::handleStateChange(const TreeNode* node)
+{
+ //drop bounding box upon state change
+ if (mOctreeNode != node)
+ {
+ mOctreeNode = (OctreeNode*) node;
+ }
+ unbound();
+}
+
+void LLSpatialGroup::handleChildAddition(const OctreeNode* parent, OctreeNode* child)
+{
+ LLMemType mt(LLMemType::MTYPE_SPACE_PARTITION);
+ if (child->getListenerCount() == 0)
+ {
+ new LLSpatialGroup(child, mSpatialPartition);
+ }
+ else
+ {
+ OCT_ERRS << "LLSpatialGroup redundancy detected." << llendl;
+ }
+
+ unbound();
+
+ assert_states_valid(this);
+}
+
+void LLSpatialGroup::handleChildRemoval(const OctreeNode* parent, const OctreeNode* child)
+{
+ unbound();
+}
+
+void LLSpatialGroup::destroyGL()
+{
+ setState(LLSpatialGroup::GEOM_DIRTY | LLSpatialGroup::IMAGE_DIRTY);
+ gPipeline.markRebuild(this, TRUE);
+
+ mLastUpdateTime = gFrameTimeSeconds;
+ mVertexBuffer = NULL;
+ mBufferMap.clear();
+
+ clearDrawMap();
+
+ for (U32 i = 0; i < LLViewerCamera::NUM_CAMERAS; i++)
+ {
+ if (mOcclusionQuery[i])
+ {
+ sQueryPool.release(mOcclusionQuery[i]);
+ mOcclusionQuery[i] = 0;
+ }
+ }
+
+ mOcclusionVerts = NULL;
+
+ for (LLSpatialGroup::element_iter i = getData().begin(); i != getData().end(); ++i)
+ {
+ LLDrawable* drawable = *i;
+ for (S32 j = 0; j < drawable->getNumFaces(); j++)
+ {
+ LLFace* facep = drawable->getFace(j);
+ facep->clearVertexBuffer();
+ }
+ }
+}
+
+BOOL LLSpatialGroup::rebound()
+{
+ if (!isState(DIRTY))
+ { //return TRUE if we're not empty
+ return TRUE;
+ }
+
+ if (mOctreeNode->getChildCount() == 1 && mOctreeNode->getElementCount() == 0)
+ {
+ LLSpatialGroup* group = (LLSpatialGroup*) mOctreeNode->getChild(0)->getListener(0);
+ group->rebound();
+
+ //copy single child's bounding box
+ mBounds[0] = group->mBounds[0];
+ mBounds[1] = group->mBounds[1];
+ mExtents[0] = group->mExtents[0];
+ mExtents[1] = group->mExtents[1];
+
+ group->setState(SKIP_FRUSTUM_CHECK);
+ }
+ else if (mOctreeNode->isLeaf())
+ { //copy object bounding box if this is a leaf
+ boundObjects(TRUE, mExtents[0], mExtents[1]);
+ mBounds[0] = mObjectBounds[0];
+ mBounds[1] = mObjectBounds[1];
+ }
+ else
+ {
+ LLVector4a& newMin = mExtents[0];
+ LLVector4a& newMax = mExtents[1];
+ LLSpatialGroup* group = (LLSpatialGroup*) mOctreeNode->getChild(0)->getListener(0);
+ group->clearState(SKIP_FRUSTUM_CHECK);
+ group->rebound();
+ //initialize to first child
+ newMin = group->mExtents[0];
+ newMax = group->mExtents[1];
+
+ //first, rebound children
+ for (U32 i = 1; i < mOctreeNode->getChildCount(); i++)
+ {
+ group = (LLSpatialGroup*) mOctreeNode->getChild(i)->getListener(0);
+ group->clearState(SKIP_FRUSTUM_CHECK);
+ group->rebound();
+ const LLVector4a& max = group->mExtents[1];
+ const LLVector4a& min = group->mExtents[0];
+
+ newMax.setMax(newMax, max);
+ newMin.setMin(newMin, min);
+ }
+
+ boundObjects(FALSE, newMin, newMax);
+
+ mBounds[0].setAdd(newMin, newMax);
+ mBounds[0].mul(0.5f);
+ mBounds[1].setSub(newMax, newMin);
+ mBounds[1].mul(0.5f);
+ }
+
+ setState(OCCLUSION_DIRTY);
+
+ clearState(DIRTY);
+
+ return TRUE;
+}
+
+static LLFastTimer::DeclareTimer FTM_OCCLUSION_READBACK("Readback Occlusion");
+void LLSpatialGroup::checkOcclusion()
+{
+ if (LLPipeline::sUseOcclusion > 1)
+ {
+ LLFastTimer t(FTM_OCCLUSION_READBACK);
+ LLSpatialGroup* parent = getParent();
+ if (parent && parent->isOcclusionState(LLSpatialGroup::OCCLUDED))
+ { //if the parent has been marked as occluded, the child is implicitly occluded
+ clearOcclusionState(QUERY_PENDING | DISCARD_QUERY);
+ }
+ else if (isOcclusionState(QUERY_PENDING))
+ { //otherwise, if a query is pending, read it back
+
+ GLuint available = 0;
+ if (mOcclusionQuery[LLViewerCamera::sCurCameraID])
+ {
+ glGetQueryObjectuivARB(mOcclusionQuery[LLViewerCamera::sCurCameraID], GL_QUERY_RESULT_AVAILABLE_ARB, &available);
+ }
+ else
+ {
+ available = 1;
+ }
+
+ if (available)
+ { //result is available, read it back, otherwise wait until next frame
+ GLuint res = 1;
+ if (!isOcclusionState(DISCARD_QUERY) && mOcclusionQuery[LLViewerCamera::sCurCameraID])
+ {
+ glGetQueryObjectuivARB(mOcclusionQuery[LLViewerCamera::sCurCameraID], GL_QUERY_RESULT_ARB, &res);
+#if LL_TRACK_PENDING_OCCLUSION_QUERIES
+ sPendingQueries.erase(mOcclusionQuery[LLViewerCamera::sCurCameraID]);
+#endif
+ }
+ else if (mOcclusionQuery[LLViewerCamera::sCurCameraID])
+ { //delete the query to avoid holding onto hundreds of pending queries
+ sQueryPool.release(mOcclusionQuery[LLViewerCamera::sCurCameraID]);
+ mOcclusionQuery[LLViewerCamera::sCurCameraID] = 0;
+ }
+
+ if (isOcclusionState(DISCARD_QUERY))
+ {
+ res = 2;
+ }
+
+ if (res > 0)
+ {
+ assert_states_valid(this);
+ clearOcclusionState(LLSpatialGroup::OCCLUDED, LLSpatialGroup::STATE_MODE_DIFF);
+ assert_states_valid(this);
+ }
+ else
+ {
+ assert_states_valid(this);
+ setOcclusionState(LLSpatialGroup::OCCLUDED, LLSpatialGroup::STATE_MODE_DIFF);
+ assert_states_valid(this);
+ }
+
+ clearOcclusionState(QUERY_PENDING | DISCARD_QUERY);
+ }
+ }
+ else if (mSpatialPartition->isOcclusionEnabled() && isOcclusionState(LLSpatialGroup::OCCLUDED))
+ { //check occlusion has been issued for occluded node that has not had a query issued
+ assert_states_valid(this);
+ clearOcclusionState(LLSpatialGroup::OCCLUDED, LLSpatialGroup::STATE_MODE_DIFF);
+ assert_states_valid(this);
+ }
+ }
+}
+
+static LLFastTimer::DeclareTimer FTM_PUSH_OCCLUSION_VERTS("Push Occlusion");
+static LLFastTimer::DeclareTimer FTM_SET_OCCLUSION_STATE("Occlusion State");
+static LLFastTimer::DeclareTimer FTM_OCCLUSION_EARLY_FAIL("Occlusion Early Fail");
+static LLFastTimer::DeclareTimer FTM_OCCLUSION_ALLOCATE("Allocate");
+static LLFastTimer::DeclareTimer FTM_OCCLUSION_BUILD("Build");
+static LLFastTimer::DeclareTimer FTM_OCCLUSION_BEGIN_QUERY("Begin Query");
+static LLFastTimer::DeclareTimer FTM_OCCLUSION_END_QUERY("End Query");
+static LLFastTimer::DeclareTimer FTM_OCCLUSION_SET_BUFFER("Set Buffer");
+static LLFastTimer::DeclareTimer FTM_OCCLUSION_DRAW_WATER("Draw Water");
+static LLFastTimer::DeclareTimer FTM_OCCLUSION_DRAW("Draw");
+
+
+
+void LLSpatialGroup::doOcclusion(LLCamera* camera)
+{
+ if (mSpatialPartition->isOcclusionEnabled() && LLPipeline::sUseOcclusion > 1)
+ {
+ // Don't cull hole/edge water, unless we have the GL_ARB_depth_clamp extension
+ if (earlyFail(camera, this))
+ {
+ LLFastTimer t(FTM_OCCLUSION_EARLY_FAIL);
+ setOcclusionState(LLSpatialGroup::DISCARD_QUERY);
+ assert_states_valid(this);
+ clearOcclusionState(LLSpatialGroup::OCCLUDED, LLSpatialGroup::STATE_MODE_DIFF);
+ assert_states_valid(this);
+ }
+ else
+ {
+ if (!isOcclusionState(QUERY_PENDING) || isOcclusionState(DISCARD_QUERY))
+ {
+ { //no query pending, or previous query to be discarded
+ LLFastTimer t(FTM_RENDER_OCCLUSION);
+
+ if (!mOcclusionQuery[LLViewerCamera::sCurCameraID])
+ {
+ LLFastTimer t(FTM_OCCLUSION_ALLOCATE);
+ mOcclusionQuery[LLViewerCamera::sCurCameraID] = sQueryPool.allocate();
+ }
+
+ if (mOcclusionVerts.isNull() || isState(LLSpatialGroup::OCCLUSION_DIRTY))
+ {
+ LLFastTimer t(FTM_OCCLUSION_BUILD);
+ buildOcclusion();
+ }
+
+ // Depth clamp all water to avoid it being culled as a result of being
+ // behind the far clip plane, and in the case of edge water to avoid
+ // it being culled while still visible.
+ bool const use_depth_clamp = gGLManager.mHasDepthClamp &&
+ (mSpatialPartition->mDrawableType == LLDrawPool::POOL_WATER ||
+ mSpatialPartition->mDrawableType == LLDrawPool::POOL_VOIDWATER);
+
+ LLGLEnable clamp(use_depth_clamp ? GL_DEPTH_CLAMP : 0);
+
+#if !LL_DARWIN
+ U32 mode = gGLManager.mHasOcclusionQuery2 ? GL_ANY_SAMPLES_PASSED : GL_SAMPLES_PASSED_ARB;
+#else
+ U32 mode = GL_SAMPLES_PASSED_ARB;
+#endif
+
+#if LL_TRACK_PENDING_OCCLUSION_QUERIES
+ sPendingQueries.insert(mOcclusionQuery[LLViewerCamera::sCurCameraID]);
+#endif
+
+ {
+ LLFastTimer t(FTM_PUSH_OCCLUSION_VERTS);
+
+ {
+ LLFastTimer t(FTM_OCCLUSION_BEGIN_QUERY);
+ glBeginQueryARB(mode, mOcclusionQuery[LLViewerCamera::sCurCameraID]);
+ }
+
+ {
+ LLFastTimer t(FTM_OCCLUSION_SET_BUFFER);
+ mOcclusionVerts->setBuffer(LLVertexBuffer::MAP_VERTEX);
+ }
+
+ if (!use_depth_clamp && mSpatialPartition->mDrawableType == LLDrawPool::POOL_VOIDWATER)
+ {
+ LLFastTimer t(FTM_OCCLUSION_DRAW_WATER);
+
+ LLGLSquashToFarClip squash(glh_get_current_projection(), 1);
+ if (camera->getOrigin().isExactlyZero())
+ { //origin is invalid, draw entire box
+ mOcclusionVerts->drawRange(LLRender::TRIANGLE_FAN, 0, 7, 8, 0);
+ mOcclusionVerts->drawRange(LLRender::TRIANGLE_FAN, 0, 7, 8, b111*8);
+ }
+ else
+ {
+ mOcclusionVerts->drawRange(LLRender::TRIANGLE_FAN, 0, 7, 8, get_box_fan_indices(camera, mBounds[0]));
+ }
+ }
+ else
+ {
+ LLFastTimer t(FTM_OCCLUSION_DRAW);
+ if (camera->getOrigin().isExactlyZero())
+ { //origin is invalid, draw entire box
+ mOcclusionVerts->drawRange(LLRender::TRIANGLE_FAN, 0, 7, 8, 0);
+ mOcclusionVerts->drawRange(LLRender::TRIANGLE_FAN, 0, 7, 8, b111*8);
+ }
+ else
+ {
+ mOcclusionVerts->drawRange(LLRender::TRIANGLE_FAN, 0, 7, 8, get_box_fan_indices(camera, mBounds[0]));
+ }
+ }
+
+
+ {
+ LLFastTimer t(FTM_OCCLUSION_END_QUERY);
+ glEndQueryARB(mode);
+ }
+ }
+ }
+
+ {
+ LLFastTimer t(FTM_SET_OCCLUSION_STATE);
+ setOcclusionState(LLSpatialGroup::QUERY_PENDING);
+ clearOcclusionState(LLSpatialGroup::DISCARD_QUERY);
+ }
+ }
+ }
+ }
+}
+
+//==============================================
+
+LLSpatialPartition::LLSpatialPartition(U32 data_mask, BOOL render_by_group, U32 buffer_usage)
+: mRenderByGroup(render_by_group)
+{
+ LLMemType mt(LLMemType::MTYPE_SPACE_PARTITION);
+ mOcclusionEnabled = TRUE;
+ mDrawableType = 0;
+ mPartitionType = LLViewerRegion::PARTITION_NONE;
+ mLODSeed = 0;
+ mLODPeriod = 1;
+ mVertexDataMask = data_mask;
+ mBufferUsage = buffer_usage;
+ mDepthMask = FALSE;
+ mSlopRatio = 0.25f;
+ mInfiniteFarClip = FALSE;
+
+ LLVector4a center, size;
+ center.splat(0.f);
+ size.splat(1.f);
+
+ mOctree = new LLSpatialGroup::OctreeRoot(center,size,
+ NULL);
+ new LLSpatialGroup(mOctree, this);
+}
+
+
+LLSpatialPartition::~LLSpatialPartition()
+{
+ LLMemType mt(LLMemType::MTYPE_SPACE_PARTITION);
+
+ delete mOctree;
+ mOctree = NULL;
+}
+
+
+LLSpatialGroup *LLSpatialPartition::put(LLDrawable *drawablep, BOOL was_visible)
+{
+ LLMemType mt(LLMemType::MTYPE_SPACE_PARTITION);
+
+ drawablep->updateSpatialExtents();
+
+ //keep drawable from being garbage collected
+ LLPointer<LLDrawable> ptr = drawablep;
+
+ assert_octree_valid(mOctree);
+ mOctree->insert(drawablep);
+ assert_octree_valid(mOctree);
+
+ LLSpatialGroup* group = drawablep->getSpatialGroup();
+
+ if (group && was_visible && group->isOcclusionState(LLSpatialGroup::QUERY_PENDING))
+ {
+ group->setOcclusionState(LLSpatialGroup::DISCARD_QUERY, LLSpatialGroup::STATE_MODE_ALL_CAMERAS);
+ }
+
+ return group;
+}
+
+BOOL LLSpatialPartition::remove(LLDrawable *drawablep, LLSpatialGroup *curp)
+{
+ LLMemType mt(LLMemType::MTYPE_SPACE_PARTITION);
+
+ drawablep->setSpatialGroup(NULL);
+
+ if (!curp->removeObject(drawablep))
+ {
+ OCT_ERRS << "Failed to remove drawable from octree!" << llendl;
+ }
+
+ assert_octree_valid(mOctree);
+
+ return TRUE;
+}
+
+void LLSpatialPartition::move(LLDrawable *drawablep, LLSpatialGroup *curp, BOOL immediate)
+{
+ LLMemType mt(LLMemType::MTYPE_SPACE_PARTITION);
+
+ // sanity check submitted by open source user bushing Spatula
+ // who was seeing crashing here. (See VWR-424 reported by Bunny Mayne)
+ if (!drawablep)
+ {
+ OCT_ERRS << "LLSpatialPartition::move was passed a bad drawable." << llendl;
+ return;
+ }
+
+ BOOL was_visible = curp ? curp->isVisible() : FALSE;
+
+ if (curp && curp->mSpatialPartition != this)
+ {
+ //keep drawable from being garbage collected
+ LLPointer<LLDrawable> ptr = drawablep;
+ if (curp->mSpatialPartition->remove(drawablep, curp))
+ {
+ put(drawablep, was_visible);
+ return;
+ }
+ else
+ {
+ OCT_ERRS << "Drawable lost between spatial partitions on outbound transition." << llendl;
+ }
+ }
+
+ if (curp && curp->updateInGroup(drawablep, immediate))
+ {
+ // Already updated, don't need to do anything
+ assert_octree_valid(mOctree);
+ return;
+ }
+
+ //keep drawable from being garbage collected
+ LLPointer<LLDrawable> ptr = drawablep;
+ if (curp && !remove(drawablep, curp))
+ {
+ OCT_ERRS << "Move couldn't find existing spatial group!" << llendl;
+ }
+
+ put(drawablep, was_visible);
+}
+
+class LLSpatialShift : public LLSpatialGroup::OctreeTraveler
+{
+public:
+ const LLVector4a& mOffset;
+
+ LLSpatialShift(const LLVector4a& offset) : mOffset(offset) { }
+ virtual void visit(const LLSpatialGroup::OctreeNode* branch)
+ {
+ ((LLSpatialGroup*) branch->getListener(0))->shift(mOffset);
+ }
+};
+
+void LLSpatialPartition::shift(const LLVector4a &offset)
+{ //shift octree node bounding boxes by offset
+ LLMemType mt(LLMemType::MTYPE_SPACE_PARTITION);
+ LLSpatialShift shifter(offset);
+ shifter.traverse(mOctree);
+}
+
+class LLOctreeCull : public LLSpatialGroup::OctreeTraveler
+{
+public:
+ LLOctreeCull(LLCamera* camera)
+ : mCamera(camera), mRes(0) { }
+
+ virtual bool earlyFail(LLSpatialGroup* group)
+ {
+ group->checkOcclusion();
+
+ if (group->mOctreeNode->getParent() && //never occlusion cull the root node
+ LLPipeline::sUseOcclusion && //ignore occlusion if disabled
+ group->isOcclusionState(LLSpatialGroup::OCCLUDED))
+ {
+ gPipeline.markOccluder(group);
+ return true;
+ }
+
+ return false;
+ }
+
+ virtual void traverse(const LLSpatialGroup::OctreeNode* n)
+ {
+ LLSpatialGroup* group = (LLSpatialGroup*) n->getListener(0);
+
+ if (earlyFail(group))
+ {
+ return;
+ }
+
+ if (mRes == 2 ||
+ (mRes && group->isState(LLSpatialGroup::SKIP_FRUSTUM_CHECK)))
+ { //fully in, just add everything
+ LLSpatialGroup::OctreeTraveler::traverse(n);
+ }
+ else
+ {
+ mRes = frustumCheck(group);
+
+ if (mRes)
+ { //at least partially in, run on down
+ LLSpatialGroup::OctreeTraveler::traverse(n);
+ }
+
+ mRes = 0;
+ }
+ }
+
+ virtual S32 frustumCheck(const LLSpatialGroup* group)
+ {
+ S32 res = mCamera->AABBInFrustumNoFarClip(group->mBounds[0], group->mBounds[1]);
+ if (res != 0)
+ {
+ res = llmin(res, AABBSphereIntersect(group->mExtents[0], group->mExtents[1], mCamera->getOrigin(), mCamera->mFrustumCornerDist));
+ }
+ return res;
+ }
+
+ virtual S32 frustumCheckObjects(const LLSpatialGroup* group)
+ {
+ S32 res = mCamera->AABBInFrustumNoFarClip(group->mObjectBounds[0], group->mObjectBounds[1]);
+ if (res != 0)
+ {
+ res = llmin(res, AABBSphereIntersect(group->mObjectExtents[0], group->mObjectExtents[1], mCamera->getOrigin(), mCamera->mFrustumCornerDist));
+ }
+ return res;
+ }
+
+ virtual bool checkObjects(const LLSpatialGroup::OctreeNode* branch, const LLSpatialGroup* group)
+ {
+ if (branch->getElementCount() == 0) //no elements
+ {
+ return false;
+ }
+ else if (branch->getChildCount() == 0) //leaf state, already checked tightest bounding box
+ {
+ return true;
+ }
+ else if (mRes == 1 && !frustumCheckObjects(group)) //no objects in frustum
+ {
+ return false;
+ }
+
+ return true;
+ }
+
+ virtual void preprocess(LLSpatialGroup* group)
+ {
+
+ }
+
+ virtual void processGroup(LLSpatialGroup* group)
+ {
+ if (group->needsUpdate() ||
+ group->mVisible[LLViewerCamera::sCurCameraID] < LLDrawable::getCurrentFrame() - 1)
+ {
+ group->doOcclusion(mCamera);
+ }
+ gPipeline.markNotCulled(group, *mCamera);
+ }
+
+ virtual void visit(const LLSpatialGroup::OctreeNode* branch)
+ {
+ LLSpatialGroup* group = (LLSpatialGroup*) branch->getListener(0);
+
+ preprocess(group);
+
+ if (checkObjects(branch, group))
+ {
+ processGroup(group);
+ }
+ }
+
+ LLCamera *mCamera;
+ S32 mRes;
+};
+
+class LLOctreeCullNoFarClip : public LLOctreeCull
+{
+public:
+ LLOctreeCullNoFarClip(LLCamera* camera)
+ : LLOctreeCull(camera) { }
+
+ virtual S32 frustumCheck(const LLSpatialGroup* group)
+ {
+ return mCamera->AABBInFrustumNoFarClip(group->mBounds[0], group->mBounds[1]);
+ }
+
+ virtual S32 frustumCheckObjects(const LLSpatialGroup* group)
+ {
+ S32 res = mCamera->AABBInFrustumNoFarClip(group->mObjectBounds[0], group->mObjectBounds[1]);
+ return res;
+ }
+};
+
+class LLOctreeCullShadow : public LLOctreeCull
+{
+public:
+ LLOctreeCullShadow(LLCamera* camera)
+ : LLOctreeCull(camera) { }
+
+ virtual S32 frustumCheck(const LLSpatialGroup* group)
+ {
+ return mCamera->AABBInFrustum(group->mBounds[0], group->mBounds[1]);
+ }
+
+ virtual S32 frustumCheckObjects(const LLSpatialGroup* group)
+ {
+ return mCamera->AABBInFrustum(group->mObjectBounds[0], group->mObjectBounds[1]);
+ }
+};
+
+class LLOctreeCullVisExtents: public LLOctreeCullShadow
+{
+public:
+ LLOctreeCullVisExtents(LLCamera* camera, LLVector4a& min, LLVector4a& max)
+ : LLOctreeCullShadow(camera), mMin(min), mMax(max), mEmpty(TRUE) { }
+
+ virtual bool earlyFail(LLSpatialGroup* group)
+ {
+ if (group->mOctreeNode->getParent() && //never occlusion cull the root node
+ LLPipeline::sUseOcclusion && //ignore occlusion if disabled
+ group->isOcclusionState(LLSpatialGroup::OCCLUDED))
+ {
+ return true;
+ }
+
+ return false;
+ }
+
+ virtual void traverse(const LLSpatialGroup::OctreeNode* n)
+ {
+ LLSpatialGroup* group = (LLSpatialGroup*) n->getListener(0);
+
+ if (earlyFail(group))
+ {
+ return;
+ }
+
+ if ((mRes && group->isState(LLSpatialGroup::SKIP_FRUSTUM_CHECK)) ||
+ mRes == 2)
+ { //don't need to do frustum check
+ LLSpatialGroup::OctreeTraveler::traverse(n);
+ }
+ else
+ {
+ mRes = frustumCheck(group);
+
+ if (mRes)
+ { //at least partially in, run on down
+ LLSpatialGroup::OctreeTraveler::traverse(n);
+ }
+
+ mRes = 0;
+ }
+ }
+
+ virtual void processGroup(LLSpatialGroup* group)
+ {
+ llassert(!group->isState(LLSpatialGroup::DIRTY) && !group->getData().empty())
+
+ if (mRes < 2)
+ {
+ if (mCamera->AABBInFrustum(group->mObjectBounds[0], group->mObjectBounds[1]) > 0)
+ {
+ mEmpty = FALSE;
+ update_min_max(mMin, mMax, group->mObjectExtents[0]);
+ update_min_max(mMin, mMax, group->mObjectExtents[1]);
+ }
+ }
+ else
+ {
+ mEmpty = FALSE;
+ update_min_max(mMin, mMax, group->mExtents[0]);
+ update_min_max(mMin, mMax, group->mExtents[1]);
+ }
+ }
+
+ BOOL mEmpty;
+ LLVector4a& mMin;
+ LLVector4a& mMax;
+};
+
+class LLOctreeCullDetectVisible: public LLOctreeCullShadow
+{
+public:
+ LLOctreeCullDetectVisible(LLCamera* camera)
+ : LLOctreeCullShadow(camera), mResult(FALSE) { }
+
+ virtual bool earlyFail(LLSpatialGroup* group)
+ {
+ if (mResult || //already found a node, don't check any more
+ (group->mOctreeNode->getParent() && //never occlusion cull the root node
+ LLPipeline::sUseOcclusion && //ignore occlusion if disabled
+ group->isOcclusionState(LLSpatialGroup::OCCLUDED)))
+ {
+ return true;
+ }
+
+ return false;
+ }
+
+ virtual void processGroup(LLSpatialGroup* group)
+ {
+ if (group->isVisible())
+ {
+ mResult = TRUE;
+ }
+ }
+
+ BOOL mResult;
+};
+
+class LLOctreeSelect : public LLOctreeCull
+{
+public:
+ LLOctreeSelect(LLCamera* camera, std::vector<LLDrawable*>* results)
+ : LLOctreeCull(camera), mResults(results) { }
+
+ virtual bool earlyFail(LLSpatialGroup* group) { return false; }
+ virtual void preprocess(LLSpatialGroup* group) { }
+
+ virtual void processGroup(LLSpatialGroup* group)
+ {
+ LLSpatialGroup::OctreeNode* branch = group->mOctreeNode;
+
+ for (LLSpatialGroup::OctreeNode::const_element_iter i = branch->getData().begin(); i != branch->getData().end(); ++i)
+ {
+ LLDrawable* drawable = *i;
+
+ if (!drawable->isDead())
+ {
+ if (drawable->isSpatialBridge())
+ {
+ drawable->setVisible(*mCamera, mResults, TRUE);
+ }
+ else
+ {
+ mResults->push_back(drawable);
+ }
+ }
+ }
+ }
+
+ std::vector<LLDrawable*>* mResults;
+};
+
+void drawBox(const LLVector3& c, const LLVector3& r)
+{
+ LLVertexBuffer::unbind();
+
+ gGL.begin(LLRender::TRIANGLE_STRIP);
+ //left front
+ gGL.vertex3fv((c+r.scaledVec(LLVector3(-1,1,-1))).mV);
+ gGL.vertex3fv((c+r.scaledVec(LLVector3(-1,1,1))).mV);
+ //right front
+ gGL.vertex3fv((c+r.scaledVec(LLVector3(1,1,-1))).mV);
+ gGL.vertex3fv((c+r.scaledVec(LLVector3(1,1,1))).mV);
+ //right back
+ gGL.vertex3fv((c+r.scaledVec(LLVector3(1,-1,-1))).mV);
+ gGL.vertex3fv((c+r.scaledVec(LLVector3(1,-1,1))).mV);
+ //left back
+ gGL.vertex3fv((c+r.scaledVec(LLVector3(-1,-1,-1))).mV);
+ gGL.vertex3fv((c+r.scaledVec(LLVector3(-1,-1,1))).mV);
+ //left front
+ gGL.vertex3fv((c+r.scaledVec(LLVector3(-1,1,-1))).mV);
+ gGL.vertex3fv((c+r.scaledVec(LLVector3(-1,1,1))).mV);
+ gGL.end();
+
+ //bottom
+ gGL.begin(LLRender::TRIANGLE_STRIP);
+ gGL.vertex3fv((c+r.scaledVec(LLVector3(1,1,-1))).mV);
+ gGL.vertex3fv((c+r.scaledVec(LLVector3(1,-1,-1))).mV);
+ gGL.vertex3fv((c+r.scaledVec(LLVector3(-1,1,-1))).mV);
+ gGL.vertex3fv((c+r.scaledVec(LLVector3(-1,-1,-1))).mV);
+ gGL.end();
+
+ //top
+ gGL.begin(LLRender::TRIANGLE_STRIP);
+ gGL.vertex3fv((c+r.scaledVec(LLVector3(1,1,1))).mV);
+ gGL.vertex3fv((c+r.scaledVec(LLVector3(-1,1,1))).mV);
+ gGL.vertex3fv((c+r.scaledVec(LLVector3(1,-1,1))).mV);
+ gGL.vertex3fv((c+r.scaledVec(LLVector3(-1,-1,1))).mV);
+ gGL.end();
+}
+
+void drawBox(const LLVector4a& c, const LLVector4a& r)
+{
+ drawBox(reinterpret_cast<const LLVector3&>(c), reinterpret_cast<const LLVector3&>(r));
+}
+
+void drawBoxOutline(const LLVector3& pos, const LLVector3& size)
+{
+ LLVector3 v1 = size.scaledVec(LLVector3( 1, 1,1));
+ LLVector3 v2 = size.scaledVec(LLVector3(-1, 1,1));
+ LLVector3 v3 = size.scaledVec(LLVector3(-1,-1,1));
+ LLVector3 v4 = size.scaledVec(LLVector3( 1,-1,1));
+
+ gGL.begin(LLRender::LINES);
+
+ //top
+ gGL.vertex3fv((pos+v1).mV);
+ gGL.vertex3fv((pos+v2).mV);
+ gGL.vertex3fv((pos+v2).mV);
+ gGL.vertex3fv((pos+v3).mV);
+ gGL.vertex3fv((pos+v3).mV);
+ gGL.vertex3fv((pos+v4).mV);
+ gGL.vertex3fv((pos+v4).mV);
+ gGL.vertex3fv((pos+v1).mV);
+
+ //bottom
+ gGL.vertex3fv((pos-v1).mV);
+ gGL.vertex3fv((pos-v2).mV);
+ gGL.vertex3fv((pos-v2).mV);
+ gGL.vertex3fv((pos-v3).mV);
+ gGL.vertex3fv((pos-v3).mV);
+ gGL.vertex3fv((pos-v4).mV);
+ gGL.vertex3fv((pos-v4).mV);
+ gGL.vertex3fv((pos-v1).mV);
+
+ //right
+ gGL.vertex3fv((pos+v1).mV);
+ gGL.vertex3fv((pos-v3).mV);
+
+ gGL.vertex3fv((pos+v4).mV);
+ gGL.vertex3fv((pos-v2).mV);
+
+ //left
+ gGL.vertex3fv((pos+v2).mV);
+ gGL.vertex3fv((pos-v4).mV);
+
+ gGL.vertex3fv((pos+v3).mV);
+ gGL.vertex3fv((pos-v1).mV);
+
+ gGL.end();
+}
+
+void drawBoxOutline(const LLVector4a& pos, const LLVector4a& size)
+{
+ drawBoxOutline(reinterpret_cast<const LLVector3&>(pos), reinterpret_cast<const LLVector3&>(size));
+}
+
+class LLOctreeDirty : public LLOctreeTraveler<LLDrawable>
+{
+public:
+ virtual void visit(const LLOctreeNode<LLDrawable>* state)
+ {
+ LLSpatialGroup* group = (LLSpatialGroup*) state->getListener(0);
+ group->destroyGL();
+
+ for (LLSpatialGroup::element_iter i = group->getData().begin(); i != group->getData().end(); ++i)
+ {
+ LLDrawable* drawable = *i;
+ if (drawable->getVObj().notNull() && !group->mSpatialPartition->mRenderByGroup)
+ {
+ gPipeline.markRebuild(drawable, LLDrawable::REBUILD_ALL, TRUE);
+ }
+ }
+
+ for (LLSpatialGroup::bridge_list_t::iterator i = group->mBridgeList.begin(); i != group->mBridgeList.end(); ++i)
+ {
+ LLSpatialBridge* bridge = *i;
+ traverse(bridge->mOctree);
+ }
+ }
+};
+
+void LLSpatialPartition::restoreGL()
+{
+ LLMemType mt(LLMemType::MTYPE_SPACE_PARTITION);
+}
+
+void LLSpatialPartition::resetVertexBuffers()
+{
+ LLOctreeDirty dirty;
+ dirty.traverse(mOctree);
+}
+
+BOOL LLSpatialPartition::isOcclusionEnabled()
+{
+ return mOcclusionEnabled || LLPipeline::sUseOcclusion > 2;
+}
+
+BOOL LLSpatialPartition::getVisibleExtents(LLCamera& camera, LLVector3& visMin, LLVector3& visMax)
+{
+ LLVector4a visMina, visMaxa;
+ visMina.load3(visMin.mV);
+ visMaxa.load3(visMax.mV);
+
+ {
+ LLFastTimer ftm(FTM_CULL_REBOUND);
+ LLSpatialGroup* group = (LLSpatialGroup*) mOctree->getListener(0);
+ group->rebound();
+ }
+
+ LLOctreeCullVisExtents vis(&camera, visMina, visMaxa);
+ vis.traverse(mOctree);
+
+ visMin.set(visMina.getF32ptr());
+ visMax.set(visMaxa.getF32ptr());
+ return vis.mEmpty;
+}
+
+BOOL LLSpatialPartition::visibleObjectsInFrustum(LLCamera& camera)
+{
+ LLOctreeCullDetectVisible vis(&camera);
+ vis.traverse(mOctree);
+ return vis.mResult;
+}
+
+S32 LLSpatialPartition::cull(LLCamera &camera, std::vector<LLDrawable *>* results, BOOL for_select)
+{
+ LLMemType mt(LLMemType::MTYPE_SPACE_PARTITION);
+#if LL_OCTREE_PARANOIA_CHECK
+ ((LLSpatialGroup*)mOctree->getListener(0))->checkStates();
+#endif
+ {
+ LLFastTimer ftm(FTM_CULL_REBOUND);
+ LLSpatialGroup* group = (LLSpatialGroup*) mOctree->getListener(0);
+ group->rebound();
+ }
+
+#if LL_OCTREE_PARANOIA_CHECK
+ ((LLSpatialGroup*)mOctree->getListener(0))->validate();
+#endif
+
+
+ if (for_select)
+ {
+ LLOctreeSelect selecter(&camera, results);
+ selecter.traverse(mOctree);
+ }
+ else if (LLPipeline::sShadowRender)
+ {
+ LLFastTimer ftm(FTM_FRUSTUM_CULL);
+ LLOctreeCullShadow culler(&camera);
+ culler.traverse(mOctree);
+ }
+ else if (mInfiniteFarClip || !LLPipeline::sUseFarClip)
+ {
+ LLFastTimer ftm(FTM_FRUSTUM_CULL);
+ LLOctreeCullNoFarClip culler(&camera);
+ culler.traverse(mOctree);
+ }
+ else
+ {
+ LLFastTimer ftm(FTM_FRUSTUM_CULL);
+ LLOctreeCull culler(&camera);
+ culler.traverse(mOctree);
+ }
+
+ return 0;
+}
+
+BOOL earlyFail(LLCamera* camera, LLSpatialGroup* group)
+{
+ if (camera->getOrigin().isExactlyZero())
+ {
+ return FALSE;
+ }
+
+ const F32 vel = SG_OCCLUSION_FUDGE*2.f;
+ LLVector4a fudge;
+ fudge.splat(vel);
+
+ const LLVector4a& c = group->mBounds[0];
+ LLVector4a r;
+ r.setAdd(group->mBounds[1], fudge);
+
+ /*if (r.magVecSquared() > 1024.0*1024.0)
+ {
+ return TRUE;
+ }*/
+
+ LLVector4a e;
+ e.load3(camera->getOrigin().mV);
+
+ LLVector4a min;
+ min.setSub(c,r);
+ LLVector4a max;
+ max.setAdd(c,r);
+
+ S32 lt = e.lessThan(min).getGatheredBits() & 0x7;
+ if (lt)
+ {
+ return FALSE;
+ }
+
+ S32 gt = e.greaterThan(max).getGatheredBits() & 0x7;
+ if (gt)
+ {
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+
+void pushVerts(LLDrawInfo* params, U32 mask)
+{
+ LLRenderPass::applyModelMatrix(*params);
+ params->mVertexBuffer->setBuffer(mask);
+ params->mVertexBuffer->drawRange(params->mParticle ? LLRender::POINTS : LLRender::TRIANGLES,
+ params->mStart, params->mEnd, params->mCount, params->mOffset);
+}
+
+void pushVerts(LLSpatialGroup* group, U32 mask)
+{
+ LLDrawInfo* params = NULL;
+
+ for (LLSpatialGroup::draw_map_t::iterator i = group->mDrawMap.begin(); i != group->mDrawMap.end(); ++i)
+ {
+ for (LLSpatialGroup::drawmap_elem_t::iterator j = i->second.begin(); j != i->second.end(); ++j)
+ {
+ params = *j;
+ pushVerts(params, mask);
+ }
+ }
+}
+
+void pushVerts(LLFace* face, U32 mask)
+{
+ llassert(face->verify());
+
+ LLVertexBuffer* buffer = face->getVertexBuffer();
+
+ if (buffer && (face->getGeomCount() >= 3))
+ {
+ buffer->setBuffer(mask);
+ U16 start = face->getGeomStart();
+ U16 end = start + face->getGeomCount()-1;
+ U32 count = face->getIndicesCount();
+ U16 offset = face->getIndicesStart();
+ buffer->drawRange(LLRender::TRIANGLES, start, end, count, offset);
+ }
+}
+
+void pushVerts(LLDrawable* drawable, U32 mask)
+{
+ for (S32 i = 0; i < drawable->getNumFaces(); ++i)
+ {
+ pushVerts(drawable->getFace(i), mask);
+ }
+}
+
+void pushVerts(LLVolume* volume)
+{
+ LLVertexBuffer::unbind();
+ for (S32 i = 0; i < volume->getNumVolumeFaces(); ++i)
+ {
+ const LLVolumeFace& face = volume->getVolumeFace(i);
+ LLVertexBuffer::drawElements(LLRender::TRIANGLES, face.mPositions, NULL, face.mNumIndices, face.mIndices);
+ }
+}
+
+void pushBufferVerts(LLVertexBuffer* buffer, U32 mask)
+{
+ if (buffer)
+ {
+ buffer->setBuffer(mask);
+ buffer->drawRange(LLRender::TRIANGLES, 0, buffer->getNumVerts()-1, buffer->getNumIndices(), 0);
+ }
+}
+
+void pushBufferVerts(LLSpatialGroup* group, U32 mask)
+{
+ if (group->mSpatialPartition->mRenderByGroup)
+ {
+ if (!group->mDrawMap.empty())
+ {
+ LLDrawInfo* params = *(group->mDrawMap.begin()->second.begin());
+ LLRenderPass::applyModelMatrix(*params);
+
+ pushBufferVerts(group->mVertexBuffer, mask);
+
+ for (LLSpatialGroup::buffer_map_t::iterator i = group->mBufferMap.begin(); i != group->mBufferMap.end(); ++i)
+ {
+ for (LLSpatialGroup::buffer_texture_map_t::iterator j = i->second.begin(); j != i->second.end(); ++j)
+ {
+ for (LLSpatialGroup::buffer_list_t::iterator k = j->second.begin(); k != j->second.end(); ++k)
+ {
+ pushBufferVerts(*k, mask);
+ }
+ }
+ }
+ }
+ }
+ else
+ {
+ drawBox(group->mBounds[0], group->mBounds[1]);
+ }
+}
+
+void pushVertsColorCoded(LLSpatialGroup* group, U32 mask)
+{
+ LLDrawInfo* params = NULL;
+
+ LLColor4 colors[] = {
+ LLColor4::green,
+ LLColor4::green1,
+ LLColor4::green2,
+ LLColor4::green3,
+ LLColor4::green4,
+ LLColor4::green5,
+ LLColor4::green6
+ };
+
+ static const U32 col_count = LL_ARRAY_SIZE(colors);
+
+ U32 col = 0;
+
+ for (LLSpatialGroup::draw_map_t::iterator i = group->mDrawMap.begin(); i != group->mDrawMap.end(); ++i)
+ {
+ for (LLSpatialGroup::drawmap_elem_t::iterator j = i->second.begin(); j != i->second.end(); ++j)
+ {
+ params = *j;
+ LLRenderPass::applyModelMatrix(*params);
+ gGL.diffuseColor4f(colors[col].mV[0], colors[col].mV[1], colors[col].mV[2], 0.5f);
+ params->mVertexBuffer->setBuffer(mask);
+ params->mVertexBuffer->drawRange(params->mParticle ? LLRender::POINTS : LLRender::TRIANGLES,
+ params->mStart, params->mEnd, params->mCount, params->mOffset);
+ col = (col+1)%col_count;
+ }
+ }
+}
+
+void renderOctree(LLSpatialGroup* group)
+{
+ //render solid object bounding box, color
+ //coded by buffer usage and activity
+ gGL.setSceneBlendType(LLRender::BT_ADD_WITH_ALPHA);
+ LLVector4 col;
+ if (group->mBuilt > 0.f)
+ {
+ group->mBuilt -= 2.f * gFrameIntervalSeconds;
+ if (group->mBufferUsage == GL_STATIC_DRAW_ARB)
+ {
+ col.setVec(1.0f, 0, 0, group->mBuilt*0.5f);
+ }
+ else
+ {
+ col.setVec(0.1f,0.1f,1,0.1f);
+ //col.setVec(1.0f, 1.0f, 0, sinf(group->mBuilt*3.14159f)*0.5f);
+ }
+
+ if (group->mBufferUsage != GL_STATIC_DRAW_ARB)
+ {
+ LLGLDepthTest gl_depth(FALSE, FALSE);
+ glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
+
+ gGL.diffuseColor4f(1,0,0,group->mBuilt);
+ gGL.flush();
+ glLineWidth(5.f);
+ drawBoxOutline(group->mObjectBounds[0], group->mObjectBounds[1]);
+ gGL.flush();
+ glLineWidth(1.f);
+ gGL.flush();
+ for (LLSpatialGroup::element_iter i = group->getData().begin(); i != group->getData().end(); ++i)
+ {
+ LLDrawable* drawable = *i;
+ if (!group->mSpatialPartition->isBridge())
+ {
+ gGL.pushMatrix();
+ LLVector3 trans = drawable->getRegion()->getOriginAgent();
+ gGL.translatef(trans.mV[0], trans.mV[1], trans.mV[2]);
+ }
+
+ for (S32 j = 0; j < drawable->getNumFaces(); j++)
+ {
+ LLFace* face = drawable->getFace(j);
+ if (face->getVertexBuffer())
+ {
+ if (gFrameTimeSeconds - face->mLastUpdateTime < 0.5f)
+ {
+ gGL.diffuseColor4f(0, 1, 0, group->mBuilt);
+ }
+ else if (gFrameTimeSeconds - face->mLastMoveTime < 0.5f)
+ {
+ gGL.diffuseColor4f(1, 0, 0, group->mBuilt);
+ }
+ else
+ {
+ continue;
+ }
+
+ face->getVertexBuffer()->setBuffer(LLVertexBuffer::MAP_VERTEX);
+ //drawBox((face->mExtents[0] + face->mExtents[1])*0.5f,
+ // (face->mExtents[1]-face->mExtents[0])*0.5f);
+ face->getVertexBuffer()->draw(LLRender::TRIANGLES, face->getIndicesCount(), face->getIndicesStart());
+ }
+ }
+
+ if (!group->mSpatialPartition->isBridge())
+ {
+ gGL.popMatrix();
+ }
+ }
+ glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
+ gGL.diffuseColor4f(1,1,1,1);
+ }
+ }
+ else
+ {
+ if (group->mBufferUsage == GL_STATIC_DRAW_ARB && !group->getData().empty()
+ && group->mSpatialPartition->mRenderByGroup)
+ {
+ col.setVec(0.8f, 0.4f, 0.1f, 0.1f);
+ }
+ else
+ {
+ col.setVec(0.1f, 0.1f, 1.f, 0.1f);
+ }
+ }
+
+ gGL.diffuseColor4fv(col.mV);
+ LLVector4a fudge;
+ fudge.splat(0.001f);
+ LLVector4a size = group->mObjectBounds[1];
+ size.mul(1.01f);
+ size.add(fudge);
+
+ //{
+ // LLGLDepthTest depth(GL_TRUE, GL_FALSE);
+ // drawBox(group->mObjectBounds[0], fudge);
+ //}
+
+ gGL.setSceneBlendType(LLRender::BT_ALPHA);
+
+ //if (group->mBuilt <= 0.f)
+ {
+ //draw opaque outline
+ //gGL.diffuseColor4f(col.mV[0], col.mV[1], col.mV[2], 1.f);
+ //drawBoxOutline(group->mObjectBounds[0], group->mObjectBounds[1]);
+
+ gGL.diffuseColor4f(0,1,1,1);
+ drawBoxOutline(group->mBounds[0],group->mBounds[1]);
+
+ //draw bounding box for draw info
+ /*if (group->mSpatialPartition->mRenderByGroup)
+ {
+ gGL.diffuseColor4f(1.0f, 0.75f, 0.25f, 0.6f);
+ for (LLSpatialGroup::draw_map_t::iterator i = group->mDrawMap.begin(); i != group->mDrawMap.end(); ++i)
+ {
+ for (LLSpatialGroup::drawmap_elem_t::iterator j = i->second.begin(); j != i->second.end(); ++j)
+ {
+ LLDrawInfo* draw_info = *j;
+ LLVector4a center;
+ center.setAdd(draw_info->mExtents[1], draw_info->mExtents[0]);
+ center.mul(0.5f);
+ LLVector4a size;
+ size.setSub(draw_info->mExtents[1], draw_info->mExtents[0]);
+ size.mul(0.5f);
+ drawBoxOutline(center, size);
+ }
+ }
+ }*/
+ }
+
+// LLSpatialGroup::OctreeNode* node = group->mOctreeNode;
+// gGL.diffuseColor4f(0,1,0,1);
+// drawBoxOutline(LLVector3(node->getCenter()), LLVector3(node->getSize()));
+}
+
+void renderVisibility(LLSpatialGroup* group, LLCamera* camera)
+{
+ LLGLEnable blend(GL_BLEND);
+ gGL.setSceneBlendType(LLRender::BT_ALPHA);
+ LLGLEnable cull(GL_CULL_FACE);
+ glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
+
+ BOOL render_objects = (!LLPipeline::sUseOcclusion || !group->isOcclusionState(LLSpatialGroup::OCCLUDED)) && group->isVisible() &&
+ !group->getData().empty();
+
+ if (render_objects)
+ {
+ LLGLDepthTest depth_under(GL_TRUE, GL_FALSE, GL_GREATER);
+ gGL.diffuseColor4f(0, 0.5f, 0, 0.5f);
+ gGL.diffuseColor4f(0, 0.5f, 0, 0.5f);
+ pushBufferVerts(group, LLVertexBuffer::MAP_VERTEX);
+ }
+
+ {
+ LLGLDepthTest depth_over(GL_TRUE, GL_FALSE, GL_LEQUAL);
+
+ if (render_objects)
+ {
+ gGL.diffuseColor4f(0.f, 0.5f, 0.f,1.f);
+ gGL.diffuseColor4f(0.f, 0.5f, 0.f, 1.f);
+ pushBufferVerts(group, LLVertexBuffer::MAP_VERTEX);
+ }
+
+ glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
+
+ if (render_objects)
+ {
+ gGL.diffuseColor4f(0.f, 0.75f, 0.f,0.5f);
+ gGL.diffuseColor4f(0.f, 0.75f, 0.f, 0.5f);
+ pushBufferVerts(group, LLVertexBuffer::MAP_VERTEX);
+ }
+ /*else if (camera && group->mOcclusionVerts.notNull())
+ {
+ LLVertexBuffer::unbind();
+ group->mOcclusionVerts->setBuffer(LLVertexBuffer::MAP_VERTEX);
+
+ gGL.diffuseColor4f(1.0f, 0.f, 0.f, 0.5f);
+ group->mOcclusionVerts->drawRange(LLRender::TRIANGLE_FAN, 0, 7, 8, get_box_fan_indices(camera, group->mBounds[0]));
+ glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
+
+ gGL.diffuseColor4f(1.0f, 1.f, 1.f, 1.0f);
+ group->mOcclusionVerts->drawRange(LLRender::TRIANGLE_FAN, 0, 7, 8, get_box_fan_indices(camera, group->mBounds[0]));
+ glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
+ }*/
+ }
+}
+
+void renderCrossHairs(LLVector3 position, F32 size, LLColor4 color)
+{
+ gGL.diffuseColor4fv(color.mV);
+ gGL.begin(LLRender::LINES);
+ {
+ gGL.vertex3fv((position - LLVector3(size, 0.f, 0.f)).mV);
+ gGL.vertex3fv((position + LLVector3(size, 0.f, 0.f)).mV);
+ gGL.vertex3fv((position - LLVector3(0.f, size, 0.f)).mV);
+ gGL.vertex3fv((position + LLVector3(0.f, size, 0.f)).mV);
+ gGL.vertex3fv((position - LLVector3(0.f, 0.f, size)).mV);
+ gGL.vertex3fv((position + LLVector3(0.f, 0.f, size)).mV);
+ }
+ gGL.end();
+}
+
+void renderUpdateType(LLDrawable* drawablep)
+{
+ LLViewerObject* vobj = drawablep->getVObj();
+ if (!vobj || OUT_UNKNOWN == vobj->getLastUpdateType())
+ {
+ return;
+ }
+ LLGLEnable blend(GL_BLEND);
+ switch (vobj->getLastUpdateType())
+ {
+ case OUT_FULL:
+ gGL.diffuseColor4f(0,1,0,0.5f);
+ break;
+ case OUT_TERSE_IMPROVED:
+ gGL.diffuseColor4f(0,1,1,0.5f);
+ break;
+ case OUT_FULL_COMPRESSED:
+ if (vobj->getLastUpdateCached())
+ {
+ gGL.diffuseColor4f(1,0,0,0.5f);
+ }
+ else
+ {
+ gGL.diffuseColor4f(1,1,0,0.5f);
+ }
+ break;
+ case OUT_FULL_CACHED:
+ gGL.diffuseColor4f(0,0,1,0.5f);
+ break;
+ default:
+ llwarns << "Unknown update_type " << vobj->getLastUpdateType() << llendl;
+ break;
+ };
+ S32 num_faces = drawablep->getNumFaces();
+ if (num_faces)
+ {
+ for (S32 i = 0; i < num_faces; ++i)
+ {
+ pushVerts(drawablep->getFace(i), LLVertexBuffer::MAP_VERTEX);
+ }
+ }
+}
+
+void renderComplexityDisplay(LLDrawable* drawablep)
+{
+ LLViewerObject* vobj = drawablep->getVObj();
+ if (!vobj)
+ {
+ return;
+ }
+
+ LLVOVolume *voVol = dynamic_cast<LLVOVolume*>(vobj);
+
+ if (!voVol)
+ {
+ return;
+ }
+
+ if (!voVol->isRoot())
+ {
+ return;
+ }
+
+ LLVOVolume::texture_cost_t textures;
+ F32 cost = (F32) voVol->getRenderCost(textures);
+
+ // add any child volumes
+ LLViewerObject::const_child_list_t children = voVol->getChildren();
+ for (LLViewerObject::const_child_list_t::const_iterator iter = children.begin(); iter != children.end(); ++iter)
+ {
+ const LLViewerObject *child = *iter;
+ const LLVOVolume *child_volume = dynamic_cast<const LLVOVolume*>(child);
+ if (child_volume)
+ {
+ cost += child_volume->getRenderCost(textures);
+ }
+ }
+
+ // add texture cost
+ for (LLVOVolume::texture_cost_t::iterator iter = textures.begin(); iter != textures.end(); ++iter)
+ {
+ // add the cost of each individual texture in the linkset
+ cost += iter->second;
+ }
+
+ F32 cost_max = (F32) LLVOVolume::getRenderComplexityMax();
+
+
+
+ // allow user to set a static color scale
+ if (gSavedSettings.getS32("RenderComplexityStaticMax") > 0)
+ {
+ cost_max = gSavedSettings.getS32("RenderComplexityStaticMax");
+ }
+
+ F32 cost_ratio = cost / cost_max;
+
+ // cap cost ratio at 1.0f in case cost_max is at a low threshold
+ cost_ratio = cost_ratio > 1.0f ? 1.0f : cost_ratio;
+
+ LLGLEnable blend(GL_BLEND);
+
+ LLColor4 color;
+ const LLColor4 color_min = gSavedSettings.getColor4("RenderComplexityColorMin");
+ const LLColor4 color_mid = gSavedSettings.getColor4("RenderComplexityColorMid");
+ const LLColor4 color_max = gSavedSettings.getColor4("RenderComplexityColorMax");
+
+ if (cost_ratio < 0.5f)
+ {
+ color = color_min * (1 - cost_ratio * 2) + color_mid * (cost_ratio * 2);
+ }
+ else
+ {
+ color = color_mid * (1 - (cost_ratio - 0.5) * 2) + color_max * ((cost_ratio - 0.5) * 2);
+ }
+
+ LLSD color_val = color.getValue();
+
+ // don't highlight objects below the threshold
+ if (cost > gSavedSettings.getS32("RenderComplexityThreshold"))
+ {
+ glColor4f(color[0],color[1],color[2],0.5f);
+
+
+ S32 num_faces = drawablep->getNumFaces();
+ if (num_faces)
+ {
+ for (S32 i = 0; i < num_faces; ++i)
+ {
+ pushVerts(drawablep->getFace(i), LLVertexBuffer::MAP_VERTEX);
+ }
+ }
+ LLViewerObject::const_child_list_t children = voVol->getChildren();
+ for (LLViewerObject::const_child_list_t::const_iterator iter = children.begin(); iter != children.end(); ++iter)
+ {
+ const LLViewerObject *child = *iter;
+ if (child)
+ {
+ num_faces = child->getNumFaces();
+ if (num_faces)
+ {
+ for (S32 i = 0; i < num_faces; ++i)
+ {
+ pushVerts(child->mDrawable->getFace(i), LLVertexBuffer::MAP_VERTEX);
+ }
+ }
+ }
+ }
+ }
+
+ voVol->setDebugText(llformat("%4.0f", cost));
+}
+
+void renderBoundingBox(LLDrawable* drawable, BOOL set_color = TRUE)
+{
+ if (set_color)
+ {
+ if (drawable->isSpatialBridge())
+ {
+ gGL.diffuseColor4f(1,0.5f,0,1);
+ }
+ else if (drawable->getVOVolume())
+ {
+ if (drawable->isRoot())
+ {
+ gGL.diffuseColor4f(1,1,0,1);
+ }
+ else
+ {
+ gGL.diffuseColor4f(0,1,0,1);
+ }
+ }
+ else if (drawable->getVObj())
+ {
+ switch (drawable->getVObj()->getPCode())
+ {
+ case LLViewerObject::LL_VO_SURFACE_PATCH:
+ gGL.diffuseColor4f(0,1,1,1);
+ break;
+ case LLViewerObject::LL_VO_CLOUDS:
+ // no longer used
+ break;
+ case LLViewerObject::LL_VO_PART_GROUP:
+ case LLViewerObject::LL_VO_HUD_PART_GROUP:
+ gGL.diffuseColor4f(0,0,1,1);
+ break;
+ case LLViewerObject::LL_VO_VOID_WATER:
+ case LLViewerObject::LL_VO_WATER:
+ gGL.diffuseColor4f(0,0.5f,1,1);
+ break;
+ case LL_PCODE_LEGACY_TREE:
+ gGL.diffuseColor4f(0,0.5f,0,1);
+ break;
+ default:
+ gGL.diffuseColor4f(1,0,1,1);
+ break;
+ }
+ }
+ else
+ {
+ gGL.diffuseColor4f(1,0,0,1);
+ }
+ }
+
+ const LLVector4a* ext;
+ LLVector4a pos, size;
+
+ //render face bounding boxes
+ for (S32 i = 0; i < drawable->getNumFaces(); i++)
+ {
+ LLFace* facep = drawable->getFace(i);
+
+ ext = facep->mExtents;
+
+ pos.setAdd(ext[0], ext[1]);
+ pos.mul(0.5f);
+ size.setSub(ext[1], ext[0]);
+ size.mul(0.5f);
+
+ drawBoxOutline(pos,size);
+ }
+
+ //render drawable bounding box
+ ext = drawable->getSpatialExtents();
+
+ pos.setAdd(ext[0], ext[1]);
+ pos.mul(0.5f);
+ size.setSub(ext[1], ext[0]);
+ size.mul(0.5f);
+
+ LLViewerObject* vobj = drawable->getVObj();
+ if (vobj && vobj->onActiveList())
+ {
+ gGL.flush();
+ glLineWidth(llmax(4.f*sinf(gFrameTimeSeconds*2.f)+1.f, 1.f));
+ //glLineWidth(4.f*(sinf(gFrameTimeSeconds*2.f)*0.25f+0.75f));
+ stop_glerror();
+ drawBoxOutline(pos,size);
+ gGL.flush();
+ glLineWidth(1.f);
+ }
+ else
+ {
+ drawBoxOutline(pos,size);
+ }
+}
+
+void renderNormals(LLDrawable* drawablep)
+{
+ LLVertexBuffer::unbind();
+
+ LLVOVolume* vol = drawablep->getVOVolume();
+ if (vol)
+ {
+ LLVolume* volume = vol->getVolume();
+ gGL.pushMatrix();
+ gGL.multMatrix((F32*) vol->getRelativeXform().mMatrix);
+
+ gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
+
+ LLVector4a scale(gSavedSettings.getF32("RenderDebugNormalScale"));
+
+ for (S32 i = 0; i < volume->getNumVolumeFaces(); ++i)
+ {
+ const LLVolumeFace& face = volume->getVolumeFace(i);
+
+ for (S32 j = 0; j < face.mNumVertices; ++j)
+ {
+ gGL.begin(LLRender::LINES);
+ LLVector4a n,p;
+
+ n.setMul(face.mNormals[j], scale);
+ p.setAdd(face.mPositions[j], n);
+
+ gGL.diffuseColor4f(1,1,1,1);
+ gGL.vertex3fv(face.mPositions[j].getF32ptr());
+ gGL.vertex3fv(p.getF32ptr());
+
+ if (face.mBinormals)
+ {
+ n.setMul(face.mBinormals[j], scale);
+ p.setAdd(face.mPositions[j], n);
+
+ gGL.diffuseColor4f(0,1,1,1);
+ gGL.vertex3fv(face.mPositions[j].getF32ptr());
+ gGL.vertex3fv(p.getF32ptr());
+ }
+ gGL.end();
+ }
+ }
+
+ gGL.popMatrix();
+ }
+}
+
+S32 get_physics_detail(const LLVolumeParams& volume_params, const LLVector3& scale)
+{
+ const S32 DEFAULT_DETAIL = 1;
+ const F32 LARGE_THRESHOLD = 5.f;
+ const F32 MEGA_THRESHOLD = 25.f;
+
+ S32 detail = DEFAULT_DETAIL;
+ F32 avg_scale = (scale[0]+scale[1]+scale[2])/3.f;
+
+ if (avg_scale > LARGE_THRESHOLD)
+ {
+ detail += 1;
+ if (avg_scale > MEGA_THRESHOLD)
+ {
+ detail += 1;
+ }
+ }
+
+ return detail;
+}
+
+void renderMeshBaseHull(LLVOVolume* volume, U32 data_mask, LLColor4& color, LLColor4& line_color)
+{
+ LLUUID mesh_id = volume->getVolume()->getParams().getSculptID();
+ LLModel::Decomposition* decomp = gMeshRepo.getDecomposition(mesh_id);
+
+ const LLVector3 center(0,0,0);
+ const LLVector3 size(0.25f,0.25f,0.25f);
+
+ if (decomp)
+ {
+ if (!decomp->mBaseHullMesh.empty())
+ {
+ gGL.diffuseColor4fv(color.mV);
+ LLVertexBuffer::drawArrays(LLRender::TRIANGLES, decomp->mBaseHullMesh.mPositions, decomp->mBaseHullMesh.mNormals);
+ }
+ else
+ {
+ gMeshRepo.buildPhysicsMesh(*decomp);
+ gGL.diffuseColor4f(0,1,1,1);
+ drawBoxOutline(center, size);
+ }
+
+ }
+ else
+ {
+ gGL.diffuseColor3f(1,0,1);
+ drawBoxOutline(center, size);
+ }
+}
+
+void render_hull(LLModel::PhysicsMesh& mesh, const LLColor4& color, const LLColor4& line_color)
+{
+ gGL.diffuseColor4fv(color.mV);
+ LLVertexBuffer::drawArrays(LLRender::TRIANGLES, mesh.mPositions, mesh.mNormals);
+ LLGLEnable offset(GL_POLYGON_OFFSET_LINE);
+ glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
+ glPolygonOffset(3.f, 3.f);
+ glLineWidth(3.f);
+ gGL.diffuseColor4fv(line_color.mV);
+ LLVertexBuffer::drawArrays(LLRender::TRIANGLES, mesh.mPositions, mesh.mNormals);
+ glLineWidth(1.f);
+ glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
+}
+
+void renderPhysicsShape(LLDrawable* drawable, LLVOVolume* volume)
+{
+ U8 physics_type = volume->getPhysicsShapeType();
+
+ if (physics_type == LLViewerObject::PHYSICS_SHAPE_NONE || volume->isFlexible())
+ {
+ return;
+ }
+
+ //not allowed to return at this point without rendering *something*
+
+ F32 threshold = gSavedSettings.getF32("ObjectCostHighThreshold");
+ F32 cost = volume->getObjectCost();
+
+ LLColor4 low = gSavedSettings.getColor4("ObjectCostLowColor");
+ LLColor4 mid = gSavedSettings.getColor4("ObjectCostMidColor");
+ LLColor4 high = gSavedSettings.getColor4("ObjectCostHighColor");
+
+ F32 normalizedCost = 1.f - exp( -(cost / threshold) );
+
+ LLColor4 color;
+ if ( normalizedCost <= 0.5f )
+ {
+ color = lerp( low, mid, 2.f * normalizedCost );
+ }
+ else
+ {
+ color = lerp( mid, high, 2.f * ( normalizedCost - 0.5f ) );
+ }
+
+ LLColor4 line_color = color*0.5f;
+
+ U32 data_mask = LLVertexBuffer::MAP_VERTEX;
+
+ LLVolumeParams volume_params = volume->getVolume()->getParams();
+
+ LLPhysicsVolumeParams physics_params(volume_params,
+ physics_type == LLViewerObject::PHYSICS_SHAPE_CONVEX_HULL);
+
+ LLPhysicsShapeBuilderUtil::PhysicsShapeSpecification physics_spec;
+ LLPhysicsShapeBuilderUtil::determinePhysicsShape(physics_params, volume->getScale(), physics_spec);
+
+ U32 type = physics_spec.getType();
+
+ LLVector3 center(0,0,0);
+ LLVector3 size(0.25f,0.25f,0.25f);
+
+ gGL.pushMatrix();
+ gGL.multMatrix((F32*) volume->getRelativeXform().mMatrix);
+
+ if (type == LLPhysicsShapeBuilderUtil::PhysicsShapeSpecification::USER_MESH)
+ {
+ LLUUID mesh_id = volume->getVolume()->getParams().getSculptID();
+ LLModel::Decomposition* decomp = gMeshRepo.getDecomposition(mesh_id);
+
+ if (decomp)
+ { //render a physics based mesh
+
+ gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
+
+ if (!decomp->mHull.empty())
+ { //decomposition exists, use that
+
+ if (decomp->mMesh.empty())
+ {
+ gMeshRepo.buildPhysicsMesh(*decomp);
+ }
+
+ for (U32 i = 0; i < decomp->mMesh.size(); ++i)
+ {
+ render_hull(decomp->mMesh[i], color, line_color);
+ }
+ }
+ else if (!decomp->mPhysicsShapeMesh.empty())
+ {
+ //decomp has physics mesh, render that mesh
+ gGL.diffuseColor4fv(color.mV);
+ LLVertexBuffer::drawArrays(LLRender::TRIANGLES, decomp->mPhysicsShapeMesh.mPositions, decomp->mPhysicsShapeMesh.mNormals);
+
+ glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
+ gGL.diffuseColor4fv(line_color.mV);
+ LLVertexBuffer::drawArrays(LLRender::TRIANGLES, decomp->mPhysicsShapeMesh.mPositions, decomp->mPhysicsShapeMesh.mNormals);
+ glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
+ }
+ else
+ { //no mesh or decomposition, render base hull
+ renderMeshBaseHull(volume, data_mask, color, line_color);
+
+ if (decomp->mPhysicsShapeMesh.empty())
+ {
+ //attempt to fetch physics shape mesh if available
+ gMeshRepo.fetchPhysicsShape(mesh_id);
+ }
+ }
+ }
+ else
+ {
+ gGL.diffuseColor3f(1,1,0);
+ drawBoxOutline(center, size);
+ }
+ }
+ else if (type == LLPhysicsShapeBuilderUtil::PhysicsShapeSpecification::USER_CONVEX ||
+ type == LLPhysicsShapeBuilderUtil::PhysicsShapeSpecification::PRIM_CONVEX)
+ {
+ if (volume->isMesh())
+ {
+ renderMeshBaseHull(volume, data_mask, color, line_color);
+ }
+ else
+ {
+ LLVolumeParams volume_params = volume->getVolume()->getParams();
+ S32 detail = get_physics_detail(volume_params, volume->getScale());
+ LLVolume* phys_volume = LLPrimitive::sVolumeManager->refVolume(volume_params, detail);
+
+ if (!phys_volume->mHullPoints)
+ { //build convex hull
+ std::vector<LLVector3> pos;
+ std::vector<U16> index;
+
+ S32 index_offset = 0;
+
+ for (S32 i = 0; i < phys_volume->getNumVolumeFaces(); ++i)
+ {
+ const LLVolumeFace& face = phys_volume->getVolumeFace(i);
+ if (index_offset + face.mNumVertices > 65535)
+ {
+ continue;
+ }
+
+ for (S32 j = 0; j < face.mNumVertices; ++j)
+ {
+ pos.push_back(LLVector3(face.mPositions[j].getF32ptr()));
+ }
+
+ for (S32 j = 0; j < face.mNumIndices; ++j)
+ {
+ index.push_back(face.mIndices[j]+index_offset);
+ }
+
+ index_offset += face.mNumVertices;
+ }
+
+ if (!pos.empty() && !index.empty())
+ {
+ LLCDMeshData mesh;
+ mesh.mIndexBase = &index[0];
+ mesh.mVertexBase = pos[0].mV;
+ mesh.mNumVertices = pos.size();
+ mesh.mVertexStrideBytes = 12;
+ mesh.mIndexStrideBytes = 6;
+ mesh.mIndexType = LLCDMeshData::INT_16;
+
+ mesh.mNumTriangles = index.size()/3;
+
+ LLCDMeshData res;
+
+ LLConvexDecomposition::getInstance()->generateSingleHullMeshFromMesh( &mesh, &res );
+
+ //copy res into phys_volume
+ phys_volume->mHullPoints = (LLVector4a*) ll_aligned_malloc_16(sizeof(LLVector4a)*res.mNumVertices);
+ phys_volume->mNumHullPoints = res.mNumVertices;
+
+ S32 idx_size = (res.mNumTriangles*3*2+0xF) & ~0xF;
+ phys_volume->mHullIndices = (U16*) ll_aligned_malloc_16(idx_size);
+ phys_volume->mNumHullIndices = res.mNumTriangles*3;
+
+ const F32* v = res.mVertexBase;
+
+ for (S32 i = 0; i < res.mNumVertices; ++i)
+ {
+ F32* p = (F32*) ((U8*)v+i*res.mVertexStrideBytes);
+ phys_volume->mHullPoints[i].load3(p);
+ }
+
+ if (res.mIndexType == LLCDMeshData::INT_16)
+ {
+ for (S32 i = 0; i < res.mNumTriangles; ++i)
+ {
+ U16* idx = (U16*) (((U8*)res.mIndexBase)+i*res.mIndexStrideBytes);
+
+ phys_volume->mHullIndices[i*3+0] = idx[0];
+ phys_volume->mHullIndices[i*3+1] = idx[1];
+ phys_volume->mHullIndices[i*3+2] = idx[2];
+ }
+ }
+ else
+ {
+ for (S32 i = 0; i < res.mNumTriangles; ++i)
+ {
+ U32* idx = (U32*) (((U8*)res.mIndexBase)+i*res.mIndexStrideBytes);
+
+ phys_volume->mHullIndices[i*3+0] = (U16) idx[0];
+ phys_volume->mHullIndices[i*3+1] = (U16) idx[1];
+ phys_volume->mHullIndices[i*3+2] = (U16) idx[2];
+ }
+ }
+ }
+ }
+
+ if (phys_volume->mHullPoints)
+ {
+ //render hull
+
+ glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
+
+ gGL.diffuseColor4fv(line_color.mV);
+ LLVertexBuffer::unbind();
+
+ llassert(!LLGLSLShader::sNoFixedFunction || LLGLSLShader::sCurBoundShader != 0);
+
+ LLVertexBuffer::drawElements(LLRender::TRIANGLES, phys_volume->mHullPoints, NULL, phys_volume->mNumHullIndices, phys_volume->mHullIndices);
+
+ gGL.diffuseColor4fv(color.mV);
+ glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
+ LLVertexBuffer::drawElements(LLRender::TRIANGLES, phys_volume->mHullPoints, NULL, phys_volume->mNumHullIndices, phys_volume->mHullIndices);
+
+ }
+ else
+ {
+ gGL.diffuseColor4f(1,0,1,1);
+ drawBoxOutline(center, size);
+ }
+
+ LLPrimitive::sVolumeManager->unrefVolume(phys_volume);
+ }
+ }
+ else if (type == LLPhysicsShapeBuilderUtil::PhysicsShapeSpecification::BOX)
+ {
+ LLVector3 center = physics_spec.getCenter();
+ LLVector3 scale = physics_spec.getScale();
+ LLVector3 vscale = volume->getScale()*2.f;
+ scale.set(scale[0]/vscale[0], scale[1]/vscale[1], scale[2]/vscale[2]);
+
+ gGL.diffuseColor4fv(color.mV);
+ drawBox(center, scale);
+ }
+ else if (type == LLPhysicsShapeBuilderUtil::PhysicsShapeSpecification::SPHERE)
+ {
+ /*LLVolumeParams volume_params;
+ volume_params.setType( LL_PCODE_PROFILE_CIRCLE_HALF, LL_PCODE_PATH_CIRCLE );
+ volume_params.setBeginAndEndS( 0.f, 1.f );
+ volume_params.setBeginAndEndT( 0.f, 1.f );
+ volume_params.setRatio ( 1, 1 );
+ volume_params.setShear ( 0, 0 );
+ LLVolume* sphere = LLPrimitive::sVolumeManager->refVolume(volume_params, 3);
+
+ gGL.diffuseColor4fv(color.mV);
+ pushVerts(sphere);
+ LLPrimitive::sVolumeManager->unrefVolume(sphere);*/
+ }
+ else if (type == LLPhysicsShapeBuilderUtil::PhysicsShapeSpecification::CYLINDER)
+ {
+ LLVolumeParams volume_params;
+ volume_params.setType( LL_PCODE_PROFILE_CIRCLE, LL_PCODE_PATH_LINE );
+ volume_params.setBeginAndEndS( 0.f, 1.f );
+ volume_params.setBeginAndEndT( 0.f, 1.f );
+ volume_params.setRatio ( 1, 1 );
+ volume_params.setShear ( 0, 0 );
+ LLVolume* cylinder = LLPrimitive::sVolumeManager->refVolume(volume_params, 3);
+
+ gGL.diffuseColor4fv(color.mV);
+ pushVerts(cylinder);
+ LLPrimitive::sVolumeManager->unrefVolume(cylinder);
+ }
+ else if (type == LLPhysicsShapeBuilderUtil::PhysicsShapeSpecification::PRIM_MESH)
+ {
+ LLVolumeParams volume_params = volume->getVolume()->getParams();
+ S32 detail = get_physics_detail(volume_params, volume->getScale());
+
+ LLVolume* phys_volume = LLPrimitive::sVolumeManager->refVolume(volume_params, detail);
+ glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
+
+ gGL.diffuseColor4fv(line_color.mV);
+ pushVerts(phys_volume);
+
+ gGL.diffuseColor4fv(color.mV);
+ glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
+ pushVerts(phys_volume);
+ LLPrimitive::sVolumeManager->unrefVolume(phys_volume);
+ }
+ else if (type == LLPhysicsShapeBuilderUtil::PhysicsShapeSpecification::PRIM_CONVEX)
+ {
+ LLVolumeParams volume_params = volume->getVolume()->getParams();
+ S32 detail = get_physics_detail(volume_params, volume->getScale());
+
+ LLVolume* phys_volume = LLPrimitive::sVolumeManager->refVolume(volume_params, detail);
+
+ if (phys_volume->mHullPoints && phys_volume->mHullIndices)
+ {
+ glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
+ llassert(!LLGLSLShader::sNoFixedFunction || LLGLSLShader::sCurBoundShader != 0);
+ LLVertexBuffer::unbind();
+ glVertexPointer(3, GL_FLOAT, 16, phys_volume->mHullPoints);
+ gGL.diffuseColor4fv(line_color.mV);
+ gGL.syncMatrices();
+ glDrawElements(GL_TRIANGLES, phys_volume->mNumHullIndices, GL_UNSIGNED_SHORT, phys_volume->mHullIndices);
+
+ gGL.diffuseColor4fv(color.mV);
+ glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
+ glDrawElements(GL_TRIANGLES, phys_volume->mNumHullIndices, GL_UNSIGNED_SHORT, phys_volume->mHullIndices);
+ }
+ else
+ {
+ gGL.diffuseColor3f(1,0,1);
+ drawBoxOutline(center, size);
+ gMeshRepo.buildHull(volume_params, detail);
+ }
+ LLPrimitive::sVolumeManager->unrefVolume(phys_volume);
+ }
+ else if (type == LLPhysicsShapeBuilderUtil::PhysicsShapeSpecification::SCULPT)
+ {
+ //TODO: implement sculpted prim physics display
+ }
+ else
+ {
+ llerrs << "Unhandled type" << llendl;
+ }
+
+ gGL.popMatrix();
+}
+
+void renderPhysicsShapes(LLSpatialGroup* group)
+{
+ for (LLSpatialGroup::OctreeNode::const_element_iter i = group->getData().begin(); i != group->getData().end(); ++i)
+ {
+ LLDrawable* drawable = *i;
+ LLVOVolume* volume = drawable->getVOVolume();
+ if (volume && !volume->isAttachment() && volume->getPhysicsShapeType() != LLViewerObject::PHYSICS_SHAPE_NONE )
+ {
+ if (!group->mSpatialPartition->isBridge())
+ {
+ gGL.pushMatrix();
+ LLVector3 trans = drawable->getRegion()->getOriginAgent();
+ gGL.translatef(trans.mV[0], trans.mV[1], trans.mV[2]);
+ renderPhysicsShape(drawable, volume);
+ gGL.popMatrix();
+ }
+ else
+ {
+ renderPhysicsShape(drawable, volume);
+ }
+ }
+ else
+ {
+ LLViewerObject* object = drawable->getVObj();
+ if (object && object->getPCode() == LLViewerObject::LL_VO_SURFACE_PATCH)
+ {
+ //push face vertices for terrain
+ for (S32 i = 0; i < drawable->getNumFaces(); ++i)
+ {
+ LLFace* face = drawable->getFace(i);
+ LLVertexBuffer* buff = face->getVertexBuffer();
+ if (buff)
+ {
+ glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
+
+ buff->setBuffer(LLVertexBuffer::MAP_VERTEX);
+ gGL.diffuseColor3f(0.2f, 0.5f, 0.3f);
+ buff->draw(LLRender::TRIANGLES, buff->getNumIndices(), 0);
+
+ gGL.diffuseColor3f(0.2f, 1.f, 0.3f);
+ glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
+ buff->draw(LLRender::TRIANGLES, buff->getNumIndices(), 0);
+ }
+ }
+ }
+ }
+ }
+}
+
+void renderTexturePriority(LLDrawable* drawable)
+{
+ for (int face=0; face<drawable->getNumFaces(); ++face)
+ {
+ LLFace *facep = drawable->getFace(face);
+
+ LLVector4 cold(0,0,0.25f);
+ LLVector4 hot(1,0.25f,0.25f);
+
+ LLVector4 boost_cold(0,0,0,0);
+ LLVector4 boost_hot(0,1,0,1);
+
+ LLGLDisable blend(GL_BLEND);
+
+ //LLViewerTexture* imagep = facep->getTexture();
+ //if (imagep)
+ {
+
+ //F32 vsize = imagep->mMaxVirtualSize;
+ F32 vsize = facep->getPixelArea();
+
+ if (vsize > sCurMaxTexPriority)
+ {
+ sCurMaxTexPriority = vsize;
+ }
+
+ F32 t = vsize/sLastMaxTexPriority;
+
+ LLVector4 col = lerp(cold, hot, t);
+ gGL.diffuseColor4fv(col.mV);
+ }
+ //else
+ //{
+ // gGL.diffuseColor4f(1,0,1,1);
+ //}
+
+ LLVector4a center;
+ center.setAdd(facep->mExtents[1],facep->mExtents[0]);
+ center.mul(0.5f);
+ LLVector4a size;
+ size.setSub(facep->mExtents[1],facep->mExtents[0]);
+ size.mul(0.5f);
+ size.add(LLVector4a(0.01f));
+ drawBox(center, size);
+
+ /*S32 boost = imagep->getBoostLevel();
+ if (boost>LLViewerTexture::BOOST_NONE)
+ {
+ F32 t = (F32) boost / (F32) (LLViewerTexture::BOOST_MAX_LEVEL-1);
+ LLVector4 col = lerp(boost_cold, boost_hot, t);
+ LLGLEnable blend_on(GL_BLEND);
+ gGL.blendFunc(GL_SRC_ALPHA, GL_ONE);
+ gGL.diffuseColor4fv(col.mV);
+ drawBox(center, size);
+ gGL.blendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+ }*/
+ }
+}
+
+void renderPoints(LLDrawable* drawablep)
+{
+ LLGLDepthTest depth(GL_FALSE, GL_FALSE);
+ if (drawablep->getNumFaces())
+ {
+ gGL.begin(LLRender::POINTS);
+ gGL.diffuseColor3f(1,1,1);
+ for (S32 i = 0; i < drawablep->getNumFaces(); i++)
+ {
+ gGL.vertex3fv(drawablep->getFace(i)->mCenterLocal.mV);
+ }
+ gGL.end();
+ }
+}
+
+void renderTextureAnim(LLDrawInfo* params)
+{
+ if (!params->mTextureMatrix)
+ {
+ return;
+ }
+
+ LLGLEnable blend(GL_BLEND);
+ gGL.diffuseColor4f(1,1,0,0.5f);
+ pushVerts(params, LLVertexBuffer::MAP_VERTEX);
+}
+
+void renderBatchSize(LLDrawInfo* params)
+{
+ LLGLEnable offset(GL_POLYGON_OFFSET_FILL);
+ glPolygonOffset(-1.f, 1.f);
+ gGL.diffuseColor4ubv((GLubyte*) &(params->mDebugColor));
+ pushVerts(params, LLVertexBuffer::MAP_VERTEX);
+}
+
+void renderShadowFrusta(LLDrawInfo* params)
+{
+ LLGLEnable blend(GL_BLEND);
+ gGL.setSceneBlendType(LLRender::BT_ADD);
+
+ LLVector4a center;
+ center.setAdd(params->mExtents[1], params->mExtents[0]);
+ center.mul(0.5f);
+ LLVector4a size;
+ size.setSub(params->mExtents[1],params->mExtents[0]);
+ size.mul(0.5f);
+
+ if (gPipeline.mShadowCamera[4].AABBInFrustum(center, size))
+ {
+ gGL.diffuseColor3f(1,0,0);
+ pushVerts(params, LLVertexBuffer::MAP_VERTEX);
+ }
+ if (gPipeline.mShadowCamera[5].AABBInFrustum(center, size))
+ {
+ gGL.diffuseColor3f(0,1,0);
+ pushVerts(params, LLVertexBuffer::MAP_VERTEX);
+ }
+ if (gPipeline.mShadowCamera[6].AABBInFrustum(center, size))
+ {
+ gGL.diffuseColor3f(0,0,1);
+ pushVerts(params, LLVertexBuffer::MAP_VERTEX);
+ }
+ if (gPipeline.mShadowCamera[7].AABBInFrustum(center, size))
+ {
+ gGL.diffuseColor3f(1,0,1);
+ pushVerts(params, LLVertexBuffer::MAP_VERTEX);
+ }
+
+ gGL.setSceneBlendType(LLRender::BT_ALPHA);
+}
+
+
+void renderLights(LLDrawable* drawablep)
+{
+ if (!drawablep->isLight())
+ {
+ return;
+ }
+
+ if (drawablep->getNumFaces())
+ {
+ LLGLEnable blend(GL_BLEND);
+ gGL.diffuseColor4f(0,1,1,0.5f);
+
+ for (S32 i = 0; i < drawablep->getNumFaces(); i++)
+ {
+ pushVerts(drawablep->getFace(i), LLVertexBuffer::MAP_VERTEX);
+ }
+
+ const LLVector4a* ext = drawablep->getSpatialExtents();
+
+ LLVector4a pos;
+ pos.setAdd(ext[0], ext[1]);
+ pos.mul(0.5f);
+ LLVector4a size;
+ size.setSub(ext[1], ext[0]);
+ size.mul(0.5f);
+
+ {
+ LLGLDepthTest depth(GL_FALSE, GL_TRUE);
+ gGL.diffuseColor4f(1,1,1,1);
+ drawBoxOutline(pos, size);
+ }
+
+ gGL.diffuseColor4f(1,1,0,1);
+ F32 rad = drawablep->getVOVolume()->getLightRadius();
+ drawBoxOutline(pos, LLVector4a(rad));
+ }
+}
+
+class LLRenderOctreeRaycast : public LLOctreeTriangleRayIntersect
+{
+public:
+
+
+ LLRenderOctreeRaycast(const LLVector4a& start, const LLVector4a& dir, F32* closest_t)
+ : LLOctreeTriangleRayIntersect(start, dir, NULL, closest_t, NULL, NULL, NULL, NULL)
+ {
+
+ }
+
+ void visit(const LLOctreeNode<LLVolumeTriangle>* branch)
+ {
+ LLVolumeOctreeListener* vl = (LLVolumeOctreeListener*) branch->getListener(0);
+
+ LLVector3 center, size;
+
+ if (branch->getData().empty())
+ {
+ gGL.diffuseColor3f(1.f,0.2f,0.f);
+ center.set(branch->getCenter().getF32ptr());
+ size.set(branch->getSize().getF32ptr());
+ }
+ else
+ {
+ gGL.diffuseColor3f(0.75f, 1.f, 0.f);
+ center.set(vl->mBounds[0].getF32ptr());
+ size.set(vl->mBounds[1].getF32ptr());
+ }
+
+ drawBoxOutline(center, size);
+
+ for (U32 i = 0; i < 2; i++)
+ {
+ LLGLDepthTest depth(GL_TRUE, GL_FALSE, i == 1 ? GL_LEQUAL : GL_GREATER);
+
+ if (i == 1)
+ {
+ gGL.diffuseColor4f(0,1,1,0.5f);
+ }
+ else
+ {
+ gGL.diffuseColor4f(0,0.5f,0.5f, 0.25f);
+ drawBoxOutline(center, size);
+ }
+
+ if (i == 1)
+ {
+ gGL.flush();
+ glLineWidth(3.f);
+ }
+
+ gGL.begin(LLRender::TRIANGLES);
+ for (LLOctreeNode<LLVolumeTriangle>::const_element_iter iter = branch->getData().begin();
+ iter != branch->getData().end();
+ ++iter)
+ {
+ const LLVolumeTriangle* tri = *iter;
+
+ gGL.vertex3fv(tri->mV[0]->getF32ptr());
+ gGL.vertex3fv(tri->mV[1]->getF32ptr());
+ gGL.vertex3fv(tri->mV[2]->getF32ptr());
+ }
+ gGL.end();
+
+ if (i == 1)
+ {
+ gGL.flush();
+ glLineWidth(1.f);
+ }
+ }
+ }
+};
+
+void renderRaycast(LLDrawable* drawablep)
+{
+ if (drawablep->getNumFaces())
+ {
+ LLGLEnable blend(GL_BLEND);
+ gGL.diffuseColor4f(0,1,1,0.5f);
+
+ if (drawablep->getVOVolume())
+ {
+ //glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
+ //pushVerts(drawablep->getFace(gDebugRaycastFaceHit), LLVertexBuffer::MAP_VERTEX);
+ //glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
+
+ LLVOVolume* vobj = drawablep->getVOVolume();
+ LLVolume* volume = vobj->getVolume();
+
+ bool transform = true;
+ if (drawablep->isState(LLDrawable::RIGGED))
+ {
+ volume = vobj->getRiggedVolume();
+ transform = false;
+ }
+
+ if (volume)
+ {
+ LLVector3 trans = drawablep->getRegion()->getOriginAgent();
+
+ for (S32 i = 0; i < volume->getNumVolumeFaces(); ++i)
+ {
+ const LLVolumeFace& face = volume->getVolumeFace(i);
+ if (!face.mOctree)
+ {
+ ((LLVolumeFace*) &face)->createOctree();
+ }
+
+ gGL.pushMatrix();
+ gGL.translatef(trans.mV[0], trans.mV[1], trans.mV[2]);
+ gGL.multMatrix((F32*) vobj->getRelativeXform().mMatrix);
+
+ LLVector3 start, end;
+ if (transform)
+ {
+ start = vobj->agentPositionToVolume(gDebugRaycastStart);
+ end = vobj->agentPositionToVolume(gDebugRaycastEnd);
+ }
+ else
+ {
+ start = gDebugRaycastStart;
+ end = gDebugRaycastEnd;
+ }
+
+ LLVector4a starta, enda;
+ starta.load3(start.mV);
+ enda.load3(end.mV);
+ LLVector4a dir;
+ dir.setSub(enda, starta);
+
+ F32 t = 1.f;
+
+ LLRenderOctreeRaycast render(starta, dir, &t);
+ gGL.flush();
+ glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
+
+ {
+ //render face positions
+ LLVertexBuffer::unbind();
+ gGL.diffuseColor4f(0,1,1,0.5f);
+ glVertexPointer(3, GL_FLOAT, sizeof(LLVector4a), face.mPositions);
+ gGL.syncMatrices();
+ glDrawElements(GL_TRIANGLES, face.mNumIndices, GL_UNSIGNED_SHORT, face.mIndices);
+ }
+
+ render.traverse(face.mOctree);
+ gGL.popMatrix();
+ glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
+ }
+ }
+ }
+ else if (drawablep->isAvatar())
+ {
+ if (drawablep->getVObj() == gDebugRaycastObject)
+ {
+ LLGLDepthTest depth(GL_FALSE);
+ LLVOAvatar* av = (LLVOAvatar*) drawablep->getVObj().get();
+ av->renderCollisionVolumes();
+ }
+ }
+
+ if (drawablep->getVObj() == gDebugRaycastObject)
+ {
+ // draw intersection point
+ gGL.pushMatrix();
+ gGL.loadMatrix(gGLModelView);
+ LLVector3 translate = gDebugRaycastIntersection;
+ gGL.translatef(translate.mV[0], translate.mV[1], translate.mV[2]);
+ LLCoordFrame orient;
+ orient.lookDir(gDebugRaycastNormal, gDebugRaycastBinormal);
+ LLMatrix4 rotation;
+ orient.getRotMatrixToParent(rotation);
+ gGL.multMatrix((float*)rotation.mMatrix);
+
+ gGL.diffuseColor4f(1,0,0,0.5f);
+ drawBox(LLVector3(0, 0, 0), LLVector3(0.1f, 0.022f, 0.022f));
+ gGL.diffuseColor4f(0,1,0,0.5f);
+ drawBox(LLVector3(0, 0, 0), LLVector3(0.021f, 0.1f, 0.021f));
+ gGL.diffuseColor4f(0,0,1,0.5f);
+ drawBox(LLVector3(0, 0, 0), LLVector3(0.02f, 0.02f, 0.1f));
+ gGL.popMatrix();
+
+ // draw bounding box of prim
+ const LLVector4a* ext = drawablep->getSpatialExtents();
+
+ LLVector4a pos;
+ pos.setAdd(ext[0], ext[1]);
+ pos.mul(0.5f);
+ LLVector4a size;
+ size.setSub(ext[1], ext[0]);
+ size.mul(0.5f);
+
+ LLGLDepthTest depth(GL_FALSE, GL_TRUE);
+ gGL.diffuseColor4f(0,0.5f,0.5f,1);
+ drawBoxOutline(pos, size);
+ }
+ }
+}
+
+
+void renderAvatarCollisionVolumes(LLVOAvatar* avatar)
+{
+ avatar->renderCollisionVolumes();
+}
+
+void renderAgentTarget(LLVOAvatar* avatar)
+{
+ // render these for self only (why, i don't know)
+ if (avatar->isSelf())
+ {
+ renderCrossHairs(avatar->getPositionAgent(), 0.2f, LLColor4(1, 0, 0, 0.8f));
+ renderCrossHairs(avatar->mDrawable->getPositionAgent(), 0.2f, LLColor4(1, 0, 0, 0.8f));
+ renderCrossHairs(avatar->mRoot.getWorldPosition(), 0.2f, LLColor4(1, 1, 1, 0.8f));
+ renderCrossHairs(avatar->mPelvisp->getWorldPosition(), 0.2f, LLColor4(0, 0, 1, 0.8f));
+ }
+}
+
+class LLOctreeRenderNonOccluded : public LLOctreeTraveler<LLDrawable>
+{
+public:
+ LLCamera* mCamera;
+ LLOctreeRenderNonOccluded(LLCamera* camera): mCamera(camera) {}
+
+ virtual void traverse(const LLSpatialGroup::OctreeNode* node)
+ {
+ LLSpatialGroup* group = (LLSpatialGroup*) node->getListener(0);
+
+ if (!mCamera || mCamera->AABBInFrustumNoFarClip(group->mBounds[0], group->mBounds[1]))
+ {
+ node->accept(this);
+ stop_glerror();
+
+ for (U32 i = 0; i < node->getChildCount(); i++)
+ {
+ traverse(node->getChild(i));
+ stop_glerror();
+ }
+
+ //draw tight fit bounding boxes for spatial group
+ if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_OCTREE))
+ {
+ group->rebuildGeom();
+ group->rebuildMesh();
+
+ renderOctree(group);
+ stop_glerror();
+ }
+
+ //render visibility wireframe
+ if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_OCCLUSION))
+ {
+ group->rebuildGeom();
+ group->rebuildMesh();
+
+ gGL.flush();
+ gGL.pushMatrix();
+ gGLLastMatrix = NULL;
+ gGL.loadMatrix(gGLModelView);
+ renderVisibility(group, mCamera);
+ stop_glerror();
+ gGLLastMatrix = NULL;
+ gGL.popMatrix();
+ gGL.diffuseColor4f(1,1,1,1);
+ }
+ }
+ }
+
+ virtual void visit(const LLSpatialGroup::OctreeNode* branch)
+ {
+ LLSpatialGroup* group = (LLSpatialGroup*) branch->getListener(0);
+
+ if (group->isState(LLSpatialGroup::GEOM_DIRTY) || (mCamera && !mCamera->AABBInFrustumNoFarClip(group->mBounds[0], group->mBounds[1])))
+ {
+ return;
+ }
+
+ LLVector4a nodeCenter = group->mBounds[0];
+ LLVector4a octCenter = group->mOctreeNode->getCenter();
+
+ group->rebuildGeom();
+ group->rebuildMesh();
+
+ if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_BBOXES))
+ {
+ if (!group->getData().empty())
+ {
+ gGL.diffuseColor3f(0,0,1);
+ drawBoxOutline(group->mObjectBounds[0],
+ group->mObjectBounds[1]);
+ }
+ }
+
+ for (LLSpatialGroup::OctreeNode::const_element_iter i = branch->getData().begin(); i != branch->getData().end(); ++i)
+ {
+ LLDrawable* drawable = *i;
+
+ if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_BBOXES))
+ {
+ renderBoundingBox(drawable);
+ }
+
+ if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_NORMALS))
+ {
+ renderNormals(drawable);
+ }
+
+ if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_BUILD_QUEUE))
+ {
+ if (drawable->isState(LLDrawable::IN_REBUILD_Q2))
+ {
+ gGL.diffuseColor4f(0.6f, 0.6f, 0.1f, 1.f);
+ const LLVector4a* ext = drawable->getSpatialExtents();
+ LLVector4a center;
+ center.setAdd(ext[0], ext[1]);
+ center.mul(0.5f);
+ LLVector4a size;
+ size.setSub(ext[1], ext[0]);
+ size.mul(0.5f);
+ drawBoxOutline(center, size);
+ }
+ }
+
+ if (drawable->getVOVolume() && gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_TEXTURE_PRIORITY))
+ {
+ renderTexturePriority(drawable);
+ }
+
+ if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_POINTS))
+ {
+ renderPoints(drawable);
+ }
+
+ if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_LIGHTS))
+ {
+ renderLights(drawable);
+ }
+
+ if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_RAYCAST))
+ {
+ renderRaycast(drawable);
+ }
+ if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_UPDATE_TYPE))
+ {
+ renderUpdateType(drawable);
+ }
+ if(gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_RENDER_COMPLEXITY))
+ {
+ renderComplexityDisplay(drawable);
+ }
+
+ LLVOAvatar* avatar = dynamic_cast<LLVOAvatar*>(drawable->getVObj().get());
+
+ if (avatar && gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_AVATAR_VOLUME))
+ {
+ renderAvatarCollisionVolumes(avatar);
+ }
+
+ if (avatar && gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_AGENT_TARGET))
+ {
+ renderAgentTarget(avatar);
+ }
+
+
+ if (gDebugGL)
+ {
+ for (U32 i = 0; i < drawable->getNumFaces(); ++i)
+ {
+ LLFace* facep = drawable->getFace(i);
+ U8 index = facep->getTextureIndex();
+ if (facep->mDrawInfo)
+ {
+ if (index < 255)
+ {
+ if (facep->mDrawInfo->mTextureList.size() <= index)
+ {
+ llerrs << "Face texture index out of bounds." << llendl;
+ }
+ else if (facep->mDrawInfo->mTextureList[index] != facep->getTexture())
+ {
+ llerrs << "Face texture index incorrect." << llendl;
+ }
+ }
+ }
+ }
+ }
+ }
+
+ for (LLSpatialGroup::draw_map_t::iterator i = group->mDrawMap.begin(); i != group->mDrawMap.end(); ++i)
+ {
+ LLSpatialGroup::drawmap_elem_t& draw_vec = i->second;
+ for (LLSpatialGroup::drawmap_elem_t::iterator j = draw_vec.begin(); j != draw_vec.end(); ++j)
+ {
+ LLDrawInfo* draw_info = *j;
+ if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_TEXTURE_ANIM))
+ {
+ renderTextureAnim(draw_info);
+ }
+ if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_BATCH_SIZE))
+ {
+ renderBatchSize(draw_info);
+ }
+ if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_SHADOW_FRUSTA))
+ {
+ renderShadowFrusta(draw_info);
+ }
+ }
+ }
+ }
+};
+
+
+class LLOctreeRenderPhysicsShapes : public LLOctreeTraveler<LLDrawable>
+{
+public:
+ LLCamera* mCamera;
+ LLOctreeRenderPhysicsShapes(LLCamera* camera): mCamera(camera) {}
+
+ virtual void traverse(const LLSpatialGroup::OctreeNode* node)
+ {
+ LLSpatialGroup* group = (LLSpatialGroup*) node->getListener(0);
+
+ if (!mCamera || mCamera->AABBInFrustumNoFarClip(group->mBounds[0], group->mBounds[1]))
+ {
+ node->accept(this);
+ stop_glerror();
+
+ for (U32 i = 0; i < node->getChildCount(); i++)
+ {
+ traverse(node->getChild(i));
+ stop_glerror();
+ }
+
+ group->rebuildGeom();
+ group->rebuildMesh();
+
+ renderPhysicsShapes(group);
+ }
+ }
+
+ virtual void visit(const LLSpatialGroup::OctreeNode* branch)
+ {
+
+ }
+};
+
+class LLOctreePushBBoxVerts : public LLOctreeTraveler<LLDrawable>
+{
+public:
+ LLCamera* mCamera;
+ LLOctreePushBBoxVerts(LLCamera* camera): mCamera(camera) {}
+
+ virtual void traverse(const LLSpatialGroup::OctreeNode* node)
+ {
+ LLSpatialGroup* group = (LLSpatialGroup*) node->getListener(0);
+
+ if (!mCamera || mCamera->AABBInFrustum(group->mBounds[0], group->mBounds[1]))
+ {
+ node->accept(this);
+
+ for (U32 i = 0; i < node->getChildCount(); i++)
+ {
+ traverse(node->getChild(i));
+ }
+ }
+ }
+
+ virtual void visit(const LLSpatialGroup::OctreeNode* branch)
+ {
+ LLSpatialGroup* group = (LLSpatialGroup*) branch->getListener(0);
+
+ if (group->isState(LLSpatialGroup::GEOM_DIRTY) || (mCamera && !mCamera->AABBInFrustumNoFarClip(group->mBounds[0], group->mBounds[1])))
+ {
+ return;
+ }
+
+ for (LLSpatialGroup::OctreeNode::const_element_iter i = branch->getData().begin(); i != branch->getData().end(); ++i)
+ {
+ LLDrawable* drawable = *i;
+
+ renderBoundingBox(drawable, FALSE);
+ }
+ }
+};
+
+void LLSpatialPartition::renderIntersectingBBoxes(LLCamera* camera)
+{
+ LLOctreePushBBoxVerts pusher(camera);
+ pusher.traverse(mOctree);
+}
+
+class LLOctreeStateCheck : public LLOctreeTraveler<LLDrawable>
+{
+public:
+ U32 mInheritedMask[LLViewerCamera::NUM_CAMERAS];
+
+ LLOctreeStateCheck()
+ {
+ for (U32 i = 0; i < LLViewerCamera::NUM_CAMERAS; i++)
+ {
+ mInheritedMask[i] = 0;
+ }
+ }
+
+ virtual void traverse(const LLSpatialGroup::OctreeNode* node)
+ {
+ LLSpatialGroup* group = (LLSpatialGroup*) node->getListener(0);
+
+ node->accept(this);
+
+
+ U32 temp[LLViewerCamera::NUM_CAMERAS];
+
+ for (U32 i = 0; i < LLViewerCamera::NUM_CAMERAS; i++)
+ {
+ temp[i] = mInheritedMask[i];
+ mInheritedMask[i] |= group->mOcclusionState[i] & LLSpatialGroup::OCCLUDED;
+ }
+
+ for (U32 i = 0; i < node->getChildCount(); i++)
+ {
+ traverse(node->getChild(i));
+ }
+
+ for (U32 i = 0; i < LLViewerCamera::NUM_CAMERAS; i++)
+ {
+ mInheritedMask[i] = temp[i];
+ }
+ }
+
+
+ virtual void visit(const LLOctreeNode<LLDrawable>* state)
+ {
+ LLSpatialGroup* group = (LLSpatialGroup*) state->getListener(0);
+
+ for (U32 i = 0; i < LLViewerCamera::NUM_CAMERAS; i++)
+ {
+ if (mInheritedMask[i] && !(group->mOcclusionState[i] & mInheritedMask[i]))
+ {
+ llerrs << "Spatial group failed inherited mask test." << llendl;
+ }
+ }
+
+ if (group->isState(LLSpatialGroup::DIRTY))
+ {
+ assert_parent_state(group, LLSpatialGroup::DIRTY);
+ }
+ }
+
+ void assert_parent_state(LLSpatialGroup* group, U32 state)
+ {
+ LLSpatialGroup* parent = group->getParent();
+ while (parent)
+ {
+ if (!parent->isState(state))
+ {
+ llerrs << "Spatial group failed parent state check." << llendl;
+ }
+ parent = parent->getParent();
+ }
+ }
+};
+
+
+void LLSpatialPartition::renderPhysicsShapes()
+{
+ LLSpatialBridge* bridge = asBridge();
+ LLCamera* camera = LLViewerCamera::getInstance();
+
+ if (bridge)
+ {
+ camera = NULL;
+ }
+
+ gGL.flush();
+ gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
+ glLineWidth(3.f);
+ LLOctreeRenderPhysicsShapes render_physics(camera);
+ render_physics.traverse(mOctree);
+ gGL.flush();
+ glLineWidth(1.f);
+}
+
+void LLSpatialPartition::renderDebug()
+{
+ if (!gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_OCTREE |
+ LLPipeline::RENDER_DEBUG_OCCLUSION |
+ LLPipeline::RENDER_DEBUG_LIGHTS |
+ LLPipeline::RENDER_DEBUG_BATCH_SIZE |
+ LLPipeline::RENDER_DEBUG_UPDATE_TYPE |
+ LLPipeline::RENDER_DEBUG_BBOXES |
+ LLPipeline::RENDER_DEBUG_NORMALS |
+ LLPipeline::RENDER_DEBUG_POINTS |
+ LLPipeline::RENDER_DEBUG_TEXTURE_PRIORITY |
+ LLPipeline::RENDER_DEBUG_TEXTURE_ANIM |
+ LLPipeline::RENDER_DEBUG_RAYCAST |
+ LLPipeline::RENDER_DEBUG_AVATAR_VOLUME |
+ LLPipeline::RENDER_DEBUG_AGENT_TARGET |
+ //LLPipeline::RENDER_DEBUG_BUILD_QUEUE |
+ LLPipeline::RENDER_DEBUG_SHADOW_FRUSTA |
+ LLPipeline::RENDER_DEBUG_RENDER_COMPLEXITY))
+ {
+ return;
+ }
+
+ if (LLGLSLShader::sNoFixedFunction)
+ {
+ gDebugProgram.bind();
+ }
+
+ if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_TEXTURE_PRIORITY))
+ {
+ //sLastMaxTexPriority = lerp(sLastMaxTexPriority, sCurMaxTexPriority, gFrameIntervalSeconds);
+ sLastMaxTexPriority = (F32) LLViewerCamera::getInstance()->getScreenPixelArea();
+ sCurMaxTexPriority = 0.f;
+ }
+
+ LLMemType mt(LLMemType::MTYPE_SPACE_PARTITION);
+
+ LLGLDisable cullface(GL_CULL_FACE);
+ LLGLEnable blend(GL_BLEND);
+ gGL.setSceneBlendType(LLRender::BT_ALPHA);
+ gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
+ gPipeline.disableLights();
+
+ LLSpatialBridge* bridge = asBridge();
+ LLCamera* camera = LLViewerCamera::getInstance();
+
+ if (bridge)
+ {
+ camera = NULL;
+ }
+
+ LLOctreeStateCheck checker;
+ checker.traverse(mOctree);
+
+ LLOctreeRenderNonOccluded render_debug(camera);
+ render_debug.traverse(mOctree);
+
+ if (LLGLSLShader::sNoFixedFunction)
+ {
+ gDebugProgram.unbind();
+ }
+}
+
+void LLSpatialGroup::drawObjectBox(LLColor4 col)
+{
+ gGL.diffuseColor4fv(col.mV);
+ LLVector4a size;
+ size = mObjectBounds[1];
+ size.mul(1.01f);
+ size.add(LLVector4a(0.001f));
+ drawBox(mObjectBounds[0], size);
+}
+
+bool LLSpatialPartition::isHUDPartition()
+{
+ return mPartitionType == LLViewerRegion::PARTITION_HUD ;
+}
+
+BOOL LLSpatialPartition::isVisible(const LLVector3& v)
+{
+ if (!LLViewerCamera::getInstance()->sphereInFrustum(v, 4.0f))
+ {
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+class LLOctreeIntersect : public LLSpatialGroup::OctreeTraveler
+{
+public:
+ LLVector3 mStart;
+ LLVector3 mEnd;
+ S32 *mFaceHit;
+ LLVector3 *mIntersection;
+ LLVector2 *mTexCoord;
+ LLVector3 *mNormal;
+ LLVector3 *mBinormal;
+ LLDrawable* mHit;
+ BOOL mPickTransparent;
+
+ LLOctreeIntersect(LLVector3 start, LLVector3 end, BOOL pick_transparent,
+ S32* face_hit, LLVector3* intersection, LLVector2* tex_coord, LLVector3* normal, LLVector3* binormal)
+ : mStart(start),
+ mEnd(end),
+ mFaceHit(face_hit),
+ mIntersection(intersection),
+ mTexCoord(tex_coord),
+ mNormal(normal),
+ mBinormal(binormal),
+ mHit(NULL),
+ mPickTransparent(pick_transparent)
+ {
+ }
+
+ virtual void visit(const LLSpatialGroup::OctreeNode* branch)
+ {
+ for (LLSpatialGroup::OctreeNode::const_element_iter i = branch->getData().begin(); i != branch->getData().end(); ++i)
+ {
+ check(*i);
+ }
+ }
+
+ virtual LLDrawable* check(const LLSpatialGroup::OctreeNode* node)
+ {
+ node->accept(this);
+
+ for (U32 i = 0; i < node->getChildCount(); i++)
+ {
+ const LLSpatialGroup::OctreeNode* child = node->getChild(i);
+ LLVector3 res;
+
+ LLSpatialGroup* group = (LLSpatialGroup*) child->getListener(0);
+
+ LLVector4a size;
+ LLVector4a center;
+
+ size = group->mBounds[1];
+ center = group->mBounds[0];
+
+ LLVector3 local_start = mStart;
+ LLVector3 local_end = mEnd;
+
+ if (group->mSpatialPartition->isBridge())
+ {
+ LLMatrix4 local_matrix = group->mSpatialPartition->asBridge()->mDrawable->getRenderMatrix();
+ local_matrix.invert();
+
+ local_start = mStart * local_matrix;
+ local_end = mEnd * local_matrix;
+ }
+
+ LLVector4a start, end;
+ start.load3(local_start.mV);
+ end.load3(local_end.mV);
+
+ if (LLLineSegmentBoxIntersect(start, end, center, size))
+ {
+ check(child);
+ }
+ }
+
+ return mHit;
+ }
+
+ virtual bool check(LLDrawable* drawable)
+ {
+ LLVector3 local_start = mStart;
+ LLVector3 local_end = mEnd;
+
+ if (!drawable || !gPipeline.hasRenderType(drawable->getRenderType()) || !drawable->isVisible())
+ {
+ return false;
+ }
+
+ if (drawable->isSpatialBridge())
+ {
+ LLSpatialPartition *part = drawable->asPartition();
+ LLSpatialBridge* bridge = part->asBridge();
+ if (bridge && gPipeline.hasRenderType(bridge->mDrawableType))
+ {
+ check(part->mOctree);
+ }
+ }
+ else
+ {
+ LLViewerObject* vobj = drawable->getVObj();
+
+ if (vobj)
+ {
+ LLVector3 intersection;
+ bool skip_check = false;
+ if (vobj->isAvatar())
+ {
+ LLVOAvatar* avatar = (LLVOAvatar*) vobj;
+ if (avatar->isSelf() && LLFloater::isVisible(gFloaterTools))
+ {
+ LLViewerObject* hit = avatar->lineSegmentIntersectRiggedAttachments(mStart, mEnd, -1, mPickTransparent, mFaceHit, &intersection, mTexCoord, mNormal, mBinormal);
+ if (hit)
+ {
+ mEnd = intersection;
+ if (mIntersection)
+ {
+ *mIntersection = intersection;
+ }
+
+ mHit = hit->mDrawable;
+ skip_check = true;
+ }
+
+ }
+ }
+
+ if (!skip_check && vobj->lineSegmentIntersect(mStart, mEnd, -1, mPickTransparent, mFaceHit, &intersection, mTexCoord, mNormal, mBinormal))
+ {
+ mEnd = intersection; // shorten ray so we only find CLOSER hits
+ if (mIntersection)
+ {
+ *mIntersection = intersection;
+ }
+
+ mHit = vobj->mDrawable;
+ }
+ }
+ }
+
+ return false;
+ }
+};
+
+LLDrawable* LLSpatialPartition::lineSegmentIntersect(const LLVector3& start, const LLVector3& end,
+ BOOL pick_transparent,
+ S32* face_hit, // return the face hit
+ LLVector3* intersection, // return the intersection point
+ LLVector2* tex_coord, // return the texture coordinates of the intersection point
+ LLVector3* normal, // return the surface normal at the intersection point
+ LLVector3* bi_normal // return the surface bi-normal at the intersection point
+ )
+
+{
+ LLOctreeIntersect intersect(start, end, pick_transparent, face_hit, intersection, tex_coord, normal, bi_normal);
+ LLDrawable* drawable = intersect.check(mOctree);
+
+ return drawable;
+}
+
+LLDrawInfo::LLDrawInfo(U16 start, U16 end, U32 count, U32 offset,
+ LLViewerTexture* texture, LLVertexBuffer* buffer,
+ BOOL fullbright, U8 bump, BOOL particle, F32 part_size)
+:
+ mVertexBuffer(buffer),
+ mTexture(texture),
+ mTextureMatrix(NULL),
+ mModelMatrix(NULL),
+ mStart(start),
+ mEnd(end),
+ mCount(count),
+ mOffset(offset),
+ mFullbright(fullbright),
+ mBump(bump),
+ mParticle(particle),
+ mPartSize(part_size),
+ mVSize(0.f),
+ mGroup(NULL),
+ mFace(NULL),
+ mDistance(0.f),
+ mDrawMode(LLRender::TRIANGLES)
+{
+ mVertexBuffer->validateRange(mStart, mEnd, mCount, mOffset);
+
+ mDebugColor = (rand() << 16) + rand();
+}
+
+LLDrawInfo::~LLDrawInfo()
+{
+ /*if (LLSpatialGroup::sNoDelete)
+ {
+ llerrs << "LLDrawInfo deleted illegally!" << llendl;
+ }*/
+
+ if (mFace)
+ {
+ mFace->setDrawInfo(NULL);
+ }
+
+ if (gDebugGL)
+ {
+ gPipeline.checkReferences(this);
+ }
+}
+
+void LLDrawInfo::validate()
+{
+ mVertexBuffer->validateRange(mStart, mEnd, mCount, mOffset);
+}
+
+LLVertexBuffer* LLGeometryManager::createVertexBuffer(U32 type_mask, U32 usage)
+{
+ return new LLVertexBuffer(type_mask, usage);
+}
+
+LLCullResult::LLCullResult()
+{
+ clear();
+}
+
+void LLCullResult::clear()
+{
+ mVisibleGroupsSize = 0;
+ mVisibleGroupsEnd = mVisibleGroups.begin();
+
+ mAlphaGroupsSize = 0;
+ mAlphaGroupsEnd = mAlphaGroups.begin();
+
+ mOcclusionGroupsSize = 0;
+ mOcclusionGroupsEnd = mOcclusionGroups.begin();
+
+ mDrawableGroupsSize = 0;
+ mDrawableGroupsEnd = mDrawableGroups.begin();
+
+ mVisibleListSize = 0;
+ mVisibleListEnd = mVisibleList.begin();
+
+ mVisibleBridgeSize = 0;
+ mVisibleBridgeEnd = mVisibleBridge.begin();
+
+
+ for (U32 i = 0; i < LLRenderPass::NUM_RENDER_TYPES; i++)
+ {
+ for (U32 j = 0; j < mRenderMapSize[i]; j++)
+ {
+ mRenderMap[i][j] = 0;
+ }
+ mRenderMapSize[i] = 0;
+ mRenderMapEnd[i] = mRenderMap[i].begin();
+ }
+}
+
+LLCullResult::sg_list_t::iterator LLCullResult::beginVisibleGroups()
+{
+ return mVisibleGroups.begin();
+}
+
+LLCullResult::sg_list_t::iterator LLCullResult::endVisibleGroups()
+{
+ return mVisibleGroupsEnd;
+}
+
+LLCullResult::sg_list_t::iterator LLCullResult::beginAlphaGroups()
+{
+ return mAlphaGroups.begin();
+}
+
+LLCullResult::sg_list_t::iterator LLCullResult::endAlphaGroups()
+{
+ return mAlphaGroupsEnd;
+}
+
+LLCullResult::sg_list_t::iterator LLCullResult::beginOcclusionGroups()
+{
+ return mOcclusionGroups.begin();
+}
+
+LLCullResult::sg_list_t::iterator LLCullResult::endOcclusionGroups()
+{
+ return mOcclusionGroupsEnd;
+}
+
+LLCullResult::sg_list_t::iterator LLCullResult::beginDrawableGroups()
+{
+ return mDrawableGroups.begin();
+}
+
+LLCullResult::sg_list_t::iterator LLCullResult::endDrawableGroups()
+{
+ return mDrawableGroupsEnd;
+}
+
+LLCullResult::drawable_list_t::iterator LLCullResult::beginVisibleList()
+{
+ return mVisibleList.begin();
+}
+
+LLCullResult::drawable_list_t::iterator LLCullResult::endVisibleList()
+{
+ return mVisibleListEnd;
+}
+
+LLCullResult::bridge_list_t::iterator LLCullResult::beginVisibleBridge()
+{
+ return mVisibleBridge.begin();
+}
+
+LLCullResult::bridge_list_t::iterator LLCullResult::endVisibleBridge()
+{
+ return mVisibleBridgeEnd;
+}
+
+LLCullResult::drawinfo_list_t::iterator LLCullResult::beginRenderMap(U32 type)
+{
+ return mRenderMap[type].begin();
+}
+
+LLCullResult::drawinfo_list_t::iterator LLCullResult::endRenderMap(U32 type)
+{
+ return mRenderMapEnd[type];
+}
+
+void LLCullResult::pushVisibleGroup(LLSpatialGroup* group)
+{
+ if (mVisibleGroupsSize < mVisibleGroups.size())
+ {
+ mVisibleGroups[mVisibleGroupsSize] = group;
+ }
+ else
+ {
+ mVisibleGroups.push_back(group);
+ }
+ ++mVisibleGroupsSize;
+ mVisibleGroupsEnd = mVisibleGroups.begin()+mVisibleGroupsSize;
+}
+
+void LLCullResult::pushAlphaGroup(LLSpatialGroup* group)
+{
+ if (mAlphaGroupsSize < mAlphaGroups.size())
+ {
+ mAlphaGroups[mAlphaGroupsSize] = group;
+ }
+ else
+ {
+ mAlphaGroups.push_back(group);
+ }
+ ++mAlphaGroupsSize;
+ mAlphaGroupsEnd = mAlphaGroups.begin()+mAlphaGroupsSize;
+}
+
+void LLCullResult::pushOcclusionGroup(LLSpatialGroup* group)
+{
+ if (mOcclusionGroupsSize < mOcclusionGroups.size())
+ {
+ mOcclusionGroups[mOcclusionGroupsSize] = group;
+ }
+ else
+ {
+ mOcclusionGroups.push_back(group);
+ }
+ ++mOcclusionGroupsSize;
+ mOcclusionGroupsEnd = mOcclusionGroups.begin()+mOcclusionGroupsSize;
+}
+
+void LLCullResult::pushDrawableGroup(LLSpatialGroup* group)
+{
+ if (mDrawableGroupsSize < mDrawableGroups.size())
+ {
+ mDrawableGroups[mDrawableGroupsSize] = group;
+ }
+ else
+ {
+ mDrawableGroups.push_back(group);
+ }
+ ++mDrawableGroupsSize;
+ mDrawableGroupsEnd = mDrawableGroups.begin()+mDrawableGroupsSize;
+}
+
+void LLCullResult::pushDrawable(LLDrawable* drawable)
+{
+ if (mVisibleListSize < mVisibleList.size())
+ {
+ mVisibleList[mVisibleListSize] = drawable;
+ }
+ else
+ {
+ mVisibleList.push_back(drawable);
+ }
+ ++mVisibleListSize;
+ mVisibleListEnd = mVisibleList.begin()+mVisibleListSize;
+}
+
+void LLCullResult::pushBridge(LLSpatialBridge* bridge)
+{
+ if (mVisibleBridgeSize < mVisibleBridge.size())
+ {
+ mVisibleBridge[mVisibleBridgeSize] = bridge;
+ }
+ else
+ {
+ mVisibleBridge.push_back(bridge);
+ }
+ ++mVisibleBridgeSize;
+ mVisibleBridgeEnd = mVisibleBridge.begin()+mVisibleBridgeSize;
+}
+
+void LLCullResult::pushDrawInfo(U32 type, LLDrawInfo* draw_info)
+{
+ if (mRenderMapSize[type] < mRenderMap[type].size())
+ {
+ mRenderMap[type][mRenderMapSize[type]] = draw_info;
+ }
+ else
+ {
+ mRenderMap[type].push_back(draw_info);
+ }
+ ++mRenderMapSize[type];
+ mRenderMapEnd[type] = mRenderMap[type].begin() + mRenderMapSize[type];
+}
+
+
+void LLCullResult::assertDrawMapsEmpty()
+{
+ for (U32 i = 0; i < LLRenderPass::NUM_RENDER_TYPES; i++)
+ {
+ if (mRenderMapSize[i] != 0)
+ {
+ llerrs << "Stale LLDrawInfo's in LLCullResult!" << llendl;
+ }
+ }
+}
+
+
+
diff --git a/indra/newview/llspatialpartition.h b/indra/newview/llspatialpartition.h index 11955540c6..f0c8a372ee 100644 --- a/indra/newview/llspatialpartition.h +++ b/indra/newview/llspatialpartition.h @@ -93,7 +93,6 @@ public: LLPointer<LLViewerTexture> mTexture; std::vector<LLPointer<LLViewerTexture> > mTextureList; - LLColor4U mGlowColor; S32 mDebugColor; const LLMatrix4* mTextureMatrix; const LLMatrix4* mModelMatrix; diff --git a/indra/newview/llsprite.cpp b/indra/newview/llsprite.cpp index 4bde2dfcab..c3eb70f850 100644 --- a/indra/newview/llsprite.cpp +++ b/indra/newview/llsprite.cpp @@ -243,7 +243,7 @@ void LLSprite::updateFace(LLFace &face) *indicesp++ = 3 + index_offset; } - face.getVertexBuffer()->setBuffer(0); + face.getVertexBuffer()->flush(); face.mCenterAgent = mPosition; } diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index e62227fa3c..36d6ff3ef2 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -190,6 +190,7 @@ #include "lllogin.h" #include "llevents.h" #include "llstartuplistener.h" +#include "lltoolbarview.h" #if LL_WINDOWS #include "lldxhardware.h" @@ -736,8 +737,11 @@ bool idle_startup() // this startup phase more than once. if (gLoginMenuBarView == NULL) { - initialize_edit_menu(); + display_startup(); + initialize_edit_menu(); + display_startup(); init_menus(); + display_startup(); } if (show_connect_box) @@ -746,23 +750,28 @@ bool idle_startup() // NOTE: Hits "Attempted getFields with no login view shown" warning, since we don't // show the login view until login_show() is called below. if (gUserCredential.isNull()) - { + { + display_startup(); gUserCredential = gLoginHandler.initializeLoginInfo(); + display_startup(); } if (gHeadlessClient) { LL_WARNS("AppInit") << "Waiting at connection box in headless client. Did you mean to add autologin params?" << LL_ENDL; } // Make sure the process dialog doesn't hide things + display_startup(); gViewerWindow->setShowProgress(FALSE); - + display_startup(); // Show the login dialog login_show(); + display_startup(); // connect dialog is already shown, so fill in the names if (gUserCredential.notNull()) { LLPanelLogin::setFields( gUserCredential, gRememberPassword); } + display_startup(); LLPanelLogin::giveFocus(); LLStartUp::setStartupState( STATE_LOGIN_WAIT ); // Wait for user input @@ -773,14 +782,19 @@ bool idle_startup() LLStartUp::setStartupState( STATE_LOGIN_CLEANUP ); } + display_startup(); gViewerWindow->setNormalControlsVisible( FALSE ); + display_startup(); gLoginMenuBarView->setVisible( TRUE ); + display_startup(); gLoginMenuBarView->setEnabled( TRUE ); + display_startup(); show_debug_menus(); + display_startup(); // Hide the splash screen LLSplashScreen::hide(); - + display_startup(); // Push our window frontmost gViewerWindow->getWindow()->show(); display_startup(); @@ -789,7 +803,10 @@ bool idle_startup() // first made visible. #ifdef _WIN32 MSG msg; - while( PeekMessage( &msg, /*All hWnds owned by this thread */ NULL, WM_KEYFIRST, WM_KEYLAST, PM_REMOVE ) ); + while( PeekMessage( &msg, /*All hWnds owned by this thread */ NULL, WM_KEYFIRST, WM_KEYLAST, PM_REMOVE ) ) + { + display_startup(); + } #endif timeout.reset(); return FALSE; @@ -804,7 +821,7 @@ bool idle_startup() // Don't do anything. Wait for the login view to call the login_callback, // which will push us to the next state. - + display_startup(); // Sleep so we don't spin the CPU ms_sleep(1); return FALSE; @@ -1172,37 +1189,51 @@ bool idle_startup() // Finish agent initialization. (Requires gSavedSettings, builds camera) gAgent.init(); + display_startup(); gAgentCamera.init(); + display_startup(); set_underclothes_menu_options(); + display_startup(); // Since we connected, save off the settings so the user doesn't have to // type the name/password again if we crash. gSavedSettings.saveToFile(gSavedSettings.getString("ClientSettingsFile"), TRUE); LLUIColorTable::instance().saveUserSettings(); + display_startup(); + // // Initialize classes w/graphics stuff. // gTextureList.doPrefetchImages(); + display_startup(); + LLSurface::initClasses(); + display_startup(); + LLFace::initClass(); + display_startup(); LLDrawable::initClass(); + display_startup(); // init the shader managers LLPostProcess::initClass(); + display_startup(); LLViewerObject::initVOClasses(); + display_startup(); // Initialize all our tools. Must be done after saved settings loaded. // NOTE: This also is where gToolMgr used to be instantiated before being turned into a singleton. LLToolMgr::getInstance()->initTools(); + display_startup(); // Pre-load floaters, like the world map, that are slow to spawn // due to XML complexity. gViewerWindow->initWorldUI(); - + display_startup(); // This is where we used to initialize gWorldp. Original comment said: @@ -1210,24 +1241,26 @@ bool idle_startup() // User might have overridden far clip LLWorld::getInstance()->setLandFarClip(gAgentCamera.mDrawDistance); - + display_startup(); // Before we create the first region, we need to set the agent's mOriginGlobal // This is necessary because creating objects before this is set will result in a // bad mPositionAgent cache. gAgent.initOriginGlobal(from_region_handle(gFirstSimHandle)); + display_startup(); LLWorld::getInstance()->addRegion(gFirstSimHandle, gFirstSim); + display_startup(); LLViewerRegion *regionp = LLWorld::getInstance()->getRegionFromHandle(gFirstSimHandle); LL_INFOS("AppInit") << "Adding initial simulator " << regionp->getOriginGlobal() << LL_ENDL; regionp->setSeedCapability(gFirstSimSeedCap); LL_DEBUGS("AppInit") << "Waiting for seed grant ...." << LL_ENDL; - + display_startup(); // Set agent's initial region to be the one we just created. gAgent.setRegion(regionp); - + display_startup(); // Set agent's initial position, which will be read by LLVOAvatar when the avatar // object is created. I think this must be done after setting the region. JC gAgent.setPositionAgent(agent_start_position_region); @@ -1247,6 +1280,7 @@ bool idle_startup() { LLStartUp::multimediaInit(); LLStartUp::setStartupState( STATE_FONT_INIT ); + display_startup(); return FALSE; } @@ -1255,6 +1289,7 @@ bool idle_startup() { LLStartUp::fontInit(); LLStartUp::setStartupState( STATE_SEED_GRANTED_WAIT ); + display_startup(); return FALSE; } @@ -1282,6 +1317,7 @@ bool idle_startup() set_startup_status(0.4f, LLTrans::getString("LoginRequestSeedCapGrant"), gAgent.mMOTD); } } + display_startup(); return FALSE; } @@ -1292,7 +1328,9 @@ bool idle_startup() //--------------------------------------------------------------------- if (STATE_SEED_CAP_GRANTED == LLStartUp::getStartupState()) { + display_startup(); update_texture_fetch(); + display_startup(); if ( gViewerWindow != NULL) { // This isn't the first logon attempt, so show the UI @@ -1300,12 +1338,15 @@ bool idle_startup() } gLoginMenuBarView->setVisible( FALSE ); gLoginMenuBarView->setEnabled( FALSE ); + display_startup(); // direct logging to the debug console's line buffer LLError::logToFixedBuffer(gDebugView->mDebugConsolep); + display_startup(); // set initial visibility of debug console gDebugView->mDebugConsolep->setVisible(gSavedSettings.getBOOL("ShowDebugConsole")); + display_startup(); // // Set message handlers @@ -1314,22 +1355,28 @@ bool idle_startup() // register callbacks for messages. . . do this after initial handshake to make sure that we don't catch any unwanted register_viewer_callbacks(gMessageSystem); + display_startup(); // Debugging info parameters gMessageSystem->setMaxMessageTime( 0.5f ); // Spam if decoding all msgs takes more than 500 ms + display_startup(); #ifndef LL_RELEASE_FOR_DOWNLOAD gMessageSystem->setTimeDecodes( TRUE ); // Time the decode of each msg gMessageSystem->setTimeDecodesSpamThreshold( 0.05f ); // Spam if a single msg takes over 50ms to decode #endif + display_startup(); gXferManager->registerCallbacks(gMessageSystem); + display_startup(); LLStartUp::initNameCache(); + display_startup(); // update the voice settings *after* gCacheName initialization // so that we can construct voice UI that relies on the name cache LLVoiceClient::getInstance()->updateSettings(); + display_startup(); //gCacheName is required for nearby chat history loading //so I just moved nearby history loading a few states further @@ -1338,12 +1385,14 @@ bool idle_startup() LLNearbyChat* nearby_chat = LLNearbyChat::getInstance(); if (nearby_chat) nearby_chat->loadHistory(); } + display_startup(); // *Note: this is where gWorldMap used to be initialized. // register null callbacks for audio until the audio system is initialized gMessageSystem->setHandlerFuncFast(_PREHASH_SoundTrigger, null_message_callback, NULL); gMessageSystem->setHandlerFuncFast(_PREHASH_AttachedSound, null_message_callback, NULL); + display_startup(); //reset statistics LLViewerStats::getInstance()->resetStats(); @@ -1373,6 +1422,7 @@ bool idle_startup() LLViewerCamera::getInstance()->setAspect(gViewerWindow->getWorldViewAspectRatio()); // Initialize FOV LLViewerCamera::getInstance()->setDefaultFOV(gSavedSettings.getF32("CameraAngle")); + display_startup(); // Move agent to starting location. The position handed to us by // the space server is in global coordinates, but the agent frame @@ -1383,6 +1433,7 @@ bool idle_startup() gAgent.resetAxes(gAgentStartLookAt); gAgentCamera.stopCameraAnimation(); gAgentCamera.resetCamera(); + display_startup(); // Initialize global class data needed for surfaces (i.e. textures) LL_DEBUGS("AppInit") << "Initializing sky..." << LL_ENDL; @@ -1395,6 +1446,8 @@ bool idle_startup() LLGLState::checkStates(); LLGLState::checkTextureChannels(); + display_startup(); + LL_DEBUGS("AppInit") << "Decoding images..." << LL_ENDL; // For all images pre-loaded into viewer cache, decode them. // Need to do this AFTER we init the sky @@ -1408,6 +1461,8 @@ bool idle_startup() } LLStartUp::setStartupState( STATE_WORLD_WAIT ); + display_startup(); + // JC - Do this as late as possible to increase likelihood Purify // will run. LLMessageSystem* msg = gMessageSystem; @@ -1435,6 +1490,7 @@ bool idle_startup() NULL); timeout.reset(); + display_startup(); return FALSE; } @@ -1453,8 +1509,10 @@ bool idle_startup() LLMessageSystem* msg = gMessageSystem; while (msg->checkAllMessages(gFrameCount, gServicePump)) { + display_startup(); } msg->processAcks(); + display_startup(); return FALSE; } @@ -1465,6 +1523,7 @@ bool idle_startup() { LL_DEBUGS("AppInit") << "Connecting to region..." << LL_ENDL; set_startup_status(0.60f, LLTrans::getString("LoginConnectingToRegion"), gAgent.mMOTD); + display_startup(); // register with the message system so it knows we're // expecting this message LLMessageSystem* msg = gMessageSystem; @@ -1480,6 +1539,7 @@ bool idle_startup() msg->newMessageFast(_PREHASH_EconomyDataRequest); gAgent.sendReliableMessage(); } + display_startup(); // Create login effect // But not on first login, because you can't see your avatar then @@ -1494,6 +1554,7 @@ bool idle_startup() LLStartUp::setStartupState( STATE_AGENT_WAIT ); // Go to STATE_AGENT_WAIT timeout.reset(); + display_startup(); return FALSE; } @@ -1518,14 +1579,17 @@ bool idle_startup() LL_DEBUGS("AppInit") << "Awaiting AvatarInitComplete, got " << msg->getMessageName() << LL_ENDL; } + display_startup(); } msg->processAcks(); + display_startup(); + if (gAgentMovementCompleted) { LLStartUp::setStartupState( STATE_INVENTORY_SEND ); } - + display_startup(); return FALSE; } @@ -1534,9 +1598,10 @@ bool idle_startup() //--------------------------------------------------------------------- if (STATE_INVENTORY_SEND == LLStartUp::getStartupState()) { + display_startup(); // Inform simulator of our language preference LLAgentLanguage::update(); - + display_startup(); // unpack thin inventory LLSD response = LLLoginInstance::getInstance()->getResponse(); //bool dump_buffer = false; @@ -1551,6 +1616,7 @@ bool idle_startup() gInventory.setLibraryRootFolderID(id.asUUID()); } } + display_startup(); LLSD inv_lib_owner = response["inventory-lib-owner"]; if(inv_lib_owner.isDefined()) @@ -1562,6 +1628,7 @@ bool idle_startup() gInventory.setLibraryOwnerID( LLUUID(id.asUUID())); } } + display_startup(); LLSD inv_skel_lib = response["inventory-skel-lib"]; if(inv_skel_lib.isDefined() && gInventory.getLibraryOwnerID().notNull()) @@ -1571,6 +1638,7 @@ bool idle_startup() LL_WARNS("AppInit") << "Problem loading inventory-skel-lib" << LL_ENDL; } } + display_startup(); LLSD inv_skeleton = response["inventory-skeleton"]; if(inv_skeleton.isDefined()) @@ -1580,6 +1648,7 @@ bool idle_startup() LL_WARNS("AppInit") << "Problem loading inventory-skel-targets" << LL_ENDL; } } + display_startup(); LLSD inv_basic = response["inventory-basic"]; if(inv_basic.isDefined()) @@ -1617,6 +1686,7 @@ bool idle_startup() list[agent_id] = new LLRelationship(given_rights, has_rights, false); } LLAvatarTracker::instance().addBuddyList(list); + display_startup(); } bool show_hud = false; @@ -1644,6 +1714,8 @@ bool idle_startup() //} } } + display_startup(); + // Either we want to show tutorial because this is the first login // to a Linden Help Island or the user quit with the tutorial // visible. JC @@ -1651,22 +1723,26 @@ bool idle_startup() { LLFloaterReg::showInstance("hud", LLSD(), FALSE); } + display_startup(); LLSD event_notifications = response["event_notifications"]; if(event_notifications.isDefined()) { gEventNotifier.load(event_notifications); } + display_startup(); LLSD classified_categories = response["classified_categories"]; if(classified_categories.isDefined()) { LLClassifiedInfo::loadCategories(classified_categories); } + display_startup(); // This method MUST be called before gInventory.findCategoryUUIDForType because of // gInventory.mIsAgentInvUsable is set to true in the gInventory.buildParentChildMap. gInventory.buildParentChildMap(); + display_startup(); //all categories loaded. lets create "My Favorites" category gInventory.findCategoryUUIDForType(LLFolderType::FT_FAVORITE,true); @@ -1680,24 +1756,26 @@ bool idle_startup() LLAvatarTracker::instance().registerCallbacks(msg); llinfos << " Landmark" << llendl; LLLandmark::registerCallbacks(msg); + display_startup(); // request mute list llinfos << "Requesting Mute List" << llendl; LLMuteList::getInstance()->requestFromServer(gAgent.getID()); - + display_startup(); // Get L$ and ownership credit information llinfos << "Requesting Money Balance" << llendl; LLStatusBar::sendMoneyBalanceRequest(); - + display_startup(); // request all group information llinfos << "Requesting Agent Data" << llendl; gAgent.sendAgentDataUpdateRequest(); - + display_startup(); // Create the inventory views llinfos << "Creating Inventory Views" << llendl; LLFloaterReg::getInstance("inventory"); - + display_startup(); LLStartUp::setStartupState( STATE_MISC ); + display_startup(); return FALSE; } @@ -1746,17 +1824,23 @@ bool idle_startup() gSavedSettings.setBOOL("ShowStartLocation", TRUE); } + display_startup(); + if (gSavedSettings.getBOOL("HelpFloaterOpen")) { // show default topic LLViewerHelp::instance().showTopic(""); } + display_startup(); + // We're successfully logged in. gSavedSettings.setBOOL("FirstLoginThisInstall", FALSE); LLFloaterReg::showInitialVisibleInstances(); + display_startup(); + // based on the comments, we've successfully logged in so we can delete the 'forced' // URL that the updater set in settings.ini (in a mostly paranoid fashion) std::string nextLoginLocation = gSavedSettings.getString( "NextLoginLocation" ); @@ -1770,8 +1854,10 @@ bool idle_startup() LLUIColorTable::instance().saveUserSettings(); }; + display_startup(); // JC: Initializing audio requests many sounds for download. init_audio(); + display_startup(); // JC: Initialize "active" gestures. This may also trigger // many gesture downloads, if this is the user's first @@ -1809,6 +1895,7 @@ bool idle_startup() LLGestureMgr::instance().startFetch(); } gDisplaySwapBuffers = TRUE; + display_startup(); LLMessageSystem* msg = gMessageSystem; msg->setHandlerFuncFast(_PREHASH_SoundTrigger, process_sound_trigger); @@ -1883,8 +1970,10 @@ bool idle_startup() } } + display_startup(); //DEV-17797. get null folder. Any items found here moved to Lost and Found LLInventoryModelBackgroundFetch::instance().findLostItems(); + display_startup(); LLStartUp::setStartupState( STATE_PRECACHE ); timeout.reset(); @@ -1893,6 +1982,7 @@ bool idle_startup() if (STATE_PRECACHE == LLStartUp::getStartupState()) { + display_startup(); F32 timeout_frac = timeout.getElapsedTimeF32()/PRECACHING_DELAY; // We now have an inventory skeleton, so if this is a user's first @@ -1909,6 +1999,8 @@ bool idle_startup() LLStartUp::loadInitialOutfit( sInitialOutfit, sInitialOutfitGender ); } + display_startup(); + // wait precache-delay and for agent's avatar or a lot longer. if(((timeout_frac > 1.f) && isAgentAvatarValid()) || (timeout_frac > 3.f)) @@ -1922,11 +2014,6 @@ bool idle_startup() LLTrans::getString("LoginPrecaching"), gAgent.mMOTD); display_startup(); - if (!LLViewerShaderMgr::sInitialized) - { - LLViewerShaderMgr::sInitialized = TRUE; - LLViewerShaderMgr::instance()->setShaders(); - } } return TRUE; @@ -1955,6 +2042,8 @@ bool idle_startup() return TRUE; } + display_startup(); + if (wearables_time > MAX_WEARABLES_TIME) { LLNotificationsUtil::add("ClothingLoading"); @@ -1986,16 +2075,20 @@ bool idle_startup() } } + display_startup(); update_texture_fetch(); + display_startup(); set_startup_status(0.9f + 0.1f * wearables_time / MAX_WEARABLES_TIME, LLTrans::getString("LoginDownloadingClothing").c_str(), gAgent.mMOTD.c_str()); + display_startup(); return TRUE; } if (STATE_CLEANUP == LLStartUp::getStartupState()) { set_startup_status(1.0, "", ""); + display_startup(); // Let the map know about the inventory. LLFloaterWorldMap* floater_world_map = LLFloaterWorldMap::getInstance(); @@ -2011,6 +2104,7 @@ bool idle_startup() //gViewerWindow->revealIntroPanel(); gViewerWindow->setStartupComplete(); gViewerWindow->setProgressCancelButtonVisible(FALSE); + display_startup(); // We're not away from keyboard, even though login might have taken // a while. JC @@ -2033,7 +2127,7 @@ bool idle_startup() show_debug_menus(); // Debug menu visiblity and First Use trigger // If we've got a startup URL, dispatch it - LLStartUp::dispatchURL(); + //LLStartUp::dispatchURL(); // Retrieve information about the land data // (just accessing this the first time will fetch it, @@ -2046,6 +2140,7 @@ bool idle_startup() // LLUserAuth::getInstance()->reset(); LLStartUp::setStartupState( STATE_STARTED ); + display_startup(); // Unmute audio if desired and setup volumes. // Unmute audio if desired and setup volumes. @@ -2070,6 +2165,7 @@ bool idle_startup() LLAgentPicksInfo::getInstance()->requestNumberOfPicks(); LLIMFloater::initIMFloater(); + display_startup(); return TRUE; } @@ -2091,7 +2187,12 @@ void login_show() #else BOOL bUseDebugLogin = TRUE; #endif - + // Hide the toolbars: may happen to come back here if login fails after login agent but before login in region + if (gToolBarView) + { + gToolBarView->setVisible(FALSE); + } + LLPanelLogin::show( gViewerWindow->getWindowRectScaled(), bUseDebugLogin || gSavedSettings.getBOOL("SecondLifeEnterprise"), login_callback, NULL ); @@ -2688,12 +2789,12 @@ void LLStartUp::cleanupNameCache() bool LLStartUp::dispatchURL() { // ok, if we've gotten this far and have a startup URL - if (!getStartSLURL().isValid()) + if (!getStartSLURL().isValid()) { return false; } - if(getStartSLURL().getType() != LLSLURL::APP) - { + if(getStartSLURL().getType() != LLSLURL::APP) + { // If we started with a location, but we're already // at that location, don't pop dialogs open. diff --git a/indra/newview/llstatusbar.cpp b/indra/newview/llstatusbar.cpp index 75db269bde..89240c982f 100644 --- a/indra/newview/llstatusbar.cpp +++ b/indra/newview/llstatusbar.cpp @@ -114,6 +114,7 @@ LLStatusBar::LLStatusBar(const LLRect& rect) mTextTime(NULL), mSGBandwidth(NULL), mSGPacketLoss(NULL), + mBtnStats(NULL), mBtnVolume(NULL), mBoxBalance(NULL), mBalance(0), @@ -173,6 +174,8 @@ BOOL LLStatusBar::postBuild() mBoxBalance = getChild<LLTextBox>("balance"); mBoxBalance->setClickedCallback( &LLStatusBar::onClickBalance, this ); + + mBtnStats = getChildView("stat_btn"); mBtnVolume = getChild<LLButton>( "volume_btn" ); mBtnVolume->setClickedCallback( onClickVolume, this ); @@ -288,7 +291,7 @@ void LLStatusBar::refresh() mSGBandwidth->setVisible(net_stats_visible); mSGPacketLoss->setVisible(net_stats_visible); - getChildView("stat_btn")->setEnabled(net_stats_visible); + mBtnStats->setEnabled(net_stats_visible); // update the master volume button state bool mute_audio = LLAppViewer::instance()->getMasterSystemAudioMute(); diff --git a/indra/newview/llstatusbar.h b/indra/newview/llstatusbar.h index 4ea3183d18..9d28e6c2bc 100644 --- a/indra/newview/llstatusbar.h +++ b/indra/newview/llstatusbar.h @@ -102,10 +102,11 @@ private: LLStatGraph *mSGBandwidth; LLStatGraph *mSGPacketLoss; + LLView *mBtnStats; LLButton *mBtnVolume; LLTextBox *mBoxBalance; LLButton *mMediaToggle; - LLView* mScriptOut; + LLView *mScriptOut; LLFrameTimer mClockUpdateTimer; S32 mBalance; diff --git a/indra/newview/llsyswellwindow.cpp b/indra/newview/llsyswellwindow.cpp index ffe864e220..3aa6a3b7e5 100644 --- a/indra/newview/llsyswellwindow.cpp +++ b/indra/newview/llsyswellwindow.cpp @@ -203,10 +203,9 @@ void LLSysWellWindow::reshapeWindow() { new_window_height = MAX_WINDOW_HEIGHT; } - S32 newY = curRect.mTop + new_window_height - curRect.getHeight(); - S32 newWidth = curRect.getWidth() < MIN_WINDOW_WIDTH ? MIN_WINDOW_WIDTH - : curRect.getWidth(); - curRect.setLeftTopAndSize(curRect.mLeft, newY, newWidth, new_window_height); + S32 newWidth = curRect.getWidth() < MIN_WINDOW_WIDTH ? MIN_WINDOW_WIDTH : curRect.getWidth(); + + curRect.setLeftTopAndSize(curRect.mLeft, curRect.mTop, newWidth, new_window_height); reshape(curRect.getWidth(), curRect.getHeight(), TRUE); setRect(curRect); } diff --git a/indra/newview/lltexlayer.cpp b/indra/newview/lltexlayer.cpp index e8abee2fb7..6f6d5dbf12 100644 --- a/indra/newview/lltexlayer.cpp +++ b/indra/newview/lltexlayer.cpp @@ -216,22 +216,22 @@ void LLTexLayerSetBuffer::cancelUpload() void LLTexLayerSetBuffer::pushProjection() const { - glMatrixMode(GL_PROJECTION); + gGL.matrixMode(LLRender::MM_PROJECTION); gGL.pushMatrix(); - glLoadIdentity(); - glOrtho(0.0f, mFullWidth, 0.0f, mFullHeight, -1.0f, 1.0f); + gGL.loadIdentity(); + gGL.ortho(0.0f, mFullWidth, 0.0f, mFullHeight, -1.0f, 1.0f); - glMatrixMode(GL_MODELVIEW); + gGL.matrixMode(LLRender::MM_MODELVIEW); gGL.pushMatrix(); - glLoadIdentity(); + gGL.loadIdentity(); } void LLTexLayerSetBuffer::popProjection() const { - glMatrixMode(GL_PROJECTION); + gGL.matrixMode(LLRender::MM_PROJECTION); gGL.popMatrix(); - glMatrixMode(GL_MODELVIEW); + gGL.matrixMode(LLRender::MM_MODELVIEW); gGL.popMatrix(); } @@ -294,18 +294,22 @@ BOOL LLTexLayerSetBuffer::render() const BOOL update_now = mNeedsUpdate && isReadyToUpdate(); BOOL success = TRUE; - - //hack to use fixed function when updating tex layer sets - bool no_ff = LLGLSLShader::sNoFixedFunction; - LLGLSLShader::sNoFixedFunction = false; + bool use_shaders = LLGLSLShader::sNoFixedFunction; + + if (use_shaders) + { + gAlphaMaskProgram.bind(); + gAlphaMaskProgram.setMinimumAlpha(0.004f); + } + + LLVertexBuffer::unbind(); + // Composite the color data LLGLSUIDefault gls_ui; success &= mTexLayerSet->render( mOrigin.mX, mOrigin.mY, mFullWidth, mFullHeight ); gGL.flush(); - LLGLSLShader::sNoFixedFunction = no_ff; - if(upload_now) { if (!success) @@ -335,6 +339,13 @@ BOOL LLTexLayerSetBuffer::render() doUpdate(); } + if (use_shaders) + { + gAlphaMaskProgram.unbind(); + } + + LLVertexBuffer::unbind(); + // reset GL state gGL.setColorMask(true, true); gGL.setSceneBlendType(LLRender::BT_ALPHA); @@ -924,6 +935,8 @@ BOOL LLTexLayerSet::render( S32 x, S32 y, S32 width, S32 height ) } } + bool use_shaders = LLGLSLShader::sNoFixedFunction; + LLGLSUIDefault gls_ui; LLGLDepthTest gls_depth(GL_FALSE, GL_FALSE); gGL.setColorMask(true, true); @@ -932,12 +945,20 @@ BOOL LLTexLayerSet::render( S32 x, S32 y, S32 width, S32 height ) { gGL.flush(); LLGLDisable no_alpha(GL_ALPHA_TEST); + if (use_shaders) + { + gAlphaMaskProgram.setMinimumAlpha(0.0f); + } gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); gGL.color4f( 0.f, 0.f, 0.f, 1.f ); gl_rect_2d_simple( width, height ); gGL.flush(); + if (use_shaders) + { + gAlphaMaskProgram.setMinimumAlpha(0.004f); + } } if (mIsVisible) @@ -964,6 +985,11 @@ BOOL LLTexLayerSet::render( S32 x, S32 y, S32 width, S32 height ) gGL.setSceneBlendType(LLRender::BT_REPLACE); LLGLDisable no_alpha(GL_ALPHA_TEST); + if (use_shaders) + { + gAlphaMaskProgram.setMinimumAlpha(0.f); + } + gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); gGL.color4f( 0.f, 0.f, 0.f, 0.f ); @@ -971,7 +997,10 @@ BOOL LLTexLayerSet::render( S32 x, S32 y, S32 width, S32 height ) gGL.setSceneBlendType(LLRender::BT_ALPHA); gGL.flush(); - + if (use_shaders) + { + gAlphaMaskProgram.setMinimumAlpha(0.004f); + } } return success; @@ -1078,13 +1107,14 @@ void LLTexLayerSet::renderAlphaMaskTextures(S32 x, S32 y, S32 width, S32 height, { const LLTexLayerSetInfo *info = getInfo(); + bool use_shaders = LLGLSLShader::sNoFixedFunction; + gGL.setColorMask(false, true); gGL.setSceneBlendType(LLRender::BT_REPLACE); // (Optionally) replace alpha with a single component image from a tga file. if (!info->mStaticAlphaFileName.empty()) { - LLGLSNoAlphaTest gls_no_alpha_test; gGL.flush(); { LLViewerTexture* tex = LLTexLayerStaticImageList::getInstance()->getTexture(info->mStaticAlphaFileName, TRUE); @@ -1103,12 +1133,20 @@ void LLTexLayerSet::renderAlphaMaskTextures(S32 x, S32 y, S32 width, S32 height, // Set the alpha channel to one (clean up after previous blending) gGL.flush(); LLGLDisable no_alpha(GL_ALPHA_TEST); + if (use_shaders) + { + gAlphaMaskProgram.setMinimumAlpha(0.f); + } gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); gGL.color4f( 0.f, 0.f, 0.f, 1.f ); gl_rect_2d_simple( width, height ); gGL.flush(); + if (use_shaders) + { + gAlphaMaskProgram.setMinimumAlpha(0.004f); + } } // (Optional) Mask out part of the baked texture with alpha masks @@ -1593,6 +1631,8 @@ BOOL LLTexLayer::render(S32 x, S32 y, S32 width, S32 height) LLGLEnable color_mat(GL_COLOR_MATERIAL); gPipeline.disableLights(); + bool use_shaders = LLGLSLShader::sNoFixedFunction; + LLColor4 net_color; BOOL color_specified = findNetColor(&net_color); @@ -1673,8 +1713,13 @@ BOOL LLTexLayer::render(S32 x, S32 y, S32 width, S32 height) { if( tex ) { - LLGLDisable alpha_test(getInfo()->mWriteAllChannels ? GL_ALPHA_TEST : 0); - + bool no_alpha_test = getInfo()->mWriteAllChannels; + LLGLDisable alpha_test(no_alpha_test ? GL_ALPHA_TEST : 0); + if (use_shaders && no_alpha_test) + { + gAlphaMaskProgram.setMinimumAlpha(0.f); + } + LLTexUnit::eTextureAddressMode old_mode = tex->getAddressMode(); gGL.getTexUnit(0)->bind(tex, TRUE); @@ -1684,6 +1729,11 @@ BOOL LLTexLayer::render(S32 x, S32 y, S32 width, S32 height) gGL.getTexUnit(0)->setTextureAddressMode(old_mode); gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); + if (use_shaders && no_alpha_test) + { + gAlphaMaskProgram.setMinimumAlpha(0.004f); + } + } } // else @@ -1716,9 +1766,17 @@ BOOL LLTexLayer::render(S32 x, S32 y, S32 width, S32 height) color_specified ) { LLGLDisable no_alpha(GL_ALPHA_TEST); + if (use_shaders) + { + gAlphaMaskProgram.setMinimumAlpha(0.f); + } gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); gGL.color4fv( net_color.mV ); gl_rect_2d_simple( width, height ); + if (use_shaders) + { + gAlphaMaskProgram.setMinimumAlpha(0.004f); + } } if( alpha_mask_specified || getInfo()->mWriteAllChannels ) @@ -1806,15 +1864,25 @@ BOOL LLTexLayer::blendAlphaTexture(S32 x, S32 y, S32 width, S32 height) gGL.flush(); + bool use_shaders = LLGLSLShader::sNoFixedFunction; + if( !getInfo()->mStaticImageFileName.empty() ) { LLViewerTexture* tex = LLTexLayerStaticImageList::getInstance()->getTexture( getInfo()->mStaticImageFileName, getInfo()->mStaticImageIsMask ); if( tex ) { LLGLSNoAlphaTest gls_no_alpha_test; + if (use_shaders) + { + gAlphaMaskProgram.setMinimumAlpha(0.f); + } gGL.getTexUnit(0)->bind(tex, TRUE); gl_rect_2d_simple_tex( width, height ); gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); + if (use_shaders) + { + gAlphaMaskProgram.setMinimumAlpha(0.004f); + } } else { @@ -1829,10 +1897,18 @@ BOOL LLTexLayer::blendAlphaTexture(S32 x, S32 y, S32 width, S32 height) if (tex) { LLGLSNoAlphaTest gls_no_alpha_test; + if (use_shaders) + { + gAlphaMaskProgram.setMinimumAlpha(0.f); + } gGL.getTexUnit(0)->bind(tex); gl_rect_2d_simple_tex( width, height ); gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); success = TRUE; + if (use_shaders) + { + gAlphaMaskProgram.setMinimumAlpha(0.004f); + } } } } @@ -1851,6 +1927,13 @@ BOOL LLTexLayer::renderMorphMasks(S32 x, S32 y, S32 width, S32 height, const LLC llassert( !mParamAlphaList.empty() ); + bool use_shaders = LLGLSLShader::sNoFixedFunction; + + if (use_shaders) + { + gAlphaMaskProgram.setMinimumAlpha(0.f); + } + gGL.setColorMask(false, true); LLTexLayerParamAlpha* first_param = *mParamAlphaList.begin(); @@ -1888,7 +1971,6 @@ BOOL LLTexLayer::renderMorphMasks(S32 x, S32 y, S32 width, S32 height, const LLC if( tex && (tex->getComponents() == 4) ) { LLGLSNoAlphaTest gls_no_alpha_test; - LLTexUnit::eTextureAddressMode old_mode = tex->getAddressMode(); gGL.getTexUnit(0)->bind(tex, TRUE); @@ -1927,6 +2009,10 @@ BOOL LLTexLayer::renderMorphMasks(S32 x, S32 y, S32 width, S32 height, const LLC gl_rect_2d_simple( width, height ); } + if (use_shaders) + { + gAlphaMaskProgram.setMinimumAlpha(0.004f); + } LLGLSUIDefault gls_ui; diff --git a/indra/newview/lltexturecache.cpp b/indra/newview/lltexturecache.cpp index 70b0a31308..e7a176f4f9 100644 --- a/indra/newview/lltexturecache.cpp +++ b/indra/newview/lltexturecache.cpp @@ -1641,8 +1641,8 @@ void LLTextureCache::purgeTextures(bool validate) { purge_count++; LL_DEBUGS("TextureCache") << "PURGING: " << filename << LL_ENDL; - removeEntry(idx, entries[idx], filename) ; cache_size -= entries[idx].mBodySize; + removeEntry(idx, entries[idx], filename) ; } } @@ -1879,13 +1879,12 @@ void LLTextureCache::removeEntry(S32 idx, Entry& entry, std::string& filename) file_maybe_exists = false; } } + mTexturesSizeTotal -= entry.mBodySize; entry.mImageSize = -1; entry.mBodySize = 0; mHeaderIDMap.erase(entry.mID); - mTexturesSizeMap.erase(entry.mID); - - mTexturesSizeTotal -= entry.mBodySize; + mTexturesSizeMap.erase(entry.mID); mFreeList.insert(idx); } diff --git a/indra/newview/lltextureview.cpp b/indra/newview/lltextureview.cpp index 6547154bc4..1c89766b26 100644 --- a/indra/newview/lltextureview.cpp +++ b/indra/newview/lltextureview.cpp @@ -527,11 +527,12 @@ void LLGLTexMemBar::draw() LLFontGL::getFontMonospace()->renderUTF8(text, 0, 0, v_offset + line_height*6, text_color, LLFontGL::LEFT, LLFontGL::TOP); - text = llformat("GL Tot: %d/%d MB Bound: %d/%d MB Raw Tot: %d MB Bias: %.2f Cache: %.1f/%.1f MB Net Tot Tex: %.1f MB Tot Obj: %.1f MB Tot Htp: %d", + text = llformat("GL Tot: %d/%d MB Bound: %d/%d MB FBO: %d MB Raw Tot: %d MB Bias: %.2f Cache: %.1f/%.1f MB Net Tot Tex: %.1f MB Tot Obj: %.1f MB Tot Htp: %d", total_mem, max_total_mem, bound_mem, max_bound_mem, + LLRenderTarget::sBytesAllocated/(1024*1024), LLImageRaw::sGlobalRawMemory >> 20, discard_bias, cache_usage, cache_max_usage, total_texture_downloaded, total_object_downloaded, total_http_requests); //, cache_entries, cache_max_entries @@ -571,7 +572,7 @@ void LLGLTexMemBar::draw() color = (total_mem < llfloor(max_total_mem * texmem_lower_bound_scale)) ? LLColor4::green : (total_mem < max_total_mem) ? LLColor4::yellow : LLColor4::red; color[VALPHA] = .75f; - glColor4fv(color.mV); + gGL.diffuseColor4fv(color.mV); gl_rect_2d(left, top, right, bottom); // red/yellow/green @@ -594,7 +595,7 @@ void LLGLTexMemBar::draw() color = (bound_mem < llfloor(max_bound_mem * texmem_lower_bound_scale)) ? LLColor4::green : (bound_mem < max_bound_mem) ? LLColor4::yellow : LLColor4::red; color[VALPHA] = .75f; - glColor4fv(color.mV); + gGL.diffuseColor4fv(color.mV); gl_rect_2d(left, top, right, bottom); #else diff --git a/indra/newview/lltoast.cpp b/indra/newview/lltoast.cpp index e0b07ed408..c4b226b70b 100644 --- a/indra/newview/lltoast.cpp +++ b/indra/newview/lltoast.cpp @@ -113,7 +113,8 @@ LLToast::LLToast(const LLToast::Params& p) mHideBtnPressed(false), mIsTip(p.is_tip), mWrapperPanel(NULL), - mIsFading(false) + mIsFading(false), + mIsHovered(false) { mTimer.reset(new LLToastLifeTimer(this, p.lifetime_secs)); @@ -122,8 +123,6 @@ LLToast::LLToast(const LLToast::Params& p) setCanDrag(FALSE); mWrapperPanel = getChild<LLPanel>("wrapper_panel"); - mWrapperPanel->setMouseEnterCallback(boost::bind(&LLToast::onToastMouseEnter, this)); - mWrapperPanel->setMouseLeaveCallback(boost::bind(&LLToast::onToastMouseLeave, this)); setBackgroundOpaque(TRUE); // *TODO: obsolete updateTransparency(); @@ -137,8 +136,6 @@ LLToast::LLToast(const LLToast::Params& p) { mHideBtn = getChild<LLButton>("hide_btn"); mHideBtn->setClickedCallback(boost::bind(&LLToast::hide,this)); - mHideBtn->setMouseEnterCallback(boost::bind(&LLToast::onToastMouseEnter, this)); - mHideBtn->setMouseLeaveCallback(boost::bind(&LLToast::onToastMouseLeave, this)); } // init callbacks if present @@ -331,6 +328,55 @@ void LLToast::draw() drawChild(mHideBtn); } } + + updateHoveredState(); + + LLToastLifeTimer* timer = getTimer(); + if (!timer) + { + return; + } + + // Started timer means the mouse had left the toast previously. + // If toast is hovered in the current frame we should handle + // a mouse enter event. + if(timer->getStarted() && mIsHovered) + { + mOnToastHoverSignal(this, MOUSE_ENTER); + + updateTransparency(); + + //toasts fading is management by Screen Channel + + sendChildToFront(mHideBtn); + if(mHideBtn && mHideBtn->getEnabled()) + { + mHideBtn->setVisible(TRUE); + } + mToastMouseEnterSignal(this, getValue()); + } + // Stopped timer means the mouse had entered the toast previously. + // If the toast is not hovered in the current frame we should handle + // a mouse leave event. + else if(!timer->getStarted() && !mIsHovered) + { + mOnToastHoverSignal(this, MOUSE_LEAVE); + + updateTransparency(); + + //toasts fading is management by Screen Channel + + if(mHideBtn && mHideBtn->getEnabled()) + { + if( mHideBtnPressed ) + { + mHideBtnPressed = false; + return; + } + mHideBtn->setVisible(FALSE); + } + mToastMouseLeaveSignal(this, getValue()); + } } //-------------------------------------------------------------------------- @@ -378,37 +424,11 @@ void LLToast::setVisible(BOOL show) } } -void LLToast::onToastMouseEnter() +void LLToast::updateHoveredState() { - LLRect panel_rc = mWrapperPanel->calcScreenRect(); - LLRect button_rc; - if(mHideBtn) - { - button_rc = mHideBtn->calcScreenRect(); - } - S32 x, y; LLUI::getMousePositionScreen(&x, &y); - if(panel_rc.pointInRect(x, y) || button_rc.pointInRect(x, y)) - { - mOnToastHoverSignal(this, MOUSE_ENTER); - - updateTransparency(); - - //toasts fading is management by Screen Channel - - sendChildToFront(mHideBtn); - if(mHideBtn && mHideBtn->getEnabled()) - { - mHideBtn->setVisible(TRUE); - } - mToastMouseEnterSignal(this, getValue()); - } -} - -void LLToast::onToastMouseLeave() -{ LLRect panel_rc = mWrapperPanel->calcScreenRect(); LLRect button_rc; if(mHideBtn) @@ -416,28 +436,32 @@ void LLToast::onToastMouseLeave() button_rc = mHideBtn->calcScreenRect(); } - S32 x, y; - LLUI::getMousePositionScreen(&x, &y); - - if( !panel_rc.pointInRect(x, y) && !button_rc.pointInRect(x, y)) + if (!panel_rc.pointInRect(x, y) && !button_rc.pointInRect(x, y)) { - mOnToastHoverSignal(this, MOUSE_LEAVE); + // mouse is not over this toast + mIsHovered = false; + return; + } - updateTransparency(); + bool is_overlapped_by_other_floater = false; - //toasts fading is management by Screen Channel + const child_list_t* child_list = gFloaterView->getChildList(); - if(mHideBtn && mHideBtn->getEnabled()) + // find this toast in gFloaterView child list to check whether any floater + // with higher Z-order is visible under the mouse pointer overlapping this toast + child_list_const_reverse_iter_t r_iter = std::find(child_list->rbegin(), child_list->rend(), this); + if (r_iter != child_list->rend()) + { + // skip this toast and proceed to views above in Z-order + for (++r_iter; r_iter != child_list->rend(); ++r_iter) { - if( mHideBtnPressed ) - { - mHideBtnPressed = false; - return; - } - mHideBtn->setVisible(FALSE); + LLView* view = *r_iter; + is_overlapped_by_other_floater = view->isInVisibleChain() && view->calcScreenRect().pointInRect(x, y); + if (is_overlapped_by_other_floater) break; } - mToastMouseLeaveSignal(this, getValue()); } + + mIsHovered = !is_overlapped_by_other_floater; } void LLToast::setBackgroundOpaque(BOOL b) @@ -495,13 +519,6 @@ void LLNotificationsUI::LLToast::startTimer() } } -bool LLToast::isHovered() -{ - S32 x, y; - LLUI::getMousePositionScreen(&x, &y); - return mWrapperPanel->calcScreenRect().pointInRect(x, y); -} - //-------------------------------------------------------------------------- BOOL LLToast::handleMouseDown(S32 x, S32 y, MASK mask) diff --git a/indra/newview/lltoast.h b/indra/newview/lltoast.h index 242f786bf2..77229e7beb 100644 --- a/indra/newview/lltoast.h +++ b/indra/newview/lltoast.h @@ -120,7 +120,7 @@ public: /** Start lifetime/fading timer */ virtual void startTimer(); - bool isHovered(); + bool isHovered() { return mIsHovered; } // Operating with toasts // insert a panel to a toast @@ -196,16 +196,13 @@ public: virtual S32 notifyParent(const LLSD& info); - LLHandle<LLToast> getHandle() { mHandle.bind(this); return mHandle; } + LLHandle<LLToast> getHandle() const { return getDerivedHandle<LLToast>(); } protected: void updateTransparency(); private: - - void onToastMouseEnter(); - - void onToastMouseLeave(); + void updateHoveredState(); void expire(); @@ -215,7 +212,7 @@ private: LLUUID mSessionID; LLNotificationPtr mNotification; - LLRootHandle<LLToast> mHandle; + //LLRootHandle<LLToast> mHandle; LLPanel* mWrapperPanel; @@ -236,6 +233,7 @@ private: bool mIsHidden; // this flag is TRUE when a toast has faded or was hidden with (x) button (EXT-1849) bool mIsTip; bool mIsFading; + bool mIsHovered; commit_signal_t mToastMouseEnterSignal; commit_signal_t mToastMouseLeaveSignal; diff --git a/indra/newview/lltool.h b/indra/newview/lltool.h index d3edabb486..ecc435d844 100644 --- a/indra/newview/lltool.h +++ b/indra/newview/lltool.h @@ -68,7 +68,7 @@ public: virtual void localPointToScreen(S32 local_x, S32 local_y, S32* screen_x, S32* screen_y) const { *screen_x = local_x; *screen_y = local_y; } - virtual std::string getName() const { return mName; } + virtual const std::string& getName() const { return mName; } // New virtual functions virtual LLViewerObject* getEditingObject() { return NULL; } diff --git a/indra/newview/lltoolbarview.cpp b/indra/newview/lltoolbarview.cpp index 619d17efad..eccb2cf2f1 100644 --- a/indra/newview/lltoolbarview.cpp +++ b/indra/newview/lltoolbarview.cpp @@ -30,12 +30,16 @@ #include "lltoolbarview.h" #include "llappviewer.h" +#include "llbutton.h" +#include "llclipboard.h" #include "lldir.h" -#include "llxmlnode.h" +#include "lldockablefloater.h" +#include "lldockcontrol.h" +#include "llimview.h" +#include "lltransientfloatermgr.h" #include "lltoolbar.h" -#include "llbutton.h" #include "lltooldraganddrop.h" -#include "llclipboard.h" +#include "llxmlnode.h" #include "llagent.h" // HACK for destinations guide on startup #include "llfloaterreg.h" // HACK for destinations guide on startup @@ -68,12 +72,15 @@ LLToolBarView::ToolbarSet::ToolbarSet() LLToolBarView::LLToolBarView(const LLToolBarView::Params& p) : LLUICtrl(p), - mToolbarLeft(NULL), - mToolbarRight(NULL), - mToolbarBottom(NULL), mDragStarted(false), - mDragToolbarButton(NULL) + mShowToolbars(true), + mDragToolbarButton(NULL), + mToolbarsLoaded(false) { + for (S32 i = 0; i < TOOLBAR_COUNT; i++) + { + mToolbars[i] = NULL; + } } void LLToolBarView::initFromParams(const LLToolBarView::Params& p) @@ -89,46 +96,100 @@ LLToolBarView::~LLToolBarView() BOOL LLToolBarView::postBuild() { - mToolbarLeft = getChild<LLToolBar>("toolbar_left"); - mToolbarRight = getChild<LLToolBar>("toolbar_right"); - mToolbarBottom = getChild<LLToolBar>("toolbar_bottom"); + mToolbars[TOOLBAR_LEFT] = getChild<LLToolBar>("toolbar_left"); + mToolbars[TOOLBAR_RIGHT] = getChild<LLToolBar>("toolbar_right"); + mToolbars[TOOLBAR_BOTTOM] = getChild<LLToolBar>("toolbar_bottom"); - mToolbarLeft->setStartDragCallback(boost::bind(LLToolBarView::startDragTool,_1,_2,_3)); - mToolbarLeft->setHandleDragCallback(boost::bind(LLToolBarView::handleDragTool,_1,_2,_3,_4)); - mToolbarLeft->setHandleDropCallback(boost::bind(LLToolBarView::handleDropTool,_1,_2,_3,_4)); - - mToolbarRight->setStartDragCallback(boost::bind(LLToolBarView::startDragTool,_1,_2,_3)); - mToolbarRight->setHandleDragCallback(boost::bind(LLToolBarView::handleDragTool,_1,_2,_3,_4)); - mToolbarRight->setHandleDropCallback(boost::bind(LLToolBarView::handleDropTool,_1,_2,_3,_4)); - - mToolbarBottom->setStartDragCallback(boost::bind(LLToolBarView::startDragTool,_1,_2,_3)); - mToolbarBottom->setHandleDragCallback(boost::bind(LLToolBarView::handleDragTool,_1,_2,_3,_4)); - mToolbarBottom->setHandleDropCallback(boost::bind(LLToolBarView::handleDropTool,_1,_2,_3,_4)); + for (int i = TOOLBAR_FIRST; i <= TOOLBAR_LAST; i++) + { + mToolbars[i]->setStartDragCallback(boost::bind(LLToolBarView::startDragTool,_1,_2,_3)); + mToolbars[i]->setHandleDragCallback(boost::bind(LLToolBarView::handleDragTool,_1,_2,_3,_4)); + mToolbars[i]->setHandleDropCallback(boost::bind(LLToolBarView::handleDropTool,_1,_2,_3,_4)); + mToolbars[i]->setButtonAddCallback(boost::bind(LLToolBarView::onToolBarButtonAdded,_1)); + mToolbars[i]->setButtonRemoveCallback(boost::bind(LLToolBarView::onToolBarButtonRemoved,_1)); + } LLAppViewer::instance()->setOnLoginCompletedCallback(boost::bind(&handleLoginToolbarSetup)); return TRUE; } -bool LLToolBarView::hasCommand(const LLCommandId& commandId) const +S32 LLToolBarView::hasCommand(const LLCommandId& commandId) const +{ + S32 command_location = TOOLBAR_NONE; + + for (S32 loc = TOOLBAR_FIRST; loc <= TOOLBAR_LAST; loc++) + { + if (mToolbars[loc]->hasCommand(commandId)) + { + command_location = loc; + break; + } + } + + return command_location; +} + +S32 LLToolBarView::addCommand(const LLCommandId& commandId, EToolBarLocation toolbar, int rank) +{ + int old_rank; + removeCommand(commandId, old_rank); + + S32 command_location = mToolbars[toolbar]->addCommand(commandId, rank); + + return command_location; +} + +S32 LLToolBarView::removeCommand(const LLCommandId& commandId, int& rank) +{ + S32 command_location = hasCommand(commandId); + rank = LLToolBar::RANK_NONE; + + if (command_location != TOOLBAR_NONE) + { + rank = mToolbars[command_location]->removeCommand(commandId); + } + + return command_location; +} + +S32 LLToolBarView::enableCommand(const LLCommandId& commandId, bool enabled) { - bool has_command = false; - if (mToolbarLeft && !has_command) + S32 command_location = hasCommand(commandId); + + if (command_location != TOOLBAR_NONE) { - has_command = mToolbarLeft->hasCommand(commandId); + mToolbars[command_location]->enableCommand(commandId, enabled); } - if (mToolbarRight && !has_command) + + return command_location; +} + +S32 LLToolBarView::stopCommandInProgress(const LLCommandId& commandId) +{ + S32 command_location = hasCommand(commandId); + + if (command_location != TOOLBAR_NONE) { - has_command = mToolbarRight->hasCommand(commandId); + mToolbars[command_location]->stopCommandInProgress(commandId); } - if (mToolbarBottom && !has_command) + + return command_location; +} + +S32 LLToolBarView::flashCommand(const LLCommandId& commandId, bool flash) +{ + S32 command_location = hasCommand(commandId); + + if (command_location != TOOLBAR_NONE) { - has_command = mToolbarBottom->hasCommand(commandId); + mToolbars[command_location]->flashCommand(commandId, flash); } - return has_command; + + return command_location; } -bool LLToolBarView::addCommand(const LLCommandId& command, LLToolBar* toolbar) +bool LLToolBarView::addCommandInternal(const LLCommandId& command, LLToolBar* toolbar) { LLCommandManager& mgr = LLCommandManager::instance(); if (mgr.getCommand(command)) @@ -146,6 +207,7 @@ bool LLToolBarView::addCommand(const LLCommandId& command, LLToolBar* toolbar) bool LLToolBarView::loadToolbars(bool force_default) { LLToolBarView::ToolbarSet toolbar_set; + bool err = false; // Load the toolbars.xml file std::string toolbar_file = gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, "toolbars.xml"); @@ -163,83 +225,107 @@ bool LLToolBarView::loadToolbars(bool force_default) if(!LLXMLNode::parseFile(toolbar_file, root, NULL)) { llwarns << "Unable to load toolbars from file: " << toolbar_file << llendl; - return false; + err = true; } - if(!root->hasName("toolbars")) + + if (!err && !root->hasName("toolbars")) { llwarns << toolbar_file << " is not a valid toolbars definition file" << llendl; - return false; + err = true; } // Parse the toolbar settings LLXUIParser parser; + if (!err) + { parser.readXUI(root, toolbar_set, toolbar_file); - if (!toolbar_set.validateBlock()) + } + if (!err && !toolbar_set.validateBlock()) { - llerrs << "Unable to validate toolbars from file: " << toolbar_file << llendl; - return false; + llwarns << "Unable to validate toolbars from file: " << toolbar_file << llendl; + err = true; } - // Clear the toolbars now before adding the loaded commands and settings - if (mToolbarLeft) + if (err) { - mToolbarLeft->clearCommandsList(); + if (force_default) + { + llerrs << "Unable to load toolbars from default file : " << toolbar_file << llendl; + return false; } - if (mToolbarRight) - { - mToolbarRight->clearCommandsList(); + // Try to load the default toolbars + return loadToolbars(true); } - if (mToolbarBottom) + + // Clear the toolbars now before adding the loaded commands and settings + for (S32 i = TOOLBAR_FIRST; i <= TOOLBAR_LAST; i++) { - mToolbarBottom->clearCommandsList(); + if (mToolbars[i]) + { + mToolbars[i]->clearCommandsList(); + } } // Add commands to each toolbar - if (toolbar_set.left_toolbar.isProvided() && mToolbarLeft) + if (toolbar_set.left_toolbar.isProvided() && mToolbars[TOOLBAR_LEFT]) { if (toolbar_set.left_toolbar.button_display_mode.isProvided()) { LLToolBarEnums::ButtonType button_type = toolbar_set.left_toolbar.button_display_mode; - mToolbarLeft->setButtonType(button_type); + mToolbars[TOOLBAR_LEFT]->setButtonType(button_type); } - BOOST_FOREACH(const LLCommandId::Params& command_name_param, toolbar_set.left_toolbar.commands) + BOOST_FOREACH(const LLCommandId::Params& command_params, toolbar_set.left_toolbar.commands) { - if (addCommand(LLCommandId(command_name_param), mToolbarLeft) == false) + if (addCommandInternal(LLCommandId(command_params), mToolbars[TOOLBAR_LEFT])) { - llwarns << "Error adding command '" << command_name_param.name() << "' to left toolbar." << llendl; + llwarns << "Error adding command '" << command_params.name() << "' to left toolbar." << llendl; } } } - if (toolbar_set.right_toolbar.isProvided() && mToolbarRight) + if (toolbar_set.right_toolbar.isProvided() && mToolbars[TOOLBAR_RIGHT]) { if (toolbar_set.right_toolbar.button_display_mode.isProvided()) { LLToolBarEnums::ButtonType button_type = toolbar_set.right_toolbar.button_display_mode; - mToolbarRight->setButtonType(button_type); + mToolbars[TOOLBAR_RIGHT]->setButtonType(button_type); } - BOOST_FOREACH(const LLCommandId::Params& command_name_param, toolbar_set.right_toolbar.commands) + BOOST_FOREACH(const LLCommandId::Params& command_params, toolbar_set.right_toolbar.commands) { - if (addCommand(LLCommandId(command_name_param), mToolbarRight) == false) + if (addCommandInternal(LLCommandId(command_params), mToolbars[TOOLBAR_RIGHT])) { - llwarns << "Error adding command '" << command_name_param.name() << "' to right toolbar." << llendl; + llwarns << "Error adding command '" << command_params.name() << "' to right toolbar." << llendl; } } } - if (toolbar_set.bottom_toolbar.isProvided() && mToolbarBottom) + if (toolbar_set.bottom_toolbar.isProvided() && mToolbars[TOOLBAR_BOTTOM]) { if (toolbar_set.bottom_toolbar.button_display_mode.isProvided()) { LLToolBarEnums::ButtonType button_type = toolbar_set.bottom_toolbar.button_display_mode; - mToolbarBottom->setButtonType(button_type); + mToolbars[TOOLBAR_BOTTOM]->setButtonType(button_type); } - BOOST_FOREACH(const LLCommandId::Params& command_name_param, toolbar_set.bottom_toolbar.commands) + BOOST_FOREACH(const LLCommandId::Params& command_params, toolbar_set.bottom_toolbar.commands) { - if (addCommand(LLCommandId(command_name_param), mToolbarBottom) == false) + if (addCommandInternal(LLCommandId(command_params), mToolbars[TOOLBAR_BOTTOM])) { - llwarns << "Error adding command '" << command_name_param.name() << "' to bottom toolbar." << llendl; + llwarns << "Error adding command '" << command_params.name() << "' to bottom toolbar." << llendl; } } } + mToolbarsLoaded = true; + return true; +} + +bool LLToolBarView::clearToolbars() +{ + for (S32 i = TOOLBAR_FIRST; i <= TOOLBAR_LAST; i++) + { + if (mToolbars[i]) + { + mToolbars[i]->clearCommandsList(); + } + } + return true; } @@ -251,6 +337,27 @@ bool LLToolBarView::loadDefaultToolbars() if (gToolBarView) { retval = gToolBarView->loadToolbars(true); + if (retval) + { + gToolBarView->saveToolbars(); + } + } + + return retval; +} + +//static +bool LLToolBarView::clearAllToolbars() +{ + bool retval = false; + + if (gToolBarView) + { + retval = gToolBarView->clearToolbars(); + if (retval) + { + gToolBarView->saveToolbars(); + } } return retval; @@ -258,22 +365,25 @@ bool LLToolBarView::loadDefaultToolbars() void LLToolBarView::saveToolbars() const { + if (!mToolbarsLoaded) + return; + // Build the parameter tree from the toolbar data LLToolBarView::ToolbarSet toolbar_set; - if (mToolbarLeft) + if (mToolbars[TOOLBAR_LEFT]) { - toolbar_set.left_toolbar.button_display_mode = mToolbarLeft->getButtonType(); - addToToolset(mToolbarLeft->getCommandsList(),toolbar_set.left_toolbar); + toolbar_set.left_toolbar.button_display_mode = mToolbars[TOOLBAR_LEFT]->getButtonType(); + addToToolset(mToolbars[TOOLBAR_LEFT]->getCommandsList(), toolbar_set.left_toolbar); } - if (mToolbarRight) + if (mToolbars[TOOLBAR_RIGHT]) { - toolbar_set.right_toolbar.button_display_mode = mToolbarRight->getButtonType(); - addToToolset(mToolbarRight->getCommandsList(),toolbar_set.right_toolbar); + toolbar_set.right_toolbar.button_display_mode = mToolbars[TOOLBAR_RIGHT]->getButtonType(); + addToToolset(mToolbars[TOOLBAR_RIGHT]->getCommandsList(), toolbar_set.right_toolbar); } - if (mToolbarBottom) + if (mToolbars[TOOLBAR_BOTTOM]) { - toolbar_set.bottom_toolbar.button_display_mode = mToolbarBottom->getButtonType(); - addToToolset(mToolbarBottom->getCommandsList(),toolbar_set.bottom_toolbar); + toolbar_set.bottom_toolbar.button_display_mode = mToolbars[TOOLBAR_BOTTOM]->getButtonType(); + addToToolset(mToolbars[TOOLBAR_BOTTOM]->getCommandsList(), toolbar_set.bottom_toolbar); } // Serialize the parameter tree @@ -314,35 +424,129 @@ void LLToolBarView::addToToolset(command_id_list_t& command_list, Toolbar& toolb } } -void LLToolBarView::draw() +void LLToolBarView::onToolBarButtonAdded(LLView* button) { - //LLPanel* sizer_left = getChild<LLPanel>("sizer_left"); + llassert(button); - LLRect bottom_rect, left_rect, right_rect; + if (button->getName() == "speak") + { + // Add the "Speak" button as a control view in LLTransientFloaterMgr + // to prevent hiding the transient IM floater upon pressing "Speak". + LLTransientFloaterMgr::getInstance()->addControlView(button); + + // Redock incoming and/or outgoing call windows, if applicable + + LLFloater* incoming_floater = LLFloaterReg::getLastFloaterInGroup("incoming_call"); + LLFloater* outgoing_floater = LLFloaterReg::getLastFloaterInGroup("outgoing_call"); + + if (incoming_floater && incoming_floater->isShown()) + { + LLCallDialog* incoming = dynamic_cast<LLCallDialog *>(incoming_floater); + llassert(incoming); + + LLDockControl* dock_control = incoming->getDockControl(); + if (dock_control->getDock() == NULL) + { + incoming->dockToToolbarButton("speak"); + } + } + + if (outgoing_floater && outgoing_floater->isShown()) + { + LLCallDialog* outgoing = dynamic_cast<LLCallDialog *>(outgoing_floater); + llassert(outgoing); + + LLDockControl* dock_control = outgoing->getDockControl(); + if (dock_control->getDock() == NULL) + { + outgoing->dockToToolbarButton("speak"); + } + } + } + else if (button->getName() == "voice") + { + // Add the "Voice controls" button as a control view in LLTransientFloaterMgr + // to prevent hiding the transient IM floater upon pressing "Voice controls". + LLTransientFloaterMgr::getInstance()->addControlView(button); + } +} + +void LLToolBarView::onToolBarButtonRemoved(LLView* button) +{ + llassert(button); - if (mToolbarBottom) + if (button->getName() == "speak") { - mToolbarBottom->getParent()->reshape(mToolbarBottom->getParent()->getRect().getWidth(), mToolbarBottom->getRect().getHeight()); - mToolbarBottom->localRectToOtherView(mToolbarBottom->getLocalRect(), &bottom_rect, this); + LLTransientFloaterMgr::getInstance()->removeControlView(button); + + // Undock incoming and/or outgoing call windows + + LLFloater* incoming_floater = LLFloaterReg::getLastFloaterInGroup("incoming_call"); + LLFloater* outgoing_floater = LLFloaterReg::getLastFloaterInGroup("outgoing_call"); + + if (incoming_floater && incoming_floater->isShown()) + { + LLDockableFloater* incoming = dynamic_cast<LLDockableFloater *>(incoming_floater); + llassert(incoming); + + LLDockControl* dock_control = incoming->getDockControl(); + dock_control->setDock(NULL); + } + + if (outgoing_floater && outgoing_floater->isShown()) + { + LLDockableFloater* outgoing = dynamic_cast<LLDockableFloater *>(outgoing_floater); + llassert(outgoing); + + LLDockControl* dock_control = outgoing->getDockControl(); + dock_control->setDock(NULL); + } } - if (mToolbarLeft) + else if (button->getName() == "voice") { - mToolbarLeft->getParent()->reshape(mToolbarLeft->getRect().getWidth(), mToolbarLeft->getParent()->getRect().getHeight()); - mToolbarLeft->localRectToOtherView(mToolbarLeft->getLocalRect(), &left_rect, this); + LLTransientFloaterMgr::getInstance()->removeControlView(button); } - if (mToolbarRight) +} + +void LLToolBarView::draw() +{ + LLRect toolbar_rects[TOOLBAR_COUNT]; + + for (S32 i = TOOLBAR_FIRST; i <= TOOLBAR_LAST; i++) { - mToolbarRight->getParent()->reshape(mToolbarRight->getRect().getWidth(), mToolbarRight->getParent()->getRect().getHeight()); - mToolbarRight->localRectToOtherView(mToolbarRight->getLocalRect(), &right_rect, this); + if (mToolbars[i]) + { + LLLayoutStack::ELayoutOrientation orientation = LLToolBarEnums::getOrientation(mToolbars[i]->getSideType()); + + if (orientation == LLLayoutStack::HORIZONTAL) + { + mToolbars[i]->getParent()->reshape(mToolbars[i]->getParent()->getRect().getWidth(), mToolbars[i]->getRect().getHeight()); + } + else + { + mToolbars[i]->getParent()->reshape(mToolbars[i]->getRect().getWidth(), mToolbars[i]->getParent()->getRect().getHeight()); + } + + mToolbars[i]->localRectToOtherView(mToolbars[i]->getLocalRect(), &toolbar_rects[i], this); + } } + for (S32 i = TOOLBAR_FIRST; i <= TOOLBAR_LAST; i++) + { + mToolbars[i]->getParent()->setVisible(mShowToolbars + && (mToolbars[i]->hasButtons() + || isToolDragged())); + } + // Draw drop zones if drop of a tool is active if (isToolDragged()) { LLColor4 drop_color = LLUIColorTable::instance().getColor( "ToolbarDropZoneColor" ); - gl_rect_2d(bottom_rect, drop_color, TRUE); - gl_rect_2d(left_rect, drop_color, TRUE); - gl_rect_2d(right_rect, drop_color, TRUE); + + for (S32 i = TOOLBAR_FIRST; i <= TOOLBAR_LAST; i++) + { + gl_rect_2d(toolbar_rects[i], drop_color, TRUE); + } } LLUICtrl::draw(); @@ -354,9 +558,9 @@ void LLToolBarView::draw() // ---------------------------------------- -void LLToolBarView::startDragTool(S32 x, S32 y, LLToolBarButton* button) +void LLToolBarView::startDragTool(S32 x, S32 y, LLToolBarButton* toolbarButton) { - resetDragTool(button); + resetDragTool(toolbarButton); // Flag the tool dragging but don't start it yet LLToolDragAndDrop::getInstance()->setDragStart( x, y ); @@ -382,9 +586,7 @@ BOOL LLToolBarView::handleDragTool( S32 x, S32 y, const LLUUID& uuid, LLAssetTyp // Second, stop the command if it is in progress and requires stopping! LLCommandId command_id = LLCommandId(uuid); - gToolBarView->mToolbarLeft->stopCommandInProgress(command_id); - gToolBarView->mToolbarRight->stopCommandInProgress(command_id); - gToolBarView->mToolbarBottom->stopCommandInProgress(command_id); + gToolBarView->stopCommandInProgress(command_id); gToolBarView->mDragStarted = true; return TRUE; @@ -415,10 +617,10 @@ BOOL LLToolBarView::handleDropTool( void* cargo_data, S32 x, S32 y, LLToolBar* t { // Suppress the command from the toolbars (including the one it's dropped in, // this will handle move position). - bool command_present = gToolBarView->hasCommand(command_id); + S32 old_toolbar_loc = gToolBarView->hasCommand(command_id); LLToolBar* old_toolbar = NULL; - if (command_present) + if (old_toolbar_loc != TOOLBAR_NONE) { llassert(gToolBarView->mDragToolbarButton); old_toolbar = gToolBarView->mDragToolbarButton->getParentByType<LLToolBar>(); @@ -428,9 +630,8 @@ BOOL LLToolBarView::handleDropTool( void* cargo_data, S32 x, S32 y, LLToolBar* t } else { - gToolBarView->mToolbarBottom->removeCommand(command_id); - gToolBarView->mToolbarLeft->removeCommand(command_id); - gToolBarView->mToolbarRight->removeCommand(command_id); + int old_rank = LLToolBar::RANK_NONE; + gToolBarView->removeCommand(command_id, old_rank); } } @@ -440,6 +641,9 @@ BOOL LLToolBarView::handleDropTool( void* cargo_data, S32 x, S32 y, LLToolBar* t int new_rank = toolbar->getRankFromPosition(x,y); toolbar->addCommand(command_id, new_rank); } + + // Save the new toolbars configuration + gToolBarView->saveToolbars(); } else { @@ -451,27 +655,26 @@ BOOL LLToolBarView::handleDropTool( void* cargo_data, S32 x, S32 y, LLToolBar* t return handled; } -void LLToolBarView::resetDragTool(LLToolBarButton* button) +void LLToolBarView::resetDragTool(LLToolBarButton* toolbarButton) { // Clear the saved command, toolbar and rank gToolBarView->mDragStarted = false; - gToolBarView->mDragToolbarButton = button; + gToolBarView->mDragToolbarButton = toolbarButton; } void LLToolBarView::setToolBarsVisible(bool visible) { - mToolbarBottom->getParent()->setVisible(visible); - mToolbarLeft->getParent()->setVisible(visible); - mToolbarRight->getParent()->setVisible(visible); + mShowToolbars = visible; } bool LLToolBarView::isModified() const { bool modified = false; - modified |= mToolbarBottom->isModified(); - modified |= mToolbarLeft->isModified(); - modified |= mToolbarRight->isModified(); + for (S32 i = TOOLBAR_FIRST; i <= TOOLBAR_LAST; i++) + { + modified |= mToolbars[i]->isModified(); + } return modified; } @@ -484,9 +687,11 @@ bool LLToolBarView::isModified() const void handleLoginToolbarSetup() { // Open the destinations guide by default on first login, per Rhett - if (gSavedSettings.getBOOL("FirstLoginThisInstall") || gAgent.isFirstLogin()) + if (gSavedPerAccountSettings.getBOOL("DisplayDestinationsOnInitialRun") || gAgent.isFirstLogin()) { LLFloaterReg::showInstance("destinations"); + + gSavedPerAccountSettings.setBOOL("DisplayDestinationsOnInitialRun", FALSE); } } diff --git a/indra/newview/lltoolbarview.h b/indra/newview/lltoolbarview.h index 60ad6316f8..be66bcae36 100644 --- a/indra/newview/lltoolbarview.h +++ b/indra/newview/lltoolbarview.h @@ -39,6 +39,19 @@ class LLUICtrlFactory; class LLToolBarView : public LLUICtrl { public: + typedef enum + { + TOOLBAR_NONE = 0, + TOOLBAR_LEFT, + TOOLBAR_RIGHT, + TOOLBAR_BOTTOM, + + TOOLBAR_COUNT, + + TOOLBAR_FIRST = TOOLBAR_LEFT, + TOOLBAR_LAST = TOOLBAR_BOTTOM, + } EToolBarLocation; + // Xui structure of the toolbar panel struct Params : public LLInitParam::Block<Params, LLUICtrl::Params> {}; @@ -52,6 +65,7 @@ public: { Mandatory<LLToolBarEnums::ButtonType> button_display_mode; Multiple<LLCommandId::Params> commands; + Toolbar(); }; struct ToolbarSet : public LLInitParam::Block<ToolbarSet> @@ -59,6 +73,7 @@ public: Optional<Toolbar> left_toolbar, right_toolbar, bottom_toolbar; + ToolbarSet(); }; @@ -66,20 +81,31 @@ public: virtual ~LLToolBarView(); virtual BOOL postBuild(); virtual void draw(); + // Toolbar view interface with the rest of the world - // Checks if the commandId is being used somewhere in one of the toolbars - bool hasCommand(const LLCommandId& commandId) const; + // Checks if the commandId is being used somewhere in one of the toolbars, returns EToolBarLocation + S32 hasCommand(const LLCommandId& commandId) const; + S32 addCommand(const LLCommandId& commandId, EToolBarLocation toolbar, int rank = LLToolBar::RANK_NONE); + S32 removeCommand(const LLCommandId& commandId, int& rank); // Sets the rank the removed command was at, RANK_NONE if not found + S32 enableCommand(const LLCommandId& commandId, bool enabled); + S32 stopCommandInProgress(const LLCommandId& commandId); + S32 flashCommand(const LLCommandId& commandId, bool flash); + // Loads the toolbars from the existing user or default settings bool loadToolbars(bool force_default = false); // return false if load fails + // Clears all buttons off the toolbars + bool clearToolbars(); + void setToolBarsVisible(bool visible); static bool loadDefaultToolbars(); + static bool clearAllToolbars(); - static void startDragTool(S32 x, S32 y, LLToolBarButton* button); + static void startDragTool(S32 x, S32 y, LLToolBarButton* toolbarButton); static BOOL handleDragTool(S32 x, S32 y, const LLUUID& uuid, LLAssetType::EType type); static BOOL handleDropTool(void* cargo_data, S32 x, S32 y, LLToolBar* toolbar); - static void resetDragTool(LLToolBarButton* button); + static void resetDragTool(LLToolBarButton* toolbarButton); bool isModified() const; @@ -91,16 +117,19 @@ protected: private: void saveToolbars() const; - bool addCommand(const LLCommandId& commandId, LLToolBar* toolbar); + bool addCommandInternal(const LLCommandId& commandId, LLToolBar* toolbar); void addToToolset(command_id_list_t& command_list, Toolbar& toolbar) const; + static void onToolBarButtonAdded(LLView* button); + static void onToolBarButtonRemoved(LLView* button); + // Pointers to the toolbars handled by the toolbar view - LLToolBar* mToolbarLeft; - LLToolBar* mToolbarRight; - LLToolBar* mToolbarBottom; + LLToolBar* mToolbars[TOOLBAR_COUNT]; + bool mToolbarsLoaded; bool mDragStarted; LLToolBarButton* mDragToolbarButton; + bool mShowToolbars; }; extern LLToolBarView* gToolBarView; diff --git a/indra/newview/lltoolbrush.cpp b/indra/newview/lltoolbrush.cpp index 9782b90cf1..aba43a9715 100644 --- a/indra/newview/lltoolbrush.cpp +++ b/indra/newview/lltoolbrush.cpp @@ -507,12 +507,12 @@ void LLToolBrushLand::render() void LLToolBrushLand::renderOverlay(LLSurface& land, const LLVector3& pos_region, const LLVector3& pos_world) { - glMatrixMode(GL_MODELVIEW); + gGL.matrixMode(LLRender::MM_MODELVIEW); gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); LLGLDepthTest mDepthTest(GL_TRUE); - glPushMatrix(); + gGL.pushMatrix(); gGL.color4fv(OVERLAY_COLOR.mV); - glTranslatef(0.0f, 0.0f, 1.0f); + gGL.translatef(0.0f, 0.0f, 1.0f); S32 i = (S32) pos_region.mV[VX]; S32 j = (S32) pos_region.mV[VY]; @@ -566,7 +566,7 @@ void LLToolBrushLand::renderOverlay(LLSurface& land, const LLVector3& pos_region } gGL.end(); - glPopMatrix(); + gGL.popMatrix(); } void LLToolBrushLand::determineAffectedRegions(region_list_t& regions, diff --git a/indra/newview/lltoolmorph.cpp b/indra/newview/lltoolmorph.cpp index 964b17d3a6..718201e381 100644 --- a/indra/newview/lltoolmorph.cpp +++ b/indra/newview/lltoolmorph.cpp @@ -169,23 +169,28 @@ BOOL LLVisualParamHint::render() gGL.pushUIMatrix(); gGL.loadUIIdentity(); - glMatrixMode(GL_PROJECTION); + gGL.matrixMode(LLRender::MM_PROJECTION); gGL.pushMatrix(); - glLoadIdentity(); - glOrtho(0.0f, mFullWidth, 0.0f, mFullHeight, -1.0f, 1.0f); + gGL.loadIdentity(); + gGL.ortho(0.0f, mFullWidth, 0.0f, mFullHeight, -1.0f, 1.0f); - glMatrixMode(GL_MODELVIEW); + gGL.matrixMode(LLRender::MM_MODELVIEW); gGL.pushMatrix(); - glLoadIdentity(); + gGL.loadIdentity(); + + if (LLGLSLShader::sNoFixedFunction) + { + gUIProgram.bind(); + } LLGLSUIDefault gls_ui; //LLGLState::verify(TRUE); mBackgroundp->draw(0, 0, mFullWidth, mFullHeight); - glMatrixMode(GL_PROJECTION); + gGL.matrixMode(LLRender::MM_PROJECTION); gGL.popMatrix(); - glMatrixMode(GL_MODELVIEW); + gGL.matrixMode(LLRender::MM_MODELVIEW); gGL.popMatrix(); mNeedsUpdate = FALSE; diff --git a/indra/newview/lltracker.cpp b/indra/newview/lltracker.cpp index efe9bb8da7..bf1f8808a7 100644 --- a/indra/newview/lltracker.cpp +++ b/indra/newview/lltracker.cpp @@ -509,9 +509,10 @@ void LLTracker::renderBeacon(LLVector3d pos_global, LLGLDepthTest gls_depth(GL_TRUE, GL_FALSE); - glMatrixMode(GL_MODELVIEW); - glPushMatrix(); - glTranslatef(pos_agent.mV[0], pos_agent.mV[1], pos_agent.mV[2]); + gGL.matrixMode(LLRender::MM_MODELVIEW); + gGL.pushMatrix(); + { + gGL.translatef(pos_agent.mV[0], pos_agent.mV[1], pos_agent.mV[2]); draw_shockwave(1024.f, gRenderStartTime.getElapsedTimeF32(), 32, fogged_color); @@ -563,9 +564,8 @@ void LLTracker::renderBeacon(LLVector3d pos_global, gGL.end(); } - - //gCylinder.render(1000); - glPopMatrix(); + } + gGL.popMatrix(); std::string text; text = llformat( "%.0f m", to_vec.magVec()); diff --git a/indra/newview/lltransientfloatermgr.cpp b/indra/newview/lltransientfloatermgr.cpp index c648a6a28a..3d68c10489 100644 --- a/indra/newview/lltransientfloatermgr.cpp +++ b/indra/newview/lltransientfloatermgr.cpp @@ -42,9 +42,9 @@ LLTransientFloaterMgr::LLTransientFloaterMgr() &LLTransientFloaterMgr::leftMouseClickCallback, this, _2, _3, _4)); } - mGroupControls.insert(std::pair<ETransientGroup, std::set<LLView*> >(GLOBAL, std::set<LLView*>())); - mGroupControls.insert(std::pair<ETransientGroup, std::set<LLView*> >(DOCKED, std::set<LLView*>())); - mGroupControls.insert(std::pair<ETransientGroup, std::set<LLView*> >(IM, std::set<LLView*>())); + mGroupControls.insert(std::pair<ETransientGroup, controls_set_t >(GLOBAL, controls_set_t())); + mGroupControls.insert(std::pair<ETransientGroup, controls_set_t >(DOCKED, controls_set_t())); + mGroupControls.insert(std::pair<ETransientGroup, controls_set_t >(IM, controls_set_t())); } void LLTransientFloaterMgr::registerTransientFloater(LLTransientFloater* floater) @@ -59,12 +59,16 @@ void LLTransientFloaterMgr::unregisterTransientFloater(LLTransientFloater* float void LLTransientFloaterMgr::addControlView(ETransientGroup group, LLView* view) { - mGroupControls.find(group)->second.insert(view); + if (!view) return; + + mGroupControls.find(group)->second.insert(view->getHandle()); } void LLTransientFloaterMgr::removeControlView(ETransientGroup group, LLView* view) { - mGroupControls.find(group)->second.erase(view); + if (!view) return; + + mGroupControls.find(group)->second.erase(view->getHandle()); } void LLTransientFloaterMgr::addControlView(LLView* view) @@ -89,7 +93,7 @@ void LLTransientFloaterMgr::hideTransientFloaters(S32 x, S32 y) { ETransientGroup group = floater->getGroup(); - bool hide = isControlClicked(mGroupControls.find(group)->second, x, y); + bool hide = isControlClicked(group, mGroupControls.find(group)->second, x, y); if (hide) { floater->setTransientVisible(FALSE); @@ -98,13 +102,25 @@ void LLTransientFloaterMgr::hideTransientFloaters(S32 x, S32 y) } } -bool LLTransientFloaterMgr::isControlClicked(std::set<LLView*>& set, S32 x, S32 y) +bool LLTransientFloaterMgr::isControlClicked(ETransientGroup group, controls_set_t& set, S32 x, S32 y) { + std::list< LLHandle<LLView> > dead_handles; + bool res = true; for (controls_set_t::iterator it = set.begin(); it != set.end(); it++) { - LLView* control_view = *it; + LLView* control_view = NULL; + + LLHandle<LLView> handle = *it; + if (handle.isDead()) + { + dead_handles.push_back(handle); + continue; + } + + control_view = handle.get(); + if (!control_view->getVisible()) { continue; @@ -118,6 +134,13 @@ bool LLTransientFloaterMgr::isControlClicked(std::set<LLView*>& set, S32 x, S32 break; } } + + for (std::list< LLHandle<LLView> >::iterator it = dead_handles.begin(); it != dead_handles.end(); ++it) + { + LLHandle<LLView> handle = *it; + mGroupControls.find(group)->second.erase(handle); + } + return res; } @@ -130,8 +153,8 @@ void LLTransientFloaterMgr::leftMouseClickCallback(S32 x, S32 y, return; } - bool hide = isControlClicked(mGroupControls.find(DOCKED)->second, x, y) - && isControlClicked(mGroupControls.find(GLOBAL)->second, x, y); + bool hide = isControlClicked(DOCKED, mGroupControls.find(DOCKED)->second, x, y) + && isControlClicked(GLOBAL, mGroupControls.find(GLOBAL)->second, x, y); if (hide) { hideTransientFloaters(x, y); diff --git a/indra/newview/lltransientfloatermgr.h b/indra/newview/lltransientfloatermgr.h index 2919244121..b4611c8c87 100644 --- a/indra/newview/lltransientfloatermgr.h +++ b/indra/newview/lltransientfloatermgr.h @@ -56,14 +56,15 @@ public: void removeControlView(LLView* view); private: + typedef std::set<LLHandle<LLView> > controls_set_t; + typedef std::map<ETransientGroup, controls_set_t > group_controls_t; + void hideTransientFloaters(S32 x, S32 y); void leftMouseClickCallback(S32 x, S32 y, MASK mask); - bool isControlClicked(std::set<LLView*>& set, S32 x, S32 y); -private: + bool isControlClicked(ETransientGroup group, controls_set_t& set, S32 x, S32 y); + std::set<LLTransientFloater*> mTransSet; - typedef std::set<LLView*> controls_set_t; - typedef std::map<ETransientGroup, std::set<LLView*> > group_controls_t; group_controls_t mGroupControls; }; diff --git a/indra/newview/lltranslate.cpp b/indra/newview/lltranslate.cpp index 2f60b6b90b..7eb54271f4 100644..100755 --- a/indra/newview/lltranslate.cpp +++ b/indra/newview/lltranslate.cpp @@ -31,82 +31,294 @@ #include <curl/curl.h> #include "llbufferstream.h" +#include "lltrans.h" #include "llui.h" #include "llversioninfo.h" #include "llviewercontrol.h" #include "reader.h" -// These two are concatenated with the language specifiers to form a complete Google Translate URL -const char* LLTranslate::m_GoogleURL = "http://ajax.googleapis.com/ajax/services/language/translate?v=1.0&q="; -const char* LLTranslate::m_GoogleLangSpec = "&langpair="; -float LLTranslate::m_GoogleTimeout = 5; +// virtual +void LLGoogleTranslationHandler::getTranslateURL( + std::string &url, + const std::string &from_lang, + const std::string &to_lang, + const std::string &text) const +{ + url = std::string("https://www.googleapis.com/language/translate/v2?key=") + + getAPIKey() + "&q=" + LLURI::escape(text) + "&target=" + to_lang; + if (!from_lang.empty()) + { + url += "&source=" + from_lang; + } +} -LLSD LLTranslate::m_Header; -// These constants are for the GET header. -const char* LLTranslate::m_AcceptHeader = "Accept"; -const char* LLTranslate::m_AcceptType = "text/plain"; -const char* LLTranslate::m_AgentHeader = "User-Agent"; +// virtual +void LLGoogleTranslationHandler::getKeyVerificationURL( + std::string& url, + const std::string& key) const +{ + url = std::string("https://www.googleapis.com/language/translate/v2/languages?key=") + + key + "&target=en"; +} -// These constants are in the JSON returned from Google -const char* LLTranslate::m_GoogleData = "responseData"; -const char* LLTranslate::m_GoogleTranslation = "translatedText"; -const char* LLTranslate::m_GoogleLanguage = "detectedSourceLanguage"; +// virtual +bool LLGoogleTranslationHandler::parseResponse( + int& status, + const std::string& body, + std::string& translation, + std::string& detected_lang, + std::string& err_msg) const +{ + Json::Value root; + Json::Reader reader; -//static -void LLTranslate::translateMessage(LLHTTPClient::ResponderPtr &result, const std::string &from_lang, const std::string &to_lang, const std::string &mesg) + if (!reader.parse(body, root)) + { + err_msg = reader.getFormatedErrorMessages(); + return false; + } + + if (!root.isObject()) // empty response? should not happen + { + return false; + } + + if (status != STATUS_OK) + { + // Request failed. Extract error message from the response. + parseErrorResponse(root, status, err_msg); + return false; + } + + // Request succeeded, extract translation from the response. + return parseTranslation(root, translation, detected_lang); +} + +// static +void LLGoogleTranslationHandler::parseErrorResponse( + const Json::Value& root, + int& status, + std::string& err_msg) { - std::string url; - getTranslateUrl(url, from_lang, to_lang, mesg); + const Json::Value& error = root.get("error", 0); + if (!error.isObject() || !error.isMember("message") || !error.isMember("code")) + { + return; + } - std::string user_agent = llformat("%s %d.%d.%d (%d)", - LLVersionInfo::getChannel().c_str(), - LLVersionInfo::getMajor(), - LLVersionInfo::getMinor(), - LLVersionInfo::getPatch(), - LLVersionInfo::getBuild()); + err_msg = error["message"].asString(); + status = error["code"].asInt(); +} - if (!m_Header.size()) +// static +bool LLGoogleTranslationHandler::parseTranslation( + const Json::Value& root, + std::string& translation, + std::string& detected_lang) +{ + // JsonCpp is prone to aborting the program on failed assertions, + // so be super-careful and verify the response format. + const Json::Value& data = root.get("data", 0); + if (!data.isObject() || !data.isMember("translations")) { - m_Header.insert(m_AcceptHeader, LLSD(m_AcceptType)); - m_Header.insert(m_AgentHeader, LLSD(user_agent)); + return false; + } + + const Json::Value& translations = data["translations"]; + if (!translations.isArray() || translations.size() == 0) + { + return false; + } + + const Json::Value& first = translations[0U]; + if (!first.isObject() || !first.isMember("translatedText")) + { + return false; } - LLHTTPClient::get(url, result, m_Header, m_GoogleTimeout); + translation = first["translatedText"].asString(); + detected_lang = first.get("detectedSourceLanguage", "").asString(); + return true; } -//static -void LLTranslate::getTranslateUrl(std::string &translate_url, const std::string &from_lang, const std::string &to_lang, const std::string &mesg) +// static +std::string LLGoogleTranslationHandler::getAPIKey() +{ + return gSavedSettings.getString("GoogleTranslateAPIKey"); +} + +// virtual +void LLBingTranslationHandler::getTranslateURL( + std::string &url, + const std::string &from_lang, + const std::string &to_lang, + const std::string &text) const { - char * curl_str = curl_escape(mesg.c_str(), mesg.size()); - std::string const escaped_mesg(curl_str); - curl_free(curl_str); + url = std::string("http://api.microsofttranslator.com/v2/Http.svc/Translate?appId=") + + getAPIKey() + "&text=" + LLURI::escape(text) + "&to=" + to_lang; + if (!from_lang.empty()) + { + url += "&from=" + from_lang; + } +} - translate_url = m_GoogleURL - + escaped_mesg + m_GoogleLangSpec - + from_lang // 'from' language; empty string for auto - + "%7C" // | - + to_lang; // 'to' language +// virtual +void LLBingTranslationHandler::getKeyVerificationURL( + std::string& url, + const std::string& key) const +{ + url = std::string("http://api.microsofttranslator.com/v2/Http.svc/GetLanguagesForTranslate?appId=") + + key; } -//static -bool LLTranslate::parseGoogleTranslate(const std::string& body, std::string &translation, std::string &detected_language) +// virtual +bool LLBingTranslationHandler::parseResponse( + int& status, + const std::string& body, + std::string& translation, + std::string& detected_lang, + std::string& err_msg) const { - Json::Value root; - Json::Reader reader; - - bool success = reader.parse(body, root); - if (!success) + if (status != STATUS_OK) { - LL_WARNS("Translate") << "Non valid response from Google Translate API: '" << reader.getFormatedErrorMessages() << "'" << LL_ENDL; + static const std::string MSG_BEGIN_MARKER = "Message: "; + size_t begin = body.find(MSG_BEGIN_MARKER); + if (begin != std::string::npos) + { + begin += MSG_BEGIN_MARKER.size(); + } + else + { + begin = 0; + err_msg.clear(); + } + size_t end = body.find("</p>", begin); + err_msg = body.substr(begin, end-begin); + LLStringUtil::replaceString(err_msg, "
", ""); // strip CR return false; } - - translation = root[m_GoogleData].get(m_GoogleTranslation, "").asString(); - detected_language = root[m_GoogleData].get(m_GoogleLanguage, "").asString(); + + // Sample response: <string xmlns="http://schemas.microsoft.com/2003/10/Serialization/">Hola</string> + size_t begin = body.find(">"); + if (begin == std::string::npos || begin >= (body.size() - 1)) + { + begin = 0; + } + else + { + ++begin; + } + + size_t end = body.find("</string>", begin); + + detected_lang = ""; // unsupported by this API + translation = body.substr(begin, end-begin); + LLStringUtil::replaceString(translation, "
", ""); // strip CR return true; } +// static +std::string LLBingTranslationHandler::getAPIKey() +{ + return gSavedSettings.getString("BingTranslateAPIKey"); +} + +LLTranslate::TranslationReceiver::TranslationReceiver(const std::string& from_lang, const std::string& to_lang) +: mFromLang(from_lang) +, mToLang(to_lang) +, mHandler(LLTranslate::getPreferredHandler()) +{ +} + +// virtual +void LLTranslate::TranslationReceiver::completedRaw( + U32 http_status, + const std::string& reason, + const LLChannelDescriptors& channels, + const LLIOPipe::buffer_ptr_t& buffer) +{ + LLBufferStream istr(channels, buffer.get()); + std::stringstream strstrm; + strstrm << istr.rdbuf(); + + const std::string body = strstrm.str(); + std::string translation, detected_lang, err_msg; + int status = http_status; + LL_DEBUGS("Translate") << "HTTP status: " << status << " " << reason << LL_ENDL; + LL_DEBUGS("Translate") << "Response body: " << body << LL_ENDL; + if (mHandler.parseResponse(status, body, translation, detected_lang, err_msg)) + { + // Fix up the response + LLStringUtil::replaceString(translation, "<", "<"); + LLStringUtil::replaceString(translation, ">",">"); + LLStringUtil::replaceString(translation, ""","\""); + LLStringUtil::replaceString(translation, "'","'"); + LLStringUtil::replaceString(translation, "&","&"); + LLStringUtil::replaceString(translation, "'","'"); + + handleResponse(translation, detected_lang); + } + else + { + if (err_msg.empty()) + { + err_msg = LLTrans::getString("TranslationResponseParseError"); + } + + llwarns << "Translation request failed: " << err_msg << llendl; + handleFailure(status, err_msg); + } +} + +LLTranslate::KeyVerificationReceiver::KeyVerificationReceiver(EService service) +: mService(service) +{ +} + +LLTranslate::EService LLTranslate::KeyVerificationReceiver::getService() const +{ + return mService; +} + +// virtual +void LLTranslate::KeyVerificationReceiver::completedRaw( + U32 http_status, + const std::string& reason, + const LLChannelDescriptors& channels, + const LLIOPipe::buffer_ptr_t& buffer) +{ + bool ok = (http_status == 200); + setVerificationStatus(ok); +} + +//static +void LLTranslate::translateMessage( + TranslationReceiverPtr &receiver, + const std::string &from_lang, + const std::string &to_lang, + const std::string &mesg) +{ + std::string url; + receiver->mHandler.getTranslateURL(url, from_lang, to_lang, mesg); + + LL_DEBUGS("Translate") << "Sending translation request: " << url << LL_ENDL; + sendRequest(url, receiver); +} + +// static +void LLTranslate::verifyKey( + KeyVerificationReceiverPtr& receiver, + const std::string& key) +{ + std::string url; + const LLTranslationAPIHandler& handler = getHandler(receiver->getService()); + handler.getKeyVerificationURL(url, key); + + LL_DEBUGS("Translate") << "Sending key verification request: " << url << LL_ENDL; + sendRequest(url, receiver); +} + //static std::string LLTranslate::getTranslateLanguage() { @@ -119,3 +331,52 @@ std::string LLTranslate::getTranslateLanguage() return language; } +// static +const LLTranslationAPIHandler& LLTranslate::getPreferredHandler() +{ + EService service = SERVICE_BING; + + std::string service_str = gSavedSettings.getString("TranslationService"); + if (service_str == "google") + { + service = SERVICE_GOOGLE; + } + + return getHandler(service); +} + +// static +const LLTranslationAPIHandler& LLTranslate::getHandler(EService service) +{ + static LLGoogleTranslationHandler google; + static LLBingTranslationHandler bing; + + if (service == SERVICE_GOOGLE) + { + return google; + } + + return bing; +} + +// static +void LLTranslate::sendRequest(const std::string& url, LLHTTPClient::ResponderPtr responder) +{ + static const float REQUEST_TIMEOUT = 5; + static LLSD sHeader; + + if (!sHeader.size()) + { + std::string user_agent = llformat("%s %d.%d.%d (%d)", + LLVersionInfo::getChannel().c_str(), + LLVersionInfo::getMajor(), + LLVersionInfo::getMinor(), + LLVersionInfo::getPatch(), + LLVersionInfo::getBuild()); + + sHeader.insert("Accept", "text/plain"); + sHeader.insert("User-Agent", user_agent); + } + + LLHTTPClient::get(url, responder, sHeader, REQUEST_TIMEOUT); +} diff --git a/indra/newview/lltranslate.h b/indra/newview/lltranslate.h index e85a42e878..c2330daa81 100644..100755 --- a/indra/newview/lltranslate.h +++ b/indra/newview/lltranslate.h @@ -30,89 +30,257 @@ #include "llhttpclient.h" #include "llbufferstream.h" +namespace Json +{ + class Value; +} + +/** + * Handler of an HTTP machine translation service. + * + * Derived classes know the service URL + * and how to parse the translation result. + */ +class LLTranslationAPIHandler +{ +public: + /** + * Get URL for translation of the given string. + * + * Sending HTTP GET request to the URL will initiate translation. + * + * @param[out] url Place holder for the result. + * @param from_lang Source language. Leave empty for auto-detection. + * @param to_lang Target language. + * @param text Text to translate. + */ + virtual void getTranslateURL( + std::string &url, + const std::string &from_lang, + const std::string &to_lang, + const std::string &text) const = 0; + + /** + * Get URL to verify the given API key. + * + * Sending request to the URL verifies the key. + * Positive HTTP response (code 200) means that the key is valid. + * + * @param[out] url Place holder for the URL. + * @param[in] key Key to verify. + */ + virtual void getKeyVerificationURL( + std::string &url, + const std::string &key) const = 0; + + /** + * Parse translation response. + * + * @param[in,out] status HTTP status. May be modified while parsing. + * @param body Response text. + * @param[out] translation Translated text. + * @param[out] detected_lang Detected source language. May be empty. + * @param[out] err_msg Error message (in case of error). + */ + virtual bool parseResponse( + int& status, + const std::string& body, + std::string& translation, + std::string& detected_lang, + std::string& err_msg) const = 0; + + virtual ~LLTranslationAPIHandler() {} + +protected: + static const int STATUS_OK = 200; +}; + +/// Google Translate v2 API handler. +class LLGoogleTranslationHandler : public LLTranslationAPIHandler +{ + LOG_CLASS(LLGoogleTranslationHandler); + +public: + /*virtual*/ void getTranslateURL( + std::string &url, + const std::string &from_lang, + const std::string &to_lang, + const std::string &text) const; + /*virtual*/ void getKeyVerificationURL( + std::string &url, + const std::string &key) const; + /*virtual*/ bool parseResponse( + int& status, + const std::string& body, + std::string& translation, + std::string& detected_lang, + std::string& err_msg) const; + +private: + static void parseErrorResponse( + const Json::Value& root, + int& status, + std::string& err_msg); + static bool parseTranslation( + const Json::Value& root, + std::string& translation, + std::string& detected_lang); + static std::string getAPIKey(); +}; + +/// Microsoft Translator v2 API handler. +class LLBingTranslationHandler : public LLTranslationAPIHandler +{ + LOG_CLASS(LLBingTranslationHandler); + +public: + /*virtual*/ void getTranslateURL( + std::string &url, + const std::string &from_lang, + const std::string &to_lang, + const std::string &text) const; + /*virtual*/ void getKeyVerificationURL( + std::string &url, + const std::string &key) const; + /*virtual*/ bool parseResponse( + int& status, + const std::string& body, + std::string& translation, + std::string& detected_lang, + std::string& err_msg) const; +private: + static std::string getAPIKey(); +}; + +/** + * Entry point for machine translation services. + * + * Basically, to translate a string, we need to know the URL + * of a translation service, have a valid API for the service + * and be given the target language. + * + * Callers specify the string to translate and the target language, + * LLTranslate takes care of the rest. + * + * API keys for translation are taken from saved settings. + */ class LLTranslate { LOG_CLASS(LLTranslate); + public : + + typedef enum e_service { + SERVICE_BING, + SERVICE_GOOGLE, + } EService; + + /** + * Subclasses are supposed to handle translation results (e.g. show them in chat) + */ class TranslationReceiver: public LLHTTPClient::Responder { + public: + + /** + * Using mHandler, parse incoming response. + * + * Calls either handleResponse() or handleFailure() + * depending on the HTTP status code and parsing success. + * + * @see handleResponse() + * @see handleFailure() + * @see mHandler + */ + /*virtual*/ void completedRaw( + U32 http_status, + const std::string& reason, + const LLChannelDescriptors& channels, + const LLIOPipe::buffer_ptr_t& buffer); + protected: - TranslationReceiver(const std::string &from_lang, const std::string &to_lang) - : m_fromLang(from_lang), - m_toLang(to_lang) - { - } + friend class LLTranslate; - virtual void handleResponse(const std::string &translation, const std::string &recognized_lang) {}; - virtual void handleFailure() {}; + /// Remember source and target languages for subclasses to be able to filter inappropriate results. + TranslationReceiver(const std::string& from_lang, const std::string& to_lang); + /// Override point to handle successful translation. + virtual void handleResponse(const std::string &translation, const std::string &recognized_lang) = 0; + + /// Override point to handle unsuccessful translation. + virtual void handleFailure(int status, const std::string& err_msg) = 0; + + std::string mFromLang; + std::string mToLang; + const LLTranslationAPIHandler& mHandler; + }; + + /** + * Subclasses are supposed to handle API key verification result. + */ + class KeyVerificationReceiver: public LLHTTPClient::Responder + { public: - ~TranslationReceiver() - { - } - - virtual void completedRaw( U32 status, - const std::string& reason, - const LLChannelDescriptors& channels, - const LLIOPipe::buffer_ptr_t& buffer) - { - if (200 <= status && status < 300) - { - LLBufferStream istr(channels, buffer.get()); - std::stringstream strstrm; - strstrm << istr.rdbuf(); - - const std::string result = strstrm.str(); - std::string translation; - std::string detected_language; - - if (!parseGoogleTranslate(result, translation, detected_language)) - { - handleFailure(); - return; - } - - // Fix up the response - LLStringUtil::replaceString(translation, "<", "<"); - LLStringUtil::replaceString(translation, ">",">"); - LLStringUtil::replaceString(translation, ""","\""); - LLStringUtil::replaceString(translation, "'","'"); - LLStringUtil::replaceString(translation, "&","&"); - LLStringUtil::replaceString(translation, "'","'"); - - handleResponse(translation, detected_language); - } - else - { - LL_WARNS("Translate") << "HTTP request for Google Translate failed with status " << status << ", reason: " << reason << LL_ENDL; - handleFailure(); - } - } + EService getService() const; protected: - const std::string m_toLang; - const std::string m_fromLang; + /** + * Save the translation service the key belongs to. + * + * Subclasses need to know it. + * + * @see getService() + */ + KeyVerificationReceiver(EService service); + + /** + * Parse verification response. + * + * Calls setVerificationStatus() with the verification status, + * which is true if HTTP status code is 200. + * + * @see setVerificationStatus() + */ + /*virtual*/ void completedRaw( + U32 http_status, + const std::string& reason, + const LLChannelDescriptors& channels, + const LLIOPipe::buffer_ptr_t& buffer); + + /** + * Override point for subclasses to handle key verification status. + */ + virtual void setVerificationStatus(bool ok) = 0; + + EService mService; }; - static void translateMessage(LLHTTPClient::ResponderPtr &result, const std::string &from_lang, const std::string &to_lang, const std::string &mesg); - static float m_GoogleTimeout; + typedef boost::intrusive_ptr<TranslationReceiver> TranslationReceiverPtr; + typedef boost::intrusive_ptr<KeyVerificationReceiver> KeyVerificationReceiverPtr; + + /** + * Translate given text. + * + * @param receiver Object to pass translation result to. + * @param from_lang Source language. Leave empty for auto-detection. + * @param to_lang Target language. + * @param mesg Text to translate. + */ + static void translateMessage(TranslationReceiverPtr &receiver, const std::string &from_lang, const std::string &to_lang, const std::string &mesg); + + /** + * Verify given API key of a translation service. + * + * @param receiver Object to pass verification result to. + * @param key Key to verify. + */ + static void verifyKey(KeyVerificationReceiverPtr& receiver, const std::string& key); static std::string getTranslateLanguage(); private: - static void getTranslateUrl(std::string &translate_url, const std::string &from_lang, const std::string &to_lang, const std::string &text); - static bool parseGoogleTranslate(const std::string& body, std::string &translation, std::string &detected_language); - - static LLSD m_Header; - static const char* m_GoogleURL; - static const char* m_GoogleLangSpec; - static const char* m_AcceptHeader; - static const char* m_AcceptType; - static const char* m_AgentHeader; - static const char* m_UserAgent; - - static const char* m_GoogleData; - static const char* m_GoogleTranslation; - static const char* m_GoogleLanguage; + static const LLTranslationAPIHandler& getPreferredHandler(); + static const LLTranslationAPIHandler& getHandler(EService service); + static void sendRequest(const std::string& url, LLHTTPClient::ResponderPtr responder); }; #endif diff --git a/indra/newview/llurldispatcher.cpp b/indra/newview/llurldispatcher.cpp index f6d7ceeec3..4240a38326 100644 --- a/indra/newview/llurldispatcher.cpp +++ b/indra/newview/llurldispatcher.cpp @@ -167,9 +167,9 @@ bool LLURLDispatcherImpl::dispatchApp(const LLSLURL& slurl, // static bool LLURLDispatcherImpl::dispatchRegion(const LLSLURL& slurl, const std::string& nav_type, bool right_mouse) { - if(slurl.getType() != LLSLURL::LOCATION) + if(slurl.getType() != LLSLURL::LOCATION) { - return false; + return false; } // Before we're logged in, need to update the startup screen // to tell the user where they are going. diff --git a/indra/newview/llviewerassetstorage.cpp b/indra/newview/llviewerassetstorage.cpp index 36c8b42a52..d042f62830 100644 --- a/indra/newview/llviewerassetstorage.cpp +++ b/indra/newview/llviewerassetstorage.cpp @@ -116,7 +116,7 @@ void LLViewerAssetStorage::storeAssetData( F64 timeout) { LLAssetID asset_id = tid.makeAssetID(gAgent.getSecureSessionID()); - llinfos << "LLViewerAssetStorage::storeAssetData (legacy) " << tid << ":" << LLAssetType::lookup(asset_type) + LL_DEBUGS("AssetStorage") << "LLViewerAssetStorage::storeAssetData (legacy) " << tid << ":" << LLAssetType::lookup(asset_type) << " ASSET_ID: " << asset_id << llendl; if (mUpstreamHost.isOk()) @@ -248,9 +248,9 @@ void LLViewerAssetStorage::storeAssetData( } LLAssetID asset_id = tid.makeAssetID(gAgent.getSecureSessionID()); - llinfos << "LLViewerAssetStorage::storeAssetData (legacy)" << asset_id << ":" << LLAssetType::lookup(asset_type) << llendl; + LL_DEBUGS("AssetStorage") << "LLViewerAssetStorage::storeAssetData (legacy)" << asset_id << ":" << LLAssetType::lookup(asset_type) << llendl; - llinfos << "ASSET_ID: " << asset_id << llendl; + LL_DEBUGS("AssetStorage") << "ASSET_ID: " << asset_id << llendl; S32 size = 0; LLFILE* fp = LLFile::fopen(filename, "rb"); @@ -369,7 +369,7 @@ void LLViewerAssetStorage::_queueDataRequest( tpvf.setAsset(uuid, atype); tpvf.setCallback(downloadCompleteCallback, req); - llinfos << "Starting transfer for " << uuid << llendl; + LL_DEBUGS("AssetStorage") << "Starting transfer for " << uuid << llendl; LLTransferTargetChannel *ttcp = gTransferManager.getTargetChannel(mUpstreamHost, LLTCT_ASSET); ttcp->requestTransfer(spa, tpvf, 100.f + (is_priority ? 1.f : 0.f)); diff --git a/indra/newview/llvieweraudio.cpp b/indra/newview/llvieweraudio.cpp index f7fa5690d6..2447f5dea8 100644 --- a/indra/newview/llvieweraudio.cpp +++ b/indra/newview/llvieweraudio.cpp @@ -37,9 +37,226 @@ #include "llvoiceclient.h" #include "llviewermedia.h" #include "llprogressview.h" +#include "llcallbacklist.h" +#include "llstartup.h" +#include "llviewerparcelmgr.h" +#include "llparcel.h" ///////////////////////////////////////////////////////// +LLViewerAudio::LLViewerAudio() : + mDone(true), + mFadeState(FADE_IDLE), + mFadeTime(), + mIdleListnerActive(false), + mForcedTeleportFade(false) +{ + mTeleportFailedConnection = LLViewerParcelMgr::getInstance()-> + setTeleportFailedCallback(boost::bind(&LLViewerAudio::onTeleportFailed, this)); +} + +LLViewerAudio::~LLViewerAudio() +{ + mTeleportFailedConnection.disconnect(); +} + +void LLViewerAudio::registerIdleListener() +{ + if(mIdleListnerActive==false) + { + mIdleListnerActive = true; + doOnIdleRepeating(boost::bind(boost::bind(&LLViewerAudio::onIdleUpdate, this))); + } + +} + +void LLViewerAudio::startInternetStreamWithAutoFade(std::string streamURI) +{ + // Old and new stream are identical + if (mNextStreamURI == streamURI) + { + return; + } + + // Record the URI we are going to be switching to + mNextStreamURI = streamURI; + + switch (mFadeState) + { + case FADE_IDLE: + // If a stream is playing fade it out first + if (!gAudiop->getInternetStreamURL().empty()) + { + // The order of these tests is important, state FADE_OUT will be processed below + mFadeState = FADE_OUT; + } + // Otherwise the new stream can be faded in + else + { + mFadeState = FADE_IN; + gAudiop->startInternetStream(mNextStreamURI); + startFading(); + registerIdleListener(); + break; + } + + case FADE_OUT: + startFading(); + registerIdleListener(); + break; + + case FADE_IN: + registerIdleListener(); + break; + + default: + llwarns << "Unknown fading state: " << mFadeState << llendl; + break; + } +} + +// A return of false from onIdleUpdate means it will be called again next idle update. +// A return of true means we have finished with it and the callback will be deleted. +bool LLViewerAudio::onIdleUpdate() +{ + bool fadeIsFinished = false; + + // There is a delay in the login sequence between when the parcel information has + // arrived and the music stream is started and when the audio system is called to set + // initial volume levels. This code extends the fade time so you hear a full fade in. + if ((LLStartUp::getStartupState() < STATE_STARTED)) + { + stream_fade_timer.reset(); + stream_fade_timer.setTimerExpirySec(mFadeTime); + } + + if (mDone) + { + // This should be a rare or never occurring state. + if (mFadeState == FADE_IDLE) + { + deregisterIdleListener(); + fadeIsFinished = true; // Stop calling onIdleUpdate + } + + // we have finished the current fade operation + if (mFadeState == FADE_OUT) + { + // Clear URI + gAudiop->startInternetStream(LLStringUtil::null); + gAudiop->stopInternetStream(); + + if (!mNextStreamURI.empty()) + { + mFadeState = FADE_IN; + gAudiop->startInternetStream(mNextStreamURI); + startFading(); + } + else + { + mFadeState = FADE_IDLE; + deregisterIdleListener(); + fadeIsFinished = true; // Stop calling onIdleUpdate + } + } + else if (mFadeState == FADE_IN) + { + if (mNextStreamURI != gAudiop->getInternetStreamURL()) + { + mFadeState = FADE_OUT; + startFading(); + } + else + { + mFadeState = FADE_IDLE; + deregisterIdleListener(); + fadeIsFinished = true; // Stop calling onIdleUpdate + } + } + } + + return fadeIsFinished; +} + +void LLViewerAudio::stopInternetStreamWithAutoFade() +{ + mFadeState = FADE_IDLE; + mNextStreamURI = LLStringUtil::null; + mDone = true; + + gAudiop->startInternetStream(LLStringUtil::null); + gAudiop->stopInternetStream(); +} + +void LLViewerAudio::startFading() +{ + const F32 AUDIO_MUSIC_FADE_IN_TIME = 3.0f; + const F32 AUDIO_MUSIC_FADE_OUT_TIME = 2.0f; + // This minimum fade time prevents divide by zero and negative times + const F32 AUDIO_MUSIC_MINIMUM_FADE_TIME = 0.01f; + + if(mDone) + { + // The fade state here should only be one of FADE_IN or FADE_OUT, but, in case it is not, + // rather than check for both states assume a fade in and check for the fade out case. + mFadeTime = AUDIO_MUSIC_FADE_IN_TIME; + if (LLViewerAudio::getInstance()->getFadeState() == LLViewerAudio::FADE_OUT) + { + mFadeTime = AUDIO_MUSIC_FADE_OUT_TIME; + } + + // Prevent invalid fade time + mFadeTime = llmax(mFadeTime, AUDIO_MUSIC_MINIMUM_FADE_TIME); + + stream_fade_timer.reset(); + stream_fade_timer.setTimerExpirySec(mFadeTime); + mDone = false; + } +} + +F32 LLViewerAudio::getFadeVolume() +{ + F32 fade_volume = 1.0f; + + if (stream_fade_timer.hasExpired()) + { + mDone = true; + // If we have been fading out set volume to 0 until the next fade state occurs to prevent + // an audio transient. + if (LLViewerAudio::getInstance()->getFadeState() == LLViewerAudio::FADE_OUT) + { + fade_volume = 0.0f; + } + } + + if (!mDone) + { + // Calculate how far we are into the fade time + fade_volume = stream_fade_timer.getElapsedTimeF32() / mFadeTime; + + if (LLViewerAudio::getInstance()->getFadeState() == LLViewerAudio::FADE_OUT) + { + // If we are not fading in then we are fading out, so invert the fade + // direction; start loud and move towards zero volume. + fade_volume = 1.0f - fade_volume; + } + } + + return fade_volume; +} + +void LLViewerAudio::onTeleportFailed() +{ + if (gAudiop) + { + LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); + if (parcel) + { + mNextStreamURI = parcel->getMusicURL(); + } + } +} + void init_audio() { if (!gAudiop) @@ -142,12 +359,25 @@ void audio_update_volume(bool force_update) // Streaming Music if (gAudiop) - { + { + if (progress_view_visible && !LLViewerAudio::getInstance()->getForcedTeleportFade()) + { + LLViewerAudio::getInstance()->setForcedTeleportFade(true); + LLViewerAudio::getInstance()->startInternetStreamWithAutoFade(LLStringUtil::null); + LLViewerAudio::getInstance()->setNextStreamURI(LLStringUtil::null); + } + + if (!progress_view_visible && LLViewerAudio::getInstance()->getForcedTeleportFade() == true) + { + LLViewerAudio::getInstance()->setForcedTeleportFade(false); + } + F32 music_volume = gSavedSettings.getF32("AudioLevelMusic"); BOOL music_muted = gSavedSettings.getBOOL("MuteMusic"); - music_volume = mute_volume * master_volume * music_volume; - gAudiop->setInternetStreamGain ( music_muted || progress_view_visible ? 0.f : music_volume ); - + F32 fade_volume = LLViewerAudio::getInstance()->getFadeVolume(); + + music_volume = mute_volume * master_volume * music_volume * fade_volume; + gAudiop->setInternetStreamGain (music_muted ? 0.f : music_volume); } // Streaming Media diff --git a/indra/newview/llvieweraudio.h b/indra/newview/llvieweraudio.h index e5916285fb..a3da9fc6b8 100644 --- a/indra/newview/llvieweraudio.h +++ b/indra/newview/llvieweraudio.h @@ -27,6 +27,9 @@ #ifndef LL_VIEWERAUDIO_H #define LL_VIEWERAUDIO_H +#include "llframetimer.h" +#include "llsingleton.h" + // comment out to turn off wind #define kAUDIO_ENABLE_WIND //#define kAUDIO_ENABLE_WATER 1 // comment out to turn off water @@ -38,4 +41,48 @@ void audio_update_volume(bool force_update = true); void audio_update_listener(); void audio_update_wind(bool force_update = true); +class LLViewerAudio : public LLSingleton<LLViewerAudio> +{ +public: + + enum EFadeState + { + FADE_IDLE, + FADE_IN, + FADE_OUT, + }; + + LLViewerAudio(); + virtual ~LLViewerAudio(); + + void startInternetStreamWithAutoFade(std::string streamURI); + void stopInternetStreamWithAutoFade(); + + bool onIdleUpdate(); + + EFadeState getFadeState() { return mFadeState; } + bool isDone() { return mDone; }; + F32 getFadeVolume(); + bool getForcedTeleportFade() { return mForcedTeleportFade; }; + void setForcedTeleportFade(bool fade) { mForcedTeleportFade = fade;} ; + void setNextStreamURI(std::string stream) { mNextStreamURI = stream; } ; + +private: + + bool mDone; + F32 mFadeTime; + std::string mNextStreamURI; + EFadeState mFadeState; + LLFrameTimer stream_fade_timer; + bool mIdleListnerActive; + bool mForcedTeleportFade; + boost::signals2::connection mTeleportFailedConnection; + + void registerIdleListener(); + void deregisterIdleListener() { mIdleListnerActive = false; }; + void startFading(); + void onTeleportFailed(); + +}; + #endif //LL_VIEWER_H diff --git a/indra/newview/llviewercamera.cpp b/indra/newview/llviewercamera.cpp index 7f7366dd3d..a437a8b3b5 100644 --- a/indra/newview/llviewercamera.cpp +++ b/indra/newview/llviewercamera.cpp @@ -218,8 +218,15 @@ void LLViewerCamera::calcProjection(const F32 far_distance) const void LLViewerCamera::updateFrustumPlanes(LLCamera& camera, BOOL ortho, BOOL zflip, BOOL no_hacks) { GLint* viewport = (GLint*) gGLViewport; - GLdouble* model = gGLModelView; - GLdouble* proj = gGLProjection; + F64 model[16]; + F64 proj[16]; + + for (U32 i = 0; i < 16; i++) + { + model[i] = (F64) gGLModelView[i]; + proj[i] = (F64) gGLProjection[i]; + } + GLdouble objX,objY,objZ; LLVector3 frust[8]; @@ -325,8 +332,8 @@ void LLViewerCamera::setPerspective(BOOL for_selection, aspect = getAspect(); // Load camera view matrix - glMatrixMode( GL_PROJECTION ); - glLoadIdentity(); + gGL.matrixMode(LLRender::MM_PROJECTION); + gGL.loadIdentity(); glh::matrix4f proj_mat; @@ -385,14 +392,14 @@ void LLViewerCamera::setPerspective(BOOL for_selection, proj_mat *= gl_perspective(fov_y,aspect,z_near,z_far); - glLoadMatrixf(proj_mat.m); + gGL.loadMatrix(proj_mat.m); for (U32 i = 0; i < 16; i++) { gGLProjection[i] = proj_mat.m[i]; } - glMatrixMode( GL_MODELVIEW ); + gGL.matrixMode(LLRender::MM_MODELVIEW); glh::matrix4f modelview((GLfloat*) OGL_TO_CFR_ROTATION); @@ -402,7 +409,7 @@ void LLViewerCamera::setPerspective(BOOL for_selection, modelview *= glh::matrix4f(ogl_matrix); - glLoadMatrixf(modelview.m); + gGL.loadMatrix(modelview.m); if (for_selection && (width > 1 || height > 1)) { @@ -420,7 +427,6 @@ void LLViewerCamera::setPerspective(BOOL for_selection, if (!for_selection && mZoomFactor == 1.f) { // Save GL matrices for access elsewhere in code, especially project_world_to_screen - //glGetDoublev(GL_MODELVIEW_MATRIX, gGLModelView); for (U32 i = 0; i < 16; i++) { gGLModelView[i] = modelview.m[i]; @@ -428,14 +434,6 @@ void LLViewerCamera::setPerspective(BOOL for_selection, } updateFrustumPlanes(*this); - - /*if (gSavedSettings.getBOOL("CameraOffset")) - { - glMatrixMode(GL_PROJECTION); - glTranslatef(0,0,-50); - glRotatef(20.0,1,0,0); - glMatrixMode(GL_MODELVIEW); - }*/ } @@ -443,11 +441,20 @@ void LLViewerCamera::setPerspective(BOOL for_selection, // screen coordinates to the agent's region. void LLViewerCamera::projectScreenToPosAgent(const S32 screen_x, const S32 screen_y, LLVector3* pos_agent) const { - GLdouble x, y, z; + + F64 mdlv[16]; + F64 proj[16]; + + for (U32 i = 0; i < 16; i++) + { + mdlv[i] = (F64) gGLModelView[i]; + proj[i] = (F64) gGLProjection[i]; + } + gluUnProject( GLdouble(screen_x), GLdouble(screen_y), 0.0, - gGLModelView, gGLProjection, (GLint*)gGLViewport, + mdlv, proj, (GLint*)gGLViewport, &x, &y, &z ); @@ -484,8 +491,17 @@ BOOL LLViewerCamera::projectPosAgentToScreen(const LLVector3 &pos_agent, LLCoord viewport[2] = world_view_rect.getWidth(); viewport[3] = world_view_rect.getHeight(); + F64 mdlv[16]; + F64 proj[16]; + + for (U32 i = 0; i < 16; i++) + { + mdlv[i] = (F64) gGLModelView[i]; + proj[i] = (F64) gGLProjection[i]; + } + if (GL_TRUE == gluProject(pos_agent.mV[VX], pos_agent.mV[VY], pos_agent.mV[VZ], - gGLModelView, gGLProjection, (GLint*)viewport, + mdlv, proj, (GLint*)viewport, &x, &y, &z)) { // convert screen coordinates to virtual UI coordinates @@ -587,9 +603,19 @@ BOOL LLViewerCamera::projectPosAgentToScreenEdge(const LLVector3 &pos_agent, viewport[2] = world_view_rect.getWidth(); viewport[3] = world_view_rect.getHeight(); GLdouble x, y, z; // object's window coords, GL-style + + F64 mdlv[16]; + F64 proj[16]; + + for (U32 i = 0; i < 16; i++) + { + mdlv[i] = (F64) gGLModelView[i]; + proj[i] = (F64) gGLProjection[i]; + } + if (GL_TRUE == gluProject(pos_agent.mV[VX], pos_agent.mV[VY], - pos_agent.mV[VZ], gGLModelView, - gGLProjection, (GLint*)viewport, + pos_agent.mV[VZ], mdlv, + proj, (GLint*)viewport, &x, &y, &z)) { x /= gViewerWindow->getDisplayScale().mV[VX]; diff --git a/indra/newview/llviewercontrol.cpp b/indra/newview/llviewercontrol.cpp index 967e26be0c..093b84413a 100644 --- a/indra/newview/llviewercontrol.cpp +++ b/indra/newview/llviewercontrol.cpp @@ -118,12 +118,6 @@ static bool handleSetShaderChanged(const LLSD& newvalue) gBumpImageList.destroyGL(); gBumpImageList.restoreGL(); - // Changing shader also changes the terrain detail to high, reflect that change here - if (newvalue.asBoolean()) - { - // shaders enabled, set terrain detail to high - gSavedSettings.setS32("RenderTerrainDetail", 1); - } // else, leave terrain detail as is LLViewerShaderMgr::instance()->setShaders(); return true; @@ -187,21 +181,6 @@ static bool handleReleaseGLBufferChanged(const LLSD& newvalue) return true; } -static bool handleFSAASamplesChanged(const LLSD& newvalue) -{ - if (gPipeline.isInit()) - { - gPipeline.releaseGLBuffers(); - gPipeline.createGLBuffers(); - - if (LLPipeline::sRenderDeferred) - { - LLViewerShaderMgr::instance()->setShaders(); - } - } - return true; -} - static bool handleAnisotropicChanged(const LLSD& newvalue) { LLImageGL::sGlobalUseAnisotropic = newvalue.asBoolean(); @@ -403,6 +382,7 @@ static bool handleRenderDeferredChanged(const LLSD& newvalue) LLRenderTarget::sUseFBO = newvalue.asBoolean(); if (gPipeline.isInit()) { + LLPipeline::refreshCachedSettings(); gPipeline.updateRenderDeferred(); gPipeline.releaseGLBuffers(); gPipeline.createGLBuffers(); @@ -472,12 +452,6 @@ bool handleEffectColorChanged(const LLSD& newvalue) return true; } -bool handleVectorizeChanged(const LLSD& newvalue) -{ - LLViewerJointMesh::updateVectorize(); - return true; -} - bool handleHighResSnapshotChanged(const LLSD& newvalue) { // High Res Snapshot active, must uncheck RenderUIInSnapshot @@ -588,21 +562,20 @@ void settings_setup_listeners() gSavedSettings.getControl("OctreeMaxNodeCapacity")->getSignal()->connect(boost::bind(&handleRepartition, _2)); gSavedSettings.getControl("OctreeAlphaDistanceFactor")->getSignal()->connect(boost::bind(&handleRepartition, _2)); gSavedSettings.getControl("OctreeAttachmentSizeFactor")->getSignal()->connect(boost::bind(&handleRepartition, _2)); - gSavedSettings.getControl("RenderMaxTextureIndex")->getSignal()->connect(boost::bind(&handleResetVertexBuffersChanged, _2)); + gSavedSettings.getControl("RenderMaxTextureIndex")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _2)); gSavedSettings.getControl("RenderUseTriStrips")->getSignal()->connect(boost::bind(&handleResetVertexBuffersChanged, _2)); - gSavedSettings.getControl("RenderAnimateTrees")->getSignal()->connect(boost::bind(&handleResetVertexBuffersChanged, _2)); gSavedSettings.getControl("RenderAvatarVP")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _2)); gSavedSettings.getControl("VertexShaderEnable")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _2)); gSavedSettings.getControl("RenderUIBuffer")->getSignal()->connect(boost::bind(&handleReleaseGLBufferChanged, _2)); + gSavedSettings.getControl("RenderDepthOfField")->getSignal()->connect(boost::bind(&handleReleaseGLBufferChanged, _2)); + gSavedSettings.getControl("RenderFSAASamples")->getSignal()->connect(boost::bind(&handleReleaseGLBufferChanged, _2)); gSavedSettings.getControl("RenderSpecularResX")->getSignal()->connect(boost::bind(&handleReleaseGLBufferChanged, _2)); gSavedSettings.getControl("RenderSpecularResY")->getSignal()->connect(boost::bind(&handleReleaseGLBufferChanged, _2)); gSavedSettings.getControl("RenderSpecularExponent")->getSignal()->connect(boost::bind(&handleReleaseGLBufferChanged, _2)); - gSavedSettings.getControl("RenderFSAASamples")->getSignal()->connect(boost::bind(&handleFSAASamplesChanged, _2)); gSavedSettings.getControl("RenderAnisotropic")->getSignal()->connect(boost::bind(&handleAnisotropicChanged, _2)); gSavedSettings.getControl("RenderShadowResolutionScale")->getSignal()->connect(boost::bind(&handleReleaseGLBufferChanged, _2)); gSavedSettings.getControl("RenderGlow")->getSignal()->connect(boost::bind(&handleReleaseGLBufferChanged, _2)); gSavedSettings.getControl("RenderGlow")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _2)); - gSavedSettings.getControl("EnableRippleWater")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _2)); gSavedSettings.getControl("RenderGlowResolutionPow")->getSignal()->connect(boost::bind(&handleReleaseGLBufferChanged, _2)); gSavedSettings.getControl("RenderAvatarCloth")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _2)); gSavedSettings.getControl("WindLightUseAtmosShaders")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _2)); @@ -633,7 +606,6 @@ void settings_setup_listeners() gSavedSettings.getControl("RenderDeferred")->getSignal()->connect(boost::bind(&handleRenderDeferredChanged, _2)); gSavedSettings.getControl("RenderShadowDetail")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _2)); gSavedSettings.getControl("RenderDeferredSSAO")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _2)); - gSavedSettings.getControl("RenderDeferredGI")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _2)); gSavedSettings.getControl("RenderPerformanceTest")->getSignal()->connect(boost::bind(&handleRenderPerfTestChanged, _2)); gSavedSettings.getControl("TextureMemory")->getSignal()->connect(boost::bind(&handleVideoMemoryChanged, _2)); gSavedSettings.getControl("AuditTexture")->getSignal()->connect(boost::bind(&handleAuditTextureChanged, _2)); @@ -658,6 +630,7 @@ void settings_setup_listeners() gSavedSettings.getControl("MuteAmbient")->getSignal()->connect(boost::bind(&handleAudioVolumeChanged, _2)); gSavedSettings.getControl("MuteUI")->getSignal()->connect(boost::bind(&handleAudioVolumeChanged, _2)); gSavedSettings.getControl("RenderVBOEnable")->getSignal()->connect(boost::bind(&handleResetVertexBuffersChanged, _2)); + gSavedSettings.getControl("RenderUseVAO")->getSignal()->connect(boost::bind(&handleResetVertexBuffersChanged, _2)); gSavedSettings.getControl("RenderVBOMappingDisable")->getSignal()->connect(boost::bind(&handleResetVertexBuffersChanged, _2)); gSavedSettings.getControl("RenderUseStreamVBO")->getSignal()->connect(boost::bind(&handleResetVertexBuffersChanged, _2)); gSavedSettings.getControl("RenderPreferStreamDraw")->getSignal()->connect(boost::bind(&handleResetVertexBuffersChanged, _2)); @@ -712,10 +685,6 @@ void settings_setup_listeners() gSavedSettings.getControl("UserLogFile")->getSignal()->connect(boost::bind(&handleLogFileChanged, _2)); gSavedSettings.getControl("RenderHideGroupTitle")->getSignal()->connect(boost::bind(handleHideGroupTitleChanged, _2)); gSavedSettings.getControl("HighResSnapshot")->getSignal()->connect(boost::bind(handleHighResSnapshotChanged, _2)); - gSavedSettings.getControl("VectorizePerfTest")->getSignal()->connect(boost::bind(&handleVectorizeChanged, _2)); - gSavedSettings.getControl("VectorizeEnable")->getSignal()->connect(boost::bind(&handleVectorizeChanged, _2)); - gSavedSettings.getControl("VectorizeProcessor")->getSignal()->connect(boost::bind(&handleVectorizeChanged, _2)); - gSavedSettings.getControl("VectorizeSkin")->getSignal()->connect(boost::bind(&handleVectorizeChanged, _2)); gSavedSettings.getControl("EnableVoiceChat")->getSignal()->connect(boost::bind(&handleVoiceClientPrefsChanged, _2)); gSavedSettings.getControl("PTTCurrentlyEnabled")->getSignal()->connect(boost::bind(&handleVoiceClientPrefsChanged, _2)); gSavedSettings.getControl("PushToTalkButton")->getSignal()->connect(boost::bind(&handleVoiceClientPrefsChanged, _2)); diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp index d6512207ae..cb40af7061 100644 --- a/indra/newview/llviewerdisplay.cpp +++ b/indra/newview/llviewerdisplay.cpp @@ -124,7 +124,8 @@ void display_startup() // Update images? //gImageList.updateImages(0.01f); - + LLTexUnit::sWhiteTexture = LLViewerFetchedTexture::sWhiteImagep->getTexName(); + LLGLSDefault gls_default; // Required for HTML update in login screen @@ -212,6 +213,10 @@ static LLFastTimer::DeclareTimer FTM_RENDER("Render", true); static LLFastTimer::DeclareTimer FTM_UPDATE_SKY("Update Sky"); static LLFastTimer::DeclareTimer FTM_UPDATE_TEXTURES("Update Textures"); static LLFastTimer::DeclareTimer FTM_IMAGE_UPDATE("Update Images"); +static LLFastTimer::DeclareTimer FTM_IMAGE_UPDATE_CLASS("Class"); +static LLFastTimer::DeclareTimer FTM_IMAGE_UPDATE_BUMP("Bump"); +static LLFastTimer::DeclareTimer FTM_IMAGE_UPDATE_LIST("List"); +static LLFastTimer::DeclareTimer FTM_IMAGE_UPDATE_DELETE("Delete"); // Paint the display! void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot) @@ -224,6 +229,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot) gGL.flush(); glClear(GL_COLOR_BUFFER_BIT); gViewerWindow->getWindow()->swapBuffers(); + LLPipeline::refreshCachedSettings(); gPipeline.resizeScreenTexture(); gResizeScreenTexture = FALSE; gWindowResized = FALSE; @@ -523,10 +529,9 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot) // Note that these are not the same as GL defaults... stop_glerror(); - F32 one[4] = {1.f, 1.f, 1.f, 1.f}; - glLightModelfv (GL_LIGHT_MODEL_AMBIENT,one); + gGL.setAmbientLightColor(LLColor4::white); stop_glerror(); - + ///////////////////////////////////// // // Render @@ -612,11 +617,6 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot) LLDrawable::incrementVisible(); LLSpatialGroup::sNoDelete = TRUE; - LLPipeline::sUseOcclusion = - (!gUseWireframe - && LLFeatureManager::getInstance()->isFeatureAvailable("UseOcclusion") - && gSavedSettings.getBOOL("UseOcclusion") - && gGLManager.mHasOcclusionQuery) ? 2 : 0; LLTexUnit::sWhiteTexture = LLViewerFetchedTexture::sWhiteImagep->getTexName(); /*if (LLPipeline::sUseOcclusion && LLPipeline::sRenderDeferred) @@ -624,12 +624,6 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot) LLPipeline::sUseOcclusion = 3; }*/ - LLPipeline::sAutoMaskAlphaDeferred = gSavedSettings.getBOOL("RenderAutoMaskAlphaDeferred"); - LLPipeline::sAutoMaskAlphaNonDeferred = gSavedSettings.getBOOL("RenderAutoMaskAlphaNonDeferred"); - LLPipeline::sUseFarClip = gSavedSettings.getBOOL("RenderUseFarClip"); - LLVOAvatar::sMaxVisible = (U32)gSavedSettings.getS32("RenderAvatarMaxVisible"); - LLPipeline::sDelayVBUpdate = gSavedSettings.getBOOL("RenderDelayVBUpdate"); - S32 occlusion = LLPipeline::sUseOcclusion; if (gDepthDirty) { //depth buffer is invalid, don't overwrite occlusion state @@ -657,10 +651,6 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot) { LLMemType mt_ds(LLMemType::MTYPE_DISPLAY_SWAP); - { - LLFastTimer ftm(FTM_CLIENT_COPY); - LLVertexBuffer::clientCopy(0.016); - } if (gResizeScreenTexture) { @@ -701,10 +691,10 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot) glh_set_current_projection(proj); glh_set_current_modelview(mod); - glMatrixMode(GL_PROJECTION); - glLoadMatrixf(proj.m); - glMatrixMode(GL_MODELVIEW); - glLoadMatrixf(mod.m); + gGL.matrixMode(LLRender::MM_PROJECTION); + gGL.loadMatrix(proj.m); + gGL.matrixMode(LLRender::MM_MODELVIEW); + gGL.loadMatrix(mod.m); gViewerWindow->setup3DViewport(); LLGLState::checkStates(); @@ -724,6 +714,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot) LLAppViewer::instance()->pingMainloopTimeout("Display:Imagery"); gPipeline.generateWaterReflection(*LLViewerCamera::getInstance()); gPipeline.generateHighlight(*LLViewerCamera::getInstance()); + gPipeline.renderPhysicsDisplay(); } LLGLState::checkStates(); @@ -742,18 +733,31 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot) LLMemType mt_iu(LLMemType::MTYPE_DISPLAY_IMAGE_UPDATE); LLFastTimer t(FTM_IMAGE_UPDATE); - LLViewerTexture::updateClass(LLViewerCamera::getInstance()->getVelocityStat()->getMean(), - LLViewerCamera::getInstance()->getAngularVelocityStat()->getMean()); + { + LLFastTimer t(FTM_IMAGE_UPDATE_CLASS); + LLViewerTexture::updateClass(LLViewerCamera::getInstance()->getVelocityStat()->getMean(), + LLViewerCamera::getInstance()->getAngularVelocityStat()->getMean()); + } - gBumpImageList.updateImages(); // must be called before gTextureList version so that it's textures are thrown out first. + + { + LLFastTimer t(FTM_IMAGE_UPDATE_BUMP); + gBumpImageList.updateImages(); // must be called before gTextureList version so that it's textures are thrown out first. + } - F32 max_image_decode_time = 0.050f*gFrameIntervalSeconds; // 50 ms/second decode time - max_image_decode_time = llclamp(max_image_decode_time, 0.002f, 0.005f ); // min 2ms/frame, max 5ms/frame) - gTextureList.updateImages(max_image_decode_time); + { + LLFastTimer t(FTM_IMAGE_UPDATE_LIST); + F32 max_image_decode_time = 0.050f*gFrameIntervalSeconds; // 50 ms/second decode time + max_image_decode_time = llclamp(max_image_decode_time, 0.002f, 0.005f ); // min 2ms/frame, max 5ms/frame) + gTextureList.updateImages(max_image_decode_time); + } - //remove dead textures from GL - LLImageGL::deleteDeadTextures(); - stop_glerror(); + { + LLFastTimer t(FTM_IMAGE_UPDATE_DELETE); + //remove dead textures from GL + LLImageGL::deleteDeadTextures(); + stop_glerror(); + } } LLGLState::checkStates(); @@ -812,13 +816,13 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot) //// assumes frontmost floater with focus is opaque //if (frontmost_floaterp && gFocusMgr.childHasKeyboardFocus(frontmost_floaterp)) //{ - // glMatrixMode(GL_MODELVIEW); - // glPushMatrix(); + // gGL.matrixMode(LLRender::MM_MODELVIEW); + // gGL.pushMatrix(); // { // gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); // glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_TRUE); - // glLoadIdentity(); + // gGL.loadIdentity(); // LLRect floater_rect = frontmost_floaterp->calcScreenRect(); // // deflate by one pixel so rounding errors don't occlude outside of floater extents @@ -828,8 +832,8 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot) // (F32)floater_rect.mRight / (F32)gViewerWindow->getWindowWidthScaled(), // (F32)floater_rect.mBottom / (F32)gViewerWindow->getWindowHeightScaled()); // floater_3d_rect.translate(-0.5f, -0.5f); - // glTranslatef(0.f, 0.f, -LLViewerCamera::getInstance()->getNear()); - // glScalef(LLViewerCamera::getInstance()->getNear() * LLViewerCamera::getInstance()->getAspect() / sinf(LLViewerCamera::getInstance()->getView()), LLViewerCamera::getInstance()->getNear() / sinf(LLViewerCamera::getInstance()->getView()), 1.f); + // gGL.translatef(0.f, 0.f, -LLViewerCamera::getInstance()->getNear()); + // gGL.scalef(LLViewerCamera::getInstance()->getNear() * LLViewerCamera::getInstance()->getAspect() / sinf(LLViewerCamera::getInstance()->getView()), LLViewerCamera::getInstance()->getNear() / sinf(LLViewerCamera::getInstance()->getView()), 1.f); // gGL.color4fv(LLColor4::white.mV); // gGL.begin(LLVertexBuffer::QUADS); // { @@ -841,11 +845,10 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot) // gGL.end(); // glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); // } - // glPopMatrix(); + // gGL.popMatrix(); //} LLPipeline::sUnderWaterRender = LLViewerCamera::getInstance()->cameraUnderWater() ? TRUE : FALSE; - LLPipeline::refreshRenderDeferred(); LLGLState::checkStates(); LLGLState::checkClientArrays(); @@ -865,6 +868,11 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot) else { gPipeline.mScreen.bindTarget(); + if (LLPipeline::sUnderWaterRender && !gPipeline.canUseWindLightShaders()) + { + const LLColor4 &col = LLDrawPoolWater::sWaterFogColor; + glClearColor(col.mV[0], col.mV[1], col.mV[2], 0.f); + } gPipeline.mScreen.clear(); } @@ -978,10 +986,10 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot) void render_hud_attachments() { LLMemType mt_ra(LLMemType::MTYPE_DISPLAY_RENDER_ATTACHMENTS); - glMatrixMode(GL_PROJECTION); - glPushMatrix(); - glMatrixMode(GL_MODELVIEW); - glPushMatrix(); + gGL.matrixMode(LLRender::MM_PROJECTION); + gGL.pushMatrix(); + gGL.matrixMode(LLRender::MM_MODELVIEW); + gGL.pushMatrix(); glh::matrix4f current_proj = glh_get_current_projection(); glh::matrix4f current_mod = glh_get_current_modelview(); @@ -1067,10 +1075,10 @@ void render_hud_attachments() } LLPipeline::sUseOcclusion = use_occlusion; } - glMatrixMode(GL_PROJECTION); - glPopMatrix(); - glMatrixMode(GL_MODELVIEW); - glPopMatrix(); + gGL.matrixMode(LLRender::MM_PROJECTION); + gGL.popMatrix(); + gGL.matrixMode(LLRender::MM_MODELVIEW); + gGL.popMatrix(); glh_set_current_projection(current_proj); glh_set_current_modelview(current_mod); @@ -1153,12 +1161,12 @@ BOOL setup_hud_matrices(const LLRect& screen_region) if (!result) return result; // set up transform to keep HUD objects in front of camera - glMatrixMode(GL_PROJECTION); - glLoadMatrixf(proj.m); + gGL.matrixMode(LLRender::MM_PROJECTION); + gGL.loadMatrix(proj.m); glh_set_current_projection(proj); - glMatrixMode(GL_MODELVIEW); - glLoadMatrixf(model.m); + gGL.matrixMode(LLRender::MM_MODELVIEW); + gGL.loadMatrix(model.m); glh_set_current_modelview(model); return TRUE; } @@ -1174,8 +1182,8 @@ void render_ui(F32 zoom_factor, int subfield) if (!gSnapshot) { - glPushMatrix(); - glLoadMatrixd(gGLLastModelView); + gGL.pushMatrix(); + gGL.loadMatrix(gGLLastModelView); glh_set_current_modelview(glh_copy_matrix(gGLLastModelView)); } @@ -1231,7 +1239,7 @@ void render_ui(F32 zoom_factor, int subfield) if (!gSnapshot) { glh_set_current_modelview(saved_view); - glPopMatrix(); + gGL.popMatrix(); } if (gDisplaySwapBuffers) @@ -1304,10 +1312,10 @@ void draw_axes() gGL.vertex3f(0.0f, 0.0f, 40.0f); gGL.end(); // Some coordinate axes - glPushMatrix(); - glTranslatef( v.mV[VX], v.mV[VY], v.mV[VZ] ); + gGL.pushMatrix(); + gGL.translatef( v.mV[VX], v.mV[VY], v.mV[VZ] ); renderCoordinateAxes(); - glPopMatrix(); + gGL.popMatrix(); } void render_ui_3d() @@ -1329,14 +1337,19 @@ void render_ui_3d() // Debugging stuff goes before the UI. + stop_glerror(); + + if (LLGLSLShader::sNoFixedFunction) + { + gUIProgram.bind(); + } + // Coordinate axes if (gSavedSettings.getBOOL("ShowAxes")) { draw_axes(); } - stop_glerror(); - gViewerWindow->renderSelections(FALSE, FALSE, TRUE); // Non HUD call in render_hud_elements stop_glerror(); } @@ -1377,10 +1390,10 @@ void render_ui_2d() gGL.pushMatrix(); S32 half_width = (gViewerWindow->getWorldViewWidthScaled() / 2); S32 half_height = (gViewerWindow->getWorldViewHeightScaled() / 2); - glScalef(LLUI::sGLScaleFactor.mV[0], LLUI::sGLScaleFactor.mV[1], 1.f); - glTranslatef((F32)half_width, (F32)half_height, 0.f); + gGL.scalef(LLUI::sGLScaleFactor.mV[0], LLUI::sGLScaleFactor.mV[1], 1.f); + gGL.translatef((F32)half_width, (F32)half_height, 0.f); F32 zoom = gAgentCamera.mHUDCurZoom; - glScalef(zoom,zoom,1.f); + gGL.scalef(zoom,zoom,1.f); gGL.color4fv(LLColor4::white.mV); gl_rect_2d(-half_width, half_height, half_width, -half_height, FALSE); gGL.popMatrix(); @@ -1459,6 +1472,11 @@ void render_ui_2d() void render_disconnected_background() { + if (LLGLSLShader::sNoFixedFunction) + { + gUIProgram.bind(); + } + gGL.color4f(1,1,1,1); if (!gDisconnectedImagep && gDisconnected) { @@ -1512,22 +1530,28 @@ void render_disconnected_background() { LLGLSUIDefault gls_ui; gViewerWindow->setup2DRender(); - glPushMatrix(); + gGL.pushMatrix(); { // scale ui to reflect UIScaleFactor // this can't be done in setup2DRender because it requires a // pushMatrix/popMatrix pair const LLVector2& display_scale = gViewerWindow->getDisplayScale(); - glScalef(display_scale.mV[VX], display_scale.mV[VY], 1.f); + gGL.scalef(display_scale.mV[VX], display_scale.mV[VY], 1.f); gGL.getTexUnit(0)->bind(gDisconnectedImagep); gGL.color4f(1.f, 1.f, 1.f, 1.f); gl_rect_2d_simple_tex(width, height); gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); } - glPopMatrix(); + gGL.popMatrix(); } gGL.flush(); + + if (LLGLSLShader::sNoFixedFunction) + { + gUIProgram.unbind(); + } + } void display_cleanup() diff --git a/indra/newview/llviewerfloaterreg.cpp b/indra/newview/llviewerfloaterreg.cpp index ba53540374..8406f639df 100644 --- a/indra/newview/llviewerfloaterreg.cpp +++ b/indra/newview/llviewerfloaterreg.cpp @@ -64,8 +64,8 @@ #include "llfloatergroups.h" #include "llfloaterhardwaresettings.h" #include "llfloaterhelpbrowser.h" -#include "llfloatermediabrowser.h" #include "llfloaterwebcontent.h" +#include "llfloaterwebprofile.h" #include "llfloatermediasettings.h" #include "llfloaterhud.h" #include "llfloaterimagepreview.h" @@ -85,7 +85,6 @@ #include "llfloateropenobject.h" #include "llfloaterpay.h" #include "llfloaterperms.h" -#include "llfloaterpostcard.h" #include "llfloaterpostprocess.h" #include "llfloaterpreference.h" #include "llfloaterproperties.h" @@ -107,6 +106,7 @@ #include "llfloatertos.h" #include "llfloatertopobjects.h" #include "llfloatertoybox.h" +#include "llfloatertranslationsettings.h" #include "llfloateruipreview.h" #include "llfloatervoiceeffect.h" #include "llfloaterwhitelistentry.h" @@ -226,7 +226,6 @@ void LLViewerFloaterReg::registerFloaters() LLFloaterReg::add("land_holdings", "floater_land_holdings.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterLandHoldings>); LLFloaterReg::add("mem_leaking", "floater_mem_leaking.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterMemLeak>); - LLFloaterReg::add("media_browser", "floater_media_browser.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterMediaBrowser>); LLFloaterReg::add("media_settings", "floater_media_settings.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterMediaSettings>); LLFloaterReg::add("message_critical", "floater_critical.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterTOS>); LLFloaterReg::add("message_tos", "floater_tos.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterTOS>); @@ -244,10 +243,10 @@ void LLViewerFloaterReg::registerFloaters() LLFloaterReg::add("people", "floater_people.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterSidePanelContainer>); LLFloaterReg::add("places", "floater_places.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterSidePanelContainer>); - LLFloaterReg::add("postcard", "floater_postcard.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterPostcard>); LLFloaterReg::add("preferences", "floater_preferences.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterPreference>); LLFloaterReg::add("prefs_proxy", "floater_preferences_proxy.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterPreferenceProxy>); LLFloaterReg::add("prefs_hardware_settings", "floater_hardware_settings.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterHardwareSettings>); + LLFloaterReg::add("prefs_translation", "floater_translation_settings.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterTranslationSettings>); LLFloaterReg::add("perm_prefs", "floater_perm_prefs.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterPerms>); LLFloaterReg::add("picks", "floater_picks.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterSidePanelContainer>); LLFloaterReg::add("pref_joystick", "floater_joystick.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterJoystick>); @@ -287,7 +286,8 @@ void LLViewerFloaterReg::registerFloaters() LLFloaterReg::add("stop_queue", "floater_script_queue.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterNotRunQueue>); LLFloaterReg::add("snapshot", "floater_snapshot.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterSnapshot>); LLFloaterReg::add("search", "floater_search.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterSearch>); - LLFloaterReg::add("profile", "floater_web_profile.xml", (LLFloaterBuildFunc)&LLFloaterWebContent::create); + LLFloaterReg::add("my_profile", "floater_my_web_profile.xml", (LLFloaterBuildFunc)&LLFloaterWebProfile::create); + LLFloaterReg::add("profile", "floater_web_profile.xml", (LLFloaterBuildFunc)&LLFloaterWebProfile::create); LLFloaterReg::add("how_to", "floater_how_to.xml", (LLFloaterBuildFunc)&LLFloaterWebContent::create); @@ -303,7 +303,7 @@ void LLViewerFloaterReg::registerFloaters() LLFloaterReg::add("web_content", "floater_web_content.xml", (LLFloaterBuildFunc)&LLFloaterWebContent::create); LLFloaterReg::add("whitelist_entry", "floater_whitelist_entry.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterWhiteListEntry>); - LLFloaterWindowSizeUtil::registerFloater(); + LLFloaterReg::add("window_size", "floater_window_size.xml", &LLFloaterReg::build<LLFloaterWindowSize>); LLFloaterReg::add("world_map", "floater_world_map.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterWorldMap>); // *NOTE: Please keep these alphabetized for easier merges diff --git a/indra/newview/llviewerfoldertype.cpp b/indra/newview/llviewerfoldertype.cpp index 9101222393..a179b61cff 100644 --- a/indra/newview/llviewerfoldertype.cpp +++ b/indra/newview/llviewerfoldertype.cpp @@ -40,6 +40,7 @@ struct ViewerFolderEntry : public LLDictionaryEntry const std::string &icon_name_open, // name of the folder icon const std::string &icon_name_closed, BOOL is_quiet, // folder doesn't need a UI update when changed + bool hide_if_empty, // folder not shown if empty const std::string &dictionary_name = empty_string // no reverse lookup needed on non-ensembles, so in most cases just leave this blank ) : @@ -47,7 +48,8 @@ struct ViewerFolderEntry : public LLDictionaryEntry mNewCategoryName(new_category_name), mIconNameOpen(icon_name_open), mIconNameClosed(icon_name_closed), - mIsQuiet(is_quiet) + mIsQuiet(is_quiet), + mHideIfEmpty(hide_if_empty) { mAllowedNames.clear(); } @@ -66,7 +68,8 @@ struct ViewerFolderEntry : public LLDictionaryEntry */ mIconNameOpen("Inv_FolderOpen"), mIconNameClosed("Inv_FolderClosed"), mNewCategoryName(new_category_name), - mIsQuiet(FALSE) + mIsQuiet(FALSE), + mHideIfEmpty(false) { const std::string delims (","); LLStringUtilBase<char>::getTokens(allowed_names, mAllowedNames, delims); @@ -91,6 +94,7 @@ struct ViewerFolderEntry : public LLDictionaryEntry typedef std::vector<std::string> name_vec_t; name_vec_t mAllowedNames; BOOL mIsQuiet; + bool mHideIfEmpty; }; class LLViewerFolderDictionary : public LLSingleton<LLViewerFolderDictionary>, @@ -104,43 +108,43 @@ protected: LLViewerFolderDictionary::LLViewerFolderDictionary() { - // NEW CATEGORY NAME FOLDER OPEN FOLDER CLOSED QUIET? - // |-------------------------|-----------------------|----------------------|-----------| - addEntry(LLFolderType::FT_TEXTURE, new ViewerFolderEntry("Textures", "Inv_SysOpen", "Inv_SysClosed", FALSE)); - addEntry(LLFolderType::FT_SOUND, new ViewerFolderEntry("Sounds", "Inv_SysOpen", "Inv_SysClosed", FALSE)); - addEntry(LLFolderType::FT_CALLINGCARD, new ViewerFolderEntry("Calling Cards", "Inv_SysOpen", "Inv_SysClosed", FALSE)); - addEntry(LLFolderType::FT_LANDMARK, new ViewerFolderEntry("Landmarks", "Inv_SysOpen", "Inv_SysClosed", FALSE)); - addEntry(LLFolderType::FT_CLOTHING, new ViewerFolderEntry("Clothing", "Inv_SysOpen", "Inv_SysClosed", FALSE)); - addEntry(LLFolderType::FT_OBJECT, new ViewerFolderEntry("Objects", "Inv_SysOpen", "Inv_SysClosed", FALSE)); - addEntry(LLFolderType::FT_NOTECARD, new ViewerFolderEntry("Notecards", "Inv_SysOpen", "Inv_SysClosed", FALSE)); - addEntry(LLFolderType::FT_ROOT_INVENTORY, new ViewerFolderEntry("My Inventory", "Inv_SysOpen", "Inv_SysClosed", FALSE)); - addEntry(LLFolderType::FT_LSL_TEXT, new ViewerFolderEntry("Scripts", "Inv_SysOpen", "Inv_SysClosed", FALSE)); - addEntry(LLFolderType::FT_BODYPART, new ViewerFolderEntry("Body Parts", "Inv_SysOpen", "Inv_SysClosed", FALSE)); - addEntry(LLFolderType::FT_TRASH, new ViewerFolderEntry("Trash", "Inv_TrashOpen", "Inv_TrashClosed", TRUE)); - addEntry(LLFolderType::FT_SNAPSHOT_CATEGORY, new ViewerFolderEntry("Photo Album", "Inv_SysOpen", "Inv_SysClosed", FALSE)); - addEntry(LLFolderType::FT_LOST_AND_FOUND, new ViewerFolderEntry("Lost And Found", "Inv_LostOpen", "Inv_LostClosed", TRUE)); - addEntry(LLFolderType::FT_ANIMATION, new ViewerFolderEntry("Animations", "Inv_SysOpen", "Inv_SysClosed", FALSE)); - addEntry(LLFolderType::FT_GESTURE, new ViewerFolderEntry("Gestures", "Inv_SysOpen", "Inv_SysClosed", FALSE)); - addEntry(LLFolderType::FT_FAVORITE, new ViewerFolderEntry("Favorites", "Inv_SysOpen", "Inv_SysClosed", FALSE)); + // NEW CATEGORY NAME FOLDER OPEN FOLDER CLOSED QUIET? HIDE IF EMPTY? + // |-------------------------|-----------------------|----------------------|-----------|--------------| + addEntry(LLFolderType::FT_TEXTURE, new ViewerFolderEntry("Textures", "Inv_SysOpen", "Inv_SysClosed", FALSE, true)); + addEntry(LLFolderType::FT_SOUND, new ViewerFolderEntry("Sounds", "Inv_SysOpen", "Inv_SysClosed", FALSE, true)); + addEntry(LLFolderType::FT_CALLINGCARD, new ViewerFolderEntry("Calling Cards", "Inv_SysOpen", "Inv_SysClosed", FALSE, true)); + addEntry(LLFolderType::FT_LANDMARK, new ViewerFolderEntry("Landmarks", "Inv_SysOpen", "Inv_SysClosed", FALSE, true)); + addEntry(LLFolderType::FT_CLOTHING, new ViewerFolderEntry("Clothing", "Inv_SysOpen", "Inv_SysClosed", FALSE, true)); + addEntry(LLFolderType::FT_OBJECT, new ViewerFolderEntry("Objects", "Inv_SysOpen", "Inv_SysClosed", FALSE, true)); + addEntry(LLFolderType::FT_NOTECARD, new ViewerFolderEntry("Notecards", "Inv_SysOpen", "Inv_SysClosed", FALSE, true)); + addEntry(LLFolderType::FT_ROOT_INVENTORY, new ViewerFolderEntry("My Inventory", "Inv_SysOpen", "Inv_SysClosed", FALSE, false)); + addEntry(LLFolderType::FT_LSL_TEXT, new ViewerFolderEntry("Scripts", "Inv_SysOpen", "Inv_SysClosed", FALSE, true)); + addEntry(LLFolderType::FT_BODYPART, new ViewerFolderEntry("Body Parts", "Inv_SysOpen", "Inv_SysClosed", FALSE, true)); + addEntry(LLFolderType::FT_TRASH, new ViewerFolderEntry("Trash", "Inv_TrashOpen", "Inv_TrashClosed", TRUE, false)); + addEntry(LLFolderType::FT_SNAPSHOT_CATEGORY, new ViewerFolderEntry("Photo Album", "Inv_SysOpen", "Inv_SysClosed", FALSE, true)); + addEntry(LLFolderType::FT_LOST_AND_FOUND, new ViewerFolderEntry("Lost And Found", "Inv_LostOpen", "Inv_LostClosed", TRUE, true)); + addEntry(LLFolderType::FT_ANIMATION, new ViewerFolderEntry("Animations", "Inv_SysOpen", "Inv_SysClosed", FALSE, true)); + addEntry(LLFolderType::FT_GESTURE, new ViewerFolderEntry("Gestures", "Inv_SysOpen", "Inv_SysClosed", FALSE, true)); + addEntry(LLFolderType::FT_FAVORITE, new ViewerFolderEntry("Favorites", "Inv_SysOpen", "Inv_SysClosed", FALSE, true)); - addEntry(LLFolderType::FT_CURRENT_OUTFIT, new ViewerFolderEntry("Current Outfit", "Inv_SysOpen", "Inv_SysClosed", TRUE)); - addEntry(LLFolderType::FT_OUTFIT, new ViewerFolderEntry("New Outfit", "Inv_LookFolderOpen", "Inv_LookFolderClosed", TRUE)); - addEntry(LLFolderType::FT_MY_OUTFITS, new ViewerFolderEntry("My Outfits", "Inv_SysOpen", "Inv_SysClosed", TRUE)); - addEntry(LLFolderType::FT_MESH, new ViewerFolderEntry("Meshes", "Inv_SysOpen", "Inv_SysClosed", FALSE)); + addEntry(LLFolderType::FT_CURRENT_OUTFIT, new ViewerFolderEntry("Current Outfit", "Inv_SysOpen", "Inv_SysClosed", TRUE, false)); + addEntry(LLFolderType::FT_OUTFIT, new ViewerFolderEntry("New Outfit", "Inv_LookFolderOpen", "Inv_LookFolderClosed", TRUE, true)); + addEntry(LLFolderType::FT_MY_OUTFITS, new ViewerFolderEntry("My Outfits", "Inv_SysOpen", "Inv_SysClosed", TRUE, true)); + addEntry(LLFolderType::FT_MESH, new ViewerFolderEntry("Meshes", "Inv_SysOpen", "Inv_SysClosed", FALSE, true)); - addEntry(LLFolderType::FT_INBOX, new ViewerFolderEntry("Inbox", "Inv_SysOpen", "Inv_SysClosed", FALSE)); - addEntry(LLFolderType::FT_OUTBOX, new ViewerFolderEntry("Outbox", "Inv_SysOpen", "Inv_SysClosed", FALSE)); + addEntry(LLFolderType::FT_INBOX, new ViewerFolderEntry("Inbox", "Inv_SysOpen", "Inv_SysClosed", FALSE, true)); + addEntry(LLFolderType::FT_OUTBOX, new ViewerFolderEntry("Outbox", "Inv_SysOpen", "Inv_SysClosed", FALSE, true)); - addEntry(LLFolderType::FT_BASIC_ROOT, new ViewerFolderEntry("Basic Root", "Inv_SysOpen", "Inv_SysClosed", FALSE)); + addEntry(LLFolderType::FT_BASIC_ROOT, new ViewerFolderEntry("Basic Root", "Inv_SysOpen", "Inv_SysClosed", FALSE, true)); - addEntry(LLFolderType::FT_NONE, new ViewerFolderEntry("New Folder", "Inv_FolderOpen", "Inv_FolderClosed", FALSE, "default")); + addEntry(LLFolderType::FT_NONE, new ViewerFolderEntry("New Folder", "Inv_FolderOpen", "Inv_FolderClosed", FALSE, false, "default")); #if SUPPORT_ENSEMBLES initEnsemblesFromFile(); #else for (U32 type = (U32)LLFolderType::FT_ENSEMBLE_START; type <= (U32)LLFolderType::FT_ENSEMBLE_END; ++type) { - addEntry((LLFolderType::EType)type, new ViewerFolderEntry("New Folder", "Inv_FolderOpen", "Inv_FolderClosed", FALSE)); + addEntry((LLFolderType::EType)type, new ViewerFolderEntry("New Folder", "Inv_FolderOpen", "Inv_FolderClosed", FALSE, false)); } #endif } @@ -259,6 +263,15 @@ BOOL LLViewerFolderType::lookupIsQuietType(LLFolderType::EType folder_type) return FALSE; } +bool LLViewerFolderType::lookupIsHiddenIfEmpty(LLFolderType::EType folder_type) +{ + const ViewerFolderEntry *entry = LLViewerFolderDictionary::getInstance()->lookup(folder_type); + if (entry) + { + return entry->mHideIfEmpty; + } + return false; +} const std::string &LLViewerFolderType::lookupNewCategoryName(LLFolderType::EType folder_type) { diff --git a/indra/newview/llviewerfoldertype.h b/indra/newview/llviewerfoldertype.h index f5938de619..13d5a8fbbd 100644 --- a/indra/newview/llviewerfoldertype.h +++ b/indra/newview/llviewerfoldertype.h @@ -40,6 +40,7 @@ public: static const std::string& lookupIconName(EType folder_type, BOOL is_open = FALSE); // folder icon name static BOOL lookupIsQuietType(EType folder_type); // folder doesn't require UI update when changes have occured + static bool lookupIsHiddenIfEmpty(EType folder_type); // folder is not displayed if empty static const std::string& lookupNewCategoryName(EType folder_type); // default name when creating new category static LLFolderType::EType lookupTypeFromNewCategoryName(const std::string& name); // default name when creating new category diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp index 519d4fe7f8..163581ea7f 100644 --- a/indra/newview/llviewerinventory.cpp +++ b/indra/newview/llviewerinventory.cpp @@ -1209,7 +1209,23 @@ void move_inventory_item( gAgent.sendReliableMessage(); } -void copy_inventory_from_notecard(const LLUUID& object_id, const LLUUID& notecard_inv_id, const LLInventoryItem *src, U32 callback_id) +const LLUUID get_folder_by_itemtype(const LLInventoryItem *src) +{ + LLUUID retval = LLUUID::null; + + if (src) + { + retval = gInventory.findCategoryUUIDForType(LLFolderType::assetTypeToFolderType(src->getType())); + } + + return retval; +} + +void copy_inventory_from_notecard(const LLUUID& destination_id, + const LLUUID& object_id, + const LLUUID& notecard_inv_id, + const LLInventoryItem *src, + U32 callback_id) { if (NULL == src) { @@ -1255,7 +1271,7 @@ void copy_inventory_from_notecard(const LLUUID& object_id, const LLUUID& notecar body["notecard-id"] = notecard_inv_id; body["object-id"] = object_id; body["item-id"] = src->getUUID(); - body["folder-id"] = gInventory.findCategoryUUIDForType(LLFolderType::assetTypeToFolderType(src->getType())); + body["folder-id"] = destination_id; body["callback-id"] = (LLSD::Integer)callback_id; request["message"] = "CopyInventoryFromNotecard"; diff --git a/indra/newview/llviewerinventory.h b/indra/newview/llviewerinventory.h index 41542a4e0f..7822ef4da6 100644 --- a/indra/newview/llviewerinventory.h +++ b/indra/newview/llviewerinventory.h @@ -363,7 +363,10 @@ void move_inventory_item( const std::string& new_name, LLPointer<LLInventoryCallback> cb); -void copy_inventory_from_notecard(const LLUUID& object_id, +const LLUUID get_folder_by_itemtype(const LLInventoryItem *src); + +void copy_inventory_from_notecard(const LLUUID& destination_id, + const LLUUID& object_id, const LLUUID& notecard_inv_id, const LLInventoryItem *src, U32 callback_id = 0); diff --git a/indra/newview/llviewerjoint.cpp b/indra/newview/llviewerjoint.cpp index baf85d6884..a907f102f8 100644 --- a/indra/newview/llviewerjoint.cpp +++ b/indra/newview/llviewerjoint.cpp @@ -126,7 +126,7 @@ void LLViewerJoint::setValid( BOOL valid, BOOL recursive ) // //---------------------------------------------------------------- // // push matrix stack // //---------------------------------------------------------------- -// glPushMatrix(); +// gGL.pushMatrix(); // //---------------------------------------------------------------- // // render the bone to my parent @@ -140,8 +140,8 @@ void LLViewerJoint::setValid( BOOL valid, BOOL recursive ) // // offset to joint position and // // rotate to our orientation // //---------------------------------------------------------------- -// glLoadIdentity(); -// glMultMatrixf( &getWorldMatrix().mMatrix[0][0] ); +// gGL.loadIdentity(); +// gGL.multMatrix( &getWorldMatrix().mMatrix[0][0] ); // //---------------------------------------------------------------- // // render joint axes @@ -233,7 +233,7 @@ void LLViewerJoint::setValid( BOOL valid, BOOL recursive ) // //---------------------------------------------------------------- // // pop matrix stack // //---------------------------------------------------------------- -// glPopMatrix(); +// gGL.popMatrix(); // } @@ -346,7 +346,7 @@ U32 LLViewerJoint::render( F32 pixelArea, BOOL first_pass, BOOL is_dummy ) // F32 boneSize = 0.02f; // // rotate to point to child (bone direction) -// glPushMatrix(); +// gGL.pushMatrix(); // LLVector3 boneX = getPosition(); // F32 length = boneX.normVec(); @@ -362,7 +362,7 @@ U32 LLViewerJoint::render( F32 pixelArea, BOOL first_pass, BOOL is_dummy ) // rotateMat.setFwdRow( boneX ); // rotateMat.setLeftRow( boneY ); // rotateMat.setUpRow( boneZ ); -// glMultMatrixf( &rotateMat.mMatrix[0][0] ); +// gGL.multMatrix( &rotateMat.mMatrix[0][0] ); // // render the bone // gGL.color3f( 0.5f, 0.5f, 0.0f ); @@ -388,7 +388,7 @@ U32 LLViewerJoint::render( F32 pixelArea, BOOL first_pass, BOOL is_dummy ) // gGL.end(); // // restore matrix -// glPopMatrix(); +// gGL.popMatrix(); // } //-------------------------------------------------------------------- @@ -541,9 +541,9 @@ void LLViewerJointCollisionVolume::renderCollision() updateWorldMatrix(); gGL.pushMatrix(); - glMultMatrixf( &mXform.getWorldMatrix().mMatrix[0][0] ); + gGL.multMatrix( &mXform.getWorldMatrix().mMatrix[0][0] ); - gGL.color3f( 0.f, 0.f, 1.f ); + gGL.diffuseColor3f( 0.f, 0.f, 1.f ); gGL.begin(LLRender::LINES); diff --git a/indra/newview/llviewerjointmesh.cpp b/indra/newview/llviewerjointmesh.cpp index 77c8bb0329..76f4e18c27 100644 --- a/indra/newview/llviewerjointmesh.cpp +++ b/indra/newview/llviewerjointmesh.cpp @@ -459,7 +459,10 @@ void LLViewerJointMesh::uploadJointMatrices() } } stop_glerror(); - glUniform4fvARB(gAvatarMatrixParam, 45, mat); + if (LLGLSLShader::sCurBoundShaderPtr) + { + LLGLSLShader::sCurBoundShaderPtr->uniform4fv(LLViewerShaderMgr::AVATAR_MATRIX, 45, mat); + } stop_glerror(); } else @@ -512,7 +515,8 @@ U32 LLViewerJointMesh::drawShape( F32 pixelArea, BOOL first_pass, BOOL is_dummy) { if (!mValid || !mMesh || !mFace || !mVisible || !mFace->getVertexBuffer() || - mMesh->getNumFaces() == 0) + mMesh->getNumFaces() == 0 || + (LLGLSLShader::sNoFixedFunction && LLGLSLShader::sCurBoundShaderPtr == NULL)) { return 0; } @@ -527,13 +531,13 @@ U32 LLViewerJointMesh::drawShape( F32 pixelArea, BOOL first_pass, BOOL is_dummy) // setup current color //---------------------------------------------------------------- if (is_dummy) - glColor4fv(LLVOAvatar::getDummyColor().mV); + gGL.diffuseColor4fv(LLVOAvatar::getDummyColor().mV); else - glColor4fv(mColor.mV); + gGL.diffuseColor4fv(mColor.mV); stop_glerror(); - LLGLSSpecular specular(LLColor4(1.f,1.f,1.f,1.f), mFace->getPool()->getVertexShaderLevel() > 0 ? 0.f : mShiny); + LLGLSSpecular specular(LLColor4(1.f,1.f,1.f,1.f), (mFace->getPool()->getVertexShaderLevel() > 0 || LLGLSLShader::sNoFixedFunction) ? 0.f : mShiny); //---------------------------------------------------------------- // setup current texture @@ -547,11 +551,11 @@ U32 LLViewerJointMesh::drawShape( F32 pixelArea, BOOL first_pass, BOOL is_dummy) if (mIsTransparent) { - glColor4f(1.f, 1.f, 1.f, 1.f); + gGL.diffuseColor4f(1.f, 1.f, 1.f, 1.f); } else { - glColor4f(0.7f, 0.6f, 0.3f, 1.f); + gGL.diffuseColor4f(0.7f, 0.6f, 0.3f, 1.f); gGL.getTexUnit(diffuse_channel)->setTextureColorBlend(LLTexUnit::TBO_LERP_TEX_ALPHA, LLTexUnit::TBS_TEX_COLOR, LLTexUnit::TBS_PREV_COLOR); } } @@ -582,13 +586,16 @@ U32 LLViewerJointMesh::drawShape( F32 pixelArea, BOOL first_pass, BOOL is_dummy) gGL.getTexUnit(diffuse_channel)->bind(LLViewerTextureManager::getFetchedTexture(IMG_DEFAULT)); } - mFace->getVertexBuffer()->setBuffer(sRenderMask); + + U32 mask = sRenderMask; U32 start = mMesh->mFaceVertexOffset; U32 end = start + mMesh->mFaceVertexCount - 1; U32 count = mMesh->mFaceIndexCount; U32 offset = mMesh->mFaceIndexOffset; + LLVertexBuffer* buff = mFace->getVertexBuffer(); + if (mMesh->hasWeights()) { if ((mFace->getPool()->getVertexShaderLevel() > 0)) @@ -597,17 +604,24 @@ U32 LLViewerJointMesh::drawShape( F32 pixelArea, BOOL first_pass, BOOL is_dummy) { uploadJointMatrices(); } + mask = mask | LLVertexBuffer::MAP_WEIGHT; + if (mFace->getPool()->getVertexShaderLevel() > 1) + { + mask = mask | LLVertexBuffer::MAP_CLOTHWEIGHT; + } } - mFace->getVertexBuffer()->drawRange(LLRender::TRIANGLES, start, end, count, offset); + buff->setBuffer(mask); + buff->drawRange(LLRender::TRIANGLES, start, end, count, offset); } else { - glPushMatrix(); + gGL.pushMatrix(); LLMatrix4 jointToWorld = getWorldMatrix(); - glMultMatrixf((GLfloat*)jointToWorld.mMatrix); - mFace->getVertexBuffer()->drawRange(LLRender::TRIANGLES, start, end, count, offset); - glPopMatrix(); + gGL.multMatrix((GLfloat*)jointToWorld.mMatrix); + buff->setBuffer(mask); + buff->drawRange(LLRender::TRIANGLES, start, end, count, offset); + gGL.popMatrix(); } gPipeline.addTrianglesDrawn(count); @@ -692,9 +706,9 @@ void LLViewerJointMesh::updateFaceData(LLFace *face, F32 pixel_area, BOOL damp_w if (num_verts) { - face->getGeometryAvatar(verticesp, normalsp, tex_coordsp, vertex_weightsp, clothing_weightsp); face->getVertexBuffer()->getIndexStrider(indicesp); - + face->getGeometryAvatar(verticesp, normalsp, tex_coordsp, vertex_weightsp, clothing_weightsp); + verticesp += mMesh->mFaceVertexOffset; normalsp += mMesh->mFaceVertexOffset; @@ -752,7 +766,7 @@ BOOL LLViewerJointMesh::updateLOD(F32 pixel_area, BOOL activate) } // static -void LLViewerJointMesh::updateGeometryOriginal(LLFace *mFace, LLPolyMesh *mMesh) +void LLViewerJointMesh::updateGeometry(LLFace *mFace, LLPolyMesh *mMesh) { LLStrider<LLVector3> o_vertices; LLStrider<LLVector3> o_normals; @@ -803,64 +817,7 @@ void LLViewerJointMesh::updateGeometryOriginal(LLFace *mFace, LLPolyMesh *mMesh) } } - buffer->setBuffer(0); -} - -const U32 UPDATE_GEOMETRY_CALL_MASK = 0x1FFF; // 8K samples before overflow -const U32 UPDATE_GEOMETRY_CALL_OVERFLOW = ~UPDATE_GEOMETRY_CALL_MASK; -static bool sUpdateGeometryCallPointer = false; -static F64 sUpdateGeometryGlobalTime = 0.0 ; -static F64 sUpdateGeometryElapsedTime = 0.0 ; -static F64 sUpdateGeometryElapsedTimeOff = 0.0 ; -static F64 sUpdateGeometryElapsedTimeOn = 0.0 ; -static F64 sUpdateGeometryRunAvgOff[10]; -static F64 sUpdateGeometryRunAvgOn[10]; -static U32 sUpdateGeometryRunCount = 0 ; -static U32 sUpdateGeometryCalls = 0 ; -static U32 sUpdateGeometryLastProcessor = 0 ; -static BOOL sVectorizePerfTest = FALSE; -static U32 sVectorizeProcessor = 0; - -//static -void (*LLViewerJointMesh::sUpdateGeometryFunc)(LLFace* face, LLPolyMesh* mesh); - -//static -void LLViewerJointMesh::updateVectorize() -{ - sVectorizePerfTest = gSavedSettings.getBOOL("VectorizePerfTest"); - sVectorizeProcessor = gSavedSettings.getU32("VectorizeProcessor"); - BOOL vectorizeEnable = gSavedSettings.getBOOL("VectorizeEnable"); - BOOL vectorizeSkin = gSavedSettings.getBOOL("VectorizeSkin"); - - std::string vp; - switch(sVectorizeProcessor) - { - case 2: vp = "SSE2"; break; // *TODO: replace the magic #s - case 1: vp = "SSE"; break; - default: vp = "COMPILER DEFAULT"; break; - } - LL_INFOS("AppInit") << "Vectorization : " << ( vectorizeEnable ? "ENABLED" : "DISABLED" ) << LL_ENDL ; - LL_INFOS("AppInit") << "Vector Processor : " << vp << LL_ENDL ; - LL_INFOS("AppInit") << "Vectorized Skinning : " << ( vectorizeSkin ? "ENABLED" : "DISABLED" ) << LL_ENDL ; - if(vectorizeEnable && vectorizeSkin) - { - switch(sVectorizeProcessor) - { - case 2: - sUpdateGeometryFunc = &updateGeometrySSE2; - break; - case 1: - sUpdateGeometryFunc = &updateGeometrySSE; - break; - default: - sUpdateGeometryFunc = &updateGeometryVectorized; - break; - } - } - else - { - sUpdateGeometryFunc = &updateGeometryOriginal; - } + buffer->flush(); } void LLViewerJointMesh::updateJointGeometry() @@ -875,129 +832,8 @@ void LLViewerJointMesh::updateJointGeometry() return; } - if (!sVectorizePerfTest) - { - // Once we've measured performance, just run the specified - // code version. - if(sUpdateGeometryFunc == updateGeometryOriginal) - uploadJointMatrices(); - sUpdateGeometryFunc(mFace, mMesh); - } - else - { - // At startup, measure the amount of time in skinning and choose - // the fastest one. - LLTimer ug_timer ; - - if (sUpdateGeometryCallPointer) - { - if(sUpdateGeometryFunc == updateGeometryOriginal) - uploadJointMatrices(); - // call accelerated version for this processor - sUpdateGeometryFunc(mFace, mMesh); - } - else - { - uploadJointMatrices(); - updateGeometryOriginal(mFace, mMesh); - } - - sUpdateGeometryElapsedTime += ug_timer.getElapsedTimeF64(); - ++sUpdateGeometryCalls; - if(0 != (sUpdateGeometryCalls & UPDATE_GEOMETRY_CALL_OVERFLOW)) - { - F64 time_since_app_start = ug_timer.getElapsedSeconds(); - if(sUpdateGeometryGlobalTime == 0.0 - || sUpdateGeometryLastProcessor != sVectorizeProcessor) - { - sUpdateGeometryGlobalTime = time_since_app_start; - sUpdateGeometryElapsedTime = 0; - sUpdateGeometryCalls = 0; - sUpdateGeometryRunCount = 0; - sUpdateGeometryLastProcessor = sVectorizeProcessor; - sUpdateGeometryCallPointer = false; - return; - } - F64 percent_time_in_function = - ( sUpdateGeometryElapsedTime * 100.0 ) / ( time_since_app_start - sUpdateGeometryGlobalTime ) ; - sUpdateGeometryGlobalTime = time_since_app_start; - if (!sUpdateGeometryCallPointer) - { - // First set of run data is with vectorization off. - sUpdateGeometryCallPointer = true; - llinfos << "profile (avg of " << sUpdateGeometryCalls << " samples) = " - << "vectorize off " << percent_time_in_function - << "% of time with " - << (sUpdateGeometryElapsedTime / (F64)sUpdateGeometryCalls) - << " seconds per call " - << llendl; - sUpdateGeometryRunAvgOff[sUpdateGeometryRunCount] = percent_time_in_function; - sUpdateGeometryElapsedTimeOff += sUpdateGeometryElapsedTime; - sUpdateGeometryCalls = 0; - } - else - { - // Second set of run data is with vectorization on. - sUpdateGeometryCallPointer = false; - llinfos << "profile (avg of " << sUpdateGeometryCalls << " samples) = " - << "VEC on " << percent_time_in_function - << "% of time with " - << (sUpdateGeometryElapsedTime / (F64)sUpdateGeometryCalls) - << " seconds per call " - << llendl; - sUpdateGeometryRunAvgOn[sUpdateGeometryRunCount] = percent_time_in_function ; - sUpdateGeometryElapsedTimeOn += sUpdateGeometryElapsedTime; - - sUpdateGeometryCalls = 0; - sUpdateGeometryRunCount++; - F64 a = 0.0, b = 0.0; - for(U32 i = 0; i<sUpdateGeometryRunCount; i++) - { - a += sUpdateGeometryRunAvgOff[i]; - b += sUpdateGeometryRunAvgOn[i]; - } - a /= sUpdateGeometryRunCount; - b /= sUpdateGeometryRunCount; - F64 perf_boost = ( sUpdateGeometryElapsedTimeOff - sUpdateGeometryElapsedTimeOn ) / sUpdateGeometryElapsedTimeOn; - llinfos << "run averages (" << (F64)sUpdateGeometryRunCount - << "/10) vectorize off " << a - << "% : vectorize type " << sVectorizeProcessor - << " " << b - << "% : performance boost " - << perf_boost * 100.0 - << "%" - << llendl ; - if(sUpdateGeometryRunCount == 10) - { - // In case user runs test again, force reset of data on - // next run. - sUpdateGeometryGlobalTime = 0.0; - - // We have data now on which version is faster. Switch to that - // code and save the data for next run. - gSavedSettings.setBOOL("VectorizePerfTest", FALSE); - - if (perf_boost > 0.0) - { - llinfos << "Vectorization improves avatar skinning performance, " - << "keeping on for future runs." - << llendl; - gSavedSettings.setBOOL("VectorizeSkin", TRUE); - } - else - { - // SIMD decreases performance, fall back to original code - llinfos << "Vectorization decreases avatar skinning performance, " - << "switching back to original code." - << llendl; - - gSavedSettings.setBOOL("VectorizeSkin", FALSE); - } - } - } - sUpdateGeometryElapsedTime = 0.0f; - } - } + uploadJointMatrices(); + updateGeometry(mFace, mMesh); } void LLViewerJointMesh::dump() diff --git a/indra/newview/llviewerjointmesh.h b/indra/newview/llviewerjointmesh.h index cab1205d61..0191f0cae8 100644 --- a/indra/newview/llviewerjointmesh.h +++ b/indra/newview/llviewerjointmesh.h @@ -143,23 +143,10 @@ public: /*virtual*/ BOOL isAnimatable() const { return FALSE; } - static void updateVectorize(); // Update globals when settings variables change - private: - // Avatar vertex skinning is a significant performance issue on computers - // with avatar vertex programs turned off (for example, most Macs). We - // therefore have custom versions that use SIMD instructions. - // - // These functions require compiler options for SSE2, SSE, or neither, and - // hence are contained in separate individual .cpp files. JC - static void updateGeometryOriginal(LLFace* face, LLPolyMesh* mesh); - // generic vector code, used for Altivec - static void updateGeometryVectorized(LLFace* face, LLPolyMesh* mesh); - static void updateGeometrySSE(LLFace* face, LLPolyMesh* mesh); - static void updateGeometrySSE2(LLFace* face, LLPolyMesh* mesh); - - // Use a fuction pointer to indicate which version we are running. - static void (*sUpdateGeometryFunc)(LLFace* face, LLPolyMesh* mesh); + + //copy mesh into given face's vertex buffer, applying current animation pose + static void updateGeometry(LLFace* face, LLPolyMesh* mesh); private: // Allocate skin data diff --git a/indra/newview/llviewerjointmesh_sse.cpp b/indra/newview/llviewerjointmesh_sse.cpp deleted file mode 100644 index 400b49d046..0000000000 --- a/indra/newview/llviewerjointmesh_sse.cpp +++ /dev/null @@ -1,114 +0,0 @@ -/** - * @file llviewerjointmesh_sse.cpp - * @brief SSE vectorized joint skinning code, only used when video card does - * not support avatar vertex programs. - * - * *NOTE: Disabled on Windows builds. See llv4math.h for details. - * - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2010, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -//----------------------------------------------------------------------------- -// Header Files -//----------------------------------------------------------------------------- - -#include "llviewerprecompiledheaders.h" - -#include "llviewerjointmesh.h" - -// project includes -#include "llface.h" -#include "llpolymesh.h" - -// library includes -#include "lldarray.h" -#include "llv4math.h" // for LL_VECTORIZE -#include "llv4matrix3.h" -#include "llv4matrix4.h" -#include "v3math.h" - - -#if LL_VECTORIZE - -inline void matrix_translate(LLV4Matrix4& m, const LLMatrix4* w, const LLVector3& j) -{ - m.mV[VX] = _mm_loadu_ps(w->mMatrix[VX]); - m.mV[VY] = _mm_loadu_ps(w->mMatrix[VY]); - m.mV[VZ] = _mm_loadu_ps(w->mMatrix[VZ]); - m.mV[VW] = _mm_loadu_ps(w->mMatrix[VW]); - m.mV[VW] = _mm_add_ps(m.mV[VW], _mm_mul_ps(_mm_set1_ps(j.mV[VX]), m.mV[VX])); // ( ax * vx ) + vw - m.mV[VW] = _mm_add_ps(m.mV[VW], _mm_mul_ps(_mm_set1_ps(j.mV[VY]), m.mV[VY])); - m.mV[VW] = _mm_add_ps(m.mV[VW], _mm_mul_ps(_mm_set1_ps(j.mV[VZ]), m.mV[VZ])); -} - -// static -void LLViewerJointMesh::updateGeometrySSE(LLFace *face, LLPolyMesh *mesh) -{ - // This cannot be a file-level static because it will be initialized - // before main() using SSE code, which will crash on non-SSE processors. - static LLV4Matrix4 sJointMat[32]; - LLDynamicArray<LLJointRenderData*>& joint_data = mesh->getReferenceMesh()->mJointRenderData; - - //upload joint pivots/matrices - for(S32 j = 0, jend = joint_data.count(); j < jend ; ++j ) - { - matrix_translate(sJointMat[j], joint_data[j]->mWorldMatrix, - joint_data[j]->mSkinJoint ? - joint_data[j]->mSkinJoint->mRootToJointSkinOffset - : joint_data[j+1]->mSkinJoint->mRootToParentJointSkinOffset); - } - - F32 weight = F32_MAX; - LLV4Matrix4 blend_mat; - - LLStrider<LLVector3> o_vertices; - LLStrider<LLVector3> o_normals; - - LLVertexBuffer *buffer = face->getVertexBuffer(); - buffer->getVertexStrider(o_vertices, mesh->mFaceVertexOffset); - buffer->getNormalStrider(o_normals, mesh->mFaceVertexOffset); - - const F32* weights = mesh->getWeights(); - const LLVector3* coords = (const LLVector3*)mesh->getCoords(); - const LLVector3* normals = (const LLVector3*)mesh->getNormals(); - for (U32 index = 0, index_end = mesh->getNumVertices(); index < index_end; ++index) - { - if( weight != weights[index]) - { - S32 joint = llfloor(weight = weights[index]); - blend_mat.lerp(sJointMat[joint], sJointMat[joint+1], weight - joint); - } - blend_mat.multiply(coords[index], o_vertices[index]); - ((LLV4Matrix3)blend_mat).multiply(normals[index], o_normals[index]); - } - - buffer->setBuffer(0); -} - -#else - -void LLViewerJointMesh::updateGeometrySSE(LLFace *face, LLPolyMesh *mesh) -{ - LLViewerJointMesh::updateGeometryVectorized(face, mesh); -} - -#endif diff --git a/indra/newview/llviewerjointmesh_sse2.cpp b/indra/newview/llviewerjointmesh_sse2.cpp deleted file mode 100644 index c2296dd569..0000000000 --- a/indra/newview/llviewerjointmesh_sse2.cpp +++ /dev/null @@ -1,121 +0,0 @@ -/** - * @file llviewerjointmesh_sse2.cpp - * @brief SSE vectorized joint skinning code, only used when video card does - * not support avatar vertex programs. - * - * *NOTE: Disabled on Windows builds. See llv4math.h for details. - * - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2010, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -// Visual Studio required settings for this file: -// Precompiled Headers OFF -// Code Generation: SSE2 - -//----------------------------------------------------------------------------- -// Header Files -//----------------------------------------------------------------------------- - -#include "llviewerprecompiledheaders.h" - -#include "llviewerjointmesh.h" - -// project includes -#include "llface.h" -#include "llpolymesh.h" - -// library includes -#include "lldarray.h" -#include "llstrider.h" -#include "llv4math.h" // for LL_VECTORIZE -#include "llv4matrix3.h" -#include "llv4matrix4.h" -#include "m4math.h" -#include "v3math.h" - - -#if LL_VECTORIZE - - -inline void matrix_translate(LLV4Matrix4& m, const LLMatrix4* w, const LLVector3& j) -{ - m.mV[VX] = _mm_loadu_ps(w->mMatrix[VX]); - m.mV[VY] = _mm_loadu_ps(w->mMatrix[VY]); - m.mV[VZ] = _mm_loadu_ps(w->mMatrix[VZ]); - m.mV[VW] = _mm_loadu_ps(w->mMatrix[VW]); - m.mV[VW] = _mm_add_ps(m.mV[VW], _mm_mul_ps(_mm_set1_ps(j.mV[VX]), m.mV[VX])); // ( ax * vx ) + vw - m.mV[VW] = _mm_add_ps(m.mV[VW], _mm_mul_ps(_mm_set1_ps(j.mV[VY]), m.mV[VY])); - m.mV[VW] = _mm_add_ps(m.mV[VW], _mm_mul_ps(_mm_set1_ps(j.mV[VZ]), m.mV[VZ])); -} - -// static -void LLViewerJointMesh::updateGeometrySSE2(LLFace *face, LLPolyMesh *mesh) -{ - // This cannot be a file-level static because it will be initialized - // before main() using SSE code, which will crash on non-SSE processors. - static LLV4Matrix4 sJointMat[32]; - LLDynamicArray<LLJointRenderData*>& joint_data = mesh->getReferenceMesh()->mJointRenderData; - - //upload joint pivots/matrices - for(S32 j = 0, jend = joint_data.count(); j < jend ; ++j ) - { - matrix_translate(sJointMat[j], joint_data[j]->mWorldMatrix, - joint_data[j]->mSkinJoint ? - joint_data[j]->mSkinJoint->mRootToJointSkinOffset - : joint_data[j+1]->mSkinJoint->mRootToParentJointSkinOffset); - } - - F32 weight = F32_MAX; - LLV4Matrix4 blend_mat; - - LLStrider<LLVector3> o_vertices; - LLStrider<LLVector3> o_normals; - - LLVertexBuffer *buffer = face->getVertexBuffer(); - buffer->getVertexStrider(o_vertices, mesh->mFaceVertexOffset); - buffer->getNormalStrider(o_normals, mesh->mFaceVertexOffset); - - const F32* weights = mesh->getWeights(); - const LLVector3* coords = (const LLVector3*)mesh->getCoords(); - const LLVector3* normals = (const LLVector3*)mesh->getNormals(); - for (U32 index = 0, index_end = mesh->getNumVertices(); index < index_end; ++index) - { - if( weight != weights[index]) - { - S32 joint = llfloor(weight = weights[index]); - blend_mat.lerp(sJointMat[joint], sJointMat[joint+1], weight - joint); - } - blend_mat.multiply(coords[index], o_vertices[index]); - ((LLV4Matrix3)blend_mat).multiply(normals[index], o_normals[index]); - } - - //setBuffer(0) called in LLVOAvatar::renderSkinned -} - -#else - -void LLViewerJointMesh::updateGeometrySSE2(LLFace *face, LLPolyMesh *mesh) -{ - LLViewerJointMesh::updateGeometryVectorized(face, mesh); -} - -#endif diff --git a/indra/newview/llviewerjointmesh_vec.cpp b/indra/newview/llviewerjointmesh_vec.cpp deleted file mode 100644 index 6600d01d17..0000000000 --- a/indra/newview/llviewerjointmesh_vec.cpp +++ /dev/null @@ -1,97 +0,0 @@ -/** - * @file llviewerjointmesh_vec.cpp - * @brief Compiler-generated vectorized joint skinning code, works well on - * Altivec processors (PowerPC Mac) - * - * *NOTE: See llv4math.h for notes on SSE/Altivec vector code. - * - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2010, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -//----------------------------------------------------------------------------- -// Header Files -//----------------------------------------------------------------------------- -#include "llviewerprecompiledheaders.h" - -#include "llviewerjointmesh.h" - -#include "llface.h" -#include "llpolymesh.h" -#include "llv4math.h" -#include "llv4matrix3.h" -#include "llv4matrix4.h" - -// Generic vectorized code, uses compiler defaults, works well for Altivec -// on PowerPC. - -// static -void LLViewerJointMesh::updateGeometryVectorized(LLFace *face, LLPolyMesh *mesh) -{ -#if 0 - static LLV4Matrix4 sJointMat[32]; - LLDynamicArray<LLJointRenderData*>& joint_data = mesh->getReferenceMesh()->mJointRenderData; - S32 j, joint_num, joint_end = joint_data.count(); - LLV4Vector3 pivot; - - //upload joint pivots/matrices - for(j = joint_num = 0; joint_num < joint_end ; ++joint_num ) - { - LLSkinJoint *sj; - const LLMatrix4 * wm = joint_data[joint_num]->mWorldMatrix; - if (NULL == (sj = joint_data[joint_num]->mSkinJoint)) - { - sj = joint_data[++joint_num]->mSkinJoint; - ((LLV4Matrix3)(sJointMat[j] = *wm)).multiply(sj->mRootToParentJointSkinOffset, pivot); - sJointMat[j++].translate(pivot); - wm = joint_data[joint_num]->mWorldMatrix; - } - ((LLV4Matrix3)(sJointMat[j] = *wm)).multiply(sj->mRootToJointSkinOffset, pivot); - sJointMat[j++].translate(pivot); - } - - F32 weight = F32_MAX; - LLV4Matrix4 blend_mat; - - LLStrider<LLVector3> o_vertices; - LLStrider<LLVector3> o_normals; - - LLVertexBuffer *buffer = face->mVertexBuffer; - buffer->getVertexStrider(o_vertices, mesh->mFaceVertexOffset); - buffer->getNormalStrider(o_normals, mesh->mFaceVertexOffset); - - const F32* weights = mesh->getWeights(); - const LLVector3* coords = mesh->getCoords(); - const LLVector3* normals = mesh->getNormals(); - for (U32 index = 0, index_end = mesh->getNumVertices(); index < index_end; ++index) - { - if( weight != weights[index]) - { - S32 joint = llfloor(weight = weights[index]); - blend_mat.lerp(sJointMat[joint], sJointMat[joint+1], weight - joint); - } - blend_mat.multiply(coords[index], o_vertices[index]); - ((LLV4Matrix3)blend_mat).multiply(normals[index], o_normals[index]); - } - - buffer->setBuffer(0); -#endif -} diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index 41b4dc01e8..42dabdec0d 100644 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -50,6 +50,7 @@ #include "llvoavatar.h" #include "llvoavatarself.h" #include "llviewerregion.h" +#include "llwebprofile.h" #include "llwebsharing.h" // For LLWebSharing::setOpenIDCookie(), *TODO: find a better way to do this! #include "llfilepicker.h" #include "llnotifications.h" @@ -66,9 +67,8 @@ //#include "llfirstuse.h" #include "llviewernetwork.h" #include "llwindow.h" +#include "llvieweraudio.h" - -#include "llfloatermediabrowser.h" // for handling window close requests and geometry change requests in media browser windows. #include "llfloaterwebcontent.h" // for handling window close requests and geometry change requests in media browser windows. #include <boost/bind.hpp> // for SkinFolder listener @@ -319,6 +319,10 @@ public: std::string cookie = content["set-cookie"].asString(); LLViewerMedia::getCookieStore()->setCookiesFromHost(cookie, mHost); + + // Set cookie for snapshot publishing. + std::string auth_cookie = cookie.substr(0, cookie.find(";")); // strip path + LLWebProfile::setAuthCookie(auth_cookie); } void completedRaw( @@ -782,6 +786,12 @@ static bool proximity_comparitor(const LLViewerMediaImpl* i1, const LLViewerMedi } static LLFastTimer::DeclareTimer FTM_MEDIA_UPDATE("Update Media"); +static LLFastTimer::DeclareTimer FTM_MEDIA_SPARE_IDLE("Spare Idle"); +static LLFastTimer::DeclareTimer FTM_MEDIA_UPDATE_INTEREST("Update/Interest"); +static LLFastTimer::DeclareTimer FTM_MEDIA_SORT("Sort"); +static LLFastTimer::DeclareTimer FTM_MEDIA_SORT2("Sort 2"); +static LLFastTimer::DeclareTimer FTM_MEDIA_MISC("Misc"); + ////////////////////////////////////////////////////////////////////////////////////////// // static @@ -806,21 +816,28 @@ void LLViewerMedia::updateMedia(void *dummy_arg) impl_list::iterator iter = sViewerMediaImplList.begin(); impl_list::iterator end = sViewerMediaImplList.end(); - for(; iter != end;) { - LLViewerMediaImpl* pimpl = *iter++; - pimpl->update(); - pimpl->calculateInterest(); + LLFastTimer t(FTM_MEDIA_UPDATE_INTEREST); + for(; iter != end;) + { + LLViewerMediaImpl* pimpl = *iter++; + pimpl->update(); + pimpl->calculateInterest(); + } } // Let the spare media source actually launch if(sSpareBrowserMediaSource) { + LLFastTimer t(FTM_MEDIA_SPARE_IDLE); sSpareBrowserMediaSource->idle(); } - // Sort the static instance list using our interest criteria - sViewerMediaImplList.sort(priorityComparitor); + { + LLFastTimer t(FTM_MEDIA_SORT); + // Sort the static instance list using our interest criteria + sViewerMediaImplList.sort(priorityComparitor); + } // Go through the list again and adjust according to priority. iter = sViewerMediaImplList.begin(); @@ -848,147 +865,150 @@ void LLViewerMedia::updateMedia(void *dummy_arg) // max_instances must be set high enough to allow the various instances used in the UI (for the help browser, search, etc.) to be loaded. // If max_normal + max_low is less than max_instances, things will tend to get unloaded instead of being set to slideshow. - for(; iter != end; iter++) { - LLViewerMediaImpl* pimpl = *iter; + LLFastTimer t(FTM_MEDIA_MISC); + for(; iter != end; iter++) + { + LLViewerMediaImpl* pimpl = *iter; - LLPluginClassMedia::EPriority new_priority = LLPluginClassMedia::PRIORITY_NORMAL; + LLPluginClassMedia::EPriority new_priority = LLPluginClassMedia::PRIORITY_NORMAL; - if(pimpl->isForcedUnloaded() || (impl_count_total >= (int)max_instances)) - { - // Never load muted or failed impls. - // Hard limit on the number of instances that will be loaded at one time - new_priority = LLPluginClassMedia::PRIORITY_UNLOADED; - } - else if(!pimpl->getVisible()) - { - new_priority = LLPluginClassMedia::PRIORITY_HIDDEN; - } - else if(pimpl->hasFocus()) - { - new_priority = LLPluginClassMedia::PRIORITY_HIGH; - impl_count_interest_normal++; // count this against the count of "normal" instances for priority purposes - } - else if(pimpl->getUsedInUI()) - { - new_priority = LLPluginClassMedia::PRIORITY_NORMAL; - impl_count_interest_normal++; - } - else if(pimpl->isParcelMedia()) - { - new_priority = LLPluginClassMedia::PRIORITY_NORMAL; - impl_count_interest_normal++; - } - else - { - // Look at interest and CPU usage for instances that aren't in any of the above states. - - // Heuristic -- if the media texture's approximate screen area is less than 1/4 of the native area of the texture, - // turn it down to low instead of normal. This may downsample for plugins that support it. - bool media_is_small = false; - F64 approximate_interest = pimpl->getApproximateTextureInterest(); - if(approximate_interest == 0.0f) + if(pimpl->isForcedUnloaded() || (impl_count_total >= (int)max_instances)) { - // this media has no current size, which probably means it's not loaded. - media_is_small = true; + // Never load muted or failed impls. + // Hard limit on the number of instances that will be loaded at one time + new_priority = LLPluginClassMedia::PRIORITY_UNLOADED; } - else if(pimpl->getInterest() < (approximate_interest / 4)) + else if(!pimpl->getVisible()) { - media_is_small = true; + new_priority = LLPluginClassMedia::PRIORITY_HIDDEN; } - - if(pimpl->getInterest() == 0.0f) + else if(pimpl->hasFocus()) { - // This media is completely invisible, due to being outside the view frustrum or out of range. - new_priority = LLPluginClassMedia::PRIORITY_HIDDEN; + new_priority = LLPluginClassMedia::PRIORITY_HIGH; + impl_count_interest_normal++; // count this against the count of "normal" instances for priority purposes } - else if(check_cpu_usage && (total_cpu > max_cpu)) + else if(pimpl->getUsedInUI()) { - // Higher priority plugins have already used up the CPU budget. Set remaining ones to slideshow priority. - new_priority = LLPluginClassMedia::PRIORITY_SLIDESHOW; + new_priority = LLPluginClassMedia::PRIORITY_NORMAL; + impl_count_interest_normal++; } - else if((impl_count_interest_normal < (int)max_normal) && !media_is_small) + else if(pimpl->isParcelMedia()) { - // Up to max_normal inworld get normal priority new_priority = LLPluginClassMedia::PRIORITY_NORMAL; impl_count_interest_normal++; } - else if (impl_count_interest_low + impl_count_interest_normal < (int)max_low + (int)max_normal) + else { - // The next max_low inworld get turned down - new_priority = LLPluginClassMedia::PRIORITY_LOW; - impl_count_interest_low++; - - // Set the low priority size for downsampling to approximately the size the texture is displayed at. + // Look at interest and CPU usage for instances that aren't in any of the above states. + + // Heuristic -- if the media texture's approximate screen area is less than 1/4 of the native area of the texture, + // turn it down to low instead of normal. This may downsample for plugins that support it. + bool media_is_small = false; + F64 approximate_interest = pimpl->getApproximateTextureInterest(); + if(approximate_interest == 0.0f) + { + // this media has no current size, which probably means it's not loaded. + media_is_small = true; + } + else if(pimpl->getInterest() < (approximate_interest / 4)) + { + media_is_small = true; + } + + if(pimpl->getInterest() == 0.0f) { - F32 approximate_interest_dimension = (F32) sqrt(pimpl->getInterest()); + // This media is completely invisible, due to being outside the view frustrum or out of range. + new_priority = LLPluginClassMedia::PRIORITY_HIDDEN; + } + else if(check_cpu_usage && (total_cpu > max_cpu)) + { + // Higher priority plugins have already used up the CPU budget. Set remaining ones to slideshow priority. + new_priority = LLPluginClassMedia::PRIORITY_SLIDESHOW; + } + else if((impl_count_interest_normal < (int)max_normal) && !media_is_small) + { + // Up to max_normal inworld get normal priority + new_priority = LLPluginClassMedia::PRIORITY_NORMAL; + impl_count_interest_normal++; + } + else if (impl_count_interest_low + impl_count_interest_normal < (int)max_low + (int)max_normal) + { + // The next max_low inworld get turned down + new_priority = LLPluginClassMedia::PRIORITY_LOW; + impl_count_interest_low++; + + // Set the low priority size for downsampling to approximately the size the texture is displayed at. + { + F32 approximate_interest_dimension = (F32) sqrt(pimpl->getInterest()); - pimpl->setLowPrioritySizeLimit(llround(approximate_interest_dimension)); + pimpl->setLowPrioritySizeLimit(llround(approximate_interest_dimension)); + } + } + else + { + // Any additional impls (up to max_instances) get very infrequent time + new_priority = LLPluginClassMedia::PRIORITY_SLIDESHOW; } } - else - { - // Any additional impls (up to max_instances) get very infrequent time - new_priority = LLPluginClassMedia::PRIORITY_SLIDESHOW; - } - } - if(!pimpl->getUsedInUI() && (new_priority != LLPluginClassMedia::PRIORITY_UNLOADED)) - { - // This is a loadable inworld impl -- the last one in the list in this class defines the lowest loadable interest. - lowest_interest_loadable = pimpl; + if(!pimpl->getUsedInUI() && (new_priority != LLPluginClassMedia::PRIORITY_UNLOADED)) + { + // This is a loadable inworld impl -- the last one in the list in this class defines the lowest loadable interest. + lowest_interest_loadable = pimpl; - impl_count_total++; - } + impl_count_total++; + } - // Overrides if the window is minimized or we lost focus (taking care - // not to accidentally "raise" the priority either) - if (!gViewerWindow->getActive() /* viewer window minimized? */ - && new_priority > LLPluginClassMedia::PRIORITY_HIDDEN) - { - new_priority = LLPluginClassMedia::PRIORITY_HIDDEN; - } - else if (!gFocusMgr.getAppHasFocus() /* viewer window lost focus? */ - && new_priority > LLPluginClassMedia::PRIORITY_LOW) - { - new_priority = LLPluginClassMedia::PRIORITY_LOW; - } + // Overrides if the window is minimized or we lost focus (taking care + // not to accidentally "raise" the priority either) + if (!gViewerWindow->getActive() /* viewer window minimized? */ + && new_priority > LLPluginClassMedia::PRIORITY_HIDDEN) + { + new_priority = LLPluginClassMedia::PRIORITY_HIDDEN; + } + else if (!gFocusMgr.getAppHasFocus() /* viewer window lost focus? */ + && new_priority > LLPluginClassMedia::PRIORITY_LOW) + { + new_priority = LLPluginClassMedia::PRIORITY_LOW; + } - if(!inworld_media_enabled) - { - // If inworld media is locked out, force all inworld media to stay unloaded. - if(!pimpl->getUsedInUI()) + if(!inworld_media_enabled) { - new_priority = LLPluginClassMedia::PRIORITY_UNLOADED; + // If inworld media is locked out, force all inworld media to stay unloaded. + if(!pimpl->getUsedInUI()) + { + new_priority = LLPluginClassMedia::PRIORITY_UNLOADED; + } } - } - // update the audio stream here as well - if( !inworld_audio_enabled) - { - if(LLViewerMedia::isParcelAudioPlaying() && gAudiop && LLViewerMedia::hasParcelAudio()) + // update the audio stream here as well + if( !inworld_audio_enabled) { - gAudiop->stopInternetStream(); + if(LLViewerMedia::isParcelAudioPlaying() && gAudiop && LLViewerMedia::hasParcelAudio()) + { + LLViewerAudio::getInstance()->stopInternetStreamWithAutoFade(); + } } - } - pimpl->setPriority(new_priority); + pimpl->setPriority(new_priority); - if(pimpl->getUsedInUI()) - { - // Any impls used in the UI should not be in the proximity list. - pimpl->mProximity = -1; - } - else - { - proximity_order.push_back(pimpl); - } + if(pimpl->getUsedInUI()) + { + // Any impls used in the UI should not be in the proximity list. + pimpl->mProximity = -1; + } + else + { + proximity_order.push_back(pimpl); + } - total_cpu += pimpl->getCPUUsage(); + total_cpu += pimpl->getCPUUsage(); - if (!pimpl->getUsedInUI() && pimpl->hasMedia()) - { - sAnyMediaShowing = true; - } + if (!pimpl->getUsedInUI() && pimpl->hasMedia()) + { + sAnyMediaShowing = true; + } + } } // Re-calculate this every time. @@ -1014,6 +1034,7 @@ void LLViewerMedia::updateMedia(void *dummy_arg) } else { + LLFastTimer t(FTM_MEDIA_SORT2); // Use a distance-based sort for proximity values. std::stable_sort(proximity_order.begin(), proximity_order.end(), proximity_comparitor); } @@ -1069,13 +1090,24 @@ void LLViewerMedia::setAllMediaEnabled(bool val) gAudiop && LLViewerMedia::hasParcelAudio()) { - gAudiop->startInternetStream(LLViewerMedia::getParcelAudioURL()); + if (LLAudioEngine::AUDIO_PAUSED == gAudiop->isInternetStreamPlaying()) + { + // 'false' means unpause + gAudiop->pauseInternetStream(false); + } + else + { + LLViewerAudio::getInstance()->startInternetStreamWithAutoFade(LLViewerMedia::getParcelAudioURL()); + } } } else { // This actually unloads the impl, as opposed to "stop"ping the media LLViewerParcelMedia::stop(); - if (gAudiop) gAudiop->stopInternetStream(); + if (gAudiop) + { + LLViewerAudio::getInstance()->stopInternetStreamWithAutoFade(); + } } } @@ -1484,6 +1516,8 @@ void LLViewerMedia::setOpenIDCookie() std::string profile_url = getProfileURL(""); LLURL raw_profile_url( profile_url.c_str() ); + LL_DEBUGS("MediaAuth") << "Requesting " << profile_url << llendl; + LL_DEBUGS("MediaAuth") << "sOpenIDCookie = [" << sOpenIDCookie << "]" << llendl; LLHTTPClient::get(profile_url, new LLViewerMediaWebProfileResponder(raw_profile_url.getAuthority()), headers); @@ -1716,7 +1750,8 @@ LLViewerMediaImpl::LLViewerMediaImpl( const LLUUID& texture_id, mNavigateSuspended(false), mNavigateSuspendedDeferred(false), mIsUpdated(false), - mTrustedBrowser(false) + mTrustedBrowser(false), + mZoomFactor(1.0) { // Set up the mute list observer if it hasn't been set up already. @@ -1862,7 +1897,7 @@ LLPluginClassMedia* LLViewerMediaImpl::newSourceFromMediaType(std::string media_ if(plugin_basename.empty()) { - LL_WARNS("Media") << "Couldn't find plugin for media type " << media_type << LL_ENDL; + LL_WARNS_ONCE("Media") << "Couldn't find plugin for media type " << media_type << LL_ENDL; } else { @@ -1888,11 +1923,11 @@ LLPluginClassMedia* LLViewerMediaImpl::newSourceFromMediaType(std::string media_ llstat s; if(LLFile::stat(launcher_name, &s)) { - LL_WARNS("Media") << "Couldn't find launcher at " << launcher_name << LL_ENDL; + LL_WARNS_ONCE("Media") << "Couldn't find launcher at " << launcher_name << LL_ENDL; } else if(LLFile::stat(plugin_name, &s)) { - LL_WARNS("Media") << "Couldn't find plugin at " << plugin_name << LL_ENDL; + LL_WARNS_ONCE("Media") << "Couldn't find plugin at " << plugin_name << LL_ENDL; } else { @@ -2302,6 +2337,17 @@ void LLViewerMediaImpl::clearCache() } } + +////////////////////////////////////////////////////////////////////////////////////////// +void LLViewerMediaImpl::setPageZoomFactor( double factor ) +{ + if(mMediaSource && factor != mZoomFactor) + { + mZoomFactor = factor; + mMediaSource->set_page_zoom_factor( factor ); + } +} + ////////////////////////////////////////////////////////////////////////////////////////// void LLViewerMediaImpl::mouseDown(S32 x, S32 y, MASK mask, S32 button) { @@ -2450,44 +2496,58 @@ BOOL LLViewerMediaImpl::handleMouseUp(S32 x, S32 y, MASK mask) ////////////////////////////////////////////////////////////////////////////////////////// void LLViewerMediaImpl::updateJavascriptObject() { + static LLFrameTimer timer ; + if ( mMediaSource ) { // flag to expose this information to internal browser or not. bool enable = gSavedSettings.getBOOL("BrowserEnableJSObject"); + + if(!enable) + { + return ; //no need to go further. + } + + if(timer.getElapsedTimeF32() < 1.0f) + { + return ; //do not update more than once per second. + } + timer.reset() ; + mMediaSource->jsEnableObject( enable ); // these values are only menaingful after login so don't set them before bool logged_in = LLLoginInstance::getInstance()->authSuccess(); if ( logged_in ) { - // current location within a region - LLVector3 agent_pos = gAgent.getPositionAgent(); - double x = agent_pos.mV[ VX ]; - double y = agent_pos.mV[ VY ]; - double z = agent_pos.mV[ VZ ]; - mMediaSource->jsAgentLocationEvent( x, y, z ); - - // current location within the grid - LLVector3d agent_pos_global = gAgent.getLastPositionGlobal(); - double global_x = agent_pos_global.mdV[ VX ]; - double global_y = agent_pos_global.mdV[ VY ]; - double global_z = agent_pos_global.mdV[ VZ ]; - mMediaSource->jsAgentGlobalLocationEvent( global_x, global_y, global_z ); - - // current agent orientation - double rotation = atan2( gAgent.getAtAxis().mV[VX], gAgent.getAtAxis().mV[VY] ); - double angle = rotation * RAD_TO_DEG; - if ( angle < 0.0f ) angle = 360.0f + angle; // TODO: has to be a better way to get orientation! - mMediaSource->jsAgentOrientationEvent( angle ); - - // current region agent is in - std::string region_name(""); - LLViewerRegion* region = gAgent.getRegion(); - if ( region ) - { - region_name = region->getName(); - }; - mMediaSource->jsAgentRegionEvent( region_name ); + // current location within a region + LLVector3 agent_pos = gAgent.getPositionAgent(); + double x = agent_pos.mV[ VX ]; + double y = agent_pos.mV[ VY ]; + double z = agent_pos.mV[ VZ ]; + mMediaSource->jsAgentLocationEvent( x, y, z ); + + // current location within the grid + LLVector3d agent_pos_global = gAgent.getLastPositionGlobal(); + double global_x = agent_pos_global.mdV[ VX ]; + double global_y = agent_pos_global.mdV[ VY ]; + double global_z = agent_pos_global.mdV[ VZ ]; + mMediaSource->jsAgentGlobalLocationEvent( global_x, global_y, global_z ); + + // current agent orientation + double rotation = atan2( gAgent.getAtAxis().mV[VX], gAgent.getAtAxis().mV[VY] ); + double angle = rotation * RAD_TO_DEG; + if ( angle < 0.0f ) angle = 360.0f + angle; // TODO: has to be a better way to get orientation! + mMediaSource->jsAgentOrientationEvent( angle ); + + // current region agent is in + std::string region_name(""); + LLViewerRegion* region = gAgent.getRegion(); + if ( region ) + { + region_name = region->getName(); + }; + mMediaSource->jsAgentRegionEvent( region_name ); } // language code the viewer is set to @@ -2506,7 +2566,7 @@ void LLViewerMediaImpl::updateJavascriptObject() } ////////////////////////////////////////////////////////////////////////////////////////// -std::string LLViewerMediaImpl::getName() const +const std::string& LLViewerMediaImpl::getName() const { if (mMediaSource) { @@ -2768,8 +2828,14 @@ bool LLViewerMediaImpl::canNavigateBack() } ////////////////////////////////////////////////////////////////////////////////////////// +static LLFastTimer::DeclareTimer FTM_MEDIA_DO_UPDATE("Do Update"); +static LLFastTimer::DeclareTimer FTM_MEDIA_GET_DATA("Get Data"); +static LLFastTimer::DeclareTimer FTM_MEDIA_SET_SUBIMAGE("Set Subimage"); + + void LLViewerMediaImpl::update() { + LLFastTimer t(FTM_MEDIA_DO_UPDATE); if(mMediaSource == NULL) { if(mPriority == LLPluginClassMedia::PRIORITY_UNLOADED) @@ -2869,20 +2935,27 @@ void LLViewerMediaImpl::update() if(width > 0 && height > 0) { - U8* data = mMediaSource->getBitsData(); + U8* data = NULL; + { + LLFastTimer t(FTM_MEDIA_GET_DATA); + data = mMediaSource->getBitsData(); + } // Offset the pixels pointer to match x_pos and y_pos data += ( x_pos * mMediaSource->getTextureDepth() * mMediaSource->getBitsWidth() ); data += ( y_pos * mMediaSource->getTextureDepth() ); - placeholder_image->setSubImage( - data, - mMediaSource->getBitsWidth(), - mMediaSource->getBitsHeight(), - x_pos, - y_pos, - width, - height); + { + LLFastTimer t(FTM_MEDIA_SET_SUBIMAGE); + placeholder_image->setSubImage( + data, + mMediaSource->getBitsWidth(), + mMediaSource->getBitsHeight(), + x_pos, + y_pos, + width, + height); + } } @@ -3341,7 +3414,6 @@ void LLViewerMediaImpl::handleMediaEvent(LLPluginClassMedia* plugin, LLPluginCla { // This close request is directed at another instance pass_through = false; - LLFloaterMediaBrowser::closeRequest(uuid); LLFloaterWebContent::closeRequest(uuid); } } @@ -3361,7 +3433,6 @@ void LLViewerMediaImpl::handleMediaEvent(LLPluginClassMedia* plugin, LLPluginCla { // This request is directed at another instance pass_through = false; - LLFloaterMediaBrowser::geometryChanged(uuid, plugin->getGeometryX(), plugin->getGeometryY(), plugin->getGeometryWidth(), plugin->getGeometryHeight()); LLFloaterWebContent::geometryChanged(uuid, plugin->getGeometryX(), plugin->getGeometryY(), plugin->getGeometryWidth(), plugin->getGeometryHeight()); } } @@ -3455,8 +3526,11 @@ BOOL LLViewerMediaImpl::isUpdated() return mIsUpdated ; } +static LLFastTimer::DeclareTimer FTM_MEDIA_CALCULATE_INTEREST("Calculate Interest"); + void LLViewerMediaImpl::calculateInterest() { + LLFastTimer t(FTM_MEDIA_CALCULATE_INTEREST); LLViewerMediaTexture* texture = LLViewerTextureManager::findMediaTexture( mTextureId ); if(texture != NULL) diff --git a/indra/newview/llviewermedia.h b/indra/newview/llviewermedia.h index 0b69b8f0c1..15dcda59cf 100644 --- a/indra/newview/llviewermedia.h +++ b/indra/newview/llviewermedia.h @@ -250,6 +250,7 @@ public: std::string getMediaEntryURL() { return mMediaEntryURL; } void setHomeURL(const std::string& home_url, const std::string& mime_type = LLStringUtil::null) { mHomeURL = home_url; mHomeMimeType = mime_type;}; void clearCache(); + void setPageZoomFactor( double factor ); std::string getMimeType() { return mMimeType; } void scaleMouse(S32 *mouse_x, S32 *mouse_y); void scaleTextureCoords(const LLVector2& texture_coords, S32 *x, S32 *y); @@ -317,7 +318,7 @@ public: /*virtual*/ BOOL handleToolTip(S32 x, S32 y, MASK mask) { return FALSE; }; /*virtual*/ BOOL handleMiddleMouseDown(S32 x, S32 y, MASK mask) { return FALSE; }; /*virtual*/ BOOL handleMiddleMouseUp(S32 x, S32 y, MASK mask) {return FALSE; }; - /*virtual*/ std::string getName() const; + /*virtual*/ const std::string& getName() const; /*virtual*/ void screenPointToLocal(S32 screen_x, S32 screen_y, S32* local_x, S32* local_y) const {}; /*virtual*/ void localPointToScreen(S32 local_x, S32 local_y, S32* screen_x, S32* screen_y) const {}; @@ -416,6 +417,7 @@ private: private: // a single media url with some data and an impl. LLPluginClassMedia* mMediaSource; + F64 mZoomFactor; LLUUID mTextureId; bool mMovieImageHasMips; std::string mMediaURL; // The last media url set with NavigateTo diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 2345fbfd6a..3a1b8d7623 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -76,7 +76,6 @@ #include "llinventoryfunctions.h" #include "llpanellogin.h" #include "llpanelblockedlist.h" -#include "llmenucommands.h" #include "llmoveview.h" #include "llparcel.h" #include "llrootview.h" @@ -968,6 +967,10 @@ U32 info_display_from_string(std::string info_display) { return LLPipeline::RENDER_DEBUG_SCULPTED; } + else if ("wind vectors" == info_display) + { + return LLPipeline::RENDER_DEBUG_WIND_VECTORS; + } else { return 0; @@ -980,6 +983,8 @@ class LLAdvancedToggleInfoDisplay : public view_listener_t { U32 info_display = info_display_from_string( userdata.asString() ); + LL_INFOS("ViewerMenu") << "toggle " << userdata.asString() << LL_ENDL; + if ( info_display != 0 ) { LLPipeline::toggleRenderDebug( (void*)info_display ); @@ -997,6 +1002,8 @@ class LLAdvancedCheckInfoDisplay : public view_listener_t U32 info_display = info_display_from_string( userdata.asString() ); bool new_value = false; + LL_INFOS("ViewerMenu") << "check " << userdata.asString() << LL_ENDL; + if ( info_display != 0 ) { new_value = LLPipeline::toggleRenderDebugControl( (void*)info_display ); @@ -1030,26 +1037,6 @@ class LLAdvancedCheckRandomizeFramerate : public view_listener_t } }; -void run_vectorize_perf_test(void *) -{ - gSavedSettings.setBOOL("VectorizePerfTest", TRUE); -} - - -//////////////////////////////// -// RUN Vectorized Perform Test// -//////////////////////////////// - - -class LLAdvancedVectorizePerfTest : public view_listener_t -{ - bool handleEvent(const LLSD& userdata) - { - run_vectorize_perf_test(NULL); - return true; - } -}; - /////////////////////////// //// PERIODIC SLOW FRAME // /////////////////////////// @@ -3114,7 +3101,7 @@ void handle_avatar_eject(const LLSD& avatar_id) bool my_profile_visible() { - LLFloater* floaterp = LLFloaterReg::findInstance("profile", LLSD().with("id", gAgent.getID())); + LLFloater* floaterp = LLAvatarActions::getProfileFloater(gAgentID); return floaterp && floaterp->isInVisibleChain(); } @@ -7693,7 +7680,14 @@ class LLWorldEnvSettings : public view_listener_t } else { - LLEnvManagerNew::instance().setUseDayCycle(LLEnvManagerNew::instance().getDayCycleName()); + LLEnvManagerNew &envmgr = LLEnvManagerNew::instance(); + // reset all environmental settings to track the region defaults, make this reset 'sticky' like the other sun settings. + bool use_fixed_sky = false; + bool use_region_settings = true; + envmgr.setUserPrefs(envmgr.getWaterPresetName(), + envmgr.getSkyPresetName(), + envmgr.getDayCycleName(), + use_fixed_sky, use_region_settings); } return true; @@ -7795,24 +7789,6 @@ class LLWorldPostProcess : public view_listener_t } }; -class LLWorldToggleMovementControls : public view_listener_t -{ - bool handleEvent(const LLSD& userdata) - { - LLFloaterReg::toggleInstanceOrBringToFront("moveview"); - return true; - } -}; - -class LLWorldToggleCameraControls : public view_listener_t -{ - bool handleEvent(const LLSD& userdata) - { - LLFloaterReg::toggleInstanceOrBringToFront("camera"); - return true; - } -}; - void handle_flush_name_caches() { // Toggle display names on and off to flush @@ -7962,9 +7938,17 @@ void initialize_menus() view_listener_t::addEnable(new LLUploadCostCalculator(), "Upload.CalculateCosts"); + + commit.add("Inventory.NewWindow", boost::bind(&LLFloaterInventory::showAgentInventory)); + // Agent commit.add("Agent.toggleFlying", boost::bind(&LLAgent::toggleFlying)); enable.add("Agent.enableFlying", boost::bind(&LLAgent::enableFlying)); + commit.add("Agent.PressMicrophone", boost::bind(&LLAgent::pressMicrophone, _2)); + commit.add("Agent.ReleaseMicrophone", boost::bind(&LLAgent::releaseMicrophone, _2)); + commit.add("Agent.ToggleMicrophone", boost::bind(&LLAgent::toggleMicrophone, _2)); + enable.add("Agent.IsMicrophoneOn", boost::bind(&LLAgent::isMicrophoneOn, _2)); + enable.add("Agent.IsActionAllowed", boost::bind(&LLAgent::isActionAllowed, _2)); // File menu init_menu_file(); @@ -8007,7 +7991,6 @@ void initialize_menus() view_listener_t::addMenu(new LLAdvancedAgentFlyingInfo(), "Agent.getFlying"); // World menu - commit.add("World.Chat", boost::bind(&handle_chat, (void*)NULL)); view_listener_t::addMenu(new LLWorldAlwaysRun(), "World.AlwaysRun"); view_listener_t::addMenu(new LLWorldCreateLandmark(), "World.CreateLandmark"); view_listener_t::addMenu(new LLWorldPlaceProfile(), "World.PlaceProfile"); @@ -8028,9 +8011,6 @@ void initialize_menus() view_listener_t::addMenu(new LLWorldEnableEnvPreset(), "World.EnableEnvPreset"); view_listener_t::addMenu(new LLWorldPostProcess(), "World.PostProcess"); - view_listener_t::addMenu(new LLWorldToggleMovementControls(), "World.Toggle.MovementControls"); - view_listener_t::addMenu(new LLWorldToggleCameraControls(), "World.Toggle.CameraControls"); - // Tools menu view_listener_t::addMenu(new LLToolsSelectTool(), "Tools.SelectTool"); view_listener_t::addMenu(new LLToolsSelectOnlyMyObjects(), "Tools.SelectOnlyMyObjects"); @@ -8106,7 +8086,6 @@ void initialize_menus() view_listener_t::addMenu(new LLAdvancedCheckRandomizeFramerate(), "Advanced.CheckRandomizeFramerate"); view_listener_t::addMenu(new LLAdvancedTogglePeriodicSlowFrame(), "Advanced.TogglePeriodicSlowFrame"); view_listener_t::addMenu(new LLAdvancedCheckPeriodicSlowFrame(), "Advanced.CheckPeriodicSlowFrame"); - view_listener_t::addMenu(new LLAdvancedVectorizePerfTest(), "Advanced.VectorizePerfTest"); view_listener_t::addMenu(new LLAdvancedToggleFrameTest(), "Advanced.ToggleFrameTest"); view_listener_t::addMenu(new LLAdvancedCheckFrameTest(), "Advanced.CheckFrameTest"); view_listener_t::addMenu(new LLAdvancedHandleAttachedLightParticles(), "Advanced.HandleAttachedLightParticles"); @@ -8337,6 +8316,8 @@ void initialize_menus() view_listener_t::addMenu(new LLGoToObject(), "GoToObject"); commit.add("PayObject", boost::bind(&handle_give_money_dialog)); + commit.add("Inventory.NewWindow", boost::bind(&LLFloaterInventory::showAgentInventory)); + enable.add("EnablePayObject", boost::bind(&enable_pay_object)); enable.add("EnablePayAvatar", boost::bind(&enable_pay_avatar)); enable.add("EnableEdit", boost::bind(&enable_object_edit)); diff --git a/indra/newview/llviewermenufile.cpp b/indra/newview/llviewermenufile.cpp index caa5982f56..850bf35c61 100644 --- a/indra/newview/llviewermenufile.cpp +++ b/indra/newview/llviewermenufile.cpp @@ -600,23 +600,7 @@ class LLFileTakeSnapshotToDisk : public view_listener_t {
gViewerWindow->playSnapshotAnimAndSound();
- LLPointer<LLImageFormatted> formatted;
- switch(LLFloaterSnapshot::ESnapshotFormat(gSavedSettings.getS32("SnapshotFormat")))
- {
- case LLFloaterSnapshot::SNAPSHOT_FORMAT_JPEG:
- formatted = new LLImageJPEG(gSavedSettings.getS32("SnapshotQuality"));
- break;
- case LLFloaterSnapshot::SNAPSHOT_FORMAT_PNG:
- formatted = new LLImagePNG;
- break;
- case LLFloaterSnapshot::SNAPSHOT_FORMAT_BMP:
- formatted = new LLImageBMP;
- break;
- default:
- llwarns << "Unknown Local Snapshot format" << llendl;
- return true;
- }
-
+ LLPointer<LLImageFormatted> formatted = new LLImagePNG;
formatted->enableOverSize() ;
formatted->encode(raw, 0);
formatted->disableOverSize() ;
diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index f0d53668d4..ad333a71ff 100644..100755 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -59,9 +59,9 @@ #include "llfloaterland.h" #include "llfloaterregioninfo.h" #include "llfloaterlandholdings.h" -#include "llfloaterpostcard.h" #include "llfloaterpreference.h" #include "llfloatersidepanelcontainer.h" +#include "llfloatersnapshot.h" #include "llhudeffecttrail.h" #include "llhudmanager.h" #include "llinventoryfunctions.h" @@ -1256,14 +1256,7 @@ void open_inventory_offer(const uuid_vec_t& objects, const std::string& from_nam const BOOL auto_open = gSavedSettings.getBOOL("ShowInInventory") && // don't open if showininventory is false !from_name.empty(); // don't open if it's not from anyone. - LLInventoryPanel *active_panel = LLInventoryPanel::getActiveInventoryPanel(auto_open); - if(active_panel) - { - LL_DEBUGS("Messaging") << "Highlighting" << obj_id << LL_ENDL; - LLFocusableElement* focus_ctrl = gFocusMgr.getKeyboardFocus(); - active_panel->setSelection(obj_id, TAKE_FOCUS_NO); - gFocusMgr.setKeyboardFocus(focus_ctrl); - } + LLInventoryPanel::openInventoryPanelAndSetSelection(auto_open, obj_id); } } @@ -3121,7 +3114,7 @@ protected: { // filter out non-interesting responeses if ( !translation.empty() - && (m_toLang != detected_language) + && (mToLang != detected_language) && (LLStringUtil::compareInsensitive(translation, m_origMesg) != 0) ) { m_chat.mText += " (" + translation + ")"; @@ -3130,10 +3123,13 @@ protected: LLNotificationsUI::LLNotificationManager::instance().onChat(m_chat, m_toastArgs); } - void handleFailure() + void handleFailure(int status, const std::string& err_msg) { - LLTranslate::TranslationReceiver::handleFailure(); - m_chat.mText += " (?)"; + llwarns << "Translation failed for mesg " << m_origMesg << " toLang " << mToLang << " fromLang " << mFromLang << llendl; + + std::string msg = LLTrans::getString("TranslationFailed", LLSD().with("[REASON]", err_msg)); + LLStringUtil::replaceString(msg, "\n", " "); // we want one-line error messages + m_chat.mText += " (" + msg + ")"; LLNotificationsUI::LLNotificationManager::instance().onChat(m_chat, m_toastArgs); } @@ -3371,7 +3367,7 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data) const std::string from_lang = ""; // leave empty to trigger autodetect const std::string to_lang = LLTranslate::getTranslateLanguage(); - LLHTTPClient::ResponderPtr result = ChatTranslationReceiver::build(from_lang, to_lang, mesg, chat, args); + LLTranslate::TranslationReceiverPtr result = ChatTranslationReceiver::build(from_lang, to_lang, mesg, chat, args); LLTranslate::translateMessage(result, from_lang, to_lang, mesg); } else @@ -3642,6 +3638,9 @@ void process_teleport_finish(LLMessageSystem* msg, void**) gCacheName->setUpstream(sim); */ + // Make sure we're standing + gAgent.standUp(); + // now, use the circuit info to tell simulator about us! LL_INFOS("Messaging") << "process_teleport_finish() Enabling " << sim_host << " with code " << msg->mOurCircuitCode << LL_ENDL; @@ -6467,7 +6466,7 @@ void process_user_info_reply(LLMessageSystem* msg, void**) msg->getString( "UserData", "DirectoryVisibility", dir_visibility); LLFloaterPreference::updateUserInfo(dir_visibility, im_via_email, email); - LLFloaterPostcard::updateUserInfo(email); + LLFloaterSnapshot::setAgentEmail(email); } diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index d81e67bfe2..b8772971aa 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -3219,12 +3219,12 @@ F32 LLViewerObject::getLinksetPhysicsCost() return mLinksetPhysicsCost; } -F32 LLViewerObject::getStreamingCost(S32* bytes, S32* visible_bytes) +F32 LLViewerObject::getStreamingCost(S32* bytes, S32* visible_bytes, F32* unscaled_value) const { return 0.f; } -U32 LLViewerObject::getTriangleCount() +U32 LLViewerObject::getTriangleCount(S32* vcount) const { return 0; } diff --git a/indra/newview/llviewerobject.h b/indra/newview/llviewerobject.h index 53e951e483..c8152e1539 100644 --- a/indra/newview/llviewerobject.h +++ b/indra/newview/llviewerobject.h @@ -1,4 +1,4 @@ -/** +/** * @file llviewerobject.h * @brief Description of LLViewerObject class, which is the base class for most objects in the viewer. * @@ -340,8 +340,8 @@ public: virtual void setScale(const LLVector3 &scale, BOOL damped = FALSE); - virtual F32 getStreamingCost(S32* bytes = NULL, S32* visible_bytes = NULL); - virtual U32 getTriangleCount(); + virtual F32 getStreamingCost(S32* bytes = NULL, S32* visible_bytes = NULL, F32* unscaled_value = NULL) const; + virtual U32 getTriangleCount(S32* vcount = NULL) const; virtual U32 getHighLODTriangleCount(); void setObjectCost(F32 cost); @@ -811,7 +811,7 @@ public: virtual F32 getPartSize(S32 idx); virtual void getGeometry(S32 idx, - LLStrider<LLVector3>& verticesp, + LLStrider<LLVector4a>& verticesp, LLStrider<LLVector3>& normalsp, LLStrider<LLVector2>& texcoordsp, LLStrider<LLColor4U>& colorsp, diff --git a/indra/newview/llviewerparcelmgr.cpp b/indra/newview/llviewerparcelmgr.cpp index 8db72da1ee..9db784101d 100644 --- a/indra/newview/llviewerparcelmgr.cpp +++ b/indra/newview/llviewerparcelmgr.cpp @@ -67,6 +67,7 @@ #include "llworld.h" #include "roles_constants.h" #include "llweb.h" +#include "llvieweraudio.h" const F32 PARCEL_COLLISION_DRAW_SECS = 1.f; @@ -113,7 +114,7 @@ LLViewerParcelMgr::LLViewerParcelMgr() mRequestResult(0), mWestSouth(), mEastNorth(), - mSelectedDwell(0.f), + mSelectedDwell(DWELL_NAN), mAgentParcelSequenceID(-1), mHoverRequestResult(0), mHoverWestSouth(), @@ -233,7 +234,7 @@ void LLViewerParcelMgr::getDisplayInfo(S32* area_out, S32* claim_out, S32 price = 0; S32 rent = 0; BOOL for_sale = FALSE; - F32 dwell = 0.f; + F32 dwell = DWELL_NAN; if (mSelected) { @@ -579,7 +580,7 @@ void LLViewerParcelMgr::deselectLand() mCurrentParcel->mBanList.clear(); //mCurrentParcel->mRenterList.reset(); - mSelectedDwell = 0.f; + mSelectedDwell = DWELL_NAN; // invalidate parcel selection so that existing users of this selection can clean up mCurrentParcelSelection->setParcel(NULL); @@ -1457,6 +1458,8 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use S32 other_clean_time = 0; + LLViewerParcelMgr& parcel_mgr = LLViewerParcelMgr::instance(); + msg->getS32Fast(_PREHASH_ParcelData, _PREHASH_RequestResult, request_result ); msg->getS32Fast(_PREHASH_ParcelData, _PREHASH_SequenceID, sequence_id ); @@ -1472,31 +1475,31 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use if (sequence_id == SELECTED_PARCEL_SEQ_ID) { // ...selected parcels report this sequence id - LLViewerParcelMgr::getInstance()->mRequestResult = PARCEL_RESULT_SUCCESS; - parcel = LLViewerParcelMgr::getInstance()->mCurrentParcel; + parcel_mgr.mRequestResult = PARCEL_RESULT_SUCCESS; + parcel = parcel_mgr.mCurrentParcel; } else if (sequence_id == HOVERED_PARCEL_SEQ_ID) { - LLViewerParcelMgr::getInstance()->mHoverRequestResult = PARCEL_RESULT_SUCCESS; - parcel = LLViewerParcelMgr::getInstance()->mHoverParcel; + parcel_mgr.mHoverRequestResult = PARCEL_RESULT_SUCCESS; + parcel = parcel_mgr.mHoverParcel; } else if (sequence_id == COLLISION_NOT_IN_GROUP_PARCEL_SEQ_ID || sequence_id == COLLISION_NOT_ON_LIST_PARCEL_SEQ_ID || sequence_id == COLLISION_BANNED_PARCEL_SEQ_ID) { - LLViewerParcelMgr::getInstance()->mHoverRequestResult = PARCEL_RESULT_SUCCESS; - parcel = LLViewerParcelMgr::getInstance()->mCollisionParcel; + parcel_mgr.mHoverRequestResult = PARCEL_RESULT_SUCCESS; + parcel = parcel_mgr.mCollisionParcel; } - else if (sequence_id == 0 || sequence_id > LLViewerParcelMgr::getInstance()->mAgentParcelSequenceID) + else if (sequence_id == 0 || sequence_id > parcel_mgr.mAgentParcelSequenceID) { // new agent parcel - LLViewerParcelMgr::getInstance()->mAgentParcelSequenceID = sequence_id; - parcel = LLViewerParcelMgr::getInstance()->mAgentParcel; + parcel_mgr.mAgentParcelSequenceID = sequence_id; + parcel = parcel_mgr.mAgentParcel; } else { llinfos << "out of order agent parcel sequence id " << sequence_id - << " last good " << LLViewerParcelMgr::getInstance()->mAgentParcelSequenceID + << " last good " << parcel_mgr.mAgentParcelSequenceID << llendl; return; } @@ -1567,15 +1570,15 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use parcel->setRegionDenyAgeUnverifiedOverride(region_deny_age_unverified_override); parcel->unpackMessage(msg); - if (parcel == LLViewerParcelMgr::getInstance()->mAgentParcel) + if (parcel == parcel_mgr.mAgentParcel) { - S32 bitmap_size = LLViewerParcelMgr::getInstance()->mParcelsPerEdge - * LLViewerParcelMgr::getInstance()->mParcelsPerEdge + S32 bitmap_size = parcel_mgr.mParcelsPerEdge + * parcel_mgr.mParcelsPerEdge / 8; U8* bitmap = new U8[ bitmap_size ]; msg->getBinaryDataFast(_PREHASH_ParcelData, _PREHASH_Bitmap, bitmap, bitmap_size); - LLViewerParcelMgr::getInstance()->writeAgentParcelFromBitmap(bitmap); + parcel_mgr.writeAgentParcelFromBitmap(bitmap); delete[] bitmap; // Let interesting parties know about agent parcel change. @@ -1595,11 +1598,11 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use if (sequence_id == SELECTED_PARCEL_SEQ_ID) { // Update selected counts - LLViewerParcelMgr::getInstance()->mCurrentParcelSelection->mSelectedSelfCount = self_count; - LLViewerParcelMgr::getInstance()->mCurrentParcelSelection->mSelectedOtherCount = other_count; - LLViewerParcelMgr::getInstance()->mCurrentParcelSelection->mSelectedPublicCount = public_count; + parcel_mgr.mCurrentParcelSelection->mSelectedSelfCount = self_count; + parcel_mgr.mCurrentParcelSelection->mSelectedOtherCount = other_count; + parcel_mgr.mCurrentParcelSelection->mSelectedPublicCount = public_count; - LLViewerParcelMgr::getInstance()->mCurrentParcelSelection->mSelectedMultipleOwners = + parcel_mgr.mCurrentParcelSelection->mSelectedMultipleOwners = (request_result == PARCEL_RESULT_MULTIPLE); // Select the whole parcel @@ -1610,67 +1613,67 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use { // don't muck with the westsouth and eastnorth. // just highlight it - LLVector3 west_south = region->getPosRegionFromGlobal(LLViewerParcelMgr::getInstance()->mWestSouth); - LLVector3 east_north = region->getPosRegionFromGlobal(LLViewerParcelMgr::getInstance()->mEastNorth); + LLVector3 west_south = region->getPosRegionFromGlobal(parcel_mgr.mWestSouth); + LLVector3 east_north = region->getPosRegionFromGlobal(parcel_mgr.mEastNorth); - LLViewerParcelMgr::getInstance()->resetSegments(LLViewerParcelMgr::getInstance()->mHighlightSegments); - LLViewerParcelMgr::getInstance()->writeHighlightSegments( + parcel_mgr.resetSegments(parcel_mgr.mHighlightSegments); + parcel_mgr.writeHighlightSegments( west_south.mV[VX], west_south.mV[VY], east_north.mV[VX], east_north.mV[VY] ); - LLViewerParcelMgr::getInstance()->mCurrentParcelSelection->mWholeParcelSelected = FALSE; + parcel_mgr.mCurrentParcelSelection->mWholeParcelSelected = FALSE; } else if (0 == local_id) { // this is public land, just highlight the selection - LLViewerParcelMgr::getInstance()->mWestSouth = region->getPosGlobalFromRegion( aabb_min ); - LLViewerParcelMgr::getInstance()->mEastNorth = region->getPosGlobalFromRegion( aabb_max ); + parcel_mgr.mWestSouth = region->getPosGlobalFromRegion( aabb_min ); + parcel_mgr.mEastNorth = region->getPosGlobalFromRegion( aabb_max ); - LLViewerParcelMgr::getInstance()->resetSegments(LLViewerParcelMgr::getInstance()->mHighlightSegments); - LLViewerParcelMgr::getInstance()->writeHighlightSegments( + parcel_mgr.resetSegments(parcel_mgr.mHighlightSegments); + parcel_mgr.writeHighlightSegments( aabb_min.mV[VX], aabb_min.mV[VY], aabb_max.mV[VX], aabb_max.mV[VY] ); - LLViewerParcelMgr::getInstance()->mCurrentParcelSelection->mWholeParcelSelected = TRUE; + parcel_mgr.mCurrentParcelSelection->mWholeParcelSelected = TRUE; } else { - LLViewerParcelMgr::getInstance()->mWestSouth = region->getPosGlobalFromRegion( aabb_min ); - LLViewerParcelMgr::getInstance()->mEastNorth = region->getPosGlobalFromRegion( aabb_max ); + parcel_mgr.mWestSouth = region->getPosGlobalFromRegion( aabb_min ); + parcel_mgr.mEastNorth = region->getPosGlobalFromRegion( aabb_max ); // Owned land, highlight the boundaries - S32 bitmap_size = LLViewerParcelMgr::getInstance()->mParcelsPerEdge - * LLViewerParcelMgr::getInstance()->mParcelsPerEdge + S32 bitmap_size = parcel_mgr.mParcelsPerEdge + * parcel_mgr.mParcelsPerEdge / 8; U8* bitmap = new U8[ bitmap_size ]; msg->getBinaryDataFast(_PREHASH_ParcelData, _PREHASH_Bitmap, bitmap, bitmap_size); - LLViewerParcelMgr::getInstance()->resetSegments(LLViewerParcelMgr::getInstance()->mHighlightSegments); - LLViewerParcelMgr::getInstance()->writeSegmentsFromBitmap( bitmap, LLViewerParcelMgr::getInstance()->mHighlightSegments ); + parcel_mgr.resetSegments(parcel_mgr.mHighlightSegments); + parcel_mgr.writeSegmentsFromBitmap( bitmap, parcel_mgr.mHighlightSegments ); delete[] bitmap; bitmap = NULL; - LLViewerParcelMgr::getInstance()->mCurrentParcelSelection->mWholeParcelSelected = TRUE; + parcel_mgr.mCurrentParcelSelection->mWholeParcelSelected = TRUE; } // Request access list information for this land - LLViewerParcelMgr::getInstance()->sendParcelAccessListRequest(AL_ACCESS | AL_BAN); + parcel_mgr.sendParcelAccessListRequest(AL_ACCESS | AL_BAN); // Request the media url filter list for this land - LLViewerParcelMgr::getInstance()->requestParcelMediaURLFilter(); + parcel_mgr.requestParcelMediaURLFilter(); // Request dwell for this land, if it's not public land. - LLViewerParcelMgr::getInstance()->mSelectedDwell = 0.f; + parcel_mgr.mSelectedDwell = DWELL_NAN; if (0 != local_id) { - LLViewerParcelMgr::getInstance()->sendParcelDwellRequest(); + parcel_mgr.sendParcelDwellRequest(); } - LLViewerParcelMgr::getInstance()->mSelected = TRUE; - LLViewerParcelMgr::getInstance()->notifyObservers(); + parcel_mgr.mSelected = TRUE; + parcel_mgr.notifyObservers(); } } else if (sequence_id == COLLISION_NOT_IN_GROUP_PARCEL_SEQ_ID || @@ -1678,32 +1681,32 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use sequence_id == COLLISION_BANNED_PARCEL_SEQ_ID) { // We're about to collide with this parcel - LLViewerParcelMgr::getInstance()->mRenderCollision = TRUE; - LLViewerParcelMgr::getInstance()->mCollisionTimer.reset(); + parcel_mgr.mRenderCollision = TRUE; + parcel_mgr.mCollisionTimer.reset(); // Differentiate this parcel if we are banned from it. if (sequence_id == COLLISION_BANNED_PARCEL_SEQ_ID) { - LLViewerParcelMgr::getInstance()->mCollisionBanned = BA_BANNED; + parcel_mgr.mCollisionBanned = BA_BANNED; } else if (sequence_id == COLLISION_NOT_IN_GROUP_PARCEL_SEQ_ID) { - LLViewerParcelMgr::getInstance()->mCollisionBanned = BA_NOT_IN_GROUP; + parcel_mgr.mCollisionBanned = BA_NOT_IN_GROUP; } else { - LLViewerParcelMgr::getInstance()->mCollisionBanned = BA_NOT_ON_LIST; + parcel_mgr.mCollisionBanned = BA_NOT_ON_LIST; } - S32 bitmap_size = LLViewerParcelMgr::getInstance()->mParcelsPerEdge - * LLViewerParcelMgr::getInstance()->mParcelsPerEdge + S32 bitmap_size = parcel_mgr.mParcelsPerEdge + * parcel_mgr.mParcelsPerEdge / 8; U8* bitmap = new U8[ bitmap_size ]; msg->getBinaryDataFast(_PREHASH_ParcelData, _PREHASH_Bitmap, bitmap, bitmap_size); - LLViewerParcelMgr::getInstance()->resetSegments(LLViewerParcelMgr::getInstance()->mCollisionSegments); - LLViewerParcelMgr::getInstance()->writeSegmentsFromBitmap( bitmap, LLViewerParcelMgr::getInstance()->mCollisionSegments ); + parcel_mgr.resetSegments(parcel_mgr.mCollisionSegments); + parcel_mgr.writeSegmentsFromBitmap( bitmap, parcel_mgr.mCollisionSegments ); delete[] bitmap; bitmap = NULL; @@ -1714,18 +1717,21 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use LLViewerRegion *region = LLWorld::getInstance()->getRegion( msg->getSender() ); if (region) { - LLViewerParcelMgr::getInstance()->mHoverWestSouth = region->getPosGlobalFromRegion( aabb_min ); - LLViewerParcelMgr::getInstance()->mHoverEastNorth = region->getPosGlobalFromRegion( aabb_max ); + parcel_mgr.mHoverWestSouth = region->getPosGlobalFromRegion( aabb_min ); + parcel_mgr.mHoverEastNorth = region->getPosGlobalFromRegion( aabb_max ); } else { - LLViewerParcelMgr::getInstance()->mHoverWestSouth.clearVec(); - LLViewerParcelMgr::getInstance()->mHoverEastNorth.clearVec(); + parcel_mgr.mHoverWestSouth.clearVec(); + parcel_mgr.mHoverEastNorth.clearVec(); } } else { - // look for music. + // Check for video + LLViewerParcelMedia::update(parcel); + + // Then check for music if (gAudiop) { if (parcel) @@ -1736,46 +1742,34 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use std::string music_url = music_url_raw; LLStringUtil::trim(music_url); - // On entering a new parcel, stop the last stream if the - // new parcel has a different music url. (Empty URL counts - // as different.) - const std::string& stream_url = gAudiop->getInternetStreamURL(); - - if (music_url.empty() || music_url != stream_url) + // If there is a new music URL and it's valid, play it. + if (music_url.size() > 12) { - // URL is different from one currently playing. - gAudiop->stopInternetStream(); - - // If there is a new music URL and it's valid, play it. - if (music_url.size() > 12) + if (music_url.substr(0,7) == "http://") { - if (music_url.substr(0,7) == "http://") - { - optionally_start_music(music_url); - } - else - { - llinfos << "Stopping parcel music (invalid audio stream URL)" << llendl; - // clears the URL - gAudiop->startInternetStream(LLStringUtil::null); - } + optionally_start_music(music_url); } - else if (!gAudiop->getInternetStreamURL().empty()) + else { - llinfos << "Stopping parcel music (parcel stream URL is empty)" << llendl; - gAudiop->startInternetStream(LLStringUtil::null); + llinfos << "Stopping parcel music (invalid audio stream URL)" << llendl; + // clears the URL + // null value causes fade out + LLViewerAudio::getInstance()->startInternetStreamWithAutoFade(LLStringUtil::null); } } + else if (!gAudiop->getInternetStreamURL().empty()) + { + llinfos << "Stopping parcel music (parcel stream URL is empty)" << llendl; + // null value causes fade out + LLViewerAudio::getInstance()->startInternetStreamWithAutoFade(LLStringUtil::null); + } } else { // Public land has no music - gAudiop->stopInternetStream(); + LLViewerAudio::getInstance()->stopInternetStreamWithAutoFade(); } }//if gAudiop - - // now check for video - LLViewerParcelMedia::update( parcel ); }; } @@ -1794,7 +1788,11 @@ void optionally_start_music(const std::string& music_url) gSavedSettings.getBOOL("MediaTentativeAutoPlay"))) { llinfos << "Starting parcel music " << music_url << llendl; - gAudiop->startInternetStream(music_url); + LLViewerAudio::getInstance()->startInternetStreamWithAutoFade(music_url); + } + else + { + LLViewerAudio::getInstance()->startInternetStreamWithAutoFade(LLStringUtil::null); } } } diff --git a/indra/newview/llviewerparcelmgr.h b/indra/newview/llviewerparcelmgr.h index 68d8978ea8..cac8d8391c 100644 --- a/indra/newview/llviewerparcelmgr.h +++ b/indra/newview/llviewerparcelmgr.h @@ -43,6 +43,8 @@ class LLParcel; class LLViewerTexture; class LLViewerRegion; +const F32 DWELL_NAN = -1.0f; // A dwell having this value will be displayed as Loading... + // Constants for sendLandOwner //const U32 NO_NEIGHBOR_JOIN = 0x0; //const U32 ALL_NEIGHBOR_JOIN = U32( NORTH_MASK diff --git a/indra/newview/llviewerparceloverlay.cpp b/indra/newview/llviewerparceloverlay.cpp index e619b89f9b..a0cf2fc803 100644 --- a/indra/newview/llviewerparceloverlay.cpp +++ b/indra/newview/llviewerparceloverlay.cpp @@ -884,14 +884,14 @@ S32 LLViewerParcelOverlay::renderPropertyLines () // Always fudge a little vertically. pull_toward_camera.mV[VZ] += 0.01f; - glMatrixMode( GL_MODELVIEW ); - glPushMatrix(); + gGL.matrixMode(LLRender::MM_MODELVIEW); + gGL.pushMatrix(); // Move to appropriate region coords LLVector3 origin = mRegion->getOriginAgent(); - glTranslatef( origin.mV[VX], origin.mV[VY], origin.mV[VZ] ); + gGL.translatef( origin.mV[VX], origin.mV[VY], origin.mV[VZ] ); - glTranslatef(pull_toward_camera.mV[VX], pull_toward_camera.mV[VY], + gGL.translatef(pull_toward_camera.mV[VX], pull_toward_camera.mV[VY], pull_toward_camera.mV[VZ]); // Include +1 because vertices are fenceposts. @@ -990,7 +990,7 @@ S32 LLViewerParcelOverlay::renderPropertyLines () } - glPopMatrix(); + gGL.popMatrix(); return drawn; } diff --git a/indra/newview/llviewerprecompiledheaders.h b/indra/newview/llviewerprecompiledheaders.h index 12f6a0dd1c..f738b84bb9 100644 --- a/indra/newview/llviewerprecompiledheaders.h +++ b/indra/newview/llviewerprecompiledheaders.h @@ -124,4 +124,7 @@ // Library includes from llmessage project #include "llcachename.h" +// Library includes from llxuixml +#include "llinitparam.h" + #endif diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp index 36106752a2..bddc07b395 100644 --- a/indra/newview/llviewershadermgr.cpp +++ b/indra/newview/llviewershadermgr.cpp @@ -32,6 +32,7 @@ #include "llfile.h" #include "llviewerwindow.h" +#include "llwindow.h" #include "llviewercontrol.h" #include "pipeline.h" #include "llworld.h" @@ -58,6 +59,7 @@ using std::make_pair; using std::string; BOOL LLViewerShaderMgr::sInitialized = FALSE; +bool LLViewerShaderMgr::sSkipReload = false; LLVector4 gShinyOrigin; @@ -65,15 +67,23 @@ LLVector4 gShinyOrigin; LLGLSLShader gOcclusionProgram; LLGLSLShader gCustomAlphaProgram; LLGLSLShader gGlowCombineProgram; +LLGLSLShader gSplatTextureRectProgram; +LLGLSLShader gGlowCombineFXAAProgram; LLGLSLShader gTwoTextureAddProgram; +LLGLSLShader gOneTextureNoColorProgram; +LLGLSLShader gDebugProgram; +LLGLSLShader gAlphaMaskProgram; //object shaders LLGLSLShader gObjectSimpleProgram; +LLGLSLShader gObjectPreviewProgram; LLGLSLShader gObjectSimpleWaterProgram; LLGLSLShader gObjectSimpleAlphaMaskProgram; LLGLSLShader gObjectSimpleWaterAlphaMaskProgram; LLGLSLShader gObjectFullbrightProgram; LLGLSLShader gObjectFullbrightWaterProgram; +LLGLSLShader gObjectEmissiveProgram; +LLGLSLShader gObjectEmissiveWaterProgram; LLGLSLShader gObjectFullbrightAlphaMaskProgram; LLGLSLShader gObjectFullbrightWaterAlphaMaskProgram; LLGLSLShader gObjectFullbrightShinyProgram; @@ -81,13 +91,23 @@ LLGLSLShader gObjectFullbrightShinyWaterProgram; LLGLSLShader gObjectShinyProgram; LLGLSLShader gObjectShinyWaterProgram; LLGLSLShader gObjectBumpProgram; +LLGLSLShader gTreeProgram; +LLGLSLShader gTreeWaterProgram; +LLGLSLShader gObjectFullbrightNoColorProgram; +LLGLSLShader gObjectFullbrightNoColorWaterProgram; LLGLSLShader gObjectSimpleNonIndexedProgram; +LLGLSLShader gObjectSimpleNonIndexedTexGenProgram; +LLGLSLShader gObjectSimpleNonIndexedTexGenWaterProgram; LLGLSLShader gObjectSimpleNonIndexedWaterProgram; LLGLSLShader gObjectAlphaMaskNonIndexedProgram; LLGLSLShader gObjectAlphaMaskNonIndexedWaterProgram; +LLGLSLShader gObjectAlphaMaskNoColorProgram; +LLGLSLShader gObjectAlphaMaskNoColorWaterProgram; LLGLSLShader gObjectFullbrightNonIndexedProgram; LLGLSLShader gObjectFullbrightNonIndexedWaterProgram; +LLGLSLShader gObjectEmissiveNonIndexedProgram; +LLGLSLShader gObjectEmissiveNonIndexedWaterProgram; LLGLSLShader gObjectFullbrightShinyNonIndexedProgram; LLGLSLShader gObjectFullbrightShinyNonIndexedWaterProgram; LLGLSLShader gObjectShinyNonIndexedProgram; @@ -96,11 +116,13 @@ LLGLSLShader gObjectShinyNonIndexedWaterProgram; //object hardware skinning shaders LLGLSLShader gSkinnedObjectSimpleProgram; LLGLSLShader gSkinnedObjectFullbrightProgram; +LLGLSLShader gSkinnedObjectEmissiveProgram; LLGLSLShader gSkinnedObjectFullbrightShinyProgram; LLGLSLShader gSkinnedObjectShinySimpleProgram; LLGLSLShader gSkinnedObjectSimpleWaterProgram; LLGLSLShader gSkinnedObjectFullbrightWaterProgram; +LLGLSLShader gSkinnedObjectEmissiveWaterProgram; LLGLSLShader gSkinnedObjectFullbrightShinyWaterProgram; LLGLSLShader gSkinnedObjectShinySimpleWaterProgram; @@ -124,6 +146,7 @@ LLGLSLShader gImpostorProgram; LLGLSLShader gWLSkyProgram; LLGLSLShader gWLCloudProgram; + // Effects Shaders LLGLSLShader gGlowProgram; LLGLSLShader gGlowExtractProgram; @@ -132,18 +155,19 @@ LLGLSLShader gPostNightVisionProgram; // Deferred rendering shaders LLGLSLShader gDeferredImpostorProgram; -LLGLSLShader gDeferredEdgeProgram; LLGLSLShader gDeferredWaterProgram; LLGLSLShader gDeferredDiffuseProgram; LLGLSLShader gDeferredDiffuseAlphaMaskProgram; LLGLSLShader gDeferredNonIndexedDiffuseProgram; LLGLSLShader gDeferredNonIndexedDiffuseAlphaMaskProgram; +LLGLSLShader gDeferredNonIndexedDiffuseAlphaMaskNoColorProgram; LLGLSLShader gDeferredSkinnedDiffuseProgram; LLGLSLShader gDeferredSkinnedBumpProgram; LLGLSLShader gDeferredSkinnedAlphaProgram; LLGLSLShader gDeferredBumpProgram; LLGLSLShader gDeferredTerrainProgram; LLGLSLShader gDeferredTreeProgram; +LLGLSLShader gDeferredTreeShadowProgram; LLGLSLShader gDeferredAvatarProgram; LLGLSLShader gDeferredAvatarAlphaProgram; LLGLSLShader gDeferredLightProgram; @@ -160,25 +184,23 @@ LLGLSLShader gDeferredAttachmentShadowProgram; LLGLSLShader gDeferredAlphaProgram; LLGLSLShader gDeferredAvatarEyesProgram; LLGLSLShader gDeferredFullbrightProgram; -LLGLSLShader gDeferredGIProgram; -LLGLSLShader gDeferredGIFinalProgram; -LLGLSLShader gDeferredPostGIProgram; +LLGLSLShader gDeferredEmissiveProgram; LLGLSLShader gDeferredPostProgram; +LLGLSLShader gDeferredCoFProgram; +LLGLSLShader gDeferredDoFCombineProgram; +LLGLSLShader gFXAAProgram; LLGLSLShader gDeferredPostNoDoFProgram; LLGLSLShader gDeferredWLSkyProgram; LLGLSLShader gDeferredWLCloudProgram; LLGLSLShader gDeferredStarProgram; -LLGLSLShader gLuminanceGatherProgram; - - -//current avatar shader parameter pointer -GLint gAvatarMatrixParam; +LLGLSLShader gNormalMapGenProgram; LLViewerShaderMgr::LLViewerShaderMgr() : mVertexShaderLevel(SHADER_COUNT, 0), mMaxAvatarShaderLevel(0) { /// Make sure WL Sky is the first program + //ONLY shaders that need WL Param management should be added here mShaderList.push_back(&gWLSkyProgram); mShaderList.push_back(&gWLCloudProgram); mShaderList.push_back(&gAvatarProgram); @@ -187,33 +209,42 @@ LLViewerShaderMgr::LLViewerShaderMgr() : mShaderList.push_back(&gWaterProgram); mShaderList.push_back(&gAvatarEyeballProgram); mShaderList.push_back(&gObjectSimpleProgram); + mShaderList.push_back(&gObjectPreviewProgram); mShaderList.push_back(&gImpostorProgram); + mShaderList.push_back(&gObjectFullbrightNoColorProgram); + mShaderList.push_back(&gObjectFullbrightNoColorWaterProgram); mShaderList.push_back(&gObjectSimpleAlphaMaskProgram); mShaderList.push_back(&gObjectBumpProgram); - mShaderList.push_back(&gUIProgram); - mShaderList.push_back(&gCustomAlphaProgram); - mShaderList.push_back(&gGlowCombineProgram); - mShaderList.push_back(&gTwoTextureAddProgram); - mShaderList.push_back(&gSolidColorProgram); - mShaderList.push_back(&gOcclusionProgram); + mShaderList.push_back(&gObjectEmissiveProgram); + mShaderList.push_back(&gObjectEmissiveWaterProgram); mShaderList.push_back(&gObjectFullbrightProgram); mShaderList.push_back(&gObjectFullbrightAlphaMaskProgram); mShaderList.push_back(&gObjectFullbrightShinyProgram); mShaderList.push_back(&gObjectFullbrightShinyWaterProgram); mShaderList.push_back(&gObjectSimpleNonIndexedProgram); + mShaderList.push_back(&gObjectSimpleNonIndexedTexGenProgram); + mShaderList.push_back(&gObjectSimpleNonIndexedTexGenWaterProgram); mShaderList.push_back(&gObjectSimpleNonIndexedWaterProgram); mShaderList.push_back(&gObjectAlphaMaskNonIndexedProgram); mShaderList.push_back(&gObjectAlphaMaskNonIndexedWaterProgram); + mShaderList.push_back(&gObjectAlphaMaskNoColorProgram); + mShaderList.push_back(&gObjectAlphaMaskNoColorWaterProgram); + mShaderList.push_back(&gTreeProgram); + mShaderList.push_back(&gTreeWaterProgram); mShaderList.push_back(&gObjectFullbrightNonIndexedProgram); mShaderList.push_back(&gObjectFullbrightNonIndexedWaterProgram); + mShaderList.push_back(&gObjectEmissiveNonIndexedProgram); + mShaderList.push_back(&gObjectEmissiveNonIndexedWaterProgram); mShaderList.push_back(&gObjectFullbrightShinyNonIndexedProgram); mShaderList.push_back(&gObjectFullbrightShinyNonIndexedWaterProgram); mShaderList.push_back(&gSkinnedObjectSimpleProgram); mShaderList.push_back(&gSkinnedObjectFullbrightProgram); + mShaderList.push_back(&gSkinnedObjectEmissiveProgram); mShaderList.push_back(&gSkinnedObjectFullbrightShinyProgram); mShaderList.push_back(&gSkinnedObjectShinySimpleProgram); mShaderList.push_back(&gSkinnedObjectSimpleWaterProgram); mShaderList.push_back(&gSkinnedObjectFullbrightWaterProgram); + mShaderList.push_back(&gSkinnedObjectEmissiveWaterProgram); mShaderList.push_back(&gSkinnedObjectFullbrightShinyWaterProgram); mShaderList.push_back(&gSkinnedObjectShinySimpleWaterProgram); mShaderList.push_back(&gTerrainProgram); @@ -227,24 +258,16 @@ LLViewerShaderMgr::LLViewerShaderMgr() : mShaderList.push_back(&gObjectShinyNonIndexedWaterProgram); mShaderList.push_back(&gUnderWaterProgram); mShaderList.push_back(&gDeferredSunProgram); - mShaderList.push_back(&gDeferredBlurLightProgram); mShaderList.push_back(&gDeferredSoftenProgram); - mShaderList.push_back(&gDeferredLightProgram); - mShaderList.push_back(&gDeferredMultiLightProgram); mShaderList.push_back(&gDeferredAlphaProgram); mShaderList.push_back(&gDeferredSkinnedAlphaProgram); mShaderList.push_back(&gDeferredFullbrightProgram); + mShaderList.push_back(&gDeferredEmissiveProgram); mShaderList.push_back(&gDeferredAvatarEyesProgram); - mShaderList.push_back(&gDeferredPostGIProgram); - mShaderList.push_back(&gDeferredEdgeProgram); - mShaderList.push_back(&gDeferredPostProgram); - mShaderList.push_back(&gDeferredGIProgram); - mShaderList.push_back(&gDeferredGIFinalProgram); mShaderList.push_back(&gDeferredWaterProgram); mShaderList.push_back(&gDeferredAvatarAlphaProgram); mShaderList.push_back(&gDeferredWLSkyProgram); mShaderList.push_back(&gDeferredWLCloudProgram); - mShaderList.push_back(&gDeferredStarProgram); } LLViewerShaderMgr::~LLViewerShaderMgr() @@ -268,80 +291,13 @@ void LLViewerShaderMgr::initAttribsAndUniforms(void) { if (mReservedAttribs.empty()) { - mReservedAttribs.push_back("materialColor"); - mReservedAttribs.push_back("specularColor"); - mReservedAttribs.push_back("binormal"); - mReservedAttribs.push_back("object_weight"); - - mAvatarAttribs.reserve(5); - mAvatarAttribs.push_back("weight"); - mAvatarAttribs.push_back("clothing"); - mAvatarAttribs.push_back("gWindDir"); - mAvatarAttribs.push_back("gSinWaveParams"); - mAvatarAttribs.push_back("gGravity"); + LLShaderMgr::initAttribsAndUniforms(); mAvatarUniforms.push_back("matrixPalette"); + mAvatarUniforms.push_back("gWindDir"); + mAvatarUniforms.push_back("gSinWaveParams"); + mAvatarUniforms.push_back("gGravity"); - mReservedUniforms.reserve(24); - mReservedUniforms.push_back("diffuseMap"); - mReservedUniforms.push_back("specularMap"); - mReservedUniforms.push_back("bumpMap"); - mReservedUniforms.push_back("environmentMap"); - mReservedUniforms.push_back("cloude_noise_texture"); - mReservedUniforms.push_back("fullbright"); - mReservedUniforms.push_back("lightnorm"); - mReservedUniforms.push_back("sunlight_color"); - mReservedUniforms.push_back("ambient"); - mReservedUniforms.push_back("blue_horizon"); - mReservedUniforms.push_back("blue_density"); - mReservedUniforms.push_back("haze_horizon"); - mReservedUniforms.push_back("haze_density"); - mReservedUniforms.push_back("cloud_shadow"); - mReservedUniforms.push_back("density_multiplier"); - mReservedUniforms.push_back("distance_multiplier"); - mReservedUniforms.push_back("max_y"); - mReservedUniforms.push_back("glow"); - mReservedUniforms.push_back("cloud_color"); - mReservedUniforms.push_back("cloud_pos_density1"); - mReservedUniforms.push_back("cloud_pos_density2"); - mReservedUniforms.push_back("cloud_scale"); - mReservedUniforms.push_back("gamma"); - mReservedUniforms.push_back("scene_light_strength"); - - mReservedUniforms.push_back("depthMap"); - mReservedUniforms.push_back("shadowMap0"); - mReservedUniforms.push_back("shadowMap1"); - mReservedUniforms.push_back("shadowMap2"); - mReservedUniforms.push_back("shadowMap3"); - mReservedUniforms.push_back("shadowMap4"); - mReservedUniforms.push_back("shadowMap5"); - - mReservedUniforms.push_back("normalMap"); - mReservedUniforms.push_back("positionMap"); - mReservedUniforms.push_back("diffuseRect"); - mReservedUniforms.push_back("specularRect"); - mReservedUniforms.push_back("noiseMap"); - mReservedUniforms.push_back("lightFunc"); - mReservedUniforms.push_back("lightMap"); - mReservedUniforms.push_back("luminanceMap"); - mReservedUniforms.push_back("giLightMap"); - mReservedUniforms.push_back("giMip"); - mReservedUniforms.push_back("edgeMap"); - mReservedUniforms.push_back("bloomMap"); - mReservedUniforms.push_back("sunLightMap"); - mReservedUniforms.push_back("localLightMap"); - mReservedUniforms.push_back("projectionMap"); - mReservedUniforms.push_back("diffuseGIMap"); - mReservedUniforms.push_back("specularGIMap"); - mReservedUniforms.push_back("normalGIMap"); - mReservedUniforms.push_back("minpGIMap"); - mReservedUniforms.push_back("maxpGIMap"); - mReservedUniforms.push_back("depthGIMap"); - mReservedUniforms.push_back("lastDiffuseGIMap"); - mReservedUniforms.push_back("lastNormalGIMap"); - mReservedUniforms.push_back("lastMinpGIMap"); - mReservedUniforms.push_back("lastMaxpGIMap"); - mWLUniforms.push_back("camPosLocal"); mTerrainUniforms.reserve(5); @@ -397,17 +353,29 @@ void LLViewerShaderMgr::setShaders() //setShaders might be called redundantly by gSavedSettings, so return on reentrance static bool reentrance = false; - if (!gPipeline.mInitialized || !sInitialized || reentrance) + if (!gPipeline.mInitialized || !sInitialized || reentrance || sSkipReload) { return; } - //setup preprocessor definitions - LLShaderMgr::instance()->mDefinitions["samples"] = llformat("%d", gGLManager.getNumFBOFSAASamples(gSavedSettings.getU32("RenderFSAASamples"))); - LLShaderMgr::instance()->mDefinitions["NUM_TEX_UNITS"] = llformat("%d", gGLManager.mNumTextureImageUnits); + LLGLSLShader::sIndexedTextureChannels = llmax(llmin(gGLManager.mNumTextureImageUnits, (S32) gSavedSettings.getU32("RenderMaxTextureIndex")), 1); + + //NEVER use more than 16 texture channels (work around for prevalent driver bug) + LLGLSLShader::sIndexedTextureChannels = llmin(LLGLSLShader::sIndexedTextureChannels, 16); reentrance = true; + if (LLRender::sGLCoreProfile) + { + if (!gSavedSettings.getBOOL("VertexShaderEnable")) + { //vertex shaders MUST be enabled to use core profile + gSavedSettings.setBOOL("VertexShaderEnable", TRUE); + } + } + + //setup preprocessor definitions + LLShaderMgr::instance()->mDefinitions["NUM_TEX_UNITS"] = llformat("%d", gGLManager.mNumTextureImageUnits); + // Make sure the compiled shader map is cleared before we recompile shaders. mShaderObjects.clear(); @@ -446,6 +414,7 @@ void LLViewerShaderMgr::setShaders() mMaxAvatarShaderLevel = 0; LLGLSLShader::sNoFixedFunction = false; + LLVertexBuffer::unbind(); if (LLFeatureManager::getInstance()->isFeatureAvailable("VertexShaderEnable") && gSavedSettings.getBOOL("VertexShaderEnable")) { @@ -466,15 +435,8 @@ void LLViewerShaderMgr::setShaders() gSavedSettings.getBOOL("WindLightUseAtmosShaders")) { if (gSavedSettings.getS32("RenderShadowDetail") > 0) - { - if (gSavedSettings.getBOOL("RenderDeferredGI")) - { //shadows + gi - deferred_class = 3; - } - else - { //shadows - deferred_class = 2; - } + { //shadows + deferred_class = 2; } else { //no shadows @@ -497,11 +459,7 @@ void LLViewerShaderMgr::setShaders() wl_class = 1; } - if(!gSavedSettings.getBOOL("EnableRippleWater")) - { - water_class = 0; - } - + // Trigger a full rebuild of the fallback skybox / cubemap if we've toggled windlight shaders if (mVertexShaderLevel[SHADER_WINDLIGHT] != wl_class && gSky.mVOSkyp.notNull()) { @@ -633,13 +591,21 @@ void LLViewerShaderMgr::setShaders() void LLViewerShaderMgr::unloadShaders() { gOcclusionProgram.unload(); + gDebugProgram.unload(); + gAlphaMaskProgram.unload(); gUIProgram.unload(); gCustomAlphaProgram.unload(); gGlowCombineProgram.unload(); + gSplatTextureRectProgram.unload(); + gGlowCombineFXAAProgram.unload(); gTwoTextureAddProgram.unload(); + gOneTextureNoColorProgram.unload(); gSolidColorProgram.unload(); + gObjectFullbrightNoColorProgram.unload(); + gObjectFullbrightNoColorWaterProgram.unload(); gObjectSimpleProgram.unload(); + gObjectPreviewProgram.unload(); gImpostorProgram.unload(); gObjectSimpleAlphaMaskProgram.unload(); gObjectBumpProgram.unload(); @@ -647,6 +613,8 @@ void LLViewerShaderMgr::unloadShaders() gObjectSimpleWaterAlphaMaskProgram.unload(); gObjectFullbrightProgram.unload(); gObjectFullbrightWaterProgram.unload(); + gObjectEmissiveProgram.unload(); + gObjectEmissiveWaterProgram.unload(); gObjectFullbrightAlphaMaskProgram.unload(); gObjectFullbrightWaterAlphaMaskProgram.unload(); @@ -656,11 +624,19 @@ void LLViewerShaderMgr::unloadShaders() gObjectShinyWaterProgram.unload(); gObjectSimpleNonIndexedProgram.unload(); + gObjectSimpleNonIndexedTexGenProgram.unload(); + gObjectSimpleNonIndexedTexGenWaterProgram.unload(); gObjectSimpleNonIndexedWaterProgram.unload(); gObjectAlphaMaskNonIndexedProgram.unload(); gObjectAlphaMaskNonIndexedWaterProgram.unload(); + gObjectAlphaMaskNoColorProgram.unload(); + gObjectAlphaMaskNoColorWaterProgram.unload(); gObjectFullbrightNonIndexedProgram.unload(); gObjectFullbrightNonIndexedWaterProgram.unload(); + gObjectEmissiveNonIndexedProgram.unload(); + gObjectEmissiveNonIndexedWaterProgram.unload(); + gTreeProgram.unload(); + gTreeWaterProgram.unload(); gObjectShinyNonIndexedProgram.unload(); gObjectFullbrightShinyNonIndexedProgram.unload(); @@ -669,11 +645,13 @@ void LLViewerShaderMgr::unloadShaders() gSkinnedObjectSimpleProgram.unload(); gSkinnedObjectFullbrightProgram.unload(); + gSkinnedObjectEmissiveProgram.unload(); gSkinnedObjectFullbrightShinyProgram.unload(); gSkinnedObjectShinySimpleProgram.unload(); gSkinnedObjectSimpleWaterProgram.unload(); gSkinnedObjectFullbrightWaterProgram.unload(); + gSkinnedObjectEmissiveWaterProgram.unload(); gSkinnedObjectFullbrightShinyWaterProgram.unload(); gSkinnedObjectShinySimpleWaterProgram.unload(); @@ -699,6 +677,7 @@ void LLViewerShaderMgr::unloadShaders() gDeferredDiffuseProgram.unload(); gDeferredDiffuseAlphaMaskProgram.unload(); gDeferredNonIndexedDiffuseAlphaMaskProgram.unload(); + gDeferredNonIndexedDiffuseAlphaMaskNoColorProgram.unload(); gDeferredNonIndexedDiffuseProgram.unload(); gDeferredSkinnedDiffuseProgram.unload(); gDeferredSkinnedBumpProgram.unload(); @@ -750,8 +729,8 @@ BOOL LLViewerShaderMgr::loadBasicShaders() // (in order of shader function call depth for reference purposes, deepest level first) vector< pair<string, S32> > shaders; - shaders.reserve(10); shaders.push_back( make_pair( "windlight/atmosphericsVarsV.glsl", mVertexShaderLevel[SHADER_WINDLIGHT] ) ); + shaders.push_back( make_pair( "windlight/atmosphericsVarsWaterV.glsl", mVertexShaderLevel[SHADER_WINDLIGHT] ) ); shaders.push_back( make_pair( "windlight/atmosphericsHelpersV.glsl", mVertexShaderLevel[SHADER_WINDLIGHT] ) ); shaders.push_back( make_pair( "lighting/lightFuncV.glsl", mVertexShaderLevel[SHADER_LIGHTING] ) ); shaders.push_back( make_pair( "lighting/sumLightsV.glsl", sum_lights_class ) ); @@ -762,6 +741,8 @@ BOOL LLViewerShaderMgr::loadBasicShaders() shaders.push_back( make_pair( "windlight/atmosphericsV.glsl", mVertexShaderLevel[SHADER_WINDLIGHT] ) ); shaders.push_back( make_pair( "avatar/avatarSkinV.glsl", 1 ) ); shaders.push_back( make_pair( "avatar/objectSkinV.glsl", 1 ) ); + shaders.push_back( make_pair( "objects/indexedTextureV.glsl", 1 ) ); + shaders.push_back( make_pair( "objects/nonindexedTextureV.glsl", 1 ) ); // We no longer have to bind the shaders to global glhandles, they are automatically added to a map now. for (U32 i = 0; i < shaders.size(); i++) @@ -777,8 +758,7 @@ BOOL LLViewerShaderMgr::loadBasicShaders() // (in order of shader function call depth for reference purposes, deepest level first) shaders.clear(); - shaders.reserve(13); - S32 ch = gGLManager.mNumTextureImageUnits-1; + S32 ch = llmax(LLGLSLShader::sIndexedTextureChannels-1, 1); if (gGLManager.mGLVersion < 3.1f) { //force to 1 texture index channel for old drivers @@ -787,6 +767,7 @@ BOOL LLViewerShaderMgr::loadBasicShaders() std::vector<S32> index_channels; index_channels.push_back(-1); shaders.push_back( make_pair( "windlight/atmosphericsVarsF.glsl", mVertexShaderLevel[SHADER_WINDLIGHT] ) ); + index_channels.push_back(-1); shaders.push_back( make_pair( "windlight/atmosphericsVarsWaterF.glsl", mVertexShaderLevel[SHADER_WINDLIGHT] ) ); index_channels.push_back(-1); shaders.push_back( make_pair( "windlight/gammaF.glsl", mVertexShaderLevel[SHADER_WINDLIGHT]) ); index_channels.push_back(-1); shaders.push_back( make_pair( "windlight/atmosphericsF.glsl", mVertexShaderLevel[SHADER_WINDLIGHT] ) ); index_channels.push_back(-1); shaders.push_back( make_pair( "windlight/transportF.glsl", mVertexShaderLevel[SHADER_WINDLIGHT] ) ); @@ -844,6 +825,8 @@ BOOL LLViewerShaderMgr::loadShadersEnvironment() gTerrainProgram.mFeatures.calculatesLighting = true; gTerrainProgram.mFeatures.calculatesAtmospherics = true; gTerrainProgram.mFeatures.hasAtmospherics = true; + gTerrainProgram.mFeatures.mIndexedTextureChannels = 0; + gTerrainProgram.mFeatures.disableTextureIndex = true; gTerrainProgram.mFeatures.hasGamma = true; gTerrainProgram.mShaderFiles.clear(); gTerrainProgram.mShaderFiles.push_back(make_pair("environment/terrainV.glsl", GL_VERTEX_SHADER_ARB)); @@ -912,6 +895,8 @@ BOOL LLViewerShaderMgr::loadShadersWater() gTerrainWaterProgram.mFeatures.calculatesAtmospherics = true; gTerrainWaterProgram.mFeatures.hasAtmospherics = true; gTerrainWaterProgram.mFeatures.hasWaterFog = true; + gTerrainWaterProgram.mFeatures.mIndexedTextureChannels = 0; + gTerrainWaterProgram.mFeatures.disableTextureIndex = true; gTerrainWaterProgram.mShaderFiles.clear(); gTerrainWaterProgram.mShaderFiles.push_back(make_pair("environment/terrainV.glsl", GL_VERTEX_SHADER_ARB)); gTerrainWaterProgram.mShaderFiles.push_back(make_pair("environment/terrainWaterF.glsl", GL_FRAGMENT_SHADER_ARB)); @@ -950,9 +935,6 @@ BOOL LLViewerShaderMgr::loadShadersEffects() { BOOL success = TRUE; - U32 samples = gGLManager.getNumFBOFSAASamples(gSavedSettings.getU32("RenderFSAASamples")); - bool multisample = samples > 1 && LLPipeline::sRenderDeferred && gGLManager.mHasTextureMultisample; - if (mVertexShaderLevel[SHADER_EFFECT] == 0) { gGlowProgram.unload(); @@ -978,21 +960,10 @@ BOOL LLViewerShaderMgr::loadShadersEffects() if (success) { - std::string fragment; - - if (multisample) - { - fragment = "effects/glowExtractMSF.glsl"; - } - else - { - fragment = "effects/glowExtractF.glsl"; - } - gGlowExtractProgram.mName = "Glow Extract Shader (Post)"; gGlowExtractProgram.mShaderFiles.clear(); gGlowExtractProgram.mShaderFiles.push_back(make_pair("effects/glowExtractV.glsl", GL_VERTEX_SHADER_ARB)); - gGlowExtractProgram.mShaderFiles.push_back(make_pair(fragment, GL_FRAGMENT_SHADER_ARB)); + gGlowExtractProgram.mShaderFiles.push_back(make_pair("effects/glowExtractF.glsl", GL_FRAGMENT_SHADER_ARB)); gGlowExtractProgram.mShaderLevel = mVertexShaderLevel[SHADER_EFFECT]; success = gGlowExtractProgram.createShader(NULL, &mGlowExtractUniforms); if (!success) @@ -1001,51 +972,6 @@ BOOL LLViewerShaderMgr::loadShadersEffects() } } -#if 0 - // disabling loading of postprocess shaders until we fix - // ATI sampler2DRect compatibility. - - //load Color Filter Shader - if (success) - { - vector<string> shaderUniforms; - shaderUniforms.reserve(7); - shaderUniforms.push_back("RenderTexture"); - shaderUniforms.push_back("gamma"); - shaderUniforms.push_back("brightness"); - shaderUniforms.push_back("contrast"); - shaderUniforms.push_back("contrastBase"); - shaderUniforms.push_back("saturation"); - shaderUniforms.push_back("lumWeights"); - - gPostColorFilterProgram.mName = "Color Filter Shader (Post)"; - gPostColorFilterProgram.mShaderFiles.clear(); - gPostColorFilterProgram.mShaderFiles.push_back(make_pair("effects/colorFilterF.glsl", GL_FRAGMENT_SHADER_ARB)); - gPostColorFilterProgram.mShaderFiles.push_back(make_pair("effects/drawQuadV.glsl", GL_VERTEX_SHADER_ARB)); - gPostColorFilterProgram.mShaderLevel = mVertexShaderLevel[SHADER_EFFECT]; - success = gPostColorFilterProgram.createShader(NULL, &shaderUniforms); - } - - //load Night Vision Shader - if (success) - { - vector<string> shaderUniforms; - shaderUniforms.reserve(5); - shaderUniforms.push_back("RenderTexture"); - shaderUniforms.push_back("NoiseTexture"); - shaderUniforms.push_back("brightMult"); - shaderUniforms.push_back("noiseStrength"); - shaderUniforms.push_back("lumWeights"); - - gPostNightVisionProgram.mName = "Night Vision Shader (Post)"; - gPostNightVisionProgram.mShaderFiles.clear(); - gPostNightVisionProgram.mShaderFiles.push_back(make_pair("effects/nightVisionF.glsl", GL_FRAGMENT_SHADER_ARB)); - gPostNightVisionProgram.mShaderFiles.push_back(make_pair("effects/drawQuadV.glsl", GL_VERTEX_SHADER_ARB)); - gPostNightVisionProgram.mShaderLevel = mVertexShaderLevel[SHADER_EFFECT]; - success = gPostNightVisionProgram.createShader(NULL, &shaderUniforms); - } - #endif - return success; } @@ -1055,9 +981,11 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() if (mVertexShaderLevel[SHADER_DEFERRED] == 0) { gDeferredTreeProgram.unload(); + gDeferredTreeShadowProgram.unload(); gDeferredDiffuseProgram.unload(); gDeferredDiffuseAlphaMaskProgram.unload(); gDeferredNonIndexedDiffuseAlphaMaskProgram.unload(); + gDeferredNonIndexedDiffuseAlphaMaskNoColorProgram.unload(); gDeferredNonIndexedDiffuseProgram.unload(); gDeferredSkinnedDiffuseProgram.unload(); gDeferredSkinnedBumpProgram.unload(); @@ -1080,34 +1008,29 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredAvatarAlphaProgram.unload(); gDeferredAlphaProgram.unload(); gDeferredFullbrightProgram.unload(); + gDeferredEmissiveProgram.unload(); gDeferredAvatarEyesProgram.unload(); - gDeferredPostGIProgram.unload(); - gDeferredEdgeProgram.unload(); gDeferredPostProgram.unload(); - gLuminanceGatherProgram.unload(); - gDeferredGIProgram.unload(); - gDeferredGIFinalProgram.unload(); + gDeferredCoFProgram.unload(); + gDeferredDoFCombineProgram.unload(); + gFXAAProgram.unload(); gDeferredWaterProgram.unload(); gDeferredWLSkyProgram.unload(); gDeferredWLCloudProgram.unload(); gDeferredStarProgram.unload(); + gNormalMapGenProgram.unload(); return TRUE; } - mVertexShaderLevel[SHADER_AVATAR] = 1; - BOOL success = TRUE; - U32 samples = gGLManager.getNumFBOFSAASamples(gSavedSettings.getU32("RenderFSAASamples")); - bool multisample = samples > 1 && gGLManager.mHasTextureMultisample; - if (success) { gDeferredDiffuseProgram.mName = "Deferred Diffuse Shader"; gDeferredDiffuseProgram.mShaderFiles.clear(); gDeferredDiffuseProgram.mShaderFiles.push_back(make_pair("deferred/diffuseV.glsl", GL_VERTEX_SHADER_ARB)); gDeferredDiffuseProgram.mShaderFiles.push_back(make_pair("deferred/diffuseIndexedF.glsl", GL_FRAGMENT_SHADER_ARB)); - gDeferredDiffuseProgram.mFeatures.mIndexedTextureChannels = gGLManager.mNumTextureImageUnits; + gDeferredDiffuseProgram.mFeatures.mIndexedTextureChannels = LLGLSLShader::sIndexedTextureChannels; gDeferredDiffuseProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; success = gDeferredDiffuseProgram.createShader(NULL, NULL); } @@ -1118,7 +1041,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredDiffuseAlphaMaskProgram.mShaderFiles.clear(); gDeferredDiffuseAlphaMaskProgram.mShaderFiles.push_back(make_pair("deferred/diffuseV.glsl", GL_VERTEX_SHADER_ARB)); gDeferredDiffuseAlphaMaskProgram.mShaderFiles.push_back(make_pair("deferred/diffuseAlphaMaskIndexedF.glsl", GL_FRAGMENT_SHADER_ARB)); - gDeferredDiffuseAlphaMaskProgram.mFeatures.mIndexedTextureChannels = gGLManager.mNumTextureImageUnits; + gDeferredDiffuseAlphaMaskProgram.mFeatures.mIndexedTextureChannels = LLGLSLShader::sIndexedTextureChannels; gDeferredDiffuseAlphaMaskProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; success = gDeferredDiffuseAlphaMaskProgram.createShader(NULL, NULL); } @@ -1132,6 +1055,16 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredNonIndexedDiffuseAlphaMaskProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; success = gDeferredNonIndexedDiffuseAlphaMaskProgram.createShader(NULL, NULL); } + + if (success) + { + gDeferredNonIndexedDiffuseAlphaMaskNoColorProgram.mName = "Deferred Diffuse Non-Indexed Alpha Mask Shader"; + gDeferredNonIndexedDiffuseAlphaMaskNoColorProgram.mShaderFiles.clear(); + gDeferredNonIndexedDiffuseAlphaMaskNoColorProgram.mShaderFiles.push_back(make_pair("deferred/diffuseNoColorV.glsl", GL_VERTEX_SHADER_ARB)); + gDeferredNonIndexedDiffuseAlphaMaskNoColorProgram.mShaderFiles.push_back(make_pair("deferred/diffuseAlphaMaskNoColorF.glsl", GL_FRAGMENT_SHADER_ARB)); + gDeferredNonIndexedDiffuseAlphaMaskNoColorProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; + success = gDeferredNonIndexedDiffuseAlphaMaskNoColorProgram.createShader(NULL, NULL); + } if (success) { @@ -1205,6 +1138,16 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() if (success) { + gDeferredTreeShadowProgram.mName = "Deferred Tree Shadow Shader"; + gDeferredTreeShadowProgram.mShaderFiles.clear(); + gDeferredTreeShadowProgram.mShaderFiles.push_back(make_pair("deferred/treeShadowV.glsl", GL_VERTEX_SHADER_ARB)); + gDeferredTreeShadowProgram.mShaderFiles.push_back(make_pair("deferred/treeShadowF.glsl", GL_FRAGMENT_SHADER_ARB)); + gDeferredTreeShadowProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; + success = gDeferredTreeShadowProgram.createShader(NULL, NULL); + } + + if (success) + { gDeferredImpostorProgram.mName = "Deferred Impostor Shader"; gDeferredImpostorProgram.mShaderFiles.clear(); gDeferredImpostorProgram.mShaderFiles.push_back(make_pair("deferred/impostorV.glsl", GL_VERTEX_SHADER_ARB)); @@ -1214,84 +1157,41 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() } if (success) - { - std::string fragment; - - if (multisample) - { - fragment = "deferred/pointLightMSF.glsl"; - } - else - { - fragment = "deferred/pointLightF.glsl"; - } - + { gDeferredLightProgram.mName = "Deferred Light Shader"; gDeferredLightProgram.mShaderFiles.clear(); gDeferredLightProgram.mShaderFiles.push_back(make_pair("deferred/pointLightV.glsl", GL_VERTEX_SHADER_ARB)); - gDeferredLightProgram.mShaderFiles.push_back(make_pair(fragment, GL_FRAGMENT_SHADER_ARB)); + gDeferredLightProgram.mShaderFiles.push_back(make_pair("deferred/pointLightF.glsl", GL_FRAGMENT_SHADER_ARB)); gDeferredLightProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; success = gDeferredLightProgram.createShader(NULL, NULL); } if (success) { - std::string fragment; - if (multisample) - { - fragment = "deferred/multiPointLightMSF.glsl"; - } - else - { - fragment = "deferred/multiPointLightF.glsl"; - } - gDeferredMultiLightProgram.mName = "Deferred MultiLight Shader"; gDeferredMultiLightProgram.mShaderFiles.clear(); gDeferredMultiLightProgram.mShaderFiles.push_back(make_pair("deferred/multiPointLightV.glsl", GL_VERTEX_SHADER_ARB)); - gDeferredMultiLightProgram.mShaderFiles.push_back(make_pair(fragment, GL_FRAGMENT_SHADER_ARB)); + gDeferredMultiLightProgram.mShaderFiles.push_back(make_pair("deferred/multiPointLightF.glsl", GL_FRAGMENT_SHADER_ARB)); gDeferredMultiLightProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; success = gDeferredMultiLightProgram.createShader(NULL, NULL); } if (success) { - std::string fragment; - - if (multisample) - { - fragment = "deferred/spotLightMSF.glsl"; - } - else - { - fragment = "deferred/multiSpotLightF.glsl"; - } - gDeferredSpotLightProgram.mName = "Deferred SpotLight Shader"; gDeferredSpotLightProgram.mShaderFiles.clear(); gDeferredSpotLightProgram.mShaderFiles.push_back(make_pair("deferred/pointLightV.glsl", GL_VERTEX_SHADER_ARB)); - gDeferredSpotLightProgram.mShaderFiles.push_back(make_pair(fragment, GL_FRAGMENT_SHADER_ARB)); + gDeferredSpotLightProgram.mShaderFiles.push_back(make_pair("deferred/multiSpotLightF.glsl", GL_FRAGMENT_SHADER_ARB)); gDeferredSpotLightProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; success = gDeferredSpotLightProgram.createShader(NULL, NULL); } if (success) { - std::string fragment; - - if (multisample) - { - fragment = "deferred/multiSpotLightMSF.glsl"; - } - else - { - fragment = "deferred/multiSpotLightF.glsl"; - } - gDeferredMultiSpotLightProgram.mName = "Deferred MultiSpotLight Shader"; gDeferredMultiSpotLightProgram.mShaderFiles.clear(); gDeferredMultiSpotLightProgram.mShaderFiles.push_back(make_pair("deferred/pointLightV.glsl", GL_VERTEX_SHADER_ARB)); - gDeferredMultiSpotLightProgram.mShaderFiles.push_back(make_pair(fragment, GL_FRAGMENT_SHADER_ARB)); + gDeferredMultiSpotLightProgram.mShaderFiles.push_back(make_pair("deferred/multiSpotLightF.glsl", GL_FRAGMENT_SHADER_ARB)); gDeferredMultiSpotLightProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; success = gDeferredMultiSpotLightProgram.createShader(NULL, NULL); } @@ -1302,25 +1202,11 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() if (gSavedSettings.getBOOL("RenderDeferredSSAO")) { - if (multisample) - { - fragment = "deferred/sunLightSSAOMSF.glsl"; - } - else - { - fragment = "deferred/sunLightSSAOF.glsl"; - } + fragment = "deferred/sunLightSSAOF.glsl"; } else { - if (multisample) - { - fragment = "deferred/sunLightMSF.glsl"; - } - else - { - fragment = "deferred/sunLightF.glsl"; - } + fragment = "deferred/sunLightF.glsl"; } gDeferredSunProgram.mName = "Deferred Sun Shader"; @@ -1333,21 +1219,10 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() if (success) { - std::string fragment; - - if (multisample) - { - fragment = "deferred/blurLightMSF.glsl"; - } - else - { - fragment = "deferred/blurLightF.glsl"; - } - gDeferredBlurLightProgram.mName = "Deferred Blur Light Shader"; gDeferredBlurLightProgram.mShaderFiles.clear(); gDeferredBlurLightProgram.mShaderFiles.push_back(make_pair("deferred/blurLightV.glsl", GL_VERTEX_SHADER_ARB)); - gDeferredBlurLightProgram.mShaderFiles.push_back(make_pair(fragment, GL_FRAGMENT_SHADER_ARB)); + gDeferredBlurLightProgram.mShaderFiles.push_back(make_pair("deferred/blurLightF.glsl", GL_FRAGMENT_SHADER_ARB)); gDeferredBlurLightProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; success = gDeferredBlurLightProgram.createShader(NULL, NULL); } @@ -1363,11 +1238,11 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredAlphaProgram.mFeatures.disableTextureIndex = true; //hack to disable auto-setup of texture channels if (mVertexShaderLevel[SHADER_DEFERRED] < 1) { - gDeferredAlphaProgram.mFeatures.mIndexedTextureChannels = gGLManager.mNumTextureImageUnits; + gDeferredAlphaProgram.mFeatures.mIndexedTextureChannels = LLGLSLShader::sIndexedTextureChannels; } else { //shave off some texture units for shadow maps - gDeferredAlphaProgram.mFeatures.mIndexedTextureChannels = gGLManager.mNumTextureImageUnits - 6; + gDeferredAlphaProgram.mFeatures.mIndexedTextureChannels = llmax(LLGLSLShader::sIndexedTextureChannels - 6, 1); } gDeferredAlphaProgram.mShaderFiles.clear(); @@ -1397,7 +1272,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredFullbrightProgram.mFeatures.calculatesAtmospherics = true; gDeferredFullbrightProgram.mFeatures.hasGamma = true; gDeferredFullbrightProgram.mFeatures.hasTransport = true; - gDeferredFullbrightProgram.mFeatures.mIndexedTextureChannels = gGLManager.mNumTextureImageUnits; + gDeferredFullbrightProgram.mFeatures.mIndexedTextureChannels = LLGLSLShader::sIndexedTextureChannels; gDeferredFullbrightProgram.mShaderFiles.clear(); gDeferredFullbrightProgram.mShaderFiles.push_back(make_pair("deferred/fullbrightV.glsl", GL_VERTEX_SHADER_ARB)); gDeferredFullbrightProgram.mShaderFiles.push_back(make_pair("deferred/fullbrightF.glsl", GL_FRAGMENT_SHADER_ARB)); @@ -1407,6 +1282,20 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() if (success) { + gDeferredEmissiveProgram.mName = "Deferred Emissive Shader"; + gDeferredEmissiveProgram.mFeatures.calculatesAtmospherics = true; + gDeferredEmissiveProgram.mFeatures.hasGamma = true; + gDeferredEmissiveProgram.mFeatures.hasTransport = true; + gDeferredEmissiveProgram.mFeatures.mIndexedTextureChannels = LLGLSLShader::sIndexedTextureChannels; + gDeferredEmissiveProgram.mShaderFiles.clear(); + gDeferredEmissiveProgram.mShaderFiles.push_back(make_pair("deferred/emissiveV.glsl", GL_VERTEX_SHADER_ARB)); + gDeferredEmissiveProgram.mShaderFiles.push_back(make_pair("deferred/emissiveF.glsl", GL_FRAGMENT_SHADER_ARB)); + gDeferredEmissiveProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; + success = gDeferredEmissiveProgram.createShader(NULL, NULL); + } + + if (success) + { // load water shader gDeferredWaterProgram.mName = "Deferred Water Shader"; gDeferredWaterProgram.mFeatures.calculatesAtmospherics = true; @@ -1421,21 +1310,10 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() if (success) { - std::string fragment; - - if (multisample) - { - fragment = "deferred/softenLightMSF.glsl"; - } - else - { - fragment = "deferred/softenLightF.glsl"; - } - gDeferredSoftenProgram.mName = "Deferred Soften Shader"; gDeferredSoftenProgram.mShaderFiles.clear(); gDeferredSoftenProgram.mShaderFiles.push_back(make_pair("deferred/softenLightV.glsl", GL_VERTEX_SHADER_ARB)); - gDeferredSoftenProgram.mShaderFiles.push_back(make_pair(fragment, GL_FRAGMENT_SHADER_ARB)); + gDeferredSoftenProgram.mShaderFiles.push_back(make_pair("deferred/softenLightF.glsl", GL_FRAGMENT_SHADER_ARB)); gDeferredSoftenProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; @@ -1460,6 +1338,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() if (success) { gDeferredShadowAlphaMaskProgram.mName = "Deferred Shadow Alpha Mask Shader"; + gDeferredShadowAlphaMaskProgram.mFeatures.mIndexedTextureChannels = LLGLSLShader::sIndexedTextureChannels; gDeferredShadowAlphaMaskProgram.mShaderFiles.clear(); gDeferredShadowAlphaMaskProgram.mShaderFiles.push_back(make_pair("deferred/shadowAlphaMaskV.glsl", GL_VERTEX_SHADER_ARB)); gDeferredShadowAlphaMaskProgram.mShaderFiles.push_back(make_pair("deferred/shadowAlphaMaskF.glsl", GL_FRAGMENT_SHADER_ARB)); @@ -1475,7 +1354,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredAvatarShadowProgram.mShaderFiles.push_back(make_pair("deferred/avatarShadowV.glsl", GL_VERTEX_SHADER_ARB)); gDeferredAvatarShadowProgram.mShaderFiles.push_back(make_pair("deferred/avatarShadowF.glsl", GL_FRAGMENT_SHADER_ARB)); gDeferredAvatarShadowProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; - success = gDeferredAvatarShadowProgram.createShader(&mAvatarAttribs, &mAvatarUniforms); + success = gDeferredAvatarShadowProgram.createShader(NULL, &mAvatarUniforms); } if (success) @@ -1507,7 +1386,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredAvatarProgram.mShaderFiles.push_back(make_pair("deferred/avatarV.glsl", GL_VERTEX_SHADER_ARB)); gDeferredAvatarProgram.mShaderFiles.push_back(make_pair("deferred/avatarF.glsl", GL_FRAGMENT_SHADER_ARB)); gDeferredAvatarProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; - success = gDeferredAvatarProgram.createShader(&mAvatarAttribs, &mAvatarUniforms); + success = gDeferredAvatarProgram.createShader(NULL, &mAvatarUniforms); } if (success) @@ -1522,47 +1401,57 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredAvatarAlphaProgram.mFeatures.disableTextureIndex = true; gDeferredAvatarAlphaProgram.mShaderFiles.clear(); gDeferredAvatarAlphaProgram.mShaderFiles.push_back(make_pair("deferred/avatarAlphaV.glsl", GL_VERTEX_SHADER_ARB)); - gDeferredAvatarAlphaProgram.mShaderFiles.push_back(make_pair("deferred/alphaNonIndexedF.glsl", GL_FRAGMENT_SHADER_ARB)); + gDeferredAvatarAlphaProgram.mShaderFiles.push_back(make_pair("deferred/alphaNonIndexedNoColorF.glsl", GL_FRAGMENT_SHADER_ARB)); gDeferredAvatarAlphaProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; - success = gDeferredAvatarAlphaProgram.createShader(&mAvatarAttribs, &mAvatarUniforms); + success = gDeferredAvatarAlphaProgram.createShader(NULL, &mAvatarUniforms); } if (success) { - std::string fragment; - if (multisample) - { - fragment = "deferred/postDeferredMSF.glsl"; - } - else - { - fragment = "deferred/postDeferredF.glsl"; - } + gFXAAProgram.mName = "FXAA Shader"; + gFXAAProgram.mShaderFiles.clear(); + gFXAAProgram.mShaderFiles.push_back(make_pair("deferred/postDeferredV.glsl", GL_VERTEX_SHADER_ARB)); + gFXAAProgram.mShaderFiles.push_back(make_pair("deferred/fxaaF.glsl", GL_FRAGMENT_SHADER_ARB)); + gFXAAProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; + success = gFXAAProgram.createShader(NULL, NULL); + } + if (success) + { gDeferredPostProgram.mName = "Deferred Post Shader"; gDeferredPostProgram.mShaderFiles.clear(); gDeferredPostProgram.mShaderFiles.push_back(make_pair("deferred/postDeferredV.glsl", GL_VERTEX_SHADER_ARB)); - gDeferredPostProgram.mShaderFiles.push_back(make_pair(fragment, GL_FRAGMENT_SHADER_ARB)); + gDeferredPostProgram.mShaderFiles.push_back(make_pair("deferred/postDeferredF.glsl", GL_FRAGMENT_SHADER_ARB)); gDeferredPostProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; success = gDeferredPostProgram.createShader(NULL, NULL); } if (success) { - std::string fragment; - if (multisample) - { - fragment = "deferred/postDeferredNoDoFMSF.glsl"; - } - else - { - fragment = "deferred/postDeferredNoDoFF.glsl"; - } + gDeferredCoFProgram.mName = "Deferred CoF Shader"; + gDeferredCoFProgram.mShaderFiles.clear(); + gDeferredCoFProgram.mShaderFiles.push_back(make_pair("deferred/postDeferredV.glsl", GL_VERTEX_SHADER_ARB)); + gDeferredCoFProgram.mShaderFiles.push_back(make_pair("deferred/cofF.glsl", GL_FRAGMENT_SHADER_ARB)); + gDeferredCoFProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; + success = gDeferredCoFProgram.createShader(NULL, NULL); + } + if (success) + { + gDeferredDoFCombineProgram.mName = "Deferred DoFCombine Shader"; + gDeferredDoFCombineProgram.mShaderFiles.clear(); + gDeferredDoFCombineProgram.mShaderFiles.push_back(make_pair("deferred/postDeferredV.glsl", GL_VERTEX_SHADER_ARB)); + gDeferredDoFCombineProgram.mShaderFiles.push_back(make_pair("deferred/dofCombineF.glsl", GL_FRAGMENT_SHADER_ARB)); + gDeferredDoFCombineProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; + success = gDeferredDoFCombineProgram.createShader(NULL, NULL); + } + + if (success) + { gDeferredPostNoDoFProgram.mName = "Deferred Post Shader"; gDeferredPostNoDoFProgram.mShaderFiles.clear(); gDeferredPostNoDoFProgram.mShaderFiles.push_back(make_pair("deferred/postDeferredV.glsl", GL_VERTEX_SHADER_ARB)); - gDeferredPostNoDoFProgram.mShaderFiles.push_back(make_pair(fragment, GL_FRAGMENT_SHADER_ARB)); + gDeferredPostNoDoFProgram.mShaderFiles.push_back(make_pair("deferred/postDeferredNoDoFF.glsl", GL_FRAGMENT_SHADER_ARB)); gDeferredPostNoDoFProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; success = gDeferredPostNoDoFProgram.createShader(NULL, NULL); } @@ -1601,70 +1490,15 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() success = gDeferredStarProgram.createShader(NULL, &mWLUniforms); } - if (mVertexShaderLevel[SHADER_DEFERRED] > 1) + if (success) { - if (success) - { - std::string fragment; - if (multisample) - { - fragment = "deferred/edgeMSF.glsl"; - } - else - { - fragment = "deferred/edgeF.glsl"; - } - - gDeferredEdgeProgram.mName = "Deferred Edge Shader"; - gDeferredEdgeProgram.mShaderFiles.clear(); - gDeferredEdgeProgram.mShaderFiles.push_back(make_pair("deferred/edgeV.glsl", GL_VERTEX_SHADER_ARB)); - gDeferredEdgeProgram.mShaderFiles.push_back(make_pair(fragment, GL_FRAGMENT_SHADER_ARB)); - gDeferredEdgeProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; - success = gDeferredEdgeProgram.createShader(NULL, NULL); - } - } - - if (mVertexShaderLevel[SHADER_DEFERRED] > 2) - { - if (success) - { - gDeferredPostGIProgram.mName = "Deferred Post GI Shader"; - gDeferredPostGIProgram.mShaderFiles.clear(); - gDeferredPostGIProgram.mShaderFiles.push_back(make_pair("deferred/postgiV.glsl", GL_VERTEX_SHADER_ARB)); - gDeferredPostGIProgram.mShaderFiles.push_back(make_pair("deferred/postgiF.glsl", GL_FRAGMENT_SHADER_ARB)); - gDeferredPostGIProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; - success = gDeferredPostGIProgram.createShader(NULL, NULL); - } - - if (success) - { - gDeferredGIProgram.mName = "Deferred GI Shader"; - gDeferredGIProgram.mShaderFiles.clear(); - gDeferredGIProgram.mShaderFiles.push_back(make_pair("deferred/giV.glsl", GL_VERTEX_SHADER_ARB)); - gDeferredGIProgram.mShaderFiles.push_back(make_pair("deferred/giF.glsl", GL_FRAGMENT_SHADER_ARB)); - gDeferredGIProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; - success = gDeferredGIProgram.createShader(NULL, NULL); - } - - if (success) - { - gDeferredGIFinalProgram.mName = "Deferred GI Final Shader"; - gDeferredGIFinalProgram.mShaderFiles.clear(); - gDeferredGIFinalProgram.mShaderFiles.push_back(make_pair("deferred/giFinalV.glsl", GL_VERTEX_SHADER_ARB)); - gDeferredGIFinalProgram.mShaderFiles.push_back(make_pair("deferred/giFinalF.glsl", GL_FRAGMENT_SHADER_ARB)); - gDeferredGIFinalProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; - success = gDeferredGIFinalProgram.createShader(NULL, NULL); - } - - if (success) - { - gLuminanceGatherProgram.mName = "Luminance Gather Shader"; - gLuminanceGatherProgram.mShaderFiles.clear(); - gLuminanceGatherProgram.mShaderFiles.push_back(make_pair("deferred/luminanceV.glsl", GL_VERTEX_SHADER_ARB)); - gLuminanceGatherProgram.mShaderFiles.push_back(make_pair("deferred/luminanceF.glsl", GL_FRAGMENT_SHADER_ARB)); - gLuminanceGatherProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; - success = gLuminanceGatherProgram.createShader(NULL, NULL); - } + gNormalMapGenProgram.mName = "Normal Map Generation Program"; + gNormalMapGenProgram.mShaderFiles.clear(); + gNormalMapGenProgram.mShaderFiles.push_back(make_pair("deferred/normgenV.glsl", GL_VERTEX_SHADER_ARB)); + gNormalMapGenProgram.mShaderFiles.push_back(make_pair("deferred/normgenF.glsl", GL_FRAGMENT_SHADER_ARB)); + gNormalMapGenProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; + gNormalMapGenProgram.mShaderGroup = LLGLSLShader::SG_SKY; + success = gNormalMapGenProgram.createShader(NULL, NULL); } return success; @@ -1680,12 +1514,17 @@ BOOL LLViewerShaderMgr::loadShadersObject() gObjectFullbrightShinyProgram.unload(); gObjectFullbrightShinyWaterProgram.unload(); gObjectShinyWaterProgram.unload(); + gObjectFullbrightNoColorProgram.unload(); + gObjectFullbrightNoColorWaterProgram.unload(); gObjectSimpleProgram.unload(); + gObjectPreviewProgram.unload(); gImpostorProgram.unload(); gObjectSimpleAlphaMaskProgram.unload(); gObjectBumpProgram.unload(); gObjectSimpleWaterProgram.unload(); gObjectSimpleWaterAlphaMaskProgram.unload(); + gObjectEmissiveProgram.unload(); + gObjectEmissiveWaterProgram.unload(); gObjectFullbrightProgram.unload(); gObjectFullbrightAlphaMaskProgram.unload(); gObjectFullbrightWaterProgram.unload(); @@ -1694,20 +1533,29 @@ BOOL LLViewerShaderMgr::loadShadersObject() gObjectFullbrightShinyNonIndexedProgram.unload(); gObjectFullbrightShinyNonIndexedWaterProgram.unload(); gObjectShinyNonIndexedWaterProgram.unload(); - gObjectSimpleNonIndexedProgram.unload(); + gObjectSimpleNonIndexedTexGenProgram.unload(); + gObjectSimpleNonIndexedTexGenWaterProgram.unload(); gObjectSimpleNonIndexedWaterProgram.unload(); gObjectAlphaMaskNonIndexedProgram.unload(); gObjectAlphaMaskNonIndexedWaterProgram.unload(); + gObjectAlphaMaskNoColorProgram.unload(); + gObjectAlphaMaskNoColorWaterProgram.unload(); gObjectFullbrightNonIndexedProgram.unload(); gObjectFullbrightNonIndexedWaterProgram.unload(); + gObjectEmissiveNonIndexedProgram.unload(); + gObjectEmissiveNonIndexedWaterProgram.unload(); gSkinnedObjectSimpleProgram.unload(); gSkinnedObjectFullbrightProgram.unload(); + gSkinnedObjectEmissiveProgram.unload(); gSkinnedObjectFullbrightShinyProgram.unload(); gSkinnedObjectShinySimpleProgram.unload(); gSkinnedObjectSimpleWaterProgram.unload(); gSkinnedObjectFullbrightWaterProgram.unload(); + gSkinnedObjectEmissiveWaterProgram.unload(); gSkinnedObjectFullbrightShinyWaterProgram.unload(); gSkinnedObjectShinySimpleWaterProgram.unload(); + gTreeProgram.unload(); + gTreeWaterProgram.unload(); return TRUE; } @@ -1730,6 +1578,23 @@ BOOL LLViewerShaderMgr::loadShadersObject() if (success) { + gObjectSimpleNonIndexedTexGenProgram.mName = "Non indexed tex-gen Shader"; + gObjectSimpleNonIndexedTexGenProgram.mFeatures.calculatesLighting = true; + gObjectSimpleNonIndexedTexGenProgram.mFeatures.calculatesAtmospherics = true; + gObjectSimpleNonIndexedTexGenProgram.mFeatures.hasGamma = true; + gObjectSimpleNonIndexedTexGenProgram.mFeatures.hasAtmospherics = true; + gObjectSimpleNonIndexedTexGenProgram.mFeatures.hasLighting = true; + gObjectSimpleNonIndexedTexGenProgram.mFeatures.disableTextureIndex = true; + gObjectSimpleNonIndexedTexGenProgram.mShaderFiles.clear(); + gObjectSimpleNonIndexedTexGenProgram.mShaderFiles.push_back(make_pair("objects/simpleTexGenV.glsl", GL_VERTEX_SHADER_ARB)); + gObjectSimpleNonIndexedTexGenProgram.mShaderFiles.push_back(make_pair("objects/simpleF.glsl", GL_FRAGMENT_SHADER_ARB)); + gObjectSimpleNonIndexedTexGenProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT]; + success = gObjectSimpleNonIndexedTexGenProgram.createShader(NULL, NULL); + } + + + if (success) + { gObjectSimpleNonIndexedWaterProgram.mName = "Non indexed Water Shader"; gObjectSimpleNonIndexedWaterProgram.mFeatures.calculatesLighting = true; gObjectSimpleNonIndexedWaterProgram.mFeatures.calculatesAtmospherics = true; @@ -1747,6 +1612,23 @@ BOOL LLViewerShaderMgr::loadShadersObject() if (success) { + gObjectSimpleNonIndexedTexGenWaterProgram.mName = "Non indexed tex-gen Water Shader"; + gObjectSimpleNonIndexedTexGenWaterProgram.mFeatures.calculatesLighting = true; + gObjectSimpleNonIndexedTexGenWaterProgram.mFeatures.calculatesAtmospherics = true; + gObjectSimpleNonIndexedTexGenWaterProgram.mFeatures.hasWaterFog = true; + gObjectSimpleNonIndexedTexGenWaterProgram.mFeatures.hasAtmospherics = true; + gObjectSimpleNonIndexedTexGenWaterProgram.mFeatures.hasLighting = true; + gObjectSimpleNonIndexedTexGenWaterProgram.mFeatures.disableTextureIndex = true; + gObjectSimpleNonIndexedTexGenWaterProgram.mShaderFiles.clear(); + gObjectSimpleNonIndexedTexGenWaterProgram.mShaderFiles.push_back(make_pair("objects/simpleTexGenV.glsl", GL_VERTEX_SHADER_ARB)); + gObjectSimpleNonIndexedTexGenWaterProgram.mShaderFiles.push_back(make_pair("objects/simpleWaterF.glsl", GL_FRAGMENT_SHADER_ARB)); + gObjectSimpleNonIndexedTexGenWaterProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT]; + gObjectSimpleNonIndexedTexGenWaterProgram.mShaderGroup = LLGLSLShader::SG_WATER; + success = gObjectSimpleNonIndexedTexGenWaterProgram.createShader(NULL, NULL); + } + + if (success) + { gObjectAlphaMaskNonIndexedProgram.mName = "Non indexed alpha mask Shader"; gObjectAlphaMaskNonIndexedProgram.mFeatures.calculatesLighting = true; gObjectAlphaMaskNonIndexedProgram.mFeatures.calculatesAtmospherics = true; @@ -1756,7 +1638,7 @@ BOOL LLViewerShaderMgr::loadShadersObject() gObjectAlphaMaskNonIndexedProgram.mFeatures.disableTextureIndex = true; gObjectAlphaMaskNonIndexedProgram.mFeatures.hasAlphaMask = true; gObjectAlphaMaskNonIndexedProgram.mShaderFiles.clear(); - gObjectAlphaMaskNonIndexedProgram.mShaderFiles.push_back(make_pair("objects/simpleV.glsl", GL_VERTEX_SHADER_ARB)); + gObjectAlphaMaskNonIndexedProgram.mShaderFiles.push_back(make_pair("objects/simpleNonIndexedV.glsl", GL_VERTEX_SHADER_ARB)); gObjectAlphaMaskNonIndexedProgram.mShaderFiles.push_back(make_pair("objects/simpleF.glsl", GL_FRAGMENT_SHADER_ARB)); gObjectAlphaMaskNonIndexedProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT]; success = gObjectAlphaMaskNonIndexedProgram.createShader(NULL, NULL); @@ -1773,7 +1655,7 @@ BOOL LLViewerShaderMgr::loadShadersObject() gObjectAlphaMaskNonIndexedWaterProgram.mFeatures.disableTextureIndex = true; gObjectAlphaMaskNonIndexedWaterProgram.mFeatures.hasAlphaMask = true; gObjectAlphaMaskNonIndexedWaterProgram.mShaderFiles.clear(); - gObjectAlphaMaskNonIndexedWaterProgram.mShaderFiles.push_back(make_pair("objects/simpleV.glsl", GL_VERTEX_SHADER_ARB)); + gObjectAlphaMaskNonIndexedWaterProgram.mShaderFiles.push_back(make_pair("objects/simpleNonIndexedV.glsl", GL_VERTEX_SHADER_ARB)); gObjectAlphaMaskNonIndexedWaterProgram.mShaderFiles.push_back(make_pair("objects/simpleWaterF.glsl", GL_FRAGMENT_SHADER_ARB)); gObjectAlphaMaskNonIndexedWaterProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT]; gObjectAlphaMaskNonIndexedWaterProgram.mShaderGroup = LLGLSLShader::SG_WATER; @@ -1782,6 +1664,76 @@ BOOL LLViewerShaderMgr::loadShadersObject() if (success) { + gObjectAlphaMaskNoColorProgram.mName = "No color alpha mask Shader"; + gObjectAlphaMaskNoColorProgram.mFeatures.calculatesLighting = true; + gObjectAlphaMaskNoColorProgram.mFeatures.calculatesAtmospherics = true; + gObjectAlphaMaskNoColorProgram.mFeatures.hasGamma = true; + gObjectAlphaMaskNoColorProgram.mFeatures.hasAtmospherics = true; + gObjectAlphaMaskNoColorProgram.mFeatures.hasLighting = true; + gObjectAlphaMaskNoColorProgram.mFeatures.disableTextureIndex = true; + gObjectAlphaMaskNoColorProgram.mFeatures.hasAlphaMask = true; + gObjectAlphaMaskNoColorProgram.mShaderFiles.clear(); + gObjectAlphaMaskNoColorProgram.mShaderFiles.push_back(make_pair("objects/simpleNoColorV.glsl", GL_VERTEX_SHADER_ARB)); + gObjectAlphaMaskNoColorProgram.mShaderFiles.push_back(make_pair("objects/simpleF.glsl", GL_FRAGMENT_SHADER_ARB)); + gObjectAlphaMaskNoColorProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT]; + success = gObjectAlphaMaskNoColorProgram.createShader(NULL, NULL); + } + + if (success) + { + gObjectAlphaMaskNoColorWaterProgram.mName = "No color alpha mask Water Shader"; + gObjectAlphaMaskNoColorWaterProgram.mFeatures.calculatesLighting = true; + gObjectAlphaMaskNoColorWaterProgram.mFeatures.calculatesAtmospherics = true; + gObjectAlphaMaskNoColorWaterProgram.mFeatures.hasWaterFog = true; + gObjectAlphaMaskNoColorWaterProgram.mFeatures.hasAtmospherics = true; + gObjectAlphaMaskNoColorWaterProgram.mFeatures.hasLighting = true; + gObjectAlphaMaskNoColorWaterProgram.mFeatures.disableTextureIndex = true; + gObjectAlphaMaskNoColorWaterProgram.mFeatures.hasAlphaMask = true; + gObjectAlphaMaskNoColorWaterProgram.mShaderFiles.clear(); + gObjectAlphaMaskNoColorWaterProgram.mShaderFiles.push_back(make_pair("objects/simpleNoColorV.glsl", GL_VERTEX_SHADER_ARB)); + gObjectAlphaMaskNoColorWaterProgram.mShaderFiles.push_back(make_pair("objects/simpleWaterF.glsl", GL_FRAGMENT_SHADER_ARB)); + gObjectAlphaMaskNoColorWaterProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT]; + gObjectAlphaMaskNoColorWaterProgram.mShaderGroup = LLGLSLShader::SG_WATER; + success = gObjectAlphaMaskNoColorWaterProgram.createShader(NULL, NULL); + } + + if (success) + { + gTreeProgram.mName = "Tree Shader"; + gTreeProgram.mFeatures.calculatesLighting = true; + gTreeProgram.mFeatures.calculatesAtmospherics = true; + gTreeProgram.mFeatures.hasGamma = true; + gTreeProgram.mFeatures.hasAtmospherics = true; + gTreeProgram.mFeatures.hasLighting = true; + gTreeProgram.mFeatures.disableTextureIndex = true; + gTreeProgram.mFeatures.hasAlphaMask = true; + gTreeProgram.mShaderFiles.clear(); + gTreeProgram.mShaderFiles.push_back(make_pair("objects/treeV.glsl", GL_VERTEX_SHADER_ARB)); + gTreeProgram.mShaderFiles.push_back(make_pair("objects/simpleF.glsl", GL_FRAGMENT_SHADER_ARB)); + gTreeProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT]; + success = gTreeProgram.createShader(NULL, NULL); + } + + if (success) + { + gTreeWaterProgram.mName = "Tree Water Shader"; + gTreeWaterProgram.mFeatures.calculatesLighting = true; + gTreeWaterProgram.mFeatures.calculatesAtmospherics = true; + gTreeWaterProgram.mFeatures.hasWaterFog = true; + gTreeWaterProgram.mFeatures.hasAtmospherics = true; + gTreeWaterProgram.mFeatures.hasLighting = true; + gTreeWaterProgram.mFeatures.disableTextureIndex = true; + gTreeWaterProgram.mFeatures.hasAlphaMask = true; + gTreeWaterProgram.mShaderFiles.clear(); + gTreeWaterProgram.mShaderFiles.push_back(make_pair("objects/treeV.glsl", GL_VERTEX_SHADER_ARB)); + gTreeWaterProgram.mShaderFiles.push_back(make_pair("objects/simpleWaterF.glsl", GL_FRAGMENT_SHADER_ARB)); + gTreeWaterProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT]; + gTreeWaterProgram.mShaderGroup = LLGLSLShader::SG_WATER; + success = gTreeWaterProgram.createShader(NULL, NULL); + } + + if (success) + { gObjectFullbrightNonIndexedProgram.mName = "Non Indexed Fullbright Shader"; gObjectFullbrightNonIndexedProgram.mFeatures.calculatesAtmospherics = true; gObjectFullbrightNonIndexedProgram.mFeatures.hasGamma = true; @@ -1813,6 +1765,68 @@ BOOL LLViewerShaderMgr::loadShadersObject() if (success) { + gObjectEmissiveNonIndexedProgram.mName = "Non Indexed Emissive Shader"; + gObjectEmissiveNonIndexedProgram.mFeatures.calculatesAtmospherics = true; + gObjectEmissiveNonIndexedProgram.mFeatures.hasGamma = true; + gObjectEmissiveNonIndexedProgram.mFeatures.hasTransport = true; + gObjectEmissiveNonIndexedProgram.mFeatures.isFullbright = true; + gObjectEmissiveNonIndexedProgram.mFeatures.disableTextureIndex = true; + gObjectEmissiveNonIndexedProgram.mShaderFiles.clear(); + gObjectEmissiveNonIndexedProgram.mShaderFiles.push_back(make_pair("objects/emissiveV.glsl", GL_VERTEX_SHADER_ARB)); + gObjectEmissiveNonIndexedProgram.mShaderFiles.push_back(make_pair("objects/fullbrightF.glsl", GL_FRAGMENT_SHADER_ARB)); + gObjectEmissiveNonIndexedProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT]; + success = gObjectEmissiveNonIndexedProgram.createShader(NULL, NULL); + } + + if (success) + { + gObjectEmissiveNonIndexedWaterProgram.mName = "Non Indexed Emissive Water Shader"; + gObjectEmissiveNonIndexedWaterProgram.mFeatures.calculatesAtmospherics = true; + gObjectEmissiveNonIndexedWaterProgram.mFeatures.isFullbright = true; + gObjectEmissiveNonIndexedWaterProgram.mFeatures.hasWaterFog = true; + gObjectEmissiveNonIndexedWaterProgram.mFeatures.hasTransport = true; + gObjectEmissiveNonIndexedWaterProgram.mFeatures.disableTextureIndex = true; + gObjectEmissiveNonIndexedWaterProgram.mShaderFiles.clear(); + gObjectEmissiveNonIndexedWaterProgram.mShaderFiles.push_back(make_pair("objects/emissiveV.glsl", GL_VERTEX_SHADER_ARB)); + gObjectEmissiveNonIndexedWaterProgram.mShaderFiles.push_back(make_pair("objects/fullbrightWaterF.glsl", GL_FRAGMENT_SHADER_ARB)); + gObjectEmissiveNonIndexedWaterProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT]; + gObjectEmissiveNonIndexedWaterProgram.mShaderGroup = LLGLSLShader::SG_WATER; + success = gObjectEmissiveNonIndexedWaterProgram.createShader(NULL, NULL); + } + + if (success) + { + gObjectFullbrightNoColorProgram.mName = "Non Indexed no color Fullbright Shader"; + gObjectFullbrightNoColorProgram.mFeatures.calculatesAtmospherics = true; + gObjectFullbrightNoColorProgram.mFeatures.hasGamma = true; + gObjectFullbrightNoColorProgram.mFeatures.hasTransport = true; + gObjectFullbrightNoColorProgram.mFeatures.isFullbright = true; + gObjectFullbrightNoColorProgram.mFeatures.disableTextureIndex = true; + gObjectFullbrightNoColorProgram.mShaderFiles.clear(); + gObjectFullbrightNoColorProgram.mShaderFiles.push_back(make_pair("objects/fullbrightNoColorV.glsl", GL_VERTEX_SHADER_ARB)); + gObjectFullbrightNoColorProgram.mShaderFiles.push_back(make_pair("objects/fullbrightF.glsl", GL_FRAGMENT_SHADER_ARB)); + gObjectFullbrightNoColorProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT]; + success = gObjectFullbrightNoColorProgram.createShader(NULL, NULL); + } + + if (success) + { + gObjectFullbrightNoColorWaterProgram.mName = "Non Indexed no color Fullbright Water Shader"; + gObjectFullbrightNoColorWaterProgram.mFeatures.calculatesAtmospherics = true; + gObjectFullbrightNoColorWaterProgram.mFeatures.isFullbright = true; + gObjectFullbrightNoColorWaterProgram.mFeatures.hasWaterFog = true; + gObjectFullbrightNoColorWaterProgram.mFeatures.hasTransport = true; + gObjectFullbrightNoColorWaterProgram.mFeatures.disableTextureIndex = true; + gObjectFullbrightNoColorWaterProgram.mShaderFiles.clear(); + gObjectFullbrightNoColorWaterProgram.mShaderFiles.push_back(make_pair("objects/fullbrightNoColorV.glsl", GL_VERTEX_SHADER_ARB)); + gObjectFullbrightNoColorWaterProgram.mShaderFiles.push_back(make_pair("objects/fullbrightWaterF.glsl", GL_FRAGMENT_SHADER_ARB)); + gObjectFullbrightNoColorWaterProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT]; + gObjectFullbrightNoColorWaterProgram.mShaderGroup = LLGLSLShader::SG_WATER; + success = gObjectFullbrightNoColorWaterProgram.createShader(NULL, NULL); + } + + if (success) + { gObjectShinyNonIndexedProgram.mName = "Non Indexed Shiny Shader"; gObjectShinyNonIndexedProgram.mFeatures.calculatesAtmospherics = true; gObjectShinyNonIndexedProgram.mFeatures.calculatesLighting = true; @@ -1891,6 +1905,23 @@ BOOL LLViewerShaderMgr::loadShadersObject() if (success) { + gObjectPreviewProgram.mName = "Simple Shader"; + gObjectPreviewProgram.mFeatures.calculatesLighting = true; + gObjectPreviewProgram.mFeatures.calculatesAtmospherics = true; + gObjectPreviewProgram.mFeatures.hasGamma = true; + gObjectPreviewProgram.mFeatures.hasAtmospherics = true; + gObjectPreviewProgram.mFeatures.hasLighting = true; + gObjectPreviewProgram.mFeatures.mIndexedTextureChannels = 0; + gObjectPreviewProgram.mFeatures.disableTextureIndex = true; + gObjectPreviewProgram.mShaderFiles.clear(); + gObjectPreviewProgram.mShaderFiles.push_back(make_pair("objects/previewV.glsl", GL_VERTEX_SHADER_ARB)); + gObjectPreviewProgram.mShaderFiles.push_back(make_pair("objects/simpleF.glsl", GL_FRAGMENT_SHADER_ARB)); + gObjectPreviewProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT]; + success = gObjectPreviewProgram.createShader(NULL, NULL); + } + + if (success) + { gObjectSimpleProgram.mName = "Simple Shader"; gObjectSimpleProgram.mFeatures.calculatesLighting = true; gObjectSimpleProgram.mFeatures.calculatesAtmospherics = true; @@ -1907,19 +1938,19 @@ BOOL LLViewerShaderMgr::loadShadersObject() if (success) { - gObjectSimpleAlphaMaskProgram.mName = "Simple Alpha Mask Shader"; - gObjectSimpleAlphaMaskProgram.mFeatures.calculatesLighting = true; - gObjectSimpleAlphaMaskProgram.mFeatures.calculatesAtmospherics = true; - gObjectSimpleAlphaMaskProgram.mFeatures.hasGamma = true; - gObjectSimpleAlphaMaskProgram.mFeatures.hasAtmospherics = true; - gObjectSimpleAlphaMaskProgram.mFeatures.hasLighting = true; - gObjectSimpleAlphaMaskProgram.mFeatures.hasAlphaMask = true; - gObjectSimpleAlphaMaskProgram.mFeatures.mIndexedTextureChannels = 0; - gObjectSimpleAlphaMaskProgram.mShaderFiles.clear(); - gObjectSimpleAlphaMaskProgram.mShaderFiles.push_back(make_pair("objects/simpleV.glsl", GL_VERTEX_SHADER_ARB)); - gObjectSimpleAlphaMaskProgram.mShaderFiles.push_back(make_pair("objects/simpleF.glsl", GL_FRAGMENT_SHADER_ARB)); - gObjectSimpleAlphaMaskProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT]; - success = gObjectSimpleAlphaMaskProgram.createShader(NULL, NULL); + gObjectSimpleWaterProgram.mName = "Simple Water Shader"; + gObjectSimpleWaterProgram.mFeatures.calculatesLighting = true; + gObjectSimpleWaterProgram.mFeatures.calculatesAtmospherics = true; + gObjectSimpleWaterProgram.mFeatures.hasWaterFog = true; + gObjectSimpleWaterProgram.mFeatures.hasAtmospherics = true; + gObjectSimpleWaterProgram.mFeatures.hasLighting = true; + gObjectSimpleWaterProgram.mFeatures.mIndexedTextureChannels = 0; + gObjectSimpleWaterProgram.mShaderFiles.clear(); + gObjectSimpleWaterProgram.mShaderFiles.push_back(make_pair("objects/simpleV.glsl", GL_VERTEX_SHADER_ARB)); + gObjectSimpleWaterProgram.mShaderFiles.push_back(make_pair("objects/simpleWaterF.glsl", GL_FRAGMENT_SHADER_ARB)); + gObjectSimpleWaterProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT]; + gObjectSimpleWaterProgram.mShaderGroup = LLGLSLShader::SG_WATER; + success = gObjectSimpleWaterProgram.createShader(NULL, NULL); } if (success) @@ -1936,25 +1967,34 @@ BOOL LLViewerShaderMgr::loadShadersObject() gObjectBumpProgram.mShaderFiles.push_back(make_pair("objects/bumpF.glsl", GL_FRAGMENT_SHADER_ARB)); gObjectBumpProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT]; success = gObjectBumpProgram.createShader(NULL, NULL); + + if (success) + { //lldrawpoolbump assumes "texture0" has channel 0 and "texture1" has channel 1 + gObjectBumpProgram.bind(); + gObjectBumpProgram.uniform1i("texture0", 0); + gObjectBumpProgram.uniform1i("texture1", 1); + gObjectBumpProgram.unbind(); + } } + if (success) { - gObjectSimpleWaterProgram.mName = "Simple Water Shader"; - gObjectSimpleWaterProgram.mFeatures.calculatesLighting = true; - gObjectSimpleWaterProgram.mFeatures.calculatesAtmospherics = true; - gObjectSimpleWaterProgram.mFeatures.hasWaterFog = true; - gObjectSimpleWaterProgram.mFeatures.hasAtmospherics = true; - gObjectSimpleWaterProgram.mFeatures.hasLighting = true; - gObjectSimpleWaterProgram.mFeatures.mIndexedTextureChannels = 0; - gObjectSimpleWaterProgram.mShaderFiles.clear(); - gObjectSimpleWaterProgram.mShaderFiles.push_back(make_pair("objects/simpleV.glsl", GL_VERTEX_SHADER_ARB)); - gObjectSimpleWaterProgram.mShaderFiles.push_back(make_pair("objects/simpleWaterF.glsl", GL_FRAGMENT_SHADER_ARB)); - gObjectSimpleWaterProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT]; - gObjectSimpleWaterProgram.mShaderGroup = LLGLSLShader::SG_WATER; - success = gObjectSimpleWaterProgram.createShader(NULL, NULL); + gObjectSimpleAlphaMaskProgram.mName = "Simple Alpha Mask Shader"; + gObjectSimpleAlphaMaskProgram.mFeatures.calculatesLighting = true; + gObjectSimpleAlphaMaskProgram.mFeatures.calculatesAtmospherics = true; + gObjectSimpleAlphaMaskProgram.mFeatures.hasGamma = true; + gObjectSimpleAlphaMaskProgram.mFeatures.hasAtmospherics = true; + gObjectSimpleAlphaMaskProgram.mFeatures.hasLighting = true; + gObjectSimpleAlphaMaskProgram.mFeatures.hasAlphaMask = true; + gObjectSimpleAlphaMaskProgram.mFeatures.mIndexedTextureChannels = 0; + gObjectSimpleAlphaMaskProgram.mShaderFiles.clear(); + gObjectSimpleAlphaMaskProgram.mShaderFiles.push_back(make_pair("objects/simpleV.glsl", GL_VERTEX_SHADER_ARB)); + gObjectSimpleAlphaMaskProgram.mShaderFiles.push_back(make_pair("objects/simpleF.glsl", GL_FRAGMENT_SHADER_ARB)); + gObjectSimpleAlphaMaskProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT]; + success = gObjectSimpleAlphaMaskProgram.createShader(NULL, NULL); } - + if (success) { gObjectSimpleWaterAlphaMaskProgram.mName = "Simple Water Alpha Mask Shader"; @@ -2006,6 +2046,37 @@ BOOL LLViewerShaderMgr::loadShadersObject() if (success) { + gObjectEmissiveProgram.mName = "Emissive Shader"; + gObjectEmissiveProgram.mFeatures.calculatesAtmospherics = true; + gObjectEmissiveProgram.mFeatures.hasGamma = true; + gObjectEmissiveProgram.mFeatures.hasTransport = true; + gObjectEmissiveProgram.mFeatures.isFullbright = true; + gObjectEmissiveProgram.mFeatures.mIndexedTextureChannels = 0; + gObjectEmissiveProgram.mShaderFiles.clear(); + gObjectEmissiveProgram.mShaderFiles.push_back(make_pair("objects/emissiveV.glsl", GL_VERTEX_SHADER_ARB)); + gObjectEmissiveProgram.mShaderFiles.push_back(make_pair("objects/fullbrightF.glsl", GL_FRAGMENT_SHADER_ARB)); + gObjectEmissiveProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT]; + success = gObjectEmissiveProgram.createShader(NULL, NULL); + } + + if (success) + { + gObjectEmissiveWaterProgram.mName = "Emissive Water Shader"; + gObjectEmissiveWaterProgram.mFeatures.calculatesAtmospherics = true; + gObjectEmissiveWaterProgram.mFeatures.isFullbright = true; + gObjectEmissiveWaterProgram.mFeatures.hasWaterFog = true; + gObjectEmissiveWaterProgram.mFeatures.hasTransport = true; + gObjectEmissiveWaterProgram.mFeatures.mIndexedTextureChannels = 0; + gObjectEmissiveWaterProgram.mShaderFiles.clear(); + gObjectEmissiveWaterProgram.mShaderFiles.push_back(make_pair("objects/emissiveV.glsl", GL_VERTEX_SHADER_ARB)); + gObjectEmissiveWaterProgram.mShaderFiles.push_back(make_pair("objects/fullbrightWaterF.glsl", GL_FRAGMENT_SHADER_ARB)); + gObjectEmissiveWaterProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT]; + gObjectEmissiveWaterProgram.mShaderGroup = LLGLSLShader::SG_WATER; + success = gObjectEmissiveWaterProgram.createShader(NULL, NULL); + } + + if (success) + { gObjectFullbrightAlphaMaskProgram.mName = "Fullbright Alpha Mask Shader"; gObjectFullbrightAlphaMaskProgram.mFeatures.calculatesAtmospherics = true; gObjectFullbrightAlphaMaskProgram.mFeatures.hasGamma = true; @@ -2141,6 +2212,39 @@ BOOL LLViewerShaderMgr::loadShadersObject() if (success) { + gSkinnedObjectEmissiveProgram.mName = "Skinned Emissive Shader"; + gSkinnedObjectEmissiveProgram.mFeatures.calculatesAtmospherics = true; + gSkinnedObjectEmissiveProgram.mFeatures.hasGamma = true; + gSkinnedObjectEmissiveProgram.mFeatures.hasTransport = true; + gSkinnedObjectEmissiveProgram.mFeatures.isFullbright = true; + gSkinnedObjectEmissiveProgram.mFeatures.hasObjectSkinning = true; + gSkinnedObjectEmissiveProgram.mFeatures.disableTextureIndex = true; + gSkinnedObjectEmissiveProgram.mShaderFiles.clear(); + gSkinnedObjectEmissiveProgram.mShaderFiles.push_back(make_pair("objects/emissiveSkinnedV.glsl", GL_VERTEX_SHADER_ARB)); + gSkinnedObjectEmissiveProgram.mShaderFiles.push_back(make_pair("objects/fullbrightF.glsl", GL_FRAGMENT_SHADER_ARB)); + gSkinnedObjectEmissiveProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT]; + success = gSkinnedObjectEmissiveProgram.createShader(NULL, NULL); + } + + if (success) + { + gSkinnedObjectEmissiveWaterProgram.mName = "Skinned Emissive Water Shader"; + gSkinnedObjectEmissiveWaterProgram.mFeatures.calculatesAtmospherics = true; + gSkinnedObjectEmissiveWaterProgram.mFeatures.hasGamma = true; + gSkinnedObjectEmissiveWaterProgram.mFeatures.hasTransport = true; + gSkinnedObjectEmissiveWaterProgram.mFeatures.isFullbright = true; + gSkinnedObjectEmissiveWaterProgram.mFeatures.hasObjectSkinning = true; + gSkinnedObjectEmissiveWaterProgram.mFeatures.disableTextureIndex = true; + gSkinnedObjectEmissiveWaterProgram.mFeatures.hasWaterFog = true; + gSkinnedObjectEmissiveWaterProgram.mShaderFiles.clear(); + gSkinnedObjectEmissiveWaterProgram.mShaderFiles.push_back(make_pair("objects/emissiveSkinnedV.glsl", GL_VERTEX_SHADER_ARB)); + gSkinnedObjectEmissiveWaterProgram.mShaderFiles.push_back(make_pair("objects/fullbrightWaterF.glsl", GL_FRAGMENT_SHADER_ARB)); + gSkinnedObjectEmissiveWaterProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT]; + success = gSkinnedObjectEmissiveWaterProgram.createShader(NULL, NULL); + } + + if (success) + { gSkinnedObjectFullbrightShinyProgram.mName = "Skinned Fullbright Shiny Shader"; gSkinnedObjectFullbrightShinyProgram.mFeatures.calculatesAtmospherics = true; gSkinnedObjectFullbrightShinyProgram.mFeatures.hasGamma = true; @@ -2287,7 +2391,7 @@ BOOL LLViewerShaderMgr::loadShadersAvatar() gAvatarProgram.mShaderFiles.push_back(make_pair("avatar/avatarV.glsl", GL_VERTEX_SHADER_ARB)); gAvatarProgram.mShaderFiles.push_back(make_pair("avatar/avatarF.glsl", GL_FRAGMENT_SHADER_ARB)); gAvatarProgram.mShaderLevel = mVertexShaderLevel[SHADER_AVATAR]; - success = gAvatarProgram.createShader(&mAvatarAttribs, &mAvatarUniforms); + success = gAvatarProgram.createShader(NULL, &mAvatarUniforms); if (success) { @@ -2306,7 +2410,7 @@ BOOL LLViewerShaderMgr::loadShadersAvatar() // Note: no cloth under water: gAvatarWaterProgram.mShaderLevel = llmin(mVertexShaderLevel[SHADER_AVATAR], 1); gAvatarWaterProgram.mShaderGroup = LLGLSLShader::SG_WATER; - success = gAvatarWaterProgram.createShader(&mAvatarAttribs, &mAvatarUniforms); + success = gAvatarWaterProgram.createShader(NULL, &mAvatarUniforms); } /// Keep track of avatar levels @@ -2325,7 +2429,7 @@ BOOL LLViewerShaderMgr::loadShadersAvatar() gAvatarPickProgram.mShaderFiles.push_back(make_pair("avatar/pickAvatarV.glsl", GL_VERTEX_SHADER_ARB)); gAvatarPickProgram.mShaderFiles.push_back(make_pair("avatar/pickAvatarF.glsl", GL_FRAGMENT_SHADER_ARB)); gAvatarPickProgram.mShaderLevel = mVertexShaderLevel[SHADER_AVATAR]; - success = gAvatarPickProgram.createShader(&mAvatarAttribs, &mAvatarUniforms); + success = gAvatarPickProgram.createShader(NULL, &mAvatarUniforms); } if (success) @@ -2398,6 +2502,22 @@ BOOL LLViewerShaderMgr::loadShadersInterface() if (success) { + gSplatTextureRectProgram.mName = "Splat Texture Rect Shader"; + gSplatTextureRectProgram.mShaderFiles.clear(); + gSplatTextureRectProgram.mShaderFiles.push_back(make_pair("interface/splattexturerectV.glsl", GL_VERTEX_SHADER_ARB)); + gSplatTextureRectProgram.mShaderFiles.push_back(make_pair("interface/splattexturerectF.glsl", GL_FRAGMENT_SHADER_ARB)); + gSplatTextureRectProgram.mShaderLevel = mVertexShaderLevel[SHADER_INTERFACE]; + success = gSplatTextureRectProgram.createShader(NULL, NULL); + if (success) + { + gSplatTextureRectProgram.bind(); + gSplatTextureRectProgram.uniform1i("screenMap", 0); + gSplatTextureRectProgram.unbind(); + } + } + + if (success) + { gGlowCombineProgram.mName = "Glow Combine Shader"; gGlowCombineProgram.mShaderFiles.clear(); gGlowCombineProgram.mShaderFiles.push_back(make_pair("interface/glowcombineV.glsl", GL_VERTEX_SHADER_ARB)); @@ -2415,6 +2535,24 @@ BOOL LLViewerShaderMgr::loadShadersInterface() if (success) { + gGlowCombineFXAAProgram.mName = "Glow CombineFXAA Shader"; + gGlowCombineFXAAProgram.mShaderFiles.clear(); + gGlowCombineFXAAProgram.mShaderFiles.push_back(make_pair("interface/glowcombineFXAAV.glsl", GL_VERTEX_SHADER_ARB)); + gGlowCombineFXAAProgram.mShaderFiles.push_back(make_pair("interface/glowcombineFXAAF.glsl", GL_FRAGMENT_SHADER_ARB)); + gGlowCombineFXAAProgram.mShaderLevel = mVertexShaderLevel[SHADER_INTERFACE]; + success = gGlowCombineFXAAProgram.createShader(NULL, NULL); + if (success) + { + gGlowCombineFXAAProgram.bind(); + gGlowCombineFXAAProgram.uniform1i("glowMap", 0); + gGlowCombineFXAAProgram.uniform1i("screenMap", 1); + gGlowCombineFXAAProgram.unbind(); + } + } + + + if (success) + { gTwoTextureAddProgram.mName = "Two Texture Add Shader"; gTwoTextureAddProgram.mShaderFiles.clear(); gTwoTextureAddProgram.mShaderFiles.push_back(make_pair("interface/twotextureaddV.glsl", GL_VERTEX_SHADER_ARB)); @@ -2431,6 +2569,21 @@ BOOL LLViewerShaderMgr::loadShadersInterface() if (success) { + gOneTextureNoColorProgram.mName = "One Texture No Color Shader"; + gOneTextureNoColorProgram.mShaderFiles.clear(); + gOneTextureNoColorProgram.mShaderFiles.push_back(make_pair("interface/onetexturenocolorV.glsl", GL_VERTEX_SHADER_ARB)); + gOneTextureNoColorProgram.mShaderFiles.push_back(make_pair("interface/onetexturenocolorF.glsl", GL_FRAGMENT_SHADER_ARB)); + gOneTextureNoColorProgram.mShaderLevel = mVertexShaderLevel[SHADER_INTERFACE]; + success = gOneTextureNoColorProgram.createShader(NULL, NULL); + if (success) + { + gOneTextureNoColorProgram.bind(); + gOneTextureNoColorProgram.uniform1i("tex0", 0); + } + } + + if (success) + { gSolidColorProgram.mName = "Solid Color Shader"; gSolidColorProgram.mShaderFiles.clear(); gSolidColorProgram.mShaderFiles.push_back(make_pair("interface/solidcolorV.glsl", GL_VERTEX_SHADER_ARB)); @@ -2455,6 +2608,26 @@ BOOL LLViewerShaderMgr::loadShadersInterface() success = gOcclusionProgram.createShader(NULL, NULL); } + if (success) + { + gDebugProgram.mName = "Debug Shader"; + gDebugProgram.mShaderFiles.clear(); + gDebugProgram.mShaderFiles.push_back(make_pair("interface/debugV.glsl", GL_VERTEX_SHADER_ARB)); + gDebugProgram.mShaderFiles.push_back(make_pair("interface/debugF.glsl", GL_FRAGMENT_SHADER_ARB)); + gDebugProgram.mShaderLevel = mVertexShaderLevel[SHADER_INTERFACE]; + success = gDebugProgram.createShader(NULL, NULL); + } + + if (success) + { + gAlphaMaskProgram.mName = "Alpha Mask Shader"; + gAlphaMaskProgram.mShaderFiles.clear(); + gAlphaMaskProgram.mShaderFiles.push_back(make_pair("interface/alphamaskV.glsl", GL_VERTEX_SHADER_ARB)); + gAlphaMaskProgram.mShaderFiles.push_back(make_pair("interface/alphamaskF.glsl", GL_FRAGMENT_SHADER_ARB)); + gAlphaMaskProgram.mShaderLevel = mVertexShaderLevel[SHADER_INTERFACE]; + success = gAlphaMaskProgram.createShader(NULL, NULL); + } + if( !success ) { mVertexShaderLevel[SHADER_INTERFACE] = 0; diff --git a/indra/newview/llviewershadermgr.h b/indra/newview/llviewershadermgr.h index d4040f11e1..95eb551bf1 100644 --- a/indra/newview/llviewershadermgr.h +++ b/indra/newview/llviewershadermgr.h @@ -33,6 +33,7 @@ class LLViewerShaderMgr: public LLShaderMgr { public: static BOOL sInitialized; + static bool sSkipReload; LLViewerShaderMgr(); /* virtual */ ~LLViewerShaderMgr(); @@ -71,76 +72,6 @@ public: SHADER_COUNT }; - typedef enum - { - MATERIAL_COLOR = 0, - SPECULAR_COLOR, - BINORMAL, - OBJECT_WEIGHT, - END_RESERVED_ATTRIBS - } eGLSLReservedAttribs; - - typedef enum - { - DIFFUSE_MAP = 0, - SPECULAR_MAP, - BUMP_MAP, - ENVIRONMENT_MAP, - CLOUD_NOISE_MAP, - FULLBRIGHT, - LIGHTNORM, - SUNLIGHT_COLOR, - AMBIENT, - BLUE_HORIZON, - BLUE_DENSITY, - HAZE_HORIZON, - HAZE_DENSITY, - CLOUD_SHADOW, - DENSITY_MULTIPLIER, - DISTANCE_MULTIPLIER, - MAX_Y, - GLOW, - CLOUD_COLOR, - CLOUD_POS_DENSITY1, - CLOUD_POS_DENSITY2, - CLOUD_SCALE, - GAMMA, - SCENE_LIGHT_STRENGTH, - DEFERRED_DEPTH, - DEFERRED_SHADOW0, - DEFERRED_SHADOW1, - DEFERRED_SHADOW2, - DEFERRED_SHADOW3, - DEFERRED_SHADOW4, - DEFERRED_SHADOW5, - DEFERRED_NORMAL, - DEFERRED_POSITION, - DEFERRED_DIFFUSE, - DEFERRED_SPECULAR, - DEFERRED_NOISE, - DEFERRED_LIGHTFUNC, - DEFERRED_LIGHT, - DEFERRED_LUMINANCE, - DEFERRED_GI_LIGHT, - DEFERRED_GI_MIP, - DEFERRED_EDGE, - DEFERRED_BLOOM, - DEFERRED_SUN_LIGHT, - DEFERRED_LOCAL_LIGHT, - DEFERRED_PROJECTION, - DEFERRED_GI_DIFFUSE, - DEFERRED_GI_SPECULAR, - DEFERRED_GI_NORMAL, - DEFERRED_GI_MIN_POS, - DEFERRED_GI_MAX_POS, - DEFERRED_GI_DEPTH, - DEFERRED_GI_LAST_DIFFUSE, - DEFERRED_GI_LAST_NORMAL, - DEFERRED_GI_LAST_MIN_POS, - DEFERRED_GI_LAST_MAX_POS, - END_RESERVED_UNIFORMS - } eGLSLReservedUniforms; - typedef enum { SHINY_ORIGIN = END_RESERVED_UNIFORMS @@ -186,16 +117,10 @@ public: typedef enum { - AVATAR_WEIGHT = END_RESERVED_ATTRIBS, - AVATAR_CLOTHING, + AVATAR_MATRIX = END_RESERVED_UNIFORMS, AVATAR_WIND, AVATAR_SINWAVE, - AVATAR_GRAVITY - } eAvatarAttribs; - - typedef enum - { - AVATAR_MATRIX = END_RESERVED_UNIFORMS + AVATAR_GRAVITY, } eAvatarUniforms; // simple model of forward iterator @@ -265,9 +190,6 @@ private: std::vector<std::string> mGlowExtractUniforms; - //avatar shader parameter tables - std::vector<std::string> mAvatarAttribs; - std::vector<std::string> mAvatarUniforms; // the list of shaders we need to propagate parameters to. @@ -291,26 +213,45 @@ extern LLVector4 gShinyOrigin; extern LLGLSLShader gOcclusionProgram; extern LLGLSLShader gCustomAlphaProgram; extern LLGLSLShader gGlowCombineProgram; +extern LLGLSLShader gSplatTextureRectProgram; +extern LLGLSLShader gGlowCombineFXAAProgram; +extern LLGLSLShader gDebugProgram; +extern LLGLSLShader gAlphaMaskProgram; //output tex0[tc0] + tex1[tc1] extern LLGLSLShader gTwoTextureAddProgram; - + +extern LLGLSLShader gOneTextureNoColorProgram; + //object shaders extern LLGLSLShader gObjectSimpleProgram; +extern LLGLSLShader gObjectPreviewProgram; extern LLGLSLShader gObjectSimpleAlphaMaskProgram; extern LLGLSLShader gObjectSimpleWaterProgram; extern LLGLSLShader gObjectSimpleWaterAlphaMaskProgram; extern LLGLSLShader gObjectSimpleNonIndexedProgram; +extern LLGLSLShader gObjectSimpleNonIndexedTexGenProgram; +extern LLGLSLShader gObjectSimpleNonIndexedTexGenWaterProgram; extern LLGLSLShader gObjectSimpleNonIndexedWaterProgram; extern LLGLSLShader gObjectAlphaMaskNonIndexedProgram; extern LLGLSLShader gObjectAlphaMaskNonIndexedWaterProgram; +extern LLGLSLShader gObjectAlphaMaskNoColorProgram; +extern LLGLSLShader gObjectAlphaMaskNoColorWaterProgram; extern LLGLSLShader gObjectFullbrightProgram; extern LLGLSLShader gObjectFullbrightWaterProgram; +extern LLGLSLShader gObjectFullbrightNoColorProgram; +extern LLGLSLShader gObjectFullbrightNoColorWaterProgram; +extern LLGLSLShader gObjectEmissiveProgram; +extern LLGLSLShader gObjectEmissiveWaterProgram; extern LLGLSLShader gObjectFullbrightAlphaMaskProgram; extern LLGLSLShader gObjectFullbrightWaterAlphaMaskProgram; extern LLGLSLShader gObjectFullbrightNonIndexedProgram; extern LLGLSLShader gObjectFullbrightNonIndexedWaterProgram; +extern LLGLSLShader gObjectEmissiveNonIndexedProgram; +extern LLGLSLShader gObjectEmissiveNonIndexedWaterProgram; extern LLGLSLShader gObjectBumpProgram; +extern LLGLSLShader gTreeProgram; +extern LLGLSLShader gTreeWaterProgram; extern LLGLSLShader gObjectSimpleLODProgram; extern LLGLSLShader gObjectFullbrightLODProgram; @@ -327,11 +268,13 @@ extern LLGLSLShader gObjectShinyNonIndexedWaterProgram; extern LLGLSLShader gSkinnedObjectSimpleProgram; extern LLGLSLShader gSkinnedObjectFullbrightProgram; +extern LLGLSLShader gSkinnedObjectEmissiveProgram; extern LLGLSLShader gSkinnedObjectFullbrightShinyProgram; extern LLGLSLShader gSkinnedObjectShinySimpleProgram; extern LLGLSLShader gSkinnedObjectSimpleWaterProgram; extern LLGLSLShader gSkinnedObjectFullbrightWaterProgram; +extern LLGLSLShader gSkinnedObjectEmissiveWaterProgram; extern LLGLSLShader gSkinnedObjectFullbrightShinyWaterProgram; extern LLGLSLShader gSkinnedObjectShinySimpleWaterProgram; @@ -363,11 +306,11 @@ extern LLGLSLShader gPostNightVisionProgram; // Deferred rendering shaders extern LLGLSLShader gDeferredImpostorProgram; -extern LLGLSLShader gDeferredEdgeProgram; extern LLGLSLShader gDeferredWaterProgram; extern LLGLSLShader gDeferredDiffuseProgram; extern LLGLSLShader gDeferredDiffuseAlphaMaskProgram; extern LLGLSLShader gDeferredNonIndexedDiffuseAlphaMaskProgram; +extern LLGLSLShader gDeferredNonIndexedDiffuseAlphaMaskNoColorProgram; extern LLGLSLShader gDeferredNonIndexedDiffuseProgram; extern LLGLSLShader gDeferredSkinnedDiffuseProgram; extern LLGLSLShader gDeferredSkinnedBumpProgram; @@ -375,34 +318,32 @@ extern LLGLSLShader gDeferredSkinnedAlphaProgram; extern LLGLSLShader gDeferredBumpProgram; extern LLGLSLShader gDeferredTerrainProgram; extern LLGLSLShader gDeferredTreeProgram; +extern LLGLSLShader gDeferredTreeShadowProgram; extern LLGLSLShader gDeferredLightProgram; extern LLGLSLShader gDeferredMultiLightProgram; extern LLGLSLShader gDeferredSpotLightProgram; extern LLGLSLShader gDeferredMultiSpotLightProgram; extern LLGLSLShader gDeferredSunProgram; -extern LLGLSLShader gDeferredGIProgram; -extern LLGLSLShader gDeferredGIFinalProgram; extern LLGLSLShader gDeferredBlurLightProgram; extern LLGLSLShader gDeferredAvatarProgram; extern LLGLSLShader gDeferredSoftenProgram; extern LLGLSLShader gDeferredShadowProgram; extern LLGLSLShader gDeferredShadowAlphaMaskProgram; -extern LLGLSLShader gDeferredPostGIProgram; extern LLGLSLShader gDeferredPostProgram; +extern LLGLSLShader gDeferredCoFProgram; +extern LLGLSLShader gDeferredDoFCombineProgram; +extern LLGLSLShader gFXAAProgram; extern LLGLSLShader gDeferredPostNoDoFProgram; extern LLGLSLShader gDeferredAvatarShadowProgram; extern LLGLSLShader gDeferredAttachmentShadowProgram; extern LLGLSLShader gDeferredAlphaProgram; extern LLGLSLShader gDeferredFullbrightProgram; +extern LLGLSLShader gDeferredEmissiveProgram; extern LLGLSLShader gDeferredAvatarEyesProgram; extern LLGLSLShader gDeferredAvatarAlphaProgram; extern LLGLSLShader gDeferredWLSkyProgram; extern LLGLSLShader gDeferredWLCloudProgram; extern LLGLSLShader gDeferredStarProgram; -extern LLGLSLShader gLuminanceGatherProgram; - -//current avatar shader parameter pointer -extern GLint gAvatarMatrixParam; - +extern LLGLSLShader gNormalMapGenProgram; #endif diff --git a/indra/newview/llviewertexteditor.cpp b/indra/newview/llviewertexteditor.cpp index 0a9fae68a6..b41ed00f17 100644 --- a/indra/newview/llviewertexteditor.cpp +++ b/indra/newview/llviewertexteditor.cpp @@ -88,12 +88,12 @@ public: { LLVector3d global_pos; landmark->getGlobalPos(global_pos); - LLViewerInventoryItem* agent_lanmark = + LLViewerInventoryItem* agent_landmark = LLLandmarkActions::findLandmarkForGlobalPos(global_pos); - if (agent_lanmark) + if (agent_landmark) { - showInfo(agent_lanmark->getUUID()); + showInfo(agent_landmark->getUUID()); } else { @@ -104,8 +104,13 @@ public: } else { + LLInventoryItem* item = item_ptr.get(); LLPointer<LLEmbeddedLandmarkCopied> cb = new LLEmbeddedLandmarkCopied(); - copy_inventory_from_notecard(object_id, notecard_inventory_id, item_ptr.get(), gInventoryCallbacks.registerCB(cb)); + copy_inventory_from_notecard(get_folder_by_itemtype(item), + object_id, + notecard_inventory_id, + item, + gInventoryCallbacks.registerCB(cb)); } } } @@ -1266,9 +1271,11 @@ bool LLViewerTextEditor::importStream(std::istream& str) void LLViewerTextEditor::copyInventory(const LLInventoryItem* item, U32 callback_id) { - copy_inventory_from_notecard(mObjectID, + copy_inventory_from_notecard(LLUUID::null, // Don't specify a destination -- let the sim do that + mObjectID, mNotecardInventoryID, - item, callback_id); + item, + callback_id); } bool LLViewerTextEditor::hasEmbeddedInventory() diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index 280337be0f..f4bbc2b067 100644 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -417,6 +417,48 @@ const S32 min_non_tex_system_mem = (128<<20); // 128 MB F32 texmem_lower_bound_scale = 0.85f; F32 texmem_middle_bound_scale = 0.925f; +//static +bool LLViewerTexture::isMemoryForTextureLow() +{ + const static S32 MIN_FREE_TEXTURE_MEMORY = 5 ; //MB + const static S32 MIN_FREE_MAIN_MEMORy = 100 ; //MB + + bool low_mem = false ; + if (gGLManager.mHasATIMemInfo) + { + S32 meminfo[4]; + glGetIntegerv(GL_TEXTURE_FREE_MEMORY_ATI, meminfo); + + if(meminfo[0] / 1024 < MIN_FREE_TEXTURE_MEMORY) + { + low_mem = true ; + } + } +#if 0 //ignore nVidia cards + else if (gGLManager.mHasNVXMemInfo) + { + S32 free_memory; + glGetIntegerv(GL_GPU_MEMORY_INFO_CURRENT_AVAILABLE_VIDMEM_NVX, &free_memory); + + if(free_memory / 1024 < MIN_FREE_TEXTURE_MEMORY) + { + low_mem = true ; + } + } +#endif + + if(!low_mem) //check main memory, only works for windows. + { + LLMemory::updateMemoryInfo() ; + if(LLMemory::getAvailableMemKB() / 1024 < MIN_FREE_MAIN_MEMORy) + { + low_mem = true ; + } + } + + return low_mem ; +} + //static void LLViewerTexture::updateClass(const F32 velocity, const F32 angular_velocity) { @@ -449,6 +491,11 @@ void LLViewerTexture::updateClass(const F32 velocity, const F32 angular_velocity sEvaluationTimer.reset(); } } + else if(sEvaluationTimer.getElapsedTimeF32() > discard_delta_time && isMemoryForTextureLow()) + { + sDesiredDiscardBias += discard_bias_delta; + sEvaluationTimer.reset(); + } else if (sDesiredDiscardBias > 0.0f && BYTES_TO_MEGA_BYTES(sBoundTextureMemoryInBytes) < sMaxBoundTextureMemInMegaBytes * texmem_lower_bound_scale && BYTES_TO_MEGA_BYTES(sTotalTextureMemoryInBytes) < sMaxTotalTextureMemInMegaBytes * texmem_lower_bound_scale) @@ -2222,6 +2269,7 @@ void LLViewerFetchedTexture::unpauseLoadedCallbacks(const LLLoadedCallbackEntry: } } mPauseLoadedCallBacks = FALSE ; + mLastCallBackActiveTime = sCurrentTime ; if(need_raw) { mSaveRawImage = TRUE ; @@ -2261,13 +2309,18 @@ void LLViewerFetchedTexture::pauseLoadedCallbacks(const LLLoadedCallbackEntry::s bool LLViewerFetchedTexture::doLoadedCallbacks() { - static const F32 MAX_INACTIVE_TIME = 120.f ; //seconds + static const F32 MAX_INACTIVE_TIME = 900.f ; //seconds if (mNeedsCreateTexture) { return false; } - if(sCurrentTime - mLastCallBackActiveTime > MAX_INACTIVE_TIME) + if(mPauseLoadedCallBacks) + { + destroyRawImage(); + return false; //paused + } + if(sCurrentTime - mLastCallBackActiveTime > MAX_INACTIVE_TIME && !mIsFetching) { clearCallbackEntryList() ; //remove all callbacks. return false ; @@ -2290,12 +2343,8 @@ bool LLViewerFetchedTexture::doLoadedCallbacks() // Remove ourself from the global list of textures with callbacks gTextureList.mCallbackList.erase(this); - } - if(mPauseLoadedCallBacks) - { - destroyRawImage(); - return res; //paused - } + return false ; + } S32 gl_discard = getDiscardLevel(); @@ -2557,7 +2606,11 @@ bool LLViewerFetchedTexture::needsToSaveRawImage() void LLViewerFetchedTexture::destroyRawImage() { - if (mAuxRawImage.notNull()) sAuxCount--; + if (mAuxRawImage.notNull()) + { + sAuxCount--; + mAuxRawImage = NULL; + } if (mRawImage.notNull()) { @@ -2571,12 +2624,12 @@ void LLViewerFetchedTexture::destroyRawImage() } setCachedRawImage() ; } + + mRawImage = NULL; + + mIsRawImageValid = FALSE; + mRawDiscardLevel = INVALID_DISCARD_LEVEL; } - - mRawImage = NULL; - mAuxRawImage = NULL; - mIsRawImageValid = FALSE; - mRawDiscardLevel = INVALID_DISCARD_LEVEL; } //use the mCachedRawImage to (re)generate the gl texture. diff --git a/indra/newview/llviewertexture.h b/indra/newview/llviewertexture.h index a4a5ae0a5b..b96441127d 100644 --- a/indra/newview/llviewertexture.h +++ b/indra/newview/llviewertexture.h @@ -267,6 +267,7 @@ private: /*virtual*/ LLImageGL* getGLTexture() const ; virtual void switchToCachedImage(); + static bool isMemoryForTextureLow() ; protected: LLUUID mID; S32 mBoostLevel; // enum describing priority level diff --git a/indra/newview/llviewertexturelist.cpp b/indra/newview/llviewertexturelist.cpp index c64488251a..cddf7dcfea 100644 --- a/indra/newview/llviewertexturelist.cpp +++ b/indra/newview/llviewertexturelist.cpp @@ -530,9 +530,11 @@ void LLViewerTextureList::removeImageFromList(LLViewerFetchedTexture *image) } llerrs << "LLViewerTextureList::removeImageFromList - Image not in list" << llendl; } - if(mImageList.erase(image) != 1) + + S32 count = mImageList.erase(image) ; + if(count != 1) { - llerrs << "Error happens when remove image from mImageList!" << llendl ; + llerrs << "Error happens when remove image from mImageList: " << count << llendl ; } image->setInImageList(FALSE) ; @@ -586,6 +588,11 @@ void LLViewerTextureList::dirtyImage(LLViewerFetchedTexture *image) //////////////////////////////////////////////////////////////////////////// static LLFastTimer::DeclareTimer FTM_IMAGE_MARK_DIRTY("Dirty Images"); +static LLFastTimer::DeclareTimer FTM_IMAGE_UPDATE_PRIORITIES("Prioritize"); +static LLFastTimer::DeclareTimer FTM_IMAGE_CALLBACKS("Callbacks"); +static LLFastTimer::DeclareTimer FTM_IMAGE_FETCH("Fetch"); +static LLFastTimer::DeclareTimer FTM_IMAGE_CREATE("Create"); +static LLFastTimer::DeclareTimer FTM_IMAGE_STATS("Stats"); void LLViewerTextureList::updateImages(F32 max_time) { @@ -597,14 +604,25 @@ void LLViewerTextureList::updateImages(F32 max_time) LLViewerStats::getInstance()->mGLBoundMemStat.addValue((F32)BYTES_TO_MEGA_BYTES(LLImageGL::sBoundTextureMemoryInBytes)); LLViewerStats::getInstance()->mRawMemStat.addValue((F32)BYTES_TO_MEGA_BYTES(LLImageRaw::sGlobalRawMemory)); LLViewerStats::getInstance()->mFormattedMemStat.addValue((F32)BYTES_TO_MEGA_BYTES(LLImageFormatted::sGlobalFormattedMemory)); - - updateImagesDecodePriorities(); + + + { + LLFastTimer t(FTM_IMAGE_UPDATE_PRIORITIES); + updateImagesDecodePriorities(); + } F32 total_max_time = max_time; - max_time -= updateImagesFetchTextures(max_time); + + { + LLFastTimer t(FTM_IMAGE_FETCH); + max_time -= updateImagesFetchTextures(max_time); + } - max_time = llmax(max_time, total_max_time*.50f); // at least 50% of max_time - max_time -= updateImagesCreateTextures(max_time); + { + LLFastTimer t(FTM_IMAGE_CREATE); + max_time = llmax(max_time, total_max_time*.50f); // at least 50% of max_time + max_time -= updateImagesCreateTextures(max_time); + } if (!mDirtyTextureList.empty()) { @@ -612,24 +630,32 @@ void LLViewerTextureList::updateImages(F32 max_time) gPipeline.dirtyPoolObjectTextures(mDirtyTextureList); mDirtyTextureList.clear(); } - bool didone = false; - for (image_list_t::iterator iter = mCallbackList.begin(); - iter != mCallbackList.end(); ) + { - //trigger loaded callbacks on local textures immediately - LLViewerFetchedTexture* image = *iter++; - if (!image->getUrl().empty()) + LLFastTimer t(FTM_IMAGE_CALLBACKS); + bool didone = false; + for (image_list_t::iterator iter = mCallbackList.begin(); + iter != mCallbackList.end(); ) { - // Do stuff to handle callbacks, update priorities, etc. - didone = image->doLoadedCallbacks(); - } - else if (!didone) - { - // Do stuff to handle callbacks, update priorities, etc. - didone = image->doLoadedCallbacks(); + //trigger loaded callbacks on local textures immediately + LLViewerFetchedTexture* image = *iter++; + if (!image->getUrl().empty()) + { + // Do stuff to handle callbacks, update priorities, etc. + didone = image->doLoadedCallbacks(); + } + else if (!didone) + { + // Do stuff to handle callbacks, update priorities, etc. + didone = image->doLoadedCallbacks(); + } } } - updateImagesUpdateStats(); + + { + LLFastTimer t(FTM_IMAGE_STATS); + updateImagesUpdateStats(); + } } void LLViewerTextureList::updateImagesDecodePriorities() @@ -747,7 +773,6 @@ void LLViewerTextureList::updateImagesDecodePriorities() return type_from_host; } */ -static LLFastTimer::DeclareTimer FTM_IMAGE_CREATE("Create Images"); F32 LLViewerTextureList::updateImagesCreateTextures(F32 max_time) { @@ -757,8 +782,7 @@ F32 LLViewerTextureList::updateImagesCreateTextures(F32 max_time) // Create GL textures for all textures that need them (images which have been // decoded, but haven't been pushed into GL). // - LLFastTimer t(FTM_IMAGE_CREATE); - + LLTimer create_timer; image_list_t::iterator enditer = mCreateTextureList.begin(); for (image_list_t::iterator iter = mCreateTextureList.begin(); @@ -1053,6 +1077,13 @@ S32 LLViewerTextureList::getMaxVideoRamSetting(bool get_recommended) // Treat any card with < 32 MB (shudder) as having 32 MB // - it's going to be swapping constantly regardless S32 max_vram = gGLManager.mVRAM; + + if(gGLManager.mIsATI) + { + //shrink the availabe vram for ATI cards because some of them do not handel texture swapping well. + max_vram = (S32)(max_vram * 0.75f); + } + max_vram = llmax(max_vram, getMinVideoRamSetting()); max_texmem = max_vram; if (!get_recommended) @@ -1060,10 +1091,19 @@ S32 LLViewerTextureList::getMaxVideoRamSetting(bool get_recommended) } else { - if (get_recommended) - max_texmem = 128; - else + if (!get_recommended) + { max_texmem = 512; + } + else if (gSavedSettings.getBOOL("NoHardwareProbe")) //did not do hardware detection at startup + { + max_texmem = 512; + } + else + { + max_texmem = 128; + } + llwarns << "VRAM amount not detected, defaulting to " << max_texmem << " MB" << llendl; } diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 6fcbc401af..31dfa1923c 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -489,6 +489,7 @@ public: { F32 cost = 0.f; S32 count = 0; + S32 vcount = 0; S32 object_count = 0; S32 total_bytes = 0; S32 visible_bytes = 0; @@ -510,7 +511,9 @@ public: S32 bytes = 0; S32 visible = 0; cost += object->getStreamingCost(&bytes, &visible); - count += object->getTriangleCount(); + S32 vt = 0; + count += object->getTriangleCount(&vt); + vcount += vt; total_bytes += bytes; visible_bytes += visible; } @@ -521,20 +524,20 @@ public: { label = "Selection"; cost = LLSelectMgr::getInstance()->getSelection()->getSelectedObjectStreamingCost(&total_bytes, &visible_bytes); - count = LLSelectMgr::getInstance()->getSelection()->getSelectedObjectTriangleCount(); + count = LLSelectMgr::getInstance()->getSelection()->getSelectedObjectTriangleCount(&vcount); object_count = LLSelectMgr::getInstance()->getSelection()->getObjectCount(); } addText(xpos,ypos, llformat("%s streaming cost: %.1f", label, cost)); ypos += y_inc; - addText(xpos, ypos, llformat(" %.3f KTris, %.1f/%.1f KB, %d objects", - count/1000.f, visible_bytes/1024.f, total_bytes/1024.f, object_count)); + addText(xpos, ypos, llformat(" %.3f KTris, %.3f KVerts, %.1f/%.1f KB, %d objects", + count/1000.f, vcount/1000.f, visible_bytes/1024.f, total_bytes/1024.f, object_count)); ypos += y_inc; } - addText(xpos, ypos, llformat("%d MB Vertex Data", LLVertexBuffer::sAllocatedBytes/(1024*1024))); + addText(xpos, ypos, llformat("%d MB Vertex Data (%d MB Pooled)", LLVertexBuffer::sAllocatedBytes/(1024*1024), LLVBOPool::sBytesPooled/(1024*1024))); ypos += y_inc; addText(xpos, ypos, llformat("%d Vertex Buffers", LLVertexBuffer::sGLCount)); @@ -737,37 +740,6 @@ public: } } - //temporary hack to give feedback on mesh upload progress - if (!gMeshRepo.mUploads.empty()) - { - for (std::vector<LLMeshUploadThread*>::iterator iter = gMeshRepo.mUploads.begin(); - iter != gMeshRepo.mUploads.end(); ++iter) - { - LLMeshUploadThread* thread = *iter; - - addText(xpos, ypos, llformat("Mesh Uploads: %d", - thread->mPendingUploads)); - ypos += y_inc; - } - } - - if (!gMeshRepo.mPendingRequests.empty() || - !gMeshRepo.mThread->mHeaderReqQ.empty() || - !gMeshRepo.mThread->mLODReqQ.empty()) - { - LLMutexLock lock(gMeshRepo.mThread->mMutex); - S32 pending = (S32) gMeshRepo.mPendingRequests.size(); - S32 header = (S32) gMeshRepo.mThread->mHeaderReqQ.size(); - S32 lod = (S32) gMeshRepo.mThread->mLODReqQ.size(); - - addText(xpos, ypos, llformat ("Mesh Queue - %d pending (%d:%d header | %d:%d LOD)", - pending, - LLMeshRepoThread::sActiveHeaderRequests, header, - LLMeshRepoThread::sActiveLODRequests, lod)); - - ypos += y_inc; - } - if (gSavedSettings.getBOOL("DebugShowTextureInfo")) { LLViewerObject* objectp = NULL ; @@ -838,6 +810,20 @@ void LLViewerWindow::updateDebugText() // LLViewerWindow // +LLViewerWindow::Params::Params() +: title("title"), + name("name"), + x("x"), + y("y"), + width("width"), + height("height"), + min_width("min_width"), + min_height("min_height"), + fullscreen("fullscreen", false), + ignore_pixel_depth("ignore_pixel_depth", false) +{} + + BOOL LLViewerWindow::handleAnyMouseClick(LLWindow *window, LLCoordGL pos, MASK mask, LLMouseHandler::EClickType clicktype, BOOL down) { const char* buttonname = ""; @@ -1531,18 +1517,13 @@ std::string LLViewerWindow::translateString(const char* tag, // // Classes // -LLViewerWindow::LLViewerWindow( - const std::string& title, const std::string& name, - S32 x, S32 y, - S32 width, S32 height, - BOOL fullscreen, BOOL ignore_pixel_depth) // fullscreen is no longer used - : - mWindow(NULL), +LLViewerWindow::LLViewerWindow(const Params& p) +: mWindow(NULL), mActive(true), mUIVisible(true), - mWindowRectRaw(0, height, width, 0), - mWindowRectScaled(0, height, width, 0), - mWorldViewRectRaw(0, height, width, 0), + mWindowRectRaw(0, p.height, p.width, 0), + mWindowRectScaled(0, p.height, p.width, 0), + mWorldViewRectRaw(0, p.height, p.width, 0), mLeftMouseDown(FALSE), mMiddleMouseDown(FALSE), mRightMouseDown(FALSE), @@ -1578,14 +1559,20 @@ LLViewerWindow::LLViewerWindow( // create window mWindow = LLWindowManager::createWindow(this, - title, name, x, y, width, height, 0, - fullscreen, + p.title, p.name, p.x, p.y, p.width, p.height, 0, + p.fullscreen, gHeadlessClient, gSavedSettings.getBOOL("DisableVerticalSync"), !gHeadlessClient, - ignore_pixel_depth, + p.ignore_pixel_depth, gSavedSettings.getBOOL("RenderDeferred") ? 0 : gSavedSettings.getU32("RenderFSAASamples")); //don't use window level anti-aliasing if FBOs are enabled + if (!LLViewerShaderMgr::sInitialized) + { //immediately initialize shaders + LLViewerShaderMgr::sInitialized = TRUE; + LLViewerShaderMgr::instance()->setShaders(); + } + if (NULL == mWindow) { LLSplashScreen::update(LLTrans::getString("StartupRequireDriverUpdate")); @@ -1610,10 +1597,12 @@ LLViewerWindow::LLViewerWindow( LL_WARNS("Window") << " Someone took over my signal/exception handler (post createWindow)!" << LL_ENDL; } + const bool do_not_enforce = false; + mWindow->setMinSize(p.min_width, p.min_height, do_not_enforce); // root view not set LLCoordScreen scr; mWindow->getSize(&scr); - if(fullscreen && ( scr.mX!=width || scr.mY!=height)) + if(p.fullscreen && ( scr.mX!=p.width || scr.mY!=p.height)) { llwarns << "Fullscreen has forced us in to a different resolution now using "<<scr.mX<<" x "<<scr.mY<<llendl; gSavedSettings.setS32("FullScreenWidth",scr.mX); @@ -1722,32 +1711,30 @@ LLViewerWindow::LLViewerWindow( void LLViewerWindow::initGLDefaults() { gGL.setSceneBlendType(LLRender::BT_ALPHA); - glColorMaterial( GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE ); - F32 ambient[4] = {0.f,0.f,0.f,0.f }; - F32 diffuse[4] = {1.f,1.f,1.f,1.f }; - glMaterialfv(GL_FRONT_AND_BACK,GL_AMBIENT,ambient); - glMaterialfv(GL_FRONT_AND_BACK,GL_DIFFUSE,diffuse); - - glPixelStorei(GL_PACK_ALIGNMENT,1); - glPixelStorei(GL_UNPACK_ALIGNMENT,1); + if (!LLGLSLShader::sNoFixedFunction) + { //initialize fixed function state + glColorMaterial( GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE ); - gGL.getTexUnit(0)->enable(LLTexUnit::TT_TEXTURE); + glMaterialfv(GL_FRONT_AND_BACK,GL_AMBIENT,LLColor4::black.mV); + glMaterialfv(GL_FRONT_AND_BACK,GL_DIFFUSE,LLColor4::white.mV); - // lights for objects - glShadeModel( GL_SMOOTH ); + // lights for objects + glShadeModel( GL_SMOOTH ); - glLightModelfv(GL_LIGHT_MODEL_AMBIENT, ambient); - - gGL.getTexUnit(0)->setTextureBlendType(LLTexUnit::TB_MULT); + gGL.getTexUnit(0)->enable(LLTexUnit::TT_TEXTURE); + gGL.getTexUnit(0)->setTextureBlendType(LLTexUnit::TB_MULT); + } + + glPixelStorei(GL_PACK_ALIGNMENT,1); + glPixelStorei(GL_UNPACK_ALIGNMENT,1); + gGL.setAmbientLightColor(LLColor4::black); + glCullFace(GL_BACK); // RN: Need this for translation and stretch manip. - gCone.prerender(); gBox.prerender(); - gSphere.prerender(); - gCylinder.prerender(); } struct MainPanel : public LLPanel @@ -1789,17 +1776,13 @@ void LLViewerWindow::initBase() mLoginPanelHolder = main_view->getChild<LLView>("login_panel_holder")->getHandle(); // Create the toolbar view - // *TODO: Eventually, suppress the existence of this debug setting and turn toolbar FUI on permanently - if (gSavedSettings.getBOOL("DebugToolbarFUI")) - { - // Get a pointer to the toolbar view holder - LLPanel* panel_holder = main_view->getChild<LLPanel>("toolbar_view_holder"); - // Load the toolbar view from file - gToolBarView = LLUICtrlFactory::getInstance()->createFromFile<LLToolBarView>("panel_toolbar_view.xml", panel_holder, LLDefaultChildRegistry::instance()); - gToolBarView->setShape(panel_holder->getLocalRect()); - // Hide the toolbars for the moment: we'll make them visible after logging in world (see LLViewerWindow::initWorldUI()) - gToolBarView->setVisible(FALSE); - } + // Get a pointer to the toolbar view holder + LLPanel* panel_holder = main_view->getChild<LLPanel>("toolbar_view_holder"); + // Load the toolbar view from file + gToolBarView = LLUICtrlFactory::getInstance()->createFromFile<LLToolBarView>("panel_toolbar_view.xml", panel_holder, LLDefaultChildRegistry::instance()); + gToolBarView->setShape(panel_holder->getLocalRect()); + // Hide the toolbars for the moment: we'll make them visible after logging in world (see LLViewerWindow::initWorldUI()) + gToolBarView->setVisible(FALSE); // Constrain floaters to inside the menu and status bar regions. gFloaterView = main_view->getChild<LLFloaterView>("Floater View"); @@ -2157,16 +2140,19 @@ void LLViewerWindow::reshape(S32 width, S32 height) sendShapeToSim(); // store new settings for the mode we are in, regardless - // Only save size if not maximized BOOL maximized = mWindow->getMaximized(); gSavedSettings.setBOOL("WindowMaximized", maximized); - LLCoordScreen window_size; - if (!maximized - && mWindow->getSize(&window_size)) + if (!maximized) { - gSavedSettings.setS32("WindowWidth", window_size.mX); - gSavedSettings.setS32("WindowHeight", window_size.mY); + U32 min_window_width=gSavedSettings.getU32("MinWindowWidth"); + U32 min_window_height=gSavedSettings.getU32("MinWindowHeight"); + // tell the OS specific window code about min window size + mWindow->setMinSize(min_window_width, min_window_height); + + // Only save size if not maximized + gSavedSettings.setU32("WindowWidth", mWindowRectRaw.getWidth()); + gSavedSettings.setU32("WindowHeight", mWindowRectRaw.getHeight()); } LLViewerStats::getInstance()->setStat(LLViewerStats::ST_WINDOW_WIDTH, (F64)width); @@ -2256,6 +2242,10 @@ void LLViewerWindow::drawDebugText() gGL.color4f(1,1,1,1); gGL.pushMatrix(); gGL.pushUIMatrix(); + if (LLGLSLShader::sNoFixedFunction) + { + gUIProgram.bind(); + } { // scale view by UI global scale factor and aspect ratio correction factor gGL.scaleUI(mDisplayScale.mV[VX], mDisplayScale.mV[VY], 1.f); @@ -2265,6 +2255,10 @@ void LLViewerWindow::drawDebugText() gGL.popMatrix(); gGL.flush(); + if (LLGLSLShader::sNoFixedFunction) + { + gUIProgram.unbind(); + } } void LLViewerWindow::draw() @@ -2279,9 +2273,9 @@ void LLViewerWindow::draw() LLUI::setLineWidth(1.f); // Reset any left-over transforms - glMatrixMode(GL_MODELVIEW); + gGL.matrixMode(LLRender::MM_MODELVIEW); - glLoadIdentity(); + gGL.loadIdentity(); //S32 screen_x, screen_y; @@ -2296,7 +2290,7 @@ void LLViewerWindow::draw() // draw timecode block std::string text; - glLoadIdentity(); + gGL.loadIdentity(); microsecondsToTimecodeString(gFrameTime,text); const LLFontGL* font = LLFontGL::getFontSansSerif(); @@ -2332,10 +2326,10 @@ void LLViewerWindow::draw() int pos_y = sub_region / llceil(zoom_factor); int pos_x = sub_region - (pos_y*llceil(zoom_factor)); // offset for this tile - glTranslatef((F32)getWindowWidthScaled() * -(F32)pos_x, + gGL.translatef((F32)getWindowWidthScaled() * -(F32)pos_x, (F32)getWindowHeightScaled() * -(F32)pos_y, 0.f); - glScalef(zoom_factor, zoom_factor, 1.f); + gGL.scalef(zoom_factor, zoom_factor, 1.f); LLUI::sGLScaleFactor *= zoom_factor; } @@ -2364,7 +2358,7 @@ void LLViewerWindow::draw() S32 screen_x, screen_y; top_ctrl->localPointToScreen(0, 0, &screen_x, &screen_y); - glMatrixMode(GL_MODELVIEW); + gGL.matrixMode(LLRender::MM_MODELVIEW); LLUI::pushMatrix(); LLUI::translate( (F32) screen_x, (F32) screen_y, 0.f); top_ctrl->draw(); @@ -3424,17 +3418,17 @@ void LLViewerWindow::renderSelections( BOOL for_gl_pick, BOOL pick_parcel_walls, LLBBox hud_bbox = gAgentAvatarp->getHUDBBox(); // set up transform to encompass bounding box of HUD - glMatrixMode(GL_PROJECTION); - glPushMatrix(); - glLoadIdentity(); + gGL.matrixMode(LLRender::MM_PROJECTION); + gGL.pushMatrix(); + gGL.loadIdentity(); F32 depth = llmax(1.f, hud_bbox.getExtentLocal().mV[VX] * 1.1f); - glOrtho(-0.5f * LLViewerCamera::getInstance()->getAspect(), 0.5f * LLViewerCamera::getInstance()->getAspect(), -0.5f, 0.5f, 0.f, depth); + gGL.ortho(-0.5f * LLViewerCamera::getInstance()->getAspect(), 0.5f * LLViewerCamera::getInstance()->getAspect(), -0.5f, 0.5f, 0.f, depth); - glMatrixMode(GL_MODELVIEW); - glPushMatrix(); - glLoadIdentity(); - glLoadMatrixf(OGL_TO_CFR_ROTATION); // Load Cory's favorite reference frame - glTranslatef(-hud_bbox.getCenterLocal().mV[VX] + (depth *0.5f), 0.f, 0.f); + gGL.matrixMode(LLRender::MM_MODELVIEW); + gGL.pushMatrix(); + gGL.loadIdentity(); + gGL.loadMatrix(OGL_TO_CFR_ROTATION); // Load Cory's favorite reference frame + gGL.translatef(-hud_bbox.getCenterLocal().mV[VX] + (depth *0.5f), 0.f, 0.f); } // Render light for editing @@ -3444,12 +3438,12 @@ void LLViewerWindow::renderSelections( BOOL for_gl_pick, BOOL pick_parcel_walls, LLGLEnable gls_blend(GL_BLEND); LLGLEnable gls_cull(GL_CULL_FACE); LLGLDepthTest gls_depth(GL_TRUE, GL_FALSE); - glMatrixMode(GL_MODELVIEW); - glPushMatrix(); + gGL.matrixMode(LLRender::MM_MODELVIEW); + gGL.pushMatrix(); if (selection->getSelectType() == SELECT_TYPE_HUD) { F32 zoom = gAgentCamera.mHUDCurZoom; - glScalef(zoom, zoom, zoom); + gGL.scalef(zoom, zoom, zoom); } struct f : public LLSelectedObjectFunctor @@ -3460,33 +3454,33 @@ void LLViewerWindow::renderSelections( BOOL for_gl_pick, BOOL pick_parcel_walls, if (drawable && drawable->isLight()) { LLVOVolume* vovolume = drawable->getVOVolume(); - glPushMatrix(); + gGL.pushMatrix(); LLVector3 center = drawable->getPositionAgent(); - glTranslatef(center[0], center[1], center[2]); + gGL.translatef(center[0], center[1], center[2]); F32 scale = vovolume->getLightRadius(); - glScalef(scale, scale, scale); + gGL.scalef(scale, scale, scale); LLColor4 color(vovolume->getLightColor(), .5f); - glColor4fv(color.mV); + gGL.color4fv(color.mV); - F32 pixel_area = 100000.f; + //F32 pixel_area = 100000.f; // Render Outside - gSphere.render(pixel_area); + gSphere.render(); // Render Inside glCullFace(GL_FRONT); - gSphere.render(pixel_area); + gSphere.render(); glCullFace(GL_BACK); - glPopMatrix(); + gGL.popMatrix(); } return true; } } func; LLSelectMgr::getInstance()->getSelection()->applyToObjects(&func); - glPopMatrix(); + gGL.popMatrix(); } // NOTE: The average position for the axis arrows of the selected objects should @@ -3549,11 +3543,11 @@ void LLViewerWindow::renderSelections( BOOL for_gl_pick, BOOL pick_parcel_walls, } if (selection->getSelectType() == SELECT_TYPE_HUD && selection->getObjectCount()) { - glMatrixMode(GL_PROJECTION); - glPopMatrix(); + gGL.matrixMode(LLRender::MM_PROJECTION); + gGL.popMatrix(); - glMatrixMode(GL_MODELVIEW); - glPopMatrix(); + gGL.matrixMode(LLRender::MM_MODELVIEW); + gGL.popMatrix(); stop_glerror(); } } @@ -4020,10 +4014,11 @@ BOOL LLViewerWindow::mousePointOnLandGlobal(const S32 x, const S32 y, LLVector3d } // Saves an image to the harddrive as "SnapshotX" where X >= 1. -BOOL LLViewerWindow::saveImageNumbered(LLImageFormatted *image) +BOOL LLViewerWindow::saveImageNumbered(LLImageFormatted *image, bool force_picker) { if (!image) { + llwarns << "No image to save" << llendl; return FALSE; } @@ -4043,7 +4038,7 @@ BOOL LLViewerWindow::saveImageNumbered(LLImageFormatted *image) pick_type = LLFilePicker::FFSAVE_ALL; // ??? // Get a base file location if needed. - if ( ! isSnapshotLocSet()) + if (force_picker || !isSnapshotLocSet()) { std::string proposed_name( sSnapshotBaseName ); @@ -4083,6 +4078,7 @@ BOOL LLViewerWindow::saveImageNumbered(LLImageFormatted *image) } while( -1 != err ); // search until the file is not found (i.e., stat() gives an error). + llinfos << "Saving snapshot to " << filepath << llendl; return image->save(filepath); } @@ -4091,25 +4087,18 @@ void LLViewerWindow::resetSnapshotLoc() sSnapshotDir.clear(); } -static S32 BORDERHEIGHT = 0; -static S32 BORDERWIDTH = 0; - // static void LLViewerWindow::movieSize(S32 new_width, S32 new_height) { - LLCoordScreen size; + LLCoordWindow size; gViewerWindow->getWindow()->getSize(&size); - if ( (size.mX != new_width + BORDERWIDTH) - ||(size.mY != new_height + BORDERHEIGHT)) + if ( size.mX != new_width + || size.mY != new_height) { - // use actual display dimensions, not virtual UI dimensions - S32 x = gViewerWindow->getWindowWidthRaw(); - S32 y = gViewerWindow->getWindowHeightRaw(); - BORDERWIDTH = size.mX - x; - BORDERHEIGHT = size.mY- y; - LLCoordScreen new_size(new_width + BORDERWIDTH, - new_height + BORDERHEIGHT); - gViewerWindow->getWindow()->setSize(new_size); + LLCoordWindow new_size(new_width, new_height); + LLCoordScreen screen_size; + gViewerWindow->getWindow()->convertCoords(new_size, &screen_size); + gViewerWindow->getWindow()->setSize(screen_size); } } @@ -4667,10 +4656,7 @@ void LLViewerWindow::stopGL(BOOL save_state) gPipeline.destroyGL(); } - gCone.cleanupGL(); gBox.cleanupGL(); - gSphere.cleanupGL(); - gCylinder.cleanupGL(); if(gPostProcess) { @@ -4744,6 +4730,9 @@ void LLViewerWindow::initFonts(F32 zoom_factor) { LLFontGL::destroyAllGL(); // Initialize with possibly different zoom factor + + LLFontManager::initClass(); + LLFontGL::initClass( gSavedSettings.getF32("FontScreenDPI"), mDisplayScale.mV[VX] * zoom_factor, mDisplayScale.mV[VY] * zoom_factor, diff --git a/indra/newview/llviewerwindow.h b/indra/newview/llviewerwindow.h index d10b06f121..6efcaeaf18 100644 --- a/indra/newview/llviewerwindow.h +++ b/indra/newview/llviewerwindow.h @@ -44,6 +44,7 @@ #include "llstat.h" #include "llmousehandler.h" #include "llhandle.h" +#include "llinitparam.h" #include <boost/function.hpp> #include <boost/signals2.hpp> @@ -133,7 +134,23 @@ public: // // CREATORS // - LLViewerWindow(const std::string& title, const std::string& name, S32 x, S32 y, S32 width, S32 height, BOOL fullscreen, BOOL ignore_pixel_depth); + struct Params : public LLInitParam::Block<Params> + { + Mandatory<std::string> title, + name; + Mandatory<S32> x, + y, + width, + height, + min_width, + min_height; + Optional<bool> fullscreen, + ignore_pixel_depth; + + Params(); + }; + + LLViewerWindow(const Params& p); virtual ~LLViewerWindow(); void shutdownViews(); @@ -324,7 +341,7 @@ public: BOOL thumbnailSnapshot(LLImageRaw *raw, S32 preview_width, S32 preview_height, BOOL show_ui, BOOL do_rebuild, ESnapshotType type) ; BOOL isSnapshotLocSet() const { return ! sSnapshotDir.empty(); } void resetSnapshotLoc() const { sSnapshotDir.clear(); } - BOOL saveImageNumbered(LLImageFormatted *image); + BOOL saveImageNumbered(LLImageFormatted *image, bool force_picker = false); // Reset the directory where snapshots are saved. // Client will open directory picker on next snapshot save. diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index bdab250b49..4767ba2bed 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -690,7 +690,8 @@ LLVOAvatar::LLVOAvatar(const LLUUID& id, mFullyLoadedInitialized(FALSE), mSupportsAlphaLayers(FALSE), mLoadedCallbacksPaused(FALSE), - mHasPelvisOffset( FALSE ) + mHasPelvisOffset( FALSE ), + mRenderUnloadedAvatar(LLCachedControl<bool>(gSavedSettings, "RenderUnloadedAvatar")) { LLMemType mt(LLMemType::MTYPE_AVATAR); //VTResume(); // VTune @@ -2117,8 +2118,8 @@ void LLVOAvatar::updateMeshData() } else { - if (buff->getRequestedIndices() == num_indices && - buff->getRequestedVerts() == num_vertices) + if (buff->getNumIndices() == num_indices && + buff->getNumVerts() == num_vertices) { terse_update = true; } @@ -2138,11 +2139,19 @@ void LLVOAvatar::updateMeshData() for(S32 k = j ; k < part_index ; k++) { - mMeshLOD[k]->updateFaceData(facep, mAdjustedPixelArea, k == MESH_ID_HAIR, terse_update); + bool rigid = false; + if (k == MESH_ID_EYEBALL_LEFT || + k == MESH_ID_EYEBALL_RIGHT) + { //eyeballs can't have terse updates since they're never rendered with + //the hardware skinning shader + rigid = true; + } + + mMeshLOD[k]->updateFaceData(facep, mAdjustedPixelArea, k == MESH_ID_HAIR, terse_update && !rigid); } stop_glerror(); - buff->setBuffer(0); + buff->flush(); if(!f_num) { @@ -4135,7 +4144,7 @@ U32 LLVOAvatar::renderSkinned(EAvatarRenderPass pass) LLVertexBuffer* vb = mDrawable->getFace(0)->getVertexBuffer(); if (vb) { - vb->setBuffer(0); + vb->flush(); } } } @@ -6485,10 +6494,7 @@ BOOL LLVOAvatar::processFullyLoadedChange(bool loading) BOOL LLVOAvatar::isFullyLoaded() const { - if (gSavedSettings.getBOOL("RenderUnloadedAvatar")) - return TRUE; - else - return mFullyLoaded; + return (mRenderUnloadedAvatar || mFullyLoaded); } bool LLVOAvatar::isTooComplex() const @@ -8335,7 +8341,7 @@ void LLVOAvatar::getImpostorValues(LLVector4a* extents, LLVector3& angle, F32& d void LLVOAvatar::idleUpdateRenderCost() { static const U32 ARC_BODY_PART_COST = 200; - static const U32 ARC_LIMIT = 2048; + static const U32 ARC_LIMIT = 20000; static std::set<LLUUID> all_textures; diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index e53b8e3f4b..59796370ae 100644 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -40,6 +40,7 @@ #include "lldrawpoolalpha.h" #include "llviewerobject.h" #include "llcharacter.h" +#include "llcontrol.h" #include "llviewerjointmesh.h" #include "llviewerjointattachment.h" #include "llrendertarget.h" @@ -450,6 +451,8 @@ private: F32 mImpostorDistance; F32 mImpostorPixelArea; LLVector3 mLastAnimExtents[2]; + + LLCachedControl<bool> mRenderUnloadedAvatar; //-------------------------------------------------------------------- // Wind rippling in clothes diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index 59883e0bb1..581912f844 100644 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -2558,7 +2558,7 @@ void LLVOAvatarSelf::deleteScratchTextures() LLImageGL::decTextureCounter(tex_size, 1, LLViewerTexture::AVATAR_SCRATCH_TEX) ; total_tex_size -= tex_size ; } - if( sScratchTexNames.checkData( GL_LUMINANCE_ALPHA ) ) + if( sScratchTexNames.checkData( LLRender::sGLCoreProfile ? GL_RG : GL_LUMINANCE_ALPHA ) ) { LLImageGL::decTextureCounter(tex_size, 2, LLViewerTexture::AVATAR_SCRATCH_TEX) ; total_tex_size -= 2 * tex_size ; @@ -2600,89 +2600,6 @@ void LLVOAvatarSelf::deleteScratchTextures() } } -BOOL LLVOAvatarSelf::bindScratchTexture( LLGLenum format ) -{ - U32 texture_bytes = 0; - S32 components = 0; - GLuint gl_name = getScratchTexName( format, components, &texture_bytes ); - if( gl_name ) - { - gGL.getTexUnit(0)->bindManual(LLTexUnit::TT_TEXTURE, gl_name); - stop_glerror(); - - F32* last_bind_time = sScratchTexLastBindTime.getIfThere( format ); - if( last_bind_time ) - { - if( *last_bind_time != LLImageGL::sLastFrameTime ) - { - *last_bind_time = LLImageGL::sLastFrameTime; - LLImageGL::updateBoundTexMem(texture_bytes, components, LLViewerTexture::AVATAR_SCRATCH_TEX) ; - } - } - else - { - LLImageGL::updateBoundTexMem(texture_bytes, components, LLViewerTexture::AVATAR_SCRATCH_TEX) ; - sScratchTexLastBindTime.addData( format, new F32(LLImageGL::sLastFrameTime) ); - } - return TRUE; - } - return FALSE; -} - -LLGLuint LLVOAvatarSelf::getScratchTexName( LLGLenum format, S32& components, U32* texture_bytes ) -{ - GLenum internal_format; - switch( format ) - { - case GL_LUMINANCE: components = 1; internal_format = GL_LUMINANCE8; break; - case GL_ALPHA: components = 1; internal_format = GL_ALPHA8; break; - case GL_LUMINANCE_ALPHA: components = 2; internal_format = GL_LUMINANCE8_ALPHA8; break; - case GL_RGB: components = 3; internal_format = GL_RGB8; break; - case GL_RGBA: components = 4; internal_format = GL_RGBA8; break; - default: llassert(0); components = 4; internal_format = GL_RGBA8; break; - } - - *texture_bytes = components * SCRATCH_TEX_WIDTH * SCRATCH_TEX_HEIGHT; - - if( sScratchTexNames.checkData( format ) ) - { - return *( sScratchTexNames.getData( format ) ); - } - - LLGLSUIDefault gls_ui; - - U32 name = 0; - LLImageGL::generateTextures(1, &name ); - stop_glerror(); - - gGL.getTexUnit(0)->bindManual(LLTexUnit::TT_TEXTURE, name); - stop_glerror(); - - LLImageGL::setManualImage( - GL_TEXTURE_2D, 0, internal_format, - SCRATCH_TEX_WIDTH, SCRATCH_TEX_HEIGHT, - format, GL_UNSIGNED_BYTE, NULL ); - stop_glerror(); - - gGL.getTexUnit(0)->setTextureFilteringOption(LLTexUnit::TFO_BILINEAR); - gGL.getTexUnit(0)->setTextureAddressMode(LLTexUnit::TAM_CLAMP); - stop_glerror(); - - gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); - stop_glerror(); - - sScratchTexNames.addData( format, new LLGLuint( name ) ); - - sScratchTexBytes += *texture_bytes; - LLImageGL::sGlobalTextureMemoryInBytes += *texture_bytes; - - if(gAuditTexture) - { - LLImageGL::incTextureCounter(SCRATCH_TEX_WIDTH * SCRATCH_TEX_HEIGHT, components, LLViewerTexture::AVATAR_SCRATCH_TEX) ; - } - return name; -} - // static void LLVOAvatarSelf::dumpScratchTextureByteCount() { diff --git a/indra/newview/llvoavatarself.h b/indra/newview/llvoavatarself.h index 51f06dee5f..74ff47a3e4 100644 --- a/indra/newview/llvoavatarself.h +++ b/indra/newview/llvoavatarself.h @@ -249,10 +249,7 @@ public: // Scratch textures (used for compositing) //-------------------------------------------------------------------- public: - BOOL bindScratchTexture(LLGLenum format); static void deleteScratchTextures(); -protected: - LLGLuint getScratchTexName(LLGLenum format, S32& components, U32* texture_bytes); private: static S32 sScratchTexBytes; static LLMap< LLGLenum, LLGLuint*> sScratchTexNames; diff --git a/indra/newview/llvograss.cpp b/indra/newview/llvograss.cpp index 32822e1181..8a79d564d3 100644 --- a/indra/newview/llvograss.cpp +++ b/indra/newview/llvograss.cpp @@ -464,7 +464,7 @@ void LLVOGrass::plantBlades() } void LLVOGrass::getGeometry(S32 idx, - LLStrider<LLVector3>& verticesp, + LLStrider<LLVector4a>& verticesp, LLStrider<LLVector3>& normalsp, LLStrider<LLVector2>& texcoordsp, LLStrider<LLColor4U>& colorsp, @@ -516,21 +516,24 @@ void LLVOGrass::getGeometry(S32 idx, position.mV[0] = mPosition.mV[VX] + x + xf; position.mV[1] = mPosition.mV[VY] + y + yf; position.mV[2] = mRegionp->getLand().resolveHeightRegion(position); - *verticesp++ = v1 = position + mRegionp->getOriginAgent(); - *verticesp++ = v1; + v1 = position + mRegionp->getOriginAgent(); + (*verticesp++).load3(v1.mV); + (*verticesp++).load3(v1.mV); position.mV[0] += dzx; position.mV[1] += dzy; position.mV[2] += blade_height; - *verticesp++ = v2 = position + mRegionp->getOriginAgent(); - *verticesp++ = v2; + v2 = position + mRegionp->getOriginAgent(); + (*verticesp++).load3(v2.mV); + (*verticesp++).load3(v2.mV); position.mV[0] = mPosition.mV[VX] + x - xf; position.mV[1] = mPosition.mV[VY] + y - xf; position.mV[2] = mRegionp->getLand().resolveHeightRegion(position); - *verticesp++ = v3 = position + mRegionp->getOriginAgent(); - *verticesp++ = v3; + v3 = position + mRegionp->getOriginAgent(); + (*verticesp++).load3(v3.mV); + (*verticesp++).load3(v3.mV); LLVector3 normal1 = (v1-v2) % (v2-v3); normal1.mV[VZ] = 0.75f; @@ -541,8 +544,9 @@ void LLVOGrass::getGeometry(S32 idx, position.mV[0] += dzx; position.mV[1] += dzy; position.mV[2] += blade_height; - *verticesp++ = v1 = position + mRegionp->getOriginAgent(); - *verticesp++ = v1; + v1 = position + mRegionp->getOriginAgent(); + (*verticesp++).load3(v1.mV); + (*verticesp++).load3(v1.mV); *(normalsp++) = normal1; *(normalsp++) = normal2; diff --git a/indra/newview/llvograss.h b/indra/newview/llvograss.h index c262fdcc79..00a59facf7 100644 --- a/indra/newview/llvograss.h +++ b/indra/newview/llvograss.h @@ -59,7 +59,7 @@ public: /*virtual*/ LLDrawable* createDrawable(LLPipeline *pipeline); /*virtual*/ BOOL updateGeometry(LLDrawable *drawable); /*virtual*/ void getGeometry(S32 idx, - LLStrider<LLVector3>& verticesp, + LLStrider<LLVector4a>& verticesp, LLStrider<LLVector3>& normalsp, LLStrider<LLVector2>& texcoordsp, LLStrider<LLColor4U>& colorsp, diff --git a/indra/newview/llvoground.cpp b/indra/newview/llvoground.cpp index ce256fdedf..0060f81ab5 100644 --- a/indra/newview/llvoground.cpp +++ b/indra/newview/llvoground.cpp @@ -162,7 +162,7 @@ BOOL LLVOGround::updateGeometry(LLDrawable *drawable) *(texCoordsp++) = LLVector2(0.f, 1.f); *(texCoordsp++) = LLVector2(0.5f, 0.5f); - face->getVertexBuffer()->setBuffer(0); + face->getVertexBuffer()->flush(); LLPipeline::sCompiles++; return TRUE; } diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp index 8ecf4a80b7..df1d3f2955 100644 --- a/indra/newview/llvoicevivox.cpp +++ b/indra/newview/llvoicevivox.cpp @@ -61,7 +61,6 @@ #include "llviewerwindow.h" #include "llviewercamera.h" -#include "llfloaterfriends.h" //VIVOX, inorder to refresh communicate panel #include "llviewernetwork.h" #include "llnotificationsutil.h" @@ -7020,7 +7019,6 @@ void LLVivoxVoiceClient::captureBufferPlayStopSendMessage() LLVivoxProtocolParser::LLVivoxProtocolParser() { - parser = NULL; parser = XML_ParserCreate(NULL); reset(); diff --git a/indra/newview/llvopartgroup.cpp b/indra/newview/llvopartgroup.cpp index a4b0910c92..5c10a80b07 100644 --- a/indra/newview/llvopartgroup.cpp +++ b/indra/newview/llvopartgroup.cpp @@ -274,7 +274,7 @@ BOOL LLVOPartGroup::updateGeometry(LLDrawable *drawable) } void LLVOPartGroup::getGeometry(S32 idx, - LLStrider<LLVector3>& verticesp, + LLStrider<LLVector4a>& verticesp, LLStrider<LLVector3>& normalsp, LLStrider<LLVector2>& texcoordsp, LLStrider<LLColor4U>& colorsp, @@ -290,37 +290,54 @@ void LLVOPartGroup::getGeometry(S32 idx, U32 vert_offset = mDrawable->getFace(idx)->getGeomIndex(); - LLVector3 part_pos_agent(part.mPosAgent); - LLVector3 camera_agent = getCameraPosition(); - LLVector3 at = part_pos_agent - camera_agent; - LLVector3 up; - LLVector3 right; - - right = at % LLVector3(0.f, 0.f, 1.f); - right.normalize(); - up = right % at; - up.normalize(); + LLVector4a part_pos_agent; + part_pos_agent.load3(part.mPosAgent.mV); + LLVector4a camera_agent; + camera_agent.load3(getCameraPosition().mV); + LLVector4a at; + at.setSub(part_pos_agent, camera_agent); + LLVector4a up(0, 0, 1); + LLVector4a right; + + right.setCross3(at, up); + right.normalize3fast(); + up.setCross3(right, at); + up.normalize3fast(); if (part.mFlags & LLPartData::LL_PART_FOLLOW_VELOCITY_MASK) { - LLVector3 normvel = part.mVelocity; - normvel.normalize(); + LLVector4a normvel; + normvel.load3(part.mVelocity.mV); + normvel.normalize3fast(); LLVector2 up_fracs; - up_fracs.mV[0] = normvel*right; - up_fracs.mV[1] = normvel*up; + up_fracs.mV[0] = normvel.dot3(right).getF32(); + up_fracs.mV[1] = normvel.dot3(up).getF32(); up_fracs.normalize(); - LLVector3 new_up; - LLVector3 new_right; - new_up = up_fracs.mV[0] * right + up_fracs.mV[1]*up; - new_right = up_fracs.mV[1] * right - up_fracs.mV[0]*up; + LLVector4a new_up; + LLVector4a new_right; + + //new_up = up_fracs.mV[0] * right + up_fracs.mV[1]*up; + LLVector4a t = right; + t.mul(up_fracs.mV[0]); + new_up = up; + new_up.mul(up_fracs.mV[1]); + new_up.add(t); + + //new_right = up_fracs.mV[1] * right - up_fracs.mV[0]*up; + t = right; + t.mul(up_fracs.mV[1]); + new_right = up; + new_right.mul(up_fracs.mV[0]); + t.sub(new_right); + up = new_up; - right = new_right; - up.normalize(); - right.normalize(); + right = t; + up.normalize3fast(); + right.normalize3fast(); } - right *= 0.5f*part.mScale.mV[0]; - up *= 0.5f*part.mScale.mV[1]; + right.mul(0.5f*part.mScale.mV[0]); + up.mul(0.5f*part.mScale.mV[1]); LLVector3 normal = -LLViewerCamera::getInstance()->getXAxis(); @@ -329,14 +346,25 @@ void LLVOPartGroup::getGeometry(S32 idx, // this works because there is actually a 4th float stored after the vertex position which is used as a texture index // also, somebody please VECTORIZE THIS - verticesp->mV[3] = 0.f; - *verticesp++ = part_pos_agent + up - right; - verticesp->mV[3] = 0.f; - *verticesp++ = part_pos_agent - up - right; - verticesp->mV[3] = 0.f; - *verticesp++ = part_pos_agent + up + right; - verticesp->mV[3] = 0.f; - *verticesp++ = part_pos_agent - up + right; + LLVector4a ppapu; + LLVector4a ppamu; + + ppapu.setAdd(part_pos_agent, up); + ppamu.setSub(part_pos_agent, up); + + verticesp->setSub(ppapu, right); + (*verticesp++).getF32ptr()[3] = 0.f; + verticesp->setSub(ppamu, right); + (*verticesp++).getF32ptr()[3] = 0.f; + verticesp->setAdd(ppapu, right); + (*verticesp++).getF32ptr()[3] = 0.f; + verticesp->setAdd(ppamu, right); + (*verticesp++).getF32ptr()[3] = 0.f; + + //*verticesp++ = part_pos_agent + up - right; + //*verticesp++ = part_pos_agent - up - right; + //*verticesp++ = part_pos_agent + up + right; + //*verticesp++ = part_pos_agent - up + right; *colorsp++ = part.mColor; *colorsp++ = part.mColor; @@ -453,7 +481,7 @@ void LLParticlePartition::getGeometry(LLSpatialGroup* group) LLVertexBuffer* buffer = group->mVertexBuffer; LLStrider<U16> indicesp; - LLStrider<LLVector3> verticesp; + LLStrider<LLVector4a> verticesp; LLStrider<LLVector3> normalsp; LLStrider<LLVector2> texcoordsp; LLStrider<LLColor4U> colorsp; @@ -513,7 +541,7 @@ void LLParticlePartition::getGeometry(LLSpatialGroup* group) } } - buffer->setBuffer(0); + buffer->flush(); mFaceList.clear(); } diff --git a/indra/newview/llvopartgroup.h b/indra/newview/llvopartgroup.h index 4db893b4ef..e58fed86d9 100644 --- a/indra/newview/llvopartgroup.h +++ b/indra/newview/llvopartgroup.h @@ -60,7 +60,7 @@ public: /*virtual*/ LLDrawable* createDrawable(LLPipeline *pipeline); /*virtual*/ BOOL updateGeometry(LLDrawable *drawable); void getGeometry(S32 idx, - LLStrider<LLVector3>& verticesp, + LLStrider<LLVector4a>& verticesp, LLStrider<LLVector3>& normalsp, LLStrider<LLVector2>& texcoordsp, LLStrider<LLColor4U>& colorsp, diff --git a/indra/newview/llvosky.cpp b/indra/newview/llvosky.cpp index ef21e7373e..e9db37821b 100644 --- a/indra/newview/llvosky.cpp +++ b/indra/newview/llvosky.cpp @@ -1267,7 +1267,7 @@ void LLVOSky::updateDummyVertexBuffer() LLStrider<LLVector3> vertices ; mFace[FACE_DUMMY]->getVertexBuffer()->getVertexStrider(vertices, 0); *vertices = mCameraPosAgent ; - mFace[FACE_DUMMY]->getVertexBuffer()->setBuffer(0) ; + mFace[FACE_DUMMY]->getVertexBuffer()->flush(); } //---------------------------------- //end of fake vertex buffer updating @@ -1351,7 +1351,7 @@ BOOL LLVOSky::updateGeometry(LLDrawable *drawable) *indicesp++ = index_offset + 3; *indicesp++ = index_offset + 2; - buff->setBuffer(0); + buff->flush(); } } @@ -1516,7 +1516,7 @@ BOOL LLVOSky::updateHeavenlyBodyGeometry(LLDrawable *drawable, const S32 f, cons *indicesp++ = index_offset + 2; *indicesp++ = index_offset + 3; - facep->getVertexBuffer()->setBuffer(0); + facep->getVertexBuffer()->flush(); if (is_sun) { @@ -2030,7 +2030,7 @@ void LLVOSky::updateReflectionGeometry(LLDrawable *drawable, F32 H, } } - face->getVertexBuffer()->setBuffer(0); + face->getVertexBuffer()->flush(); } @@ -2040,9 +2040,12 @@ void LLVOSky::updateFog(const F32 distance) { if (!gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_FOG)) { - glFogf(GL_FOG_DENSITY, 0); - glFogfv(GL_FOG_COLOR, (F32 *) &LLColor4::white.mV); - glFogf(GL_FOG_END, 1000000.f); + if (!LLGLSLShader::sNoFixedFunction) + { + glFogf(GL_FOG_DENSITY, 0); + glFogfv(GL_FOG_COLOR, (F32 *) &LLColor4::white.mV); + glFogf(GL_FOG_END, 1000000.f); + } return; } @@ -2112,7 +2115,10 @@ void LLVOSky::updateFog(const F32 distance) if (camera_height > water_height) { LLColor4 fog(render_fog_color); - glFogfv(GL_FOG_COLOR, fog.mV); + if (!LLGLSLShader::sNoFixedFunction) + { + glFogfv(GL_FOG_COLOR, fog.mV); + } mGLFogCol = fog; if (hide_clip_plane) @@ -2120,13 +2126,19 @@ void LLVOSky::updateFog(const F32 distance) // For now, set the density to extend to the cull distance. const F32 f_log = 2.14596602628934723963618357029f; // sqrt(fabs(log(0.01f))) fog_density = f_log/fog_distance; - glFogi(GL_FOG_MODE, GL_EXP2); + if (!LLGLSLShader::sNoFixedFunction) + { + glFogi(GL_FOG_MODE, GL_EXP2); + } } else { const F32 f_log = 4.6051701859880913680359829093687f; // fabs(log(0.01f)) fog_density = (f_log)/fog_distance; - glFogi(GL_FOG_MODE, GL_EXP); + if (!LLGLSLShader::sNoFixedFunction) + { + glFogi(GL_FOG_MODE, GL_EXP); + } } } else @@ -2146,23 +2158,29 @@ void LLVOSky::updateFog(const F32 distance) fogCol.setAlpha(1); // set the gl fog color - glFogfv(GL_FOG_COLOR, (F32 *) &fogCol.mV); mGLFogCol = fogCol; // set the density based on what the shaders use fog_density = water_fog_density * gSavedSettings.getF32("WaterGLFogDensityScale"); - glFogi(GL_FOG_MODE, GL_EXP2); + + if (!LLGLSLShader::sNoFixedFunction) + { + glFogfv(GL_FOG_COLOR, (F32 *) &fogCol.mV); + glFogi(GL_FOG_MODE, GL_EXP2); + } } mFogColor = sky_fog_color; mFogColor.setAlpha(1); - LLGLSFog gls_fog; + LLDrawPoolWater::sWaterFogEnd = fog_distance*2.2f; - glFogf(GL_FOG_END, fog_distance*2.2f); - - glFogf(GL_FOG_DENSITY, fog_density); - - glHint(GL_FOG_HINT, GL_NICEST); + if (!LLGLSLShader::sNoFixedFunction) + { + LLGLSFog gls_fog; + glFogf(GL_FOG_END, fog_distance*2.2f); + glFogf(GL_FOG_DENSITY, fog_density); + glHint(GL_FOG_HINT, GL_NICEST); + } stop_glerror(); } diff --git a/indra/newview/llvosurfacepatch.cpp b/indra/newview/llvosurfacepatch.cpp index 510525259f..c3a2e6a712 100644 --- a/indra/newview/llvosurfacepatch.cpp +++ b/indra/newview/llvosurfacepatch.cpp @@ -57,8 +57,14 @@ public: }; // virtual - void setupVertexBuffer(U32 data_mask) const + void setupVertexBuffer(U32 data_mask) { + if (LLGLSLShader::sNoFixedFunction) + { //just use default if shaders are in play + LLVertexBuffer::setupVertexBuffer(data_mask & ~(MAP_TEXCOORD2 | MAP_TEXCOORD3)); + return; + } + U8* base = useVBOs() ? (U8*) mAlignedOffset : mMappedData; //assume tex coords 2 and 3 are present @@ -106,20 +112,6 @@ public: glColorPointer(4, GL_UNSIGNED_BYTE, LLVertexBuffer::sTypeSize[TYPE_COLOR], (void*)(base + mOffsets[TYPE_COLOR])); } - if (data_mask & MAP_WEIGHT) - { - glVertexAttribPointerARB(1, 1, GL_FLOAT, FALSE, LLVertexBuffer::sTypeSize[TYPE_WEIGHT], (void*)(base + mOffsets[TYPE_WEIGHT])); - } - - if (data_mask & MAP_WEIGHT4 && sWeight4Loc != -1) - { - glVertexAttribPointerARB(sWeight4Loc, 4, GL_FLOAT, FALSE, LLVertexBuffer::sTypeSize[TYPE_WEIGHT4], (void*)(base+mOffsets[TYPE_WEIGHT4])); - } - - if (data_mask & MAP_CLOTHWEIGHT) - { - glVertexAttribPointerARB(4, 4, GL_FLOAT, TRUE, LLVertexBuffer::sTypeSize[TYPE_CLOTHWEIGHT], (void*)(base + mOffsets[TYPE_CLOTHWEIGHT])); - } if (data_mask & MAP_VERTEX) { glVertexPointer(3,GL_FLOAT, LLVertexBuffer::sTypeSize[TYPE_VERTEX], (void*)(base + 0)); @@ -325,7 +317,6 @@ BOOL LLVOSurfacePatch::updateLOD() void LLVOSurfacePatch::getGeometry(LLStrider<LLVector3> &verticesp, LLStrider<LLVector3> &normalsp, - LLStrider<LLColor4U> &colorsp, LLStrider<LLVector2> &texCoords0p, LLStrider<LLVector2> &texCoords1p, LLStrider<U16> &indicesp) @@ -337,7 +328,6 @@ void LLVOSurfacePatch::getGeometry(LLStrider<LLVector3> &verticesp, updateMainGeometry(facep, verticesp, normalsp, - colorsp, texCoords0p, texCoords1p, indicesp, @@ -345,7 +335,6 @@ void LLVOSurfacePatch::getGeometry(LLStrider<LLVector3> &verticesp, updateNorthGeometry(facep, verticesp, normalsp, - colorsp, texCoords0p, texCoords1p, indicesp, @@ -353,7 +342,6 @@ void LLVOSurfacePatch::getGeometry(LLStrider<LLVector3> &verticesp, updateEastGeometry(facep, verticesp, normalsp, - colorsp, texCoords0p, texCoords1p, indicesp, @@ -363,7 +351,6 @@ void LLVOSurfacePatch::getGeometry(LLStrider<LLVector3> &verticesp, void LLVOSurfacePatch::updateMainGeometry(LLFace *facep, LLStrider<LLVector3> &verticesp, LLStrider<LLVector3> &normalsp, - LLStrider<LLColor4U> &colorsp, LLStrider<LLVector2> &texCoords0p, LLStrider<LLVector2> &texCoords1p, LLStrider<U16> &indicesp, @@ -404,7 +391,6 @@ void LLVOSurfacePatch::updateMainGeometry(LLFace *facep, x = i * render_stride; y = j * render_stride; mPatchp->eval(x, y, render_stride, verticesp.get(), normalsp.get(), texCoords0p.get(), texCoords1p.get()); - *colorsp++ = LLColor4U::white; verticesp++; normalsp++; texCoords0p++; @@ -469,7 +455,6 @@ void LLVOSurfacePatch::updateMainGeometry(LLFace *facep, void LLVOSurfacePatch::updateNorthGeometry(LLFace *facep, LLStrider<LLVector3> &verticesp, LLStrider<LLVector3> &normalsp, - LLStrider<LLColor4U> &colorsp, LLStrider<LLVector2> &texCoords0p, LLStrider<LLVector2> &texCoords1p, LLStrider<U16> &indicesp, @@ -507,7 +492,6 @@ void LLVOSurfacePatch::updateNorthGeometry(LLFace *facep, y = 16 - render_stride; mPatchp->eval(x, y, render_stride, verticesp.get(), normalsp.get(), texCoords0p.get(), texCoords1p.get()); - *colorsp++ = LLColor4U::white; verticesp++; normalsp++; texCoords0p++; @@ -523,7 +507,6 @@ void LLVOSurfacePatch::updateNorthGeometry(LLFace *facep, mPatchp->eval(x, y, render_stride, verticesp.get(), normalsp.get(), texCoords0p.get(), texCoords1p.get()); verticesp++; normalsp++; - *colorsp++ = LLColor4U::white; texCoords0p++; texCoords1p++; vertex_count++; @@ -562,7 +545,6 @@ void LLVOSurfacePatch::updateNorthGeometry(LLFace *facep, mPatchp->eval(x, y, render_stride, verticesp.get(), normalsp.get(), texCoords0p.get(), texCoords1p.get()); verticesp++; normalsp++; - *colorsp++ = LLColor4U::white; texCoords0p++; texCoords1p++; vertex_count++; @@ -577,7 +559,6 @@ void LLVOSurfacePatch::updateNorthGeometry(LLFace *facep, mPatchp->eval(x, y, render_stride, verticesp.get(), normalsp.get(), texCoords0p.get(), texCoords1p.get()); verticesp++; normalsp++; - *colorsp++ = LLColor4U::white; texCoords0p++; texCoords1p++; vertex_count++; @@ -621,7 +602,6 @@ void LLVOSurfacePatch::updateNorthGeometry(LLFace *facep, y = 16 - render_stride; mPatchp->eval(x, y, render_stride, verticesp.get(), normalsp.get(), texCoords0p.get(), texCoords1p.get()); - *colorsp++ = LLColor4U::white; verticesp++; normalsp++; texCoords0p++; @@ -638,7 +618,6 @@ void LLVOSurfacePatch::updateNorthGeometry(LLFace *facep, mPatchp->eval(x, y, render_stride, verticesp.get(), normalsp.get(), texCoords0p.get(), texCoords1p.get()); verticesp++; normalsp++; - *colorsp++ = LLColor4U::white; texCoords0p++; texCoords1p++; vertex_count++; @@ -676,7 +655,6 @@ void LLVOSurfacePatch::updateNorthGeometry(LLFace *facep, void LLVOSurfacePatch::updateEastGeometry(LLFace *facep, LLStrider<LLVector3> &verticesp, LLStrider<LLVector3> &normalsp, - LLStrider<LLColor4U> &colorsp, LLStrider<LLVector2> &texCoords0p, LLStrider<LLVector2> &texCoords1p, LLStrider<U16> &indicesp, @@ -710,7 +688,6 @@ void LLVOSurfacePatch::updateEastGeometry(LLFace *facep, mPatchp->eval(x, y, render_stride, verticesp.get(), normalsp.get(), texCoords0p.get(), texCoords1p.get()); verticesp++; normalsp++; - *colorsp++ = LLColor4U::white; texCoords0p++; texCoords1p++; } @@ -723,7 +700,6 @@ void LLVOSurfacePatch::updateEastGeometry(LLFace *facep, mPatchp->eval(x, y, render_stride, verticesp.get(), normalsp.get(), texCoords0p.get(), texCoords1p.get()); verticesp++; normalsp++; - *colorsp++ = LLColor4U::white; texCoords0p++; texCoords1p++; } @@ -761,7 +737,6 @@ void LLVOSurfacePatch::updateEastGeometry(LLFace *facep, mPatchp->eval(x, y, render_stride, verticesp.get(), normalsp.get(), texCoords0p.get(), texCoords1p.get()); verticesp++; normalsp++; - *colorsp++ = LLColor4U::white; texCoords0p++; texCoords1p++; } @@ -774,7 +749,6 @@ void LLVOSurfacePatch::updateEastGeometry(LLFace *facep, mPatchp->eval(x, y, render_stride, verticesp.get(), normalsp.get(), texCoords0p.get(), texCoords1p.get()); verticesp++; normalsp++; - *colorsp++ = LLColor4U::white; texCoords0p++; texCoords1p++; } @@ -818,7 +792,6 @@ void LLVOSurfacePatch::updateEastGeometry(LLFace *facep, mPatchp->eval(x, y, render_stride, verticesp.get(), normalsp.get(), texCoords0p.get(), texCoords1p.get()); verticesp++; normalsp++; - *colorsp++ = LLColor4U::white; texCoords0p++; texCoords1p++; } @@ -831,7 +804,6 @@ void LLVOSurfacePatch::updateEastGeometry(LLFace *facep, mPatchp->eval(x, y, render_stride, verticesp.get(), normalsp.get(), texCoords0p.get(), texCoords1p.get()); verticesp++; normalsp++; - *colorsp++ = LLColor4U::white; texCoords0p++; texCoords1p++; } @@ -1063,6 +1035,8 @@ void LLVOSurfacePatch::updateSpatialExtents(LLVector4a& newMin, LLVector4a &newM { LLVector3 posAgent = getPositionAgent(); LLVector3 scale = getScale(); + //make z-axis scale at least 1 to avoid shadow artifacts on totally flat land + scale.mV[VZ] = llmax(scale.mV[VZ], 1.f); newMin.load3( (posAgent-scale*0.5f).mV); // Changing to 2.f makes the culling a -little- better, but still wrong newMax.load3( (posAgent+scale*0.5f).mV); LLVector4a pos; @@ -1102,14 +1076,12 @@ void LLTerrainPartition::getGeometry(LLSpatialGroup* group) LLStrider<LLVector3> normals; LLStrider<LLVector2> texcoords2; LLStrider<LLVector2> texcoords; - LLStrider<LLColor4U> colors; LLStrider<U16> indices; llassert_always(buffer->getVertexStrider(vertices)); llassert_always(buffer->getNormalStrider(normals)); llassert_always(buffer->getTexCoord0Strider(texcoords)); llassert_always(buffer->getTexCoord1Strider(texcoords2)); - llassert_always(buffer->getColorStrider(colors)); llassert_always(buffer->getIndexStrider(indices)); U32 indices_index = 0; @@ -1124,13 +1096,13 @@ void LLTerrainPartition::getGeometry(LLSpatialGroup* group) facep->setVertexBuffer(buffer); LLVOSurfacePatch* patchp = (LLVOSurfacePatch*) facep->getViewerObject(); - patchp->getGeometry(vertices, normals, colors, texcoords, texcoords2, indices); + patchp->getGeometry(vertices, normals, texcoords, texcoords2, indices); indices_index += facep->getIndicesCount(); index_offset += facep->getGeomCount(); } - buffer->setBuffer(0); + buffer->flush(); mFaceList.clear(); } diff --git a/indra/newview/llvosurfacepatch.h b/indra/newview/llvosurfacepatch.h index 8e75ff2e6e..a15878368e 100644 --- a/indra/newview/llvosurfacepatch.h +++ b/indra/newview/llvosurfacepatch.h @@ -44,8 +44,7 @@ public: VERTEX_DATA_MASK = (1 << LLVertexBuffer::TYPE_VERTEX) | (1 << LLVertexBuffer::TYPE_NORMAL) | (1 << LLVertexBuffer::TYPE_TEXCOORD0) | - (1 << LLVertexBuffer::TYPE_TEXCOORD1) | - (1 << LLVertexBuffer::TYPE_COLOR) + (1 << LLVertexBuffer::TYPE_TEXCOORD1) }; LLVOSurfacePatch(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp); @@ -64,7 +63,6 @@ public: /*virtual*/ void updateFaceSize(S32 idx); void getGeometry(LLStrider<LLVector3> &verticesp, LLStrider<LLVector3> &normalsp, - LLStrider<LLColor4U> &colorsp, LLStrider<LLVector2> &texCoords0p, LLStrider<LLVector2> &texCoords1p, LLStrider<U16> &indicesp); @@ -116,7 +114,6 @@ protected: void updateMainGeometry(LLFace *facep, LLStrider<LLVector3> &verticesp, LLStrider<LLVector3> &normalsp, - LLStrider<LLColor4U> &colorsp, LLStrider<LLVector2> &texCoords0p, LLStrider<LLVector2> &texCoords1p, LLStrider<U16> &indicesp, @@ -124,7 +121,6 @@ protected: void updateNorthGeometry(LLFace *facep, LLStrider<LLVector3> &verticesp, LLStrider<LLVector3> &normalsp, - LLStrider<LLColor4U> &colorsp, LLStrider<LLVector2> &texCoords0p, LLStrider<LLVector2> &texCoords1p, LLStrider<U16> &indicesp, @@ -132,7 +128,6 @@ protected: void updateEastGeometry(LLFace *facep, LLStrider<LLVector3> &verticesp, LLStrider<LLVector3> &normalsp, - LLStrider<LLColor4U> &colorsp, LLStrider<LLVector2> &texCoords0p, LLStrider<LLVector2> &texCoords1p, LLStrider<U16> &indicesp, diff --git a/indra/newview/llvotextbubble.cpp b/indra/newview/llvotextbubble.cpp deleted file mode 100644 index a92172fe23..0000000000 --- a/indra/newview/llvotextbubble.cpp +++ /dev/null @@ -1,272 +0,0 @@ -/** - * @file llvotextbubble.cpp - * @brief Viewer-object text bubble. - * - * $LicenseInfo:firstyear=2001&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2010, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -#include "llviewerprecompiledheaders.h" - -#include "llvotextbubble.h" - -#include "imageids.h" -#include "llviewercontrol.h" -#include "llprimitive.h" -#include "llrendersphere.h" - -#include "llbox.h" -#include "lldrawable.h" -#include "llface.h" -#include "llviewertexturelist.h" -#include "llvolume.h" -#include "pipeline.h" -#include "llvector4a.h" -#include "llviewerregion.h" - -LLVOTextBubble::LLVOTextBubble(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp) -: LLAlphaObject(id, pcode, regionp) -{ - setScale(LLVector3(1.5f, 1.5f, 0.25f)); - mbCanSelect = FALSE; - mLOD = MIN_LOD; - mVolumeChanged = TRUE; - setVelocity(LLVector3(0.f, 0.f, 0.75f)); - LLVolumeParams volume_params; - volume_params.setType(LL_PCODE_PROFILE_CIRCLE, LL_PCODE_PATH_LINE); - volume_params.setBeginAndEndS(0.f, 1.f); - volume_params.setBeginAndEndT(0.f, 1.f); - volume_params.setRatio(0.25f, 0.25f); - volume_params.setShear(0.f, 0.f); - setVolume(volume_params, 0); - mColor = LLColor4(1.0f, 0.0f, 0.0f, 1.f); - S32 i; - for (i = 0; i < getNumTEs(); i++) - { - setTEColor(i, mColor); - setTETexture(i, LLUUID(IMG_DEFAULT)); - } -} - - -LLVOTextBubble::~LLVOTextBubble() -{ -} - - -BOOL LLVOTextBubble::isActive() const -{ - return TRUE; -} - -BOOL LLVOTextBubble::idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time) -{ - static LLFastTimer::DeclareTimer ftm("Text Bubble"); - LLFastTimer t(ftm); - - F32 dt = mUpdateTimer.getElapsedTimeF32(); - // Die after a few seconds. - if (dt > 1.5f) - { - return FALSE; - } - - LLViewerObject::idleUpdate(agent, world, time); - - setScale(0.5f * (1.f+dt) * LLVector3(1.5f, 1.5f, 0.5f)); - - F32 alpha = 0.35f*dt; - - LLColor4 color = mColor; - color.mV[VALPHA] -= alpha; - if (color.mV[VALPHA] <= 0.05f) - { - return FALSE; - } - S32 i; - for (i = 0; i < getNumTEs(); i++) - { - setTEColor(i, color); - setTEFullbright(i, TRUE); - } - - gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_VOLUME, TRUE); - return TRUE; -} - - -void LLVOTextBubble::updateTextures() -{ - // Update the image levels of all textures... - - for (U32 i = 0; i < getNumTEs(); i++) - { - const LLTextureEntry *te = getTE(i); - F32 texel_area_ratio = fabs(te->mScaleS * te->mScaleT); - texel_area_ratio = llclamp(texel_area_ratio, .125f, 16.f); - LLViewerTexture *imagep = getTEImage(i); - if (imagep) - { - imagep->addTextureStats(mPixelArea / texel_area_ratio); - } - } -} - - -LLDrawable *LLVOTextBubble::createDrawable(LLPipeline *pipeline) -{ - pipeline->allocDrawable(this); - mDrawable->setLit(FALSE); - mDrawable->setRenderType(LLPipeline::RENDER_TYPE_VOLUME); - - for (U32 i = 0; i < getNumTEs(); i++) - { - LLViewerTexture *imagep; - const LLTextureEntry *texture_entry = getTE(i); - imagep = LLViewerTextureManager::getFetchedTexture(texture_entry->getID()); - - mDrawable->addFace((LLFacePool*) NULL, imagep); - } - - return mDrawable; -} - -// virtual -BOOL LLVOTextBubble::setVolume(const LLVolumeParams &volume_params, const S32 detail, bool unique_volume) -{ - if (LLPrimitive::setVolume(volume_params, mLOD)) - { - if (mDrawable) - { - gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_VOLUME, TRUE); - mVolumeChanged = TRUE; - } - return TRUE; - } - return FALSE; -} - - -BOOL LLVOTextBubble::updateLOD() -{ - return FALSE; -} - -BOOL LLVOTextBubble::updateGeometry(LLDrawable *drawable) -{ - if (!(gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_VOLUME))) - return TRUE; - - if (mVolumeChanged) - { - LLVolumeParams volume_params = getVolume()->getParams(); - setVolume(volume_params, 0); - - LLPipeline::sCompiles++; - - drawable->setNumFaces(getVolume()->getNumFaces(), drawable->getFace(0)->getPool(), getTEImage(0)); - } - - LLMatrix4 identity4; - LLMatrix3 identity3; - for (S32 i = 0; i < drawable->getNumFaces(); i++) - { - LLFace *face = drawable->getFace(i); - face->setTEOffset(i); - face->setTexture(LLViewerFetchedTexture::sSmokeImagep); - face->setState(LLFace::FULLBRIGHT); - } - - mVolumeChanged = FALSE; - - mDrawable->movePartition(); - return TRUE; -} - -void LLVOTextBubble::updateFaceSize(S32 idx) -{ - LLFace* face = mDrawable->getFace(idx); - - if (idx == 0 || idx == 2) - { - face->setSize(0,0); - } - else - { - const LLVolumeFace& vol_face = getVolume()->getVolumeFace(idx); - face->setSize(vol_face.mNumVertices, vol_face.mNumIndices); - } -} - -void LLVOTextBubble::getGeometry(S32 idx, - LLStrider<LLVector3>& verticesp, - LLStrider<LLVector3>& normalsp, - LLStrider<LLVector2>& texcoordsp, - LLStrider<LLColor4U>& colorsp, - LLStrider<U16>& indicesp) -{ - if (idx == 0 || idx == 2) - { - return; - } - - const LLVolumeFace& face = getVolume()->getVolumeFace(idx); - - LLVector4a pos; - pos.load3(getPositionAgent().mV); - - LLVector4a scale; - scale.load3(getScale().mV); - - LLColor4U color = LLColor4U(getTE(idx)->getColor()); - U32 offset = mDrawable->getFace(idx)->getGeomIndex(); - - LLVector4a* dst_pos = (LLVector4a*) verticesp.get(); - LLVector4a* src_pos = (LLVector4a*) face.mPositions; - - LLVector4a* dst_norm = (LLVector4a*) normalsp.get(); - LLVector4a* src_norm = (LLVector4a*) face.mNormals; - - LLVector2* dst_tc = (LLVector2*) texcoordsp.get(); - LLVector2* src_tc = (LLVector2*) face.mTexCoords; - - LLVector4a::memcpyNonAliased16((F32*) dst_norm, (F32*) src_norm, face.mNumVertices*4*sizeof(F32)); - LLVector4a::memcpyNonAliased16((F32*) dst_tc, (F32*) src_tc, face.mNumVertices*2*sizeof(F32)); - - - for (U32 i = 0; i < face.mNumVertices; i++) - { - LLVector4a t; - t.setMul(src_pos[i], scale); - dst_pos[i].setAdd(t, pos); - *colorsp++ = color; - } - - for (U32 i = 0; i < face.mNumIndices; i++) - { - *indicesp++ = face.mIndices[i] + offset; - } -} - -U32 LLVOTextBubble::getPartitionType() const -{ - return LLViewerRegion::PARTITION_PARTICLE; -} diff --git a/indra/newview/llvotextbubble.h b/indra/newview/llvotextbubble.h deleted file mode 100644 index 9c39929711..0000000000 --- a/indra/newview/llvotextbubble.h +++ /dev/null @@ -1,66 +0,0 @@ -/** - * @file llvotextbubble.h - * @brief Description of LLVORock class, which a derivation of LLViewerObject - * - * $LicenseInfo:firstyear=2001&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2010, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -#ifndef LL_LLVOTEXTBUBBLE_H -#define LL_LLVOTEXTBUBBLE_H - -#include "llviewerobject.h" -#include "llframetimer.h" - -class LLVOTextBubble : public LLAlphaObject -{ -public: - LLVOTextBubble(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp); - - /*virtual*/ BOOL isActive() const; // Whether this object needs to do an idleUpdate. - /*virtual*/ BOOL idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time); - - /*virtual*/ void updateTextures(); - /*virtual*/ LLDrawable* createDrawable(LLPipeline *pipeline); - /*virtual*/ BOOL updateGeometry(LLDrawable *drawable); - /*virtual*/ BOOL updateLOD(); - /*virtual*/ void updateFaceSize(S32 idx); - - /*virtual*/ void getGeometry(S32 idx, - LLStrider<LLVector3>& verticesp, - LLStrider<LLVector3>& normalsp, - LLStrider<LLVector2>& texcoordsp, - LLStrider<LLColor4U>& colorsp, - LLStrider<U16>& indicesp); - - virtual U32 getPartitionType() const; - - LLColor4 mColor; - S32 mLOD; - BOOL mVolumeChanged; - -protected: - ~LLVOTextBubble(); - BOOL setVolume(const LLVolumeParams &volume_params, const S32 detail, bool unique_volume = false); - LLFrameTimer mUpdateTimer; -}; - -#endif // LL_VO_TEXT_BUBBLE diff --git a/indra/newview/llvotree.cpp b/indra/newview/llvotree.cpp index 890861df71..4564207da4 100644 --- a/indra/newview/llvotree.cpp +++ b/indra/newview/llvotree.cpp @@ -341,45 +341,11 @@ U32 LLVOTree::processUpdateMessage(LLMessageSystem *mesgsys, BOOL LLVOTree::idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time) { - const U16 FRAMES_PER_WIND_UPDATE = 20; // How many frames between wind update per tree - const F32 TREE_WIND_SENSITIVITY = 0.005f; - const F32 TREE_TRUNK_STIFFNESS = 0.1f; - if (mDead || !(gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_TREE))) { return TRUE; } - if (gSavedSettings.getBOOL("RenderAnimateTrees")) - { - F32 mass_inv; - - // For all tree objects, update the trunk bending with the current wind - // Walk sprite list in order away from viewer - if (!(mFrameCount % FRAMES_PER_WIND_UPDATE)) - { - // If needed, Get latest wind for this tree - mWind = mRegionp->mWind.getVelocity(getPositionRegion()); - } - mFrameCount++; - - mass_inv = 1.f/(5.f + mDepth*mBranches*0.2f); - mTrunkVel += (mWind * mass_inv * TREE_WIND_SENSITIVITY); // Pull in direction of wind - mTrunkVel -= (mTrunkBend * mass_inv * TREE_TRUNK_STIFFNESS); // Restoring force in direction of trunk - mTrunkBend += mTrunkVel; - mTrunkVel *= 0.99f; // Add damping - - if (mTrunkBend.length() > 1.f) - { - mTrunkBend.normalize(); - } - - if (mTrunkVel.length() > 1.f) - { - mTrunkVel.normalize(); - } - } - S32 trunk_LOD = sMAX_NUM_TREE_LOD_LEVELS ; F32 app_angle = getAppAngle()*LLVOTree::sTreeFactor; @@ -392,39 +358,36 @@ BOOL LLVOTree::idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time) } } - if (!gSavedSettings.getBOOL("RenderAnimateTrees")) + if (mReferenceBuffer.isNull()) { - if (mReferenceBuffer.isNull()) - { - gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_ALL, TRUE); - } - else if (trunk_LOD != mTrunkLOD) + gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_ALL, TRUE); + } + else if (trunk_LOD != mTrunkLOD) + { + gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_ALL, FALSE); + } + else + { + // we're not animating but we may *still* need to + // regenerate the mesh if we moved, since position + // and rotation are baked into the mesh. + // *TODO: I don't know what's so special about trees + // that they don't get REBUILD_POSITION automatically + // at a higher level. + const LLVector3 &this_position = getPositionAgent(); + if (this_position != mLastPosition) { - gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_ALL, FALSE); + gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_POSITION); + mLastPosition = this_position; } else { - // we're not animating but we may *still* need to - // regenerate the mesh if we moved, since position - // and rotation are baked into the mesh. - // *TODO: I don't know what's so special about trees - // that they don't get REBUILD_POSITION automatically - // at a higher level. - const LLVector3 &this_position = getPositionAgent(); - if (this_position != mLastPosition) + const LLQuaternion &this_rotation = getRotation(); + + if (this_rotation != mLastRotation) { gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_POSITION); - mLastPosition = this_position; - } - else - { - const LLQuaternion &this_rotation = getRotation(); - - if (this_rotation != mLastRotation) - { - gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_POSITION); - mLastRotation = this_rotation; - } + mLastRotation = this_rotation; } } } @@ -559,7 +522,7 @@ BOOL LLVOTree::updateGeometry(LLDrawable *drawable) max_vertices += sLODVertexCount[lod]; } - mReferenceBuffer = new LLVertexBuffer(LLDrawPoolTree::VERTEX_DATA_MASK, gSavedSettings.getBOOL("RenderAnimateTrees") ? GL_STATIC_DRAW_ARB : 0); + mReferenceBuffer = new LLVertexBuffer(LLDrawPoolTree::VERTEX_DATA_MASK, 0); mReferenceBuffer->allocateBuffer(max_vertices, max_indices, TRUE); LLStrider<LLVector3> vertices; @@ -858,20 +821,13 @@ BOOL LLVOTree::updateGeometry(LLDrawable *drawable) slices /= 2; } - mReferenceBuffer->setBuffer(0); + mReferenceBuffer->flush(); llassert(vertex_count == max_vertices); llassert(index_count == max_indices); } - if (gSavedSettings.getBOOL("RenderAnimateTrees")) - { - mDrawable->getFace(0)->setVertexBuffer(mReferenceBuffer); - } - else - { - //generate tree mesh - updateMesh(); - } + //generate tree mesh + updateMesh(); return TRUE; } @@ -882,7 +838,7 @@ void LLVOTree::updateMesh() // Translate to tree base HACK - adjustment in Z plants tree underground const LLVector3 &pos_agent = getPositionAgent(); - //glTranslatef(pos_agent.mV[VX], pos_agent.mV[VY], pos_agent.mV[VZ] - 0.1f); + //gGL.translatef(pos_agent.mV[VX], pos_agent.mV[VY], pos_agent.mV[VZ] - 0.1f); LLMatrix4 trans_mat; trans_mat.setTranslation(pos_agent.mV[VX], pos_agent.mV[VY], pos_agent.mV[VZ] - 0.1f); trans_mat *= matrix; @@ -940,8 +896,8 @@ void LLVOTree::updateMesh() genBranchPipeline(vertices, normals, tex_coords, indices, idx_offset, scale_mat, mTrunkLOD, stop_depth, mDepth, mTrunkDepth, 1.0, mTwist, droop, mBranches, alpha); - mReferenceBuffer->setBuffer(0); - buff->setBuffer(0); + mReferenceBuffer->flush(); + buff->flush(); } void LLVOTree::appendMesh(LLStrider<LLVector3>& vertices, @@ -1158,7 +1114,8 @@ U32 LLVOTree::drawBranchPipeline(LLMatrix4& matrix, U16* indicesp, S32 trunk_LOD scale_mat.mMatrix[2][2] = scale*length; scale_mat *= matrix; - glLoadMatrixf((F32*) scale_mat.mMatrix); + gGL.loadMatrix((F32*) scale_mat.mMatrix); + gGL.syncMatrices(); glDrawElements(GL_TRIANGLES, sLODIndexCount[trunk_LOD], GL_UNSIGNED_SHORT, indicesp + sLODIndexOffset[trunk_LOD]); gPipeline.addTrianglesDrawn(LEAF_INDICES); stop_glerror(); @@ -1208,7 +1165,8 @@ U32 LLVOTree::drawBranchPipeline(LLMatrix4& matrix, U16* indicesp, S32 trunk_LOD scale_mat *= matrix; - glLoadMatrixf((F32*) scale_mat.mMatrix); + gGL.loadMatrix((F32*) scale_mat.mMatrix); + gGL.syncMatrices(); glDrawElements(GL_TRIANGLES, LEAF_INDICES, GL_UNSIGNED_SHORT, indicesp); gPipeline.addTrianglesDrawn(LEAF_INDICES); stop_glerror(); @@ -1229,19 +1187,20 @@ U32 LLVOTree::drawBranchPipeline(LLMatrix4& matrix, U16* indicesp, S32 trunk_LOD scale_mat *= matrix; - glMatrixMode(GL_TEXTURE); - glTranslatef(0.0, -0.5, 0.0); - glMatrixMode(GL_MODELVIEW); + gGL.matrixMode(LLRender::MM_TEXTURE); + gGL.translatef(0.0, -0.5, 0.0); + gGL.matrixMode(LLRender::MM_MODELVIEW); - glLoadMatrixf((F32*) scale_mat.mMatrix); + gGL.loadMatrix((F32*) scale_mat.mMatrix); + gGL.syncMatrices(); glDrawElements(GL_TRIANGLES, LEAF_INDICES, GL_UNSIGNED_SHORT, indicesp); gPipeline.addTrianglesDrawn(LEAF_INDICES); stop_glerror(); ret += LEAF_INDICES; - glMatrixMode(GL_TEXTURE); - glLoadIdentity(); - glMatrixMode(GL_MODELVIEW); + gGL.matrixMode(LLRender::MM_TEXTURE); + gGL.loadIdentity(); + gGL.matrixMode(LLRender::MM_MODELVIEW); } return ret; diff --git a/indra/newview/llvotree.h b/indra/newview/llvotree.h index 1e1deede26..0554935539 100644 --- a/indra/newview/llvotree.h +++ b/indra/newview/llvotree.h @@ -152,7 +152,6 @@ public: friend class LLDrawPoolTree; protected: LLVector3 mTrunkBend; // Accumulated wind (used for blowing trees) - LLVector3 mTrunkVel; // LLVector3 mWind; LLPointer<LLVertexBuffer> mReferenceBuffer; //reference geometry for generating tree mesh diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 380d63c77b..20f8674655 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -3266,13 +3266,13 @@ void LLVOVolume::updateRenderComplexity() mRenderComplexity_current = 0; } -U32 LLVOVolume::getTriangleCount() const +U32 LLVOVolume::getTriangleCount(S32* vcount) const { U32 count = 0; LLVolume* volume = getVolume(); if (volume) { - count = volume->getNumTriangles(); + count = volume->getNumTriangles(vcount); } return count; @@ -3976,8 +3976,6 @@ void LLVolumeGeometryManager::registerFace(LLSpatialGroup* group, LLFace* facep, } } - U8 glow = (U8) (facep->getTextureEntry()->getGlow() * 255); - if (idx >= 0 && draw_vec[idx]->mVertexBuffer == facep->getVertexBuffer() && draw_vec[idx]->mEnd == facep->getGeomIndex()-1 && @@ -3986,7 +3984,6 @@ void LLVolumeGeometryManager::registerFace(LLSpatialGroup* group, LLFace* facep, draw_vec[idx]->mEnd - draw_vec[idx]->mStart + facep->getGeomCount() <= (U32) gGLManager.mGLMaxVertexRange && draw_vec[idx]->mCount + facep->getIndicesCount() <= (U32) gGLManager.mGLMaxIndexRange && #endif - draw_vec[idx]->mGlowColor.mV[3] == glow && draw_vec[idx]->mFullbright == fullbright && draw_vec[idx]->mBump == bump && draw_vec[idx]->mTextureMatrix == tex_mat && @@ -4018,7 +4015,6 @@ void LLVolumeGeometryManager::registerFace(LLSpatialGroup* group, LLFace* facep, draw_vec.push_back(draw_info); draw_info->mTextureMatrix = tex_mat; draw_info->mModelMatrix = model_mat; - draw_info->mGlowColor.setVec(0,0,0,glow); if (type == LLRenderPass::PASS_ALPHA) { //for alpha sorting facep->setDrawInfo(draw_info); @@ -4118,6 +4114,8 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) U32 cur_total = 0; + bool emissive = false; + //get all the faces into a list for (LLSpatialGroup::element_iter drawable_iter = group->getData().begin(); drawable_iter != group->getData().end(); ++drawable_iter) { @@ -4330,6 +4328,7 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) } } + if (cur_total > max_total || facep->getIndicesCount() <= 0 || facep->getGeomCount() <= 0) { facep->clearVertexBuffer(); @@ -4343,6 +4342,11 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) const LLTextureEntry* te = facep->getTextureEntry(); LLViewerTexture* tex = facep->getTexture(); + if (te->getGlow() >= 1.f/255.f) + { + emissive = true; + } + if (facep->isState(LLFace::TEXTURE_ANIM)) { if (!vobj->mTexAnimMode) @@ -4459,6 +4463,14 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) U32 bump_mask = LLVertexBuffer::MAP_TEXCOORD0 | LLVertexBuffer::MAP_TEXCOORD1 | LLVertexBuffer::MAP_NORMAL | LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_COLOR; U32 fullbright_mask = LLVertexBuffer::MAP_TEXCOORD0 | LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_COLOR; + if (emissive) + { //emissive faces are present, include emissive byte to preserve batching + simple_mask = simple_mask | LLVertexBuffer::MAP_EMISSIVE; + alpha_mask = alpha_mask | LLVertexBuffer::MAP_EMISSIVE; + bump_mask = bump_mask | LLVertexBuffer::MAP_EMISSIVE; + fullbright_mask = fullbright_mask | LLVertexBuffer::MAP_EMISSIVE; + } + bool batch_textures = LLViewerShaderMgr::instance()->getVertexShaderLevel(LLViewerShaderMgr::SHADER_OBJECT) > 1; if (batch_textures) @@ -4551,7 +4563,7 @@ void LLVolumeGeometryManager::rebuildMesh(LLSpatialGroup* group) for (std::set<LLVertexBuffer*>::iterator iter = mapped_buffers.begin(); iter != mapped_buffers.end(); ++iter) { - (*iter)->setBuffer(0); + (*iter)->flush(); } // don't forget alpha @@ -4559,7 +4571,7 @@ void LLVolumeGeometryManager::rebuildMesh(LLSpatialGroup* group) !group->mVertexBuffer.isNull() && group->mVertexBuffer->isLocked()) { - group->mVertexBuffer->setBuffer(0); + group->mVertexBuffer->flush(); } //if not all buffers are unmapped @@ -4575,7 +4587,7 @@ void LLVolumeGeometryManager::rebuildMesh(LLSpatialGroup* group) LLVertexBuffer* buff = face->getVertexBuffer(); if (face && buff && buff->isLocked()) { - buff->setBuffer(0) ; + buff->flush(); } } } @@ -4602,10 +4614,6 @@ struct CompareBatchBreakerModified { return lte->getFullbright() < rte->getFullbright(); } - else if (lte->getGlow() != rte->getGlow()) - { - return lte->getGlow() < rte->getGlow(); - } else { return lhs->getTexture() < rhs->getTexture(); @@ -4616,6 +4624,19 @@ struct CompareBatchBreakerModified void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, std::vector<LLFace*>& faces, BOOL distance_sort, BOOL batch_textures) { + U32 buffer_usage = group->mBufferUsage; + +#if LL_DARWIN + // HACK from Leslie: + // Disable VBO usage for alpha on Mac OS X because it kills the framerate + // due to implicit calls to glTexSubImage that are beyond our control. + // (this works because the only calls here that sort by distance are alpha) + if (distance_sort) + { + buffer_usage = 0x0; + } +#endif + //calculate maximum number of vertices to store in a single buffer U32 max_vertices = (gSavedSettings.getS32("RenderMaxVBOSize")*1024)/LLVertexBuffer::calcVertexSize(group->mSpatialPartition->mVertexDataMask); max_vertices = llmin(max_vertices, (U32) 65535); @@ -4644,7 +4665,7 @@ void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, std:: buffer_index = -1; } - S32 texture_index_channels = gGLManager.mNumTextureImageUnits-1; //always reserve one for shiny for now just for simplicity + S32 texture_index_channels = LLGLSLShader::sIndexedTextureChannels-1; //always reserve one for shiny for now just for simplicity if (gGLManager.mGLVersion < 3.1f) { @@ -4658,6 +4679,8 @@ void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, std:: texture_index_channels = llmin(texture_index_channels, (S32) gSavedSettings.getU32("RenderMaxTextureIndex")); + //NEVER use more than 16 texture index channels (workaround for prevalent driver bug) + texture_index_channels = llmin(texture_index_channels, 16); while (face_iter != faces.end()) { @@ -4795,17 +4818,15 @@ void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, std:: if (!buffer) { //create new buffer if needed - buffer = createVertexBuffer(mask, - group->mBufferUsage); + buffer = createVertexBuffer(mask, buffer_usage); buffer->allocateBuffer(geom_count, index_count, TRUE); } else { //resize pre-existing buffer - if (LLVertexBuffer::sEnableVBOs && buffer->getUsage() != group->mBufferUsage || + if (LLVertexBuffer::sEnableVBOs && buffer->getUsage() != buffer_usage || buffer->getTypeMask() != mask) { - buffer = createVertexBuffer(mask, - group->mBufferUsage); + buffer = createVertexBuffer(mask, buffer_usage); buffer->allocateBuffer(geom_count, index_count, TRUE); } else @@ -4886,11 +4907,6 @@ void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, std:: { registerFace(group, facep, LLRenderPass::PASS_ALPHA); } - - if (LLPipeline::sRenderDeferred) - { - registerFace(group, facep, LLRenderPass::PASS_ALPHA_SHADOW); - } } else if (gPipeline.canUseVertexShaders() && group->mSpatialPartition->mPartitionType != LLViewerRegion::PARTITION_HUD @@ -4985,7 +5001,7 @@ void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, std:: ++face_iter; } - buffer->setBuffer(0); + buffer->flush(); } group->mBufferMap[mask].clear(); diff --git a/indra/newview/llvovolume.h b/indra/newview/llvovolume.h index b6347526ee..3cf434dc26 100644 --- a/indra/newview/llvovolume.h +++ b/indra/newview/llvovolume.h @@ -131,9 +131,10 @@ public: /*virtual*/ const LLMatrix4 getRenderMatrix() const; typedef std::map<LLUUID, S32> texture_cost_t; U32 getRenderCost(texture_cost_t &textures) const; - /*virtual*/ F32 getStreamingCost(S32* bytes = NULL, S32* visible_bytes = NULL, F32* unscaled_value = NULL) const; + F32 getStreamingCost(S32* bytes, S32* visible_bytes, F32* unscaled_value) const; + /*virtual*/ F32 getStreamingCost(S32* bytes = NULL, S32* visible_bytes = NULL) { return getStreamingCost(bytes, visible_bytes, NULL); } - /*virtual*/ U32 getTriangleCount() const; + /*virtual*/ U32 getTriangleCount(S32* vcount = NULL) const; /*virtual*/ U32 getHighLODTriangleCount(); /*virtual*/ BOOL lineSegmentIntersect(const LLVector3& start, const LLVector3& end, S32 face = -1, // which face to check, -1 = ALL_SIDES diff --git a/indra/newview/llvowater.cpp b/indra/newview/llvowater.cpp index e70ac0a2e7..7df50ec815 100644 --- a/indra/newview/llvowater.cpp +++ b/indra/newview/llvowater.cpp @@ -160,7 +160,7 @@ BOOL LLVOWater::updateGeometry(LLDrawable *drawable) static const unsigned int vertices_per_quad = 4; static const unsigned int indices_per_quad = 6; - const S32 size = gSavedSettings.getBOOL("RenderTransparentWater") ? 16 : 1; + const S32 size = gSavedSettings.getBOOL("RenderTransparentWater") && !LLGLSLShader::sNoFixedFunction ? 16 : 1; const S32 num_quads = size * size; face->setSize(vertices_per_quad * num_quads, @@ -231,7 +231,7 @@ BOOL LLVOWater::updateGeometry(LLDrawable *drawable) } } - buff->setBuffer(0); + buff->flush(); mDrawable->movePartition(); LLPipeline::sCompiles++; diff --git a/indra/newview/llvowlsky.cpp b/indra/newview/llvowlsky.cpp index 7b1c725483..f1c5499d84 100644 --- a/indra/newview/llvowlsky.cpp +++ b/indra/newview/llvowlsky.cpp @@ -326,7 +326,7 @@ BOOL LLVOWLSky::updateGeometry(LLDrawable * drawable) buildFanBuffer(vertices, texCoords, indices); - mFanVerts->setBuffer(0); + mFanVerts->flush(); } { @@ -349,6 +349,9 @@ BOOL LLVOWLSky::updateGeometry(LLDrawable * drawable) mStripsVerts.resize(strips_segments, NULL); + LLTimer timer; + timer.start(); + for (U32 i = 0; i < strips_segments ;++i) { LLVertexBuffer * segment = new LLVertexBuffer(LLDrawPoolWLSky::SKY_VERTEX_DATA_MASK, GL_STATIC_DRAW_ARB); @@ -388,8 +391,10 @@ BOOL LLVOWLSky::updateGeometry(LLDrawable * drawable) buildStripsBuffer(begin_stack, end_stack, vertices, texCoords, indices); // and unlock the buffer - segment->setBuffer(0); + segment->flush(); } + + llinfos << "completed in " << llformat("%.2f", timer.getElapsedTimeF32()) << "seconds" << llendl; } #else mStripsVerts = new LLVertexBuffer(LLDrawPoolWLSky::SKY_VERTEX_DATA_MASK, GL_STATIC_DRAW_ARB); @@ -468,7 +473,7 @@ BOOL LLVOWLSky::updateGeometry(LLDrawable * drawable) } } - mStripsVerts->setBuffer(0); + mStripsVerts->flush(); #endif updateStarColors(); @@ -485,7 +490,7 @@ void LLVOWLSky::drawStars(void) if (mStarsVerts.notNull()) { mStarsVerts->setBuffer(LLDrawPoolWLSky::STAR_VERTEX_DATA_MASK); - mStarsVerts->drawArrays(LLRender::QUADS, 0, getStarsNumVerts()*4); + mStarsVerts->drawArrays(LLRender::TRIANGLES, 0, getStarsNumVerts()*4); } } @@ -511,13 +516,14 @@ void LLVOWLSky::drawDome(void) strips_segment->drawRange( LLRender::TRIANGLE_STRIP, - 0, strips_segment->getRequestedVerts()-1, strips_segment->getRequestedIndices(), + 0, strips_segment->getNumVerts()-1, strips_segment->getNumIndices(), 0); - gPipeline.addTrianglesDrawn(strips_segment->getRequestedIndices(), LLRender::TRIANGLE_STRIP); + gPipeline.addTrianglesDrawn(strips_segment->getNumIndices(), LLRender::TRIANGLE_STRIP); } #else mStripsVerts->setBuffer(data_mask); + gGL.syncMatrices(); glDrawRangeElements( GL_TRIANGLES, 0, mStripsVerts->getNumVerts()-1, mStripsVerts->getNumIndices(), @@ -771,7 +777,7 @@ BOOL LLVOWLSky::updateStarGeometry(LLDrawable *drawable) if (mStarsVerts.isNull()) { mStarsVerts = new LLVertexBuffer(LLDrawPoolWLSky::STAR_VERTEX_DATA_MASK, GL_DYNAMIC_DRAW); - mStarsVerts->allocateBuffer(getStarsNumVerts()*4, 0, TRUE); + mStarsVerts->allocateBuffer(getStarsNumVerts()*6, 0, TRUE); } BOOL success = mStarsVerts->getVertexStrider(verticesp) @@ -806,19 +812,25 @@ BOOL LLVOWLSky::updateStarGeometry(LLDrawable *drawable) *(verticesp++) = mStarVertices[vtx]; *(verticesp++) = mStarVertices[vtx]+left; *(verticesp++) = mStarVertices[vtx]+left+up; + *(verticesp++) = mStarVertices[vtx]+left; + *(verticesp++) = mStarVertices[vtx]+left+up; *(verticesp++) = mStarVertices[vtx]+up; *(texcoordsp++) = LLVector2(0,0); *(texcoordsp++) = LLVector2(0,1); *(texcoordsp++) = LLVector2(1,1); + *(texcoordsp++) = LLVector2(0,1); + *(texcoordsp++) = LLVector2(1,1); *(texcoordsp++) = LLVector2(1,0); *(colorsp++) = LLColor4U(mStarColors[vtx]); *(colorsp++) = LLColor4U(mStarColors[vtx]); *(colorsp++) = LLColor4U(mStarColors[vtx]); *(colorsp++) = LLColor4U(mStarColors[vtx]); + *(colorsp++) = LLColor4U(mStarColors[vtx]); + *(colorsp++) = LLColor4U(mStarColors[vtx]); } - mStarsVerts->setBuffer(0); + mStarsVerts->flush(); return TRUE; } diff --git a/indra/newview/llwaterparammanager.cpp b/indra/newview/llwaterparammanager.cpp index 1a98d4c6c2..20b34637b8 100644 --- a/indra/newview/llwaterparammanager.cpp +++ b/indra/newview/llwaterparammanager.cpp @@ -190,6 +190,7 @@ void LLWaterParamManager::updateShaderUniforms(LLGLSLShader * shader) shader->uniform4fv(LLViewerShaderMgr::LIGHTNORM, 1, LLWLParamManager::getInstance()->getRotatedLightDir().mV); shader->uniform3fv("camPosLocal", 1, LLViewerCamera::getInstance()->getOrigin().mV); shader->uniform4fv("waterFogColor", 1, LLDrawPoolWater::sWaterFogColor.mV); + shader->uniform1f("waterFogEnd", LLDrawPoolWater::sWaterFogEnd); shader->uniform4fv("waterPlane", 1, mWaterPlane.mV); shader->uniform1f("waterFogDensity", getFogDensity()); shader->uniform1f("waterFogKS", mWaterFogKS); diff --git a/indra/newview/llweb.cpp b/indra/newview/llweb.cpp index b2f35892d0..d2d48dc68f 100644 --- a/indra/newview/llweb.cpp +++ b/indra/newview/llweb.cpp @@ -34,7 +34,6 @@ #include "llagent.h" #include "llappviewer.h" -#include "llfloatermediabrowser.h" #include "llfloaterwebcontent.h" #include "llfloaterreg.h" #include "lllogininstance.h" @@ -78,32 +77,15 @@ void LLWeb::initClass() } -// static -void LLWeb::loadURL(const std::string& url, const std::string& target, const std::string& uuid) -{ - loadWebURL(url, target, uuid); - //if(target == "_internal") - //{ - // // Force load in the internal browser, as if with a blank target. - // loadURLInternal(url, "", uuid); - //} - //else if (gSavedSettings.getBOOL("UseExternalBrowser") || (target == "_external")) - //{ - // loadURLExternal(url); - //} - //else - //{ - // loadURLInternal(url, target, uuid); - //} -} + // static -void LLWeb::loadWebURL(const std::string& url, const std::string& target, const std::string& uuid) +void LLWeb::loadURL(const std::string& url, const std::string& target, const std::string& uuid) { if(target == "_internal") { // Force load in the internal browser, as if with a blank target. - loadWebURLInternal(url, "", uuid); + loadURLInternal(url, "", uuid); } else if (gSavedSettings.getBOOL("UseExternalBrowser") || (target == "_external")) { @@ -111,19 +93,13 @@ void LLWeb::loadWebURL(const std::string& url, const std::string& target, const } else { - loadWebURLInternal(url, target, uuid); + loadURLInternal(url, target, uuid); } } // static -void LLWeb::loadURLInternal(const std::string &url, const std::string& target, const std::string& uuid) -{ - LLFloaterMediaBrowser::create(url, target, uuid); -} - -// static // Explicitly open a Web URL using the Web content floater -void LLWeb::loadWebURLInternal(const std::string &url, const std::string& target, const std::string& uuid) +void LLWeb::loadURLInternal(const std::string &url, const std::string& target, const std::string& uuid) { LLFloaterWebContent::Params p; p.url(url).target(target).id(uuid); diff --git a/indra/newview/llweb.h b/indra/newview/llweb.h index 376abc0ece..0b95f664d6 100644 --- a/indra/newview/llweb.h +++ b/indra/newview/llweb.h @@ -42,23 +42,15 @@ class LLWeb public: static void initClass(); - /// Load the given url in the user's preferred web browser - static void loadURL(const std::string& url, const std::string& target, const std::string& uuid = LLStringUtil::null); - static void loadURL(const std::string& url) { loadURL(url, LLStringUtil::null); } - /// Load the given url in the user's preferred web browser - static void loadURL(const char* url, const std::string& target = LLStringUtil::null) { loadURL( ll_safe_string(url), target); } - /// Load the given url in the Second Life internal web browser - static void loadURLInternal(const std::string &url, const std::string& target, const std::string& uuid = LLStringUtil::null); - static void loadURLInternal(const std::string &url) { loadURLInternal(url, LLStringUtil::null, LLStringUtil::null);} /// Load the given url in the operating system's web browser, async if we want to return immediately /// before browser has spawned static void loadURLExternal(const std::string& url) {loadURLExternal(url, LLStringUtil::null);} static void loadURLExternal(const std::string& url, const std::string& uuid); static void loadURLExternal(const std::string& url, bool async, const std::string& uuid = LLStringUtil::null); - // Explicitly open a Web URL using the Web content floater vs. the more general media browser - static void loadWebURL(const std::string& url, const std::string& target, const std::string& uuid); - static void loadWebURLInternal(const std::string &url, const std::string& target = LLStringUtil::null, const std::string& uuid = LLStringUtil::null); + static void loadURL(const std::string& url, const std::string& target = LLStringUtil::null, const std::string& uuid = LLStringUtil::null); + // load content using built-in browser + static void loadURLInternal(const std::string &url, const std::string& target = LLStringUtil::null, const std::string& uuid = LLStringUtil::null); /// Returns escaped url (eg, " " to "%20") - used by all loadURL methods static std::string escapeURL(const std::string& url); diff --git a/indra/newview/llwebprofile.cpp b/indra/newview/llwebprofile.cpp new file mode 100644 index 0000000000..641f338f2c --- /dev/null +++ b/indra/newview/llwebprofile.cpp @@ -0,0 +1,305 @@ +/** + * @file llwebprofile.cpp + * @brief Web profile access. + * + * $LicenseInfo:firstyear=2011&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2011, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" + +#include "llwebprofile.h" + +// libs +#include "llbufferstream.h" +#include "llhttpclient.h" +#include "llimagepng.h" +#include "llplugincookiestore.h" + +// newview +#include "llpanelprofile.h" // for getProfileURL(). FIXME: move the method to LLAvatarActions +#include "llviewermedia.h" // FIXME: don't use LLViewerMedia internals + +// third-party +#include "reader.h" // JSON + +/* + * Workflow: + * 1. LLViewerMedia::setOpenIDCookie() + * -> GET https://my-demo.secondlife.com/ via LLViewerMediaWebProfileResponder + * -> LLWebProfile::setAuthCookie() + * 2. LLWebProfile::uploadImage() + * -> GET "https://my-demo.secondlife.com/snapshots/s3_upload_config" via ConfigResponder + * 3. LLWebProfile::post() + * -> POST <config_url> via PostImageResponder + * -> redirect + * -> GET <redirect_url> via PostImageRedirectResponder + */ + +/////////////////////////////////////////////////////////////////////////////// +// LLWebProfileResponders::ConfigResponder + +class LLWebProfileResponders::ConfigResponder : public LLHTTPClient::Responder +{ + LOG_CLASS(LLWebProfileResponders::ConfigResponder); + +public: + ConfigResponder(LLPointer<LLImageFormatted> imagep) + : mImagep(imagep) + { + } + + /*virtual*/ void completedRaw( + U32 status, + const std::string& reason, + const LLChannelDescriptors& channels, + const LLIOPipe::buffer_ptr_t& buffer) + { + LLBufferStream istr(channels, buffer.get()); + std::stringstream strstrm; + strstrm << istr.rdbuf(); + const std::string body = strstrm.str(); + + if (status != 200) + { + llwarns << "Failed to get upload config (" << status << ")" << llendl; + LLWebProfile::reportImageUploadStatus(false); + return; + } + + Json::Value root; + Json::Reader reader; + if (!reader.parse(body, root)) + { + llwarns << "Failed to parse upload config: " << reader.getFormatedErrorMessages() << llendl; + LLWebProfile::reportImageUploadStatus(false); + return; + } + + // *TODO: 404 = not supported by the grid + // *TODO: increase timeout or handle 499 Expired + + // Convert config to LLSD. + const Json::Value data = root["data"]; + const std::string upload_url = root["url"].asString(); + LLSD config; + config["acl"] = data["acl"].asString(); + config["AWSAccessKeyId"] = data["AWSAccessKeyId"].asString(); + config["Content-Type"] = data["Content-Type"].asString(); + config["key"] = data["key"].asString(); + config["policy"] = data["policy"].asString(); + config["success_action_redirect"] = data["success_action_redirect"].asString(); + config["signature"] = data["signature"].asString(); + config["add_loc"] = data.get("add_loc", "0").asString(); + config["caption"] = data.get("caption", "").asString(); + + // Do the actual image upload using the configuration. + LL_DEBUGS("Snapshots") << "Got upload config, POSTing image to " << upload_url << ", config=[" << config << "]" << llendl; + LLWebProfile::post(mImagep, config, upload_url); + } + +private: + LLPointer<LLImageFormatted> mImagep; +}; + +/////////////////////////////////////////////////////////////////////////////// +// LLWebProfilePostImageRedirectResponder +class LLWebProfileResponders::PostImageRedirectResponder : public LLHTTPClient::Responder +{ + LOG_CLASS(LLWebProfileResponders::PostImageRedirectResponder); + +public: + /*virtual*/ void completedRaw( + U32 status, + const std::string& reason, + const LLChannelDescriptors& channels, + const LLIOPipe::buffer_ptr_t& buffer) + { + if (status != 200) + { + llwarns << "Failed to upload image: " << status << " " << reason << llendl; + LLWebProfile::reportImageUploadStatus(false); + return; + } + + LLBufferStream istr(channels, buffer.get()); + std::stringstream strstrm; + strstrm << istr.rdbuf(); + const std::string body = strstrm.str(); + llinfos << "Image uploaded." << llendl; + LL_DEBUGS("Snapshots") << "Uploading image succeeded. Response: [" << body << "]" << llendl; + LLWebProfile::reportImageUploadStatus(true); + } + +private: + LLPointer<LLImageFormatted> mImagep; +}; + + +/////////////////////////////////////////////////////////////////////////////// +// LLWebProfileResponders::PostImageResponder +class LLWebProfileResponders::PostImageResponder : public LLHTTPClient::Responder +{ + LOG_CLASS(LLWebProfileResponders::PostImageResponder); + +public: + /*virtual*/ void completedHeader(U32 status, const std::string& reason, const LLSD& content) + { + // Viewer seems to fail to follow a 303 redirect on POST request + // (URLRequest Error: 65, Send failed since rewinding of the data stream failed). + // Handle it manually. + if (status == 303) + { + LLSD headers = LLViewerMedia::getHeaders(); + headers["Cookie"] = LLWebProfile::getAuthCookie(); + const std::string& redir_url = content["location"]; + LL_DEBUGS("Snapshots") << "Got redirection URL: " << redir_url << llendl; + LLHTTPClient::get(redir_url, new LLWebProfileResponders::PostImageRedirectResponder, headers); + } + else + { + llwarns << "Unexpected POST status: " << status << " " << reason << llendl; + LL_DEBUGS("Snapshots") << "headers: [" << content << "]" << llendl; + LLWebProfile::reportImageUploadStatus(false); + } + } + + // Override just to suppress warnings. + /*virtual*/ void completedRaw(U32 status, const std::string& reason, + const LLChannelDescriptors& channels, + const LLIOPipe::buffer_ptr_t& buffer) + { + } +}; + +/////////////////////////////////////////////////////////////////////////////// +// LLWebProfile + +std::string LLWebProfile::sAuthCookie; +LLWebProfile::status_callback_t LLWebProfile::mStatusCallback; + +// static +void LLWebProfile::uploadImage(LLPointer<LLImageFormatted> image, const std::string& caption, bool add_location) +{ + // Get upload configuration data. + std::string config_url(getProfileURL(LLStringUtil::null) + "snapshots/s3_upload_config"); + config_url += "?caption=" + LLURI::escape(caption); + config_url += "&add_loc=" + std::string(add_location ? "1" : "0"); + + LL_DEBUGS("Snapshots") << "Requesting " << config_url << llendl; + LLSD headers = LLViewerMedia::getHeaders(); + headers["Cookie"] = getAuthCookie(); + LLHTTPClient::get(config_url, new LLWebProfileResponders::ConfigResponder(image), headers); +} + +// static +void LLWebProfile::setAuthCookie(const std::string& cookie) +{ + LL_DEBUGS("Snapshots") << "Setting auth cookie: " << cookie << llendl; + sAuthCookie = cookie; +} + +// static +void LLWebProfile::post(LLPointer<LLImageFormatted> image, const LLSD& config, const std::string& url) +{ + if (dynamic_cast<LLImagePNG*>(image.get()) == 0) + { + llwarns << "Image to upload is not a PNG" << llendl; + llassert(dynamic_cast<LLImagePNG*>(image.get()) != 0); + return; + } + + const std::string boundary = "----------------------------0123abcdefab"; + + LLSD headers = LLViewerMedia::getHeaders(); + headers["Cookie"] = getAuthCookie(); + headers["Content-Type"] = "multipart/form-data; boundary=" + boundary; + + std::ostringstream body; + + // *NOTE: The order seems to matter. + body << "--" << boundary << "\r\n" + << "Content-Disposition: form-data; name=\"key\"\r\n\r\n" + << config["key"].asString() << "\r\n"; + + body << "--" << boundary << "\r\n" + << "Content-Disposition: form-data; name=\"AWSAccessKeyId\"\r\n\r\n" + << config["AWSAccessKeyId"].asString() << "\r\n"; + + body << "--" << boundary << "\r\n" + << "Content-Disposition: form-data; name=\"acl\"\r\n\r\n" + << config["acl"].asString() << "\r\n"; + + body << "--" << boundary << "\r\n" + << "Content-Disposition: form-data; name=\"Content-Type\"\r\n\r\n" + << config["Content-Type"].asString() << "\r\n"; + + body << "--" << boundary << "\r\n" + << "Content-Disposition: form-data; name=\"policy\"\r\n\r\n" + << config["policy"].asString() << "\r\n"; + + body << "--" << boundary << "\r\n" + << "Content-Disposition: form-data; name=\"signature\"\r\n\r\n" + << config["signature"].asString() << "\r\n"; + + body << "--" << boundary << "\r\n" + << "Content-Disposition: form-data; name=\"success_action_redirect\"\r\n\r\n" + << config["success_action_redirect"].asString() << "\r\n"; + + body << "--" << boundary << "\r\n" + << "Content-Disposition: form-data; name=\"file\"; filename=\"snapshot.png\"\r\n" + << "Content-Type: image/png\r\n\r\n"; + + // Insert the image data. + // *FIX: Treating this as a string will probably screw it up ... + U8* image_data = image->getData(); + for (S32 i = 0; i < image->getDataSize(); ++i) + { + body << image_data[i]; + } + + body << "\r\n--" << boundary << "--\r\n"; + + // postRaw() takes ownership of the buffer and releases it later. + size_t size = body.str().size(); + U8 *data = new U8[size]; + memcpy(data, body.str().data(), size); + + // Send request, successful upload will trigger posting metadata. + LLHTTPClient::postRaw(url, data, size, new LLWebProfileResponders::PostImageResponder(), headers); +} + +// static +void LLWebProfile::reportImageUploadStatus(bool ok) +{ + if (mStatusCallback) + { + mStatusCallback(ok); + } +} + +// static +std::string LLWebProfile::getAuthCookie() +{ + // This is needed to test image uploads on Linux viewer built with OpenSSL 1.0.0 (0.9.8 works fine). + const char* debug_cookie = getenv("LL_SNAPSHOT_COOKIE"); + return debug_cookie ? debug_cookie : sAuthCookie; +} diff --git a/indra/newview/llwebprofile.h b/indra/newview/llwebprofile.h new file mode 100644 index 0000000000..10279bffac --- /dev/null +++ b/indra/newview/llwebprofile.h @@ -0,0 +1,69 @@ +/** + * @file llwebprofile.h + * @brief Web profile access. + * + * $LicenseInfo:firstyear=2011&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2011, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#ifndef LL_LLWEBPROFILE_H +#define LL_LLWEBPROFILE_H + +#include "llimage.h" + +namespace LLWebProfileResponders +{ + class ConfigResponder; + class PostImageResponder; + class PostImageRedirectResponder; +}; + +/** + * @class LLWebProfile + * + * Manages interaction with, a web service allowing the upload of snapshot images + * taken within the viewer. + */ +class LLWebProfile +{ + LOG_CLASS(LLWebProfile); + +public: + typedef boost::function<void(bool ok)> status_callback_t; + + static void uploadImage(LLPointer<LLImageFormatted> image, const std::string& caption, bool add_location); + static void setAuthCookie(const std::string& cookie); + static void setImageUploadResultCallback(status_callback_t cb) { mStatusCallback = cb; } + +private: + friend class LLWebProfileResponders::ConfigResponder; + friend class LLWebProfileResponders::PostImageResponder; + friend class LLWebProfileResponders::PostImageRedirectResponder; + + static void post(LLPointer<LLImageFormatted> image, const LLSD& config, const std::string& url); + static void reportImageUploadStatus(bool ok); + static std::string getAuthCookie(); + + static std::string sAuthCookie; + static status_callback_t mStatusCallback; +}; + +#endif // LL_LLWEBPROFILE_H diff --git a/indra/newview/llwind.cpp b/indra/newview/llwind.cpp index 69d3090442..4c39fb5b74 100644 --- a/indra/newview/llwind.cpp +++ b/indra/newview/llwind.cpp @@ -46,16 +46,12 @@ #include "llworld.h" -const F32 CLOUD_DIVERGENCE_COEF = 0.5f; - - ////////////////////////////////////////////////////////////////////// // Construction/Destruction ////////////////////////////////////////////////////////////////////// LLWind::LLWind() -: mSize(16), - mCloudDensityp(NULL) +: mSize(16) { init(); } @@ -65,8 +61,6 @@ LLWind::~LLWind() { delete [] mVelX; delete [] mVelY; - delete [] mCloudVelX; - delete [] mCloudVelY; } @@ -77,31 +71,23 @@ LLWind::~LLWind() void LLWind::init() { + LL_DEBUGS("Wind") << "initializing wind size: "<< mSize << LL_ENDL; + // Initialize vector data mVelX = new F32[mSize*mSize]; mVelY = new F32[mSize*mSize]; - mCloudVelX = new F32[mSize*mSize]; - mCloudVelY = new F32[mSize*mSize]; - S32 i; for (i = 0; i < mSize*mSize; i++) { mVelX[i] = 0.5f; mVelY[i] = 0.5f; - mCloudVelX[i] = 0.0f; - mCloudVelY[i] = 0.0f; } } void LLWind::decompress(LLBitPack &bitpack, LLGroupHeader *group_headerp) { - if (!mCloudDensityp) - { - return; - } - LLPatchHeader patch_header; S32 buffer[16*16]; @@ -122,22 +108,15 @@ void LLWind::decompress(LLBitPack &bitpack, LLGroupHeader *group_headerp) decode_patch(bitpack, buffer); decompress_patch(mVelY, buffer, &patch_header); - - S32 i, j, k; - // HACK -- mCloudVelXY is the same as mVelXY, except we add a divergence - // that is proportional to the gradient of the cloud density - // ==> this helps to clump clouds together - // NOTE ASSUMPTION: cloud density has the same dimensions as the wind field - // This needs to be fixed... causes discrepency at region boundaries for (j=1; j<mSize-1; j++) { for (i=1; i<mSize-1; i++) { k = i + j * mSize; - *(mCloudVelX + k) = *(mVelX + k) + CLOUD_DIVERGENCE_COEF * (*(mCloudDensityp + k + 1) - *(mCloudDensityp + k - 1)); - *(mCloudVelY + k) = *(mVelY + k) + CLOUD_DIVERGENCE_COEF * (*(mCloudDensityp + k + mSize) - *(mCloudDensityp + k - mSize)); + *(mVelX + k) = *(mVelX + k); + *(mVelY + k) = *(mVelY + k); } } @@ -145,29 +124,29 @@ void LLWind::decompress(LLBitPack &bitpack, LLGroupHeader *group_headerp) for (j=1; j<mSize-1; j++) { k = i + j * mSize; - *(mCloudVelX + k) = *(mVelX + k) + CLOUD_DIVERGENCE_COEF * (*(mCloudDensityp + k) - *(mCloudDensityp + k - 2)); - *(mCloudVelY + k) = *(mVelY + k) + CLOUD_DIVERGENCE_COEF * (*(mCloudDensityp + k + mSize) - *(mCloudDensityp + k - mSize)); + *(mVelX + k) = *(mVelX + k); + *(mVelY + k) = *(mVelY + k); } i = 0; for (j=1; j<mSize-1; j++) { k = i + j * mSize; - *(mCloudVelX + k) = *(mVelX + k) + CLOUD_DIVERGENCE_COEF * (*(mCloudDensityp + k + 2) - *(mCloudDensityp + k)); - *(mCloudVelY + k) = *(mVelY + k) + CLOUD_DIVERGENCE_COEF * (*(mCloudDensityp + k + mSize) - *(mCloudDensityp + k + mSize)); + *(mVelX + k) = *(mVelX + k); + *(mVelY + k) = *(mVelY + k); } j = mSize - 1; for (i=1; i<mSize-1; i++) { k = i + j * mSize; - *(mCloudVelX + k) = *(mVelX + k) + CLOUD_DIVERGENCE_COEF * (*(mCloudDensityp + k + 1) - *(mCloudDensityp + k - 1)); - *(mCloudVelY + k) = *(mVelY + k) + CLOUD_DIVERGENCE_COEF * (*(mCloudDensityp + k) - *(mCloudDensityp + k - 2*mSize)); + *(mVelX + k) = *(mVelX + k); + *(mVelY + k) = *(mVelY + k); } j = 0; for (i=1; i<mSize-1; i++) { k = i + j * mSize; - *(mCloudVelX + k) = *(mVelX + k) + CLOUD_DIVERGENCE_COEF * (*(mCloudDensityp + k + 1) - *(mCloudDensityp + k -1)); - *(mCloudVelY + k) = *(mVelY + k) + CLOUD_DIVERGENCE_COEF * (*(mCloudDensityp + k + 2*mSize) - *(mCloudDensityp + k)); + *(mVelX + k) = *(mVelX + k); + *(mVelY + k) = *(mVelY + k); } } @@ -280,74 +259,6 @@ LLVector3 LLWind::getVelocity(const LLVector3 &pos_region) return r_val * WIND_SCALE_HACK; } - -LLVector3 LLWind::getCloudVelocity(const LLVector3 &pos_region) -{ - llassert(mSize == 16); - // Resolves value of wind at a location relative to SW corner of region - // - // Returns wind magnitude in X,Y components of vector3 - LLVector3 r_val; - F32 dx,dy; - S32 k; - - LLVector3 pos_clamped_region(pos_region); - - F32 region_width_meters = LLWorld::getInstance()->getRegionWidthInMeters(); - - if (pos_clamped_region.mV[VX] < 0.f) - { - pos_clamped_region.mV[VX] = 0.f; - } - else if (pos_clamped_region.mV[VX] >= region_width_meters) - { - pos_clamped_region.mV[VX] = (F32) fmod(pos_clamped_region.mV[VX], region_width_meters); - } - - if (pos_clamped_region.mV[VY] < 0.f) - { - pos_clamped_region.mV[VY] = 0.f; - } - else if (pos_clamped_region.mV[VY] >= region_width_meters) - { - pos_clamped_region.mV[VY] = (F32) fmod(pos_clamped_region.mV[VY], region_width_meters); - } - - - S32 i = llfloor(pos_clamped_region.mV[VX] * mSize / region_width_meters); - S32 j = llfloor(pos_clamped_region.mV[VY] * mSize / region_width_meters); - k = i + j*mSize; - dx = ((pos_clamped_region.mV[VX] * mSize / region_width_meters) - (F32) i); - dy = ((pos_clamped_region.mV[VY] * mSize / region_width_meters) - (F32) j); - - if ((i < mSize-1) && (j < mSize-1)) - { - // Interior points, no edges - r_val.mV[VX] = mCloudVelX[k]*(1.0f - dx)*(1.0f - dy) + - mCloudVelX[k + 1]*dx*(1.0f - dy) + - mCloudVelX[k + mSize]*dy*(1.0f - dx) + - mCloudVelX[k + mSize + 1]*dx*dy; - r_val.mV[VY] = mCloudVelY[k]*(1.0f - dx)*(1.0f - dy) + - mCloudVelY[k + 1]*dx*(1.0f - dy) + - mCloudVelY[k + mSize]*dy*(1.0f - dx) + - mCloudVelY[k + mSize + 1]*dx*dy; - } - else - { - r_val.mV[VX] = mCloudVelX[k]; - r_val.mV[VY] = mCloudVelY[k]; - } - - r_val.mV[VZ] = 0.f; - return r_val * WIND_SCALE_HACK; -} - - -void LLWind::setCloudDensityPointer(F32 *densityp) -{ - mCloudDensityp = densityp; -} - void LLWind::setOriginGlobal(const LLVector3d &origin_global) { mOriginGlobal = origin_global; diff --git a/indra/newview/llwind.h b/indra/newview/llwind.h index 925cb6d642..3b57f07124 100644 --- a/indra/newview/llwind.h +++ b/indra/newview/llwind.h @@ -27,7 +27,6 @@ #ifndef LL_LLWIND_H #define LL_LLWIND_H -//#include "vmath.h" #include "llmath.h" #include "v3math.h" #include "v3dmath.h" @@ -44,25 +43,21 @@ public: ~LLWind(); void renderVectors(); LLVector3 getVelocity(const LLVector3 &location); // "location" is region-local - LLVector3 getCloudVelocity(const LLVector3 &location); // "location" is region-local LLVector3 getVelocityNoisy(const LLVector3 &location, const F32 dim); // "location" is region-local void decompress(LLBitPack &bitpack, LLGroupHeader *group_headerp); LLVector3 getAverage(); - void setCloudDensityPointer(F32 *densityp); void setOriginGlobal(const LLVector3d &origin_global); private: S32 mSize; F32 * mVelX; F32 * mVelY; - F32 * mCloudVelX; - F32 * mCloudVelY; - F32 * mCloudDensityp; LLVector3d mOriginGlobal; void init(); + LOG_CLASS(LLWind); }; #endif diff --git a/indra/newview/llwlparamset.cpp b/indra/newview/llwlparamset.cpp index 02d914a812..5bb7025031 100644 --- a/indra/newview/llwlparamset.cpp +++ b/indra/newview/llwlparamset.cpp @@ -69,12 +69,18 @@ LLWLParamSet::LLWLParamSet(void) : */ } +static LLFastTimer::DeclareTimer FTM_WL_PARAM_UPDATE("WL Param Update"); + void LLWLParamSet::update(LLGLSLShader * shader) const { + LLFastTimer t(FTM_WL_PARAM_UPDATE); + for(LLSD::map_const_iterator i = mParamValues.beginMap(); i != mParamValues.endMap(); ++i) { + + const std::string& param = i->first; if( param == "star_brightness" || param == "preset_num" || param == "sun_angle" || @@ -91,8 +97,9 @@ void LLWLParamSet::update(LLGLSLShader * shader) const val.mV[1] = F32(i->second[1].asReal()) + mCloudScrollYOffset; val.mV[2] = (F32) i->second[2].asReal(); val.mV[3] = (F32) i->second[3].asReal(); - - shader->uniform4fv(param, 1, val.mV); + stop_glerror(); + shader->uniform4fv(param, 1, val.mV); + stop_glerror(); } else // param is the uniform name { @@ -118,8 +125,9 @@ void LLWLParamSet::update(LLGLSLShader * shader) const { val.mV[0] = i->second.asBoolean(); } - + stop_glerror(); shader->uniform4fv(param, 1, val.mV); + stop_glerror(); } } } diff --git a/indra/newview/llworld.cpp b/indra/newview/llworld.cpp index a7ae456f3c..676287c0ad 100644 --- a/indra/newview/llworld.cpp +++ b/indra/newview/llworld.cpp @@ -589,22 +589,22 @@ void LLWorld::updateVisibilities() { F32 cur_far_clip = LLViewerCamera::getInstance()->getFar(); - LLViewerCamera::getInstance()->setFar(mLandFarClip); - - F32 diagonal_squared = F_SQRT2 * F_SQRT2 * mWidth * mWidth; - // Go through the culled list and check for visible regions + // Go through the culled list and check for visible regions (region is visible if land is visible) for (region_list_t::iterator iter = mCulledRegionList.begin(); iter != mCulledRegionList.end(); ) { region_list_t::iterator curiter = iter++; LLViewerRegion* regionp = *curiter; - F32 height = regionp->getLand().getMaxZ() - regionp->getLand().getMinZ(); - F32 radius = 0.5f*(F32) sqrt(height * height + diagonal_squared); - if (!regionp->getLand().hasZData() - || LLViewerCamera::getInstance()->sphereInFrustum(regionp->getCenterAgent(), radius)) + + LLSpatialPartition* part = regionp->getSpatialPartition(LLViewerRegion::PARTITION_TERRAIN); + if (part) { - mCulledRegionList.erase(curiter); - mVisibleRegionList.push_back(regionp); + LLSpatialGroup* group = (LLSpatialGroup*) part->mOctree->getListener(0); + if (LLViewerCamera::getInstance()->AABBInFrustum(group->mBounds[0], group->mBounds[1])) + { + mCulledRegionList.erase(curiter); + mVisibleRegionList.push_back(regionp); + } } } @@ -619,17 +619,20 @@ void LLWorld::updateVisibilities() continue; } - F32 height = regionp->getLand().getMaxZ() - regionp->getLand().getMinZ(); - F32 radius = 0.5f*(F32) sqrt(height * height + diagonal_squared); - if (LLViewerCamera::getInstance()->sphereInFrustum(regionp->getCenterAgent(), radius)) - { - regionp->calculateCameraDistance(); - regionp->getLand().updatePatchVisibilities(gAgent); - } - else + LLSpatialPartition* part = regionp->getSpatialPartition(LLViewerRegion::PARTITION_TERRAIN); + if (part) { - mVisibleRegionList.erase(curiter); - mCulledRegionList.push_back(regionp); + LLSpatialGroup* group = (LLSpatialGroup*) part->mOctree->getListener(0); + if (LLViewerCamera::getInstance()->AABBInFrustum(group->mBounds[0], group->mBounds[1])) + { + regionp->calculateCameraDistance(); + regionp->getLand().updatePatchVisibilities(gAgent); + } + else + { + mVisibleRegionList.erase(curiter); + mCulledRegionList.push_back(regionp); + } } } @@ -815,14 +818,11 @@ void LLWorld::updateWaterObjects() max_x = (S32)region_x + range; max_y = (S32)region_y + range; - F32 height = 0.f; - for (region_list_t::iterator iter = mRegionList.begin(); iter != mRegionList.end(); ++iter) { LLViewerRegion* regionp = *iter; LLVOWater* waterp = regionp->getLand().getWaterObj(); - height += regionp->getWaterHeight(); if (waterp) { gObjectList.updateActive(waterp); @@ -839,6 +839,7 @@ void LLWorld::updateWaterObjects() // Now, get a list of the holes S32 x, y; + F32 water_height = gAgent.getRegion()->getWaterHeight() + 256.f; for (x = min_x; x <= max_x; x += rwidth) { for (y = min_y; y <= max_y; y += rwidth) @@ -850,7 +851,7 @@ void LLWorld::updateWaterObjects() waterp->setUseTexture(FALSE); waterp->setPositionGlobal(LLVector3d(x + rwidth/2, y + rwidth/2, - 256.f+DEFAULT_WATER_HEIGHT)); + water_height)); waterp->setScale(LLVector3((F32)rwidth, (F32)rwidth, 512.f)); gPipeline.createObject(waterp); mHoleWaterObjects.push_back(waterp); @@ -907,8 +908,7 @@ void LLWorld::updateWaterObjects() } waterp->setRegion(gAgent.getRegion()); - LLVector3d water_pos(water_center_x, water_center_y, - DEFAULT_WATER_HEIGHT+256.f); + LLVector3d water_pos(water_center_x, water_center_y, water_height) ; LLVector3 water_scale((F32) dim[0], (F32) dim[1], 512.f); //stretch out to horizon diff --git a/indra/newview/llworldmapmessage.cpp b/indra/newview/llworldmapmessage.cpp index 66d0d698ba..8307d32336 100644 --- a/indra/newview/llworldmapmessage.cpp +++ b/indra/newview/llworldmapmessage.cpp @@ -210,15 +210,14 @@ void LLWorldMapMessage::processMapBlockReply(LLMessageSystem* msg, void**) } // Handle the SLURL callback if any - if(LLWorldMapMessage::getInstance()->mSLURLCallback != NULL) + url_callback_t callback = LLWorldMapMessage::getInstance()->mSLURLCallback; + if(callback != NULL) { U64 handle = to_region_handle(x_world, y_world); // Check if we reached the requested region if ((LLStringUtil::compareInsensitive(LLWorldMapMessage::getInstance()->mSLURLRegionName, name)==0) || (LLWorldMapMessage::getInstance()->mSLURLRegionHandle == handle)) { - url_callback_t callback = LLWorldMapMessage::getInstance()->mSLURLCallback; - LLWorldMapMessage::getInstance()->mSLURLCallback = NULL; LLWorldMapMessage::getInstance()->mSLURLRegionName.clear(); LLWorldMapMessage::getInstance()->mSLURLRegionHandle = 0; diff --git a/indra/newview/llworldmapview.cpp b/indra/newview/llworldmapview.cpp index 265d5dc801..e50851b8e7 100644 --- a/indra/newview/llworldmapview.cpp +++ b/indra/newview/llworldmapview.cpp @@ -314,7 +314,7 @@ void LLWorldMapView::draw() { gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); - glMatrixMode(GL_MODELVIEW); + gGL.matrixMode(LLRender::MM_MODELVIEW); // Clear the background alpha to 0 gGL.flush(); @@ -422,7 +422,7 @@ void LLWorldMapView::draw() // Draw something whenever we have enough info if (overlayimage->hasGLTexture()) { - gGL.blendFunc(LLRender::BF_DEST_ALPHA, LLRender::BF_ZERO); + gGL.blendFunc(LLRender::BF_SOURCE_ALPHA, LLRender::BF_ONE_MINUS_SOURCE_ALPHA); gGL.getTexUnit(0)->bind(overlayimage); gGL.color4f(1.f, 1.f, 1.f, 1.f); gGL.begin(LLRender::QUADS); @@ -1307,7 +1307,7 @@ void LLWorldMapView::drawTrackingCircle( const LLRect& rect, S32 x, S32 y, const end_theta -= angle_adjust_y; } - glMatrixMode(GL_MODELVIEW); + gGL.matrixMode(LLRender::MM_MODELVIEW); gGL.pushMatrix(); gGL.translatef((F32)x, (F32)y, 0.f); gl_washer_segment_2d(inner_radius, outer_radius, start_theta, end_theta, 40, color, color); diff --git a/indra/newview/llxmlrpctransaction.cpp b/indra/newview/llxmlrpctransaction.cpp index f483ba5af8..920a9a3752 100644 --- a/indra/newview/llxmlrpctransaction.cpp +++ b/indra/newview/llxmlrpctransaction.cpp @@ -382,19 +382,11 @@ bool LLXMLRPCTransaction::Impl::process() // continue onward } } - - //const F32 MAX_PROCESSING_TIME = 0.05f; - //LLTimer timer; - - mCurlRequest->perform(); - - /*while (mCurlRequest->perform() > 0) + + if(!mCurlRequest->wait()) { - if (timer.getElapsedTimeF32() >= MAX_PROCESSING_TIME) - { - return false; - } - }*/ + return false ; + } while(1) { diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 8b51d1cd6c..cc94882f8c 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -106,26 +106,6 @@ #include "llnotifications.h" #include "llpathinglib.h" -void check_stack_depth(S32 stack_depth) -{ - if (gDebugGL || gDebugSession) - { - GLint depth; - glGetIntegerv(GL_MODELVIEW_STACK_DEPTH, &depth); - if (depth != stack_depth) - { - if (gDebugSession) - { - ll_fail("GL matrix stack corrupted."); - } - else - { - llerrs << "GL matrix stack corrupted!" << llendl; - } - } - } -} - #ifdef _DEBUG // Debug indices is disabled for now for debug performance - djs 4/24/02 //#define DEBUG_INDICES @@ -133,13 +113,88 @@ void check_stack_depth(S32 stack_depth) //#define DEBUG_INDICES #endif +//cached settings +BOOL LLPipeline::RenderAvatarVP; +BOOL LLPipeline::VertexShaderEnable; +BOOL LLPipeline::WindLightUseAtmosShaders; +BOOL LLPipeline::RenderDeferred; +F32 LLPipeline::RenderDeferredSunWash; +U32 LLPipeline::RenderFSAASamples; +U32 LLPipeline::RenderResolutionDivisor; +BOOL LLPipeline::RenderUIBuffer; +S32 LLPipeline::RenderShadowDetail; +BOOL LLPipeline::RenderDeferredSSAO; +F32 LLPipeline::RenderShadowResolutionScale; +BOOL LLPipeline::RenderLocalLights; +BOOL LLPipeline::RenderDelayCreation; +BOOL LLPipeline::RenderAnimateRes; +BOOL LLPipeline::FreezeTime; +S32 LLPipeline::DebugBeaconLineWidth; +F32 LLPipeline::RenderHighlightBrightness; +LLColor4 LLPipeline::RenderHighlightColor; +F32 LLPipeline::RenderHighlightThickness; +BOOL LLPipeline::RenderSpotLightsInNondeferred; +LLColor4 LLPipeline::PreviewAmbientColor; +LLColor4 LLPipeline::PreviewDiffuse0; +LLColor4 LLPipeline::PreviewSpecular0; +LLColor4 LLPipeline::PreviewDiffuse1; +LLColor4 LLPipeline::PreviewSpecular1; +LLColor4 LLPipeline::PreviewDiffuse2; +LLColor4 LLPipeline::PreviewSpecular2; +LLVector3 LLPipeline::PreviewDirection0; +LLVector3 LLPipeline::PreviewDirection1; +LLVector3 LLPipeline::PreviewDirection2; +F32 LLPipeline::RenderGlowMinLuminance; +F32 LLPipeline::RenderGlowMaxExtractAlpha; +F32 LLPipeline::RenderGlowWarmthAmount; +LLVector3 LLPipeline::RenderGlowLumWeights; +LLVector3 LLPipeline::RenderGlowWarmthWeights; +S32 LLPipeline::RenderGlowResolutionPow; +S32 LLPipeline::RenderGlowIterations; +F32 LLPipeline::RenderGlowWidth; +F32 LLPipeline::RenderGlowStrength; +BOOL LLPipeline::RenderDepthOfField; +F32 LLPipeline::CameraFocusTransitionTime; +F32 LLPipeline::CameraFNumber; +F32 LLPipeline::CameraFocalLength; +F32 LLPipeline::CameraFieldOfView; +F32 LLPipeline::RenderShadowNoise; +F32 LLPipeline::RenderShadowBlurSize; +F32 LLPipeline::RenderSSAOScale; +U32 LLPipeline::RenderSSAOMaxScale; +F32 LLPipeline::RenderSSAOFactor; +LLVector3 LLPipeline::RenderSSAOEffect; +F32 LLPipeline::RenderShadowOffsetError; +F32 LLPipeline::RenderShadowBiasError; +F32 LLPipeline::RenderShadowOffset; +F32 LLPipeline::RenderShadowBias; +F32 LLPipeline::RenderSpotShadowOffset; +F32 LLPipeline::RenderSpotShadowBias; +F32 LLPipeline::RenderEdgeDepthCutoff; +F32 LLPipeline::RenderEdgeNormCutoff; +LLVector3 LLPipeline::RenderShadowGaussian; +F32 LLPipeline::RenderShadowBlurDistFactor; +BOOL LLPipeline::RenderDeferredAtmospheric; +S32 LLPipeline::RenderReflectionDetail; +F32 LLPipeline::RenderHighlightFadeTime; +LLVector3 LLPipeline::RenderShadowClipPlanes; +LLVector3 LLPipeline::RenderShadowOrthoClipPlanes; +LLVector3 LLPipeline::RenderShadowNearDist; +F32 LLPipeline::RenderFarClip; +LLVector3 LLPipeline::RenderShadowSplitExponent; +F32 LLPipeline::RenderShadowErrorCutoff; +F32 LLPipeline::RenderShadowFOVCutoff; +BOOL LLPipeline::CameraOffset; +F32 LLPipeline::CameraMaxCoF; +F32 LLPipeline::CameraDoFResScale; + const F32 BACKLIGHT_DAY_MAGNITUDE_AVATAR = 0.2f; const F32 BACKLIGHT_NIGHT_MAGNITUDE_AVATAR = 0.1f; const F32 BACKLIGHT_DAY_MAGNITUDE_OBJECT = 0.1f; const F32 BACKLIGHT_NIGHT_MAGNITUDE_OBJECT = 0.08f; const S32 MAX_OFFSCREEN_GEOMETRY_CHANGES_PER_FRAME = 10; const U32 REFLECTION_MAP_RES = 128; - +const U32 DEFERRED_VB_MASK = LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_TEXCOORD0 | LLVertexBuffer::MAP_TEXCOORD1; // Max number of occluders to search for. JC const S32 MAX_OCCLUDER_COUNT = 2; @@ -211,23 +266,12 @@ std::string gPoolNames[] = void drawBox(const LLVector3& c, const LLVector3& r); void drawBoxOutline(const LLVector3& pos, const LLVector3& size); +U32 nhpo2(U32 v); -U32 nhpo2(U32 v) -{ - U32 r = 1; - while (r < v) { - r *= 2; - } - return r; -} - -glh::matrix4f glh_copy_matrix(GLdouble* src) +glh::matrix4f glh_copy_matrix(F32* src) { glh::matrix4f ret; - for (U32 i = 0; i < 16; i++) - { - ret.m[i] = (F32) src[i]; - } + ret.set_value(src); return ret; } @@ -251,7 +295,7 @@ glh::matrix4f glh_get_last_projection() return glh_copy_matrix(gGLLastProjection); } -void glh_copy_matrix(const glh::matrix4f& src, GLdouble* dst) +void glh_copy_matrix(const glh::matrix4f& src, F32* dst) { for (U32 i = 0; i < 16; i++) { @@ -394,11 +438,14 @@ void LLPipeline::init() { LLMemType mt(LLMemType::MTYPE_PIPELINE_INIT); + refreshCachedSettings(); + gOctreeMaxCapacity = gSavedSettings.getU32("OctreeMaxNodeCapacity"); sDynamicLOD = gSavedSettings.getBOOL("RenderDynamicLOD"); sRenderBump = gSavedSettings.getBOOL("RenderObjectBump"); sUseTriStrips = gSavedSettings.getBOOL("RenderUseTriStrips"); LLVertexBuffer::sUseStreamDraw = gSavedSettings.getBOOL("RenderUseStreamVBO"); + LLVertexBuffer::sUseVAO = gSavedSettings.getBOOL("RenderUseVAO"); LLVertexBuffer::sPreferStreamDraw = gSavedSettings.getBOOL("RenderPreferStreamDraw"); sRenderAttachedLights = gSavedSettings.getBOOL("RenderAttachedLights"); sRenderAttachedParticles = gSavedSettings.getBOOL("RenderAttachedParticles"); @@ -459,7 +506,95 @@ void LLPipeline::init() mSpotLightFade[i] = 1.f; } + mDeferredVB = new LLVertexBuffer(DEFERRED_VB_MASK, 0); + mDeferredVB->allocateBuffer(8, 0, true); setLightingDetail(-1); + + // + // Update all settings to trigger a cached settings refresh + // + + gSavedSettings.getControl("RenderAutoMaskAlphaDeferred")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("RenderAutoMaskAlphaNonDeferred")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("RenderUseFarClip")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("RenderAvatarMaxVisible")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("RenderDelayVBUpdate")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + + gSavedSettings.getControl("UseOcclusion")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + + gSavedSettings.getControl("VertexShaderEnable")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("RenderAvatarVP")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("WindLightUseAtmosShaders")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("RenderDeferred")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("RenderDeferredSunWash")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("RenderFSAASamples")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("RenderResolutionDivisor")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("RenderUIBuffer")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("RenderShadowDetail")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("RenderDeferredSSAO")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("RenderShadowResolutionScale")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("RenderLocalLights")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("RenderDelayCreation")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("RenderAnimateRes")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("FreezeTime")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("DebugBeaconLineWidth")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("RenderHighlightBrightness")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("RenderHighlightColor")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("RenderHighlightThickness")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("RenderSpotLightsInNondeferred")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("PreviewAmbientColor")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("PreviewDiffuse0")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("PreviewSpecular0")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("PreviewDiffuse1")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("PreviewSpecular1")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("PreviewDiffuse2")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("PreviewSpecular2")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("PreviewDirection0")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("PreviewDirection1")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("PreviewDirection2")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("RenderGlowMinLuminance")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("RenderGlowMaxExtractAlpha")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("RenderGlowWarmthAmount")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("RenderGlowLumWeights")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("RenderGlowWarmthWeights")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("RenderGlowResolutionPow")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("RenderGlowIterations")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("RenderGlowWidth")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("RenderGlowStrength")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("RenderDepthOfField")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("CameraFocusTransitionTime")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("CameraFNumber")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("CameraFocalLength")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("CameraFieldOfView")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("RenderShadowNoise")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("RenderShadowBlurSize")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("RenderSSAOScale")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("RenderSSAOMaxScale")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("RenderSSAOFactor")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("RenderSSAOEffect")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("RenderShadowOffsetError")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("RenderShadowBiasError")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("RenderShadowOffset")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("RenderShadowBias")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("RenderSpotShadowOffset")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("RenderSpotShadowBias")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("RenderEdgeDepthCutoff")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("RenderEdgeNormCutoff")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("RenderShadowGaussian")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("RenderShadowBlurDistFactor")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("RenderDeferredAtmospheric")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("RenderReflectionDetail")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("RenderHighlightFadeTime")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("RenderShadowClipPlanes")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("RenderShadowOrthoClipPlanes")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("RenderShadowNearDist")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("RenderFarClip")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("RenderShadowSplitExponent")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("RenderShadowErrorCutoff")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("RenderShadowFOVCutoff")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("CameraOffset")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("CameraMaxCoF")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("CameraDoFResScale")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); } LLPipeline::~LLPipeline() @@ -537,6 +672,8 @@ void LLPipeline::cleanup() mMovedBridge.clear(); mInitialized = FALSE; + + mDeferredVB = NULL; } //============================================================================ @@ -606,12 +743,8 @@ void LLPipeline::allocatePhysicsBuffer() void LLPipeline::allocateScreenBuffer(U32 resX, U32 resY) { - U32 samples = gGLManager.getNumFBOFSAASamples(gSavedSettings.getU32("RenderFSAASamples")); - - if (gGLManager.mIsATI) - { //ATI doesn't like the way we use multisample texture - samples = 0; - } + refreshCachedSettings(); + U32 samples = RenderFSAASamples; //try to allocate screen buffers at requested resolution and samples // - on failure, shrink number of samples and try again @@ -632,6 +765,8 @@ void LLPipeline::allocateScreenBuffer(U32 resX, U32 resY) releaseScreenBuffers(); } + samples = 0; + //reduce resolution while (resY > 0 && resX > 0) { @@ -657,11 +792,13 @@ void LLPipeline::allocateScreenBuffer(U32 resX, U32 resY) bool LLPipeline::allocateScreenBuffer(U32 resX, U32 resY, U32 samples) { + refreshCachedSettings(); + // remember these dimensions mScreenWidth = resX; mScreenHeight = resY; - U32 res_mod = gSavedSettings.getU32("RenderResolutionDivisor"); + U32 res_mod = RenderResolutionDivisor; if (res_mod > 1 && res_mod < resX && res_mod < resY) { @@ -669,7 +806,7 @@ bool LLPipeline::allocateScreenBuffer(U32 resX, U32 resY, U32 samples) resY /= res_mod; } - if (gSavedSettings.getBOOL("RenderUIBuffer")) + if (RenderUIBuffer) { if (!mUIScreen.allocate(resX,resY, GL_RGBA, FALSE, FALSE, LLTexUnit::TT_RECT_TEXTURE, FALSE)) { @@ -679,79 +816,40 @@ bool LLPipeline::allocateScreenBuffer(U32 resX, U32 resY, U32 samples) if (LLPipeline::sRenderDeferred) { - S32 shadow_detail = gSavedSettings.getS32("RenderShadowDetail"); - BOOL ssao = gSavedSettings.getBOOL("RenderDeferredSSAO"); - bool gi = LLViewerShaderMgr::instance()->getVertexShaderLevel(LLViewerShaderMgr::SHADER_DEFERRED); - + S32 shadow_detail = RenderShadowDetail; + BOOL ssao = RenderDeferredSSAO; + //allocate deferred rendering color buffers if (!mDeferredScreen.allocate(resX, resY, GL_RGBA, TRUE, TRUE, LLTexUnit::TT_RECT_TEXTURE, FALSE, samples)) return false; if (!mDeferredDepth.allocate(resX, resY, 0, TRUE, FALSE, LLTexUnit::TT_RECT_TEXTURE, FALSE, samples)) return false; if (!addDeferredAttachments(mDeferredScreen)) return false; if (!mScreen.allocate(resX, resY, GL_RGBA, FALSE, FALSE, LLTexUnit::TT_RECT_TEXTURE, FALSE, samples)) return false; - -#if LL_DARWIN - // As of OS X 10.6.7, Apple doesn't support multiple color formats in a single FBO - if (!mEdgeMap.allocate(resX, resY, GL_RGBA, FALSE, FALSE, LLTexUnit::TT_RECT_TEXTURE, FALSE)) return false; -#else - if (!mEdgeMap.allocate(resX, resY, GL_ALPHA, FALSE, FALSE, LLTexUnit::TT_RECT_TEXTURE, FALSE)) return false; -#endif - - if (shadow_detail > 0 || ssao) - { //only need mDeferredLight[0] for shadows OR ssao - if (!mDeferredLight[0].allocate(resX, resY, GL_RGBA, FALSE, FALSE, LLTexUnit::TT_RECT_TEXTURE, FALSE)) return false; - } - else + if (samples > 0) { - mDeferredLight[0].release(); - } - - if (ssao) - { //only need mDeferredLight[1] for ssao - if (!mDeferredLight[1].allocate(resX, resY, GL_RGBA, FALSE, FALSE, LLTexUnit::TT_RECT_TEXTURE, false)) return false; + if (!mFXAABuffer.allocate(nhpo2(resX), nhpo2(resY), GL_RGBA, FALSE, FALSE, LLTexUnit::TT_TEXTURE, FALSE, samples)) return false; } else { - mDeferredLight[1].release(); + mFXAABuffer.release(); } - - if (gi) - { //only need mDeferredLight[2] and mGIMapPost for gi - if (!mDeferredLight[2].allocate(resX, resY, GL_RGBA, FALSE, FALSE, LLTexUnit::TT_RECT_TEXTURE, false)) return false; - for (U32 i = 0; i < 2; i++) - { -#if LL_DARWIN - // As of OS X 10.6.7, Apple doesn't support multiple color formats in a single FBO - if (!mGIMapPost[i].allocate(resX,resY, GL_RGBA, FALSE, FALSE, LLTexUnit::TT_RECT_TEXTURE)) return false; -#else - if (!mGIMapPost[i].allocate(resX,resY, GL_RGB, FALSE, FALSE, LLTexUnit::TT_RECT_TEXTURE)) return false; -#endif - } + + if (shadow_detail > 0 || ssao || RenderDepthOfField || samples > 0) + { //only need mDeferredLight for shadows OR ssao OR dof OR fxaa + if (!mDeferredLight.allocate(resX, resY, GL_RGBA, FALSE, FALSE, LLTexUnit::TT_RECT_TEXTURE, FALSE)) return false; } else { - mDeferredLight[2].release(); - - for (U32 i = 0; i < 2; i++) - { - mGIMapPost[i].release(); - } + mDeferredLight.release(); } - F32 scale = gSavedSettings.getF32("RenderShadowResolutionScale"); - -#if LL_DARWIN - U32 shadow_fmt = 0; -#else - //HACK: make alpha masking work on ATI depth shadows (work around for ATI driver bug) - U32 shadow_fmt = gGLManager.mIsATI ? GL_ALPHA : 0; -#endif + F32 scale = RenderShadowResolutionScale; if (shadow_detail > 0) { //allocate 4 sun shadow maps for (U32 i = 0; i < 4; i++) { - if (!mShadow[i].allocate(U32(resX*scale),U32(resY*scale), shadow_fmt, TRUE, FALSE, LLTexUnit::TT_RECT_TEXTURE)) return false; + if (!mShadow[i].allocate(U32(resX*scale),U32(resY*scale), 0, TRUE, FALSE, LLTexUnit::TT_RECT_TEXTURE)) return false; } } else @@ -769,7 +867,7 @@ bool LLPipeline::allocateScreenBuffer(U32 resX, U32 resY, U32 samples) { //allocate two spot shadow maps for (U32 i = 4; i < 6; i++) { - if (!mShadow[i].allocate(width, height, shadow_fmt, TRUE, FALSE)) return false; + if (!mShadow[i].allocate(width, height, 0, TRUE, FALSE)) return false; } } else @@ -779,31 +877,20 @@ bool LLPipeline::allocateScreenBuffer(U32 resX, U32 resY, U32 samples) mShadow[i].release(); } } - - width = nhpo2(resX)/2; - height = nhpo2(resY)/2; - if (!mLuminanceMap.allocate(width,height, GL_RGBA, FALSE, FALSE)) return false; } else { - for (U32 i = 0; i < 3; i++) - { - mDeferredLight[i].release(); - } - for (U32 i = 0; i < 2; i++) - { - mGIMapPost[i].release(); - } + mDeferredLight.release(); + for (U32 i = 0; i < 6; i++) { mShadow[i].release(); } + mFXAABuffer.release(); mScreen.release(); mDeferredScreen.release(); //make sure to release any render targets that share a depth buffer with mDeferredScreen first mDeferredDepth.release(); - mEdgeMap.release(); - mLuminanceMap.release(); - + if (!mScreen.allocate(resX, resY, GL_RGBA, TRUE, TRUE, LLTexUnit::TT_RECT_TEXTURE, FALSE)) return false; } @@ -822,12 +909,12 @@ bool LLPipeline::allocateScreenBuffer(U32 resX, U32 resY, U32 samples) //static void LLPipeline::updateRenderDeferred() { - BOOL deferred = ((gSavedSettings.getBOOL("RenderDeferred") && + BOOL deferred = ((RenderDeferred && LLRenderTarget::sUseFBO && - LLFeatureManager::getInstance()->isFeatureAvailable("RenderDeferred") && - gSavedSettings.getBOOL("VertexShaderEnable") && - gSavedSettings.getBOOL("RenderAvatarVP") && - gSavedSettings.getBOOL("WindLightUseAtmosShaders")) ? TRUE : FALSE) && + LLFeatureManager::getInstance()->isFeatureAvailable("RenderDeferred") && + VertexShaderEnable && + RenderAvatarVP && + WindLightUseAtmosShaders) ? TRUE : FALSE) && !gUseWireframe; sRenderDeferred = deferred; @@ -838,8 +925,94 @@ void LLPipeline::updateRenderDeferred() } //static -void LLPipeline::refreshRenderDeferred() -{ +void LLPipeline::refreshCachedSettings() +{ + LLPipeline::sAutoMaskAlphaDeferred = gSavedSettings.getBOOL("RenderAutoMaskAlphaDeferred"); + LLPipeline::sAutoMaskAlphaNonDeferred = gSavedSettings.getBOOL("RenderAutoMaskAlphaNonDeferred"); + LLPipeline::sUseFarClip = gSavedSettings.getBOOL("RenderUseFarClip"); + LLVOAvatar::sMaxVisible = (U32)gSavedSettings.getS32("RenderAvatarMaxVisible"); + LLPipeline::sDelayVBUpdate = gSavedSettings.getBOOL("RenderDelayVBUpdate"); + + LLPipeline::sUseOcclusion = + (!gUseWireframe + && LLFeatureManager::getInstance()->isFeatureAvailable("UseOcclusion") + && gSavedSettings.getBOOL("UseOcclusion") + && gGLManager.mHasOcclusionQuery) ? 2 : 0; + + VertexShaderEnable = gSavedSettings.getBOOL("VertexShaderEnable"); + RenderAvatarVP = gSavedSettings.getBOOL("RenderAvatarVP"); + WindLightUseAtmosShaders = gSavedSettings.getBOOL("WindLightUseAtmosShaders"); + RenderDeferred = gSavedSettings.getBOOL("RenderDeferred"); + RenderDeferredSunWash = gSavedSettings.getF32("RenderDeferredSunWash"); + RenderFSAASamples = gSavedSettings.getU32("RenderFSAASamples"); + RenderResolutionDivisor = gSavedSettings.getU32("RenderResolutionDivisor"); + RenderUIBuffer = gSavedSettings.getBOOL("RenderUIBuffer"); + RenderShadowDetail = gSavedSettings.getS32("RenderShadowDetail"); + RenderDeferredSSAO = gSavedSettings.getBOOL("RenderDeferredSSAO"); + RenderShadowResolutionScale = gSavedSettings.getF32("RenderShadowResolutionScale"); + RenderLocalLights = gSavedSettings.getBOOL("RenderLocalLights"); + RenderDelayCreation = gSavedSettings.getBOOL("RenderDelayCreation"); + RenderAnimateRes = gSavedSettings.getBOOL("RenderAnimateRes"); + FreezeTime = gSavedSettings.getBOOL("FreezeTime"); + DebugBeaconLineWidth = gSavedSettings.getS32("DebugBeaconLineWidth"); + RenderHighlightBrightness = gSavedSettings.getF32("RenderHighlightBrightness"); + RenderHighlightColor = gSavedSettings.getColor4("RenderHighlightColor"); + RenderHighlightThickness = gSavedSettings.getF32("RenderHighlightThickness"); + RenderSpotLightsInNondeferred = gSavedSettings.getBOOL("RenderSpotLightsInNondeferred"); + PreviewAmbientColor = gSavedSettings.getColor4("PreviewAmbientColor"); + PreviewDiffuse0 = gSavedSettings.getColor4("PreviewDiffuse0"); + PreviewSpecular0 = gSavedSettings.getColor4("PreviewSpecular0"); + PreviewDiffuse1 = gSavedSettings.getColor4("PreviewDiffuse1"); + PreviewSpecular1 = gSavedSettings.getColor4("PreviewSpecular1"); + PreviewDiffuse2 = gSavedSettings.getColor4("PreviewDiffuse2"); + PreviewSpecular2 = gSavedSettings.getColor4("PreviewSpecular2"); + PreviewDirection0 = gSavedSettings.getVector3("PreviewDirection0"); + PreviewDirection1 = gSavedSettings.getVector3("PreviewDirection1"); + PreviewDirection2 = gSavedSettings.getVector3("PreviewDirection2"); + RenderGlowMinLuminance = gSavedSettings.getF32("RenderGlowMinLuminance"); + RenderGlowMaxExtractAlpha = gSavedSettings.getF32("RenderGlowMaxExtractAlpha"); + RenderGlowWarmthAmount = gSavedSettings.getF32("RenderGlowWarmthAmount"); + RenderGlowLumWeights = gSavedSettings.getVector3("RenderGlowLumWeights"); + RenderGlowWarmthWeights = gSavedSettings.getVector3("RenderGlowWarmthWeights"); + RenderGlowResolutionPow = gSavedSettings.getS32("RenderGlowResolutionPow"); + RenderGlowIterations = gSavedSettings.getS32("RenderGlowIterations"); + RenderGlowWidth = gSavedSettings.getF32("RenderGlowWidth"); + RenderGlowStrength = gSavedSettings.getF32("RenderGlowStrength"); + RenderDepthOfField = gSavedSettings.getBOOL("RenderDepthOfField"); + CameraFocusTransitionTime = gSavedSettings.getF32("CameraFocusTransitionTime"); + CameraFNumber = gSavedSettings.getF32("CameraFNumber"); + CameraFocalLength = gSavedSettings.getF32("CameraFocalLength"); + CameraFieldOfView = gSavedSettings.getF32("CameraFieldOfView"); + RenderShadowNoise = gSavedSettings.getF32("RenderShadowNoise"); + RenderShadowBlurSize = gSavedSettings.getF32("RenderShadowBlurSize"); + RenderSSAOScale = gSavedSettings.getF32("RenderSSAOScale"); + RenderSSAOMaxScale = gSavedSettings.getU32("RenderSSAOMaxScale"); + RenderSSAOFactor = gSavedSettings.getF32("RenderSSAOFactor"); + RenderSSAOEffect = gSavedSettings.getVector3("RenderSSAOEffect"); + RenderShadowOffsetError = gSavedSettings.getF32("RenderShadowOffsetError"); + RenderShadowBiasError = gSavedSettings.getF32("RenderShadowBiasError"); + RenderShadowOffset = gSavedSettings.getF32("RenderShadowOffset"); + RenderShadowBias = gSavedSettings.getF32("RenderShadowBias"); + RenderSpotShadowOffset = gSavedSettings.getF32("RenderSpotShadowOffset"); + RenderSpotShadowBias = gSavedSettings.getF32("RenderSpotShadowBias"); + RenderEdgeDepthCutoff = gSavedSettings.getF32("RenderEdgeDepthCutoff"); + RenderEdgeNormCutoff = gSavedSettings.getF32("RenderEdgeNormCutoff"); + RenderShadowGaussian = gSavedSettings.getVector3("RenderShadowGaussian"); + RenderShadowBlurDistFactor = gSavedSettings.getF32("RenderShadowBlurDistFactor"); + RenderDeferredAtmospheric = gSavedSettings.getBOOL("RenderDeferredAtmospheric"); + RenderReflectionDetail = gSavedSettings.getS32("RenderReflectionDetail"); + RenderHighlightFadeTime = gSavedSettings.getF32("RenderHighlightFadeTime"); + RenderShadowClipPlanes = gSavedSettings.getVector3("RenderShadowClipPlanes"); + RenderShadowOrthoClipPlanes = gSavedSettings.getVector3("RenderShadowOrthoClipPlanes"); + RenderShadowNearDist = gSavedSettings.getVector3("RenderShadowNearDist"); + RenderFarClip = gSavedSettings.getF32("RenderFarClip"); + RenderShadowSplitExponent = gSavedSettings.getVector3("RenderShadowSplitExponent"); + RenderShadowErrorCutoff = gSavedSettings.getF32("RenderShadowErrorCutoff"); + RenderShadowFOVCutoff = gSavedSettings.getF32("RenderShadowFOVCutoff"); + CameraOffset = gSavedSettings.getBOOL("CameraOffset"); + CameraMaxCoF = gSavedSettings.getF32("CameraMaxCoF"); + CameraDoFResScale = gSavedSettings.getF32("CameraDoFResScale"); + updateRenderDeferred(); } @@ -883,21 +1056,14 @@ void LLPipeline::releaseScreenBuffers() { mUIScreen.release(); mScreen.release(); + mFXAABuffer.release(); mPhysicsDisplay.release(); mDeferredScreen.release(); mDeferredDepth.release(); - for (U32 i = 0; i < 3; i++) - { - mDeferredLight[i].release(); - } - - mEdgeMap.release(); - mGIMap.release(); - mGIMapPost[0].release(); - mGIMapPost[1].release(); - mHighlight.release(); - mLuminanceMap.release(); + mDeferredLight.release(); + mHighlight.release(); + for (U32 i = 0; i < 6; i++) { mShadow[i].release(); @@ -907,6 +1073,7 @@ void LLPipeline::releaseScreenBuffers() void LLPipeline::createGLBuffers() { + stop_glerror(); LLMemType mt_cb(LLMemType::MTYPE_PIPELINE_CREATE_BUFFERS); assertInitialized(); @@ -1011,18 +1178,12 @@ void LLPipeline::createGLBuffers() LLImageGL::generateTextures(1, &mLightFunc); gGL.getTexUnit(0)->bindManual(LLTexUnit::TT_TEXTURE, mLightFunc); - LLImageGL::setManualImage(LLTexUnit::getInternalType(LLTexUnit::TT_TEXTURE), 0, GL_ALPHA, lightResX, lightResY, GL_ALPHA, GL_UNSIGNED_BYTE, lg); + LLImageGL::setManualImage(LLTexUnit::getInternalType(LLTexUnit::TT_TEXTURE), 0, GL_R8, lightResX, lightResY, GL_RED, GL_UNSIGNED_BYTE, lg); gGL.getTexUnit(0)->setTextureAddressMode(LLTexUnit::TAM_CLAMP); gGL.getTexUnit(0)->setTextureFilteringOption(LLTexUnit::TFO_TRILINEAR); delete [] lg; } - - if (gSavedSettings.getBOOL("RenderDeferredGI")) - { - mGIMap.allocate(512,512,GL_RGBA, TRUE, FALSE); - addDeferredAttachments(mGIMap); - } } gBumpImageList.restoreGL(); @@ -1123,10 +1284,11 @@ S32 LLPipeline::getMaxLightingDetail() const S32 LLPipeline::setLightingDetail(S32 level) { LLMemType mt_ld(LLMemType::MTYPE_PIPELINE_LIGHTING_DETAIL); + refreshCachedSettings(); if (level < 0) { - if (gSavedSettings.getBOOL("RenderLocalLights")) + if (RenderLocalLights) { level = 1; } @@ -1447,7 +1609,7 @@ U32 LLPipeline::addObject(LLViewerObject *vobj) { LLMemType mt_ao(LLMemType::MTYPE_PIPELINE_ADD_OBJECT); - if (gSavedSettings.getBOOL("RenderDelayCreation")) + if (RenderDelayCreation) { mCreateQ.push_back(vobj); } @@ -1510,7 +1672,7 @@ void LLPipeline::createObject(LLViewerObject* vobj) markRebuild(drawablep, LLDrawable::REBUILD_ALL, TRUE); - if (drawablep->getVOVolume() && gSavedSettings.getBOOL("RenderAnimateRes")) + if (drawablep->getVOVolume() && RenderAnimateRes) { // fun animated res drawablep->updateXform(TRUE); @@ -1549,7 +1711,7 @@ void LLPipeline::resetFrameStats() //external functions for asynchronous updating void LLPipeline::updateMoveDampedAsync(LLDrawable* drawablep) { - if (gSavedSettings.getBOOL("FreezeTime")) + if (FreezeTime) { return; } @@ -1579,7 +1741,7 @@ void LLPipeline::updateMoveDampedAsync(LLDrawable* drawablep) void LLPipeline::updateMoveNormalAsync(LLDrawable* drawablep) { - if (gSavedSettings.getBOOL("FreezeTime")) + if (FreezeTime) { return; } @@ -1636,7 +1798,7 @@ void LLPipeline::updateMove() LLFastTimer t(FTM_UPDATE_MOVE); LLMemType mt_um(LLMemType::MTYPE_PIPELINE_UPDATE_MOVE); - if (gSavedSettings.getBOOL("FreezeTime")) + if (FreezeTime) { return; } @@ -2009,13 +2171,13 @@ void LLPipeline::updateCull(LLCamera& camera, LLCullResult& result, S32 water_cl gGL.setColorMask(false, false); } - glMatrixMode(GL_PROJECTION); - glPushMatrix(); - glLoadMatrixd(gGLLastProjection); - glMatrixMode(GL_MODELVIEW); - glPushMatrix(); + gGL.matrixMode(LLRender::MM_PROJECTION); + gGL.pushMatrix(); + gGL.loadMatrix(gGLLastProjection); + gGL.matrixMode(LLRender::MM_MODELVIEW); + gGL.pushMatrix(); gGLLastMatrix = NULL; - glLoadMatrixd(gGLLastModelView); + gGL.loadMatrix(gGLLastModelView); LLVertexBuffer::unbind(); @@ -2120,10 +2282,10 @@ void LLPipeline::updateCull(LLCamera& camera, LLCullResult& result, S32 water_cl } - glMatrixMode(GL_PROJECTION); - glPopMatrix(); - glMatrixMode(GL_MODELVIEW); - glPopMatrix(); + gGL.matrixMode(LLRender::MM_PROJECTION); + gGL.popMatrix(); + gGL.matrixMode(LLRender::MM_MODELVIEW); + gGL.popMatrix(); if (sUseOcclusion > 1) { @@ -2761,6 +2923,11 @@ void LLPipeline::stateSort(LLCamera& camera, LLCullResult &result) { markVisible(*i, camera); } + + if (!sDelayVBUpdate) + { //rebuild mesh as soon as we know it's visible + group->rebuildMesh(); + } } } @@ -2811,6 +2978,11 @@ void LLPipeline::stateSort(LLCamera& camera, LLCullResult &result) { group->setVisible(); stateSort(group, camera); + + if (!sDelayVBUpdate) + { //rebuild mesh as soon as we know it's visible + group->rebuildMesh(); + } } } @@ -2826,11 +2998,7 @@ void LLPipeline::stateSort(LLCamera& camera, LLCullResult &result) } } } - { - LLFastTimer ftm(FTM_CLIENT_COPY); - LLVertexBuffer::clientCopy(); - } - + postSort(camera); } @@ -2986,7 +3154,7 @@ void renderScriptedBeacons(LLDrawable* drawablep) { if (gPipeline.sRenderBeacons) { - gObjectList.addDebugBeacon(vobj->getPositionAgent(), "", LLColor4(1.f, 0.f, 0.f, 0.5f), LLColor4(1.f, 1.f, 1.f, 0.5f), gSavedSettings.getS32("DebugBeaconLineWidth")); + gObjectList.addDebugBeacon(vobj->getPositionAgent(), "", LLColor4(1.f, 0.f, 0.f, 0.5f), LLColor4(1.f, 1.f, 1.f, 0.5f), LLPipeline::DebugBeaconLineWidth); } if (gPipeline.sRenderHighlight) @@ -3012,7 +3180,7 @@ void renderScriptedTouchBeacons(LLDrawable* drawablep) { if (gPipeline.sRenderBeacons) { - gObjectList.addDebugBeacon(vobj->getPositionAgent(), "", LLColor4(1.f, 0.f, 0.f, 0.5f), LLColor4(1.f, 1.f, 1.f, 0.5f), gSavedSettings.getS32("DebugBeaconLineWidth")); + gObjectList.addDebugBeacon(vobj->getPositionAgent(), "", LLColor4(1.f, 0.f, 0.f, 0.5f), LLColor4(1.f, 1.f, 1.f, 0.5f), LLPipeline::DebugBeaconLineWidth); } if (gPipeline.sRenderHighlight) @@ -3037,7 +3205,7 @@ void renderPhysicalBeacons(LLDrawable* drawablep) { if (gPipeline.sRenderBeacons) { - gObjectList.addDebugBeacon(vobj->getPositionAgent(), "", LLColor4(0.f, 1.f, 0.f, 0.5f), LLColor4(1.f, 1.f, 1.f, 0.5f), gSavedSettings.getS32("DebugBeaconLineWidth")); + gObjectList.addDebugBeacon(vobj->getPositionAgent(), "", LLColor4(0.f, 1.f, 0.f, 0.5f), LLColor4(1.f, 1.f, 1.f, 0.5f), LLPipeline::DebugBeaconLineWidth); } if (gPipeline.sRenderHighlight) @@ -3073,7 +3241,7 @@ void renderMOAPBeacons(LLDrawable* drawablep) { if (gPipeline.sRenderBeacons) { - gObjectList.addDebugBeacon(vobj->getPositionAgent(), "", LLColor4(1.f, 1.f, 1.f, 0.5f), LLColor4(1.f, 1.f, 1.f, 0.5f), gSavedSettings.getS32("DebugBeaconLineWidth")); + gObjectList.addDebugBeacon(vobj->getPositionAgent(), "", LLColor4(1.f, 1.f, 1.f, 0.5f), LLColor4(1.f, 1.f, 1.f, 0.5f), LLPipeline::DebugBeaconLineWidth); } if (gPipeline.sRenderHighlight) @@ -3098,7 +3266,7 @@ void renderParticleBeacons(LLDrawable* drawablep) if (gPipeline.sRenderBeacons) { LLColor4 light_blue(0.5f, 0.5f, 1.f, 0.5f); - gObjectList.addDebugBeacon(vobj->getPositionAgent(), "", light_blue, LLColor4(1.f, 1.f, 1.f, 0.5f), gSavedSettings.getS32("DebugBeaconLineWidth")); + gObjectList.addDebugBeacon(vobj->getPositionAgent(), "", light_blue, LLColor4(1.f, 1.f, 1.f, 0.5f), LLPipeline::DebugBeaconLineWidth); } if (gPipeline.sRenderHighlight) @@ -3243,19 +3411,6 @@ void LLPipeline::postSort(LLCamera& camera) if (!sShadowRender) { - //sort by texture or bump map - for (U32 i = 0; i < LLRenderPass::NUM_RENDER_TYPES; ++i) - { - if (i == LLRenderPass::PASS_BUMP) - { - std::sort(sCull->beginRenderMap(i), sCull->endRenderMap(i), LLDrawInfo::CompareBump()); - } - else - { - std::sort(sCull->beginRenderMap(i), sCull->endRenderMap(i), LLDrawInfo::CompareTexturePtrMatrix()); - } - } - std::sort(sCull->beginAlphaGroups(), sCull->endAlphaGroups(), LLSpatialGroup::CompareDepthGreater()); } llpushcallstacks ; @@ -3304,7 +3459,7 @@ void LLPipeline::postSort(LLCamera& camera) if (gPipeline.sRenderBeacons) { //pos += LLVector3(0.f, 0.f, 0.2f); - gObjectList.addDebugBeacon(pos, "", LLColor4(1.f, 1.f, 0.f, 0.5f), LLColor4(1.f, 1.f, 1.f, 0.5f), gSavedSettings.getS32("DebugBeaconLineWidth")); + gObjectList.addDebugBeacon(pos, "", LLColor4(1.f, 1.f, 0.f, 0.5f), LLColor4(1.f, 1.f, 1.f, 0.5f), DebugBeaconLineWidth); } } // now deal with highlights for all those seeable sound sources @@ -3369,7 +3524,7 @@ void render_hud_elements() if (!LLPipeline::sReflectionRender && gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_UI)) { - LLGLEnable multisample(gSavedSettings.getU32("RenderFSAASamples") > 0 ? GL_MULTISAMPLE_ARB : 0); + LLGLEnable multisample(LLPipeline::RenderFSAASamples > 0 ? GL_MULTISAMPLE_ARB : 0); gViewerWindow->renderSelections(FALSE, FALSE, FALSE); // For HUD version in render_ui_3d() // Draw the tracking overlays @@ -3441,10 +3596,10 @@ void LLPipeline::renderHighlights() //gGL.setSceneBlendType(LLRender::BT_ADD_WITH_ALPHA); gGL.pushMatrix(); - glLoadIdentity(); - glMatrixMode(GL_PROJECTION); + gGL.loadIdentity(); + gGL.matrixMode(LLRender::MM_PROJECTION); gGL.pushMatrix(); - glLoadIdentity(); + gGL.loadIdentity(); gGL.getTexUnit(0)->bind(&mHighlight); @@ -3456,9 +3611,9 @@ void LLPipeline::renderHighlights() gGL.begin(LLRender::TRIANGLES); - F32 scale = gSavedSettings.getF32("RenderHighlightBrightness"); - LLColor4 color = gSavedSettings.getColor4("RenderHighlightColor"); - F32 thickness = gSavedSettings.getF32("RenderHighlightThickness"); + F32 scale = RenderHighlightBrightness; + LLColor4 color = RenderHighlightColor; + F32 thickness = RenderHighlightThickness; for (S32 pass = 0; pass < 2; ++pass) { @@ -3504,7 +3659,7 @@ void LLPipeline::renderHighlights() gGL.end(); gGL.popMatrix(); - glMatrixMode(GL_MODELVIEW); + gGL.matrixMode(LLRender::MM_MODELVIEW); gGL.popMatrix(); //gGL.setSceneBlendType(LLRender::BT_ALPHA); @@ -3513,7 +3668,7 @@ void LLPipeline::renderHighlights() if ((LLViewerShaderMgr::instance()->getVertexShaderLevel(LLViewerShaderMgr::SHADER_INTERFACE) > 0)) { gHighlightProgram.bind(); - gHighlightProgram.vertexAttrib4f(LLViewerShaderMgr::MATERIAL_COLOR,1,1,1,0.5f); + gGL.diffuseColor4f(1,1,1,0.5f); } if (hasRenderDebugFeatureMask(RENDER_DEBUG_FEATURE_SELECTED)) @@ -3543,10 +3698,7 @@ void LLPipeline::renderHighlights() { // Paint 'em red! color.setVec(1.f, 0.f, 0.f, 0.5f); - if ((LLViewerShaderMgr::instance()->getVertexShaderLevel(LLViewerShaderMgr::SHADER_INTERFACE) > 0)) - { - gHighlightProgram.vertexAttrib4f(LLViewerShaderMgr::MATERIAL_COLOR,1,0,0,0.5f); - } + int count = mHighlightFaces.size(); for (S32 i = 0; i < count; i++) { @@ -3575,8 +3727,8 @@ void LLPipeline::renderGeom(LLCamera& camera, BOOL forceVBOUpdate) assertInitialized(); - F64 saved_modelview[16]; - F64 saved_projection[16]; + F32 saved_modelview[16]; + F32 saved_projection[16]; //HACK: preserve/restore matrices around HUD render if (gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_HUD)) @@ -3588,13 +3740,6 @@ void LLPipeline::renderGeom(LLCamera& camera, BOOL forceVBOUpdate) } } - S32 stack_depth = 0; - - if (gDebugGL) - { - glGetIntegerv(GL_MODELVIEW_STACK_DEPTH, &stack_depth); - } - /////////////////////////////////////////// // // Sync and verify GL state @@ -3620,12 +3765,12 @@ void LLPipeline::renderGeom(LLCamera& camera, BOOL forceVBOUpdate) LLAppViewer::instance()->pingMainloopTimeout("Pipeline:ForceVBO"); // Initialize lots of GL state to "safe" values - glMatrixMode(GL_TEXTURE); - glLoadIdentity(); - glMatrixMode(GL_MODELVIEW); + gGL.matrixMode(LLRender::MM_TEXTURE); + gGL.loadIdentity(); + gGL.matrixMode(LLRender::MM_MODELVIEW); LLGLSPipeline gls_pipeline; - LLGLEnable multisample(gSavedSettings.getU32("RenderFSAASamples") > 0 ? GL_MULTISAMPLE_ARB : 0); + LLGLEnable multisample(RenderFSAASamples > 0 ? GL_MULTISAMPLE_ARB : 0); LLGLState gls_color_material(GL_COLOR_MATERIAL, mLightingDetail < 2); @@ -3715,7 +3860,7 @@ void LLPipeline::renderGeom(LLCamera& camera, BOOL forceVBOUpdate) { occlude = FALSE; gGLLastMatrix = NULL; - glLoadMatrixd(gGLModelView); + gGL.loadMatrix(gGLModelView); LLGLSLShader::bindNoShader(); doOcclusion(camera); } @@ -3726,7 +3871,7 @@ void LLPipeline::renderGeom(LLCamera& camera, BOOL forceVBOUpdate) LLFastTimer t(FTM_POOLRENDER); gGLLastMatrix = NULL; - glLoadMatrixd(gGLModelView); + gGL.loadMatrix(gGLModelView); for( S32 i = 0; i < poolp->getNumPasses(); i++ ) { @@ -3746,7 +3891,6 @@ void LLPipeline::renderGeom(LLCamera& camera, BOOL forceVBOUpdate) LLVertexBuffer::unbind(); if (gDebugGL) { - check_stack_depth(stack_depth); std::string msg = llformat("pass %d", i); LLGLState::checkStates(msg); //LLGLState::checkTextureChannels(msg); @@ -3775,13 +3919,13 @@ void LLPipeline::renderGeom(LLCamera& camera, BOOL forceVBOUpdate) LLVertexBuffer::unbind(); gGLLastMatrix = NULL; - glLoadMatrixd(gGLModelView); + gGL.loadMatrix(gGLModelView); if (occlude) { occlude = FALSE; gGLLastMatrix = NULL; - glLoadMatrixd(gGLModelView); + gGL.loadMatrix(gGLModelView); LLGLSLShader::bindNoShader(); doOcclusion(camera); } @@ -3875,7 +4019,7 @@ void LLPipeline::renderGeomDeferred(LLCamera& camera) } } - LLGLEnable multisample(gSavedSettings.getU32("RenderFSAASamples") > 0 ? GL_MULTISAMPLE_ARB : 0); + LLGLEnable multisample(RenderFSAASamples > 0 ? GL_MULTISAMPLE_ARB : 0); LLVertexBuffer::unbind(); @@ -3901,7 +4045,7 @@ void LLPipeline::renderGeomDeferred(LLCamera& camera) LLFastTimer t(FTM_POOLRENDER); gGLLastMatrix = NULL; - glLoadMatrixd(gGLModelView); + gGL.loadMatrix(gGLModelView); for( S32 i = 0; i < poolp->getNumDeferredPasses(); i++ ) { @@ -3922,12 +4066,6 @@ void LLPipeline::renderGeomDeferred(LLCamera& camera) if (gDebugGL || gDebugPipeline) { - GLint depth; - glGetIntegerv(GL_MODELVIEW_STACK_DEPTH, &depth); - if (depth > 3) - { - llerrs << "GL matrix stack corrupted!" << llendl; - } LLGLState::checkStates(); } } @@ -3949,7 +4087,7 @@ void LLPipeline::renderGeomDeferred(LLCamera& camera) } gGLLastMatrix = NULL; - glLoadMatrixd(gGLModelView); + gGL.loadMatrix(gGLModelView); gGL.setColorMask(true, false); } @@ -3962,7 +4100,7 @@ void LLPipeline::renderGeomPostDeferred(LLCamera& camera) LLGLEnable cull(GL_CULL_FACE); - LLGLEnable multisample(gSavedSettings.getU32("RenderFSAASamples") > 0 ? GL_MULTISAMPLE_ARB : 0); + LLGLEnable multisample(RenderFSAASamples > 0 ? GL_MULTISAMPLE_ARB : 0); calcNearbyLights(camera); setupHWLights(NULL); @@ -3982,7 +4120,7 @@ void LLPipeline::renderGeomPostDeferred(LLCamera& camera) { occlude = FALSE; gGLLastMatrix = NULL; - glLoadMatrixd(gGLModelView); + gGL.loadMatrix(gGLModelView); LLGLSLShader::bindNoShader(); doOcclusion(camera); gGL.setColorMask(true, false); @@ -3994,7 +4132,7 @@ void LLPipeline::renderGeomPostDeferred(LLCamera& camera) LLFastTimer t(FTM_POOLRENDER); gGLLastMatrix = NULL; - glLoadMatrixd(gGLModelView); + gGL.loadMatrix(gGLModelView); for( S32 i = 0; i < poolp->getNumPostDeferredPasses(); i++ ) { @@ -4015,12 +4153,6 @@ void LLPipeline::renderGeomPostDeferred(LLCamera& camera) if (gDebugGL || gDebugPipeline) { - GLint depth; - glGetIntegerv(GL_MODELVIEW_STACK_DEPTH, &depth); - if (depth > 3) - { - llerrs << "GL matrix stack corrupted!" << llendl; - } LLGLState::checkStates(); } } @@ -4042,17 +4174,17 @@ void LLPipeline::renderGeomPostDeferred(LLCamera& camera) } gGLLastMatrix = NULL; - glLoadMatrixd(gGLModelView); + gGL.loadMatrix(gGLModelView); if (occlude) { occlude = FALSE; gGLLastMatrix = NULL; - glLoadMatrixd(gGLModelView); + gGL.loadMatrix(gGLModelView); LLGLSLShader::bindNoShader(); doOcclusion(camera); gGLLastMatrix = NULL; - glLoadMatrixd(gGLModelView); + gGL.loadMatrix(gGLModelView); } } @@ -4076,8 +4208,10 @@ void LLPipeline::renderGeomShadow(LLCamera& camera) pool_set_t::iterator iter2 = iter1; if (hasRenderType(poolp->getType()) && poolp->getNumShadowPasses() > 0) { + poolp->prerender() ; + gGLLastMatrix = NULL; - glLoadMatrixd(gGLModelView); + gGL.loadMatrix(gGLModelView); for( S32 i = 0; i < poolp->getNumShadowPasses(); i++ ) { @@ -4116,7 +4250,7 @@ void LLPipeline::renderGeomShadow(LLCamera& camera) } gGLLastMatrix = NULL; - glLoadMatrixd(gGLModelView); + gGL.loadMatrix(gGLModelView); } @@ -4163,6 +4297,11 @@ void LLPipeline::renderPhysicsDisplay() gGL.setColorMask(true, false); + if (LLGLSLShader::sNoFixedFunction) + { + gDebugProgram.bind(); + } + for (LLWorld::region_list_t::const_iterator iter = LLWorld::getInstance()->getRegionList().begin(); iter != LLWorld::getInstance()->getRegionList().end(); ++iter) { @@ -4185,15 +4324,20 @@ void LLPipeline::renderPhysicsDisplay() LLSpatialBridge* bridge = *i; if (!bridge->isDead() && hasRenderType(bridge->mDrawableType)) { - glPushMatrix(); - glMultMatrixf((F32*)bridge->mDrawable->getRenderMatrix().mMatrix); + gGL.pushMatrix(); + gGL.multMatrix((F32*)bridge->mDrawable->getRenderMatrix().mMatrix); bridge->renderPhysicsShapes(); - glPopMatrix(); + gGL.popMatrix(); } } - gGL.flush(); + + if (LLGLSLShader::sNoFixedFunction) + { + gDebugProgram.unbind(); + } + mPhysicsDisplay.flush(); } @@ -4207,13 +4351,21 @@ void LLPipeline::renderDebug() gGL.color4f(1,1,1,1); gGLLastMatrix = NULL; - glLoadMatrixd(gGLModelView); + gGL.loadMatrix(gGLModelView); gGL.setColorMask(true, false); bool hud_only = hasRenderType(LLPipeline::RENDER_TYPE_HUD); + if (!hud_only && !mDebugBlips.empty()) { //render debug blips + if (LLGLSLShader::sNoFixedFunction) + { + gUIProgram.bind(); + } + + gGL.getTexUnit(0)->bind(LLViewerFetchedTexture::sWhiteImagep, true); + glPointSize(8.f); LLGLDepthTest depth(GL_TRUE, GL_TRUE, GL_ALWAYS); @@ -4267,13 +4419,18 @@ void LLPipeline::renderDebug() LLSpatialBridge* bridge = *i; if (!bridge->isDead() && hasRenderType(bridge->mDrawableType)) { - glPushMatrix(); - glMultMatrixf((F32*)bridge->mDrawable->getRenderMatrix().mMatrix); + gGL.pushMatrix(); + gGL.multMatrix((F32*)bridge->mDrawable->getRenderMatrix().mMatrix); bridge->renderDebug(); - glPopMatrix(); + gGL.popMatrix(); } } + if (LLGLSLShader::sNoFixedFunction) + { + gUIProgram.bind(); + } + if (hasRenderDebugMask(LLPipeline::RENDER_DEBUG_SHADOW_FRUSTA)) { LLVertexBuffer::unbind(); @@ -4407,6 +4564,11 @@ void LLPipeline::renderDebug() } } + if (mRenderDebugMask & RENDER_DEBUG_WIND_VECTORS) + { + gAgent.getRegion()->mWind.renderVectors(); + } + if (mRenderDebugMask & RENDER_DEBUG_COMPOSITION) { // Debug composition layers @@ -4453,7 +4615,7 @@ void LLPipeline::renderDebug() gGL.getTexUnit(0)->bind(LLViewerFetchedTexture::sWhiteImagep); gGL.pushMatrix(); - glLoadMatrixd(gGLModelView); + gGL.loadMatrix(gGLModelView); gGLLastMatrix = NULL; for (LLSpatialGroup::sg_vector_t::iterator iter = mGroupQ2.begin(); iter != mGroupQ2.end(); ++iter) @@ -4474,7 +4636,7 @@ void LLPipeline::renderDebug() if (bridge) { gGL.pushMatrix(); - glMultMatrixf((F32*)bridge->mDrawable->getRenderMatrix().mMatrix); + gGL.multMatrix((F32*)bridge->mDrawable->getRenderMatrix().mMatrix); } F32 alpha = llclamp((F32) (size-count)/size, 0.f, 1.f); @@ -4498,8 +4660,10 @@ void LLPipeline::renderDebug() } gGL.flush(); - - gPipeline.renderPhysicsDisplay(); + if (LLGLSLShader::sNoFixedFunction) + { + gUIProgram.unbind(); + } } void LLPipeline::rebuildPools() @@ -5048,10 +5212,14 @@ void LLPipeline::calcNearbyLights(LLCamera& camera) void LLPipeline::setupHWLights(LLDrawPool* pool) { assertInitialized(); - + // Ambient - LLColor4 ambient = gSky.getTotalAmbientColor(); - glLightModelfv(GL_LIGHT_MODEL_AMBIENT,ambient.mV); + if (!LLGLSLShader::sNoFixedFunction) + { + gGL.syncMatrices(); + LLColor4 ambient = gSky.getTotalAmbientColor(); + gGL.setAmbientLightColor(ambient); + } // Light 0 = Sun or Moon (All objects) { @@ -5161,8 +5329,9 @@ void LLPipeline::setupHWLights(LLDrawPool* pool) light_state->setQuadraticAttenuation(0.f); } + if (light->isLightSpotlight() // directional (spot-)light - && (LLPipeline::sRenderDeferred || gSavedSettings.getBOOL("RenderSpotLightsInNondeferred"))) // these are only rendered as GL spotlights if we're in deferred rendering mode *or* the setting forces them on + && (LLPipeline::sRenderDeferred || RenderSpotLightsInNondeferred)) // these are only rendered as GL spotlights if we're in deferred rendering mode *or* the setting forces them on { LLVector3 spotparams = light->getSpotLightParams(); LLQuaternion quat = light->getRenderRotation(); @@ -5229,7 +5398,11 @@ void LLPipeline::setupHWLights(LLDrawPool* pool) } // Init GL state - glDisable(GL_LIGHTING); + if (!LLGLSLShader::sNoFixedFunction) + { + glDisable(GL_LIGHTING); + } + for (S32 i = 0; i < 8; ++i) { gGL.getLight(i)->disable(); @@ -5250,7 +5423,10 @@ void LLPipeline::enableLights(U32 mask) stop_glerror(); if (!mLightMask) { - glEnable(GL_LIGHTING); + if (!LLGLSLShader::sNoFixedFunction) + { + glEnable(GL_LIGHTING); + } } if (mask) { @@ -5273,13 +5449,16 @@ void LLPipeline::enableLights(U32 mask) } else { - glDisable(GL_LIGHTING); + if (!LLGLSLShader::sNoFixedFunction) + { + glDisable(GL_LIGHTING); + } } - stop_glerror(); mLightMask = mask; - LLColor4 ambient = gSky.getTotalAmbientColor(); - glLightModelfv(GL_LIGHT_MODEL_AMBIENT,ambient.mV); stop_glerror(); + + LLColor4 ambient = gSky.getTotalAmbientColor(); + gGL.setAmbientLightColor(ambient); } } @@ -5328,21 +5507,24 @@ void LLPipeline::enableLightsPreview() { disableLights(); - glEnable(GL_LIGHTING); - LLColor4 ambient = gSavedSettings.getColor4("PreviewAmbientColor"); - glLightModelfv(GL_LIGHT_MODEL_AMBIENT,ambient.mV); + if (!LLGLSLShader::sNoFixedFunction) + { + glEnable(GL_LIGHTING); + } + LLColor4 ambient = PreviewAmbientColor; + gGL.setAmbientLightColor(ambient); - 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"); + LLColor4 diffuse0 = PreviewDiffuse0; + LLColor4 specular0 = PreviewSpecular0; + LLColor4 diffuse1 = PreviewDiffuse1; + LLColor4 specular1 = PreviewSpecular1; + LLColor4 diffuse2 = PreviewDiffuse2; + LLColor4 specular2 = PreviewSpecular2; - LLVector3 dir0 = gSavedSettings.getVector3("PreviewDirection0"); - LLVector3 dir1 = gSavedSettings.getVector3("PreviewDirection1"); - LLVector3 dir2 = gSavedSettings.getVector3("PreviewDirection2"); + LLVector3 dir0 = PreviewDirection0; + LLVector3 dir1 = PreviewDirection1; + LLVector3 dir2 = PreviewDirection2; dir0.normVec(); dir1.normVec(); @@ -5389,7 +5571,7 @@ void LLPipeline::enableLightsAvatarEdit(const LLColor4& color) setupAvatarLights(TRUE); enableLights(mask); - glLightModelfv(GL_LIGHT_MODEL_AMBIENT,color.mV); + gGL.setAmbientLightColor(color); } void LLPipeline::enableLightsFullbright(const LLColor4& color) @@ -5398,7 +5580,7 @@ void LLPipeline::enableLightsFullbright(const LLColor4& color) U32 mask = 0x1000; // Non-0 mask, set ambient enableLights(mask); - glLightModelfv(GL_LIGHT_MODEL_AMBIENT,color.mV); + gGL.setAmbientLightColor(color); } void LLPipeline::disableLights() @@ -6054,11 +6236,8 @@ void LLPipeline::resetVertexBuffers() gSky.resetVertexBuffers(); - if (LLVertexBuffer::sGLCount > 0) - { - LLVertexBuffer::cleanupClass(); - } - + LLVertexBuffer::cleanupClass(); + //delete all name pool caches LLGLNamePool::cleanupPools(); @@ -6067,35 +6246,32 @@ void LLPipeline::resetVertexBuffers() llwarns << "VBO wipe failed." << llendl; } - if (!LLVertexBuffer::sStreamIBOPool.mNameList.empty() || - !LLVertexBuffer::sStreamVBOPool.mNameList.empty() || - !LLVertexBuffer::sDynamicIBOPool.mNameList.empty() || - !LLVertexBuffer::sDynamicVBOPool.mNameList.empty()) - { - llwarns << "VBO name pool cleanup failed." << llendl; - } + llassert(LLVertexBuffer::sGLCount == 0); LLVertexBuffer::unbind(); sRenderBump = gSavedSettings.getBOOL("RenderObjectBump"); sUseTriStrips = gSavedSettings.getBOOL("RenderUseTriStrips"); LLVertexBuffer::sUseStreamDraw = gSavedSettings.getBOOL("RenderUseStreamVBO"); + LLVertexBuffer::sUseVAO = gSavedSettings.getBOOL("RenderUseVAO"); LLVertexBuffer::sPreferStreamDraw = gSavedSettings.getBOOL("RenderPreferStreamDraw"); LLVertexBuffer::sEnableVBOs = gSavedSettings.getBOOL("RenderVBOEnable"); LLVertexBuffer::sDisableVBOMapping = LLVertexBuffer::sEnableVBOs && gSavedSettings.getBOOL("RenderVBOMappingDisable") ; sBakeSunlight = gSavedSettings.getBOOL("RenderBakeSunlight"); sNoAlpha = gSavedSettings.getBOOL("RenderNoAlpha"); LLPipeline::sTextureBindTest = gSavedSettings.getBOOL("RenderDebugTextureBind"); + + LLVertexBuffer::initClass(LLVertexBuffer::sEnableVBOs, LLVertexBuffer::sDisableVBOMapping); } -void LLPipeline::renderObjects(U32 type, U32 mask, BOOL texture) +void LLPipeline::renderObjects(U32 type, U32 mask, BOOL texture, BOOL batch_texture) { LLMemType mt_ro(LLMemType::MTYPE_PIPELINE_RENDER_OBJECTS); assertInitialized(); - glLoadMatrixd(gGLModelView); + gGL.loadMatrix(gGLModelView); gGLLastMatrix = NULL; - mSimplePool->pushBatches(type, mask); - glLoadMatrixd(gGLModelView); + mSimplePool->pushBatches(type, mask, texture, batch_texture); + gGL.loadMatrix(gGLModelView); gGLLastMatrix = NULL; } @@ -6104,25 +6280,25 @@ void apply_cube_face_rotation(U32 face) switch (face) { case 0: - glRotatef(90.f, 0, 1, 0); - glRotatef(180.f, 1, 0, 0); + gGL.rotatef(90.f, 0, 1, 0); + gGL.rotatef(180.f, 1, 0, 0); break; case 2: - glRotatef(-90.f, 1, 0, 0); + gGL.rotatef(-90.f, 1, 0, 0); break; case 4: - glRotatef(180.f, 0, 1, 0); - glRotatef(180.f, 0, 0, 1); + gGL.rotatef(180.f, 0, 1, 0); + gGL.rotatef(180.f, 0, 0, 1); break; case 1: - glRotatef(-90.f, 0, 1, 0); - glRotatef(180.f, 1, 0, 0); + gGL.rotatef(-90.f, 0, 1, 0); + gGL.rotatef(180.f, 1, 0, 0); break; case 3: - glRotatef(90, 1, 0, 0); + gGL.rotatef(90, 1, 0, 0); break; case 5: - glRotatef(180, 0, 0, 1); + gGL.rotatef(180, 0, 0, 1); break; } } @@ -6165,8 +6341,7 @@ void LLPipeline::renderBloom(BOOL for_snapshot, F32 zoom_factor, int subfield) { LLMemType mt_ru(LLMemType::MTYPE_PIPELINE_RENDER_BLOOM); if (!(gPipeline.canUseVertexShaders() && - sRenderGlow) || - (!sRenderDeferred && hasRenderDebugMask(LLPipeline::RENDER_DEBUG_PHYSICS_SHAPES))) + sRenderGlow)) { return; } @@ -6182,11 +6357,11 @@ void LLPipeline::renderBloom(BOOL for_snapshot, F32 zoom_factor, int subfield) glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); } - U32 res_mod = gSavedSettings.getU32("RenderResolutionDivisor"); + U32 res_mod = RenderResolutionDivisor; LLVector2 tc1(0,0); - LLVector2 tc2((F32) gViewerWindow->getWorldViewWidthRaw()*2, - (F32) gViewerWindow->getWorldViewHeightRaw()*2); + LLVector2 tc2((F32) mScreen.getWidth()*2, + (F32) mScreen.getHeight()*2); if (res_mod > 1) { @@ -6201,12 +6376,12 @@ void LLPipeline::renderBloom(BOOL for_snapshot, F32 zoom_factor, int subfield) enableLightsFullbright(LLColor4(1,1,1,1)); - glMatrixMode(GL_PROJECTION); - glPushMatrix(); - glLoadIdentity(); - glMatrixMode(GL_MODELVIEW); - glPushMatrix(); - glLoadIdentity(); + gGL.matrixMode(LLRender::MM_PROJECTION); + gGL.pushMatrix(); + gGL.loadIdentity(); + gGL.matrixMode(LLRender::MM_MODELVIEW); + gGL.pushMatrix(); + gGL.loadIdentity(); LLGLDisable test(GL_ALPHA_TEST); @@ -6221,16 +6396,18 @@ void LLPipeline::renderBloom(BOOL for_snapshot, F32 zoom_factor, int subfield) } gGlowExtractProgram.bind(); - F32 minLum = llmax(gSavedSettings.getF32("RenderGlowMinLuminance"), 0.0f); - F32 maxAlpha = gSavedSettings.getF32("RenderGlowMaxExtractAlpha"); - F32 warmthAmount = gSavedSettings.getF32("RenderGlowWarmthAmount"); - LLVector3 lumWeights = gSavedSettings.getVector3("RenderGlowLumWeights"); - LLVector3 warmthWeights = gSavedSettings.getVector3("RenderGlowWarmthWeights"); - gGlowExtractProgram.uniform1f("minLuminance", minLum); - gGlowExtractProgram.uniform1f("maxExtractAlpha", maxAlpha); - gGlowExtractProgram.uniform3f("lumWeights", lumWeights.mV[0], lumWeights.mV[1], lumWeights.mV[2]); - gGlowExtractProgram.uniform3f("warmthWeights", warmthWeights.mV[0], warmthWeights.mV[1], warmthWeights.mV[2]); - gGlowExtractProgram.uniform1f("warmthAmount", warmthAmount); + F32 minLum = llmax((F32) RenderGlowMinLuminance, 0.0f); + F32 maxAlpha = RenderGlowMaxExtractAlpha; + F32 warmthAmount = RenderGlowWarmthAmount; + LLVector3 lumWeights = RenderGlowLumWeights; + LLVector3 warmthWeights = RenderGlowWarmthWeights; + + + gGlowExtractProgram.uniform1f(LLShaderMgr::GLOW_MIN_LUMINANCE, minLum); + gGlowExtractProgram.uniform1f(LLShaderMgr::GLOW_MAX_EXTRACT_ALPHA, maxAlpha); + gGlowExtractProgram.uniform3f(LLShaderMgr::GLOW_LUM_WEIGHTS, lumWeights.mV[0], lumWeights.mV[1], lumWeights.mV[2]); + gGlowExtractProgram.uniform3f(LLShaderMgr::GLOW_WARMTH_WEIGHTS, warmthWeights.mV[0], warmthWeights.mV[1], warmthWeights.mV[2]); + gGlowExtractProgram.uniform1f(LLShaderMgr::GLOW_WARMTH_AMOUNT, warmthAmount); LLGLEnable blend_on(GL_BLEND); LLGLEnable test(GL_ALPHA_TEST); @@ -6261,22 +6438,22 @@ void LLPipeline::renderBloom(BOOL for_snapshot, F32 zoom_factor, int subfield) tc2.setVec(2,2); // power of two between 1 and 1024 - U32 glowResPow = gSavedSettings.getS32("RenderGlowResolutionPow"); + U32 glowResPow = RenderGlowResolutionPow; const U32 glow_res = llmax(1, llmin(1024, 1 << glowResPow)); - S32 kernel = gSavedSettings.getS32("RenderGlowIterations")*2; - F32 delta = gSavedSettings.getF32("RenderGlowWidth") / glow_res; + S32 kernel = RenderGlowIterations*2; + F32 delta = RenderGlowWidth / glow_res; // Use half the glow width if we have the res set to less than 9 so that it looks // almost the same in either case. if (glowResPow < 9) { delta *= 0.5f; } - F32 strength = gSavedSettings.getF32("RenderGlowStrength"); + F32 strength = RenderGlowStrength; gGlowProgram.bind(); - gGlowProgram.uniform1f("glowStrength", strength); + gGlowProgram.uniform1f(LLShaderMgr::GLOW_STRENGTH, strength); for (S32 i = 0; i < kernel; i++) { @@ -6297,11 +6474,11 @@ void LLPipeline::renderBloom(BOOL for_snapshot, F32 zoom_factor, int subfield) if (i%2 == 0) { - gGlowProgram.uniform2f("glowDelta", delta, 0); + gGlowProgram.uniform2f(LLShaderMgr::GLOW_DELTA, delta, 0); } else { - gGlowProgram.uniform2f("glowDelta", 0, delta); + gGlowProgram.uniform2f(LLShaderMgr::GLOW_DELTA, 0, delta); } gGL.begin(LLRender::TRIANGLE_STRIP); @@ -6333,8 +6510,8 @@ void LLPipeline::renderBloom(BOOL for_snapshot, F32 zoom_factor, int subfield) gGLViewport[3] = gViewerWindow->getWorldViewRectRaw().getHeight(); glViewport(gGLViewport[0], gGLViewport[1], gGLViewport[2], gGLViewport[3]); - tc2.setVec((F32) gViewerWindow->getWorldViewWidthRaw(), - (F32) gViewerWindow->getWorldViewHeightRaw()); + tc2.setVec((F32) mScreen.getWidth(), + (F32) mScreen.getHeight()); gGL.flush(); @@ -6342,28 +6519,22 @@ void LLPipeline::renderBloom(BOOL for_snapshot, F32 zoom_factor, int subfield) if (LLPipeline::sRenderDeferred) { - bool dof_enabled = !LLViewerCamera::getInstance()->cameraUnderWater(); - LLGLSLShader* shader = &gDeferredPostProgram; - if (LLViewerShaderMgr::instance()->getVertexShaderLevel(LLViewerShaderMgr::SHADER_DEFERRED) > 2) - { - shader = &gDeferredGIFinalProgram; - dof_enabled = false; - } - else if (!dof_enabled || LLToolMgr::getInstance()->inBuildMode() || !gSavedSettings.getBOOL("RenderDepthOfField")) - { //squish focal length when in build mode (or if DoF is disabled) so DoF doesn't make editing objects difficult - shader = &gDeferredPostNoDoFProgram; - dof_enabled = false; - } - - - LLGLDisable blend(GL_BLEND); - bindDeferredShader(*shader); + bool dof_enabled = !LLViewerCamera::getInstance()->cameraUnderWater() && + !LLToolMgr::getInstance()->inBuildMode() && + RenderDepthOfField; + + bool multisample = RenderFSAASamples > 1 && mFXAABuffer.isComplete(); + + gViewerWindow->setup3DViewport(); + if (dof_enabled) { - //depth of field focal plane calculations + LLGLSLShader* shader = &gDeferredPostProgram; + LLGLDisable blend(GL_BLEND); + //depth of field focal plane calculations static F32 current_distance = 16.f; static F32 start_distance = 16.f; static F32 transition_time = 1.f; @@ -6393,8 +6564,8 @@ void LLPipeline::renderBloom(BOOL for_snapshot, F32 zoom_factor, int subfield) else if (gAgentCamera.cameraMouselook()) { //focus on point under mouselook crosshairs gViewerWindow->cursorIntersect(-1, -1, 512.f, NULL, -1, FALSE, - NULL, - &focus_point); + NULL, + &focus_point); } else { @@ -6425,7 +6596,7 @@ void LLPipeline::renderBloom(BOOL for_snapshot, F32 zoom_factor, int subfield) } else if (transition_time < 1.f) { //currently in a transition, continue interpolating - transition_time += 1.f/gSavedSettings.getF32("CameraFocusTransitionTime")*gFrameIntervalSeconds; + transition_time += 1.f/CameraFocusTransitionTime*gFrameIntervalSeconds; transition_time = llmin(transition_time, 1.f); F32 t = cosf(transition_time*F_PI+F_PI)*0.5f+0.5f; @@ -6438,12 +6609,12 @@ void LLPipeline::renderBloom(BOOL for_snapshot, F32 zoom_factor, int subfield) //convert to mm F32 subject_distance = current_distance*1000.f; - F32 fnumber = gSavedSettings.getF32("CameraFNumber"); - F32 default_focal_length = gSavedSettings.getF32("CameraFocalLength"); + F32 fnumber = CameraFNumber; + F32 default_focal_length = CameraFocalLength; F32 fov = LLViewerCamera::getInstance()->getView(); - const F32 default_fov = gSavedSettings.getF32("CameraFieldOfView") * F_PI/180.f; + const F32 default_fov = CameraFieldOfView * F_PI/180.f; //const F32 default_aspect_ratio = gSavedSettings.getF32("CameraAspectRatio"); //F32 aspect_ratio = (F32) mScreen.getWidth()/(F32)mScreen.getHeight(); @@ -6466,36 +6637,217 @@ void LLPipeline::renderBloom(BOOL for_snapshot, F32 zoom_factor, int subfield) blur_constant /= 1000.f; //convert to meters for shader F32 magnification = focal_length/(subject_distance-focal_length); - shader->uniform1f("focal_distance", -subject_distance/1000.f); - shader->uniform1f("blur_constant", blur_constant); - shader->uniform1f("tan_pixel_angle", tanf(1.f/LLDrawable::sCurPixelAngle)); - shader->uniform1f("magnification", magnification); - } + { //build diffuse+bloom+CoF + mDeferredLight.bindTarget(); + shader = &gDeferredCoFProgram; - S32 channel = shader->enableTexture(LLViewerShaderMgr::DEFERRED_DIFFUSE, mScreen.getUsage()); - if (channel > -1) - { - mScreen.bindTexture(0, channel); + bindDeferredShader(*shader); + + S32 channel = shader->enableTexture(LLShaderMgr::DEFERRED_DIFFUSE, mScreen.getUsage()); + if (channel > -1) + { + mScreen.bindTexture(0, channel); + } + + shader->uniform1f(LLShaderMgr::DOF_FOCAL_DISTANCE, -subject_distance/1000.f); + shader->uniform1f(LLShaderMgr::DOF_BLUR_CONSTANT, blur_constant); + shader->uniform1f(LLShaderMgr::DOF_TAN_PIXEL_ANGLE, tanf(1.f/LLDrawable::sCurPixelAngle)); + shader->uniform1f(LLShaderMgr::DOF_MAGNIFICATION, magnification); + shader->uniform1f(LLShaderMgr::DOF_MAX_COF, CameraMaxCoF); + shader->uniform1f(LLShaderMgr::DOF_RES_SCALE, CameraDoFResScale); + + gGL.begin(LLRender::TRIANGLE_STRIP); + gGL.texCoord2f(tc1.mV[0], tc1.mV[1]); + gGL.vertex2f(-1,-1); + + gGL.texCoord2f(tc1.mV[0], tc2.mV[1]); + gGL.vertex2f(-1,3); + + gGL.texCoord2f(tc2.mV[0], tc1.mV[1]); + gGL.vertex2f(3,-1); + + gGL.end(); + + unbindDeferredShader(*shader); + mDeferredLight.flush(); + } + + { //perform DoF sampling at half-res (preserve alpha channel) + mScreen.bindTarget(); + glViewport(0,0,(GLsizei) (mScreen.getWidth()*CameraDoFResScale), (GLsizei) (mScreen.getHeight()*CameraDoFResScale)); + gGL.setColorMask(true, false); + + shader = &gDeferredPostProgram; + bindDeferredShader(*shader); + S32 channel = shader->enableTexture(LLShaderMgr::DEFERRED_DIFFUSE, mDeferredLight.getUsage()); + if (channel > -1) + { + mDeferredLight.bindTexture(0, channel); + } + + shader->uniform1f(LLShaderMgr::DOF_MAX_COF, CameraMaxCoF); + shader->uniform1f(LLShaderMgr::DOF_RES_SCALE, CameraDoFResScale); + + gGL.begin(LLRender::TRIANGLE_STRIP); + gGL.texCoord2f(tc1.mV[0], tc1.mV[1]); + gGL.vertex2f(-1,-1); + + gGL.texCoord2f(tc1.mV[0], tc2.mV[1]); + gGL.vertex2f(-1,3); + + gGL.texCoord2f(tc2.mV[0], tc1.mV[1]); + gGL.vertex2f(3,-1); + + gGL.end(); + + unbindDeferredShader(*shader); + mScreen.flush(); + gGL.setColorMask(true, true); + } + + { //combine result based on alpha + if (multisample) + { + mDeferredLight.bindTarget(); + glViewport(0, 0, mDeferredScreen.getWidth(), mDeferredScreen.getHeight()); + } + else + { + gGLViewport[0] = gViewerWindow->getWorldViewRectRaw().mLeft; + gGLViewport[1] = gViewerWindow->getWorldViewRectRaw().mBottom; + gGLViewport[2] = gViewerWindow->getWorldViewRectRaw().getWidth(); + gGLViewport[3] = gViewerWindow->getWorldViewRectRaw().getHeight(); + glViewport(gGLViewport[0], gGLViewport[1], gGLViewport[2], gGLViewport[3]); + } + + shader = &gDeferredDoFCombineProgram; + bindDeferredShader(*shader); + + S32 channel = shader->enableTexture(LLShaderMgr::DEFERRED_DIFFUSE, mScreen.getUsage()); + if (channel > -1) + { + mScreen.bindTexture(0, channel); + gGL.getTexUnit(channel)->setTextureFilteringOption(LLTexUnit::TFO_BILINEAR); + } + + shader->uniform1f(LLShaderMgr::DOF_MAX_COF, CameraMaxCoF); + shader->uniform1f(LLShaderMgr::DOF_RES_SCALE, CameraDoFResScale); + + gGL.begin(LLRender::TRIANGLE_STRIP); + gGL.texCoord2f(tc1.mV[0], tc1.mV[1]); + gGL.vertex2f(-1,-1); + + gGL.texCoord2f(tc1.mV[0], tc2.mV[1]); + gGL.vertex2f(-1,3); + + gGL.texCoord2f(tc2.mV[0], tc1.mV[1]); + gGL.vertex2f(3,-1); + + gGL.end(); + + unbindDeferredShader(*shader); + + if (multisample) + { + mDeferredLight.flush(); + } + } } - //channel = shader->enableTexture(LLViewerShaderMgr::DEFERRED_DEPTH, LLTexUnit::TT_RECT_TEXTURE); - //if (channel > -1) - //{ - //gGL.getTexUnit(channel)->setTextureFilteringOption(LLTexUnit::TFO_BILINEAR); - //} + else + { + if (multisample) + { + mDeferredLight.bindTarget(); + } + LLGLSLShader* shader = &gDeferredPostNoDoFProgram; + + bindDeferredShader(*shader); + + S32 channel = shader->enableTexture(LLShaderMgr::DEFERRED_DIFFUSE, mScreen.getUsage()); + if (channel > -1) + { + mScreen.bindTexture(0, channel); + } - gGL.begin(LLRender::TRIANGLE_STRIP); - gGL.texCoord2f(tc1.mV[0], tc1.mV[1]); - gGL.vertex2f(-1,-1); + gGL.begin(LLRender::TRIANGLE_STRIP); + gGL.texCoord2f(tc1.mV[0], tc1.mV[1]); + gGL.vertex2f(-1,-1); - gGL.texCoord2f(tc1.mV[0], tc2.mV[1]); - gGL.vertex2f(-1,3); + gGL.texCoord2f(tc1.mV[0], tc2.mV[1]); + gGL.vertex2f(-1,3); - gGL.texCoord2f(tc2.mV[0], tc1.mV[1]); - gGL.vertex2f(3,-1); + gGL.texCoord2f(tc2.mV[0], tc1.mV[1]); + gGL.vertex2f(3,-1); - gGL.end(); + gGL.end(); + + unbindDeferredShader(*shader); + + if (multisample) + { + mDeferredLight.flush(); + } + } + + if (multisample) + { + //bake out texture2D with RGBL for FXAA shader + mFXAABuffer.bindTarget(); + + S32 width = mScreen.getWidth(); + S32 height = mScreen.getHeight(); + glViewport(0, 0, width, height); + + LLGLSLShader* shader = &gGlowCombineFXAAProgram; + + shader->bind(); + shader->uniform2f(LLShaderMgr::DEFERRED_SCREEN_RES, width, height); + + S32 channel = shader->enableTexture(LLShaderMgr::DEFERRED_DIFFUSE, mDeferredLight.getUsage()); + if (channel > -1) + { + mDeferredLight.bindTexture(0, channel); + } + + gGL.begin(LLRender::TRIANGLE_STRIP); + gGL.vertex2f(-1,-1); + gGL.vertex2f(-1,3); + gGL.vertex2f(3,-1); + gGL.end(); + + gGL.flush(); + + shader->disableTexture(LLShaderMgr::DEFERRED_DIFFUSE, mDeferredLight.getUsage()); + shader->unbind(); + + mFXAABuffer.flush(); + + shader = &gFXAAProgram; + shader->bind(); + + channel = shader->enableTexture(LLShaderMgr::DIFFUSE_MAP, mFXAABuffer.getUsage()); + if (channel > -1) + { + mFXAABuffer.bindTexture(0, channel); + gGL.getTexUnit(channel)->setTextureFilteringOption(LLTexUnit::TFO_BILINEAR); + } + + F32 scale_x = (F32) width/mFXAABuffer.getWidth(); + F32 scale_y = (F32) height/mFXAABuffer.getHeight(); + shader->uniform2f(LLShaderMgr::FXAA_TC_SCALE, scale_x, scale_y); + shader->uniform2f(LLShaderMgr::FXAA_RCP_SCREEN_RES, 1.f/width*scale_x, 1.f/height*scale_y); + shader->uniform4f(LLShaderMgr::FXAA_RCP_FRAME_OPT, -0.5f/width*scale_x, -0.5f/height*scale_y, 0.5f/width*scale_x, 0.5f/height*scale_y); + shader->uniform4f(LLShaderMgr::FXAA_RCP_FRAME_OPT2, -2.f/width*scale_x, -2.f/height*scale_y, 2.f/width*scale_x, 2.f/height*scale_y); + + gGL.begin(LLRender::TRIANGLE_STRIP); + gGL.vertex2f(-1,-1); + gGL.vertex2f(-1,3); + gGL.vertex2f(3,-1); + gGL.end(); - unbindDeferredShader(*shader); + gGL.flush(); + shader->unbind(); + } } else { @@ -6528,7 +6880,7 @@ void LLPipeline::renderBloom(BOOL for_snapshot, F32 zoom_factor, int subfield) v[1] = LLVector3(-1,3,0); v[2] = LLVector3(3,-1,0); - buff->setBuffer(0); + buff->flush(); LLGLDisable blend(GL_BLEND); @@ -6547,7 +6899,7 @@ void LLPipeline::renderBloom(BOOL for_snapshot, F32 zoom_factor, int subfield) gGL.getTexUnit(0)->bind(&mGlow[1]); gGL.getTexUnit(1)->bind(&mScreen); - LLGLEnable multisample(gSavedSettings.getU32("RenderFSAASamples") > 0 ? GL_MULTISAMPLE_ARB : 0); + LLGLEnable multisample(RenderFSAASamples > 0 ? GL_MULTISAMPLE_ARB : 0); buff->setBuffer(mask); buff->drawArrays(LLRender::TRIANGLE_STRIP, 0, 3); @@ -6567,19 +6919,13 @@ void LLPipeline::renderBloom(BOOL for_snapshot, F32 zoom_factor, int subfield) } - if (LLRenderTarget::sUseFBO) - { //copy depth buffer from mScreen to framebuffer - LLRenderTarget::copyContentsToFramebuffer(mScreen, 0, 0, mScreen.getWidth(), mScreen.getHeight(), - 0, 0, mScreen.getWidth(), mScreen.getHeight(), GL_DEPTH_BUFFER_BIT, GL_NEAREST); - } - gGL.setSceneBlendType(LLRender::BT_ALPHA); if (hasRenderDebugMask(LLPipeline::RENDER_DEBUG_PHYSICS_SHAPES)) { if (LLGLSLShader::sNoFixedFunction) { - gUIProgram.bind(); + gSplatTextureRectProgram.bind(); } gGL.setColorMask(true, false); @@ -6593,7 +6939,7 @@ void LLPipeline::renderBloom(BOOL for_snapshot, F32 zoom_factor, int subfield) gGL.getTexUnit(0)->bind(&mPhysicsDisplay); - gGL.begin(LLRender::TRIANGLE_STRIP); + gGL.begin(LLRender::TRIANGLES); gGL.texCoord2f(tc1.mV[0], tc1.mV[1]); gGL.vertex2f(-1,-1); @@ -6608,15 +6954,22 @@ void LLPipeline::renderBloom(BOOL for_snapshot, F32 zoom_factor, int subfield) if (LLGLSLShader::sNoFixedFunction) { - gUIProgram.unbind(); + gSplatTextureRectProgram.unbind(); } + } + + if (LLRenderTarget::sUseFBO) + { //copy depth buffer from mScreen to framebuffer + LLRenderTarget::copyContentsToFramebuffer(mScreen, 0, 0, mScreen.getWidth(), mScreen.getHeight(), + 0, 0, mScreen.getWidth(), mScreen.getHeight(), GL_DEPTH_BUFFER_BIT, GL_NEAREST); } + - glMatrixMode(GL_PROJECTION); - glPopMatrix(); - glMatrixMode(GL_MODELVIEW); - glPopMatrix(); + gGL.matrixMode(LLRender::MM_PROJECTION); + gGL.popMatrix(); + gGL.matrixMode(LLRender::MM_MODELVIEW); + gGL.popMatrix(); LLVertexBuffer::unbind(); @@ -6627,7 +6980,7 @@ void LLPipeline::renderBloom(BOOL for_snapshot, F32 zoom_factor, int subfield) static LLFastTimer::DeclareTimer FTM_BIND_DEFERRED("Bind Deferred"); -void LLPipeline::bindDeferredShader(LLGLSLShader& shader, U32 light_index, LLRenderTarget* gi_source, LLRenderTarget* last_gi_post, U32 noise_map) +void LLPipeline::bindDeferredShader(LLGLSLShader& shader, U32 light_index, U32 noise_map) { LLFastTimer t(FTM_BIND_DEFERRED); @@ -6638,146 +6991,28 @@ void LLPipeline::bindDeferredShader(LLGLSLShader& shader, U32 light_index, LLRen shader.bind(); S32 channel = 0; - channel = shader.enableTexture(LLViewerShaderMgr::DEFERRED_DIFFUSE, mDeferredScreen.getUsage()); + channel = shader.enableTexture(LLShaderMgr::DEFERRED_DIFFUSE, mDeferredScreen.getUsage()); if (channel > -1) { mDeferredScreen.bindTexture(0,channel); gGL.getTexUnit(channel)->setTextureFilteringOption(LLTexUnit::TFO_POINT); } - channel = shader.enableTexture(LLViewerShaderMgr::DEFERRED_SPECULAR, mDeferredScreen.getUsage()); + channel = shader.enableTexture(LLShaderMgr::DEFERRED_SPECULAR, mDeferredScreen.getUsage()); if (channel > -1) { mDeferredScreen.bindTexture(1, channel); gGL.getTexUnit(channel)->setTextureFilteringOption(LLTexUnit::TFO_POINT); } - channel = shader.enableTexture(LLViewerShaderMgr::DEFERRED_NORMAL, mDeferredScreen.getUsage()); + channel = shader.enableTexture(LLShaderMgr::DEFERRED_NORMAL, mDeferredScreen.getUsage()); if (channel > -1) { mDeferredScreen.bindTexture(2, channel); gGL.getTexUnit(channel)->setTextureFilteringOption(LLTexUnit::TFO_POINT); } - if (gi_source) - { - BOOL has_gi = FALSE; - channel = shader.enableTexture(LLViewerShaderMgr::DEFERRED_GI_DIFFUSE); - if (channel > -1) - { - has_gi = TRUE; - gi_source->bindTexture(0, channel); - gGL.getTexUnit(channel)->setTextureFilteringOption(LLTexUnit::TFO_BILINEAR); - } - - channel = shader.enableTexture(LLViewerShaderMgr::DEFERRED_GI_SPECULAR); - if (channel > -1) - { - has_gi = TRUE; - gi_source->bindTexture(1, channel); - gGL.getTexUnit(channel)->setTextureFilteringOption(LLTexUnit::TFO_BILINEAR); - } - - channel = shader.enableTexture(LLViewerShaderMgr::DEFERRED_GI_NORMAL); - if (channel > -1) - { - has_gi = TRUE; - gi_source->bindTexture(2, channel); - gGL.getTexUnit(channel)->setTextureFilteringOption(LLTexUnit::TFO_BILINEAR); - } - - channel = shader.enableTexture(LLViewerShaderMgr::DEFERRED_GI_MIN_POS); - if (channel > -1) - { - has_gi = TRUE; - gi_source->bindTexture(1, channel); - gGL.getTexUnit(channel)->setTextureFilteringOption(LLTexUnit::TFO_BILINEAR); - } - - channel = shader.enableTexture(LLViewerShaderMgr::DEFERRED_GI_MAX_POS); - if (channel > -1) - { - has_gi = TRUE; - gi_source->bindTexture(3, channel); - gGL.getTexUnit(channel)->setTextureFilteringOption(LLTexUnit::TFO_BILINEAR); - } - - channel = shader.enableTexture(LLViewerShaderMgr::DEFERRED_GI_LAST_DIFFUSE); - if (channel > -1) - { - has_gi = TRUE; - last_gi_post->bindTexture(0, channel); - gGL.getTexUnit(channel)->setTextureFilteringOption(LLTexUnit::TFO_BILINEAR); - } - - channel = shader.enableTexture(LLViewerShaderMgr::DEFERRED_GI_LAST_NORMAL); - if (channel > -1) - { - has_gi = TRUE; - last_gi_post->bindTexture(2, channel); - gGL.getTexUnit(channel)->setTextureFilteringOption(LLTexUnit::TFO_BILINEAR); - } - - channel = shader.enableTexture(LLViewerShaderMgr::DEFERRED_GI_LAST_MAX_POS); - if (channel > -1) - { - has_gi = TRUE; - last_gi_post->bindTexture(1, channel); - gGL.getTexUnit(channel)->setTextureFilteringOption(LLTexUnit::TFO_BILINEAR); - } - - channel = shader.enableTexture(LLViewerShaderMgr::DEFERRED_GI_LAST_MIN_POS); - if (channel > -1) - { - has_gi = TRUE; - last_gi_post->bindTexture(3, channel); - gGL.getTexUnit(channel)->setTextureFilteringOption(LLTexUnit::TFO_BILINEAR); - } - - channel = shader.enableTexture(LLViewerShaderMgr::DEFERRED_GI_DEPTH); - if (channel > -1) - { - has_gi = TRUE; - gGL.getTexUnit(channel)->bind(gi_source, TRUE); - gGL.getTexUnit(channel)->setTextureFilteringOption(LLTexUnit::TFO_POINT); - stop_glerror(); - - glTexParameteri(LLTexUnit::getInternalType(mGIMap.getUsage()), GL_TEXTURE_COMPARE_MODE_ARB, GL_NONE); - glTexParameteri(LLTexUnit::getInternalType(mGIMap.getUsage()), GL_DEPTH_TEXTURE_MODE_ARB, GL_ALPHA); - - stop_glerror(); - } - - if (has_gi) - { - F32 range_x = llmin(mGIRange.mV[0], 1.f); - F32 range_y = llmin(mGIRange.mV[1], 1.f); - - LLVector2 scale(range_x,range_y); - - LLVector2 kern[25]; - - for (S32 i = 0; i < 5; ++i) - { - for (S32 j = 0; j < 5; ++j) - { - S32 idx = i*5+j; - kern[idx].mV[0] = (i-2)*0.5f; - kern[idx].mV[1] = (j-2)*0.5f; - kern[idx].scaleVec(scale); - } - } - - shader.uniform2fv("gi_kern", 25, (F32*) kern); - shader.uniformMatrix4fv("gi_mat", 1, FALSE, mGIMatrix.m); - shader.uniformMatrix4fv("gi_mat_proj", 1, FALSE, mGIMatrixProj.m); - shader.uniformMatrix4fv("gi_inv_proj", 1, FALSE, mGIInvProj.m); - shader.uniformMatrix4fv("gi_norm_mat", 1, FALSE, mGINormalMatrix.m); - } - } - stop_glerror(); - - channel = shader.enableTexture(LLViewerShaderMgr::DEFERRED_DEPTH, mDeferredDepth.getUsage()); + channel = shader.enableTexture(LLShaderMgr::DEFERRED_DEPTH, mDeferredDepth.getUsage()); if (channel > -1) { gGL.getTexUnit(channel)->bind(&mDeferredDepth, TRUE); @@ -6791,21 +7026,21 @@ void LLPipeline::bindDeferredShader(LLGLSLShader& shader, U32 light_index, LLRen glh::matrix4f projection = glh_get_current_projection(); glh::matrix4f inv_proj = projection.inverse(); - shader.uniformMatrix4fv("inv_proj", 1, FALSE, inv_proj.m); - shader.uniform4f("viewport", (F32) gGLViewport[0], + shader.uniformMatrix4fv(LLShaderMgr::INVERSE_PROJECTION_MATRIX, 1, FALSE, inv_proj.m); + shader.uniform4f(LLShaderMgr::VIEWPORT, (F32) gGLViewport[0], (F32) gGLViewport[1], (F32) gGLViewport[2], (F32) gGLViewport[3]); } - channel = shader.enableTexture(LLViewerShaderMgr::DEFERRED_NOISE); + channel = shader.enableTexture(LLShaderMgr::DEFERRED_NOISE); if (channel > -1) { gGL.getTexUnit(channel)->bindManual(LLTexUnit::TT_TEXTURE, noise_map); gGL.getTexUnit(channel)->setTextureFilteringOption(LLTexUnit::TFO_POINT); } - channel = shader.enableTexture(LLViewerShaderMgr::DEFERRED_LIGHTFUNC); + channel = shader.enableTexture(LLShaderMgr::DEFERRED_LIGHTFUNC); if (channel > -1) { gGL.getTexUnit(channel)->bindManual(LLTexUnit::TT_TEXTURE, mLightFunc); @@ -6813,60 +7048,31 @@ void LLPipeline::bindDeferredShader(LLGLSLShader& shader, U32 light_index, LLRen stop_glerror(); - channel = shader.enableTexture(LLViewerShaderMgr::DEFERRED_LIGHT, mDeferredLight[light_index].getUsage()); + channel = shader.enableTexture(LLShaderMgr::DEFERRED_LIGHT, mDeferredLight.getUsage()); if (channel > -1) { - mDeferredLight[light_index].bindTexture(0, channel); + if (light_index > 0) + { + mScreen.bindTexture(0, channel); + } + else + { + mDeferredLight.bindTexture(0, channel); + } gGL.getTexUnit(channel)->setTextureFilteringOption(LLTexUnit::TFO_POINT); } - channel = shader.enableTexture(LLViewerShaderMgr::DEFERRED_LUMINANCE); - if (channel > -1) - { - gGL.getTexUnit(channel)->bindManual(LLTexUnit::TT_TEXTURE, mLuminanceMap.getTexture(), true); - gGL.getTexUnit(channel)->setTextureFilteringOption(LLTexUnit::TFO_TRILINEAR); - } - - channel = shader.enableTexture(LLViewerShaderMgr::DEFERRED_BLOOM); + channel = shader.enableTexture(LLShaderMgr::DEFERRED_BLOOM); if (channel > -1) { mGlow[1].bindTexture(0, channel); } - channel = shader.enableTexture(LLViewerShaderMgr::DEFERRED_GI_LIGHT, LLTexUnit::TT_RECT_TEXTURE); - if (channel > -1) - { - gi_source->bindTexture(0, channel); - gGL.getTexUnit(channel)->setTextureFilteringOption(LLTexUnit::TFO_POINT); - } - - channel = shader.enableTexture(LLViewerShaderMgr::DEFERRED_EDGE, LLTexUnit::TT_RECT_TEXTURE); - if (channel > -1) - { - mEdgeMap.bindTexture(0, channel); - gGL.getTexUnit(channel)->setTextureFilteringOption(LLTexUnit::TFO_POINT); - } - - channel = shader.enableTexture(LLViewerShaderMgr::DEFERRED_SUN_LIGHT, LLTexUnit::TT_RECT_TEXTURE); - if (channel > -1) - { - mDeferredLight[1].bindTexture(0, channel); - gGL.getTexUnit(channel)->setTextureFilteringOption(LLTexUnit::TFO_POINT); - } - - channel = shader.enableTexture(LLViewerShaderMgr::DEFERRED_LOCAL_LIGHT, LLTexUnit::TT_RECT_TEXTURE); - if (channel > -1) - { - mDeferredLight[2].bindTexture(0, channel); - gGL.getTexUnit(channel)->setTextureFilteringOption(LLTexUnit::TFO_POINT); - } - - stop_glerror(); for (U32 i = 0; i < 4; i++) { - channel = shader.enableTexture(LLViewerShaderMgr::DEFERRED_SHADOW0+i, LLTexUnit::TT_RECT_TEXTURE); + channel = shader.enableTexture(LLShaderMgr::DEFERRED_SHADOW0+i, LLTexUnit::TT_RECT_TEXTURE); stop_glerror(); if (channel > -1) { @@ -6884,7 +7090,7 @@ void LLPipeline::bindDeferredShader(LLGLSLShader& shader, U32 light_index, LLRen for (U32 i = 4; i < 6; i++) { - channel = shader.enableTexture(LLViewerShaderMgr::DEFERRED_SHADOW0+i); + channel = shader.enableTexture(LLShaderMgr::DEFERRED_SHADOW0+i); stop_glerror(); if (channel > -1) { @@ -6913,12 +7119,11 @@ void LLPipeline::bindDeferredShader(LLGLSLShader& shader, U32 light_index, LLRen mat[i+80] = mSunShadowMatrix[5].m[i]; } - shader.uniformMatrix4fv("shadow_matrix[0]", 6, FALSE, mat); - shader.uniformMatrix4fv("shadow_matrix", 6, FALSE, mat); + shader.uniformMatrix4fv(LLShaderMgr::DEFERRED_SHADOW_MATRIX, 6, FALSE, mat); stop_glerror(); - channel = shader.enableTexture(LLViewerShaderMgr::ENVIRONMENT_MAP, LLTexUnit::TT_CUBE_MAP); + channel = shader.enableTexture(LLShaderMgr::ENVIRONMENT_MAP, LLTexUnit::TT_CUBE_MAP); if (channel > -1) { LLCubeMap* cube_map = gSky.mVOSkyp ? gSky.mVOSkyp->getCubeMap() : NULL; @@ -6926,31 +7131,29 @@ void LLPipeline::bindDeferredShader(LLGLSLShader& shader, U32 light_index, LLRen { cube_map->enable(channel); cube_map->bind(); - F64* m = gGLModelView; - - + F32* m = gGLModelView; + F32 mat[] = { m[0], m[1], m[2], m[4], m[5], m[6], m[8], m[9], m[10] }; - shader.uniform3fv("env_mat[0]", 3, mat); - shader.uniform3fv("env_mat", 3, mat); + shader.uniformMatrix3fv(LLShaderMgr::DEFERRED_ENV_MAT, 1, TRUE, mat); } } - shader.uniform4fv("shadow_clip", 1, mSunClipPlanes.mV); - shader.uniform1f("sun_wash", gSavedSettings.getF32("RenderDeferredSunWash")); - shader.uniform1f("shadow_noise", gSavedSettings.getF32("RenderShadowNoise")); - shader.uniform1f("blur_size", gSavedSettings.getF32("RenderShadowBlurSize")); + shader.uniform4fv(LLShaderMgr::DEFERRED_SHADOW_CLIP, 1, mSunClipPlanes.mV); + shader.uniform1f(LLShaderMgr::DEFERRED_SUN_WASH, RenderDeferredSunWash); + shader.uniform1f(LLShaderMgr::DEFERRED_SHADOW_NOISE, RenderShadowNoise); + shader.uniform1f(LLShaderMgr::DEFERRED_BLUR_SIZE, RenderShadowBlurSize); - shader.uniform1f("ssao_radius", gSavedSettings.getF32("RenderSSAOScale")); - shader.uniform1f("ssao_max_radius", gSavedSettings.getU32("RenderSSAOMaxScale")); + shader.uniform1f(LLShaderMgr::DEFERRED_SSAO_RADIUS, RenderSSAOScale); + shader.uniform1f(LLShaderMgr::DEFERRED_SSAO_MAX_RADIUS, RenderSSAOMaxScale); - F32 ssao_factor = gSavedSettings.getF32("RenderSSAOFactor"); - shader.uniform1f("ssao_factor", ssao_factor); - shader.uniform1f("ssao_factor_inv", 1.0/ssao_factor); + F32 ssao_factor = RenderSSAOFactor; + shader.uniform1f(LLShaderMgr::DEFERRED_SSAO_FACTOR, ssao_factor); + shader.uniform1f(LLShaderMgr::DEFERRED_SSAO_FACTOR_INV, 1.0/ssao_factor); - LLVector3 ssao_effect = gSavedSettings.getVector3("RenderSSAOEffect"); + LLVector3 ssao_effect = RenderSSAOEffect; F32 matrix_diag = (ssao_effect[0] + 2.0*ssao_effect[1])/3.0; F32 matrix_nondiag = (ssao_effect[0] - ssao_effect[1])/3.0; // This matrix scales (proj of color onto <1/rt(3),1/rt(3),1/rt(3)>) by @@ -6958,35 +7161,23 @@ void LLPipeline::bindDeferredShader(LLGLSLShader& shader, U32 light_index, LLRen F32 ssao_effect_mat[] = { matrix_diag, matrix_nondiag, matrix_nondiag, matrix_nondiag, matrix_diag, matrix_nondiag, matrix_nondiag, matrix_nondiag, matrix_diag}; - shader.uniformMatrix3fv("ssao_effect_mat", 1, GL_FALSE, ssao_effect_mat); - - F32 shadow_offset_error = 1.f + gSavedSettings.getF32("RenderShadowOffsetError") * fabsf(LLViewerCamera::getInstance()->getOrigin().mV[2]); - F32 shadow_bias_error = 1.f + gSavedSettings.getF32("RenderShadowBiasError") * fabsf(LLViewerCamera::getInstance()->getOrigin().mV[2]); - - shader.uniform2f("screen_res", mDeferredScreen.getWidth(), mDeferredScreen.getHeight()); - shader.uniform1f("near_clip", LLViewerCamera::getInstance()->getNear()*2.f); - shader.uniform1f ("shadow_offset", gSavedSettings.getF32("RenderShadowOffset")*shadow_offset_error); - shader.uniform1f("shadow_bias", gSavedSettings.getF32("RenderShadowBias")*shadow_bias_error); - shader.uniform1f ("spot_shadow_offset", gSavedSettings.getF32("RenderSpotShadowOffset")); - shader.uniform1f("spot_shadow_bias", gSavedSettings.getF32("RenderSpotShadowBias")); - - shader.uniform1f("lum_scale", gSavedSettings.getF32("RenderLuminanceScale")); - shader.uniform1f("sun_lum_scale", gSavedSettings.getF32("RenderSunLuminanceScale")); - shader.uniform1f("sun_lum_offset", gSavedSettings.getF32("RenderSunLuminanceOffset")); - shader.uniform1f("lum_lod", gSavedSettings.getF32("RenderLuminanceDetail")); - shader.uniform1f("gi_range", gSavedSettings.getF32("RenderGIRange")); - shader.uniform1f("gi_brightness", gSavedSettings.getF32("RenderGIBrightness")); - shader.uniform1f("gi_luminance", gSavedSettings.getF32("RenderGILuminance")); - shader.uniform1f("gi_edge_weight", gSavedSettings.getF32("RenderGIBlurEdgeWeight")); - shader.uniform1f("gi_blur_brightness", gSavedSettings.getF32("RenderGIBlurBrightness")); - shader.uniform1f("gi_sample_width", mGILightRadius); - shader.uniform1f("gi_noise", gSavedSettings.getF32("RenderGINoise")); - shader.uniform1f("gi_attenuation", gSavedSettings.getF32("RenderGIAttenuation")); - shader.uniform1f("gi_ambiance", gSavedSettings.getF32("RenderGIAmbiance")); - shader.uniform2f("shadow_res", mShadow[0].getWidth(), mShadow[0].getHeight()); - shader.uniform2f("proj_shadow_res", mShadow[4].getWidth(), mShadow[4].getHeight()); - shader.uniform1f("depth_cutoff", gSavedSettings.getF32("RenderEdgeDepthCutoff")); - shader.uniform1f("norm_cutoff", gSavedSettings.getF32("RenderEdgeNormCutoff")); + shader.uniformMatrix3fv(LLShaderMgr::DEFERRED_SSAO_EFFECT_MAT, 1, GL_FALSE, ssao_effect_mat); + + F32 shadow_offset_error = 1.f + RenderShadowOffsetError * fabsf(LLViewerCamera::getInstance()->getOrigin().mV[2]); + F32 shadow_bias_error = 1.f + RenderShadowBiasError * fabsf(LLViewerCamera::getInstance()->getOrigin().mV[2]); + + shader.uniform2f(LLShaderMgr::DEFERRED_SCREEN_RES, mDeferredScreen.getWidth(), mDeferredScreen.getHeight()); + shader.uniform1f(LLShaderMgr::DEFERRED_NEAR_CLIP, LLViewerCamera::getInstance()->getNear()*2.f); + shader.uniform1f (LLShaderMgr::DEFERRED_SHADOW_OFFSET, RenderShadowOffset*shadow_offset_error); + shader.uniform1f(LLShaderMgr::DEFERRED_SHADOW_BIAS, RenderShadowBias*shadow_bias_error); + shader.uniform1f(LLShaderMgr::DEFERRED_SPOT_SHADOW_OFFSET, RenderSpotShadowOffset); + shader.uniform1f(LLShaderMgr::DEFERRED_SPOT_SHADOW_BIAS, RenderSpotShadowBias); + + shader.uniform3fv(LLShaderMgr::DEFERRED_SUN_DIR, 1, mTransformedSunDir.mV); + shader.uniform2f(LLShaderMgr::DEFERRED_SHADOW_RES, mShadow[0].getWidth(), mShadow[0].getHeight()); + shader.uniform2f(LLShaderMgr::DEFERRED_PROJ_SHADOW_RES, mShadow[4].getWidth(), mShadow[4].getHeight()); + shader.uniform1f(LLShaderMgr::DEFERRED_DEPTH_CUTOFF, RenderEdgeDepthCutoff); + shader.uniform1f(LLShaderMgr::DEFERRED_NORM_CUTOFF, RenderEdgeNormCutoff); if (shader.getUniformLocation("norm_mat") >= 0) @@ -7025,7 +7216,7 @@ void LLPipeline::renderDeferredLighting() 0, 0, mDeferredDepth.getWidth(), mDeferredDepth.getHeight(), GL_DEPTH_BUFFER_BIT, GL_NEAREST); } - LLGLEnable multisample(gSavedSettings.getU32("RenderFSAASamples") > 0 ? GL_MULTISAMPLE_ARB : 0); + LLGLEnable multisample(RenderFSAASamples > 0 ? GL_MULTISAMPLE_ARB : 0); if (gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_HUD)) { @@ -7047,38 +7238,40 @@ void LLPipeline::renderDeferredLighting() glh::matrix4f mat = glh_copy_matrix(gGLModelView); - F32 vert[] = - { - -1,1, - -1,-3, - 3,1, - }; - glVertexPointer(2, GL_FLOAT, 0, vert); - glColor3f(1,1,1); + LLStrider<LLVector3> vert; + mDeferredVB->getVertexStrider(vert); + LLStrider<LLVector2> tc0; + LLStrider<LLVector2> tc1; + mDeferredVB->getTexCoord0Strider(tc0); + mDeferredVB->getTexCoord1Strider(tc1); + vert[0].set(-1,1,0); + vert[1].set(-1,-3,0); + vert[2].set(3,1,0); + { setupHWLights(NULL); //to set mSunDir; LLVector4 dir(mSunDir, 0.f); glh::vec4f tc(dir.mV); mat.mult_matrix_vec(tc); - glTexCoord4f(tc.v[0], tc.v[1], tc.v[2], 0); + mTransformedSunDir.set(tc.v); } - glPushMatrix(); - glLoadIdentity(); - glMatrixMode(GL_PROJECTION); - glPushMatrix(); - glLoadIdentity(); + gGL.pushMatrix(); + gGL.loadIdentity(); + gGL.matrixMode(LLRender::MM_PROJECTION); + gGL.pushMatrix(); + gGL.loadIdentity(); - if (gSavedSettings.getBOOL("RenderDeferredSSAO") || gSavedSettings.getS32("RenderShadowDetail") > 0) + if (RenderDeferredSSAO || RenderShadowDetail > 0) { - mDeferredLight[0].bindTarget(); + mDeferredLight.bindTarget(); { //paint shadow/SSAO light map (direct lighting lightmap) LLFastTimer ftm(FTM_SUN_SHADOW); bindDeferredShader(gDeferredSunProgram, 0); - + mDeferredVB->setBuffer(LLVertexBuffer::MAP_VERTEX); glClearColor(1,1,1,1); - mDeferredLight[0].clear(GL_COLOR_BUFFER_BIT); + mDeferredLight.clear(GL_COLOR_BUFFER_BIT); glClearColor(0,0,0,0); glh::matrix4f inv_trans = glh_get_current_modelview().inverse().transpose(); @@ -7101,141 +7294,36 @@ void LLPipeline::renderDeferredLighting() } gDeferredSunProgram.uniform3fv("offset", slice, offset); - gDeferredSunProgram.uniform2f("screenRes", mDeferredLight[0].getWidth(), mDeferredLight[0].getHeight()); + gDeferredSunProgram.uniform2f("screenRes", mDeferredLight.getWidth(), mDeferredLight.getHeight()); { LLGLDisable blend(GL_BLEND); LLGLDepthTest depth(GL_TRUE, GL_FALSE, GL_ALWAYS); stop_glerror(); - glDrawArrays(GL_TRIANGLE_STRIP, 0, 3); + mDeferredVB->drawArrays(LLRender::TRIANGLES, 0, 3); stop_glerror(); } unbindDeferredShader(gDeferredSunProgram); } - mDeferredLight[0].flush(); + mDeferredLight.flush(); } - { //global illumination specific block (still experimental) - if (gSavedSettings.getBOOL("RenderDeferredBlurLight") && - gSavedSettings.getBOOL("RenderDeferredGI")) - { - LLFastTimer ftm(FTM_EDGE_DETECTION); - //generate edge map - LLGLDisable blend(GL_BLEND); - LLGLDisable test(GL_ALPHA_TEST); - LLGLDepthTest depth(GL_FALSE); - LLGLDisable stencil(GL_STENCIL_TEST); - - { - gDeferredEdgeProgram.bind(); - mEdgeMap.bindTarget(); - bindDeferredShader(gDeferredEdgeProgram); - glDrawArrays(GL_TRIANGLE_STRIP, 0, 3); - unbindDeferredShader(gDeferredEdgeProgram); - mEdgeMap.flush(); - } - } - - if (LLViewerShaderMgr::instance()->getVertexShaderLevel(LLViewerShaderMgr::SHADER_DEFERRED) > 2) - { - { //get luminance map from previous frame's light map - LLGLEnable blend(GL_BLEND); - LLGLDisable test(GL_ALPHA_TEST); - LLGLDepthTest depth(GL_FALSE); - LLGLDisable stencil(GL_STENCIL_TEST); - - //static F32 fade = 1.f; - - { - gGL.setSceneBlendType(LLRender::BT_ALPHA); - gLuminanceGatherProgram.bind(); - gLuminanceGatherProgram.uniform2f("screen_res", mDeferredLight[0].getWidth(), mDeferredLight[0].getHeight()); - mLuminanceMap.bindTarget(); - bindDeferredShader(gLuminanceGatherProgram); - glDrawArrays(GL_TRIANGLE_STRIP, 0, 3); - unbindDeferredShader(gLuminanceGatherProgram); - mLuminanceMap.flush(); - gGL.getTexUnit(0)->bindManual(LLTexUnit::TT_TEXTURE, mLuminanceMap.getTexture(), true); - gGL.getTexUnit(0)->setTextureFilteringOption(LLTexUnit::TFO_TRILINEAR); - glGenerateMipmap(GL_TEXTURE_2D); - } - } - - { //paint noisy GI map (bounce lighting lightmap) - LLFastTimer ftm(FTM_GI_TRACE); - LLGLDisable blend(GL_BLEND); - LLGLDepthTest depth(GL_FALSE); - LLGLDisable test(GL_ALPHA_TEST); - - mGIMapPost[0].bindTarget(); - - bindDeferredShader(gDeferredGIProgram, 0, &mGIMap, 0, mTrueNoiseMap); - glDrawArrays(GL_TRIANGLE_STRIP, 0, 3); - unbindDeferredShader(gDeferredGIProgram); - mGIMapPost[0].flush(); - } - - U32 pass_count = 0; - if (gSavedSettings.getBOOL("RenderDeferredBlurLight")) - { - pass_count = llclamp(gSavedSettings.getU32("RenderGIBlurPasses"), (U32) 1, (U32) 128); - } - - for (U32 i = 0; i < pass_count; ++i) - { //gather/soften indirect lighting map - LLFastTimer ftm(FTM_GI_GATHER); - bindDeferredShader(gDeferredPostGIProgram, 0, &mGIMapPost[0], NULL, mTrueNoiseMap); - F32 blur_size = gSavedSettings.getF32("RenderGIBlurSize")/((F32) i * gSavedSettings.getF32("RenderGIBlurIncrement")+1.f); - gDeferredPostGIProgram.uniform2f("delta", 1.f, 0.f); - gDeferredPostGIProgram.uniform1f("kern_scale", blur_size); - gDeferredPostGIProgram.uniform1f("gi_blur_brightness", gSavedSettings.getF32("RenderGIBlurBrightness")); - - mGIMapPost[1].bindTarget(); - { - LLGLDisable blend(GL_BLEND); - LLGLDepthTest depth(GL_FALSE); - stop_glerror(); - glDrawArrays(GL_TRIANGLE_STRIP, 0, 3); - stop_glerror(); - } - - mGIMapPost[1].flush(); - unbindDeferredShader(gDeferredPostGIProgram); - bindDeferredShader(gDeferredPostGIProgram, 0, &mGIMapPost[1], NULL, mTrueNoiseMap); - mGIMapPost[0].bindTarget(); - - gDeferredPostGIProgram.uniform2f("delta", 0.f, 1.f); - - { - LLGLDisable blend(GL_BLEND); - LLGLDepthTest depth(GL_FALSE); - stop_glerror(); - glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); - stop_glerror(); - } - mGIMapPost[0].flush(); - unbindDeferredShader(gDeferredPostGIProgram); - } - } - } - - if (gSavedSettings.getBOOL("RenderDeferredSSAO")) + if (RenderDeferredSSAO) { //soften direct lighting lightmap LLFastTimer ftm(FTM_SOFTEN_SHADOW); //blur lightmap - mDeferredLight[1].bindTarget(); - + mScreen.bindTarget(); glClearColor(1,1,1,1); - mDeferredLight[1].clear(GL_COLOR_BUFFER_BIT); + mScreen.clear(GL_COLOR_BUFFER_BIT); glClearColor(0,0,0,0); bindDeferredShader(gDeferredBlurLightProgram); - - LLVector3 go = gSavedSettings.getVector3("RenderShadowGaussian"); + mDeferredVB->setBuffer(LLVertexBuffer::MAP_VERTEX); + LLVector3 go = RenderShadowGaussian; const U32 kern_length = 4; - F32 blur_size = gSavedSettings.getF32("RenderShadowBlurSize"); - F32 dist_factor = gSavedSettings.getF32("RenderShadowBlurDistFactor"); + F32 blur_size = RenderShadowBlurSize; + F32 dist_factor = RenderShadowBlurDistFactor; // sample symmetrically with the middle sample falling exactly on 0.0 F32 x = 0.f; @@ -7259,15 +7347,16 @@ void LLPipeline::renderDeferredLighting() LLGLDisable blend(GL_BLEND); LLGLDepthTest depth(GL_TRUE, GL_FALSE, GL_ALWAYS); stop_glerror(); - glDrawArrays(GL_TRIANGLE_STRIP, 0, 3); + mDeferredVB->drawArrays(LLRender::TRIANGLES, 0, 3); stop_glerror(); } - mDeferredLight[1].flush(); + mScreen.flush(); unbindDeferredShader(gDeferredBlurLightProgram); bindDeferredShader(gDeferredBlurLightProgram, 1); - mDeferredLight[0].bindTarget(); + mDeferredVB->setBuffer(LLVertexBuffer::MAP_VERTEX); + mDeferredLight.bindTarget(); gDeferredBlurLightProgram.uniform2f("delta", 0.f, 1.f); @@ -7275,69 +7364,59 @@ void LLPipeline::renderDeferredLighting() LLGLDisable blend(GL_BLEND); LLGLDepthTest depth(GL_TRUE, GL_FALSE, GL_ALWAYS); stop_glerror(); - glDrawArrays(GL_TRIANGLE_STRIP, 0, 3); + mDeferredVB->drawArrays(LLRender::TRIANGLES, 0, 3); stop_glerror(); } - mDeferredLight[0].flush(); + mDeferredLight.flush(); unbindDeferredShader(gDeferredBlurLightProgram); } stop_glerror(); - glPopMatrix(); + gGL.popMatrix(); stop_glerror(); - glMatrixMode(GL_MODELVIEW); + gGL.matrixMode(LLRender::MM_MODELVIEW); stop_glerror(); - glPopMatrix(); + gGL.popMatrix(); stop_glerror(); //copy depth and stencil from deferred screen //mScreen.copyContents(mDeferredScreen, 0, 0, mDeferredScreen.getWidth(), mDeferredScreen.getHeight(), // 0, 0, mScreen.getWidth(), mScreen.getHeight(), GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT, GL_NEAREST); - if (LLViewerShaderMgr::instance()->getVertexShaderLevel(LLViewerShaderMgr::SHADER_DEFERRED) > 2) - { - mDeferredLight[1].bindTarget(); - // clear color buffer here (GI) - zeroing alpha (glow) is important or it will accumulate against sky - glClearColor(0,0,0,0); - mScreen.clear(GL_COLOR_BUFFER_BIT); - } - else - { - mScreen.bindTarget(); - // clear color buffer here - zeroing alpha (glow) is important or it will accumulate against sky - glClearColor(0,0,0,0); - mScreen.clear(GL_COLOR_BUFFER_BIT); - } - - if (gSavedSettings.getBOOL("RenderDeferredAtmospheric")) + mScreen.bindTarget(); + // clear color buffer here - zeroing alpha (glow) is important or it will accumulate against sky + glClearColor(0,0,0,0); + mScreen.clear(GL_COLOR_BUFFER_BIT); + + if (RenderDeferredAtmospheric) { //apply sunlight contribution LLFastTimer ftm(FTM_ATMOSPHERICS); - bindDeferredShader(gDeferredSoftenProgram, 0, &mGIMapPost[0]); + bindDeferredShader(gDeferredSoftenProgram); { LLGLDepthTest depth(GL_FALSE); LLGLDisable blend(GL_BLEND); LLGLDisable test(GL_ALPHA_TEST); //full screen blit - glPushMatrix(); - glLoadIdentity(); - glMatrixMode(GL_PROJECTION); - glPushMatrix(); - glLoadIdentity(); + gGL.pushMatrix(); + gGL.loadIdentity(); + gGL.matrixMode(LLRender::MM_PROJECTION); + gGL.pushMatrix(); + gGL.loadIdentity(); - glVertexPointer(2, GL_FLOAT, 0, vert); - - glDrawArrays(GL_TRIANGLE_STRIP, 0, 3); + mDeferredVB->setBuffer(LLVertexBuffer::MAP_VERTEX); - glPopMatrix(); - glMatrixMode(GL_MODELVIEW); - glPopMatrix(); + mDeferredVB->drawArrays(LLRender::TRIANGLES, 0, 3); + + gGL.popMatrix(); + gGL.matrixMode(LLRender::MM_MODELVIEW); + gGL.popMatrix(); } unbindDeferredShader(gDeferredSoftenProgram); } - { //render sky + { //render non-deferred geometry (fullbright, alpha, etc) LLGLDisable blend(GL_BLEND); LLGLDisable stencil(GL_STENCIL_TEST); gGL.setSceneBlendType(LLRender::BT_ALPHA); @@ -7354,15 +7433,8 @@ void LLPipeline::renderDeferredLighting() gPipeline.popRenderTypeMask(); } - BOOL render_local = gSavedSettings.getBOOL("RenderLocalLights"); + BOOL render_local = RenderLocalLights; - if (LLViewerShaderMgr::instance()->getVertexShaderLevel(LLViewerShaderMgr::SHADER_DEFERRED) > 2) - { - mDeferredLight[1].flush(); - mDeferredLight[2].bindTarget(); - mDeferredLight[2].clear(GL_COLOR_BUFFER_BIT); - } - if (render_local) { gGL.setSceneBlendType(LLRender::BT_ADD); @@ -7378,12 +7450,12 @@ void LLPipeline::renderDeferredLighting() std::list<LLVector4> light_colors; LLVertexBuffer::unbind(); + LLVector4a* v = (LLVector4a*) vert.get(); - F32 v[24]; - glVertexPointer(3, GL_FLOAT, 0, v); - { bindDeferredShader(gDeferredLightProgram); + mDeferredVB->setBuffer(LLVertexBuffer::MAP_VERTEX); + LLGLDepthTest depth(GL_TRUE, GL_FALSE); for (LLDrawable::drawable_set_t::iterator iter = mLights.begin(); iter != mLights.end(); ++iter) { @@ -7438,15 +7510,16 @@ void LLPipeline::renderDeferredLighting() //correspond to their axis facing, with bit position 3,2,1 matching //axis facing x,y,z, bit set meaning positive facing, bit clear //meaning negative facing - v[0] = c[0]-s; v[1] = c[1]-s; v[2] = c[2]-s; // 0 - 0000 - v[3] = c[0]-s; v[4] = c[1]-s; v[5] = c[2]+s; // 1 - 0001 - v[6] = c[0]-s; v[7] = c[1]+s; v[8] = c[2]-s; // 2 - 0010 - v[9] = c[0]-s; v[10] = c[1]+s; v[11] = c[2]+s; // 3 - 0011 + mDeferredVB->getVertexStrider(vert); + v[0].set(c[0]-s,c[1]-s,c[2]-s); // 0 - 0000 + v[1].set(c[0]-s,c[1]-s,c[2]+s); // 1 - 0001 + v[2].set(c[0]-s,c[1]+s,c[2]-s); // 2 - 0010 + v[3].set(c[0]-s,c[1]+s,c[2]+s); // 3 - 0011 - v[12] = c[0]+s; v[13] = c[1]-s; v[14] = c[2]-s; // 4 - 0100 - v[15] = c[0]+s; v[16] = c[1]-s; v[17] = c[2]+s; // 5 - 0101 - v[18] = c[0]+s; v[19] = c[1]+s; v[20] = c[2]-s; // 6 - 0110 - v[21] = c[0]+s; v[22] = c[1]+s; v[23] = c[2]+s; // 7 - 0111 + v[4].set(c[0]+s,c[1]-s,c[2]-s); // 4 - 0100 + v[5].set(c[0]+s,c[1]-s,c[2]+s); // 5 - 0101 + v[6].set(c[0]+s,c[1]+s,c[2]-s); // 6 - 0110 + v[7].set(c[0]+s,c[1]+s,c[2]+s); // 7 - 0111 if (camera->getOrigin().mV[0] > c[0] + s + 0.2f || camera->getOrigin().mV[0] < c[0] - s - 0.2f || @@ -7465,10 +7538,16 @@ void LLPipeline::renderDeferredLighting() } LLFastTimer ftm(FTM_LOCAL_LIGHTS); - glTexCoord4f(tc.v[0], tc.v[1], tc.v[2], s*s); - glColor4f(col.mV[0], col.mV[1], col.mV[2], volume->getLightFalloff()*0.5f); + //glTexCoord4f(tc.v[0], tc.v[1], tc.v[2], s*s); + gDeferredLightProgram.uniform3fv(LLShaderMgr::LIGHT_CENTER, 1, tc.v); + gDeferredLightProgram.uniform1f(LLShaderMgr::LIGHT_SIZE, s*s); + gDeferredLightProgram.uniform3fv(LLShaderMgr::DIFFUSE_COLOR, 1, col.mV); + gDeferredLightProgram.uniform1f(LLShaderMgr::LIGHT_FALLOFF, volume->getLightFalloff()*0.5f); + //gGL.diffuseColor4f(col.mV[0], col.mV[1], col.mV[2], volume->getLightFalloff()*0.5f); + gGL.syncMatrices(); + mDeferredVB->setBuffer(LLVertexBuffer::MAP_VERTEX); glDrawRangeElements(GL_TRIANGLE_FAN, 0, 7, 8, - GL_UNSIGNED_BYTE, get_box_fan_indices_ptr(camera, center)); + GL_UNSIGNED_SHORT, get_box_fan_indices_ptr(camera, center)); stop_glerror(); } } @@ -7493,7 +7572,9 @@ void LLPipeline::renderDeferredLighting() LLGLDepthTest depth(GL_TRUE, GL_FALSE); bindDeferredShader(gDeferredSpotLightProgram); - gDeferredSpotLightProgram.enableTexture(LLViewerShaderMgr::DEFERRED_PROJECTION); + mDeferredVB->setBuffer(LLVertexBuffer::MAP_VERTEX); + + gDeferredSpotLightProgram.enableTexture(LLShaderMgr::DEFERRED_PROJECTION); for (LLDrawable::drawable_list_t::iterator iter = spot_lights.begin(); iter != spot_lights.end(); ++iter) { @@ -7521,36 +7602,49 @@ void LLPipeline::renderDeferredLighting() //correspond to their axis facing, with bit position 3,2,1 matching //axis facing x,y,z, bit set meaning positive facing, bit clear //meaning negative facing - v[0] = c[0]-s; v[1] = c[1]-s; v[2] = c[2]-s; // 0 - 0000 - v[3] = c[0]-s; v[4] = c[1]-s; v[5] = c[2]+s; // 1 - 0001 - v[6] = c[0]-s; v[7] = c[1]+s; v[8] = c[2]-s; // 2 - 0010 - v[9] = c[0]-s; v[10] = c[1]+s; v[11] = c[2]+s; // 3 - 0011 + mDeferredVB->getVertexStrider(vert); + v[0].set(c[0]-s,c[1]-s,c[2]-s); // 0 - 0000 + v[1].set(c[0]-s,c[1]-s,c[2]+s); // 1 - 0001 + v[2].set(c[0]-s,c[1]+s,c[2]-s); // 2 - 0010 + v[3].set(c[0]-s,c[1]+s,c[2]+s); // 3 - 0011 - v[12] = c[0]+s; v[13] = c[1]-s; v[14] = c[2]-s; // 4 - 0100 - v[15] = c[0]+s; v[16] = c[1]-s; v[17] = c[2]+s; // 5 - 0101 - v[18] = c[0]+s; v[19] = c[1]+s; v[20] = c[2]-s; // 6 - 0110 - v[21] = c[0]+s; v[22] = c[1]+s; v[23] = c[2]+s; // 7 - 0111 - - glTexCoord4f(tc.v[0], tc.v[1], tc.v[2], s*s); - glColor4f(col.mV[0], col.mV[1], col.mV[2], volume->getLightFalloff()*0.5f); + v[4].set(c[0]+s,c[1]-s,c[2]-s); // 4 - 0100 + v[5].set(c[0]+s,c[1]-s,c[2]+s); // 5 - 0101 + v[6].set(c[0]+s,c[1]+s,c[2]-s); // 6 - 0110 + v[7].set(c[0]+s,c[1]+s,c[2]+s); // 7 - 0111 + + gDeferredSpotLightProgram.uniform3fv(LLShaderMgr::LIGHT_CENTER, 1, tc.v); + gDeferredSpotLightProgram.uniform1f(LLShaderMgr::LIGHT_SIZE, s*s); + gDeferredSpotLightProgram.uniform3fv(LLShaderMgr::DIFFUSE_COLOR, 1, col.mV); + gDeferredSpotLightProgram.uniform1f(LLShaderMgr::LIGHT_FALLOFF, volume->getLightFalloff()*0.5f); + gGL.syncMatrices(); + mDeferredVB->setBuffer(LLVertexBuffer::MAP_VERTEX); glDrawRangeElements(GL_TRIANGLE_FAN, 0, 7, 8, - GL_UNSIGNED_BYTE, get_box_fan_indices_ptr(camera, center)); + GL_UNSIGNED_SHORT, get_box_fan_indices_ptr(camera, center)); } - gDeferredSpotLightProgram.disableTexture(LLViewerShaderMgr::DEFERRED_PROJECTION); + gDeferredSpotLightProgram.disableTexture(LLShaderMgr::DEFERRED_PROJECTION); unbindDeferredShader(gDeferredSpotLightProgram); } + //reset mDeferredVB to fullscreen triangle + mDeferredVB->getVertexStrider(vert); + vert[0].set(-1,1,0); + vert[1].set(-1,-3,0); + vert[2].set(3,1,0); + { bindDeferredShader(gDeferredMultiLightProgram); + mDeferredVB->setBuffer(LLVertexBuffer::MAP_VERTEX); + LLGLDepthTest depth(GL_FALSE); //full screen blit - glPushMatrix(); - glLoadIdentity(); - glMatrixMode(GL_PROJECTION); - glPushMatrix(); - glLoadIdentity(); + gGL.pushMatrix(); + gGL.loadIdentity(); + gGL.matrixMode(LLRender::MM_PROJECTION); + gGL.pushMatrix(); + gGL.loadIdentity(); U32 count = 0; @@ -7558,7 +7652,7 @@ void LLPipeline::renderDeferredLighting() LLVector4 light[max_count]; LLVector4 col[max_count]; - glVertexPointer(2, GL_FLOAT, 0, vert); +// glVertexPointer(2, GL_FLOAT, 0, vert); F32 far_z = 0.f; @@ -7575,13 +7669,13 @@ void LLPipeline::renderDeferredLighting() count++; if (count == max_count || fullscreen_lights.empty()) { - gDeferredMultiLightProgram.uniform1i("light_count", count); - gDeferredMultiLightProgram.uniform4fv("light", count, (GLfloat*) light); - gDeferredMultiLightProgram.uniform4fv("light_col", count, (GLfloat*) col); - gDeferredMultiLightProgram.uniform1f("far_z", far_z); + gDeferredMultiLightProgram.uniform1i(LLShaderMgr::MULTI_LIGHT_COUNT, count); + gDeferredMultiLightProgram.uniform4fv(LLShaderMgr::MULTI_LIGHT, count, (GLfloat*) light); + gDeferredMultiLightProgram.uniform4fv(LLShaderMgr::MULTI_LIGHT_COL, count, (GLfloat*) col); + gDeferredMultiLightProgram.uniform1f(LLShaderMgr::MULTI_LIGHT_FAR_Z, far_z); far_z = 0.f; - count = 0; - glDrawArrays(GL_TRIANGLE_STRIP, 0, 3); + count = 0; + mDeferredVB->drawArrays(LLRender::TRIANGLES, 0, 3); } } @@ -7589,7 +7683,9 @@ void LLPipeline::renderDeferredLighting() bindDeferredShader(gDeferredMultiSpotLightProgram); - gDeferredMultiSpotLightProgram.enableTexture(LLViewerShaderMgr::DEFERRED_PROJECTION); + gDeferredMultiSpotLightProgram.enableTexture(LLShaderMgr::DEFERRED_PROJECTION); + + mDeferredVB->setBuffer(LLVertexBuffer::MAP_VERTEX); for (LLDrawable::drawable_list_t::iterator iter = fullscreen_spot_lights.begin(); iter != fullscreen_spot_lights.end(); ++iter) { @@ -7612,62 +7708,23 @@ void LLPipeline::renderDeferredLighting() LLColor3 col = volume->getLightColor(); col *= volume->getLightIntensity(); - glTexCoord4f(tc.v[0], tc.v[1], tc.v[2], s*s); - glColor4f(col.mV[0], col.mV[1], col.mV[2], volume->getLightFalloff()*0.5f); - glDrawArrays(GL_TRIANGLE_STRIP, 0, 3); + gDeferredMultiSpotLightProgram.uniform3fv(LLShaderMgr::LIGHT_CENTER, 1, tc.v); + gDeferredMultiSpotLightProgram.uniform1f(LLShaderMgr::LIGHT_SIZE, s*s); + gDeferredMultiSpotLightProgram.uniform3fv(LLShaderMgr::DIFFUSE_COLOR, 1, col.mV); + gDeferredMultiSpotLightProgram.uniform1f(LLShaderMgr::LIGHT_FALLOFF, volume->getLightFalloff()*0.5f); + mDeferredVB->drawArrays(LLRender::TRIANGLES, 0, 3); } - gDeferredMultiSpotLightProgram.disableTexture(LLViewerShaderMgr::DEFERRED_PROJECTION); + gDeferredMultiSpotLightProgram.disableTexture(LLShaderMgr::DEFERRED_PROJECTION); unbindDeferredShader(gDeferredMultiSpotLightProgram); - glPopMatrix(); - glMatrixMode(GL_MODELVIEW); - glPopMatrix(); + gGL.popMatrix(); + gGL.matrixMode(LLRender::MM_MODELVIEW); + gGL.popMatrix(); } } gGL.setColorMask(true, true); - - if (LLViewerShaderMgr::instance()->getVertexShaderLevel(LLViewerShaderMgr::SHADER_DEFERRED) > 2) - { - mDeferredLight[2].flush(); - - mScreen.bindTarget(); - mScreen.clear(GL_COLOR_BUFFER_BIT); - - gGL.setSceneBlendType(LLRender::BT_ALPHA); - - { //mix various light maps (local, sun, gi) - LLFastTimer ftm(FTM_POST); - LLGLDisable blend(GL_BLEND); - LLGLDisable test(GL_ALPHA_TEST); - LLGLDepthTest depth(GL_FALSE); - LLGLDisable stencil(GL_STENCIL_TEST); - - bindDeferredShader(gDeferredPostProgram, 0, &mGIMapPost[0]); - - gDeferredPostProgram.bind(); - - LLVertexBuffer::unbind(); - - glVertexPointer(2, GL_FLOAT, 0, vert); - glColor3f(1,1,1); - - glPushMatrix(); - glLoadIdentity(); - glMatrixMode(GL_PROJECTION); - glPushMatrix(); - glLoadIdentity(); - - glDrawArrays(GL_TRIANGLES, 0, 3); - - glPopMatrix(); - glMatrixMode(GL_MODELVIEW); - glPopMatrix(); - - unbindDeferredShader(gDeferredPostProgram); - } - } } { //render non-deferred geometry (alpha, fullbright, glow) @@ -7783,13 +7840,13 @@ void LLPipeline::setupSpotLight(LLGLSLShader& shader, LLDrawable* drawablep) F32 proj_range = far_clip - near_clip; glh::matrix4f light_proj = gl_perspective(fovy, aspect, near_clip, far_clip); screen_to_light = trans * light_proj * screen_to_light; - shader.uniformMatrix4fv("proj_mat", 1, FALSE, screen_to_light.m); - shader.uniform1f("proj_near", near_clip); - shader.uniform3fv("proj_p", 1, p1.v); - shader.uniform3fv("proj_n", 1, n.v); - shader.uniform3fv("proj_origin", 1, screen_origin.v); - shader.uniform1f("proj_range", proj_range); - shader.uniform1f("proj_ambiance", params.mV[2]); + shader.uniformMatrix4fv(LLShaderMgr::PROJECTOR_MATRIX, 1, FALSE, screen_to_light.m); + shader.uniform1f(LLShaderMgr::PROJECTOR_NEAR, near_clip); + shader.uniform3fv(LLShaderMgr::PROJECTOR_P, 1, p1.v); + shader.uniform3fv(LLShaderMgr::PROJECTOR_N, 1, n.v); + shader.uniform3fv(LLShaderMgr::PROJECTOR_ORIGIN, 1, screen_origin.v); + shader.uniform1f(LLShaderMgr::PROJECTOR_RANGE, proj_range); + shader.uniform1f(LLShaderMgr::PROJECTOR_AMBIANCE, params.mV[2]); S32 s_idx = -1; for (U32 i = 0; i < 2; i++) @@ -7800,15 +7857,15 @@ void LLPipeline::setupSpotLight(LLGLSLShader& shader, LLDrawable* drawablep) } } - shader.uniform1i("proj_shadow_idx", s_idx); + shader.uniform1i(LLShaderMgr::PROJECTOR_SHADOW_INDEX, s_idx); if (s_idx >= 0) { - shader.uniform1f("shadow_fade", 1.f-mSpotLightFade[s_idx]); + shader.uniform1f(LLShaderMgr::PROJECTOR_SHADOW_FADE, 1.f-mSpotLightFade[s_idx]); } else { - shader.uniform1f("shadow_fade", 1.f); + shader.uniform1f(LLShaderMgr::PROJECTOR_SHADOW_FADE, 1.f); } { @@ -7842,7 +7899,7 @@ void LLPipeline::setupSpotLight(LLGLSLShader& shader, LLDrawable* drawablep) img = LLViewerFetchedTexture::sWhiteImagep; } - S32 channel = shader.enableTexture(LLViewerShaderMgr::DEFERRED_PROJECTION); + S32 channel = shader.enableTexture(LLShaderMgr::DEFERRED_PROJECTION); if (channel > -1) { @@ -7852,9 +7909,9 @@ void LLPipeline::setupSpotLight(LLGLSLShader& shader, LLDrawable* drawablep) F32 lod_range = logf(img->getWidth())/logf(2.f); - shader.uniform1f("proj_focus", focus); - shader.uniform1f("proj_lod", lod_range); - shader.uniform1f("proj_ambient_lod", llclamp((proj_range-focus)/proj_range*lod_range, 0.f, 1.f)); + shader.uniform1f(LLShaderMgr::PROJECTOR_FOCUS, focus); + shader.uniform1f(LLShaderMgr::PROJECTOR_LOD, lod_range); + shader.uniform1f(LLShaderMgr::PROJECTOR_AMBIENT_LOD, llclamp((proj_range-focus)/proj_range*lod_range, 0.f, 1.f)); } } @@ -7863,33 +7920,17 @@ void LLPipeline::setupSpotLight(LLGLSLShader& shader, LLDrawable* drawablep) void LLPipeline::unbindDeferredShader(LLGLSLShader &shader) { stop_glerror(); - shader.disableTexture(LLViewerShaderMgr::DEFERRED_NORMAL, mDeferredScreen.getUsage()); - shader.disableTexture(LLViewerShaderMgr::DEFERRED_DIFFUSE, mDeferredScreen.getUsage()); - shader.disableTexture(LLViewerShaderMgr::DEFERRED_SPECULAR, mDeferredScreen.getUsage()); - shader.disableTexture(LLViewerShaderMgr::DEFERRED_DEPTH, mDeferredScreen.getUsage()); - shader.disableTexture(LLViewerShaderMgr::DEFERRED_LIGHT, mDeferredLight[0].getUsage()); - shader.disableTexture(LLViewerShaderMgr::DEFERRED_GI_LIGHT, LLTexUnit::TT_RECT_TEXTURE); - shader.disableTexture(LLViewerShaderMgr::DEFERRED_EDGE, mEdgeMap.getUsage()); - shader.disableTexture(LLViewerShaderMgr::DEFERRED_SUN_LIGHT, mDeferredLight[1].getUsage()); - shader.disableTexture(LLViewerShaderMgr::DEFERRED_LOCAL_LIGHT, mDeferredLight[2].getUsage()); - shader.disableTexture(LLViewerShaderMgr::DEFERRED_LUMINANCE); - shader.disableTexture(LLViewerShaderMgr::DIFFUSE_MAP); - shader.disableTexture(LLViewerShaderMgr::DEFERRED_GI_MIP); - shader.disableTexture(LLViewerShaderMgr::DEFERRED_BLOOM); - shader.disableTexture(LLViewerShaderMgr::DEFERRED_GI_NORMAL); - shader.disableTexture(LLViewerShaderMgr::DEFERRED_GI_DIFFUSE); - shader.disableTexture(LLViewerShaderMgr::DEFERRED_GI_SPECULAR); - shader.disableTexture(LLViewerShaderMgr::DEFERRED_GI_DEPTH); - shader.disableTexture(LLViewerShaderMgr::DEFERRED_GI_MIN_POS); - shader.disableTexture(LLViewerShaderMgr::DEFERRED_GI_MAX_POS); - shader.disableTexture(LLViewerShaderMgr::DEFERRED_GI_LAST_NORMAL); - shader.disableTexture(LLViewerShaderMgr::DEFERRED_GI_LAST_DIFFUSE); - shader.disableTexture(LLViewerShaderMgr::DEFERRED_GI_LAST_MIN_POS); - shader.disableTexture(LLViewerShaderMgr::DEFERRED_GI_LAST_MAX_POS); + shader.disableTexture(LLShaderMgr::DEFERRED_NORMAL, mDeferredScreen.getUsage()); + shader.disableTexture(LLShaderMgr::DEFERRED_DIFFUSE, mDeferredScreen.getUsage()); + shader.disableTexture(LLShaderMgr::DEFERRED_SPECULAR, mDeferredScreen.getUsage()); + shader.disableTexture(LLShaderMgr::DEFERRED_DEPTH, mDeferredScreen.getUsage()); + shader.disableTexture(LLShaderMgr::DEFERRED_LIGHT, mDeferredLight.getUsage()); + shader.disableTexture(LLShaderMgr::DIFFUSE_MAP); + shader.disableTexture(LLShaderMgr::DEFERRED_BLOOM); for (U32 i = 0; i < 4; i++) { - if (shader.disableTexture(LLViewerShaderMgr::DEFERRED_SHADOW0+i, LLTexUnit::TT_RECT_TEXTURE) > -1) + if (shader.disableTexture(LLShaderMgr::DEFERRED_SHADOW0+i, LLTexUnit::TT_RECT_TEXTURE) > -1) { glTexParameteri(GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_COMPARE_MODE_ARB, GL_NONE); } @@ -7897,16 +7938,16 @@ void LLPipeline::unbindDeferredShader(LLGLSLShader &shader) for (U32 i = 4; i < 6; i++) { - if (shader.disableTexture(LLViewerShaderMgr::DEFERRED_SHADOW0+i) > -1) + if (shader.disableTexture(LLShaderMgr::DEFERRED_SHADOW0+i) > -1) { glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_COMPARE_MODE_ARB, GL_NONE); } } - shader.disableTexture(LLViewerShaderMgr::DEFERRED_NOISE); - shader.disableTexture(LLViewerShaderMgr::DEFERRED_LIGHTFUNC); + shader.disableTexture(LLShaderMgr::DEFERRED_NOISE); + shader.disableTexture(LLShaderMgr::DEFERRED_LIGHTFUNC); - S32 channel = shader.disableTexture(LLViewerShaderMgr::ENVIRONMENT_MAP, LLTexUnit::TT_CUBE_MAP); + S32 channel = shader.disableTexture(LLShaderMgr::ENVIRONMENT_MAP, LLTexUnit::TT_CUBE_MAP); if (channel > -1) { LLCubeMap* cube_map = gSky.mVOSkyp ? gSky.mVOSkyp->getCubeMap() : NULL; @@ -7932,11 +7973,11 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in) if (LLPipeline::sWaterReflections && assertInitialized() && LLDrawPoolWater::sNeedsReflectionUpdate) { BOOL skip_avatar_update = FALSE; - if (!isAgentAvatarValid() || gAgentCamera.getCameraAnimating() || gAgentCamera.getCameraMode() != CAMERA_MODE_MOUSELOOK) + if (!isAgentAvatarValid() || gAgentCamera.getCameraAnimating() || gAgentCamera.getCameraMode() != CAMERA_MODE_MOUSELOOK || !LLVOAvatar::sVisibleInFirstPerson) { skip_avatar_update = TRUE; } - + if (!skip_avatar_update) { gAgentAvatarp->updateAttachmentVisibility(CAMERA_MODE_THIRD_PERSON); @@ -8001,7 +8042,7 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in) stop_glerror(); - glPushMatrix(); + gGL.pushMatrix(); mat.set_scale(glh::vec3f(1,1,-1)); mat.set_translate(glh::vec3f(0,0,height*2.f)); @@ -8011,7 +8052,7 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in) mat = current * mat; glh_set_current_modelview(mat); - glLoadMatrixf(mat.m); + gGL.loadMatrix(mat.m); LLViewerCamera::updateFrustumPlanes(camera, FALSE, TRUE); @@ -8054,7 +8095,7 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in) LLPipeline::RENDER_TYPE_CLOUDS, LLPipeline::END_RENDER_TYPES); - S32 detail = gSavedSettings.getS32("RenderReflectionDetail"); + S32 detail = RenderReflectionDetail; if (detail > 0) { //mask out selected geometry based on reflection detail if (detail < 4) @@ -8078,7 +8119,7 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in) if (LLDrawPoolWater::sNeedsDistortionUpdate) { - if (gSavedSettings.getS32("RenderReflectionDetail") > 0) + if (RenderReflectionDetail > 0) { gPipeline.grabReferences(ref_result); LLGLUserClipPlane clip_plane(plane, mat, projection); @@ -8089,7 +8130,7 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in) gPipeline.popRenderTypeMask(); } glCullFace(GL_BACK); - glPopMatrix(); + gGL.popMatrix(); mWaterRef.flush(); glh_set_current_modelview(current); LLPipeline::sUseOcclusion = occlusion; @@ -8259,7 +8300,14 @@ void LLPipeline::renderShadow(glh::matrix4f& view, glh::matrix4f& proj, LLCamera } LLPipeline::sShadowRender = TRUE; - U32 types[] = { LLRenderPass::PASS_SIMPLE, LLRenderPass::PASS_FULLBRIGHT, LLRenderPass::PASS_SHINY, LLRenderPass::PASS_BUMP, LLRenderPass::PASS_FULLBRIGHT_SHINY }; + U32 types[] = { + LLRenderPass::PASS_SIMPLE, + LLRenderPass::PASS_FULLBRIGHT, + LLRenderPass::PASS_SHINY, + LLRenderPass::PASS_BUMP, + LLRenderPass::PASS_FULLBRIGHT_SHINY + }; + LLGLEnable cull(GL_CULL_FACE); if (use_shader) @@ -8271,12 +8319,12 @@ void LLPipeline::renderShadow(glh::matrix4f& view, glh::matrix4f& proj, LLCamera stateSort(shadow_cam, result); //generate shadow map - glMatrixMode(GL_PROJECTION); - glPushMatrix(); - glLoadMatrixf(proj.m); - glMatrixMode(GL_MODELVIEW); - glPushMatrix(); - glLoadMatrixd(gGLModelView); + gGL.matrixMode(LLRender::MM_PROJECTION); + gGL.pushMatrix(); + gGL.loadMatrix(proj.m); + gGL.matrixMode(LLRender::MM_MODELVIEW); + gGL.pushMatrix(); + gGL.loadMatrix(gGLModelView); stop_glerror(); gGLLastMatrix = NULL; @@ -8287,12 +8335,8 @@ void LLPipeline::renderShadow(glh::matrix4f& view, glh::matrix4f& proj, LLCamera } gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); - - glColor4f(1,1,1,1); stop_glerror(); - - gGL.setColorMask(false, false); //glCullFace(GL_FRONT); @@ -8303,6 +8347,10 @@ void LLPipeline::renderShadow(glh::matrix4f& view, glh::matrix4f& proj, LLCamera { //occlusion program is general purpose depth-only no-textures gOcclusionProgram.bind(); } + + gGL.diffuseColor4f(1,1,1,1); + gGL.setColorMask(false, false); + LLFastTimer ftm(FTM_SHADOW_SIMPLE); gGL.getTexUnit(0)->disable(); for (U32 i = 0; i < sizeof(types)/sizeof(U32); ++i) @@ -8330,16 +8378,26 @@ void LLPipeline::renderShadow(glh::matrix4f& view, glh::matrix4f& proj, LLCamera { LLFastTimer ftm(FTM_SHADOW_ALPHA); gDeferredShadowAlphaMaskProgram.bind(); - gDeferredShadowAlphaMaskProgram.setAlphaRange(0.6f, 1.f); - renderObjects(LLRenderPass::PASS_ALPHA_SHADOW, LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_TEXCOORD0 | LLVertexBuffer::MAP_COLOR, TRUE); - glColor4f(1,1,1,1); + gDeferredShadowAlphaMaskProgram.setMinimumAlpha(0.598f); + + U32 mask = LLVertexBuffer::MAP_VERTEX | + LLVertexBuffer::MAP_TEXCOORD0 | + LLVertexBuffer::MAP_COLOR | + LLVertexBuffer::MAP_TEXTURE_INDEX; + + renderObjects(LLRenderPass::PASS_ALPHA_MASK, mask, TRUE, TRUE); + renderObjects(LLRenderPass::PASS_FULLBRIGHT_ALPHA_MASK, mask, TRUE, TRUE); + renderObjects(LLRenderPass::PASS_ALPHA, mask, TRUE, TRUE); + gDeferredTreeShadowProgram.bind(); + gDeferredTreeShadowProgram.setMinimumAlpha(0.598f); renderObjects(LLRenderPass::PASS_GRASS, LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_TEXCOORD0, TRUE); } //glCullFace(GL_BACK); + gDeferredShadowProgram.bind(); gGLLastMatrix = NULL; - glLoadMatrixd(gGLModelView); + gGL.loadMatrix(gGLModelView); doOcclusion(shadow_cam); if (use_shader) @@ -8349,10 +8407,10 @@ void LLPipeline::renderShadow(glh::matrix4f& view, glh::matrix4f& proj, LLCamera gGL.setColorMask(true, true); - glMatrixMode(GL_PROJECTION); - glPopMatrix(); - glMatrixMode(GL_MODELVIEW); - glPopMatrix(); + gGL.matrixMode(LLRender::MM_PROJECTION); + gGL.popMatrix(); + gGL.matrixMode(LLRender::MM_MODELVIEW); + gGL.popMatrix(); gGLLastMatrix = NULL; LLPipeline::sUseOcclusion = occlude; @@ -8534,184 +8592,6 @@ BOOL LLPipeline::getVisiblePointCloud(LLCamera& camera, LLVector3& min, LLVector return TRUE; } -void LLPipeline::generateGI(LLCamera& camera, LLVector3& lightDir, std::vector<LLVector3>& vpc) -{ - if (LLViewerShaderMgr::instance()->getVertexShaderLevel(LLViewerShaderMgr::SHADER_DEFERRED) < 3) - { - return; - } - - LLVector3 up; - - //LLGLEnable depth_clamp(GL_DEPTH_CLAMP_NV); - - if (lightDir.mV[2] > 0.5f) - { - up = LLVector3(1,0,0); - } - else - { - up = LLVector3(0, 0, 1); - } - - - F32 gi_range = gSavedSettings.getF32("RenderGIRange"); - - U32 res = mGIMap.getWidth(); - - F32 atten = llmax(gSavedSettings.getF32("RenderGIAttenuation"), 0.001f); - - //set radius to range at which distance attenuation of incoming photons is near 0 - - F32 lrad = sqrtf(1.f/(atten*0.01f)); - - F32 lrange = lrad+gi_range*0.5f; - - LLVector3 pad(lrange,lrange,lrange); - - glh::matrix4f view = look(LLVector3(128.f,128.f,128.f), lightDir, up); - - LLVector3 cp = camera.getOrigin()+camera.getAtAxis()*(gi_range*0.5f); - - glh::vec3f scp(cp.mV); - view.mult_matrix_vec(scp); - cp.setVec(scp.v); - - F32 pix_width = lrange/(res*0.5f); - - //move cp to the nearest pix_width - for (U32 i = 0; i < 3; i++) - { - cp.mV[i] = llround(cp.mV[i], pix_width); - } - - LLVector3 min = cp-pad; - LLVector3 max = cp+pad; - - //set mGIRange to range in tc space[0,1] that covers texture block of intersecting lights around a point - mGIRange.mV[0] = (max.mV[0]-min.mV[0])/res; - mGIRange.mV[1] = (max.mV[1]-min.mV[1])/res; - mGILightRadius = lrad/lrange*0.5f; - - glh::matrix4f proj = gl_ortho(min.mV[0], max.mV[0], - min.mV[1], max.mV[1], - -max.mV[2], -min.mV[2]); - - LLCamera sun_cam = camera; - - glh::matrix4f eye_view = glh_get_current_modelview(); - - //get eye space to camera space matrix - mGIMatrix = view*eye_view.inverse(); - mGINormalMatrix = mGIMatrix.inverse().transpose(); - mGIInvProj = proj.inverse(); - mGIMatrixProj = proj*mGIMatrix; - - //translate and scale to [0,1] - glh::matrix4f trans(.5f, 0.f, 0.f, .5f, - 0.f, 0.5f, 0.f, 0.5f, - 0.f, 0.f, 0.5f, 0.5f, - 0.f, 0.f, 0.f, 1.f); - - mGIMatrixProj = trans*mGIMatrixProj; - - glh_set_current_modelview(view); - glh_set_current_projection(proj); - - LLViewerCamera::updateFrustumPlanes(sun_cam, TRUE, FALSE, TRUE); - - sun_cam.ignoreAgentFrustumPlane(LLCamera::AGENT_PLANE_NEAR); - static LLCullResult result; - - pushRenderTypeMask(); - - andRenderTypeMask(LLPipeline::RENDER_TYPE_SIMPLE, - LLPipeline::RENDER_TYPE_FULLBRIGHT, - LLPipeline::RENDER_TYPE_BUMP, - LLPipeline::RENDER_TYPE_VOLUME, - LLPipeline::RENDER_TYPE_TREE, - LLPipeline::RENDER_TYPE_TERRAIN, - LLPipeline::RENDER_TYPE_WATER, - LLPipeline::RENDER_TYPE_VOIDWATER, - LLPipeline::RENDER_TYPE_PASS_ALPHA_SHADOW, - LLPipeline::RENDER_TYPE_AVATAR, - LLPipeline::RENDER_TYPE_PASS_SIMPLE, - LLPipeline::RENDER_TYPE_PASS_BUMP, - LLPipeline::RENDER_TYPE_PASS_FULLBRIGHT, - LLPipeline::RENDER_TYPE_PASS_SHINY, - END_RENDER_TYPES); - - - - S32 occlude = LLPipeline::sUseOcclusion; - //LLPipeline::sUseOcclusion = 0; - LLPipeline::sShadowRender = TRUE; - - //only render large objects into GI map - sMinRenderSize = gSavedSettings.getF32("RenderGIMinRenderSize"); - - LLViewerCamera::sCurCameraID = LLViewerCamera::CAMERA_GI_SOURCE; - mGIMap.bindTarget(); - - F64 last_modelview[16]; - F64 last_projection[16]; - for (U32 i = 0; i < 16; i++) - { - last_modelview[i] = gGLLastModelView[i]; - last_projection[i] = gGLLastProjection[i]; - gGLLastModelView[i] = mGIModelview.m[i]; - gGLLastProjection[i] = mGIProjection.m[i]; - } - - sun_cam.setOrigin(0.f, 0.f, 0.f); - updateCull(sun_cam, result); - stateSort(sun_cam, result); - - for (U32 i = 0; i < 16; i++) - { - gGLLastModelView[i] = last_modelview[i]; - gGLLastProjection[i] = last_projection[i]; - } - - mGIProjection = proj; - mGIModelview = view; - - LLGLEnable cull(GL_CULL_FACE); - - //generate GI map - glMatrixMode(GL_PROJECTION); - glPushMatrix(); - glLoadMatrixf(proj.m); - glMatrixMode(GL_MODELVIEW); - glPushMatrix(); - glLoadMatrixf(view.m); - - stop_glerror(); - gGLLastMatrix = NULL; - - mGIMap.clear(); - - { - //LLGLEnable enable(GL_DEPTH_CLAMP_NV); - renderGeomDeferred(camera); - } - - mGIMap.flush(); - - glMatrixMode(GL_PROJECTION); - glPopMatrix(); - glMatrixMode(GL_MODELVIEW); - glPopMatrix(); - gGLLastMatrix = NULL; - - LLPipeline::sUseOcclusion = occlude; - LLPipeline::sShadowRender = FALSE; - sMinRenderSize = 0.f; - - popRenderTypeMask(); - -} - void LLPipeline::renderHighlight(const LLViewerObject* obj, F32 fade) { if (obj && obj->getVolume()) @@ -8746,7 +8626,7 @@ void LLPipeline::generateHighlight(LLCamera& camera) if (!mHighlightSet.empty()) { - F32 transition = gFrameIntervalSeconds/gSavedSettings.getF32("RenderHighlightFadeTime"); + F32 transition = gFrameIntervalSeconds/RenderHighlightFadeTime; LLGLDisable test(GL_ALPHA_TEST); LLGLDepthTest depth(GL_FALSE); @@ -8792,11 +8672,23 @@ void LLPipeline::generateHighlight(LLCamera& camera) void LLPipeline::generateSunShadow(LLCamera& camera) { - if (!sRenderDeferred || gSavedSettings.getS32("RenderShadowDetail") <= 0) + if (!sRenderDeferred || RenderShadowDetail <= 0) { return; } + BOOL skip_avatar_update = FALSE; + if (!isAgentAvatarValid() || gAgentCamera.getCameraAnimating() || gAgentCamera.getCameraMode() != CAMERA_MODE_MOUSELOOK || !LLVOAvatar::sVisibleInFirstPerson) + { + + skip_avatar_update = TRUE; + } + + if (!skip_avatar_update) + { + gAgentAvatarp->updateAttachmentVisibility(CAMERA_MODE_THIRD_PERSON); + } + F64 last_modelview[16]; F64 last_projection[16]; for (U32 i = 0; i < 16; i++) @@ -8817,7 +8709,9 @@ void LLPipeline::generateSunShadow(LLCamera& camera) LLPipeline::RENDER_TYPE_TERRAIN, LLPipeline::RENDER_TYPE_WATER, LLPipeline::RENDER_TYPE_VOIDWATER, - LLPipeline::RENDER_TYPE_PASS_ALPHA_SHADOW, + LLPipeline::RENDER_TYPE_PASS_ALPHA, + LLPipeline::RENDER_TYPE_PASS_ALPHA_MASK, + LLPipeline::RENDER_TYPE_PASS_FULLBRIGHT_ALPHA_MASK, LLPipeline::RENDER_TYPE_PASS_GRASS, LLPipeline::RENDER_TYPE_PASS_SIMPLE, LLPipeline::RENDER_TYPE_PASS_BUMP, @@ -8839,25 +8733,25 @@ void LLPipeline::generateSunShadow(LLCamera& camera) glh::matrix4f proj[6]; //clip contains parallel split distances for 3 splits - LLVector3 clip = gSavedSettings.getVector3("RenderShadowClipPlanes"); + LLVector3 clip = RenderShadowClipPlanes; //F32 slope_threshold = gSavedSettings.getF32("RenderShadowSlopeThreshold"); //far clip on last split is minimum of camera view distance and 128 mSunClipPlanes = LLVector4(clip, clip.mV[2] * clip.mV[2]/clip.mV[1]); - clip = gSavedSettings.getVector3("RenderShadowOrthoClipPlanes"); + clip = RenderShadowOrthoClipPlanes; mSunOrthoClipPlanes = LLVector4(clip, clip.mV[2]*clip.mV[2]/clip.mV[1]); //currently used for amount to extrude frusta corners for constructing shadow frusta - LLVector3 n = gSavedSettings.getVector3("RenderShadowNearDist"); + LLVector3 n = RenderShadowNearDist; //F32 nearDist[] = { n.mV[0], n.mV[1], n.mV[2], n.mV[2] }; //put together a universal "near clip" plane for shadow frusta LLPlane shadow_near_clip; { LLVector3 p = gAgent.getPositionAgent(); - p += mSunDir * gSavedSettings.getF32("RenderFarClip")*2.f; + p += mSunDir * RenderFarClip*2.f; shadow_near_clip.setVec(p, mSunDir); } @@ -8910,11 +8804,15 @@ void LLPipeline::generateSunShadow(LLCamera& camera) mShadowFrustPoints[3].clear(); } popRenderTypeMask(); + + if (!skip_avatar_update) + { + gAgentAvatarp->updateAttachmentVisibility(gAgentCamera.getCameraMode()); + } + return; } - generateGI(camera, lightDir, fp); - //get good split distances for frustum for (U32 i = 0; i < fp.size(); ++i) { @@ -8940,7 +8838,7 @@ void LLPipeline::generateSunShadow(LLCamera& camera) F32 range = far_clip-near_clip; - LLVector3 split_exp = gSavedSettings.getVector3("RenderShadowSplitExponent"); + LLVector3 split_exp = RenderShadowSplitExponent; F32 da = 1.f-llmax( fabsf(lightDir*up), fabsf(lightDir*camera.getLeftAxis()) ); @@ -8961,384 +8859,399 @@ void LLPipeline::generateSunShadow(LLCamera& camera) // convenience array of 4 near clip plane distances F32 dist[] = { near_clip, mSunClipPlanes.mV[0], mSunClipPlanes.mV[1], mSunClipPlanes.mV[2], mSunClipPlanes.mV[3] }; - for (S32 j = 0; j < 4; j++) - { - if (!hasRenderDebugMask(RENDER_DEBUG_SHADOW_FRUSTA)) + + if (mSunDiffuse == LLColor4::black) + { //sun diffuse is totally black, shadows don't matter + LLGLDepthTest depth(GL_TRUE); + + for (S32 j = 0; j < 4; j++) { - mShadowFrustPoints[j].clear(); + mShadow[j].bindTarget(); + mShadow[j].clear(); + mShadow[j].flush(); } + } + else + { + for (S32 j = 0; j < 4; j++) + { + if (!hasRenderDebugMask(RENDER_DEBUG_SHADOW_FRUSTA)) + { + mShadowFrustPoints[j].clear(); + } - LLViewerCamera::sCurCameraID = LLViewerCamera::CAMERA_SHADOW0+j; + LLViewerCamera::sCurCameraID = LLViewerCamera::CAMERA_SHADOW0+j; - //restore render matrices - glh_set_current_modelview(saved_view); - glh_set_current_projection(saved_proj); + //restore render matrices + glh_set_current_modelview(saved_view); + glh_set_current_projection(saved_proj); - LLVector3 eye = camera.getOrigin(); + LLVector3 eye = camera.getOrigin(); - //camera used for shadow cull/render - LLCamera shadow_cam; + //camera used for shadow cull/render + LLCamera shadow_cam; - //create world space camera frustum for this split - shadow_cam = camera; - shadow_cam.setFar(16.f); + //create world space camera frustum for this split + shadow_cam = camera; + shadow_cam.setFar(16.f); - LLViewerCamera::updateFrustumPlanes(shadow_cam, FALSE, FALSE, TRUE); + LLViewerCamera::updateFrustumPlanes(shadow_cam, FALSE, FALSE, TRUE); - LLVector3* frust = shadow_cam.mAgentFrustum; + LLVector3* frust = shadow_cam.mAgentFrustum; - LLVector3 pn = shadow_cam.getAtAxis(); + LLVector3 pn = shadow_cam.getAtAxis(); - LLVector3 min, max; + LLVector3 min, max; - //construct 8 corners of split frustum section - for (U32 i = 0; i < 4; i++) - { - LLVector3 delta = frust[i+4]-eye; - delta += (frust[i+4]-frust[(i+2)%4+4])*0.05f; - delta.normVec(); - F32 dp = delta*pn; - frust[i] = eye + (delta*dist[j]*0.95f)/dp; - frust[i+4] = eye + (delta*dist[j+1]*1.05f)/dp; - } + //construct 8 corners of split frustum section + for (U32 i = 0; i < 4; i++) + { + LLVector3 delta = frust[i+4]-eye; + delta += (frust[i+4]-frust[(i+2)%4+4])*0.05f; + delta.normVec(); + F32 dp = delta*pn; + frust[i] = eye + (delta*dist[j]*0.95f)/dp; + frust[i+4] = eye + (delta*dist[j+1]*1.05f)/dp; + } - shadow_cam.calcAgentFrustumPlanes(frust); - shadow_cam.mFrustumCornerDist = 0.f; + shadow_cam.calcAgentFrustumPlanes(frust); + shadow_cam.mFrustumCornerDist = 0.f; - if (!gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_SHADOW_FRUSTA)) - { - mShadowCamera[j] = shadow_cam; - } - - std::vector<LLVector3> fp; - - if (!gPipeline.getVisiblePointCloud(shadow_cam, min, max, fp, lightDir)) - { - //no possible shadow receivers if (!gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_SHADOW_FRUSTA)) { - mShadowExtents[j][0] = LLVector3(); - mShadowExtents[j][1] = LLVector3(); - mShadowCamera[j+4] = shadow_cam; - } - - mShadow[j].bindTarget(); - { - LLGLDepthTest depth(GL_TRUE); - mShadow[j].clear(); + mShadowCamera[j] = shadow_cam; } - mShadow[j].flush(); - - mShadowError.mV[j] = 0.f; - mShadowFOV.mV[j] = 0.f; - continue; - } + std::vector<LLVector3> fp; - if (!gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_SHADOW_FRUSTA)) - { - mShadowExtents[j][0] = min; - mShadowExtents[j][1] = max; - mShadowFrustPoints[j] = fp; - } - + if (!gPipeline.getVisiblePointCloud(shadow_cam, min, max, fp, lightDir)) + { + //no possible shadow receivers + if (!gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_SHADOW_FRUSTA)) + { + mShadowExtents[j][0] = LLVector3(); + mShadowExtents[j][1] = LLVector3(); + mShadowCamera[j+4] = shadow_cam; + } - //find a good origin for shadow projection - LLVector3 origin; + mShadow[j].bindTarget(); + { + LLGLDepthTest depth(GL_TRUE); + mShadow[j].clear(); + } + mShadow[j].flush(); - //get a temporary view projection - view[j] = look(camera.getOrigin(), lightDir, -up); + mShadowError.mV[j] = 0.f; + mShadowFOV.mV[j] = 0.f; - std::vector<LLVector3> wpf; + continue; + } - for (U32 i = 0; i < fp.size(); i++) - { - glh::vec3f p = glh::vec3f(fp[i].mV); - view[j].mult_matrix_vec(p); - wpf.push_back(LLVector3(p.v)); - } + if (!gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_SHADOW_FRUSTA)) + { + mShadowExtents[j][0] = min; + mShadowExtents[j][1] = max; + mShadowFrustPoints[j] = fp; + } + - min = wpf[0]; - max = wpf[0]; + //find a good origin for shadow projection + LLVector3 origin; - for (U32 i = 0; i < fp.size(); ++i) - { //get AABB in camera space - update_min_max(min, max, wpf[i]); - } - - // Construct a perspective transform with perspective along y-axis that contains - // points in wpf - //Known: - // - far clip plane - // - near clip plane - // - points in frustum - //Find: - // - origin - - //get some "interesting" points of reference - LLVector3 center = (min+max)*0.5f; - LLVector3 size = (max-min)*0.5f; - LLVector3 near_center = center; - near_center.mV[1] += size.mV[1]*2.f; - - - //put all points in wpf in quadrant 0, reletive to center of min/max - //get the best fit line using least squares - F32 bfm = 0.f; - F32 bfb = 0.f; + //get a temporary view projection + view[j] = look(camera.getOrigin(), lightDir, -up); - for (U32 i = 0; i < wpf.size(); ++i) - { - wpf[i] -= center; - wpf[i].mV[0] = fabsf(wpf[i].mV[0]); - wpf[i].mV[2] = fabsf(wpf[i].mV[2]); - } + std::vector<LLVector3> wpf; - if (!wpf.empty()) - { - F32 sx = 0.f; - F32 sx2 = 0.f; - F32 sy = 0.f; - F32 sxy = 0.f; - - for (U32 i = 0; i < wpf.size(); ++i) - { - sx += wpf[i].mV[0]; - sx2 += wpf[i].mV[0]*wpf[i].mV[0]; - sy += wpf[i].mV[1]; - sxy += wpf[i].mV[0]*wpf[i].mV[1]; + for (U32 i = 0; i < fp.size(); i++) + { + glh::vec3f p = glh::vec3f(fp[i].mV); + view[j].mult_matrix_vec(p); + wpf.push_back(LLVector3(p.v)); } - bfm = (sy*sx-wpf.size()*sxy)/(sx*sx-wpf.size()*sx2); - bfb = (sx*sxy-sy*sx2)/(sx*sx-bfm*sx2); - } - - { - // best fit line is y=bfm*x+bfb - - //find point that is furthest to the right of line - F32 off_x = -1.f; - LLVector3 lp; - - for (U32 i = 0; i < wpf.size(); ++i) - { - //y = bfm*x+bfb - //x = (y-bfb)/bfm - F32 lx = (wpf[i].mV[1]-bfb)/bfm; + min = wpf[0]; + max = wpf[0]; - lx = wpf[i].mV[0]-lx; - - if (off_x < lx) - { - off_x = lx; - lp = wpf[i]; - } + for (U32 i = 0; i < fp.size(); ++i) + { //get AABB in camera space + update_min_max(min, max, wpf[i]); } - //get line with slope bfm through lp - // bfb = y-bfm*x - bfb = lp.mV[1]-bfm*lp.mV[0]; + // Construct a perspective transform with perspective along y-axis that contains + // points in wpf + //Known: + // - far clip plane + // - near clip plane + // - points in frustum + //Find: + // - origin - //calculate error - mShadowError.mV[j] = 0.f; + //get some "interesting" points of reference + LLVector3 center = (min+max)*0.5f; + LLVector3 size = (max-min)*0.5f; + LLVector3 near_center = center; + near_center.mV[1] += size.mV[1]*2.f; + + + //put all points in wpf in quadrant 0, reletive to center of min/max + //get the best fit line using least squares + F32 bfm = 0.f; + F32 bfb = 0.f; for (U32 i = 0; i < wpf.size(); ++i) { - F32 lx = (wpf[i].mV[1]-bfb)/bfm; - mShadowError.mV[j] += fabsf(wpf[i].mV[0]-lx); + wpf[i] -= center; + wpf[i].mV[0] = fabsf(wpf[i].mV[0]); + wpf[i].mV[2] = fabsf(wpf[i].mV[2]); } - mShadowError.mV[j] /= wpf.size(); - mShadowError.mV[j] /= size.mV[0]; + if (!wpf.empty()) + { + F32 sx = 0.f; + F32 sx2 = 0.f; + F32 sy = 0.f; + F32 sxy = 0.f; + + for (U32 i = 0; i < wpf.size(); ++i) + { + sx += wpf[i].mV[0]; + sx2 += wpf[i].mV[0]*wpf[i].mV[0]; + sy += wpf[i].mV[1]; + sxy += wpf[i].mV[0]*wpf[i].mV[1]; + } - if (mShadowError.mV[j] > gSavedSettings.getF32("RenderShadowErrorCutoff")) - { //just use ortho projection - mShadowFOV.mV[j] = -1.f; - origin.clearVec(); - proj[j] = gl_ortho(min.mV[0], max.mV[0], - min.mV[1], max.mV[1], - -max.mV[2], -min.mV[2]); + bfm = (sy*sx-wpf.size()*sxy)/(sx*sx-wpf.size()*sx2); + bfb = (sx*sxy-sy*sx2)/(sx*sx-bfm*sx2); } - else + { - //origin is where line x = 0; - origin.setVec(0,bfb,0); - - F32 fovz = 1.f; - F32 fovx = 1.f; - - LLVector3 zp; - LLVector3 xp; + // best fit line is y=bfm*x+bfb + + //find point that is furthest to the right of line + F32 off_x = -1.f; + LLVector3 lp; for (U32 i = 0; i < wpf.size(); ++i) { - LLVector3 atz = wpf[i]-origin; - atz.mV[0] = 0.f; - atz.normVec(); - if (fovz > -atz.mV[1]) - { - zp = wpf[i]; - fovz = -atz.mV[1]; - } - - LLVector3 atx = wpf[i]-origin; - atx.mV[2] = 0.f; - atx.normVec(); - if (fovx > -atx.mV[1]) + //y = bfm*x+bfb + //x = (y-bfb)/bfm + F32 lx = (wpf[i].mV[1]-bfb)/bfm; + + lx = wpf[i].mV[0]-lx; + + if (off_x < lx) { - fovx = -atx.mV[1]; - xp = wpf[i]; + off_x = lx; + lp = wpf[i]; } } - fovx = acos(fovx); - fovz = acos(fovz); + //get line with slope bfm through lp + // bfb = y-bfm*x + bfb = lp.mV[1]-bfm*lp.mV[0]; - F32 cutoff = llmin(gSavedSettings.getF32("RenderShadowFOVCutoff"), 1.4f); - - mShadowFOV.mV[j] = fovx; - - if (fovx < cutoff && fovz > cutoff) + //calculate error + mShadowError.mV[j] = 0.f; + + for (U32 i = 0; i < wpf.size(); ++i) { - //x is a good fit, but z is too big, move away from zp enough so that fovz matches cutoff - F32 d = zp.mV[2]/tan(cutoff); - F32 ny = zp.mV[1] + fabsf(d); + F32 lx = (wpf[i].mV[1]-bfb)/bfm; + mShadowError.mV[j] += fabsf(wpf[i].mV[0]-lx); + } - origin.mV[1] = ny; + mShadowError.mV[j] /= wpf.size(); + mShadowError.mV[j] /= size.mV[0]; - fovz = 1.f; - fovx = 1.f; + if (mShadowError.mV[j] > RenderShadowErrorCutoff) + { //just use ortho projection + mShadowFOV.mV[j] = -1.f; + origin.clearVec(); + proj[j] = gl_ortho(min.mV[0], max.mV[0], + min.mV[1], max.mV[1], + -max.mV[2], -min.mV[2]); + } + else + { + //origin is where line x = 0; + origin.setVec(0,bfb,0); + + F32 fovz = 1.f; + F32 fovx = 1.f; + + LLVector3 zp; + LLVector3 xp; for (U32 i = 0; i < wpf.size(); ++i) { LLVector3 atz = wpf[i]-origin; atz.mV[0] = 0.f; atz.normVec(); - fovz = llmin(fovz, -atz.mV[1]); - + if (fovz > -atz.mV[1]) + { + zp = wpf[i]; + fovz = -atz.mV[1]; + } + LLVector3 atx = wpf[i]-origin; atx.mV[2] = 0.f; atx.normVec(); - fovx = llmin(fovx, -atx.mV[1]); + if (fovx > -atx.mV[1]) + { + fovx = -atx.mV[1]; + xp = wpf[i]; + } } fovx = acos(fovx); fovz = acos(fovz); - mShadowFOV.mV[j] = cutoff; - } + F32 cutoff = llmin((F32) RenderShadowFOVCutoff, 1.4f); + + mShadowFOV.mV[j] = fovx; + + if (fovx < cutoff && fovz > cutoff) + { + //x is a good fit, but z is too big, move away from zp enough so that fovz matches cutoff + F32 d = zp.mV[2]/tan(cutoff); + F32 ny = zp.mV[1] + fabsf(d); + + origin.mV[1] = ny; + + fovz = 1.f; + fovx = 1.f; + + for (U32 i = 0; i < wpf.size(); ++i) + { + LLVector3 atz = wpf[i]-origin; + atz.mV[0] = 0.f; + atz.normVec(); + fovz = llmin(fovz, -atz.mV[1]); + + LLVector3 atx = wpf[i]-origin; + atx.mV[2] = 0.f; + atx.normVec(); + fovx = llmin(fovx, -atx.mV[1]); + } + + fovx = acos(fovx); + fovz = acos(fovz); + + mShadowFOV.mV[j] = cutoff; + } - origin += center; + origin += center; - F32 ynear = -(max.mV[1]-origin.mV[1]); - F32 yfar = -(min.mV[1]-origin.mV[1]); + F32 ynear = -(max.mV[1]-origin.mV[1]); + F32 yfar = -(min.mV[1]-origin.mV[1]); - if (ynear < 0.1f) //keep a sensible near clip plane - { - F32 diff = 0.1f-ynear; - origin.mV[1] += diff; - ynear += diff; - yfar += diff; - } + if (ynear < 0.1f) //keep a sensible near clip plane + { + F32 diff = 0.1f-ynear; + origin.mV[1] += diff; + ynear += diff; + yfar += diff; + } - if (fovx > cutoff) - { //just use ortho projection - origin.clearVec(); - mShadowError.mV[j] = -1.f; - proj[j] = gl_ortho(min.mV[0], max.mV[0], - min.mV[1], max.mV[1], - -max.mV[2], -min.mV[2]); - } - else - { - //get perspective projection - view[j] = view[j].inverse(); + if (fovx > cutoff) + { //just use ortho projection + origin.clearVec(); + mShadowError.mV[j] = -1.f; + proj[j] = gl_ortho(min.mV[0], max.mV[0], + min.mV[1], max.mV[1], + -max.mV[2], -min.mV[2]); + } + else + { + //get perspective projection + view[j] = view[j].inverse(); - glh::vec3f origin_agent(origin.mV); + glh::vec3f origin_agent(origin.mV); - //translate view to origin - view[j].mult_matrix_vec(origin_agent); + //translate view to origin + view[j].mult_matrix_vec(origin_agent); - eye = LLVector3(origin_agent.v); + eye = LLVector3(origin_agent.v); - if (!hasRenderDebugMask(LLPipeline::RENDER_DEBUG_SHADOW_FRUSTA)) - { - mShadowFrustOrigin[j] = eye; - } + if (!hasRenderDebugMask(LLPipeline::RENDER_DEBUG_SHADOW_FRUSTA)) + { + mShadowFrustOrigin[j] = eye; + } - view[j] = look(LLVector3(origin_agent.v), lightDir, -up); + view[j] = look(LLVector3(origin_agent.v), lightDir, -up); - F32 fx = 1.f/tanf(fovx); - F32 fz = 1.f/tanf(fovz); + F32 fx = 1.f/tanf(fovx); + F32 fz = 1.f/tanf(fovz); - proj[j] = glh::matrix4f(-fx, 0, 0, 0, - 0, (yfar+ynear)/(ynear-yfar), 0, (2.f*yfar*ynear)/(ynear-yfar), - 0, 0, -fz, 0, - 0, -1.f, 0, 0); + proj[j] = glh::matrix4f(-fx, 0, 0, 0, + 0, (yfar+ynear)/(ynear-yfar), 0, (2.f*yfar*ynear)/(ynear-yfar), + 0, 0, -fz, 0, + 0, -1.f, 0, 0); + } } } - } - //shadow_cam.setFar(128.f); - shadow_cam.setOriginAndLookAt(eye, up, center); + //shadow_cam.setFar(128.f); + shadow_cam.setOriginAndLookAt(eye, up, center); - shadow_cam.setOrigin(0,0,0); + shadow_cam.setOrigin(0,0,0); - glh_set_current_modelview(view[j]); - glh_set_current_projection(proj[j]); + glh_set_current_modelview(view[j]); + glh_set_current_projection(proj[j]); - LLViewerCamera::updateFrustumPlanes(shadow_cam, FALSE, FALSE, TRUE); + LLViewerCamera::updateFrustumPlanes(shadow_cam, FALSE, FALSE, TRUE); - //shadow_cam.ignoreAgentFrustumPlane(LLCamera::AGENT_PLANE_NEAR); - shadow_cam.getAgentPlane(LLCamera::AGENT_PLANE_NEAR).set(shadow_near_clip); + //shadow_cam.ignoreAgentFrustumPlane(LLCamera::AGENT_PLANE_NEAR); + shadow_cam.getAgentPlane(LLCamera::AGENT_PLANE_NEAR).set(shadow_near_clip); - //translate and scale to from [-1, 1] to [0, 1] - glh::matrix4f trans(0.5f, 0.f, 0.f, 0.5f, - 0.f, 0.5f, 0.f, 0.5f, - 0.f, 0.f, 0.5f, 0.5f, - 0.f, 0.f, 0.f, 1.f); + //translate and scale to from [-1, 1] to [0, 1] + glh::matrix4f trans(0.5f, 0.f, 0.f, 0.5f, + 0.f, 0.5f, 0.f, 0.5f, + 0.f, 0.f, 0.5f, 0.5f, + 0.f, 0.f, 0.f, 1.f); - glh_set_current_modelview(view[j]); - glh_set_current_projection(proj[j]); + glh_set_current_modelview(view[j]); + glh_set_current_projection(proj[j]); - for (U32 i = 0; i < 16; i++) - { - gGLLastModelView[i] = mShadowModelview[j].m[i]; - gGLLastProjection[i] = mShadowProjection[j].m[i]; - } + for (U32 i = 0; i < 16; i++) + { + gGLLastModelView[i] = mShadowModelview[j].m[i]; + gGLLastProjection[i] = mShadowProjection[j].m[i]; + } - mShadowModelview[j] = view[j]; - mShadowProjection[j] = proj[j]; + mShadowModelview[j] = view[j]; + mShadowProjection[j] = proj[j]; - mSunShadowMatrix[j] = trans*proj[j]*view[j]*inv_view; + mSunShadowMatrix[j] = trans*proj[j]*view[j]*inv_view; - stop_glerror(); + stop_glerror(); - mShadow[j].bindTarget(); - mShadow[j].getViewport(gGLViewport); - mShadow[j].clear(); + mShadow[j].bindTarget(); + mShadow[j].getViewport(gGLViewport); + mShadow[j].clear(); - { - static LLCullResult result[4]; + { + static LLCullResult result[4]; - //LLGLEnable enable(GL_DEPTH_CLAMP_NV); - renderShadow(view[j], proj[j], shadow_cam, result[j], TRUE); - } + //LLGLEnable enable(GL_DEPTH_CLAMP_NV); + renderShadow(view[j], proj[j], shadow_cam, result[j], TRUE); + } - mShadow[j].flush(); + mShadow[j].flush(); - if (!gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_SHADOW_FRUSTA)) - { - LLViewerCamera::updateFrustumPlanes(shadow_cam, FALSE, FALSE, TRUE); - mShadowCamera[j+4] = shadow_cam; + if (!gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_SHADOW_FRUSTA)) + { + LLViewerCamera::updateFrustumPlanes(shadow_cam, FALSE, FALSE, TRUE); + mShadowCamera[j+4] = shadow_cam; + } } } //hack to disable projector shadows - bool gen_shadow = gSavedSettings.getS32("RenderShadowDetail") > 1; + bool gen_shadow = RenderShadowDetail > 1; if (gen_shadow) { @@ -9477,7 +9390,7 @@ void LLPipeline::generateSunShadow(LLCamera& camera) } - if (!gSavedSettings.getBOOL("CameraOffset")) + if (!CameraOffset) { glh_set_current_modelview(saved_view); glh_set_current_projection(saved_proj); @@ -9486,10 +9399,10 @@ void LLPipeline::generateSunShadow(LLCamera& camera) { glh_set_current_modelview(view[1]); glh_set_current_projection(proj[1]); - glLoadMatrixf(view[1].m); - glMatrixMode(GL_PROJECTION); - glLoadMatrixf(proj[1].m); - glMatrixMode(GL_MODELVIEW); + gGL.loadMatrix(view[1].m); + gGL.matrixMode(LLRender::MM_PROJECTION); + gGL.loadMatrix(proj[1].m); + gGL.matrixMode(LLRender::MM_MODELVIEW); } gGL.setColorMask(true, false); @@ -9500,6 +9413,11 @@ void LLPipeline::generateSunShadow(LLCamera& camera) } popRenderTypeMask(); + + if (!skip_avatar_update) + { + gAgentAvatarp->updateAttachmentVisibility(gAgentCamera.getCameraMode()); + } } void LLPipeline::renderGroups(LLRenderPass* pass, U32 type, U32 mask, BOOL texture) @@ -9621,24 +9539,24 @@ void LLPipeline::generateImpostor(LLVOAvatar* avatar) tdim.mV[0] = fabsf(half_height.dot3(left).getF32()); tdim.mV[1] = fabsf(half_height.dot3(up).getF32()); - glMatrixMode(GL_PROJECTION); - glPushMatrix(); + gGL.matrixMode(LLRender::MM_PROJECTION); + gGL.pushMatrix(); F32 distance = (pos-camera.getOrigin()).length(); F32 fov = atanf(tdim.mV[1]/distance)*2.f*RAD_TO_DEG; F32 aspect = tdim.mV[0]/tdim.mV[1]; glh::matrix4f persp = gl_perspective(fov, aspect, 1.f, 256.f); glh_set_current_projection(persp); - glLoadMatrixf(persp.m); + gGL.loadMatrix(persp.m); - glMatrixMode(GL_MODELVIEW); - glPushMatrix(); + gGL.matrixMode(LLRender::MM_MODELVIEW); + gGL.pushMatrix(); glh::matrix4f mat; camera.getOpenGLTransform(mat.m); mat = glh::matrix4f((GLfloat*) OGL_TO_CFR_ROTATION) * mat; - glLoadMatrixf(mat.m); + gGL.loadMatrix(mat.m); glh_set_current_modelview(mat); glClearColor(0.0f,0.0f,0.0f,0.0f); @@ -9706,14 +9624,19 @@ void LLPipeline::generateImpostor(LLVOAvatar* avatar) gGL.flush(); - glPushMatrix(); - glLoadIdentity(); - glMatrixMode(GL_PROJECTION); - glPushMatrix(); - glLoadIdentity(); + gGL.pushMatrix(); + gGL.loadIdentity(); + gGL.matrixMode(LLRender::MM_PROJECTION); + gGL.pushMatrix(); + gGL.loadIdentity(); static const F32 clip_plane = 0.99999f; + if (LLGLSLShader::sNoFixedFunction) + { + gUIProgram.bind(); + } + gGL.color4ub(64,64,64,255); gGL.begin(LLRender::QUADS); gGL.vertex3f(-1, -1, clip_plane); @@ -9723,9 +9646,14 @@ void LLPipeline::generateImpostor(LLVOAvatar* avatar) gGL.end(); gGL.flush(); - glPopMatrix(); - glMatrixMode(GL_MODELVIEW); - glPopMatrix(); + if (LLGLSLShader::sNoFixedFunction) + { + gUIProgram.unbind(); + } + + gGL.popMatrix(); + gGL.matrixMode(LLRender::MM_MODELVIEW); + gGL.popMatrix(); } avatar->mImpostor.flush(); @@ -9739,10 +9667,10 @@ void LLPipeline::generateImpostor(LLVOAvatar* avatar) sShadowRender = FALSE; popRenderTypeMask(); - glMatrixMode(GL_PROJECTION); - glPopMatrix(); - glMatrixMode(GL_MODELVIEW); - glPopMatrix(); + gGL.matrixMode(LLRender::MM_PROJECTION); + gGL.popMatrix(); + gGL.matrixMode(LLRender::MM_MODELVIEW); + gGL.popMatrix(); avatar->mNeedsImpostorUpdate = FALSE; avatar->cacheImpostorValues(); diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h index 27ee2745b5..2815d736e4 100644 --- a/indra/newview/pipeline.h +++ b/indra/newview/pipeline.h @@ -72,7 +72,7 @@ BOOL compute_min_max(LLMatrix4& box, LLVector2& min, LLVector2& max); // Shouldn bool LLRayAABB(const LLVector3 ¢er, const LLVector3 &size, const LLVector3& origin, const LLVector3& dir, LLVector3 &coord, F32 epsilon = 0); BOOL setup_hud_matrices(); // use whole screen to render hud BOOL setup_hud_matrices(const LLRect& screen_region); // specify portion of screen (in pixels) to render hud attachments from (for picking) -glh::matrix4f glh_copy_matrix(GLdouble* src); +glh::matrix4f glh_copy_matrix(F32* src); glh::matrix4f glh_get_current_modelview(); void glh_set_current_modelview(const glh::matrix4f& mat); glh::matrix4f glh_get_current_projection(); @@ -231,7 +231,7 @@ public: void postSort(LLCamera& camera); void forAllVisibleDrawables(void (*func)(LLDrawable*)); - void renderObjects(U32 type, U32 mask, BOOL texture = TRUE); + void renderObjects(U32 type, U32 mask, BOOL texture = TRUE, BOOL batch_texture = FALSE); void renderGroups(LLRenderPass* pass, U32 type, U32 mask, BOOL texture); void grabReferences(LLCullResult& result); @@ -248,7 +248,7 @@ public: void renderGeomDeferred(LLCamera& camera); void renderGeomPostDeferred(LLCamera& camera); void renderGeomShadow(LLCamera& camera); - void bindDeferredShader(LLGLSLShader& shader, U32 light_index = 0, LLRenderTarget* gi_source = NULL, LLRenderTarget* last_gi_post = NULL, U32 noise_map = 0xFFFFFFFF); + void bindDeferredShader(LLGLSLShader& shader, U32 light_index = 0, U32 noise_map = 0xFFFFFFFF); void setupSpotLight(LLGLSLShader& shader, LLDrawable* drawablep); void unbindDeferredShader(LLGLSLShader& shader); @@ -262,7 +262,6 @@ public: void renderShadow(glh::matrix4f& view, glh::matrix4f& proj, LLCamera& camera, LLCullResult& result, BOOL use_shader = TRUE, BOOL use_occlusion = TRUE); - void generateGI(LLCamera& camera, LLVector3& lightDir, std::vector<LLVector3>& vpc); void renderHighlights(); void renderDebug(); void renderPhysicsDisplay(); @@ -360,7 +359,7 @@ public: static BOOL getRenderHighlights(void* data); static void updateRenderDeferred(); - static void refreshRenderDeferred(); + static void refreshCachedSettings(); static void throttleNewMemoryAllocation(BOOL disable); @@ -408,7 +407,6 @@ public: RENDER_TYPE_PASS_ALPHA = LLRenderPass::PASS_ALPHA, RENDER_TYPE_PASS_ALPHA_MASK = LLRenderPass::PASS_ALPHA_MASK, RENDER_TYPE_PASS_FULLBRIGHT_ALPHA_MASK = LLRenderPass::PASS_FULLBRIGHT_ALPHA_MASK, - RENDER_TYPE_PASS_ALPHA_SHADOW = LLRenderPass::PASS_ALPHA_SHADOW, // Following are object types (only used in drawable mRenderType) RENDER_TYPE_HUD = LLRenderPass::NUM_RENDER_TYPES, RENDER_TYPE_VOLUME, @@ -438,7 +436,7 @@ public: RENDER_DEBUG_VERIFY = 0x0000002, RENDER_DEBUG_BBOXES = 0x0000004, RENDER_DEBUG_OCTREE = 0x0000008, - RENDER_DEBUG_PICKING = 0x0000010, + RENDER_DEBUG_WIND_VECTORS = 0x0000010, RENDER_DEBUG_OCCLUSION = 0x0000020, RENDER_DEBUG_POINTS = 0x0000040, RENDER_DEBUG_TEXTURE_PRIORITY = 0x0000080, @@ -531,15 +529,16 @@ public: LLRenderTarget mScreen; LLRenderTarget mUIScreen; LLRenderTarget mDeferredScreen; + LLRenderTarget mFXAABuffer; LLRenderTarget mEdgeMap; LLRenderTarget mDeferredDepth; - LLRenderTarget mDeferredLight[3]; - LLRenderTarget mGIMap; - LLRenderTarget mGIMapPost[2]; - LLRenderTarget mLuminanceMap; + LLRenderTarget mDeferredLight; LLRenderTarget mHighlight; LLRenderTarget mPhysicsDisplay; + //utility buffer for rendering post effects, gets abused by renderDeferredLighting + LLPointer<LLVertexBuffer> mDeferredVB; + //sun shadow map LLRenderTarget mShadow[6]; std::vector<LLVector3> mShadowFrustPoints[4]; @@ -585,6 +584,7 @@ public: LLColor4 mSunDiffuse; LLVector3 mSunDir; + LLVector3 mTransformedSunDir; BOOL mInitialized; BOOL mVertexShadersEnabled; @@ -770,6 +770,81 @@ public: //debug use static U32 sCurRenderPoolType ; + + //cached settings + static BOOL WindLightUseAtmosShaders; + static BOOL VertexShaderEnable; + static BOOL RenderAvatarVP; + static BOOL RenderDeferred; + static F32 RenderDeferredSunWash; + static U32 RenderFSAASamples; + static U32 RenderResolutionDivisor; + static BOOL RenderUIBuffer; + static S32 RenderShadowDetail; + static BOOL RenderDeferredSSAO; + static F32 RenderShadowResolutionScale; + static BOOL RenderLocalLights; + static BOOL RenderDelayCreation; + static BOOL RenderAnimateRes; + static BOOL FreezeTime; + static S32 DebugBeaconLineWidth; + static F32 RenderHighlightBrightness; + static LLColor4 RenderHighlightColor; + static F32 RenderHighlightThickness; + static BOOL RenderSpotLightsInNondeferred; + static LLColor4 PreviewAmbientColor; + static LLColor4 PreviewDiffuse0; + static LLColor4 PreviewSpecular0; + static LLColor4 PreviewDiffuse1; + static LLColor4 PreviewSpecular1; + static LLColor4 PreviewDiffuse2; + static LLColor4 PreviewSpecular2; + static LLVector3 PreviewDirection0; + static LLVector3 PreviewDirection1; + static LLVector3 PreviewDirection2; + static F32 RenderGlowMinLuminance; + static F32 RenderGlowMaxExtractAlpha; + static F32 RenderGlowWarmthAmount; + static LLVector3 RenderGlowLumWeights; + static LLVector3 RenderGlowWarmthWeights; + static S32 RenderGlowResolutionPow; + static S32 RenderGlowIterations; + static F32 RenderGlowWidth; + static F32 RenderGlowStrength; + static BOOL RenderDepthOfField; + static F32 CameraFocusTransitionTime; + static F32 CameraFNumber; + static F32 CameraFocalLength; + static F32 CameraFieldOfView; + static F32 RenderShadowNoise; + static F32 RenderShadowBlurSize; + static F32 RenderSSAOScale; + static U32 RenderSSAOMaxScale; + static F32 RenderSSAOFactor; + static LLVector3 RenderSSAOEffect; + static F32 RenderShadowOffsetError; + static F32 RenderShadowBiasError; + static F32 RenderShadowOffset; + static F32 RenderShadowBias; + static F32 RenderSpotShadowOffset; + static F32 RenderSpotShadowBias; + static F32 RenderEdgeDepthCutoff; + static F32 RenderEdgeNormCutoff; + static LLVector3 RenderShadowGaussian; + static F32 RenderShadowBlurDistFactor; + static BOOL RenderDeferredAtmospheric; + static S32 RenderReflectionDetail; + static F32 RenderHighlightFadeTime; + static LLVector3 RenderShadowClipPlanes; + static LLVector3 RenderShadowOrthoClipPlanes; + static LLVector3 RenderShadowNearDist; + static F32 RenderFarClip; + static LLVector3 RenderShadowSplitExponent; + static F32 RenderShadowErrorCutoff; + static F32 RenderShadowFOVCutoff; + static BOOL CameraOffset; + static F32 CameraMaxCoF; + static F32 CameraDoFResScale; }; void render_bbox(const LLVector3 &min, const LLVector3 &max); diff --git a/indra/newview/skins/default/textures/arrow_keys.png b/indra/newview/skins/default/textures/arrow_keys.png Binary files differdeleted file mode 100644 index f19af59251..0000000000 --- a/indra/newview/skins/default/textures/arrow_keys.png +++ /dev/null diff --git a/indra/newview/skins/default/textures/bottomtray/Cam_Pan_Over.png b/indra/newview/skins/default/textures/bottomtray/Cam_Pan_Over.png Binary files differdeleted file mode 100644 index b5781718ec..0000000000 --- a/indra/newview/skins/default/textures/bottomtray/Cam_Pan_Over.png +++ /dev/null diff --git a/indra/newview/skins/default/textures/bottomtray/CameraView_Press.png b/indra/newview/skins/default/textures/bottomtray/CameraView_Press.png Binary files differdeleted file mode 100644 index 5a9346fd39..0000000000 --- a/indra/newview/skins/default/textures/bottomtray/CameraView_Press.png +++ /dev/null diff --git a/indra/newview/skins/default/textures/bottomtray/PanOrbit_Disabled.png b/indra/newview/skins/default/textures/bottomtray/PanOrbit_Disabled.png Binary files differdeleted file mode 100644 index 20fa40e127..0000000000 --- a/indra/newview/skins/default/textures/bottomtray/PanOrbit_Disabled.png +++ /dev/null diff --git a/indra/newview/skins/default/textures/bottomtray/PanOrbit_Over.png b/indra/newview/skins/default/textures/bottomtray/PanOrbit_Over.png Binary files differdeleted file mode 100644 index f1420e0002..0000000000 --- a/indra/newview/skins/default/textures/bottomtray/PanOrbit_Over.png +++ /dev/null diff --git a/indra/newview/skins/default/textures/bottomtray/PanOrbit_Press.png b/indra/newview/skins/default/textures/bottomtray/PanOrbit_Press.png Binary files differdeleted file mode 100644 index 89a6269edc..0000000000 --- a/indra/newview/skins/default/textures/bottomtray/PanOrbit_Press.png +++ /dev/null diff --git a/indra/newview/skins/default/textures/bottomtray/VoicePTT_Lvl1_Dark.png b/indra/newview/skins/default/textures/bottomtray/VoicePTT_Lvl1_Dark.png Binary files differnew file mode 100644 index 0000000000..857fa1e047 --- /dev/null +++ b/indra/newview/skins/default/textures/bottomtray/VoicePTT_Lvl1_Dark.png diff --git a/indra/newview/skins/default/textures/bottomtray/VoicePTT_Lvl2_Dark.png b/indra/newview/skins/default/textures/bottomtray/VoicePTT_Lvl2_Dark.png Binary files differnew file mode 100644 index 0000000000..453bb53673 --- /dev/null +++ b/indra/newview/skins/default/textures/bottomtray/VoicePTT_Lvl2_Dark.png diff --git a/indra/newview/skins/default/textures/bottomtray/VoicePTT_Lvl3_Dark.png b/indra/newview/skins/default/textures/bottomtray/VoicePTT_Lvl3_Dark.png Binary files differnew file mode 100644 index 0000000000..135a66ca0d --- /dev/null +++ b/indra/newview/skins/default/textures/bottomtray/VoicePTT_Lvl3_Dark.png diff --git a/indra/newview/skins/default/textures/bottomtray/VoicePTT_Off_Dark.png b/indra/newview/skins/default/textures/bottomtray/VoicePTT_Off_Dark.png Binary files differnew file mode 100644 index 0000000000..a63aec5e6d --- /dev/null +++ b/indra/newview/skins/default/textures/bottomtray/VoicePTT_Off_Dark.png diff --git a/indra/newview/skins/default/textures/bottomtray/VoicePTT_On_Dark.png b/indra/newview/skins/default/textures/bottomtray/VoicePTT_On_Dark.png Binary files differnew file mode 100644 index 0000000000..1719eb3e84 --- /dev/null +++ b/indra/newview/skins/default/textures/bottomtray/VoicePTT_On_Dark.png diff --git a/indra/newview/skins/default/textures/checkerboard_transparency_bg.png b/indra/newview/skins/default/textures/checkerboard_transparency_bg.png Binary files differdeleted file mode 100644 index 9a16935204..0000000000 --- a/indra/newview/skins/default/textures/checkerboard_transparency_bg.png +++ /dev/null diff --git a/indra/newview/skins/default/textures/circle.tga b/indra/newview/skins/default/textures/circle.tga Binary files differdeleted file mode 100644 index d7097e3a35..0000000000 --- a/indra/newview/skins/default/textures/circle.tga +++ /dev/null diff --git a/indra/newview/skins/default/textures/containers/Accordion_ArrowClosed_Over.png b/indra/newview/skins/default/textures/containers/Accordion_ArrowClosed_Over.png Binary files differdeleted file mode 100644 index e47f913db1..0000000000 --- a/indra/newview/skins/default/textures/containers/Accordion_ArrowClosed_Over.png +++ /dev/null diff --git a/indra/newview/skins/default/textures/containers/Accordion_ArrowOpened_Over.png b/indra/newview/skins/default/textures/containers/Accordion_ArrowOpened_Over.png Binary files differdeleted file mode 100644 index e2c67de9c0..0000000000 --- a/indra/newview/skins/default/textures/containers/Accordion_ArrowOpened_Over.png +++ /dev/null diff --git a/indra/newview/skins/default/textures/containers/TabTop_Left_Over.png b/indra/newview/skins/default/textures/containers/TabTop_Left_Over.png Binary files differdeleted file mode 100644 index 295cd89a57..0000000000 --- a/indra/newview/skins/default/textures/containers/TabTop_Left_Over.png +++ /dev/null diff --git a/indra/newview/skins/default/textures/containers/TabTop_Middle_Over.png b/indra/newview/skins/default/textures/containers/TabTop_Middle_Over.png Binary files differdeleted file mode 100644 index 0758cbcf0d..0000000000 --- a/indra/newview/skins/default/textures/containers/TabTop_Middle_Over.png +++ /dev/null diff --git a/indra/newview/skins/default/textures/containers/TabTop_Right_Over.png b/indra/newview/skins/default/textures/containers/TabTop_Right_Over.png Binary files differdeleted file mode 100644 index c2cbc2b1e5..0000000000 --- a/indra/newview/skins/default/textures/containers/TabTop_Right_Over.png +++ /dev/null diff --git a/indra/newview/skins/default/textures/icn_label_web.tga b/indra/newview/skins/default/textures/icn_label_web.tga Binary files differdeleted file mode 100644 index 7c9131dfff..0000000000 --- a/indra/newview/skins/default/textures/icn_label_web.tga +++ /dev/null diff --git a/indra/newview/skins/default/textures/icn_media.tga b/indra/newview/skins/default/textures/icn_media.tga Binary files differdeleted file mode 100644 index 43dd342c9d..0000000000 --- a/indra/newview/skins/default/textures/icn_media.tga +++ /dev/null diff --git a/indra/newview/skins/default/textures/icn_voice-groupfocus.tga b/indra/newview/skins/default/textures/icn_voice-groupfocus.tga Binary files differdeleted file mode 100644 index 9f48d4609d..0000000000 --- a/indra/newview/skins/default/textures/icn_voice-groupfocus.tga +++ /dev/null diff --git a/indra/newview/skins/default/textures/icn_voice-localchat.tga b/indra/newview/skins/default/textures/icn_voice-localchat.tga Binary files differdeleted file mode 100644 index 7cf267eaf5..0000000000 --- a/indra/newview/skins/default/textures/icn_voice-localchat.tga +++ /dev/null diff --git a/indra/newview/skins/default/textures/icn_voice-pvtfocus.tga b/indra/newview/skins/default/textures/icn_voice-pvtfocus.tga Binary files differdeleted file mode 100644 index abadb09aaf..0000000000 --- a/indra/newview/skins/default/textures/icn_voice-pvtfocus.tga +++ /dev/null diff --git a/indra/newview/skins/default/textures/icon_day_cycle.tga b/indra/newview/skins/default/textures/icon_day_cycle.tga Binary files differdeleted file mode 100644 index 2d5dee1e94..0000000000 --- a/indra/newview/skins/default/textures/icon_day_cycle.tga +++ /dev/null diff --git a/indra/newview/skins/default/textures/icon_event_adult.tga b/indra/newview/skins/default/textures/icon_event_adult.tga Binary files differdeleted file mode 100644 index f548126e5a..0000000000 --- a/indra/newview/skins/default/textures/icon_event_adult.tga +++ /dev/null diff --git a/indra/newview/skins/default/textures/icon_lock.tga b/indra/newview/skins/default/textures/icon_lock.tga Binary files differdeleted file mode 100644 index 23521aa113..0000000000 --- a/indra/newview/skins/default/textures/icon_lock.tga +++ /dev/null diff --git a/indra/newview/skins/default/textures/icons/AddItem_Over.png b/indra/newview/skins/default/textures/icons/AddItem_Over.png Binary files differdeleted file mode 100644 index cad6e8d52f..0000000000 --- a/indra/newview/skins/default/textures/icons/AddItem_Over.png +++ /dev/null diff --git a/indra/newview/skins/default/textures/icons/BackArrow_Over.png b/indra/newview/skins/default/textures/icons/BackArrow_Over.png Binary files differdeleted file mode 100644 index b36e03a8cf..0000000000 --- a/indra/newview/skins/default/textures/icons/BackArrow_Over.png +++ /dev/null diff --git a/indra/newview/skins/default/textures/icons/DragHandle.png b/indra/newview/skins/default/textures/icons/DragHandle.png Binary files differdeleted file mode 100644 index c3cbc07a33..0000000000 --- a/indra/newview/skins/default/textures/icons/DragHandle.png +++ /dev/null diff --git a/indra/newview/skins/default/textures/icons/Generic_Object.png b/indra/newview/skins/default/textures/icons/Generic_Object.png Binary files differdeleted file mode 100644 index e3a80b2aef..0000000000 --- a/indra/newview/skins/default/textures/icons/Generic_Object.png +++ /dev/null diff --git a/indra/newview/skins/default/textures/icons/Inv_Gift.png b/indra/newview/skins/default/textures/icons/Inv_Gift.png Binary files differdeleted file mode 100644 index 5afe85d72d..0000000000 --- a/indra/newview/skins/default/textures/icons/Inv_Gift.png +++ /dev/null diff --git a/indra/newview/skins/default/textures/icons/OptionsMenu_Over.png b/indra/newview/skins/default/textures/icons/OptionsMenu_Over.png Binary files differdeleted file mode 100644 index fcabd4c6d3..0000000000 --- a/indra/newview/skins/default/textures/icons/OptionsMenu_Over.png +++ /dev/null diff --git a/indra/newview/skins/default/textures/icons/OutboxPush_On_Selected.png b/indra/newview/skins/default/textures/icons/OutboxPush_On_Selected.png Binary files differdeleted file mode 100644 index 0e60b417b0..0000000000 --- a/indra/newview/skins/default/textures/icons/OutboxPush_On_Selected.png +++ /dev/null diff --git a/indra/newview/skins/default/textures/icons/Parcel_Damage_Light_Alt.png b/indra/newview/skins/default/textures/icons/Parcel_Damage_Light_Alt.png Binary files differdeleted file mode 100644 index d72f02f708..0000000000 --- a/indra/newview/skins/default/textures/icons/Parcel_Damage_Light_Alt.png +++ /dev/null diff --git a/indra/newview/skins/default/textures/icons/Parcel_NoScripts_Light.png b/indra/newview/skins/default/textures/icons/Parcel_NoScripts_Light.png Binary files differdeleted file mode 100644 index f82354959e..0000000000 --- a/indra/newview/skins/default/textures/icons/Parcel_NoScripts_Light.png +++ /dev/null diff --git a/indra/newview/skins/default/textures/icons/TrashItem_Over.png b/indra/newview/skins/default/textures/icons/TrashItem_Over.png Binary files differdeleted file mode 100644 index 1a0eea6c67..0000000000 --- a/indra/newview/skins/default/textures/icons/TrashItem_Over.png +++ /dev/null diff --git a/indra/newview/skins/default/textures/icons/parcel_color_EVRY.png b/indra/newview/skins/default/textures/icons/parcel_color_EVRY.png Binary files differdeleted file mode 100644 index b5508423eb..0000000000 --- a/indra/newview/skins/default/textures/icons/parcel_color_EVRY.png +++ /dev/null diff --git a/indra/newview/skins/default/textures/icons/parcel_color_EXP.png b/indra/newview/skins/default/textures/icons/parcel_color_EXP.png Binary files differdeleted file mode 100644 index 4813d37198..0000000000 --- a/indra/newview/skins/default/textures/icons/parcel_color_EXP.png +++ /dev/null diff --git a/indra/newview/skins/default/textures/icons/parcel_color_M.png b/indra/newview/skins/default/textures/icons/parcel_color_M.png Binary files differdeleted file mode 100644 index 41984c43e4..0000000000 --- a/indra/newview/skins/default/textures/icons/parcel_color_M.png +++ /dev/null diff --git a/indra/newview/skins/default/textures/image_edit_icon.tga b/indra/newview/skins/default/textures/image_edit_icon.tga Binary files differdeleted file mode 100644 index 8666f0bbe6..0000000000 --- a/indra/newview/skins/default/textures/image_edit_icon.tga +++ /dev/null diff --git a/indra/newview/skins/default/textures/inv_folder_animation.tga b/indra/newview/skins/default/textures/inv_folder_animation.tga Binary files differdeleted file mode 100644 index 1b4df7a2d8..0000000000 --- a/indra/newview/skins/default/textures/inv_folder_animation.tga +++ /dev/null diff --git a/indra/newview/skins/default/textures/inv_folder_inbox.tga b/indra/newview/skins/default/textures/inv_folder_inbox.tga Binary files differdeleted file mode 100644 index 04539c2cc4..0000000000 --- a/indra/newview/skins/default/textures/inv_folder_inbox.tga +++ /dev/null diff --git a/indra/newview/skins/default/textures/map_avatar_above_8.tga b/indra/newview/skins/default/textures/map_avatar_above_8.tga Binary files differdeleted file mode 100644 index 193428e530..0000000000 --- a/indra/newview/skins/default/textures/map_avatar_above_8.tga +++ /dev/null diff --git a/indra/newview/skins/default/textures/map_avatar_below_8.tga b/indra/newview/skins/default/textures/map_avatar_below_8.tga Binary files differdeleted file mode 100644 index 9e14bfab90..0000000000 --- a/indra/newview/skins/default/textures/map_avatar_below_8.tga +++ /dev/null diff --git a/indra/newview/skins/default/textures/map_event_adult.tga b/indra/newview/skins/default/textures/map_event_adult.tga Binary files differdeleted file mode 100644 index f548126e5a..0000000000 --- a/indra/newview/skins/default/textures/map_event_adult.tga +++ /dev/null diff --git a/indra/newview/skins/default/textures/map_event_mature.tga b/indra/newview/skins/default/textures/map_event_mature.tga Binary files differdeleted file mode 100644 index 71067c0dfd..0000000000 --- a/indra/newview/skins/default/textures/map_event_mature.tga +++ /dev/null diff --git a/indra/newview/skins/default/textures/map_track_8.tga b/indra/newview/skins/default/textures/map_track_8.tga Binary files differdeleted file mode 100644 index 53425ff45b..0000000000 --- a/indra/newview/skins/default/textures/map_track_8.tga +++ /dev/null diff --git a/indra/newview/skins/default/textures/model_wizard/divider_line.png b/indra/newview/skins/default/textures/model_wizard/divider_line.png Binary files differdeleted file mode 100644 index 76c9e68767..0000000000 --- a/indra/newview/skins/default/textures/model_wizard/divider_line.png +++ /dev/null diff --git a/indra/newview/skins/default/textures/mute_icon.tga b/indra/newview/skins/default/textures/mute_icon.tga Binary files differdeleted file mode 100644 index 879b9e6188..0000000000 --- a/indra/newview/skins/default/textures/mute_icon.tga +++ /dev/null diff --git a/indra/newview/skins/default/textures/navbar/Arrow_Left_Over.png b/indra/newview/skins/default/textures/navbar/Arrow_Left_Over.png Binary files differdeleted file mode 100644 index a91b74819f..0000000000 --- a/indra/newview/skins/default/textures/navbar/Arrow_Left_Over.png +++ /dev/null diff --git a/indra/newview/skins/default/textures/navbar/Arrow_Right_Over.png b/indra/newview/skins/default/textures/navbar/Arrow_Right_Over.png Binary files differdeleted file mode 100644 index a2caf227a7..0000000000 --- a/indra/newview/skins/default/textures/navbar/Arrow_Right_Over.png +++ /dev/null diff --git a/indra/newview/skins/default/textures/navbar/Help_Over.png b/indra/newview/skins/default/textures/navbar/Help_Over.png Binary files differdeleted file mode 100644 index b9bc0d0f87..0000000000 --- a/indra/newview/skins/default/textures/navbar/Help_Over.png +++ /dev/null diff --git a/indra/newview/skins/default/textures/navbar/Home_Over.png b/indra/newview/skins/default/textures/navbar/Home_Over.png Binary files differdeleted file mode 100644 index d9c6b3842e..0000000000 --- a/indra/newview/skins/default/textures/navbar/Home_Over.png +++ /dev/null diff --git a/indra/newview/skins/default/textures/places_rating_adult.tga b/indra/newview/skins/default/textures/places_rating_adult.tga Binary files differdeleted file mode 100644 index c344fb1e78..0000000000 --- a/indra/newview/skins/default/textures/places_rating_adult.tga +++ /dev/null diff --git a/indra/newview/skins/default/textures/places_rating_mature.tga b/indra/newview/skins/default/textures/places_rating_mature.tga Binary files differdeleted file mode 100644 index 61c879bc92..0000000000 --- a/indra/newview/skins/default/textures/places_rating_mature.tga +++ /dev/null diff --git a/indra/newview/skins/default/textures/places_rating_pg.tga b/indra/newview/skins/default/textures/places_rating_pg.tga Binary files differdeleted file mode 100644 index 7805dbce60..0000000000 --- a/indra/newview/skins/default/textures/places_rating_pg.tga +++ /dev/null diff --git a/indra/newview/skins/default/textures/propertyline.tga b/indra/newview/skins/default/textures/propertyline.tga Binary files differdeleted file mode 100644 index 0c504eea71..0000000000 --- a/indra/newview/skins/default/textures/propertyline.tga +++ /dev/null diff --git a/indra/newview/skins/default/textures/quick_tips/avatar_free_mode.png b/indra/newview/skins/default/textures/quick_tips/avatar_free_mode.png Binary files differdeleted file mode 100644 index be7c87efb6..0000000000 --- a/indra/newview/skins/default/textures/quick_tips/avatar_free_mode.png +++ /dev/null diff --git a/indra/newview/skins/default/textures/quick_tips/camera_free_mode.png b/indra/newview/skins/default/textures/quick_tips/camera_free_mode.png Binary files differdeleted file mode 100644 index 9a3f3703b2..0000000000 --- a/indra/newview/skins/default/textures/quick_tips/camera_free_mode.png +++ /dev/null diff --git a/indra/newview/skins/default/textures/quick_tips/camera_orbit_mode.png b/indra/newview/skins/default/textures/quick_tips/camera_orbit_mode.png Binary files differdeleted file mode 100644 index dd72cc0162..0000000000 --- a/indra/newview/skins/default/textures/quick_tips/camera_orbit_mode.png +++ /dev/null diff --git a/indra/newview/skins/default/textures/quick_tips/camera_pan_mode.png b/indra/newview/skins/default/textures/quick_tips/camera_pan_mode.png Binary files differdeleted file mode 100644 index b537dcbe46..0000000000 --- a/indra/newview/skins/default/textures/quick_tips/camera_pan_mode.png +++ /dev/null diff --git a/indra/newview/skins/default/textures/quick_tips/camera_preset_front_view.png b/indra/newview/skins/default/textures/quick_tips/camera_preset_front_view.png Binary files differdeleted file mode 100644 index 7674a75ac3..0000000000 --- a/indra/newview/skins/default/textures/quick_tips/camera_preset_front_view.png +++ /dev/null diff --git a/indra/newview/skins/default/textures/quick_tips/camera_preset_group_view.png b/indra/newview/skins/default/textures/quick_tips/camera_preset_group_view.png Binary files differdeleted file mode 100644 index 9c9b923a5a..0000000000 --- a/indra/newview/skins/default/textures/quick_tips/camera_preset_group_view.png +++ /dev/null diff --git a/indra/newview/skins/default/textures/quick_tips/camera_preset_rear_view.png b/indra/newview/skins/default/textures/quick_tips/camera_preset_rear_view.png Binary files differdeleted file mode 100644 index 15c3053491..0000000000 --- a/indra/newview/skins/default/textures/quick_tips/camera_preset_rear_view.png +++ /dev/null diff --git a/indra/newview/skins/default/textures/quick_tips/move_fly_first.png b/indra/newview/skins/default/textures/quick_tips/move_fly_first.png Binary files differdeleted file mode 100644 index b6e2ce60e4..0000000000 --- a/indra/newview/skins/default/textures/quick_tips/move_fly_first.png +++ /dev/null diff --git a/indra/newview/skins/default/textures/quick_tips/move_fly_second.png b/indra/newview/skins/default/textures/quick_tips/move_fly_second.png Binary files differdeleted file mode 100644 index 84b63cc338..0000000000 --- a/indra/newview/skins/default/textures/quick_tips/move_fly_second.png +++ /dev/null diff --git a/indra/newview/skins/default/textures/quick_tips/move_run_first.png b/indra/newview/skins/default/textures/quick_tips/move_run_first.png Binary files differdeleted file mode 100644 index 16093dc683..0000000000 --- a/indra/newview/skins/default/textures/quick_tips/move_run_first.png +++ /dev/null diff --git a/indra/newview/skins/default/textures/quick_tips/move_run_second.png b/indra/newview/skins/default/textures/quick_tips/move_run_second.png Binary files differdeleted file mode 100644 index 19fa43ec32..0000000000 --- a/indra/newview/skins/default/textures/quick_tips/move_run_second.png +++ /dev/null diff --git a/indra/newview/skins/default/textures/quick_tips/move_walk_first.png b/indra/newview/skins/default/textures/quick_tips/move_walk_first.png Binary files differdeleted file mode 100644 index 92d120d53e..0000000000 --- a/indra/newview/skins/default/textures/quick_tips/move_walk_first.png +++ /dev/null diff --git a/indra/newview/skins/default/textures/quick_tips/move_walk_second.png b/indra/newview/skins/default/textures/quick_tips/move_walk_second.png Binary files differdeleted file mode 100644 index f8e28722be..0000000000 --- a/indra/newview/skins/default/textures/quick_tips/move_walk_second.png +++ /dev/null diff --git a/indra/newview/skins/default/textures/show_btn.tga b/indra/newview/skins/default/textures/show_btn.tga Binary files differdeleted file mode 100644 index 5f05f377e3..0000000000 --- a/indra/newview/skins/default/textures/show_btn.tga +++ /dev/null diff --git a/indra/newview/skins/default/textures/show_btn_selected.tga b/indra/newview/skins/default/textures/show_btn_selected.tga Binary files differdeleted file mode 100644 index 00a2f34a37..0000000000 --- a/indra/newview/skins/default/textures/show_btn_selected.tga +++ /dev/null diff --git a/indra/newview/skins/default/textures/smicon_warn.tga b/indra/newview/skins/default/textures/smicon_warn.tga Binary files differdeleted file mode 100644 index 90ccaa07e5..0000000000 --- a/indra/newview/skins/default/textures/smicon_warn.tga +++ /dev/null diff --git a/indra/newview/skins/default/textures/snapshot_download.png b/indra/newview/skins/default/textures/snapshot_download.png Binary files differnew file mode 100644 index 0000000000..6aa1abded5 --- /dev/null +++ b/indra/newview/skins/default/textures/snapshot_download.png diff --git a/indra/newview/skins/default/textures/snapshot_email.png b/indra/newview/skins/default/textures/snapshot_email.png Binary files differnew file mode 100644 index 0000000000..dee784a9bf --- /dev/null +++ b/indra/newview/skins/default/textures/snapshot_email.png diff --git a/indra/newview/skins/default/textures/spacer35.tga b/indra/newview/skins/default/textures/spacer35.tga Binary files differdeleted file mode 100644 index b88bc6680a..0000000000 --- a/indra/newview/skins/default/textures/spacer35.tga +++ /dev/null diff --git a/indra/newview/skins/default/textures/square_btn_32x128.tga b/indra/newview/skins/default/textures/square_btn_32x128.tga Binary files differdeleted file mode 100644 index d7ce58dac3..0000000000 --- a/indra/newview/skins/default/textures/square_btn_32x128.tga +++ /dev/null diff --git a/indra/newview/skins/default/textures/square_btn_selected_32x128.tga b/indra/newview/skins/default/textures/square_btn_selected_32x128.tga Binary files differdeleted file mode 100644 index 59ca365aa4..0000000000 --- a/indra/newview/skins/default/textures/square_btn_selected_32x128.tga +++ /dev/null diff --git a/indra/newview/skins/default/textures/startup_logo.j2c b/indra/newview/skins/default/textures/startup_logo.j2c Binary files differdeleted file mode 100644 index d1b991f17f..0000000000 --- a/indra/newview/skins/default/textures/startup_logo.j2c +++ /dev/null diff --git a/indra/newview/skins/default/textures/status_busy.tga b/indra/newview/skins/default/textures/status_busy.tga Binary files differdeleted file mode 100644 index 7743d9c7bb..0000000000 --- a/indra/newview/skins/default/textures/status_busy.tga +++ /dev/null diff --git a/indra/newview/skins/default/textures/taskpanel/TabIcon_Appearance_Off.png b/indra/newview/skins/default/textures/taskpanel/TabIcon_Appearance_Off.png Binary files differdeleted file mode 100644 index 0b91abfb0d..0000000000 --- a/indra/newview/skins/default/textures/taskpanel/TabIcon_Appearance_Off.png +++ /dev/null diff --git a/indra/newview/skins/default/textures/taskpanel/TabIcon_Appearance_Selected.png b/indra/newview/skins/default/textures/taskpanel/TabIcon_Appearance_Selected.png Binary files differdeleted file mode 100644 index 33a47236a5..0000000000 --- a/indra/newview/skins/default/textures/taskpanel/TabIcon_Appearance_Selected.png +++ /dev/null diff --git a/indra/newview/skins/default/textures/taskpanel/TabIcon_Home_Off.png b/indra/newview/skins/default/textures/taskpanel/TabIcon_Home_Off.png Binary files differdeleted file mode 100644 index 421f5e1705..0000000000 --- a/indra/newview/skins/default/textures/taskpanel/TabIcon_Home_Off.png +++ /dev/null diff --git a/indra/newview/skins/default/textures/taskpanel/TabIcon_Me_Selected.png b/indra/newview/skins/default/textures/taskpanel/TabIcon_Me_Selected.png Binary files differdeleted file mode 100644 index 905d4c973e..0000000000 --- a/indra/newview/skins/default/textures/taskpanel/TabIcon_Me_Selected.png +++ /dev/null diff --git a/indra/newview/skins/default/textures/taskpanel/TabIcon_People_Selected.png b/indra/newview/skins/default/textures/taskpanel/TabIcon_People_Selected.png Binary files differdeleted file mode 100644 index 909f0d0a47..0000000000 --- a/indra/newview/skins/default/textures/taskpanel/TabIcon_People_Selected.png +++ /dev/null diff --git a/indra/newview/skins/default/textures/taskpanel/TabIcon_Places_Large.png b/indra/newview/skins/default/textures/taskpanel/TabIcon_Places_Large.png Binary files differdeleted file mode 100644 index cc505c4a30..0000000000 --- a/indra/newview/skins/default/textures/taskpanel/TabIcon_Places_Large.png +++ /dev/null diff --git a/indra/newview/skins/default/textures/taskpanel/TabIcon_Places_Selected.png b/indra/newview/skins/default/textures/taskpanel/TabIcon_Places_Selected.png Binary files differdeleted file mode 100644 index 8e0fb9661e..0000000000 --- a/indra/newview/skins/default/textures/taskpanel/TabIcon_Places_Selected.png +++ /dev/null diff --git a/indra/newview/skins/default/textures/taskpanel/TabIcon_Things_Selected.png b/indra/newview/skins/default/textures/taskpanel/TabIcon_Things_Selected.png Binary files differdeleted file mode 100644 index d4ac451c8e..0000000000 --- a/indra/newview/skins/default/textures/taskpanel/TabIcon_Things_Selected.png +++ /dev/null diff --git a/indra/newview/skins/default/textures/textures.xml b/indra/newview/skins/default/textures/textures.xml index bb91d32c6c..8702ebde2a 100644 --- a/indra/newview/skins/default/textures/textures.xml +++ b/indra/newview/skins/default/textures/textures.xml @@ -39,7 +39,7 @@ with the same filename but different name <texture name="Accordion_Over" file_name="containers/Accordion_Over.png" preload="false" /> <texture name="Accordion_Selected" file_name="containers/Accordion_Selected.png" preload="false" /> -<texture name="Activate_Checkmark" file_name="taskpanel/Activate_Checkmark.png" preload="false" /> + <texture name="Activate_Checkmark" file_name="taskpanel/Activate_Checkmark.png" preload="false" /> <texture name="AddItem_Disabled" file_name="icons/AddItem_Disabled.png" preload="false" /> <texture name="AddItem_Off" file_name="icons/AddItem_Off.png" preload="false" /> @@ -48,9 +48,6 @@ with the same filename but different name <texture name="Arrow_Left_Off" file_name="navbar/Arrow_Left_Off.png" preload="true" /> <texture name="Arrow_Right_Off" file_name="navbar/Arrow_Right_Off.png" preload="true" /> -<!-- ---> - <texture name="Arrow_Small_Up" file_name="widgets/Arrow_Small_Up.png" preload="true" /> <texture name="Arrow_Small_Left" file_name="widgets/Arrow_Small_Left.png" preload="true" /> <texture name="Arrow_Small_Right" file_name="widgets/Arrow_Small_Right.png" preload="true" /> @@ -157,7 +154,6 @@ with the same filename but different name <texture name="ComboButton_Disabled" file_name="widgets/ComboButton_Disabled.png" preload="true" scale.left="2" scale.top="19" scale.right="18" scale.bottom="2" /> <texture name="ComboButton_Selected" file_name="widgets/ComboButton_Selected.png" preload="true" scale.left="2" scale.top="19" scale.right="18" scale.bottom="2" /> <texture name="ComboButton_UpSelected" file_name="widgets/ComboButton_UpSelected.png" preload="true" scale.left="2" scale.top="19" scale.right="18" scale.bottom="2" /> - <texture name="ComboButton_Up_On_Selected" file_name="widgets/ComboButton_Up_On_Selected.png" preload="true" scale.left="2" scale.top="19" scale.right="18" scale.bottom="2" /> <texture name="ComboButton_On" file_name="widgets/ComboButton_On.png" preload="true" scale.left="2" scale.top="19" scale.right="18" scale.bottom="2" /> <texture name="ComboButton_Off" file_name="widgets/ComboButton_Off.png" preload="true" scale.left="2" scale.top="19" scale.right="18" scale.bottom="2" /> <texture name="ComboButton_UpOff" file_name="widgets/ComboButton_UpOff.png" preload="true" scale.left="2" scale.top="19" scale.right="18" scale.bottom="2" /> @@ -190,6 +186,10 @@ with the same filename but different name <texture name="Flag" file_name="navbar/Flag.png" preload="false" /> + <texture name="Flyout_Left" file_name="windows/Flyout_Left.png" preload="false" /> + <texture name="Flyout_Pointer" file_name="windows/Flyout_Pointer.png" preload="false" /> + <texture name="Flyout_Right" file_name="windows/Flyout_Right.png" preload="false" /> + <texture name="Folder_Arrow" file_name="folder_arrow.tga" preload="false" /> <texture name="ForSale_Badge" file_name="icons/ForSale_Badge.png" preload="false" /> <texture name="ForwardArrow_Off" file_name="icons/ForwardArrow_Off.png" preload="false" /> @@ -547,6 +547,10 @@ with the same filename but different name <texture name="Unknown_Icon" file_name="icons/unknown_icon.png" preload="true" /> <texture name="Snapshot_Off" file_name="bottomtray/Snapshot_Off.png" preload="true" scale.left="4" scale.top="19" scale.right="22" scale.bottom="4" /> + <texture name="Snapshot_Download" file_name="snapshot_download.png" preload="false" /> + <texture name="Snapshot_Email" file_name="snapshot_email.png" preload="false" /> + <texture name="Snapshot_Inventory" file_name="toolbar_icons/inventory.png" preload="false" /> + <texture name="Snapshot_Profile" file_name="toolbar_icons/profile.png" preload="false" /> <texture name="startup_logo" file_name="windows/startup_logo.png" preload="true" /> @@ -568,21 +572,13 @@ with the same filename but different name <texture name="Sync_Progress_5" file_name="icons/Sync_Progress_5.png" preload="true" /> <texture name="Sync_Progress_6" file_name="icons/Sync_Progress_6.png" preload="true" /> - <texture name="TabIcon_Appearance_Off" file_name="taskpanel/TabIcon_Appearance_Off.png" preload="false" /> - <texture name="TabIcon_Appearance_Selected" file_name="taskpanel/TabIcon_Appearance_Selected.png" preload="false" /> <texture name="TabIcon_Close_Off" file_name="taskpanel/TabIcon_Close_Off.png" preload="false" /> - <texture name="TabIcon_Home_Off" file_name="taskpanel/TabIcon_Home_Off.png" preload="false" /> <texture name="TabIcon_Home_Selected" file_name="taskpanel/TabIcon_Home_Selected.png" preload="false" /> <texture name="TabIcon_Me_Off" file_name="taskpanel/TabIcon_Me_Off.png" preload="false" /> - <texture name="TabIcon_Me_Selected" file_name="taskpanel/TabIcon_Me_Selected.png" preload="false" /> <texture name="TabIcon_Open_Off" file_name="taskpanel/TabIcon_Open_Off.png" preload="false" /> <texture name="TabIcon_People_Off" file_name="taskpanel/TabIcon_People_Off.png" preload="false" /> - <texture name="TabIcon_People_Selected" file_name="taskpanel/TabIcon_People_Selected.png" preload="false" /> - <texture name="TabIcon_Places_Large" file_name="taskpanel/TabIcon_Places_Large.png" preload="false" /> <texture name="TabIcon_Places_Off" file_name="taskpanel/TabIcon_Places_Off.png" preload="false" /> - <texture name="TabIcon_Places_Selected" file_name="taskpanel/TabIcon_Places_Selected.png" preload="false" /> <texture name="TabIcon_Things_Off" file_name="taskpanel/TabIcon_Things_Off.png" preload="false" /> - <texture name="TabIcon_Things_Selected" file_name="taskpanel/TabIcon_Things_Selected.png" preload="false" /> <texture name="TabTop_Right_Off" file_name="containers/TabTop_Right_Off.png" preload="false" scale.left="8" scale.top="8" scale.right="62" scale.bottom="9" /> <texture name="TabTop_Right_Selected" file_name="containers/TabTop_Right_Selected.png" preload="false" scale.left="8" scale.top="8" scale.right="62" scale.bottom="9" /> @@ -646,6 +642,12 @@ with the same filename but different name <texture name="VoicePTT_Lvl3" file_name="bottomtray/VoicePTT_Lvl3.png" preload="false" /> <texture name="VoicePTT_Off" file_name="bottomtray/VoicePTT_Off.png" preload="false" /> <texture name="VoicePTT_On" file_name="bottomtray/VoicePTT_On.png" preload="false" /> + + <texture name="VoicePTT_Lvl1_Dark" file_name="bottomtray/VoicePTT_Lvl1_Dark.png" preload="false" /> + <texture name="VoicePTT_Lvl2_Dark" file_name="bottomtray/VoicePTT_Lvl2_Dark.png" preload="false" /> + <texture name="VoicePTT_Lvl3_Dark" file_name="bottomtray/VoicePTT_Lvl3_Dark.png" preload="false" /> + <texture name="VoicePTT_Off_Dark" file_name="bottomtray/VoicePTT_Off_Dark.png" preload="false" /> + <texture name="VoicePTT_On_Dark" file_name="bottomtray/VoicePTT_On_Dark.png" preload="false" /> <texture name="Wearables_Divider" file_name="windows/Wearables_Divider.png" preload="false" /> @@ -678,9 +680,6 @@ with the same filename but different name <!--WARNING OLD ART BELOW *do not use*--> <texture name="icn_media_web.tga" preload="true" /> <texture name="icn_media_movie.tga" preload="true" /> - <texture name="icn_voice-localchat.tga" /> - <texture name="icn_voice-groupfocus.tga" /> - <texture name="icn_voice-pvtfocus.tga" /> <texture name="jump_left_out.tga" file_name="widgets/jump_left_out.png" /> <texture name="jump_left_in.tga" file_name="widgets/jump_left_in.png" /> @@ -714,7 +713,6 @@ with the same filename but different name <texture name="icon_avatar_offline.tga" /> <texture name="icon_avatar_online.tga" /> - <texture name="icon_day_cycle.tga" /> <texture name="icon_diurnal.tga" /> <texture name="icon_for_sale.tga" file_name="icons/Icon_For_Sale.png" /> <texture name="icon_top_pick.tga" /> @@ -731,7 +729,6 @@ with the same filename but different name <texture name="map_avatar_16.tga" /> <texture name="map_avatar_8.tga" /> <texture name="map_event.tga" /> - <texture name="map_event_mature.tga" /> <texture name="map_home.tga" /> <texture name="map_infohub.tga" /> <texture name="map_telehub.tga" /> diff --git a/indra/newview/skins/default/textures/widgets/Checkbox_On_Over.png b/indra/newview/skins/default/textures/widgets/Checkbox_On_Over.png Binary files differdeleted file mode 100644 index bc504d130e..0000000000 --- a/indra/newview/skins/default/textures/widgets/Checkbox_On_Over.png +++ /dev/null diff --git a/indra/newview/skins/default/textures/widgets/Checkbox_Over.png b/indra/newview/skins/default/textures/widgets/Checkbox_Over.png Binary files differdeleted file mode 100644 index 5a7162addf..0000000000 --- a/indra/newview/skins/default/textures/widgets/Checkbox_Over.png +++ /dev/null diff --git a/indra/newview/skins/default/textures/widgets/ComboButton_Up_On_Selected.png b/indra/newview/skins/default/textures/widgets/ComboButton_Up_On_Selected.png Binary files differdeleted file mode 100644 index fd1d11dd0b..0000000000 --- a/indra/newview/skins/default/textures/widgets/ComboButton_Up_On_Selected.png +++ /dev/null diff --git a/indra/newview/skins/default/textures/widgets/DisclosureArrow_Closed_Over.png b/indra/newview/skins/default/textures/widgets/DisclosureArrow_Closed_Over.png Binary files differdeleted file mode 100644 index 45bcb0464e..0000000000 --- a/indra/newview/skins/default/textures/widgets/DisclosureArrow_Closed_Over.png +++ /dev/null diff --git a/indra/newview/skins/default/textures/widgets/DisclosureArrow_Opened_Over.png b/indra/newview/skins/default/textures/widgets/DisclosureArrow_Opened_Over.png Binary files differdeleted file mode 100644 index dabbd85b34..0000000000 --- a/indra/newview/skins/default/textures/widgets/DisclosureArrow_Opened_Over.png +++ /dev/null diff --git a/indra/newview/skins/default/textures/widgets/PushButton_On_Over.png b/indra/newview/skins/default/textures/widgets/PushButton_On_Over.png Binary files differdeleted file mode 100644 index 064a4c4f7f..0000000000 --- a/indra/newview/skins/default/textures/widgets/PushButton_On_Over.png +++ /dev/null diff --git a/indra/newview/skins/default/textures/widgets/PushButton_Selected_Over.png b/indra/newview/skins/default/textures/widgets/PushButton_Selected_Over.png Binary files differdeleted file mode 100644 index 064a4c4f7f..0000000000 --- a/indra/newview/skins/default/textures/widgets/PushButton_Selected_Over.png +++ /dev/null diff --git a/indra/newview/skins/default/textures/widgets/RadioButton_On_Over.png b/indra/newview/skins/default/textures/widgets/RadioButton_On_Over.png Binary files differdeleted file mode 100644 index 3e7d803a28..0000000000 --- a/indra/newview/skins/default/textures/widgets/RadioButton_On_Over.png +++ /dev/null diff --git a/indra/newview/skins/default/textures/widgets/RadioButton_Over.png b/indra/newview/skins/default/textures/widgets/RadioButton_Over.png Binary files differdeleted file mode 100644 index a5c8cbe293..0000000000 --- a/indra/newview/skins/default/textures/widgets/RadioButton_Over.png +++ /dev/null diff --git a/indra/newview/skins/default/textures/widgets/ScrollArrow_Down_Over.png b/indra/newview/skins/default/textures/widgets/ScrollArrow_Down_Over.png Binary files differdeleted file mode 100644 index 605d159eaa..0000000000 --- a/indra/newview/skins/default/textures/widgets/ScrollArrow_Down_Over.png +++ /dev/null diff --git a/indra/newview/skins/default/textures/widgets/ScrollArrow_Left_Over.png b/indra/newview/skins/default/textures/widgets/ScrollArrow_Left_Over.png Binary files differdeleted file mode 100644 index c79547dffd..0000000000 --- a/indra/newview/skins/default/textures/widgets/ScrollArrow_Left_Over.png +++ /dev/null diff --git a/indra/newview/skins/default/textures/widgets/ScrollArrow_Right_Over.png b/indra/newview/skins/default/textures/widgets/ScrollArrow_Right_Over.png Binary files differdeleted file mode 100644 index e353542ad9..0000000000 --- a/indra/newview/skins/default/textures/widgets/ScrollArrow_Right_Over.png +++ /dev/null diff --git a/indra/newview/skins/default/textures/widgets/ScrollArrow_Up_Over.png b/indra/newview/skins/default/textures/widgets/ScrollArrow_Up_Over.png Binary files differdeleted file mode 100644 index dd2fceb716..0000000000 --- a/indra/newview/skins/default/textures/widgets/ScrollArrow_Up_Over.png +++ /dev/null diff --git a/indra/newview/skins/default/textures/widgets/ScrollThumb_Horiz_Over.png b/indra/newview/skins/default/textures/widgets/ScrollThumb_Horiz_Over.png Binary files differdeleted file mode 100644 index cf78ea3924..0000000000 --- a/indra/newview/skins/default/textures/widgets/ScrollThumb_Horiz_Over.png +++ /dev/null diff --git a/indra/newview/skins/default/textures/widgets/ScrollThumb_Vert_Over.png b/indra/newview/skins/default/textures/widgets/ScrollThumb_Vert_Over.png Binary files differdeleted file mode 100644 index 53587197da..0000000000 --- a/indra/newview/skins/default/textures/widgets/ScrollThumb_Vert_Over.png +++ /dev/null diff --git a/indra/newview/skins/default/textures/widgets/SegmentedBtn_Left_On.png b/indra/newview/skins/default/textures/widgets/SegmentedBtn_Left_On.png Binary files differdeleted file mode 100644 index 7afb9c99c3..0000000000 --- a/indra/newview/skins/default/textures/widgets/SegmentedBtn_Left_On.png +++ /dev/null diff --git a/indra/newview/skins/default/textures/widgets/SegmentedBtn_Left_On_Disabled.png b/indra/newview/skins/default/textures/widgets/SegmentedBtn_Left_On_Disabled.png Binary files differdeleted file mode 100644 index 77c4224539..0000000000 --- a/indra/newview/skins/default/textures/widgets/SegmentedBtn_Left_On_Disabled.png +++ /dev/null diff --git a/indra/newview/skins/default/textures/widgets/SegmentedBtn_Left_On_Over.png b/indra/newview/skins/default/textures/widgets/SegmentedBtn_Left_On_Over.png Binary files differdeleted file mode 100644 index 8b93dd551e..0000000000 --- a/indra/newview/skins/default/textures/widgets/SegmentedBtn_Left_On_Over.png +++ /dev/null diff --git a/indra/newview/skins/default/textures/widgets/SegmentedBtn_Left_On_Selected.png b/indra/newview/skins/default/textures/widgets/SegmentedBtn_Left_On_Selected.png Binary files differdeleted file mode 100644 index 3f207cbea2..0000000000 --- a/indra/newview/skins/default/textures/widgets/SegmentedBtn_Left_On_Selected.png +++ /dev/null diff --git a/indra/newview/skins/default/textures/widgets/SegmentedBtn_Middle_On.png b/indra/newview/skins/default/textures/widgets/SegmentedBtn_Middle_On.png Binary files differdeleted file mode 100644 index 220df9db25..0000000000 --- a/indra/newview/skins/default/textures/widgets/SegmentedBtn_Middle_On.png +++ /dev/null diff --git a/indra/newview/skins/default/textures/widgets/SegmentedBtn_Middle_On_Over.png b/indra/newview/skins/default/textures/widgets/SegmentedBtn_Middle_On_Over.png Binary files differdeleted file mode 100644 index 5bbcdcb0b4..0000000000 --- a/indra/newview/skins/default/textures/widgets/SegmentedBtn_Middle_On_Over.png +++ /dev/null diff --git a/indra/newview/skins/default/textures/widgets/SegmentedBtn_Middle_On_Press.png b/indra/newview/skins/default/textures/widgets/SegmentedBtn_Middle_On_Press.png Binary files differdeleted file mode 100644 index dde367f05e..0000000000 --- a/indra/newview/skins/default/textures/widgets/SegmentedBtn_Middle_On_Press.png +++ /dev/null diff --git a/indra/newview/skins/default/textures/widgets/SegmentedBtn_Middle_Over.png b/indra/newview/skins/default/textures/widgets/SegmentedBtn_Middle_Over.png Binary files differdeleted file mode 100644 index d4f30b9adb..0000000000 --- a/indra/newview/skins/default/textures/widgets/SegmentedBtn_Middle_Over.png +++ /dev/null diff --git a/indra/newview/skins/default/textures/widgets/SegmentedBtn_Middle_Selected_Over.png b/indra/newview/skins/default/textures/widgets/SegmentedBtn_Middle_Selected_Over.png Binary files differdeleted file mode 100644 index 5bbcdcb0b4..0000000000 --- a/indra/newview/skins/default/textures/widgets/SegmentedBtn_Middle_Selected_Over.png +++ /dev/null diff --git a/indra/newview/skins/default/textures/widgets/SegmentedBtn_Right_On.png b/indra/newview/skins/default/textures/widgets/SegmentedBtn_Right_On.png Binary files differdeleted file mode 100644 index 467c43fc90..0000000000 --- a/indra/newview/skins/default/textures/widgets/SegmentedBtn_Right_On.png +++ /dev/null diff --git a/indra/newview/skins/default/textures/widgets/SegmentedBtn_Right_On_Over.png b/indra/newview/skins/default/textures/widgets/SegmentedBtn_Right_On_Over.png Binary files differdeleted file mode 100644 index 2049736897..0000000000 --- a/indra/newview/skins/default/textures/widgets/SegmentedBtn_Right_On_Over.png +++ /dev/null diff --git a/indra/newview/skins/default/textures/widgets/SegmentedBtn_Right_Selected_Over.png b/indra/newview/skins/default/textures/widgets/SegmentedBtn_Right_Selected_Over.png Binary files differdeleted file mode 100644 index 2049736897..0000000000 --- a/indra/newview/skins/default/textures/widgets/SegmentedBtn_Right_Selected_Over.png +++ /dev/null diff --git a/indra/newview/skins/default/textures/widgets/SliderThumb_Over.png b/indra/newview/skins/default/textures/widgets/SliderThumb_Over.png Binary files differdeleted file mode 100644 index b6f900d3bd..0000000000 --- a/indra/newview/skins/default/textures/widgets/SliderThumb_Over.png +++ /dev/null diff --git a/indra/newview/skins/default/textures/widgets/Stepper_Down_Over.png b/indra/newview/skins/default/textures/widgets/Stepper_Down_Over.png Binary files differdeleted file mode 100644 index 01e0a2d9f1..0000000000 --- a/indra/newview/skins/default/textures/widgets/Stepper_Down_Over.png +++ /dev/null diff --git a/indra/newview/skins/default/textures/widgets/Stepper_Up_Over.png b/indra/newview/skins/default/textures/widgets/Stepper_Up_Over.png Binary files differdeleted file mode 100644 index 2ce84ea5be..0000000000 --- a/indra/newview/skins/default/textures/widgets/Stepper_Up_Over.png +++ /dev/null diff --git a/indra/newview/skins/default/textures/windows/Flyout.png b/indra/newview/skins/default/textures/windows/Flyout.png Binary files differdeleted file mode 100644 index 5596b194c9..0000000000 --- a/indra/newview/skins/default/textures/windows/Flyout.png +++ /dev/null diff --git a/indra/newview/skins/default/textures/windows/Flyout_Left.png b/indra/newview/skins/default/textures/windows/Flyout_Left.png Binary files differnew file mode 100644 index 0000000000..6ac9fe2efd --- /dev/null +++ b/indra/newview/skins/default/textures/windows/Flyout_Left.png diff --git a/indra/newview/skins/default/textures/windows/Flyout_Pointer_Up.png b/indra/newview/skins/default/textures/windows/Flyout_Pointer_Up.png Binary files differdeleted file mode 100644 index 361fab59e0..0000000000 --- a/indra/newview/skins/default/textures/windows/Flyout_Pointer_Up.png +++ /dev/null diff --git a/indra/newview/skins/default/textures/windows/Flyout_Right.png b/indra/newview/skins/default/textures/windows/Flyout_Right.png Binary files differnew file mode 100644 index 0000000000..aa1f0625aa --- /dev/null +++ b/indra/newview/skins/default/textures/windows/Flyout_Right.png diff --git a/indra/newview/skins/default/textures/windows/Icon_Gear_Over.png b/indra/newview/skins/default/textures/windows/Icon_Gear_Over.png Binary files differdeleted file mode 100644 index 67bd399358..0000000000 --- a/indra/newview/skins/default/textures/windows/Icon_Gear_Over.png +++ /dev/null diff --git a/indra/newview/skins/default/textures/windows/Icon_Undock_Press.png b/indra/newview/skins/default/textures/windows/Icon_Undock_Press.png Binary files differdeleted file mode 100644 index 3ab8c3666a..0000000000 --- a/indra/newview/skins/default/textures/windows/Icon_Undock_Press.png +++ /dev/null diff --git a/indra/newview/skins/default/xui/da/floater_about.xml b/indra/newview/skins/default/xui/da/floater_about.xml index 0ccaab73ba..fc8bc33096 100644 --- a/indra/newview/skins/default/xui/da/floater_about.xml +++ b/indra/newview/skins/default/xui/da/floater_about.xml @@ -10,7 +10,7 @@ <floater.string name="AboutPosition"> Du er ved [POSITION_0,number,1], [POSITION_1,number,1], [POSITION_2,number,1] i regionen [REGION] lokaliseret ved <nolink>[HOSTNAME]</nolink> ([HOSTIP]) [SERVER_VERSION] -[[SERVER_RELEASE_NOTES_URL] [ReleaseNotes]] +[SERVER_RELEASE_NOTES_URL] </floater.string> <floater.string name="AboutSystem"> CPU: [CPU] diff --git a/indra/newview/skins/default/xui/da/floater_buy_currency.xml b/indra/newview/skins/default/xui/da/floater_buy_currency.xml index ec47b2f445..3c0428b2b0 100644 --- a/indra/newview/skins/default/xui/da/floater_buy_currency.xml +++ b/indra/newview/skins/default/xui/da/floater_buy_currency.xml @@ -46,7 +46,7 @@ L$ [AMT] </text> <text name="currency_links"> - [http://www.secondlife.com/my/account/payment_method_management.php payment method] | [http://www.secondlife.com/my/account/currency.php currency] | [http://www.secondlife.com/my/account/exchange_rates.php exchange rate] + [http://www.secondlife.com/my/account/payment_method_management.php payment method] | [http://www.secondlife.com/my/account/currency.php currency] </text> <text name="exchange_rate_note"> Indtast beløbet for at se nyeste valutakurs. diff --git a/indra/newview/skins/default/xui/da/floater_camera.xml b/indra/newview/skins/default/xui/da/floater_camera.xml index 5b7ef6db54..b5d5e8bc08 100644 --- a/indra/newview/skins/default/xui/da/floater_camera.xml +++ b/indra/newview/skins/default/xui/da/floater_camera.xml @@ -9,15 +9,6 @@ <floater.string name="move_tooltip"> Flyt kamera op og ned, til venstre og højre </floater.string> - <floater.string name="camera_modes_title"> - Kamera valg - </floater.string> - <floater.string name="pan_mode_title"> - Kredsløb zoom panorering - </floater.string> - <floater.string name="presets_mode_title"> - Forvalg - </floater.string> <floater.string name="free_mode_title"> Se objekt </floater.string> diff --git a/indra/newview/skins/default/xui/da/floater_nearby_chat.xml b/indra/newview/skins/default/xui/da/floater_nearby_chat.xml index bd17224259..76bc40edac 100644 --- a/indra/newview/skins/default/xui/da/floater_nearby_chat.xml +++ b/indra/newview/skins/default/xui/da/floater_nearby_chat.xml @@ -1,4 +1,4 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <floater name="nearby_chat" title="CHAT NÆRVED"> - <check_box label="Oversæt chat (håndteret af Google)" name="translate_chat_checkbox"/> + <check_box label="Oversæt chat" name="translate_chat_checkbox"/> </floater> diff --git a/indra/newview/skins/default/xui/da/notifications.xml b/indra/newview/skins/default/xui/da/notifications.xml index 3ccdfc036a..cf6f1ccdd9 100644 --- a/indra/newview/skins/default/xui/da/notifications.xml +++ b/indra/newview/skins/default/xui/da/notifications.xml @@ -438,7 +438,7 @@ Tilbyd venskab til [NAME]? </form> </notification> <notification name="RemoveFromFriends"> - Ønsker du at fjerne [NAME] fra din venneliste? + Ønsker du at fjerne <nolink>[NAME]</nolink> fra din venneliste? </notification> <notification name="ConfirmItemDeleteHasLinks"> Mindst en af genstandene har lænkede genstande der peger på den. Hvis du sletter denne genstand, vil lænkninger ikke virke mere. Det anbefales kraftigt at fjerne lænkninger først. @@ -1023,10 +1023,10 @@ Henvis til dette fra en hjemmeside for at give andre nem adgang til denne lokati Erstattet manglende tøj/kropsdele med standard. </notification> <notification name="FriendOnline"> - [NAME] er logget på + <nolink>[NAME]</nolink> er logget på </notification> <notification name="FriendOffline"> - [NAME] er logget af + <nolink>[NAME]</nolink> er logget af </notification> <notification name="AddSelfFriend"> Selvom du nok er meget sød, kan du ikke tilføje dig selv som ven. @@ -1404,10 +1404,10 @@ Prøv igen om lidt. (Som udgangspunkt, vil du være i stand til at se den andens online status) </notification> <notification name="FriendshipAccepted"> - [NAME] accepterede dit tilbud om venskab. + <nolink>[NAME]</nolink> accepterede dit tilbud om venskab. </notification> <notification name="FriendshipDeclined"> - [NAME] afviste dit tilbud om venskab. + <nolink>[NAME]</nolink> afviste dit tilbud om venskab. </notification> <notification name="FriendshipAcceptedByMe"> Tilbud om venskab accepteret. diff --git a/indra/newview/skins/default/xui/da/panel_my_profile.xml b/indra/newview/skins/default/xui/da/panel_my_profile.xml deleted file mode 100644 index 94da58389f..0000000000 --- a/indra/newview/skins/default/xui/da/panel_my_profile.xml +++ /dev/null @@ -1,31 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes"?> -<panel label="Profil" name="panel_profile"> - <string name="no_partner_text" value="Ingen"/> - <string name="no_group_text" value="Ingen"/> - <string name="RegisterDateFormat"> - [REG_DATE] ([AGE]) - </string> - <string name="name_text_args"> - [NAME] - </string> - <string name="display_name_text_args"> - [DISPLAY_NAME] - </string> - <layout_stack name="layout"> - <layout_panel name="profile_stack"> - <scroll_container name="profile_scroll"> - <panel name="scroll_content_panel"> - <panel name="second_life_image_panel"> - <text name="display_name_descr_text"> - Brugernavn - </text> - <text name="name_descr_text"> - Visningsnavn - </text> - <button label="Profil" name="see_profile_btn" tool_tip="Se profil for denne avatar"/> - </panel> - </panel> - </scroll_container> - </layout_panel> - </layout_stack> -</panel> diff --git a/indra/newview/skins/default/xui/da/panel_notes.xml b/indra/newview/skins/default/xui/da/panel_notes.xml deleted file mode 100644 index 7d8097f6ff..0000000000 --- a/indra/newview/skins/default/xui/da/panel_notes.xml +++ /dev/null @@ -1,35 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes"?> -<panel label="Noter & Privatliv" name="panel_notes"> - <layout_stack name="layout"> - <layout_panel name="notes_stack"> - <scroll_container name="profile_scroll"> - <panel name="profile_scroll_panel"> - <text name="status_message" value="Min private noter:"/> - <text name="status_message2" value="Tillad denne person at:"/> - <check_box label="Se min online status" name="status_check"/> - <check_box label="Se mig på kortet" name="map_check"/> - <check_box label="Editére, slette og tage mine objekter" name="objects_check"/> - </panel> - </scroll_container> - </layout_panel> - <layout_panel name="notes_buttons_panel"> - <layout_stack name="bottom_bar_ls"> - <layout_panel name="add_friend_btn_lp"> - <button label="Tilføj ven" name="add_friend" tool_tip="Tilbyd venskab til beboer"/> - </layout_panel> - <layout_panel name="im_btn_lp"> - <button label="IM" name="im" tool_tip="Åben session med personlige beskeder"/> - </layout_panel> - <layout_panel name="call_btn_lp"> - <button label="Opkald" name="call" tool_tip="Opkald til denne beboer"/> - </layout_panel> - <layout_panel name="show_on_map_btn_lp"> - <button label="Kort" name="show_on_map_btn" tool_tip="Vis denne beboer på kortet"/> - </layout_panel> - <layout_panel name="teleport_btn_lp"> - <button label="Teleportér" name="teleport" tool_tip="Tilbyd teleport"/> - </layout_panel> - </layout_stack> - </layout_panel> - </layout_stack> -</panel> diff --git a/indra/newview/skins/default/xui/da/panel_preferences_chat.xml b/indra/newview/skins/default/xui/da/panel_preferences_chat.xml index f0f6242fff..890a3038ef 100644 --- a/indra/newview/skins/default/xui/da/panel_preferences_chat.xml +++ b/indra/newview/skins/default/xui/da/panel_preferences_chat.xml @@ -31,7 +31,7 @@ <spinner label="Tid før chatvisning forsvinder:" name="nearby_toasts_fadingtime"/> <check_box name="translate_chat_checkbox"/> <text name="translate_chb_label"> - Benyt maskinel oversættelse ved chat (håndteret af Google) + Benyt maskinel oversættelse ved chat </text> <text name="translate_language_text" width="110"> Oversæt chat til : diff --git a/indra/newview/skins/default/xui/da/panel_profile.xml b/indra/newview/skins/default/xui/da/panel_profile.xml deleted file mode 100644 index db85eb23a8..0000000000 --- a/indra/newview/skins/default/xui/da/panel_profile.xml +++ /dev/null @@ -1,59 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes"?> -<panel label="Profil" name="panel_profile"> - <string name="no_partner_text" value="Ingen"/> - <string name="no_group_text" value="Ingen"/> - <string name="RegisterDateFormat"> - [REG_DATE] ([AGE]) - </string> - <string name="name_text_args"> - [NAME] - </string> - <string name="display_name_text_args"> - [DISPLAY_NAME] - </string> - <layout_stack name="layout"> - <layout_panel name="profile_stack"> - <scroll_container name="profile_scroll"> - <panel name="profile_scroll_panel"> - <panel name="second_life_image_panel"> - <text name="title_sl_descr_text" value="[SECOND_LIFE]:"/> - </panel> - <panel name="first_life_image_panel"> - <text name="title_rw_descr_text" value="Real World:"/> - </panel> - <text name="title_member_text" value="Beboer siden:"/> - <text name="title_acc_status_text" value="Konto status:"/> - <text name="title_partner_text" value="Partner:"/> - <panel name="partner_data_panel"> - <text initial_value="(henter)" name="partner_text"/> - </panel> - <text name="title_groups_text" value="Grupper:"/> - </panel> - </scroll_container> - </layout_panel> - </layout_stack> - <layout_stack name="layout_verb_buttons"> - <layout_panel name="profile_buttons_panel"> - <layout_stack name="bottom_bar_ls"> - <layout_panel name="add_friend_btn_lp"> - <button label="Tilføj ven" name="add_friend" tool_tip="Tilbyd venskab til beboeren"/> - </layout_panel> - <layout_panel name="im_btn_lp"> - <button label="Personlig besked" name="im" tool_tip="Åben session med personlig besked"/> - </layout_panel> - <layout_panel name="call_btn_lp"> - <button label="Opkald" name="call" tool_tip="Opkald til denne beboer"/> - </layout_panel> - <layout_panel name="chat_btn_lp"> - <button label="Teleportér" name="teleport" tool_tip="Tilbyd teleport"/> - </layout_panel> - <layout_panel name="overflow_btn_lp"> - <menu_button label="▼" name="overflow_btn" tool_tip="Betal eller del beholdning med denne beboer"/> - </layout_panel> - </layout_stack> - </layout_panel> - <layout_panel name="profile_me_buttons_panel"> - <button label="Redigér profil" name="edit_profile_btn" tool_tip="Redigér din personlige information"/> - </layout_panel> - </layout_stack> -</panel> diff --git a/indra/newview/skins/default/xui/da/panel_profile_view.xml b/indra/newview/skins/default/xui/da/panel_profile_view.xml deleted file mode 100644 index e6e8ca4d10..0000000000 --- a/indra/newview/skins/default/xui/da/panel_profile_view.xml +++ /dev/null @@ -1,20 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes"?> -<panel name="panel_target_profile"> - <string name="status_online"> - Online - </string> - <string name="status_offline"> - Offline - </string> - <text name="display_name_label" value="Visningsnavn:"/> - <text name="solo_username_label" value="Brugernavn:"/> - <text name="status" value="Online"/> - <text name="user_name_small" value="Se på mig med dette enormt ekstremt super lange navn"/> - <button name="copy_to_clipboard" tool_tip="Kopiér til udskriftsholder"/> - <text name="user_label" value="Brugernavn:"/> - <tab_container name="tabs"> - <panel label="PROFIL" name="panel_profile"/> - <panel label="FAVORITTER" name="panel_picks"/> - <panel label="NOTER & PRIVATLIV" name="panel_notes"/> - </tab_container> -</panel> diff --git a/indra/newview/skins/default/xui/da/strings.xml b/indra/newview/skins/default/xui/da/strings.xml index 165d47c931..11d100eeff 100644 --- a/indra/newview/skins/default/xui/da/strings.xml +++ b/indra/newview/skins/default/xui/da/strings.xml @@ -560,6 +560,9 @@ Prøv venligst om lidt igen. <string name="mesh"> mesh </string> + <string name="AvatarEditingAppearance"> + (Redigering Udseende) + </string> <string name="AvatarAway"> Væk </string> diff --git a/indra/newview/skins/default/xui/da/teleport_strings.xml b/indra/newview/skins/default/xui/da/teleport_strings.xml index 071aab46f4..0d89fae986 100644 --- a/indra/newview/skins/default/xui/da/teleport_strings.xml +++ b/indra/newview/skins/default/xui/da/teleport_strings.xml @@ -20,6 +20,10 @@ Hvis du stadig ikke kan teleporte, prøv venligst at logge ud og ligge ind for a Beklager, systemet kunne ikke fuldføre teleport forbindelse. Prøv igen om lidt. </message> + <message name="NoHelpIslandTP"> + Du kan ikke teleportere tilbage til Welcome Island. +Gå til 'Welcome Island Puclic' for at prøve tutorial igen. + </message> <message name="noaccess_tport"> Beklager, du har ikke adgang til denne teleport destination. </message> diff --git a/indra/newview/skins/default/xui/de/floater_buy_currency.xml b/indra/newview/skins/default/xui/de/floater_buy_currency.xml index 38321b7906..e766b622f7 100644 --- a/indra/newview/skins/default/xui/de/floater_buy_currency.xml +++ b/indra/newview/skins/default/xui/de/floater_buy_currency.xml @@ -46,7 +46,7 @@ [AMT] L$ </text> <text name="currency_links"> - [http://www.secondlife.com/my/account/payment_method_management.php?lang=de-DE Zahlungsart] | [http://www.secondlife.com/my/account/currency.php?lang=de-DE Währung] | [http://www.secondlife.com/my/account/exchange_rates.php?lang=de-DE Umtauschrate] + [http://www.secondlife.com/my/account/payment_method_management.php?lang=de-DE Zahlungsart] | [http://www.secondlife.com/my/account/currency.php?lang=de-DE Währung] </text> <text name="exchange_rate_note"> Geben Sie den Betrag erneut ein, um die aktuellste Umtauschrate anzuzeigen. diff --git a/indra/newview/skins/default/xui/de/floater_camera.xml b/indra/newview/skins/default/xui/de/floater_camera.xml index bbf1c8af60..7e9ebdb643 100644 --- a/indra/newview/skins/default/xui/de/floater_camera.xml +++ b/indra/newview/skins/default/xui/de/floater_camera.xml @@ -9,15 +9,6 @@ <floater.string name="move_tooltip"> Kamera nach oben, unten, links und rechts bewegen </floater.string> - <floater.string name="camera_modes_title"> - Kameramodi - </floater.string> - <floater.string name="pan_mode_title"> - Kreisen - Zoomen - Schwenken - </floater.string> - <floater.string name="presets_mode_title"> - Ansichten - </floater.string> <floater.string name="free_mode_title"> Objekt ansehen </floater.string> diff --git a/indra/newview/skins/default/xui/de/floater_nearby_chat.xml b/indra/newview/skins/default/xui/de/floater_nearby_chat.xml index bbb4114200..2aabbb18f2 100644 --- a/indra/newview/skins/default/xui/de/floater_nearby_chat.xml +++ b/indra/newview/skins/default/xui/de/floater_nearby_chat.xml @@ -1,4 +1,4 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <floater name="nearby_chat" title="CHAT IN DER NÄHE"> - <check_box label="Chat übersetzen (Service von Google)" name="translate_chat_checkbox"/> + <check_box label="Chat übersetzen" name="translate_chat_checkbox"/> </floater> diff --git a/indra/newview/skins/default/xui/de/inspect_group.xml b/indra/newview/skins/default/xui/de/inspect_group.xml index d85ca7ce4d..60fa8ff0d8 100644 --- a/indra/newview/skins/default/xui/de/inspect_group.xml +++ b/indra/newview/skins/default/xui/de/inspect_group.xml @@ -26,7 +26,7 @@ Hoch solln sie leben! Elche forever! Und auch Mungos! <text name="group_cost"> Mitgliedschaft: 123 L$ </text> - <button label="Zusammen" name="join_btn"/> + <button label="Beitreten" name="join_btn"/> <button label="Verlassen" name="leave_btn"/> <button label="Profil anzeigen" name="view_profile_btn"/> </floater> diff --git a/indra/newview/skins/default/xui/de/notifications.xml b/indra/newview/skins/default/xui/de/notifications.xml index fc38608df5..72e7ec8eb4 100644 --- a/indra/newview/skins/default/xui/de/notifications.xml +++ b/indra/newview/skins/default/xui/de/notifications.xml @@ -992,7 +992,7 @@ Sie sind nicht berechtigt, Land für die aktive Gruppe zu kaufen. </form> </notification> <notification name="RemoveFromFriends"> - Möchten Sie [NAME] aus Ihrer Freundesliste entfernen? + Möchten Sie <nolink>[NAME]</nolink> aus Ihrer Freundesliste entfernen? <usetemplate name="okcancelbuttons" notext="Abbrechen" yestext="OK"/> </notification> <notification name="RemoveMultipleFromFriends"> @@ -2134,10 +2134,10 @@ Hierzu wird Ihr Webbrowser geöffnet. Betreff: [SUBJECT], Nachricht: [MESSAGE] </notification> <notification name="FriendOnline"> - [NAME] ist online + <nolink>[NAME]</nolink> ist online </notification> <notification name="FriendOffline"> - [NAME] ist offline + <nolink>[NAME]</nolink> ist offline </notification> <notification name="AddSelfFriend"> Obwohl Sie ein sehr netter Mensch sind, können Sie sich nicht selbst als Freund hinzufügen. @@ -2532,10 +2532,10 @@ Versuchen Sie es in einigen Minuten erneut. </form> </notification> <notification name="FriendshipAccepted"> - [NAME] hat Ihr Freundschaftsangebot akzeptiert. + <nolink>[NAME]</nolink> hat Ihr Freundschaftsangebot akzeptiert. </notification> <notification name="FriendshipDeclined"> - [NAME] hat Ihr Freundschaftsangebot abgelehnt. + <nolink>[NAME]</nolink> hat Ihr Freundschaftsangebot abgelehnt. </notification> <notification name="FriendshipAcceptedByMe"> Ihr Freundschaftsangebot wurde angeommen. diff --git a/indra/newview/skins/default/xui/de/panel_my_profile.xml b/indra/newview/skins/default/xui/de/panel_my_profile.xml deleted file mode 100644 index 89a4dfdaba..0000000000 --- a/indra/newview/skins/default/xui/de/panel_my_profile.xml +++ /dev/null @@ -1,42 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes"?> -<panel label="Profil" name="panel_profile"> - <string name="CaptionTextAcctInfo"> - [ACCTTYPE] -[PAYMENTINFO] [AGEVERIFICATION] - </string> - <string name="payment_update_link_url"> - http://www.secondlife.com/account/billing.php?lang=de-DE - </string> - <string name="partner_edit_link_url"> - http://www.secondlife.com/account/partners.php?lang=de - </string> - <string name="my_account_link_url" value="http://secondlife.com/my/account/index.php?lang=de-DE"/> - <string name="no_partner_text" value="Keiner"/> - <string name="no_group_text" value="Keiner"/> - <string name="RegisterDateFormat"> - [REG_DATE] ([AGE]) - </string> - <string name="name_text_args"> - [NAME] - </string> - <string name="display_name_text_args"> - [DISPLAY_NAME] - </string> - <layout_stack name="layout"> - <layout_panel name="profile_stack"> - <scroll_container name="profile_scroll"> - <panel name="scroll_content_panel"> - <panel name="second_life_image_panel"> - <text name="display_name_descr_text"> - Benutzername - </text> - <text name="name_descr_text"> - Anzeigename - </text> - <button label="Profil" name="see_profile_btn" tool_tip="Profil zu diesem Avatar anzeigen"/> - </panel> - </panel> - </scroll_container> - </layout_panel> - </layout_stack> -</panel> diff --git a/indra/newview/skins/default/xui/de/panel_nearby_chat.xml b/indra/newview/skins/default/xui/de/panel_nearby_chat.xml index c3ce42efa1..2068c39024 100644 --- a/indra/newview/skins/default/xui/de/panel_nearby_chat.xml +++ b/indra/newview/skins/default/xui/de/panel_nearby_chat.xml @@ -1,4 +1,4 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <panel name="nearby_chat"> - <check_box label="Chat übersetzen (von Google bereitgestellt)" name="translate_chat_checkbox"/> + <check_box label="Chat übersetzen" name="translate_chat_checkbox"/> </panel> diff --git a/indra/newview/skins/default/xui/de/panel_notes.xml b/indra/newview/skins/default/xui/de/panel_notes.xml deleted file mode 100644 index ef1961b63d..0000000000 --- a/indra/newview/skins/default/xui/de/panel_notes.xml +++ /dev/null @@ -1,35 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes"?> -<panel label="Notizen & Privatsphäre" name="panel_notes"> - <layout_stack name="layout"> - <layout_panel name="notes_stack"> - <scroll_container name="profile_scroll"> - <panel name="profile_scroll_panel"> - <text name="status_message" value="Meine Notizen:"/> - <text name="status_message2" value="Diese Person kann:"/> - <check_box label="meinen Online-Status sehen." name="status_check"/> - <check_box label="mich auf der Karte sehen." name="map_check"/> - <check_box label="meine Objekte bearbeiten, löschen oder nehmen." name="objects_check"/> - </panel> - </scroll_container> - </layout_panel> - <layout_panel name="notes_buttons_panel"> - <layout_stack name="bottom_bar_ls"> - <layout_panel name="add_friend_btn_lp"> - <button label="Freund hinzufügen" name="add_friend" tool_tip="Dem Einwohner die Freundschaft anbieten"/> - </layout_panel> - <layout_panel name="im_btn_lp"> - <button label="IM" name="im" tool_tip="Instant Messenger öffnen"/> - </layout_panel> - <layout_panel name="call_btn_lp"> - <button label="Anrufen" name="call" tool_tip="Diesen Einwohner anrufen"/> - </layout_panel> - <layout_panel name="show_on_map_btn_lp"> - <button label="Karte" name="show_on_map_btn" tool_tip="Einwohner auf Karte anzeigen"/> - </layout_panel> - <layout_panel name="teleport_btn_lp"> - <button label="Teleportieren" name="teleport" tool_tip="Teleport anbieten"/> - </layout_panel> - </layout_stack> - </layout_panel> - </layout_stack> -</panel> diff --git a/indra/newview/skins/default/xui/de/panel_preferences_chat.xml b/indra/newview/skins/default/xui/de/panel_preferences_chat.xml index 104f89b80c..04f6c27330 100644 --- a/indra/newview/skins/default/xui/de/panel_preferences_chat.xml +++ b/indra/newview/skins/default/xui/de/panel_preferences_chat.xml @@ -31,7 +31,7 @@ <spinner label="Ein-/Ausblenddauer von Toasts für Chat in der Nähe:" name="nearby_toasts_fadingtime"/> <check_box name="translate_chat_checkbox"/> <text name="translate_chb_label"> - Beim Chatten Maschinenübersetzung verwenden (von Google bereitgestellt) + Beim Chatten Maschinenübersetzung verwenden </text> <text name="translate_language_text"> Chat übersetzen in: diff --git a/indra/newview/skins/default/xui/de/panel_preferences_general.xml b/indra/newview/skins/default/xui/de/panel_preferences_general.xml index 5c8b8302c8..979ccba48d 100644 --- a/indra/newview/skins/default/xui/de/panel_preferences_general.xml +++ b/indra/newview/skins/default/xui/de/panel_preferences_general.xml @@ -16,7 +16,7 @@ <combo_box.item label="Русский (Russisch) – Beta" name="Russian"/> <combo_box.item label="Türkçe (Türkisch) – Beta" name="Turkish"/> <combo_box.item label="日本語 (Japanisch) - Beta" name="(Japanese)"/> - <combo_box.item label="正體 (Traditionelles Chinesisch) – Beta" name="Traditional Chinese"/> + <combo_box.item label="正體中文 (Traditionelles Chinesisch) – Beta" name="Traditional Chinese"/> </combo_box> <text name="language_textbox2"> (Erfordert Neustart) diff --git a/indra/newview/skins/default/xui/de/panel_profile.xml b/indra/newview/skins/default/xui/de/panel_profile.xml deleted file mode 100644 index b4c6e67108..0000000000 --- a/indra/newview/skins/default/xui/de/panel_profile.xml +++ /dev/null @@ -1,74 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes"?> -<panel label="Profil" name="panel_profile"> - <string name="CaptionTextAcctInfo"> - [ACCTTYPE] -[PAYMENTINFO] [AGEVERIFICATION] - </string> - <string name="payment_update_link_url"> - http://www.secondlife.com/account/billing.php?lang=de-DE - </string> - <string name="partner_edit_link_url"> - http://www.secondlife.com/account/partners.php?lang=de - </string> - <string name="my_account_link_url" value="http://secondlife.com/my/account/index.php?lang=de-DE"/> - <string name="no_partner_text" value="Keiner"/> - <string name="no_group_text" value="Keiner"/> - <string name="RegisterDateFormat"> - [REG_DATE] ([AGE]) - </string> - <string name="name_text_args"> - [NAME] - </string> - <string name="display_name_text_args"> - [DISPLAY_NAME] - </string> - <layout_stack name="layout"> - <layout_panel name="profile_stack"> - <scroll_container name="profile_scroll"> - <panel name="profile_scroll_panel"> - <panel name="second_life_image_panel"> - <text name="title_sl_descr_text" value="[SECOND_LIFE]:"/> - </panel> - <panel name="first_life_image_panel"> - <text name="title_rw_descr_text" value="Echtes Leben:"/> - </panel> - <text name="title_member_text" value="Einwohner seit:"/> - <text name="title_acc_status_text" value="Kontostatus:"/> - <text_editor name="acc_status_text"> - Einwohner. Keine Zahlungsinfo archiviert. - Linden. - </text_editor> - <text name="title_partner_text" value="Partner:"/> - <panel name="partner_data_panel"> - <text initial_value="(wird in Datenbank gesucht)" name="partner_text"/> - </panel> - <text name="title_groups_text" value="Gruppen:"/> - </panel> - </scroll_container> - </layout_panel> - </layout_stack> - <layout_stack name="layout_verb_buttons"> - <layout_panel name="profile_buttons_panel"> - <layout_stack name="bottom_bar_ls"> - <layout_panel name="add_friend_btn_lp"> - <button label="Freund hinzufügen" name="add_friend" tool_tip="Dem Einwohner die Freundschaft anbieten"/> - </layout_panel> - <layout_panel name="im_btn_lp"> - <button label="IM" name="im" tool_tip="Instant Messenger öffnen"/> - </layout_panel> - <layout_panel name="call_btn_lp"> - <button label="Anrufen" name="call" tool_tip="Diesen Einwohner anrufen"/> - </layout_panel> - <layout_panel name="chat_btn_lp"> - <button label="Teleportieren" name="teleport" tool_tip="Teleport anbieten"/> - </layout_panel> - <layout_panel name="overflow_btn_lp"> - <menu_button label="▼" name="overflow_btn" tool_tip="Dem Einwohner Geld geben oder Inventar an den Einwohner schicken"/> - </layout_panel> - </layout_stack> - </layout_panel> - <layout_panel name="profile_me_buttons_panel"> - <button label="Profil bearbeiten" name="edit_profile_btn" tool_tip="Ihre persönlichen Informationen bearbeiten"/> - </layout_panel> - </layout_stack> -</panel> diff --git a/indra/newview/skins/default/xui/de/panel_profile_view.xml b/indra/newview/skins/default/xui/de/panel_profile_view.xml deleted file mode 100644 index 7e93bd1ede..0000000000 --- a/indra/newview/skins/default/xui/de/panel_profile_view.xml +++ /dev/null @@ -1,20 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes"?> -<panel name="panel_target_profile"> - <string name="status_online"> - Online - </string> - <string name="status_offline"> - Offline - </string> - <text name="display_name_label" value="Anzeigename:"/> - <text name="solo_username_label" value="Benutzername:"/> - <text name="status" value="Online"/> - <text name="user_name_small" value="Dieser Name ist ein ganz außerordentlich langer Name"/> - <button name="copy_to_clipboard" tool_tip="In Zwischenablage kopieren"/> - <text name="user_label" value="Benutzername:"/> - <tab_container name="tabs" tab_min_width="60"> - <panel label="PROFIL" name="panel_profile"/> - <panel label="AUSWAHL" name="panel_picks"/> - <panel label="NOTIZEN & PRIVATSPHÄRE" name="panel_notes"/> - </tab_container> -</panel> diff --git a/indra/newview/skins/default/xui/de/teleport_strings.xml b/indra/newview/skins/default/xui/de/teleport_strings.xml index 69c952c532..bbfc830688 100644 --- a/indra/newview/skins/default/xui/de/teleport_strings.xml +++ b/indra/newview/skins/default/xui/de/teleport_strings.xml @@ -20,6 +20,10 @@ Wenn der Teleport dann immer noch nicht funktioniert, melden Sie sich bitte ab u Das System konnte keine Teleport-Verbindung herstellen. Versuchen Sie es später noch einmal. </message> + <message name="NoHelpIslandTP"> + Sie können nicht zurück nach Welcome Island teleportieren. +Gehen Sie zu „Welcome Island Public“ und wiederholen sie das Tutorial. + </message> <message name="noaccess_tport"> Sie haben leider keinen Zugang zu diesem Teleport-Ziel. </message> diff --git a/indra/newview/skins/default/xui/en/floater_about.xml b/indra/newview/skins/default/xui/en/floater_about.xml index 36af475824..c7e9ec781d 100644 --- a/indra/newview/skins/default/xui/en/floater_about.xml +++ b/indra/newview/skins/default/xui/en/floater_about.xml @@ -196,34 +196,36 @@ Dummy Name replaced at run time top="5" width="435" word_wrap="true"> -3Dconnexion SDK Copyright (C) 1992-2007 3Dconnexion -APR Copyright (C) 2000-2004 The Apache Software Foundation -Collada DOM Copyright 2005 Sony Computer Entertainment Inc. -cURL Copyright (C) 1996-2002, Daniel Stenberg, (daniel@haxx.se) -DBus/dbus-glib Copyright (C) 2002, 2003 CodeFactory AB / Copyright (C) 2003, 2004 Red Hat, Inc. -expat Copyright (C) 1998, 1999, 2000 Thai Open Source Software Center Ltd. -FreeType Copyright (C) 1996-2002, The FreeType Project (www.freetype.org). -GL Copyright (C) 1999-2004 Brian Paul. -GLOD Copyright (C) 2003-04 Jonathan Cohen, Nat Duca, Chris Niski, Johns Hopkins University and David Luebke, Brenden Schubert, University of Virginia. -google-perftools Copyright (c) 2005, Google Inc. -Havok.com(TM) Copyright (C) 1999-2001, Telekinesys Research Limited. -jpeg2000 Copyright (C) 2001, David Taubman, The University of New South Wales (UNSW) -jpeglib Copyright (C) 1991-1998, Thomas G. Lane. -ogg/vorbis Copyright (C) 2001, Xiphophorus -OpenSSL Copyright (C) 1998-2002 The OpenSSL Project. -PCRE Copyright (c) 1997-2008 University of Cambridge -SDL Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 Sam Lantinga -SSLeay Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) -xmlrpc-epi Copyright (C) 2000 Epinions, Inc. -zlib Copyright (C) 1995-2002 Jean-loup Gailly and Mark Adler. -google-perftools Copyright (c) 2005, Google Inc. + 3Dconnexion SDK Copyright (C) 1992-2007 3Dconnexion + APR Copyright (C) 2000-2004 The Apache Software Foundation + Collada DOM Copyright 2005 Sony Computer Entertainment Inc. + cURL Copyright (C) 1996-2002, Daniel Stenberg, (daniel@haxx.se) + DBus/dbus-glib Copyright (C) 2002, 2003 CodeFactory AB / Copyright (C) 2003, 2004 Red Hat, Inc. + expat Copyright (C) 1998, 1999, 2000 Thai Open Source Software Center Ltd. + FreeType Copyright (C) 1996-2002, The FreeType Project (www.freetype.org). + GL Copyright (C) 1999-2004 Brian Paul. + GLOD Copyright (C) 2003-04 Jonathan Cohen, Nat Duca, Chris Niski, Johns Hopkins University and David Luebke, Brenden Schubert, University of Virginia. + google-perftools Copyright (c) 2005, Google Inc. + Havok.com(TM) Copyright (C) 1999-2001, Telekinesys Research Limited. + jpeg2000 Copyright (C) 2001, David Taubman, The University of New South Wales (UNSW) + jpeglib Copyright (C) 1991-1998, Thomas G. Lane. + ogg/vorbis Copyright (C) 2001, Xiphophorus + OpenSSL Copyright (C) 1998-2002 The OpenSSL Project. + PCRE Copyright (c) 1997-2008 University of Cambridge + SDL Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 Sam Lantinga + SSLeay Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + xmlrpc-epi Copyright (C) 2000 Epinions, Inc. + zlib Copyright (C) 1995-2002 Jean-loup Gailly and Mark Adler. + google-perftools Copyright (c) 2005, Google Inc. -Second Life Viewer uses Havok (TM) Physics. (c)Copyright 1999-2010 Havok.com Inc. (and its Licensors). All Rights Reserved. See www.havok.com for details. + Second Life Viewer uses Havok (TM) Physics. (c)Copyright 1999-2010 Havok.com Inc. (and its Licensors). All Rights Reserved. See www.havok.com for details. -All rights reserved. See licenses.txt for details. + This software contains source code provided by NVIDIA Corporation. -Voice chat Audio coding: Polycom(R) Siren14(TM) (ITU-T Rec. G.722.1 Annex C) - </text_editor> + All rights reserved. See licenses.txt for details. + + Voice chat Audio coding: Polycom(R) Siren14(TM) (ITU-T Rec. G.722.1 Annex C) + </text_editor> </panel> </tab_container> </floater> diff --git a/indra/newview/skins/default/xui/en/floater_about_land.xml b/indra/newview/skins/default/xui/en/floater_about_land.xml index eaffbf5fa6..4772f744ea 100644 --- a/indra/newview/skins/default/xui/en/floater_about_land.xml +++ b/indra/newview/skins/default/xui/en/floater_about_land.xml @@ -487,7 +487,7 @@ name="DwellText" top_delta="0" width="186"> - 0 + Loading... </text> <button @@ -1208,7 +1208,7 @@ Only large parcels can be listed in search. </panel.string> <panel.string name="see_avs_text"> - See and chat with residents on this parcel + Avatars on other parcels can see </panel.string> <text type="string" @@ -1223,30 +1223,33 @@ Only large parcels can be listed in search. width="278"> Allow other Residents to: </text> - <check_box - height="16" - label="Edit Terrain" - layout="topleft" - left="14" - name="edit land check" - tool_tip="If checked, anyone can terraform your land. It is best to leave this unchecked, as you can always edit your own land." - top_pad="4" - width="147i" /> - <check_box + <text + type="string" + length="1" + follows="left|top" + height="16" + layout="topleft" + left="20" + name="allow_label0" + width="150"> + Fly: + </text> + + <check_box height="16" - label="Fly" + label="Everyone" layout="topleft" name="check fly" tool_tip="If checked, Residents can fly on your land. If unchecked, they can only fly into and over your land." - left_pad="4" - width="150" /> + left_pad="2" + width="130" /> <text type="string" length="1" follows="left|top" height="16" layout="topleft" - left="14" + left="20" name="allow_label2" width="150"> Build: @@ -1271,7 +1274,7 @@ Only large parcels can be listed in search. follows="left|top" height="16" layout="topleft" - left="14" + left="20" name="allow_label3" width="150"> Object Entry: @@ -1298,7 +1301,7 @@ Only large parcels can be listed in search. follows="left|top" height="16" layout="topleft" - left="14" + left="20" name="allow_label4" width="150"> Run Scripts: @@ -1319,49 +1322,47 @@ Only large parcels can be listed in search. name="check group scripts" top_delta="0" width="70" /> - <text - type="string" - text_color="white" - length="1" - follows="left|top" - height="16" - layout="topleft" - left="10" - name="land_options_label" - width="278"> - Land Options: - </text> - <check_box + <panel + bevel_style="none" + border="true" + top="146" + bottom="146" + follows="left|bottom|right" + left="20" + right="-20"/> + <check_box height="16" label="Safe (no damage)" layout="topleft" - left="14" + left="18" name="check safe" tool_tip="If checked, sets the land to Safe, disabling damage combat. If cleared, damage combat is enabled." - top_pad="5" + top="130" width="200" /> <check_box height="16" label="No Pushing" layout="topleft" - left_pad="5" + left_pad="35" name="PushRestrictCheck" tool_tip="Prevents scripts from pushing. Checking this option may be useful for preventing disruptive behavior on your land." - top_delta="0" + top="130" width="119" /> <check_box height="16" label="Show Place in Search (L$30/week)" layout="topleft" - left="14" + left="18" name="ShowDirectoryCheck" tool_tip="Let people see this parcel in search results" + top="150" width="430" /> <combo_box enabled="false" height="23" layout="topleft" - left="30" + left="20" + top="194" name="land category with adult" visible="false" width="140"> @@ -1426,7 +1427,8 @@ Only large parcels can be listed in search. enabled="false" height="23" layout="topleft" - left="30" + left="20" + top="194" name="land category" visible="false" width="140"> @@ -1487,11 +1489,11 @@ Only large parcels can be listed in search. height="16" label="Moderate Content" layout="topleft" - left="14" + left="18" name="MatureCheck" - top="177" + top="170" label_text.valign="center" - label_text.v_pad="-5" + label_text.v_pad="-1" tool_tip=" " width="200" /> <text @@ -1500,18 +1502,19 @@ Only large parcels can be listed in search. follows="left|top" height="16" layout="topleft" - left="10" + left="20" name="Snapshot:" text_color="white" - top="220" + top="225" width="200"> Snapshot: </text> <texture_picker follows="left|top" + top_pad="0" height="150" layout="topleft" - left="14" + left="20" name="snapshot_ctrl" fallback_image="default_land_picture.j2c" tool_tip="Click to choose a picture" @@ -1520,23 +1523,24 @@ Only large parcels can be listed in search. type="string" length="1" follows="left|top" - text_color="white" + text_color="LtGray" height="16" layout="topleft" - left="230" - top="174" + left="274" + top="166" name="allow_label5" width="278"> - Allow Residents on other parcels to: + and chat with avatars on this parcel </text> <check_box height="16" label="See Avatars" follows="top" layout="topleft" - left="230" + left="253" + top="150" name="SeeAvatarsCheck" - tool_tip="Allows residents on other parcels to see and chat with residents on this parcel, and you to see and chat with them." + tool_tip="Allows avatars on other parcels to see and chat with avatars on this parcel, and you to see and chat with them." width="120" /> <text type="string" @@ -1544,8 +1548,8 @@ Only large parcels can be listed in search. follows="left|top" height="16" layout="topleft" - left="230" - top="230" + left="255" + top="282" text_color="white" name="landing_point" word_wrap="true" @@ -1554,12 +1558,13 @@ Only large parcels can be listed in search. </text> <button follows="right|top" + top_pad="0" height="23" label="Set" label_selected="Set" layout="topleft" name="Set" - left="230" + left="255" tool_tip="Sets the landing point where visitors arrive. Sets to your avatar's location inside this parcel." width="50" /> <button @@ -1579,7 +1584,7 @@ Only large parcels can be listed in search. follows="left|top" height="16" layout="topleft" - left="230" + left="255" top_pad="10" name="Teleport Routing: " width="200"> @@ -1589,7 +1594,7 @@ Only large parcels can be listed in search. height="23" layout="topleft" name="landing type" - top_pad="3" + top_pad="0" tool_tip="Teleport Routing -- select how to handle teleports onto your land" width="120"> <combo_box.item diff --git a/indra/newview/skins/default/xui/en/floater_activeim.xml b/indra/newview/skins/default/xui/en/floater_activeim.xml index 670c528f08..b79c5d9a19 100644 --- a/indra/newview/skins/default/xui/en/floater_activeim.xml +++ b/indra/newview/skins/default/xui/en/floater_activeim.xml @@ -6,7 +6,6 @@ title="ACTIVE IM" height="22" width="320" - follows="right|bottom" background_visible="true" can_close="true" can_dock="true" diff --git a/indra/newview/skins/default/xui/en/floater_avatar.xml b/indra/newview/skins/default/xui/en/floater_avatar.xml index 2d973e7d90..82c3403008 100644 --- a/indra/newview/skins/default/xui/en/floater_avatar.xml +++ b/indra/newview/skins/default/xui/en/floater_avatar.xml @@ -15,12 +15,12 @@ help_topic="avatar" save_rect="true" save_visibility="true" - title="AVATAR PICKER" - width="635"> + title="CHOOSE AN AVATAR" + width="700"> <web_browser top="25" height="200" - width="635" + width="700" follows="all" name="avatar_picker_contents" trusted_content="true"/> diff --git a/indra/newview/skins/default/xui/en/floater_build_options.xml b/indra/newview/skins/default/xui/en/floater_build_options.xml index afb7917043..35918e9705 100644 --- a/indra/newview/skins/default/xui/en/floater_build_options.xml +++ b/indra/newview/skins/default/xui/en/floater_build_options.xml @@ -1,7 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <floater legacy_header_height="18" - follows="right" height="198" layout="topleft" name="build options floater" diff --git a/indra/newview/skins/default/xui/en/floater_buy_currency.xml b/indra/newview/skins/default/xui/en/floater_buy_currency.xml index 49ca6cc8ba..6afa24d04a 100644 --- a/indra/newview/skins/default/xui/en/floater_buy_currency.xml +++ b/indra/newview/skins/default/xui/en/floater_buy_currency.xml @@ -224,7 +224,7 @@ width="300" height="30" name="currency_links"> - [http://www.secondlife.com/my/account/payment_method_management.php payment method] | [http://www.secondlife.com/my/account/currency.php currency] | [http://www.secondlife.com/my/account/exchange_rates.php exchange rate] + [http://www.secondlife.com/my/account/payment_method_management.php payment method] | [http://www.secondlife.com/my/account/currency.php currency] </text> <text type="string" diff --git a/indra/newview/skins/default/xui/en/floater_buy_currency_html.xml b/indra/newview/skins/default/xui/en/floater_buy_currency_html.xml index b9c415633f..0637eedfb2 100644 --- a/indra/newview/skins/default/xui/en/floater_buy_currency_html.xml +++ b/indra/newview/skins/default/xui/en/floater_buy_currency_html.xml @@ -23,6 +23,5 @@ right="-1" top="1" bottom="-1" - ignore_ui_scale="false" name="browser"/> </floater> diff --git a/indra/newview/skins/default/xui/en/floater_camera.xml b/indra/newview/skins/default/xui/en/floater_camera.xml index e7f5207271..4673c6def5 100644 --- a/indra/newview/skins/default/xui/en/floater_camera.xml +++ b/indra/newview/skins/default/xui/en/floater_camera.xml @@ -1,19 +1,18 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <floater open_positioning="specified" - specified_left="320" + specified_left="458" specified_bottom="80" legacy_header_height="18" can_minimize="true" can_close="true" - follows="bottom" height="164" layout="topleft" name="camera_floater" help_topic="camera_floater" save_visibility="true" single_instance="true" - title="VIEW" + title="CAMERA CONTROLS" chrome="true" save_rect="true" width="228"> @@ -30,18 +29,6 @@ Move Camera Up and Down, Left and Right </floater.string> <floater.string - name="camera_modes_title"> - Camera modes - </floater.string> - <floater.string - name="pan_mode_title"> - Orbit Zoom Pan - </floater.string> - <floater.string - name="presets_mode_title"> - Preset Views - </floater.string> - <floater.string name="free_mode_title"> View Object </floater.string> diff --git a/indra/newview/skins/default/xui/en/floater_chat_bar.xml b/indra/newview/skins/default/xui/en/floater_chat_bar.xml index 989b4a0580..8d0cecdac3 100644 --- a/indra/newview/skins/default/xui/en/floater_chat_bar.xml +++ b/indra/newview/skins/default/xui/en/floater_chat_bar.xml @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <floater open_positioning="specified" - specified_left="320" + specified_left="10" specified_bottom="10" height="60" layout="topleft" @@ -15,61 +15,68 @@ min_height="60" min_width="150" can_resize="true" + default_tab_group="1" name="chat_bar" - width="380"> + width="300"> <panel top="20" class="panel_nearby_chat" follow="all" - width="380" + width="300" height="0" visible="false" filename="panel_nearby_chat.xml" name="nearby_chat" /> - <panel width="380" height="31" left="0" bottom="-1" follows="left|right|bottom"> - <line_editor - border_style="line" - border_thickness="1" - follows="left|right" - height="23" - label="Click here to chat." - layout="topleft" - left_delta="7" - left="0" - max_length_bytes="1023" - name="chat_box" - text_pad_left="5" - text_pad_right="25" - tool_tip="Press Enter to say, Ctrl+Enter to shout" - top="2" - width="335" /> - <output_monitor - auto_update="true" - follows="right" - draw_border="false" - height="16" - layout="topleft" - left_pad="-24" - mouse_opaque="true" - name="chat_zone_indicator" - top="6" - visible="true" - width="20" /> - <button - follows="right" - is_toggle="true" - width="20" - top="2" - layout="topleft" - left_pad="12" - image_disabled="ComboButton_UpOff" - image_unselected="ComboButton_UpOff" - image_selected="ComboButton_On" - image_pressed="ComboButton_UpSelected" - image_pressed_selected="ComboButton_Selected" - height="23" - name="show_nearby_chat" - tool_tip="Shows/hides nearby chat log"> - </button> + <panel width="300" + height="31" + left="0" + bottom="-1" + follows="left|right|bottom" + tab_group="1"> + <line_editor + border_style="line" + border_thickness="1" + follows="left|right" + height="23" + label="Click here to chat." + layout="topleft" + left_delta="7" + left="0" + max_length_bytes="1023" + name="chat_box" + text_pad_left="5" + text_pad_right="25" + tool_tip="Press Enter to say, Ctrl+Enter to shout" + top="2" + width="255" /> + <output_monitor + auto_update="true" + follows="right" + draw_border="false" + height="16" + layout="topleft" + left_pad="-24" + mouse_opaque="true" + name="chat_zone_indicator" + top="6" + visible="true" + width="20" /> + <button + follows="right" + is_toggle="true" + width="20" + top="2" + layout="topleft" + left_pad="12" + image_disabled="ComboButton_UpOff" + image_unselected="ComboButton_UpOff" + image_selected="ComboButton_On" + image_pressed="ComboButton_UpSelected" + image_pressed_selected="ComboButton_Selected" + height="23" + chrome="true" + name="show_nearby_chat" + tool_tip="Shows/hides nearby chat log"> + </button> </panel> </floater> diff --git a/indra/newview/skins/default/xui/en/floater_color_picker.xml b/indra/newview/skins/default/xui/en/floater_color_picker.xml index 421f3a72c6..e06d10606a 100644 --- a/indra/newview/skins/default/xui/en/floater_color_picker.xml +++ b/indra/newview/skins/default/xui/en/floater_color_picker.xml @@ -2,7 +2,6 @@ <floater legacy_header_height="18" can_minimize="false" - follows="left|top" height="380" layout="topleft" name="ColorPicker" diff --git a/indra/newview/skins/default/xui/en/floater_event.xml b/indra/newview/skins/default/xui/en/floater_event.xml index 7ed020f832..cf61b7d24d 100644 --- a/indra/newview/skins/default/xui/en/floater_event.xml +++ b/indra/newview/skins/default/xui/en/floater_event.xml @@ -1,6 +1,5 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <floater - follows="all" height="400" can_resize="true" help_topic="event_details" diff --git a/indra/newview/skins/default/xui/en/floater_gesture.xml b/indra/newview/skins/default/xui/en/floater_gesture.xml index a941734358..b96a94a849 100644 --- a/indra/newview/skins/default/xui/en/floater_gesture.xml +++ b/indra/newview/skins/default/xui/en/floater_gesture.xml @@ -9,7 +9,6 @@ help_topic="gestures" title="GESTURES" background_visible="true" - follows="all" label="Places" layout="topleft" min_height="350" diff --git a/indra/newview/skins/default/xui/en/floater_hardware_settings.xml b/indra/newview/skins/default/xui/en/floater_hardware_settings.xml index 05f4c52b95..66bb9d3cea 100644 --- a/indra/newview/skins/default/xui/en/floater_hardware_settings.xml +++ b/indra/newview/skins/default/xui/en/floater_hardware_settings.xml @@ -35,7 +35,7 @@ height="12" layout="topleft" left="10" - name="Antialiasing:" + name="antialiasing label" top_pad="7" width="188"> Antialiasing: diff --git a/indra/newview/skins/default/xui/en/floater_im_session.xml b/indra/newview/skins/default/xui/en/floater_im_session.xml index cb7d91abb8..5fe8f3c114 100644 --- a/indra/newview/skins/default/xui/en/floater_im_session.xml +++ b/indra/newview/skins/default/xui/en/floater_im_session.xml @@ -3,8 +3,8 @@ legacy_header_height="18" background_visible="true" default_tab_group="1" - follows="all" height="350" + help_topic="floater_im_box" layout="topleft" name="panel_im" can_dock="false" diff --git a/indra/newview/skins/default/xui/en/floater_live_lsleditor.xml b/indra/newview/skins/default/xui/en/floater_live_lsleditor.xml index 1f192f9b28..5cd7cd196d 100644 --- a/indra/newview/skins/default/xui/en/floater_live_lsleditor.xml +++ b/indra/newview/skins/default/xui/en/floater_live_lsleditor.xml @@ -4,7 +4,6 @@ bevel_style="none" border_style="line" can_resize="true" - follows="left|top" height="580" layout="topleft" min_height="271" diff --git a/indra/newview/skins/default/xui/en/floater_lsl_guide.xml b/indra/newview/skins/default/xui/en/floater_lsl_guide.xml index c9d87f158f..e9676777f4 100644 --- a/indra/newview/skins/default/xui/en/floater_lsl_guide.xml +++ b/indra/newview/skins/default/xui/en/floater_lsl_guide.xml @@ -2,7 +2,6 @@ <floater legacy_header_height="18" can_resize="true" - follows="left|top" height="400" layout="topleft" min_height="271" diff --git a/indra/newview/skins/default/xui/en/floater_map.xml b/indra/newview/skins/default/xui/en/floater_map.xml index 31972d4122..3eeebcf120 100644 --- a/indra/newview/skins/default/xui/en/floater_map.xml +++ b/indra/newview/skins/default/xui/en/floater_map.xml @@ -4,7 +4,6 @@ can_minimize="true" can_resize="true" chrome="true" - follows="top|right" height="200" layout="topleft" min_height="128" diff --git a/indra/newview/skins/default/xui/en/floater_mem_leaking.xml b/indra/newview/skins/default/xui/en/floater_mem_leaking.xml index 28a29c42aa..fb7d09a21e 100644 --- a/indra/newview/skins/default/xui/en/floater_mem_leaking.xml +++ b/indra/newview/skins/default/xui/en/floater_mem_leaking.xml @@ -2,7 +2,6 @@ <floater legacy_header_height="18" can_minimize="false" - follows="left|top" height="175" layout="topleft" name="MemLeak" diff --git a/indra/newview/skins/default/xui/en/floater_model_preview.xml b/indra/newview/skins/default/xui/en/floater_model_preview.xml index fbaf4f0a8a..eebc5ddc72 100644 --- a/indra/newview/skins/default/xui/en/floater_model_preview.xml +++ b/indra/newview/skins/default/xui/en/floater_model_preview.xml @@ -6,6 +6,7 @@ <string name="status_idle"></string> <string name="status_parse_error">Error: Dae parsing issue - see log for details.</string> + <string name="status_material_mismatch">Error: Material of model is not a subset of reference model.</string> <string name="status_reading_file">Loading...</string> <string name="status_generating_meshes">Generating Meshes...</string> <string name="status_vertex_number_overflow">Error: Vertex number is more than 65534, aborted!</string> @@ -789,7 +790,7 @@ <check_box name="physics_use_hull" follows="left|top" width="130" left_pad="5" height="20" label="Use Convex Hull"/> --> </panel> - <!-- ==== STEP 2: Analyse ==== --> + <!-- ==== STEP 2: Analyze ==== --> <view_border bevel_style="none" follows="top|left" @@ -818,7 +819,7 @@ name="method_label" text_color="White" top_pad="0"> - Step 2: Analyse + Step 2: Analyze </text> <text follows="top|left" diff --git a/indra/newview/skins/default/xui/en/floater_moveview.xml b/indra/newview/skins/default/xui/en/floater_moveview.xml index e96039a3e1..065dab0413 100644 --- a/indra/newview/skins/default/xui/en/floater_moveview.xml +++ b/indra/newview/skins/default/xui/en/floater_moveview.xml @@ -1,13 +1,12 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <floater open_positioning="specified" - specified_left="558" + specified_left="320" specified_bottom="80" legacy_header_height="18" can_dock="false" can_minimize="true" can_close="true" - follows="bottom" height="110" layout="topleft" name="move_floater" @@ -16,7 +15,7 @@ save_visibility="true" single_instance="true" chrome="true" - title="MOVE" + title="WALK / RUN / FLY" width="133"> <string name="walk_forward_tooltip"> diff --git a/indra/newview/skins/default/xui/en/floater_my_appearance.xml b/indra/newview/skins/default/xui/en/floater_my_appearance.xml index a40393aed8..1c4b25a7b0 100644 --- a/indra/newview/skins/default/xui/en/floater_my_appearance.xml +++ b/indra/newview/skins/default/xui/en/floater_my_appearance.xml @@ -12,7 +12,7 @@ single_instance="true" reuse_instance="true" title="APPEARANCE" - min_height="260" + min_height="440" min_width="333" width="333"> <panel diff --git a/indra/newview/skins/default/xui/en/floater_my_web_profile.xml b/indra/newview/skins/default/xui/en/floater_my_web_profile.xml new file mode 100644 index 0000000000..df46fc198f --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_my_web_profile.xml @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<floater name="floater_my_web_profile" + help_topic="web_profile" + width="780" + height="775" + save_rect="true" + single_instance="true" + reuse_instance="false" + filename="floater_web_content.xml"/>
\ No newline at end of file diff --git a/indra/newview/skins/default/xui/en/floater_outgoing_call.xml b/indra/newview/skins/default/xui/en/floater_outgoing_call.xml index 9db6568ee3..ffbb6aa28b 100644 --- a/indra/newview/skins/default/xui/en/floater_outgoing_call.xml +++ b/indra/newview/skins/default/xui/en/floater_outgoing_call.xml @@ -8,6 +8,7 @@ layout="topleft" name="outgoing call" help_topic="outgoing_call" + save_dock_state="true" title="CALLING" width="410"> <floater.string diff --git a/indra/newview/skins/default/xui/en/floater_people.xml b/indra/newview/skins/default/xui/en/floater_people.xml index 32dda1b694..d6d8431150 100644 --- a/indra/newview/skins/default/xui/en/floater_people.xml +++ b/indra/newview/skins/default/xui/en/floater_people.xml @@ -26,10 +26,6 @@ name="panel_people" filename="panel_people.xml"/> <panel - class="panel_profile_view" - name="panel_profile_view" - filename="panel_profile_view.xml"/> - <panel class="panel_group_info_sidetray" name="panel_group_info_sidetray" filename="panel_group_info_sidetray.xml" diff --git a/indra/newview/skins/default/xui/en/floater_places.xml b/indra/newview/skins/default/xui/en/floater_places.xml index 6484b54360..ccceac0a7b 100644 --- a/indra/newview/skins/default/xui/en/floater_places.xml +++ b/indra/newview/skins/default/xui/en/floater_places.xml @@ -11,7 +11,7 @@ save_rect="true" reuse_instance="true" title="PLACES" - min_height="230" + min_height="440" min_width="333" width="333"> <panel diff --git a/indra/newview/skins/default/xui/en/floater_preview_notecard.xml b/indra/newview/skins/default/xui/en/floater_preview_notecard.xml index f35628f8e5..be3b2d179d 100644 --- a/indra/newview/skins/default/xui/en/floater_preview_notecard.xml +++ b/indra/newview/skins/default/xui/en/floater_preview_notecard.xml @@ -3,7 +3,6 @@ legacy_header_height="18" can_resize="true" default_tab_group="1" - follows="left|top" height="361" layout="topleft" min_height="243" diff --git a/indra/newview/skins/default/xui/en/floater_preview_texture.xml b/indra/newview/skins/default/xui/en/floater_preview_texture.xml index 92d3a6702c..137e278ddc 100644 --- a/indra/newview/skins/default/xui/en/floater_preview_texture.xml +++ b/indra/newview/skins/default/xui/en/floater_preview_texture.xml @@ -2,7 +2,6 @@ <floater legacy_header_height="18" can_resize="true" - follows="left|top" height="350" layout="topleft" min_height="200" diff --git a/indra/newview/skins/default/xui/en/floater_script.xml b/indra/newview/skins/default/xui/en/floater_script.xml index 73e6d6147a..bd4edb81c8 100644 --- a/indra/newview/skins/default/xui/en/floater_script.xml +++ b/indra/newview/skins/default/xui/en/floater_script.xml @@ -2,7 +2,6 @@ <floater legacy_header_height="18" background_visible="true" - follows="left|top|right|bottom" height="250" layout="topleft" name="script_floater" diff --git a/indra/newview/skins/default/xui/en/floater_script_debug_panel.xml b/indra/newview/skins/default/xui/en/floater_script_debug_panel.xml index ce96ea232e..b5dd2f97b9 100644 --- a/indra/newview/skins/default/xui/en/floater_script_debug_panel.xml +++ b/indra/newview/skins/default/xui/en/floater_script_debug_panel.xml @@ -2,7 +2,6 @@ <floater legacy_header_height="18" can_resize="true" - follows="left|top|right|bottom" height="200" layout="topleft" name="script" diff --git a/indra/newview/skins/default/xui/en/floater_snapshot.xml b/indra/newview/skins/default/xui/en/floater_snapshot.xml index 91b4ed6954..0c38283d59 100644 --- a/indra/newview/skins/default/xui/en/floater_snapshot.xml +++ b/indra/newview/skins/default/xui/en/floater_snapshot.xml @@ -4,401 +4,370 @@ legacy_header_height="18" can_minimize="true" can_close="true" - follows="left|top" - height="520" + height="500" layout="topleft" name="Snapshot" help_topic="snapshot" save_rect="true" - save_visibility="true" + save_visibility="false" title="SNAPSHOT PREVIEW" - width="245"> + width="470"> <floater.string name="unknown"> unknown </floater.string> - <radio_group - height="70" - label="Snapshot type" - layout="topleft" - left="10" - name="snapshot_type_radio" - top="20" - width="205"> -<!-- - <radio_item - height="16" - label="Share to Web" - layout="topleft" - name="share_to_web" - top_pad="0" /> ---> - <radio_item - height="16" - label="Email" - layout="topleft" - name="postcard" - top_pad="2" /> - <radio_item - height="16" - label="My inventory (L$[AMOUNT])" - layout="topleft" - name="texture" - top_pad="2" /> - <radio_item - height="16" - label="Save to my computer" - layout="topleft" - name="local" - top_pad="2" /> - </radio_group> - <ui_ctrl - height="90" - width="125" - layout="topleft" - name="thumbnail_placeholder" - top_pad="6" - follows="left|top" - left="10" - /> - <text - type="string" - font="SansSerifSmall" - length="1" - follows="left|top" - height="14" - layout="topleft" - right="-5" - left_delta="0" - halign="right" - name="file_size_label" - top_pad="8" - width="195"> - [SIZE] KB - </text> - <button - follows="left|top" - height="22" - image_overlay="Refresh_Off" - layout="topleft" - left="10" - name="new_snapshot_btn" - width="23" /> - <button - follows="left|top" - height="23" - label="Send" - layout="topleft" - left_pad="5" - right="-5" - name="send_btn" - width="100" /> + <string + name="postcard_progress_str"> + Sending Email + </string> + <string + name="profile_progress_str"> + Posting + </string> + <string + name="inventory_progress_str"> + Saving to Inventory + </string> + <string + name="local_progress_str"> + Saving to Computer + </string> + <string + name="profile_succeeded_str"> + Image uploaded + </string> + <string + name="postcard_succeeded_str"> + Email Sent! + </string> + <string + name="inventory_succeeded_str"> + Saved to Inventory! + </string> + <string + name="local_succeeded_str"> + Saved to Computer! + </string> + <string + name="profile_failed_str"> + Failed to upload image to your Profile Feed. + </string> + <string + name="postcard_failed_str"> + Failed to send email. + </string> + <string + name="inventory_failed_str"> + Failed to save to inventory. + </string> + <string + name="local_failed_str"> + Failed to save to computer. + </string> <button follows="left|top" height="23" - label="Save (L$[AMOUNT])" + image_overlay="TabIcon_Close_Off" layout="topleft" - right="-5" - name="upload_btn" - top_delta="0" - width="110" /> - <flyout_button - follows="left|top" - height="23" - label="Save" - layout="topleft" - right="-5" - name="save_btn" - tool_tip="Save image to a file" - top_delta="0" - width="100"> - <flyout_button.item - label="Save" - name="save_item" - value="save" /> - <flyout_button.item - label="Save As..." - name="saveas_item" - value="save as" /> - </flyout_button> - <button - follows="left|top" - height="23" - label="More" - layout="topleft" - left="10" - name="more_btn" + left="236" + name="advanced_options_btn" tool_tip="Advanced options" - width="80" /> - <button - follows="left|top" - height="23" - label="Less" - layout="topleft" - left_delta="0" - name="less_btn" - tool_tip="Advanced options" - top_delta="0" - width="80" /> - <button - follows="left|top" - height="23" - label="Cancel" - layout="topleft" - right="-5" - left_pad="5" - name="discard_btn" - width="110" /> - <text - type="string" - length="1" - follows="top|left" - height="12" - layout="topleft" - left="10" - name="type_label2" - top_pad="5" - width="127"> - Size - </text> - <text - type="string" - length="1" - follows="top|left" - height="12" - layout="topleft" - left_pad="5" - name="format_label" - top_delta="0" - width="70"> - Format - </text> - <combo_box - height="23" - label="Resolution" - layout="topleft" - left="10" - name="postcard_size_combo" - width="120"> - <combo_box.item - label="Current Window" - name="CurrentWindow" - value="[i0,i0]" /> - <combo_box.item - label="640x480" - name="640x480" - value="[i640,i480]" /> - <combo_box.item - label="800x600" - name="800x600" - value="[i800,i600]" /> - <combo_box.item - label="1024x768" - name="1024x768" - value="[i1024,i768]" /> - <combo_box.item - label="Custom" - name="Custom" - value="[i-1,i-1]" /> - </combo_box> - <combo_box - height="23" - label="Resolution" - layout="topleft" - left_delta="0" - name="texture_size_combo" - top_delta="0" - width="127"> - <combo_box.item - label="Current Window" - name="CurrentWindow" - value="[i0,i0]" /> - <combo_box.item - label="Small (128x128)" - name="Small(128x128)" - value="[i128,i128]" /> - <combo_box.item - label="Medium (256x256)" - name="Medium(256x256)" - value="[i256,i256]" /> - <combo_box.item - label="Large (512x512)" - name="Large(512x512)" - value="[i512,i512]" /> - <combo_box.item - label="Custom" - name="Custom" - value="[i-1,i-1]" /> - </combo_box> - <combo_box - height="23" - label="Resolution" - layout="topleft" - left_delta="0" - name="local_size_combo" - top_delta="0" - width="127"> - <combo_box.item - label="Current Window" - name="CurrentWindow" - value="[i0,i0]" /> - <combo_box.item - label="320x240" - name="320x240" - value="[i320,i240]" /> - <combo_box.item - label="640x480" - name="640x480" - value="[i640,i480]" /> - <combo_box.item - label="800x600" - name="800x600" - value="[i800,i600]" /> - <combo_box.item - label="1024x768" - name="1024x768" - value="[i1024,i768]" /> - <combo_box.item - label="1280x1024" - name="1280x1024" - value="[i1280,i1024]" /> - <combo_box.item - label="1600x1200" - name="1600x1200" - value="[i1600,i1200]" /> - <combo_box.item - label="Custom" - name="Custom" - value="[i-1,i-1]" /> - </combo_box> - <combo_box - height="23" - label="Format" - layout="topleft" - left_pad="5" - name="local_format_combo" - width="70"> - <combo_box.item - label="PNG" - name="PNG" /> - <combo_box.item - label="JPEG" - name="JPEG" /> - <combo_box.item - label="BMP" - name="BMP" /> - </combo_box> - <spinner - allow_text_entry="false" - decimal_digits="0" - follows="left|top" - height="20" - increment="32" - label="Width" - label_width="40" - layout="topleft" - left="10" - max_val="6016" - min_val="32" - name="snapshot_width" - top_pad="10" - width="95" /> - <spinner - allow_text_entry="false" - decimal_digits="0" - follows="left|top" - height="20" - increment="32" - label="Height" - label_width="40" - layout="topleft" - left_pad="5" - max_val="6016" - min_val="32" - name="snapshot_height" - top_delta="0" - width="95" /> - <check_box - bottom_delta="20" - label="Constrain proportions" - layout="topleft" - left="10" - name="keep_aspect_check" /> - <slider - decimal_digits="0" - follows="left|top" - height="15" - increment="1" - initial_value="75" - label="Image quality" - label_width="124" - layout="topleft" - left_delta="0" - max_val="100" - name="image_quality_slider" - top_pad="5" - width="228" /> - <text - type="string" - length="1" + top="25" + width="23" /> + <ui_ctrl + height="160" + width="250" + layout="topleft" + name="thumbnail_placeholder" + top="50" + follows="left|top" + left="10"> + <panel + background_visible="true" + bg_alpha_color="0.9 1 0.9 1" + follows="left|top" + font="SansSerifLarge" + halign="center" + height="20" + layout="topleft" + left="0" + length="1" + name="succeeded_panel" + right="-1" + top="0" + type="string" + visible="false"> + <text + follows="all" + font="SansSerif" + halign="center" + height="18" + layout="topleft" + left="1" + length="1" + name="succeeded_lbl" + right="-1" + text_color="0.2 0.5 0.2 1" + top="4" + translate="false" + type="string"> + Succeeded + </text> + </panel> + <panel + background_visible="true" + bg_alpha_color="1 0.9 0.9 1" + follows="left|top" + font="SansSerifLarge" + halign="center" + height="20" + layout="topleft" + left_delta="0" + length="1" + name="failed_panel" + right="-1" + top="0" + type="string" + visible="false"> + <text + follows="all" + font="SansSerif" + halign="center" + height="18" + layout="topleft" + left="1" + length="1" + name="failed_lbl" + right="-1" + text_color="0.5 0.2 0.2 1" + top="4" + translate="false" + type="string"> + Failed + </text> + </panel> + <loading_indicator + follows="left|top" + height="48" + layout="topleft" + name="working_indicator" + left="101" + top="46" + visible="false" + width="48" /> + <text + follows="left|top|right" + font="SansSerifBold" + height="14" + layout="topleft" + left="5" + length="1" + halign="center" + name="working_lbl" + right="-5" + top="98" + translate="false" + type="string" + visible="false" + width="130"> + Working + </text> + <button + follows="left|top" + height="22" + image_overlay="Refresh_Off" + layout="topleft" + left="20" + name="new_snapshot_btn" + bottom="-20" + visible="false" + width="22" /> + <text + follows="left|top" + font="SansSerifBold" + halign="left" + height="18" + layout="topleft" + left_pad="10" + length="1" + name="refresh_lbl" + right="-5" + text_color="red" + top_delta="0" + translate="false" + type="string" + visible="false" + width="130"> + Refresh to save. + </text> + </ui_ctrl> + <view_border + bevel_style="in" + height="21" + width="250" + layout="topleft" + name="img_info_border" + top_pad="3" + follows="left|top" + left_delta="0" + /> + <text + type="string" + font="SansSerifSmall" + length="1" + follows="left|top" + height="14" + layout="topleft" + left_delta="5" + halign="left" + name="image_res_text" + top_delta="5" + width="100"> + [WIDTH] x [HEIGHT] px + </text> + <text + follows="left|top" + font="SansSerifSmall" + height="14" + layout="topleft" + left="200" + length="1" + halign="right" + name="file_size_label" + top_delta="0" + type="string" + width="50"> + [SIZE] KB + </text> + <panel_container follows="left|top" - height="13" - layout="topleft" - left="10" - name="layer_type_label" - top_pad="5" - width="50"> - Capture: - </text> - <combo_box - height="23" - label="Image Layers" + height="260" layout="topleft" - left="30" - name="layer_types" - width="145"> - <combo_box.item - label="Colors" - name="Colors" - value="colors" /> - <combo_box.item - label="Depth" - name="Depth" - value="depth" /> - </combo_box> - <check_box - label="Interface" - layout="topleft" - left="30" - top_pad="10" - width="180" - name="ui_check" /> - <check_box - label="HUDs" - layout="topleft" - left="30" + left="0" + name="panel_container" + default_panel_name="panel_snapshot_options" top_pad="10" - width="180" - name="hud_check" /> - <check_box - label="Keep open after saving" - layout="topleft" - left="10" - top_pad="8" - width="180" - name="keep_open_check" /> - <check_box - label="Freeze frame (fullscreen)" - layout="topleft" - left="10" - top_pad="8" - width="180" - name="freeze_frame_check" /> - <check_box - label="Auto-refresh" + width="270"> + <panel + class="llpanelsnapshotoptions" + filename="panel_snapshot_options.xml" + follows="all" + layout="topleft" + left="0" + name="panel_snapshot_options" + top="0" /> + <panel + class="llpanelsnapshotprofile" + follows="all" + layout="topleft" + name="panel_snapshot_profile" + filename="panel_snapshot_profile.xml" /> + <panel + class="llpanelsnapshotpostcard" + follows="all" + layout="topleft" + name="panel_snapshot_postcard" + filename="panel_snapshot_postcard.xml" /> + <panel + class="llpanelsnapshotinventory" + follows="all" + layout="topleft" + name="panel_snapshot_inventory" + filename="panel_snapshot_inventory.xml" /> + <panel + class="llpanelsnapshotlocal" + follows="all" + layout="topleft" + name="panel_snapshot_local" + filename="panel_snapshot_local.xml" /> + </panel_container> + <panel + height="295" layout="topleft" - left="10" - top_pad="8" - width="180" - name="auto_snapshot_check" /> + left="270" + name="advanced_options_panel" + top="20" + width="200"> + <text + type="string" + font="SansSerifSmall" + length="1" + follows="left|top" + height="14" + layout="topleft" + left="10" + halign="left" + name="advanced_options_label" + right="-10" + top="10"> + ADVANCED OPTIONS + </text> + <view_border + bevel_style="in" + follows="left|top|right" + height="1" + left="10" + layout="topleft" + name="advanced_options_hr" + right="-10" + top_pad="5" + /> + <text + type="string" + length="1" + follows="left|top" + height="13" + layout="topleft" + left="10" + name="layer_type_label" + top_pad="10" + width="50"> + Capture: + </text> + <combo_box + follows="left|top|right" + height="23" + label="Image Layers" + layout="topleft" + left="30" + name="layer_types" + right="-10"> + <combo_box.item + label="Colors" + name="Colors" + value="colors" /> + <combo_box.item + label="Depth" + name="Depth" + value="depth" /> + </combo_box> + <check_box + label="Interface" + layout="topleft" + left="30" + top_pad="10" + width="180" + name="ui_check" /> + <check_box + label="HUDs" + layout="topleft" + left="30" + top_pad="10" + width="180" + name="hud_check" /> + <check_box + label="Freeze frame (fullscreen)" + layout="topleft" + left="10" + top_pad="8" + width="180" + name="freeze_frame_check" /> + <check_box + label="Auto-refresh" + layout="topleft" + left="10" + top_pad="8" + width="180" + name="auto_snapshot_check" /> + </panel> </floater> diff --git a/indra/newview/skins/default/xui/en/floater_stats.xml b/indra/newview/skins/default/xui/en/floater_stats.xml index 406114294d..2fd932786b 100644 --- a/indra/newview/skins/default/xui/en/floater_stats.xml +++ b/indra/newview/skins/default/xui/en/floater_stats.xml @@ -2,7 +2,6 @@ <floater legacy_header_height="18" can_resize="true" - follows="top|right" height="400" layout="topleft" name="Statistics" diff --git a/indra/newview/skins/default/xui/en/floater_sys_well.xml b/indra/newview/skins/default/xui/en/floater_sys_well.xml index 9b96a5badc..ecedb27438 100644 --- a/indra/newview/skins/default/xui/en/floater_sys_well.xml +++ b/indra/newview/skins/default/xui/en/floater_sys_well.xml @@ -2,7 +2,6 @@ <floater legacy_header_height="18" bevel_style="in" - follows="right|bottom" layout="topleft" name="sys_well_window" help_topic="notification_chiclet" diff --git a/indra/newview/skins/default/xui/en/floater_tools.xml b/indra/newview/skins/default/xui/en/floater_tools.xml index 1808cab2a5..f9147ea650 100644 --- a/indra/newview/skins/default/xui/en/floater_tools.xml +++ b/indra/newview/skins/default/xui/en/floater_tools.xml @@ -2,7 +2,6 @@ <floater open_positioning="cascading" legacy_header_height="18" - follows="left|top|right" height="580" layout="topleft" bg_opaque_image="Window_NoTitle_Foreground" @@ -791,6 +790,7 @@ tab_min_width="40" tab_position="top" tab_height="25" + open_tabs_on_drag_and_drop="true" top="173" width="295"> diff --git a/indra/newview/skins/default/xui/en/floater_toybox.xml b/indra/newview/skins/default/xui/en/floater_toybox.xml index c7e09bf45e..493d44a9cf 100644 --- a/indra/newview/skins/default/xui/en/floater_toybox.xml +++ b/indra/newview/skins/default/xui/en/floater_toybox.xml @@ -5,7 +5,7 @@ can_minimize="false" can_resize="false" default_tab_group="1" - height="460" + height="330" help_topic="toybox" layout="topleft" legacy_header_height="18" @@ -13,7 +13,7 @@ open_positioning="centered" save_rect="true" single_instance="true" - title="CUSTOMIZE TOOLBARS" + title="TOOLBAR BUTTONS" width="650"> <text follows="left|top" @@ -46,7 +46,7 @@ Buttons will appear as shown or as icon-only depending on each toolbar's settings. </text> <toolbar - bottom="395" + bottom="265" button_display_mode="icons_with_text" follows="all" left="20" @@ -82,20 +82,32 @@ <panel bevel_style="none" border="true" - bottom="396" + bottom="266" follows="left|bottom|right" left="20" right="-20" - top="396" /> + top="266" /> + <button + follows="left|bottom|right" + height="23" + label="Clear all toolbars" + label_selected="Clear all toolbars" + layout="topleft" + left="185" + name="btn_clear_all" + top="285" + width="130"> + <button.commit_callback function="Toybox.ClearAll" /> + </button> <button follows="left|bottom|right" height="23" label="Restore defaults" label_selected="Restore defaults" layout="topleft" - left="260" + left="335" name="btn_restore_defaults" - top="415" + top="285" width="130"> <button.commit_callback function="Toybox.RestoreDefaults" /> </button> diff --git a/indra/newview/skins/default/xui/en/floater_translation_settings.xml b/indra/newview/skins/default/xui/en/floater_translation_settings.xml new file mode 100644 index 0000000000..a212ce7889 --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_translation_settings.xml @@ -0,0 +1,244 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<floater + legacy_header_height="18" + height="310" + layout="topleft" + name="floater_translation_settings" + help_topic="translation_settings" + save_rect="true" + title="CHAT TRANSLATION SETTINGS" + width="485"> + + <string name="bing_api_key_not_verified">Bing appID not verified. Please try again.</string> + <string name="google_api_key_not_verified">Google API key not verified. Please try again.</string> + + <string name="bing_api_key_verified">Bing appID verified.</string> + <string name="google_api_key_verified">Google API key verified.</string> + + <check_box + height="16" + label="Enable machine translation while chatting" + layout="topleft" + left="10" + name="translate_chat_checkbox" + top="30" + width="20" /> + <text + height="20" + follows="left|top" + layout="topleft" + left="40" + name="translate_language_label" + top_pad="20" + width="130"> + Translate chat into: + </text> + <combo_box + allow_text_entry="true" + follows="left|top" + height="23" + left_pad="10" + max_chars="135" + mouse_opaque="true" + name="translate_language_combo" + top_delta="-5" + width="190"> + <combo_box.item + label="System Default" + name="System Default Language" + value="default" /> + <combo_box.item + label="English" + name="English" + value="en" /> + <!-- After "System Default" and "English", please keep the rest of these combo_box.items in alphabetical order by the first character in the string. --> + <combo_box.item + label="Dansk (Danish)" + name="Danish" + value="da" /> + <combo_box.item + label="Deutsch (German)" + name="German" + value="de" /> + <combo_box.item + label="Español (Spanish)" + name="Spanish" + value="es" /> + <combo_box.item + label="Français (French)" + name="French" + value="fr" /> + <combo_box.item + label="Italiano (Italian)" + name="Italian" + value="it" /> + <combo_box.item + label="Magyar (Hungarian)" + name="Hungarian" + value="hu" /> + <combo_box.item + label="Nederlands (Dutch)" + name="Dutch" + value="nl" /> + <combo_box.item + label="Polski (Polish)" + name="Polish" + value="pl" /> + <combo_box.item + label="Português (Portuguese)" + name="Portugese" + value="pt" /> + <combo_box.item + label="Русский (Russian)" + name="Russian" + value="ru" /> + <combo_box.item + label="Türkçe (Turkish)" + name="Turkish" + value="tr" /> + <combo_box.item + label="Українська (Ukrainian)" + name="Ukrainian" + value="uk" /> + <combo_box.item + label="中文 (正體) (Chinese)" + name="Chinese" + value="zh" /> + <combo_box.item + label="日本語 (Japanese)" + name="Japanese" + value="ja" /> + <combo_box.item + label="한국어 (Korean)" + name="Korean" + value="ko" /> + </combo_box> + + <text + follows="top|left|right" + height="15" + layout="topleft" + left="40" + name="tip" + top_pad="20" + width="330" + wrap="true"> + Choose translation service: + </text> + + <radio_group + follows="top|left" + height="80" + layout="topleft" + left_delta="10" + name="translation_service_rg" + top_pad="20" + width="320"> + <radio_item + initial_value="bing" + label="Bing Translator" + layout="topleft" + name="bing" /> + <radio_item + initial_value="google" + label="Google Translate" + layout="topleft" + name="google" + top_pad="55" /> + </radio_group> + + <text + type="string" + length="1" + follows="top|right" + height="20" + layout="topleft" + left="70" + name="bing_api_key_label" + top_pad="-55" + width="85"> + Bing [http://www.bing.com/developers/createapp.aspx AppID]: + </text> + <line_editor + default_text="Enter Bing AppID and click "Verify"" + follows="top|left" + height="20" + layout="topleft" + left_pad="10" + max_length_chars="50" + top_delta="-4" + name="bing_api_key" + width="210" /> + <button + follows="left|top" + height="23" + label="Verify" + layout="topleft" + left_pad="10" + name="verify_bing_api_key_btn" + top_delta="-2" + width="90" /> + + <text + follows="top|right" + height="20" + layout="topleft" + left="70" + length="1" + name="google_api_key_label" + top_pad="50" + type="string" + width="85"> + Google [http://code.google.com/apis/language/translate/v2/getting_started.html#auth API key]: + </text> + <line_editor + default_text="Enter Google API key and click "Verify"" + follows="top|left" + height="20" + layout="topleft" + left_pad="10" + max_length_chars="50" + top_delta="-4" + name="google_api_key" + width="210" /> + <button + follows="left|top" + height="23" + label="Verify" + layout="topleft" + left_pad="10" + name="verify_google_api_key_btn" + top_delta="-2" + width="90" /> + + <text + follows="top|right" + height="20" + layout="topleft" + left="185" + length="1" + name="google_links_text" + top_delta="-23" + type="string" + width="100"> + [http://code.google.com/apis/language/translate/v2/pricing.html Pricing] | [https://code.google.com/apis/console Stats] + </text> + + <button + follows="left|top" + height="23" + label="OK" + layout="topleft" + right="-120" + name="ok_btn" + top="-30" + width="100" /> + <button + follows="left|top" + height="23" + label="Cancel" + layout="topleft" + left_pad="10" + name="cancel_btn" + width="100" /> +</floater> diff --git a/indra/newview/skins/default/xui/en/floater_voice_controls.xml b/indra/newview/skins/default/xui/en/floater_voice_controls.xml index 93a04050b6..6807b01fa3 100644 --- a/indra/newview/skins/default/xui/en/floater_voice_controls.xml +++ b/indra/newview/skins/default/xui/en/floater_voice_controls.xml @@ -89,7 +89,7 @@ visible="true" width="20" /> </layout_panel> - <layout_panel name="leave_call_panel" height="26" auto_resize="false"> + <layout_panel name="leave_call_panel" height="26" min_height="26" user_resize="false" auto_resize="false"> <layout_stack clip="true" follows="left|top|right" diff --git a/indra/newview/skins/default/xui/en/floater_voice_effect.xml b/indra/newview/skins/default/xui/en/floater_voice_effect.xml index 2c754cd8d0..77fb21e27c 100644 --- a/indra/newview/skins/default/xui/en/floater_voice_effect.xml +++ b/indra/newview/skins/default/xui/en/floater_voice_effect.xml @@ -7,7 +7,6 @@ help_topic="voice_effects" title="VOICE MORPHING" background_visible="true" - follows="all" label="Places" layout="topleft" min_height="360" diff --git a/indra/newview/skins/default/xui/en/floater_world_map.xml b/indra/newview/skins/default/xui/en/floater_world_map.xml index 4314c8a9e2..56d79f62c7 100644 --- a/indra/newview/skins/default/xui/en/floater_world_map.xml +++ b/indra/newview/skins/default/xui/en/floater_world_map.xml @@ -468,7 +468,7 @@ left="3" top_pad="7" mouse_opaque="true" - name="region_icon" + name="location_icon" width="16" /> <search_editor follows="top|right" diff --git a/indra/newview/skins/default/xui/en/inspect_remote_object.xml b/indra/newview/skins/default/xui/en/inspect_remote_object.xml index ef3dd844cd..e83257d2a0 100644 --- a/indra/newview/skins/default/xui/en/inspect_remote_object.xml +++ b/indra/newview/skins/default/xui/en/inspect_remote_object.xml @@ -36,7 +36,7 @@ height="16" left="8" name="object_owner_label" - width="55" + width="65" top_pad="12"> Owner: </text> diff --git a/indra/newview/skins/default/xui/en/menu_login.xml b/indra/newview/skins/default/xui/en/menu_login.xml index 80e310a873..8ac1ac9e09 100644 --- a/indra/newview/skins/default/xui/en/menu_login.xml +++ b/indra/newview/skins/default/xui/en/menu_login.xml @@ -167,13 +167,6 @@ function="Floater.Show" parameter="message_critical" /> </menu_item_call> - <menu_item_call - label="Media Browser Test" - name="Web Browser Test"> - <menu_item_call.on_click - function="Advanced.WebBrowserTest" - parameter="http://join.secondlife.com/"/> - </menu_item_call> <menu_item_call label="Web Content Floater Debug Test" name="Web Content Floater Debug Test"> diff --git a/indra/newview/skins/default/xui/en/menu_toolbars.xml b/indra/newview/skins/default/xui/en/menu_toolbars.xml index 59912b5503..fbe40a7244 100644 --- a/indra/newview/skins/default/xui/en/menu_toolbars.xml +++ b/indra/newview/skins/default/xui/en/menu_toolbars.xml @@ -3,9 +3,15 @@ layout="topleft" name="Toolbars Popup" visible="false"> - <menu_item_call label="Choose buttons..." + <menu_item_call label="Remove this button" layout="topleft" - name="Chose Buttons"> + name="Remove button"> + <menu_item_call.on_click function="Toolbars.RemoveSelectedCommand" /> + </menu_item_call> + <menu_item_separator layout="topleft" /> + <menu_item_call label="Toolbar buttons..." + layout="topleft" + name="Choose Buttons"> <menu_item_call.on_click function="Floater.Show" parameter="toybox" /> </menu_item_call> diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml index 2f88b6fbf1..28e9052ddb 100644 --- a/indra/newview/skins/default/xui/en/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en/menu_viewer.xml @@ -9,14 +9,6 @@ name="Me" tear_off="true"> <menu_item_call - label="Dashboard..." - name="Manage My Account"> - <menu_item_call.on_click - function="PromptShowURL" - name="ManageMyAccount_url" - parameter="WebLaunchJoinNow,http://secondlife.com/account/" /> - </menu_item_call> - <menu_item_call label="Profile..." name="Profile"> <menu_item_call.on_click @@ -31,6 +23,14 @@ <menu_item_call.on_enable function="Edit.EnableCustomizeAvatar" /> </menu_item_call> + <menu_item_call + label="Choose an avatar..." + name="Avatar Picker"> + <menu_item_call.on_click + function="Floater.ToggleOrBringToFront" + parameter="avatar" /> + </menu_item_call> + <menu_item_separator/> <menu_item_check label="Inventory..." name="Inventory" @@ -43,29 +43,37 @@ function="Floater.Toggle" parameter="inventory" /> </menu_item_check> - <menu_item_check - label="Gestures..." - name="Gestures" - shortcut="control|G"> - <menu_item_check.on_check - function="Floater.Visible" - parameter="gestures" /> - <menu_item_check.on_click - function="Floater.Toggle" - parameter="gestures" /> - </menu_item_check> - <menu_item_check - label="Voice..." - name="ShowVoice" - visibility_control="VoiceMorphingEnabled"> - <menu_item_check.on_check - function="Floater.Visible" - Parameter="voice_effect" /> - <menu_item_check.on_click - function="Floater.Toggle" - parameter="voice_effect" /> - </menu_item_check> - + <menu_item_call + label="New Inventory Window" + name="NewInventoryWindow" + shortcut="control|shift|I" + visible="false"> + <menu_item_call.on_click + function="Inventory.NewWindow" + parameter="" /> + </menu_item_call> + <menu_item_call + label="Places..." + name="Places"> + <menu_item_call.on_click + function="Floater.ToggleOrBringToFront" + parameter="places" /> + </menu_item_call> + <menu_item_call + label="Picks..." + name="Picks"> + <menu_item_call.on_click + function="Floater.ToggleOrBringToFront" + parameter="picks" /> + </menu_item_call> + <menu_item_separator/> + <menu_item_call + label="Camera Controls..." + name="Camera Controls"> + <menu_item_call.on_click + function="Floater.ToggleOrBringToFront" + parameter="camera" /> + </menu_item_call> <menu create_jump_keys="true" label="Movement" @@ -108,6 +116,13 @@ <menu_item_call.on_click function="Tools.StopAllAnimations" /> </menu_item_call> + <menu_item_call + label="Walk / run / fly..." + name="Stop Animating My Avatar"> + <menu_item_call.on_click + function="Floater.ToggleOrBringToFront" + parameter="moveview" /> + </menu_item_call> </menu> <menu @@ -154,6 +169,14 @@ <menu_item_call.on_click function="BuyCurrency" /> </menu_item_call> + <menu_item_call + label="Account dashboard..." + name="Manage My Account"> + <menu_item_call.on_click + function="PromptShowURL" + name="ManageMyAccount_url" + parameter="WebLaunchJoinNow,http://secondlife.com/account/" /> + </menu_item_call> <menu_item_separator/> @@ -166,7 +189,7 @@ parameter="preferences" /> </menu_item_call> <menu_item_call - label="Toolbars..." + label="Toolbar buttons..." name="Toolbars" shortcut="control|T"> <menu_item_call.on_click @@ -196,33 +219,8 @@ label="Communicate" name="Communicate" tear_off="true"> - <menu_item_call - label="My Friends" - name="My Friends" - shortcut="control|shift|F"> - <menu_item_call.on_click - function="SideTray.PanelPeopleTab" - parameter="friends_panel" /> - </menu_item_call> - <menu_item_call - label="My Groups" - name="My Groups" - shortcut="control|shift|G"> - <menu_item_call.on_click - function="SideTray.PanelPeopleTab" - parameter="groups_panel" /> - </menu_item_call> - - <menu_item_separator/> - - <!--menu_item_call - label="Chat" - name="Chat"> - <menu_item_call.on_click - function="World.Chat" /> - </menu_item_call--> <menu_item_check - label="Nearby Chat" + label="Chat..." name="Nearby Chat" shortcut="control|H" use_mac_ctrl="true"> @@ -233,16 +231,21 @@ function="Floater.Toggle" parameter="chat_bar" /> </menu_item_check> - <menu_item_call - label="Nearby People" - name="Active Speakers" - shortcut="control|shift|A"> - <menu_item_call.on_click - function="SideTray.PanelPeopleTab" - parameter="nearby_panel" /> - </menu_item_call> <menu_item_check - label="Nearby Voice" + label="Speak" + name="Speak"> + <menu_item_check.on_check + function="Agent.IsMicrophoneOn" + parameter="speak" /> + <menu_item_check.on_enable + function="Agent.IsActionAllowed" + parameter="speak" /> + <menu_item_check.on_click + function="Agent.ToggleMicrophone" + parameter="speak" /> + </menu_item_check> + <menu_item_check + label="Voice settings..." name="Nearby Voice"> <menu_item_check.on_check function="Floater.Visible" @@ -251,12 +254,86 @@ function="Floater.Toggle" parameter="voice_controls" /> </menu_item_check> + <menu_item_check + label="Voice morphing..." + name="ShowVoice" + visibility_control="VoiceMorphingEnabled"> + <menu_item_check.on_check + function="Floater.Visible" + parameter="voice_effect" /> + <menu_item_check.on_click + function="Floater.Toggle" + parameter="voice_effect" /> + </menu_item_check> + <menu_item_check + label="Gestures..." + name="Gestures" + shortcut="control|G"> + <menu_item_check.on_check + function="Floater.Visible" + parameter="gestures" /> + <menu_item_check.on_click + function="Floater.Toggle" + parameter="gestures" /> + </menu_item_check> + <menu_item_separator/> + <menu_item_call + label="Friends" + name="My Friends" + shortcut="control|shift|F"> + <menu_item_call.on_click + function="SideTray.PanelPeopleTab" + parameter="friends_panel" /> + </menu_item_call> + <menu_item_call + label="Groups" + name="My Groups" + shortcut="control|shift|G"> + <menu_item_call.on_click + function="SideTray.PanelPeopleTab" + parameter="groups_panel" /> + </menu_item_call> + <menu_item_call + label="Nearby people" + name="Active Speakers" + shortcut="control|shift|A"> + <menu_item_call.on_click + function="SideTray.PanelPeopleTab" + parameter="nearby_panel" /> + </menu_item_call> </menu> <menu create_jump_keys="true" label="World" name="World" tear_off="true"> + <menu_item_call + label="Landmark This Place" + name="Create Landmark Here"> + <menu_item_call.on_click + function="World.CreateLandmark" /> + <menu_item_call.on_enable + function="World.EnableCreateLandmark" /> + </menu_item_call> + <menu_item_call + label="Destinations..." + name="Destinations"> + <menu_item_call.on_click + function="Floater.ToggleOrBringToFront" + parameter="destinations" /> + </menu_item_call> + <menu_item_check + label="World map" + name="World Map" + shortcut="control|M" + use_mac_ctrl="true"> + <menu_item_check.on_check + function="Floater.Visible" + parameter="world_map" /> + <menu_item_check.on_click + function="Floater.Toggle" + parameter="world_map" /> + </menu_item_check> <menu_item_check label="Mini-map" name="Mini-Map" @@ -268,18 +345,6 @@ function="Floater.Toggle" parameter="mini_map" /> </menu_item_check> - <menu_item_check - label="World Map" - name="World Map" - shortcut="control|M" - use_mac_ctrl="true"> - <menu_item_check.on_check - function="Floater.Visible" - parameter="world_map" /> - <menu_item_check.on_click - function="Floater.Toggle" - parameter="world_map" /> - </menu_item_check> <menu_item_check label="Search" name="Search" @@ -291,6 +356,25 @@ function="Floater.Toggle" parameter="search" /> </menu_item_check> + <menu_item_separator/> + <menu_item_call + label="Teleport home" + name="Teleport Home" + shortcut="control|shift|H"> + <menu_item_call.on_click + function="World.TeleportHome" /> + <menu_item_call.on_enable + function="World.EnableTeleportHome" /> + </menu_item_call> + <menu_item_call + label="Set home to here" + name="Set Home to Here"> + <menu_item_call.on_click + function="World.SetHomeLocation" /> + <menu_item_call.on_enable + function="World.EnableSetHomeLocation" /> + </menu_item_call> + <menu_item_separator/> <menu_item_call label="Snapshot" name="Take Snapshot" @@ -299,82 +383,51 @@ function="Floater.Show" parameter="snapshot" /> </menu_item_call> - <menu_item_call - label="Landmark This Place" - name="Create Landmark Here"> - <menu_item_call.on_click - function="World.CreateLandmark" /> - <menu_item_call.on_enable - function="World.EnableCreateLandmark" /> - </menu_item_call> - <menu - create_jump_keys="true" - label="Place Profile" - name="Land" - tear_off="true"> + <menu_item_separator/> <menu_item_call - label="Place Profile" + label="Place profile" layout="topleft" name="Place Profile"> <menu_item_call.on_click function="World.PlaceProfile" /> </menu_item_call> <menu_item_call - label="About Land" + label="About land" name="About Land"> <menu_item_call.on_click function="Floater.Show" parameter="about_land" /> </menu_item_call> <menu_item_call - label="Region/Estate" + label="Region / Estate" name="Region/Estate"> <menu_item_call.on_click function="Floater.Show" parameter="region_info" /> </menu_item_call> - </menu> + <menu_item_call + label="My land holdings..." + name="My Land"> + <menu_item_call.on_click + function="Floater.Show" + parameter="land_holdings" /> + </menu_item_call> + <menu_item_call + label="Buy this land" + name="Buy Land"> + <menu_item_call.on_click + function="Land.Buy" /> + <menu_item_call.on_enable + function="World.EnableBuyLand" /> + </menu_item_call> <menu_item_separator/> - <menu_item_call - label="Buy This Land" - name="Buy Land"> - <menu_item_call.on_click - function="Land.Buy" /> - <menu_item_call.on_enable - function="World.EnableBuyLand" /> - </menu_item_call> - <menu_item_call - label="My Land" - name="My Land"> - <menu_item_call.on_click - function="Floater.Show" - parameter="land_holdings" /> - </menu_item_call> <menu create_jump_keys="true" label="Show" name="LandShow" tear_off="true"> - <menu_item_check - label="Move Controls" - name="Movement Controls"> - <menu_item_check.on_check - function="Floater.Visible" - parameter="moveview" /> - <menu_item_check.on_click - function="World.Toggle.MovementControls" /> - </menu_item_check> - <menu_item_check - label="View Controls" - name="Camera Controls"> - <menu_item_check.on_check - function="Floater.Visible" - parameter="camera" /> - <menu_item_check.on_click - function="World.Toggle.CameraControls" /> - </menu_item_check> <menu_item_check label="Ban Lines" name="Ban Lines"> @@ -447,24 +500,6 @@ </menu> <menu_item_separator/> - - <menu_item_call - label="Teleport Home" - name="Teleport Home" - shortcut="control|shift|H"> - <menu_item_call.on_click - function="World.TeleportHome" /> - <menu_item_call.on_enable - function="World.EnableTeleportHome" /> - </menu_item_call> - <menu_item_call - label="Set Home to Here" - name="Set Home to Here"> - <menu_item_call.on_click - function="World.SetHomeLocation" /> - <menu_item_call.on_enable - function="World.EnableSetHomeLocation" /> - </menu_item_call> <!-- <menu_item_check label="Show Navigation Bar" name="ShowNavbarNavigationPanel"> @@ -487,8 +522,6 @@ </menu_item_check> <menu_item_separator/>--> - <menu_item_separator/> - <menu create_jump_keys="true" label="Sun" @@ -524,18 +557,26 @@ function="World.EnvSettings" parameter="midnight" /> </menu_item_call> + <menu_item_separator/> + <menu_item_call + label="Use Region Settings" + name="Use Region Settings"> + <menu_item_call.on_click + function="World.EnvSettings" + parameter="region" /> + </menu_item_call> </menu> <menu create_jump_keys="true" - label="Enviroment Editor" - name="Enviroment Editor" + label="Environment Editor" + name="Environment Editor" tear_off="true"> <menu_item_call - label="Enviroment Settings..." - name="Enviroment Settings"> + label="Environment Settings..." + name="Environment Settings"> <menu_item_call.on_click function="World.EnvSettings" parameter="editor"/> @@ -1175,6 +1216,13 @@ name="Help" tear_off="true"> <menu_item_call + label="How to..." + name="How To"> + <menu_item_call.on_click + function="Help.ToggleHowTo" + parameter="" /> + </menu_item_call> + <menu_item_call label="[SECOND_LIFE] Help" name="Second Life Help" shortcut="F1"> @@ -1743,12 +1791,6 @@ function="Tools.EnableReleaseKeys" parameter="" /> </menu_item_call> - <menu_item_call - label="Set UI Size to Default" - name="Set UI Size to Default"> - <menu_item_call.on_click - function="View.DefaultUISize" /> - </menu_item_call> <!-- This second, alternative shortcut for Show Advanced Menu is for backward compatibility. The main shortcut has been changed so it's Linux-friendly, where the old shortcut is typically eaten by the window manager. --> <menu_item_check label="Show Advanced Menu - legacy shortcut" @@ -2474,6 +2516,16 @@ parameter="raycast" /> </menu_item_check> <menu_item_check + label="Wind Vectors" + name="Wind Vectors"> + <menu_item_check.on_check + function="Advanced.CheckInfoDisplay" + parameter="wind vectors" /> + <menu_item_check.on_click + function="Advanced.ToggleInfoDisplay" + parameter="wind vectors" /> + </menu_item_check> + <menu_item_check label="Render Complexity" name="rendercomplexity"> <menu_item_check.on_check @@ -2587,19 +2639,6 @@ <menu_item_check.on_enable function="Advanced.EnableRenderDeferredOptions" /> </menu_item_check> - <menu_item_check - label=" Global Illumination (experimental)" - name="Global Illumination"> - <menu_item_check.on_check - function="CheckControl" - parameter="RenderDeferredGI" /> - <menu_item_check.on_click - function="ToggleControl" - parameter="RenderDeferredGI" /> - <menu_item_check.on_enable - function="Advanced.EnableRenderDeferredOptions" /> - </menu_item_check> - <menu_item_separator /> <menu_item_check diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index 3ed8c30ca8..0ba4b84abe 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -2369,7 +2369,7 @@ Would you be my friend? name="RemoveFromFriends" type="alertmodal"> <tag>friendship</tag> -Do you want to remove [NAME] from your Friends List? +Do you want to remove <nolink>[NAME]</nolink> from your Friends List? <tag>confirm</tag> <usetemplate name="okcancelbuttons" @@ -4636,7 +4636,21 @@ Are you sure you want to quit? name="ConfirmRestoreToybox" type="alertmodal"> <unique/> -Are you sure you want to restore your default buttons and toolbars? +This action will restore your default buttons and toolbars. + +You cannot undo this action. + <usetemplate + name="okcancelbuttons" + notext="Cancel" + yestext="OK"/> + </notification> + + <notification + icon="alertmodal.tga" + name="ConfirmClearAllToybox" + type="alertmodal"> + <unique/> +This action will return all buttons to the toolbox and your toolbars will be empty. You cannot undo this action. <usetemplate @@ -4644,7 +4658,7 @@ You cannot undo this action. notext="Cancel" yestext="OK"/> </notification> - + <notification icon="alertmodal.tga" name="DeleteItems" @@ -5147,7 +5161,7 @@ Topic: [SUBJECT], Message: [MESSAGE] name="FriendOnline" type="notifytip"> <tag>friendship</tag> -[NAME] is Online +<nolink>[NAME]</nolink> is Online </notification> <notification @@ -5155,7 +5169,7 @@ Topic: [SUBJECT], Message: [MESSAGE] name="FriendOffline" type="notifytip"> <tag>friendship</tag> -[NAME] is Offline +<nolink>[NAME]</nolink> is Offline </notification> <notification @@ -6157,7 +6171,7 @@ Your object named <nolink>[OBJECTFROMNAME]</nolink> has given you th name="FriendshipAccepted" type="offer"> <tag>friendship</tag> -[NAME] accepted your friendship offer. +<nolink>[NAME]</nolink> accepted your friendship offer. </notification> <notification @@ -6166,7 +6180,7 @@ Your object named <nolink>[OBJECTFROMNAME]</nolink> has given you th persist="true" type="notify"> <tag>friendship</tag> -[NAME] declined your friendship offer. +<nolink>[NAME]</nolink> declined your friendship offer. </notification> <notification @@ -6925,7 +6939,7 @@ With the following Residents: <usetemplate name="okcancelbuttons" notext="Cancel" - yestext="Ok"/> + yestext="OK"/> </notification> <notification @@ -7121,7 +7135,7 @@ Mute everyone? <usetemplate ignoretext="Confirm before I mute all participants in a group call" name="okcancelignore" - yestext="Ok" + yestext="OK" notext="Cancel"> <unique/> </usetemplate> diff --git a/indra/newview/skins/default/xui/en/panel_edit_jacket.xml b/indra/newview/skins/default/xui/en/panel_edit_jacket.xml index 8e8d8e6505..0f8c37c691 100644 --- a/indra/newview/skins/default/xui/en/panel_edit_jacket.xml +++ b/indra/newview/skins/default/xui/en/panel_edit_jacket.xml @@ -32,7 +32,7 @@ name="Upper Fabric" tool_tip="Click to choose a picture" top="10" - width="74" > + width="75" > <texture_picker.commit_callback function="TexturePicker.Commit" /> </texture_picker> diff --git a/indra/newview/skins/default/xui/en/panel_login.xml b/indra/newview/skins/default/xui/en/panel_login.xml index 3835cd17b6..6521bf2a4e 100644 --- a/indra/newview/skins/default/xui/en/panel_login.xml +++ b/indra/newview/skins/default/xui/en/panel_login.xml @@ -22,17 +22,17 @@ top="600" <!-- *NOTE: Custom resize logic for login_html in llpanellogin.cpp --> <web_browser tab_stop="false" -trusted_content="true" -bg_opaque_color="Black" -border_visible="false" -bottom="600" -follows="all" -left="0" -name="login_html" -start_url="" -top="0" -height="600" - width="980" /> + trusted_content="true" + bg_opaque_color="Black" + border_visible="false" + bottom="600" + follows="all" + left="0" + name="login_html" + start_url="" + top="0" + height="600" + width="980"/> <layout_stack follows="left|bottom|right" name="login_widgets" diff --git a/indra/newview/skins/default/xui/en/panel_my_profile.xml b/indra/newview/skins/default/xui/en/panel_my_profile.xml deleted file mode 100644 index 4bd2235cda..0000000000 --- a/indra/newview/skins/default/xui/en/panel_my_profile.xml +++ /dev/null @@ -1,146 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes" ?> -<panel - follows="all" - height="535" - label="Profile" - layout="topleft" - left="0" - name="panel_profile" - top="0" - width="315"> - <string - name="CaptionTextAcctInfo"> - [ACCTTYPE] -[PAYMENTINFO] [AGEVERIFICATION] - </string> - <string - name="payment_update_link_url"> - http://www.secondlife.com/account/billing.php?lang=en - </string> - <string - name="partner_edit_link_url"> - http://www.secondlife.com/account/partners.php?lang=en - </string> - <string - name="my_account_link_url" - value="http://secondlife.com/account" /> - <string - name="no_partner_text" - value="None" /> - <string - name="no_group_text" - value="None" /> - <string - name="RegisterDateFormat"> - [REG_DATE] ([AGE]) - </string> - <string - name="name_text_args"> - [NAME] - </string> - <string - name="display_name_text_args"> - [DISPLAY_NAME] - </string> - <layout_stack - name="layout" - orientation="vertical" - follows="all" - layout="topleft" - left="0" - top="0" - height="510" - width="315" - border_size="0"> - <layout_panel - name="profile_stack" - follows="all" - layout="topleft" - top="0" - left="0" - height="492" - user_resize="false" - width="315"> - <scroll_container - color="DkGray2" - follows="all" - layout="topleft" - left="0" - name="profile_scroll" - opaque="true" - height="488" - width="315" - top="0"> - <panel - layout="topleft" - follows="left|top|right" - height="488" - name="scroll_content_panel" - top="0" - left="0" - width="297"> - <panel - follows="left|top|right" - height="117" - layout="topleft" - left="10" - name="second_life_image_panel" - top="0" - width="297"> - - <texture_picker - allow_no_texture="true" - default_image_name="None" - enabled="false" - fallback_image="Generic_Person_Large" - follows="top|left" - height="124" - layout="topleft" - left="3" - name="2nd_life_pic" - top="10" - width="102" /> - - <text - follows="left|top|right" - font="SansSerifLarge" - font.style="BOLD" - height="15" - layout="topleft" - left_pad="10" - name="display_name_descr_text" - text_color="0.7 0.7 0.7 1.0" - top_delta="0" - width="280" > - User name - </text> - - <text - follows="left|top|right" - font.style="BOLD" - height="15" - layout="topleft" - left_delta="0" - name="name_descr_text" - text_color="0.4 0.4 0.4 1.0" - top_delta="20" - width="280"> - Display Name - </text> - - <button - follows="bottom" - height="23" - left_delta="0" - top_delta="20" - label="Profile" - name="see_profile_btn" - tool_tip="See profile for this avatar" - width="120" /> - - </panel> - </panel> - </scroll_container> - </layout_panel> - </layout_stack> -</panel> diff --git a/indra/newview/skins/default/xui/en/panel_nearby_chat.xml b/indra/newview/skins/default/xui/en/panel_nearby_chat.xml index f766236b2e..d492f9bd68 100644 --- a/indra/newview/skins/default/xui/en/panel_nearby_chat.xml +++ b/indra/newview/skins/default/xui/en/panel_nearby_chat.xml @@ -11,7 +11,7 @@ control_name="TranslateChat" enabled="true" height="16" - label="Translate chat (powered by Google)" + label="Translate chat" layout="topleft" left="5" name="translate_chat_checkbox" diff --git a/indra/newview/skins/default/xui/en/panel_notes.xml b/indra/newview/skins/default/xui/en/panel_notes.xml deleted file mode 100644 index 124b1cfc6b..0000000000 --- a/indra/newview/skins/default/xui/en/panel_notes.xml +++ /dev/null @@ -1,236 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes" ?> -<panel - follows="all" - height="515" - label="Notes & Privacy" - layout="topleft" - left="0" - name="panel_notes" - top="0" - width="313" -> - <layout_stack - name="layout" - orientation="vertical" - follows="all" - layout="topleft" - left="0" - top="0" - height="517" - width="313" - border_size="0"> - <layout_panel - name="notes_stack" - follows="all" - layout="topleft" - top="0" - left="0" - height="450" - width="313"> - <scroll_container - color="DkGray2" - follows="all" - layout="topleft" - left="0" - name="profile_scroll" - opaque="true" - height="450" - width="313" - top="0"> - <panel - height="450" - layout="topleft" - name="profile_scroll_panel" - top="0" - left="0" - width="303"> - <text - follows="left|top" - font.style="BOLD" - height="16" - layout="topleft" - left="11" - name="status_message" - text_color="white" - top="10" - value="My private notes:" - width="293" /> - <text_editor - follows="left|top" - height="120" - layout="topleft" - left="12" - max_length="1000" - name="notes_edit" - text_color="DkGray" - top_pad="3" - width="288" - word_wrap="true" /> - <text - follows="left|top" - font.style="BOLD" - height="16" - layout="topleft" - left="11" - name="status_message2" - text_color="white" - top_pad="20" - value="Allow this person to:" - width="293" /> - <check_box - enabled="false" - height="16" - label="See my online status" - layout="topleft" - left="10" - name="status_check" - width="293" /> - <check_box - enabled="false" - height="16" - label="See me on the map" - layout="topleft" - left="10" - name="map_check" - width="293" /> - <check_box - enabled="false" - height="16" - label="Edit, delete or take my objects" - layout="topleft" - left="10" - name="objects_check" - width="293" /> - </panel> - </scroll_container> - </layout_panel> - <layout_panel - follows="bottom|left" - height="30" - layout="topleft" - left="0" - name="notes_buttons_panel" - auto_resize="false" - width="313"> - - <layout_stack - follows="bottom|left|right" - height="23" - layout="topleft" - name="bottom_bar_ls" - left="2" - orientation="horizontal" - top_pad="5" - width="309"> - - <layout_panel - follows="bottom|left|right" - height="23" - layout="bottomleft" - left="0" - name="add_friend_btn_lp" - user_resize="false" - auto_resize="true" - width="118"> - <button - follows="bottom|left|right" - height="23" - label="Add Friend" - layout="topleft" - left="1" - mouse_opaque="false" - name="add_friend" - tool_tip="Offer friendship to the Resident" - top="0" - width="117" /> - </layout_panel> - - <layout_panel - follows="bottom|left|right" - height="23" - layout="bottomleft" - left_pad="3" - name="im_btn_lp" - user_resize="false" - auto_resize="true" - width="22"> - <button - follows="bottom|left|right" - height="23" - label="IM" - layout="topleft" - name="im" - tool_tip="Open instant message session" - top="0" - left="1" - width="21" /> - </layout_panel> - - <layout_panel - follows="bottom|left|right" - height="23" - layout="bottomleft" - left_pad="3" - name="call_btn_lp" - user_resize="false" - auto_resize="true" - width="52"> - <button - follows="bottom|left|right" - height="23" - label="Call" - layout="topleft" - name="call" - tool_tip="Call this Resident" - left="1" - top="0" - use_ellipses="true" - width="51" /> - </layout_panel> - - <layout_panel - follows="bottom|left|right" - height="23" - layout="bottomleft" - left_pad="3" - name="show_on_map_btn_lp" - user_resize="false" - auto_resize="true" - width="46"> - <button - enabled="false" - follows="bottom|left|right" - height="23" - label="Map" - layout="topleft" - name="show_on_map_btn" - tool_tip="Show the Resident on the map" - top="0" - left="1" - width="45" /> - </layout_panel> - - <layout_panel - follows="bottom|left|right" - height="23" - layout="bottomleft" - left_pad="3" - name="teleport_btn_lp" - user_resize="false" - auto_resize="true" - width="81"> - <button - follows="bottom|left|right" - height="23" - label="Teleport" - layout="topleft" - name="teleport" - tool_tip="Offer teleport" - left="1" - top="0" - width="80" /> - </layout_panel> - </layout_stack> - </layout_panel> - </layout_stack> -</panel> diff --git a/indra/newview/skins/default/xui/en/panel_places.xml b/indra/newview/skins/default/xui/en/panel_places.xml index 5d7334f780..670aa47313 100644 --- a/indra/newview/skins/default/xui/en/panel_places.xml +++ b/indra/newview/skins/default/xui/en/panel_places.xml @@ -202,7 +202,7 @@ background_visible="true" </layout_panel> <layout_panel - follows="bottom|left|right" + follows="bottom|right" height="23" layout="bottomleft" left_pad="0" @@ -212,7 +212,7 @@ background_visible="true" auto_resize="true" width="24"> <menu_button - follows="bottom|left|right" + follows="bottom|right" height="23" image_disabled="ComboButton_UpOff" image_unselected="ComboButton_UpOff" diff --git a/indra/newview/skins/default/xui/en/floater_postcard.xml b/indra/newview/skins/default/xui/en/panel_postcard_message.xml index adc2433105..ab2a42ea01 100644 --- a/indra/newview/skins/default/xui/en/floater_postcard.xml +++ b/indra/newview/skins/default/xui/en/panel_postcard_message.xml @@ -1,131 +1,101 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> -<floater - legacy_header_height="18" - can_minimize="false" - can_resize="true" +<panel height="380" layout="topleft" - min_height="380" - min_width="490" - name="Postcard" - help_topic="postcard" - title="EMAIL SNAPSHOT" + name="panel_postcard_message" width="490"> - <floater.string - name="default_subject"> - Postcard from [SECOND_LIFE]. - </floater.string> - <floater.string - name="default_message"> - Check this out! - </floater.string> - <floater.string - name="upload_message"> - Sending... - </floater.string> <text type="string" length="1" bottom="35" follows="top|left" font="SansSerif" + height="16" layout="topleft" left="12" - name="to_label"> - Recipient's Email: + name="to_label" + top="10" + width="60"> + To: </text> <line_editor control_name="LastPostcardRecipient" - follows="left|top" + follows="left|top|right" height="20" layout="topleft" - left_delta="148" + left_pad="10" name="to_form" - top_delta="-4" - width="150" /> - <text - type="string" - length="1" - bottom_delta="23" - follows="top|left" - font="SansSerif" - layout="topleft" - left="12" - name="from_label"> - Your Email: - </text> - <line_editor - follows="left|top" - height="20" - layout="topleft" - left_delta="148" - name="from_form" - top_delta="-4" - width="150" /> + right="-10" + top_delta="-4" /> <text type="string" length="1" bottom_delta="23" follows="top|left" font="SansSerif" + height="16" layout="topleft" left="12" - name="name_label"> - Your Name: + name="name_label" + width="60"> + From: </text> <line_editor - follows="left|top" + follows="left|top|right" height="20" layout="topleft" - left_delta="148" + left_pad="10" max_length_bytes="100" name="name_form" - top_delta="-4" - width="150" /> + right="-10" + top_delta="-4" /> <text type="string" length="1" bottom_delta="23" follows="top|left" font="SansSerif" + height="16" layout="topleft" left="12" - name="subject_label"> + name="subject_label" + width="60"> Subject: </text> <line_editor - follows="left|top" + follows="left|top|right" height="20" label="Type your subject here." layout="topleft" - left_delta="148" + left_pad="10" max_length_bytes="100" name="subject_form" - top_delta="-4" - width="150" /> + right="-10" + top_delta="-4" /> <text type="string" length="1" bottom_delta="23" - follows="top|left" + follows="top|left|right" font="SansSerif" layout="topleft" left="12" - name="msg_label"> + name="msg_label" + right="-10"> Message: </text> <text_editor type="string" length="1" - follows="left|top|right|bottom" - height="140" + follows="left|top|right" + height="60" layout="topleft" left_delta="0" max_length="700" name="msg_form" - word_wrap="true" + right="-10" top_pad="10" - width="420"> + word_wrap="true"> Type your message here. </text_editor> <button @@ -134,9 +104,12 @@ label="Cancel" layout="topleft" name="cancel_btn" - right="-10" + right="-32" top="350" - width="100" /> + width="100"> + <button.commit_callback + function="Postcard.Cancel" /> + </button> <button follows="right|bottom" height="23" @@ -145,5 +118,8 @@ left_delta="-106" name="send_btn" top_delta="0" - width="100" /> -</floater> + width="100"> + <button.commit_callback + function="Postcard.Send" /> + </button> +</panel> diff --git a/indra/newview/skins/default/xui/en/panel_postcard_settings.xml b/indra/newview/skins/default/xui/en/panel_postcard_settings.xml new file mode 100644 index 0000000000..2e0bb88f53 --- /dev/null +++ b/indra/newview/skins/default/xui/en/panel_postcard_settings.xml @@ -0,0 +1,137 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<panel + height="380" + layout="topleft" + name="panel_postcard_settings" + width="490"> + <combo_box + follows="left|top|right" + height="23" + label="Resolution" + layout="topleft" + left="10" + name="postcard_size_combo" + right="-10" + top_pad="10"> + <combo_box.item + label="Current Window" + name="CurrentWindow" + value="[i0,i0]" /> + <combo_box.item + label="640x480" + name="640x480" + value="[i640,i480]" /> + <combo_box.item + label="800x600" + name="800x600" + value="[i800,i600]" /> + <combo_box.item + label="1024x768" + name="1024x768" + value="[i1024,i768]" /> + <combo_box.item + label="Custom" + name="Custom" + value="[i-1,i-1]" /> + </combo_box> + <layout_stack + animate="false" + follows="all" + height="275" + layout="bottomleft" + name="postcard_image_params_ls" + left_delta="0" + orientation="vertical" + top_pad="10" + right="-10"> + <layout_panel + follows="top|left|right" + height="60" + layout="topleft" + left="0" + name="postcard_image_size_lp" + user_resize="false" + auto_resize="false" + top="0" + right="-1" + visible="true"> + <spinner + allow_text_entry="false" + decimal_digits="0" + follows="left|top" + height="20" + increment="32" + label="Width" + label_width="40" + layout="topleft" + left="10" + max_val="6016" + min_val="32" + name="postcard_snapshot_width" + top_pad="10" + width="95" /> + <spinner + allow_text_entry="false" + decimal_digits="0" + follows="left|top" + height="20" + increment="32" + label="Height" + label_width="40" + layout="topleft" + left_pad="5" + max_val="6016" + min_val="32" + name="postcard_snapshot_height" + top_delta="0" + width="95" /> + <check_box + bottom_delta="20" + follows="left|top" + label="Constrain proportions" + layout="topleft" + left="10" + name="postcard_keep_aspect_check" /> + </layout_panel> + <layout_panel + follows="top|left|right" + height="23" + layout="topleft" + left="0" + name="postcard_image_format_quality_lp" + user_resize="false" + auto_resize="true" + top="0" + right="-1" + visible="true"> + <slider + decimal_digits="0" + follows="left|top" + height="15" + increment="1" + initial_value="75" + label="Image quality" + label_width="80" + layout="topleft" + left="0" + max_val="100" + name="image_quality_slider" + top_pad="7" + width="190" /> + <text + type="string" + follows="left|top" + font="SansSerifSmall" + length="1" + height="14" + layout="topleft" + left_pad="-5" + halign="left" + name="image_quality_level" + top_delta="0" + width="60"> + ([QLVL]) + </text> + </layout_panel> + </layout_stack> +</panel> diff --git a/indra/newview/skins/default/xui/en/panel_preferences_chat.xml b/indra/newview/skins/default/xui/en/panel_preferences_chat.xml index 52be805260..caf7fc85f5 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_chat.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_chat.xml @@ -204,119 +204,16 @@ name="nearby_toasts_fadingtime" top_pad="3" width="325" /> - - <check_box - control_name="TranslateChat" - enabled="true" - height="16" - layout="topleft" - left="30" - name="translate_chat_checkbox" - top_pad="5" - width="400" /> - <!-- *HACK - After storm-1109 will be fixed: instead of using this text_box, word_wrap should be applied for "translate_chat_checkbox" check_box's label.--> - <text - follows="top|left" - height="15" - layout="topleft" - left="50" - name="translate_chb_label" - top_delta="1" - width="450" - wrap="true"> - Use machine translation while chatting (powered by Google) - </text> - <text - top_pad="20" - name="translate_language_text" - follows="left|top" - layout="topleft" - left_delta="20" - height="20" - width="110"> - Translate chat into: - </text> - <combo_box - allow_text_entry="true" - bottom_delta="3" - control_name="TranslateLanguage" - enabled="true" - follows="left|top" - height="23" - left_delta="110" - max_chars="135" - mouse_opaque="true" - name="translate_language_combobox" - width="146"> - <combo_box.item - label="System Default" - name="System Default Language" - value="default" /> - <combo_box.item - label="English" - name="English" - value="en" /> - <!-- After "System Default" and "English", please keep the rest of these combo_box.items in alphabetical order by the first character in the string. --> - <combo_box.item - label="Dansk (Danish)" - name="Danish" - value="da" /> - <combo_box.item - label="Deutsch (German)" - name="German" - value="de" /> - <combo_box.item - label="Español (Spanish)" - name="Spanish" - value="es" /> - <combo_box.item - label="Français (French)" - name="French" - value="fr" /> - <combo_box.item - label="Italiano (Italian)" - name="Italian" - value="it" /> - <combo_box.item - label="Magyar (Hungarian)" - name="Hungarian" - value="hu" /> - <combo_box.item - label="Nederlands (Dutch)" - name="Dutch" - value="nl" /> - <combo_box.item - label="Polski (Polish)" - name="Polish" - value="pl" /> - <combo_box.item - label="Português (Portuguese)" - name="Portugese" - value="pt" /> - <combo_box.item - label="Русский (Russian)" - name="Russian" - value="ru" /> - <combo_box.item - label="Türkçe (Turkish)" - name="Turkish" - value="tr" /> - <combo_box.item - label="Українська (Ukrainian)" - name="Ukrainian" - value="uk" /> - <combo_box.item - label="中文 (正體) (Chinese)" - name="Chinese" - value="zh" /> - <combo_box.item - label="日本語 (Japanese)" - name="Japanese" - value="ja" /> - <combo_box.item - label="한국어 (Korean)" - name="Korean" - value="ko" /> - </combo_box> + <button + follows="left|top" + height="23" + label="Chat Translation Settings" + layout="topleft" + left="30" + name="ok_btn" + top="-40" + width="170"> + <button.commit_callback + function="Pref.TranslationSettings" /> + </button> </panel>
\ No newline at end of file diff --git a/indra/newview/skins/default/xui/en/panel_preferences_general.xml b/indra/newview/skins/default/xui/en/panel_preferences_general.xml index 0a1c0872e9..4079a80924 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_general.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_general.xml @@ -92,7 +92,7 @@ value="ja" /> <combo_box.item enabled="true" - label="正體 (Traditional Chinese) - Beta" + label="正體中文 (Traditional Chinese) - Beta" name="Traditional Chinese" value="zh" /> </combo_box> diff --git a/indra/newview/skins/default/xui/en/panel_preferences_setup.xml b/indra/newview/skins/default/xui/en/panel_preferences_setup.xml index a7078ce2e1..4aeea8823e 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_setup.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_setup.xml @@ -122,7 +122,7 @@ layout="topleft" left_delta="0" name="external" - value="1" + value="true" top="0" tool_tip="Use the default system web browser for help, web links, etc. Not recommended if running full screen." width="480" /> diff --git a/indra/newview/skins/default/xui/en/panel_profile.xml b/indra/newview/skins/default/xui/en/panel_profile.xml deleted file mode 100644 index f5a9daa994..0000000000 --- a/indra/newview/skins/default/xui/en/panel_profile.xml +++ /dev/null @@ -1,458 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes" ?> -<panel - follows="all" - height="430" - label="Profile" - layout="topleft" - left="0" - name="panel_profile" - top="0" - width="317"> - <string - name="CaptionTextAcctInfo"> - [ACCTTYPE] -[PAYMENTINFO] [AGEVERIFICATION] - </string> - <string - name="payment_update_link_url"> - http://www.secondlife.com/account/billing.php?lang=en - </string> - <string - name="partner_edit_link_url"> - http://www.secondlife.com/account/partners.php?lang=en - </string> - <string - name="my_account_link_url" - value="http://secondlife.com/account" /> - <string - name="no_partner_text" - value="None" /> - <string - name="no_group_text" - value="None" /> - <string - name="RegisterDateFormat"> - [REG_DATE] ([AGE]) - </string> - <string - name="name_text_args"> - [NAME] - </string> - <string - name="display_name_text_args"> - [DISPLAY_NAME] - </string> - <layout_stack - name="layout" - orientation="vertical" - follows="all" - layout="topleft" - left="0" - top="0" - height="400" - width="317" - border_size="0"> - <layout_panel - name="profile_stack" - follows="all" - layout="topleft" - top="0" - left="0" - height="400" - width="317"> - <scroll_container - color="DkGray2" - follows="all" - layout="topleft" - left="0" - name="profile_scroll" - opaque="true" - height="400" - width="317" - top="0"> - <panel - layout="topleft" - follows="left|top|right" - height="505" - min_height="505" - name="profile_scroll_panel" - top="0" - left="0" - width="297"> - <panel - follows="left|top|right" - height="124" - layout="topleft" - left="13" - name="second_life_image_panel" - top="0" - width="297"> - <texture_picker - allow_no_texture="true" - default_image_name="None" - enabled="false" - fallback_image="Generic_Person_Large" - follows="top|left" - height="124" - layout="topleft" - left="0" - name="2nd_life_pic" - top="10" - width="102" /> - <text - follows="left|top|right" - font.style="BOLD" - height="15" - layout="topleft" - left_pad="10" - name="title_sl_descr_text" - text_color="white" - top_delta="0" - value="[SECOND_LIFE]:" - width="180" /> - <expandable_text - follows="left|top|right" - height="97" - layout="topleft" - left="107" - textbox.max_length="512" - textbox.show_context_menu="true" - name="sl_description_edit" - top_pad="-3" - translate="false" - width="180" - expanded_bg_visible="true" - expanded_bg_color="DkGray"> - Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean viverra orci et justo sagittis aliquet.Nullamma lesuada mauris sit amet ipsum. adipiscing elit. Ae nean viverra orci et justo sagittis aliquet. Nullam malesuada mauris sit amet ipsum. adipiscing elit. Aenean viverra orci et justo sagittis aliquet. Nullam malesuada mauris sit amet ipsum. - </expandable_text> - </panel> - <panel - follows="left|top|right" - height="124" - layout="topleft" - top_pad="0" - left="13" - name="first_life_image_panel" - width="297"> - <texture_picker - allow_no_texture="true" - default_image_name="None" - enabled="false" - fallback_image="Generic_Person_Large" - follows="top|left" - height="124" - layout="topleft" - left="0" - name="real_world_pic" - width="102" /> - <text - follows="left|top|right" - font.style="BOLD" - height="15" - layout="topleft" - left_pad="10" - name="title_rw_descr_text" - text_color="white" - top_delta="0" - value="Real World:" - width="180" /> - <expandable_text - follows="left|top|right" - height="97" - layout="topleft" - left="107" - textbox.max_length="512" - textbox.show_context_menu="true" - name="fl_description_edit" - top_pad="-3" - translate="false" - width="180" - expanded_bg_visible="true" - expanded_bg_color="DkGray"> - Lorem ipsum dolor sit amet, consectetur adlkjpiscing elit moose moose. Aenean viverra orci et justo sagittis aliquet. Nullam malesuada mauris sit amet. adipiscing elit. Aenean rigviverra orci et justo sagittis aliquet. Nullam malesuada mauris sit amet sorbet ipsum. adipiscing elit. Aenean viverra orci et justo sagittis aliquet. Nullam malesuada mauris sit amet ipsum. - </expandable_text> - </panel> - <text - follows="left|top" - height="15" - font.style="BOLD" - font="SansSerifMedium" - layout="topleft" - left="10" - name="homepage_edit" - top_pad="0" - translate="false" - value="http://librarianavengers.org" - width="300" - word_wrap="false" - use_ellipses="true" /> - <text - follows="left|top" - font.style="BOLD" - height="10" - layout="topleft" - left="10" - name="title_member_text" - text_color="white" - top_pad="10" - value="Resident Since:" - width="300" /> - <text_editor - allow_scroll="false" - bg_visible="false" - follows="left|top" - h_pad="0" - height="15" - layout="topleft" - left="10" - name="register_date" - read_only="true" - translate="false" - v_pad="0" - value="05/31/2376" - width="300" - word_wrap="true" /> - <text - follows="left|top" - font.style="BOLD" - height="15" - layout="topleft" - left="10" - name="title_acc_status_text" - text_color="white" - top_pad="5" - value="Account Status:" - width="300" /> - <!-- <text - type="string" - follows="left|top" - font="SansSerifSmall" - height="15" - layout="topleft" - left_pad="10" - name="my_account_link" - top_delta="0" - value="Go to Dashboard" - width="100"/> --> - <text_editor - allow_scroll="false" - bg_visible="false" - follows="left|top" - h_pad="0" - height="28" - layout="topleft" - left="10" - name="acc_status_text" - read_only="true" - top_pad="0" - translate="false" - v_pad="0" - width="300" - word_wrap="true"> - Resident. No payment info on file. - Linden. - </text_editor> - <text - follows="left|top" - font.style="BOLD" - height="15" - layout="topleft" - left="10" - name="title_partner_text" - text_color="white" - top_pad="3" - value="Partner:" - width="300" /> - <panel - follows="left|top" - height="15" - layout="topleft" - left="10" - name="partner_data_panel" - top_pad="0" - width="300"> - <text - follows="left|top" - height="10" - initial_value="(retrieving)" - layout="topleft" - left="0" - parse_urls="true" - name="partner_text" - top="0" - use_ellipses="true" - width="300" /> - </panel> - <text - follows="left|top" - font.style="BOLD" - height="13" - layout="topleft" - left="10" - name="title_groups_text" - text_color="white" - top_pad="3" - value="Groups:" - width="300" /> - <expandable_text - follows="all" - height="103" - layout="topleft" - left="7" - name="sl_groups" - textbox.max_length="512" - textbox.show_context_menu="true" - top_pad="0" - translate="false" - width="290" - expanded_bg_visible="true" - expanded_bg_color="DkGray"> - Lorem ipsum dolor sit amet, consectetur adlkjpiscing elit moose moose. Aenean viverra orci et justo sagittis aliquet. Nullam malesuada mauris sit amet. adipiscing elit. Aenean rigviverra orci et justo sagittis aliquet. Nullam malesuada mauris sit amet sorbet ipsum. adipiscing elit. Aenean viverra orci et justo sagittis aliquet. Nullam malesuada mauris sit amet ipsum. Aenean viverra tulip moosetop. Slan de heelish marfnik tooplod. Sum sum to whop de wompam booster copm. - </expandable_text> - </panel> - </scroll_container> - </layout_panel> - -</layout_stack> - - <layout_stack - name="layout_verb_buttons" - orientation="horizontal" - follows="bottom|left|right" - layout="topleft" - left="2" - top_pad="1" - height="30" - width="315" - border_size="0"> - <layout_panel - follows="bottom|left" - height="30" - layout="topleft" - name="profile_buttons_panel" - top="0" - auto_resize="false" - width="317"> - - <layout_stack - follows="bottom|left|right" - height="23" - layout="topleft" - name="bottom_bar_ls" - left="0" - orientation="horizontal" - top_pad="5" - width="317"> - - <layout_panel - follows="bottom|left|right" - height="23" - layout="bottomleft" - left="0" - name="add_friend_btn_lp" - user_resize="false" - auto_resize="true" - width="121"> - <button - follows="bottom|left|right" - height="23" - label="Add Friend" - layout="topleft" - left="1" - mouse_opaque="false" - name="add_friend" - tool_tip="Offer friendship to the Resident" - top="0" - width="120" /> - </layout_panel> - - <layout_panel - follows="bottom|left|right" - height="23" - layout="bottomleft" - left_pad="3" - name="im_btn_lp" - user_resize="false" - auto_resize="true" - width="22"> - <button - follows="bottom|left|right" - height="23" - label="IM" - layout="topleft" - name="im" - tool_tip="Open instant message session" - top="0" - left="1" - width="21" /> - </layout_panel> - - <layout_panel - follows="bottom|left|right" - height="23" - layout="bottomleft" - left_pad="3" - name="call_btn_lp" - user_resize="false" - auto_resize="true" - width="52"> - <button - follows="bottom|left|right" - height="23" - label="Call" - layout="topleft" - name="call" - tool_tip="Call this Resident" - left="1" - top="0" - use_ellipses="true" - width="51" /> - </layout_panel> - - <layout_panel - follows="bottom|left|right" - height="23" - layout="bottomleft" - left_pad="3" - name="chat_btn_lp" - user_resize="false" - auto_resize="true" - width="93"> - <button - follows="bottom|left|right" - height="23" - label="Teleport" - layout="topleft" - name="teleport" - tool_tip="Offer teleport" - left="1" - top="0" - use_ellipses="true" - width="92" /> - </layout_panel> - - <layout_panel - follows="bottom|left|right" - height="23" - layout="bottomleft" - left_pad="3" - name="overflow_btn_lp" - user_resize="false" - auto_resize="false" - width="24"> - <menu_button - follows="bottom|left|right" - height="23" - label="▼" - layout="topleft" - name="overflow_btn" - tool_tip="Pay money to or share inventory with the Resident" - left="1" - top="0" - width="23" /> - </layout_panel> - </layout_stack> - </layout_panel> - </layout_stack> - -</panel> diff --git a/indra/newview/skins/default/xui/en/panel_profile_view.xml b/indra/newview/skins/default/xui/en/panel_profile_view.xml deleted file mode 100644 index 646875b52e..0000000000 --- a/indra/newview/skins/default/xui/en/panel_profile_view.xml +++ /dev/null @@ -1,162 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes" ?> -<panel - background_visible="true" - follows="all" - height="570" - layout="topleft" - min_height="350" - name="panel_target_profile" - left="0" - width="333"> - <string - name="status_online"> - Online - </string> - <string - name="status_offline"> - Offline - </string> - <button - follows="top|left" - height="24" - image_hover_unselected="BackButton_Over" - image_pressed="BackButton_Press" - image_unselected="BackButton_Off" - layout="topleft" - name="back" - left="10" - tab_stop="false" - top="2" - width="30" - use_draw_context_alpha="false" /> - <text - top="10" - follows="top|left" - height="13" - layout="topleft" - left="45" - name="display_name_label" - text_color="LtGray" - value="Display Name:" - width="80" /> - <text - top_delta="0" - follows="top|left" - height="13" - layout="topleft" - left="45" - name="solo_username_label" - text_color="LtGray" - value="Username:" - visible="false" - width="80" /> - <text - follows="top|right" - halign="right" - height="13" - layout="topleft" - right="-15" - name="status" - text_color="LtGray_50" - top_delta="0" - value="Online" - width="150" /> - <text - follows="top|left|right" - font="SansSerifBigBold" - height="29" - layout="topleft" - left="45" - name="user_name_small" - text_color="LtGray" - top="22" - value="Jack oh look at me this is a super duper long name" - use_ellipses="true" - word_wrap="true" - visible="false" - width="255" /> - <text - follows="top|left|right" - font="SansSerifHugeBold" - height="27" - layout="topleft" - left="45" - name="user_name" - text_color="LtGray" - translate="false" - top="25" - value="TestString PleaseIgnore" - visible="true" - use_ellipses="true" - width="258" /> - <button - name="copy_to_clipboard" - layout="topleft" - follows="top|right" - image_overlay="Copy" - top_delta="0" - right="-15" - height="21" - width="21" - tab_stop="false" - tool_tip="Copy to Clipboard"/> - <text - follows="top|left" - height="13" - layout="topleft" - left="45" - name="user_label" - text_color="LtGray" - top_pad="10" - value="Username:" - width="70" /> - <text - follows="top|left" - height="20" - layout="topleft" - left_pad="0" - name="user_slid" - text_color="EmphasisColor" - font="SansSerifBold" - top_delta="-2" - translate="false" - use_ellipses="true" - value="teststring.pleaseignore" - width="195" - wrap="true "/> - <tab_container - follows="all" - height="489" - halign="center" - layout="topleft" - left="5" - min_width="333" - name="tabs" - tab_min_width="80" - tab_height="30" - tab_position="top" - top_pad="5" - width="317"> - <panel - class="panel_profile" - filename="panel_profile.xml" - label="PROFILE" - layout="topleft" - help_topic="profile_profile_tab" - name="panel_profile" /> - <panel - class="panel_picks" - filename="panel_picks.xml" - label="PICKS" - layout="topleft" - help_topic="profile_picks_tab" - name="panel_picks" /> - <panel - class="panel_notes" - filename="panel_notes.xml" - label="NOTES & PRIVACY" - layout="topleft" - help_topic="profile_notes_tab" - name="panel_notes" /> - </tab_container> -</panel> diff --git a/indra/newview/skins/default/xui/en/panel_region_covenant.xml b/indra/newview/skins/default/xui/en/panel_region_covenant.xml index df16f6fd37..112f12500d 100644 --- a/indra/newview/skins/default/xui/en/panel_region_covenant.xml +++ b/indra/newview/skins/default/xui/en/panel_region_covenant.xml @@ -57,7 +57,7 @@ mouse_opaque="false" name="estate_name_text" top_delta="0" - width="150"> + width="350"> mainland </text> <text @@ -79,7 +79,7 @@ mouse_opaque="false" name="estate_owner_text" top_delta="0" - width="150"> + width="350"> (none) </text> <text diff --git a/indra/newview/skins/default/xui/en/panel_snapshot_inventory.xml b/indra/newview/skins/default/xui/en/panel_snapshot_inventory.xml new file mode 100644 index 0000000000..9057ebb65e --- /dev/null +++ b/indra/newview/skins/default/xui/en/panel_snapshot_inventory.xml @@ -0,0 +1,147 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<panel + height="380" + layout="topleft" + name="panel_snapshot_inventory" + width="490"> + <icon + follows="top|left" + height="18" + image_name="Snapshot_Inventory" + layout="topleft" + left="12" + mouse_opaque="true" + name="title_icon" + top="5" + width="18" /> + <text + follows="top|left|right" + font="SansSerifBold" + height="20" + layout="topleft" + left_pad="12" + length="1" + name="title" + right="-10" + text_color="white" + type="string" + top_delta="5"> + Save to My Inventory + </text> + <view_border + bevel_style="in" + follows="left|top|right" + height="1" + left="10" + layout="topleft" + name="hr" + right="-10" + top_pad="5" + /> + <text + bottom="35" + follows="top|left|right" + font="SansSerif" + height="56" + layout="topleft" + left="12" + length="1" + name="hint_lbl" + top_pad="10" + type="string" + word_wrap="true"> + Saving an image to your inventory costs L$[UPLOAD_COST]. To save your image as a texture select one of the square formats. + </text> + <combo_box + follows="top|left|right" + height="23" + label="Resolution" + layout="topleft" + left_delta="0" + name="texture_size_combo" + right="-10" + top_pad="10"> + <combo_box.item + label="Current Window" + name="CurrentWindow" + value="[i0,i0]" /> + <combo_box.item + label="Small (128x128)" + name="Small(128x128)" + value="[i128,i128]" /> + <combo_box.item + label="Medium (256x256)" + name="Medium(256x256)" + value="[i256,i256]" /> + <combo_box.item + label="Large (512x512)" + name="Large(512x512)" + value="[i512,i512]" /> + <combo_box.item + label="Custom" + name="Custom" + value="[i-1,i-1]" /> + </combo_box> + <spinner + allow_text_entry="false" + decimal_digits="0" + follows="left|top" + height="20" + increment="32" + label="Width" + label_width="40" + layout="topleft" + left="10" + max_val="6016" + min_val="32" + name="inventory_snapshot_width" + top_pad="10" + width="95" /> + <spinner + allow_text_entry="false" + decimal_digits="0" + follows="left|top" + height="20" + increment="32" + label="Height" + label_width="40" + layout="topleft" + left_pad="5" + max_val="6016" + min_val="32" + name="inventory_snapshot_height" + top_delta="0" + width="95" /> + <check_box + bottom_delta="20" + follows="left|top" + label="Constrain proportions" + layout="topleft" + left="10" + name="inventory_keep_aspect_check" + visible="false" /> + <button + follows="right|bottom" + height="23" + label="Cancel" + layout="topleft" + name="cancel_btn" + right="-32" + top="350" + width="100"> + <button.commit_callback + function="Inventory.Cancel" /> + </button> + <button + follows="right|bottom" + height="23" + label="Save" + layout="topleft" + left_delta="-106" + name="save_btn" + top_delta="0" + width="100"> + <button.commit_callback + function="Inventory.Save" /> + </button> +</panel> diff --git a/indra/newview/skins/default/xui/en/panel_snapshot_local.xml b/indra/newview/skins/default/xui/en/panel_snapshot_local.xml new file mode 100644 index 0000000000..ae0215a578 --- /dev/null +++ b/indra/newview/skins/default/xui/en/panel_snapshot_local.xml @@ -0,0 +1,236 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<panel + height="380" + layout="topleft" + name="panel_snapshot_local" + width="490"> + <icon + follows="top|left" + height="18" + image_name="Snapshot_Download" + layout="topleft" + left="12" + mouse_opaque="true" + name="title_icon" + top="5" + width="18" /> + <text + follows="top|left|right" + font="SansSerifBold" + height="20" + layout="topleft" + left_pad="12" + length="1" + name="title" + right="-10" + text_color="white" + type="string" + top_delta="4"> + Save to My Computer + </text> + <view_border + bevel_style="in" + follows="left|top|right" + height="1" + left="10" + layout="topleft" + name="hr" + right="-10" + top_pad="5" + /> + <combo_box + follows="left|top|right" + height="23" + label="Resolution" + layout="topleft" + left_delta="0" + name="local_size_combo" + right="-10" + top_pad="10"> + <combo_box.item + label="Current Window" + name="CurrentWindow" + value="[i0,i0]" /> + <combo_box.item + label="320x240" + name="320x240" + value="[i320,i240]" /> + <combo_box.item + label="640x480" + name="640x480" + value="[i640,i480]" /> + <combo_box.item + label="800x600" + name="800x600" + value="[i800,i600]" /> + <combo_box.item + label="1024x768" + name="1024x768" + value="[i1024,i768]" /> + <combo_box.item + label="1280x1024" + name="1280x1024" + value="[i1280,i1024]" /> + <combo_box.item + label="1600x1200" + name="1600x1200" + value="[i1600,i1200]" /> + <combo_box.item + label="Custom" + name="Custom" + value="[i-1,i-1]" /> + </combo_box> + <layout_stack + animate="false" + follows="all" + height="275" + layout="bottomleft" + name="local_image_params_ls" + left_delta="0" + orientation="vertical" + top_pad="10" + right="-10"> + <layout_panel + follows="top|left|right" + height="60" + layout="topleft" + left="0" + name="local_image_size_lp" + user_resize="false" + auto_resize="false" + top="0" + right="-1" + visible="true"> + <spinner + allow_text_entry="false" + decimal_digits="0" + follows="left|top" + height="20" + increment="32" + label="Width" + label_width="40" + layout="topleft" + left="10" + max_val="6016" + min_val="32" + name="local_snapshot_width" + top_pad="10" + width="95" /> + <spinner + allow_text_entry="false" + decimal_digits="0" + follows="left|top" + height="20" + increment="32" + label="Height" + label_width="40" + layout="topleft" + left_pad="5" + max_val="6016" + min_val="32" + name="local_snapshot_height" + top_delta="0" + width="95" /> + <check_box + bottom_delta="20" + follows="left|top" + label="Constrain proportions" + layout="topleft" + left="10" + name="local_keep_aspect_check" /> + </layout_panel> + <layout_panel + follows="top|left|right" + height="23" + layout="topleft" + left="0" + name="local_image_format_quality_lp" + user_resize="false" + auto_resize="true" + top="0" + right="-1" + visible="true"> + <combo_box + follows="left|top" + height="23" + label="Format" + layout="topleft" + left_delta="0" + name="local_format_combo" + top_pad="0" + width="120"> + <combo_box.item + label="PNG (Lossless)" + name="PNG" + value="PNG" /> + <combo_box.item + label="JPEG" + name="JPEG" + value="JPEG" /> + <combo_box.item + label="BMP (Lossless)" + name="BMP" + value="BMP" /> + </combo_box> + <slider + decimal_digits="0" + follows="left|top" + height="15" + increment="1" + initial_value="75" + label="Image quality" + label_width="80" + layout="topleft" + left="10" + max_val="100" + name="image_quality_slider" + top_pad="7" + width="200" /> + <text + type="string" + follows="left|top" + font="SansSerifSmall" + length="1" + height="14" + layout="topleft" + left_pad="-5" + halign="left" + name="image_quality_level" + top_delta="0" + width="60"> + ([QLVL]) + </text> + </layout_panel> + </layout_stack> + <button + follows="right|bottom" + height="23" + label="Cancel" + layout="topleft" + name="cancel_btn" + right="-32" + top="350" + width="100"> + <button.commit_callback + function="Local.Cancel" /> + </button> + <flyout_button + follows="right|bottom" + height="23" + label="Save" + layout="topleft" + left_delta="-106" + name="save_btn" + tool_tip="Save image to a file" + top_delta="0" + width="100"> + <flyout_button.item + label="Save" + name="save_item" + value="save" /> + <flyout_button.item + label="Save As..." + name="saveas_item" + value="save as" /> + </flyout_button> +</panel> diff --git a/indra/newview/skins/default/xui/en/panel_snapshot_options.xml b/indra/newview/skins/default/xui/en/panel_snapshot_options.xml new file mode 100644 index 0000000000..d2f29ade44 --- /dev/null +++ b/indra/newview/skins/default/xui/en/panel_snapshot_options.xml @@ -0,0 +1,84 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<panel + follows="all" + height="240" + layout="topleft" + name="panel_snapshot_options" + width="490"> + <button + follows="left|top|right" + font="SansSerif" + halign="left" + height="38" + image_overlay="Snapshot_Profile" + image_overlay_alignment="left" + image_top_pad="-2" + imgoverlay_label_space="10" + label="Post to My Profile Feed" + layout="topleft" + left="10" + name="save_to_profile_btn" + pad_left="10" + right="-10" + top="5"> + <button.commit_callback + function="Snapshot.SaveToProfile" /> + </button> + <button + follows="left|top|right" + font="SansSerif" + halign="left" + height="38" + image_overlay="Snapshot_Email" + image_overlay_alignment="left" + image_top_pad="-2" + imgoverlay_label_space="10" + label="Email" + layout="topleft" + left_delta="0" + name="save_to_email_btn" + pad_left="10" + right="-10" + top_pad="10"> + <button.commit_callback + function="Snapshot.SaveToEmail" /> + </button> + <button + follows="left|top|right" + font="SansSerif" + halign="left" + height="38" + image_overlay="Snapshot_Inventory" + image_overlay_alignment="left" + image_top_pad="-2" + imgoverlay_label_space="10" + label="Save to My Inventory (L$[AMOUNT])" + layout="topleft" + left_delta="0" + name="save_to_inventory_btn" + pad_left="10" + right="-10" + top_pad="10"> + <button.commit_callback + function="Snapshot.SaveToInventory" /> + </button> + <button + follows="left|top|right" + font="SansSerif" + halign="left" + height="38" + image_overlay="Snapshot_Download" + image_overlay_alignment="left" + image_top_pad="-2" + imgoverlay_label_space="10" + label="Save to My Computer" + layout="topleft" + left_delta="0" + name="save_to_computer_btn" + pad_left="10" + right="-10" + top_pad="10"> + <button.commit_callback + function="Snapshot.SaveToComputer" /> + </button> +</panel> diff --git a/indra/newview/skins/default/xui/en/panel_snapshot_postcard.xml b/indra/newview/skins/default/xui/en/panel_snapshot_postcard.xml new file mode 100644 index 0000000000..d8ff043444 --- /dev/null +++ b/indra/newview/skins/default/xui/en/panel_snapshot_postcard.xml @@ -0,0 +1,107 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<panel + height="380" + layout="topleft" + name="panel_snapshot_postcard" + width="490"> + <string + name="default_subject"> + Postcard from [SECOND_LIFE]. + </string> + <string + name="default_message"> + Check this out! + </string> + <string + name="upload_message"> + Sending... + </string> + <string + name="default_subject"> + Postcard from [SECOND_LIFE]. + </string> + <string + name="default_message"> + Check this out! + </string> + <icon + follows="top|left" + height="18" + image_name="Snapshot_Email" + layout="topleft" + left="12" + mouse_opaque="true" + name="title_icon" + top="5" + width="18" /> + <text + follows="top|left|right" + font="SansSerifBold" + height="20" + layout="topleft" + left_pad="12" + length="1" + name="title" + right="-10" + text_color="white" + type="string" + top_delta="3"> + Email + </text> + <button + follows="right|top" + height="23" + is_toggle="true" + label="Message" + layout="topleft" + name="message_btn" + right="-82" + top_delta="-7" + width="70"> + <button.commit_callback + function="Postcard.Message" /> + </button> + <button + follows="right|top" + height="23" + is_toggle="true" + label="Settings" + layout="topleft" + name="settings_btn" + top_delta="0" + right="-10" + width="70"> + <button.commit_callback + function="Postcard.Settings" /> + </button> + <view_border + bevel_style="in" + follows="left|top|right" + height="1" + left="10" + layout="topleft" + name="hr" + right="-10" + top_pad="5" + /> + <panel_container + follows="all" + height="340" + layout="topleft" + left="0" + name="postcard_panel_container" + default_panel_name="panel_postcard_message" + top_pad="10" + width="490"> + <panel + follows="all" + layout="topleft" + name="panel_postcard_message" + filename="panel_postcard_message.xml" /> + <panel + follows="all" + layout="topleft" + name="panel_postcard_settings" + filename="panel_postcard_settings.xml" /> + </panel_container> +</panel> diff --git a/indra/newview/skins/default/xui/en/panel_snapshot_profile.xml b/indra/newview/skins/default/xui/en/panel_snapshot_profile.xml new file mode 100644 index 0000000000..91ac9ad658 --- /dev/null +++ b/indra/newview/skins/default/xui/en/panel_snapshot_profile.xml @@ -0,0 +1,200 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<panel + height="380" + layout="topleft" + name="panel_snapshot_profile" + width="490"> + <icon + follows="top|left" + height="18" + image_name="Snapshot_Profile" + layout="topleft" + left="12" + mouse_opaque="true" + name="title_icon" + top="5" + width="18" /> + <text + follows="top|left|right" + font="SansSerifBold" + height="20" + layout="topleft" + left_pad="12" + length="1" + name="title" + right="-10" + text_color="white" + type="string" + top_delta="4"> + Post to My Profile Feed + </text> + <view_border + bevel_style="in" + follows="left|top|right" + height="1" + left="10" + layout="topleft" + name="hr" + right="-10" + top_pad="5" + /> + <combo_box + follows="left|top" + height="23" + label="Resolution" + layout="topleft" + left_delta="0" + name="profile_size_combo" + top_pad="10" + width="250"> + <combo_box.item + label="Current Window" + name="CurrentWindow" + value="[i0,i0]" /> + <combo_box.item + label="640x480" + name="640x480" + value="[i640,i480]" /> + <combo_box.item + label="800x600" + name="800x600" + value="[i800,i600]" /> + <combo_box.item + label="1024x768" + name="1024x768" + value="[i1024,i768]" /> + <combo_box.item + label="Custom" + name="Custom" + value="[i-1,i-1]" /> + </combo_box> + <layout_stack + animate="false" + follows="all" + height="270" + layout="bottomleft" + name="profile_image_params_ls" + left_delta="0" + orientation="vertical" + top_pad="10" + right="-10"> + <layout_panel + follows="top|left|right" + height="55" + layout="topleft" + left="0" + name="profile_image_size_lp" + user_resize="false" + auto_resize="false" + top="0" + right="-1" + visible="true"> + <spinner + allow_text_entry="false" + decimal_digits="0" + follows="left|top" + height="20" + increment="32" + label="Width" + label_width="40" + layout="topleft" + left="10" + max_val="6016" + min_val="32" + name="profile_snapshot_width" + top_pad="10" + width="95" /> + <spinner + allow_text_entry="false" + decimal_digits="0" + follows="left|top" + height="20" + increment="32" + label="Height" + label_width="40" + layout="topleft" + left_pad="5" + max_val="6016" + min_val="32" + name="profile_snapshot_height" + top_delta="0" + width="95" /> + <check_box + bottom_delta="20" + label="Constrain proportions" + layout="topleft" + left="10" + name="profile_keep_aspect_check" /> + </layout_panel> + <layout_panel + follows="top|left|right" + height="200" + layout="topleft" + left="0" + name="profile_image_metadata_lp" + user_resize="false" + auto_resize="true" + top="0" + right="-1" + visible="true"> + <text + length="1" + follows="top|left|right" + font="SansSerif" + height="16" + layout="topleft" + left="0" + name="caption_label" + right="-10" + top_pad="0" + type="string"> + Caption: + </text> + <text_editor + follows="all" + height="155" + layout="topleft" + left_delta="0" + length="1" + max_length="700" + name="caption" + right="-10" + top_pad="5" + type="string" + word_wrap="true"> + </text_editor> + <check_box + follows="left|bottom" + initial_value="true" + label="Include location" + layout="topleft" + left_delta="0" + name="add_location_cb" + top_pad="15" /> + </layout_panel> + </layout_stack> + <button + follows="right|bottom" + height="23" + label="Cancel" + layout="topleft" + name="cancel_btn" + right="-32" + top="350" + width="100"> + <button.commit_callback + function="PostToProfile.Cancel" /> + </button> + <button + follows="right|bottom" + height="23" + label="Post" + layout="topleft" + left_delta="-106" + name="post_btn" + top_delta="0" + width="100"> + <button.commit_callback + function="PostToProfile.Send" /> + </button> +</panel> diff --git a/indra/newview/skins/default/xui/en/panel_status_bar.xml b/indra/newview/skins/default/xui/en/panel_status_bar.xml index 422bbada7f..3239c4e531 100644 --- a/indra/newview/skins/default/xui/en/panel_status_bar.xml +++ b/indra/newview/skins/default/xui/en/panel_status_bar.xml @@ -2,7 +2,7 @@ <panel background_opaque="true" background_visible="true" - bg_opaque_color="MouseGray" + bg_opaque_color="DkGray" chrome="true" follows="top|right" height="19" @@ -39,10 +39,7 @@ width="160" top="1" follows="right|top" - name="balance_bg" - bg_visible="true" - background_opaque="true" - bg_opaque_image="bevel_background"> + name="balance_bg"> <text halign="center" font="SansSerifSmall" diff --git a/indra/newview/skins/default/xui/en/panel_toast.xml b/indra/newview/skins/default/xui/en/panel_toast.xml index b9e714dd30..062c403a26 100644 --- a/indra/newview/skins/default/xui/en/panel_toast.xml +++ b/indra/newview/skins/default/xui/en/panel_toast.xml @@ -21,7 +21,6 @@ width="310" left="0" top="0" - follows="right|bottom" background_visible="false" bg_opaque_image="Toast_Over" bg_alpha_image="Toast_Background" diff --git a/indra/newview/skins/default/xui/en/panel_topinfo_bar.xml b/indra/newview/skins/default/xui/en/panel_topinfo_bar.xml index 79f29777ce..fc527f5f9d 100644 --- a/indra/newview/skins/default/xui/en/panel_topinfo_bar.xml +++ b/indra/newview/skins/default/xui/en/panel_topinfo_bar.xml @@ -4,7 +4,7 @@ background_opaque="false" bg_opaque_color="Black_50" bg_alpha_color="Black_50" - follows="left|top|right" + follows="left|top" height="19" layout="topleft" name="topinfo_bar" diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml index c4031de0f8..c25d1f57d6 100644 --- a/indra/newview/skins/default/xui/en/strings.xml +++ b/indra/newview/skins/default/xui/en/strings.xml @@ -2183,6 +2183,8 @@ Returns a string with the requested data about the region <string name="Stomach">Stomach</string> <string name="Left Pec">Left Pec</string> <string name="Right Pec">Right Pec</string> + <string name="Neck">Neck</string> + <string name="Avatar Center">Avatar Center</string> <string name="Invalid Attachment">Invalid Attachment Point</string> <!-- Avatar age computation, see LLDateUtil::ageFromDate --> @@ -2269,7 +2271,7 @@ Returns a string with the requested data about the region <string name="NextStipendDay" value="The next stipend day is " /> <string name="GroupPlanningDate">[mthnum,datetime,utc]/[day,datetime,utc]/[year,datetime,utc]</string> <string name="GroupIndividualShare" value=" Group Individual Share" /> - <string name="GroupColumn" value=" Group" /> + <string name="GroupColumn" value=" Group" /> <string name="Balance">Balance</string> <string name="Credits">Credits</string> <string name="Debits">Debits</string> @@ -3529,6 +3531,10 @@ Try enclosing path to the editor with double quotes. <string name="ExternalEditorCommandParseError">Error parsing the external editor command.</string> <string name="ExternalEditorFailedToRun">External editor failed to run.</string> + <!-- Machine translation of chat messahes --> + <string name="TranslationFailed">Translation failed: [REASON]</string> + <string name="TranslationResponseParseError">Error parsing translation response.</string> + <!-- Key names begin --> <string name="Esc">Esc</string> <string name="Space">Space</string> @@ -3668,7 +3674,7 @@ Try enclosing path to the editor with double quotes. <string name="Command_Map_Label">Map</string> <string name="Command_Marketplace_Label">Marketplace</string> <string name="Command_MiniMap_Label">Mini-map</string> - <string name="Command_Move_Label">Move</string> + <string name="Command_Move_Label">Walk / run / fly</string> <string name="Command_People_Label">People</string> <string name="Command_Picks_Label">Picks</string> <string name="Command_Places_Label">Places</string> @@ -3677,7 +3683,7 @@ Try enclosing path to the editor with double quotes. <string name="Command_Search_Label">Search</string> <string name="Command_Snapshot_Label">Snapshot</string> <string name="Command_Speak_Label">Speak</string> - <string name="Command_View_Label">View</string> + <string name="Command_View_Label">Camera controls</string> <string name="Command_Voice_Label">Voice settings</string> <string name="Command_AboutLand_Tooltip">Information about the land you're visiting</string> @@ -3705,6 +3711,10 @@ Try enclosing path to the editor with double quotes. <string name="Command_View_Tooltip">Changing camera angle</string> <string name="Command_Voice_Tooltip">Volume controls for calls and people near you in world</string> + <string name="Toolbar_Bottom_Tooltip">currently in your bottom toolbar</string> + <string name="Toolbar_Left_Tooltip" >currently in your left toolbar</string> + <string name="Toolbar_Right_Tooltip" >currently in your right toolbar</string> + <!-- Mesh UI terms --> <string name="Retain%">Retain%</string> <string name="Detail">Detail</string> @@ -3714,4 +3724,12 @@ Try enclosing path to the editor with double quotes. <string name="Wrap">Wrap</string> <string name="Preview">Preview</string> <string name="Normal">Normal</string> + + <!-- Snapshot image quality levels --> + <string name="snapshot_quality_very_low">Very Low</string> + <string name="snapshot_quality_low">Low</string> + <string name="snapshot_quality_medium">Medium</string> + <string name="snapshot_quality_high">High</string> + <string name="snapshot_quality_very_high">Very High</string> + </strings> diff --git a/indra/newview/skins/default/xui/en/teleport_strings.xml b/indra/newview/skins/default/xui/en/teleport_strings.xml index bae821d3b5..dce6b8dd6d 100644 --- a/indra/newview/skins/default/xui/en/teleport_strings.xml +++ b/indra/newview/skins/default/xui/en/teleport_strings.xml @@ -20,6 +20,10 @@ If you still cannot teleport, please log out and log back in to resolve the prob Sorry, but system was unable to complete the teleport connection. Try again in a moment. </message> + <message name="NoHelpIslandTP"> +You cannot teleport back to Welcome Island. +Go to 'Welcome Island Public' to repeat the tutorial. + </message> <message name="noaccess_tport"> Sorry, you do not have access to that teleport destination. </message> diff --git a/indra/newview/skins/default/xui/en/widgets/chiclet_im_adhoc.xml b/indra/newview/skins/default/xui/en/widgets/chiclet_im_adhoc.xml index 413ca1d1ef..0e29ed0d0b 100644 --- a/indra/newview/skins/default/xui/en/widgets/chiclet_im_adhoc.xml +++ b/indra/newview/skins/default/xui/en/widgets/chiclet_im_adhoc.xml @@ -12,13 +12,20 @@ tab_stop="false" width="25" /> <chiclet_im_adhoc.speaker - auto_update="true" - draw_border="false" - height="23" - left="25" - name="speaker" - visible="false" - width="20" /> + image_mute="Parcel_VoiceNo_Light" + image_off="VoicePTT_Off_Dark" + image_on="VoicePTT_On_Dark" + image_level_1="VoicePTT_Lvl1_Dark" + image_level_2="VoicePTT_Lvl2_Dark" + image_level_3="VoicePTT_Lvl3_Dark" + auto_update="true" + draw_border="false" + height="24" + left="25" + bottom="1" + name="speaker" + visible="false" + width="20" /> <chiclet_im_adhoc.avatar_icon bottom="3" follows="left|top|bottom" diff --git a/indra/newview/skins/default/xui/en/widgets/chiclet_im_group.xml b/indra/newview/skins/default/xui/en/widgets/chiclet_im_group.xml index 372a89cbc7..77011139bf 100644 --- a/indra/newview/skins/default/xui/en/widgets/chiclet_im_group.xml +++ b/indra/newview/skins/default/xui/en/widgets/chiclet_im_group.xml @@ -12,13 +12,20 @@ tab_stop="false" width="25" /> <chiclet_im_group.speaker - auto_update="true" - draw_border="false" - height="25" - left="25" - name="speaker" - visible="false" - width="20" /> + image_mute="Parcel_VoiceNo_Light" + image_off="VoicePTT_Off_Dark" + image_on="VoicePTT_On_Dark" + image_level_1="VoicePTT_Lvl1_Dark" + image_level_2="VoicePTT_Lvl2_Dark" + image_level_3="VoicePTT_Lvl3_Dark" + auto_update="true" + draw_border="false" + height="24" + left="25" + bottom="1" + name="speaker" + visible="false" + width="20" /> <chiclet_im_group.group_icon bottom="3" default_icon="Generic_Group" diff --git a/indra/newview/skins/default/xui/en/widgets/chiclet_im_p2p.xml b/indra/newview/skins/default/xui/en/widgets/chiclet_im_p2p.xml index d27c14f4e7..8b56a8f0f6 100644 --- a/indra/newview/skins/default/xui/en/widgets/chiclet_im_p2p.xml +++ b/indra/newview/skins/default/xui/en/widgets/chiclet_im_p2p.xml @@ -12,13 +12,20 @@ tab_stop="false" width="25"/> <chiclet_im_p2p.speaker - auto_update="true" - draw_border="false" - height="23" - left="25" - name="speaker" - visible="false" - width="20" /> + image_mute="Parcel_VoiceNo_Light" + image_off="VoicePTT_Off_Dark" + image_on="VoicePTT_On_Dark" + image_level_1="VoicePTT_Lvl1_Dark" + image_level_2="VoicePTT_Lvl2_Dark" + image_level_3="VoicePTT_Lvl3_Dark" + auto_update="true" + draw_border="false" + height="24" + left="25" + bottom="1" + name="speaker" + visible="false" + width="20" /> <chiclet_im_p2p.avatar_icon bottom="3" color="white" diff --git a/indra/newview/skins/default/xui/en/widgets/inbox_folder_view_item.xml b/indra/newview/skins/default/xui/en/widgets/inbox_folder_view_item.xml new file mode 100644 index 0000000000..7a7a6e9a09 --- /dev/null +++ b/indra/newview/skins/default/xui/en/widgets/inbox_folder_view_item.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<inbox_folder_view_item + item_height="20" + item_top_pad="4" + selection_image="Rounded_Square" + > + <new_badge + label="New" + label_offset_horiz="-1" + location="right" + padding_horiz="12.5" + padding_vert="2" + location_offset_hcenter="-23" + border_image="New_Tag_Border" + border_color="DkGray2" + image="New_Tag_Background" + image_color="Black" + /> +</inbox_folder_view_item> diff --git a/indra/newview/skins/default/xui/en/widgets/toolbar.xml b/indra/newview/skins/default/xui/en/widgets/toolbar.xml index 7e7a9c61cf..0aa478ace9 100644 --- a/indra/newview/skins/default/xui/en/widgets/toolbar.xml +++ b/indra/newview/skins/default/xui/en/widgets/toolbar.xml @@ -30,6 +30,8 @@ image_overlay_alignment="left" use_ellipses="true" auto_resize="true" + button_flash_count="99999" + button_flash_rate="1.0" flash_color="EmphasisColor"/> <button_icon pad_left="10" pad_right="10" @@ -49,5 +51,7 @@ chrome="true" use_ellipses="true" auto_resize="true" + button_flash_count="99999" + button_flash_rate="1.0" flash_color="EmphasisColor"/> </toolbar> diff --git a/indra/newview/skins/default/xui/es/floater_about.xml b/indra/newview/skins/default/xui/es/floater_about.xml index 93bb8444b4..b7c9cc27ac 100644 --- a/indra/newview/skins/default/xui/es/floater_about.xml +++ b/indra/newview/skins/default/xui/es/floater_about.xml @@ -10,7 +10,7 @@ <floater.string name="AboutPosition"> Estás en la posición [POSITION_0,number,1], [POSITION_1,number,1], [POSITION_2,number,1], de [REGION], alojada en <nolink>[HOSTNAME]</nolink> ([HOSTIP]) [SERVER_VERSION] -[[SERVER_RELEASE_NOTES_URL] [ReleaseNotes]] +[SERVER_RELEASE_NOTES_URL] </floater.string> <floater.string name="AboutSystem"> CPU: [CPU] @@ -37,6 +37,9 @@ Versión del servidor de voz: [VOICE_VERSION] <floater.string name="AboutTraffic"> Paquetes perdidos: [PACKETS_LOST,number,0]/[PACKETS_IN,number,0] ([PACKETS_PCT,number,1]%) </floater.string> + <floater.string name="ErrorFetchingServerReleaseNotesURL"> + Error al obtener la URL de las notas de la versión del servidor. + </floater.string> <tab_container name="about_tab"> <panel label="Información" name="support_panel"> <button label="Copiar al portapapeles" name="copy_btn" width="165"/> diff --git a/indra/newview/skins/default/xui/es/floater_about_land.xml b/indra/newview/skins/default/xui/es/floater_about_land.xml index 83749fc535..b6391e28a0 100644 --- a/indra/newview/skins/default/xui/es/floater_about_land.xml +++ b/indra/newview/skins/default/xui/es/floater_about_land.xml @@ -213,19 +213,19 @@ Vaya al menú Mundo > Acerca del terreno o seleccione otra parcela para ver s Plus de objetos en la región: [BONUS] </text> <text name="Simulator primitive usage:"> - Uso de primitivas: + Capacidad de la región: </text> <text name="objects_available"> [COUNT] de un máx. de [MAX] ([AVAILABLE] disponibles) </text> <text name="Primitives parcel supports:"> - Prims que admite la parcela: + Capacidad del terreno de la parcela: </text> <text name="object_contrib_text"> [COUNT] </text> <text name="Primitives on parcel:"> - Prims en la parcela: + Impacto en el terreno de la parcela: </text> <text name="total_objects_text"> [COUNT] diff --git a/indra/newview/skins/default/xui/es/floater_avatar.xml b/indra/newview/skins/default/xui/es/floater_avatar.xml new file mode 100644 index 0000000000..7c87fbe01c --- /dev/null +++ b/indra/newview/skins/default/xui/es/floater_avatar.xml @@ -0,0 +1,2 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes"?> +<floater name="Avatar" title="SELECTOR DE AVATAR"/> diff --git a/indra/newview/skins/default/xui/es/floater_buy_currency.xml b/indra/newview/skins/default/xui/es/floater_buy_currency.xml index 43bbf0b70f..2c8848265f 100644 --- a/indra/newview/skins/default/xui/es/floater_buy_currency.xml +++ b/indra/newview/skins/default/xui/es/floater_buy_currency.xml @@ -46,7 +46,7 @@ [AMT] L$ </text> <text name="currency_links"> - [http://www.secondlife.com/my/account/payment_method_management.php método de pago] | [http://www.secondlife.com/my/account/currency.php moneda] | [http://www.secondlife.com/my/account/exchange_rates.php tipo de cambio] + [http://www.secondlife.com/my/account/payment_method_management.php método de pago] | [http://www.secondlife.com/my/account/currency.php moneda] </text> <text name="exchange_rate_note"> Vuelve a escribir la cantidad para ver el tipo de cambio más reciente. diff --git a/indra/newview/skins/default/xui/es/floater_camera.xml b/indra/newview/skins/default/xui/es/floater_camera.xml index 04f743b659..f8911f3a4a 100644 --- a/indra/newview/skins/default/xui/es/floater_camera.xml +++ b/indra/newview/skins/default/xui/es/floater_camera.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> -<floater name="camera_floater" title=""> +<floater name="camera_floater" title="VER"> <floater.string name="rotate_tooltip"> Girar la cámara alrededor de lo enfocado </floater.string> @@ -9,15 +9,6 @@ <floater.string name="move_tooltip"> Mover la cámara arriba y abajo, izquierda y derecha </floater.string> - <floater.string name="camera_modes_title"> - Modos de cámara - </floater.string> - <floater.string name="pan_mode_title"> - Orbital - Zoom - Panorámica - </floater.string> - <floater.string name="presets_mode_title"> - Vistas predefinidas - </floater.string> <floater.string name="free_mode_title"> Centrar el objeto </floater.string> diff --git a/indra/newview/skins/default/xui/es/floater_chat_bar.xml b/indra/newview/skins/default/xui/es/floater_chat_bar.xml new file mode 100644 index 0000000000..5e5ef616b8 --- /dev/null +++ b/indra/newview/skins/default/xui/es/floater_chat_bar.xml @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes"?> +<floater name="chat_bar" title="CHAT"> + <panel> + <line_editor label="Pulsa aquí para chatear." name="chat_box" tool_tip="Pulsa Enter para decirlo o Ctrl+Enter para gritarlo"/> + <button name="show_nearby_chat" tool_tip="Muestra o esconde el registro del chat"/> + </panel> +</floater> diff --git a/indra/newview/skins/default/xui/es/floater_destinations.xml b/indra/newview/skins/default/xui/es/floater_destinations.xml new file mode 100644 index 0000000000..df18698d2f --- /dev/null +++ b/indra/newview/skins/default/xui/es/floater_destinations.xml @@ -0,0 +1,2 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes"?> +<floater name="Destinations" title="DESTINOS"/> diff --git a/indra/newview/skins/default/xui/es/floater_fast_timers.xml b/indra/newview/skins/default/xui/es/floater_fast_timers.xml new file mode 100644 index 0000000000..eeb39583ef --- /dev/null +++ b/indra/newview/skins/default/xui/es/floater_fast_timers.xml @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes"?> +<floater name="fast_timers"> + <string name="pause"> + Pausa + </string> + <string name="run"> + Correr + </string> + <button label="Pausa" name="pause_btn"/> +</floater> diff --git a/indra/newview/skins/default/xui/es/floater_how_to.xml b/indra/newview/skins/default/xui/es/floater_how_to.xml new file mode 100644 index 0000000000..4a57dc3643 --- /dev/null +++ b/indra/newview/skins/default/xui/es/floater_how_to.xml @@ -0,0 +1,2 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes"?> +<floater name="floater_how_to" title="CÓMO"/> diff --git a/indra/newview/skins/default/xui/es/floater_map.xml b/indra/newview/skins/default/xui/es/floater_map.xml index 370b7f5053..69f638418e 100644 --- a/indra/newview/skins/default/xui/es/floater_map.xml +++ b/indra/newview/skins/default/xui/es/floater_map.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> -<floater name="Map" title=""> +<floater name="Map" title="MINIMAPA"> <floater.string name="ToolTipMsg"> [REGIÓN](Haz doble clic para abrir el mapa y pulsa la tecla Mayús y arrastra para obtener una vista panorámica) </floater.string> @@ -7,7 +7,7 @@ [REGION](Pulsa dos veces para teleportarte, pulsa mayús y arrastra para obtener una panorámica) </floater.string> <floater.string name="mini_map_caption"> - MINIMAPA + Minimapa </floater.string> <text label="N" name="floater_map_north" text="N"> N diff --git a/indra/newview/skins/default/xui/es/floater_model_preview.xml b/indra/newview/skins/default/xui/es/floater_model_preview.xml index 36f988b25f..3e77453612 100644 --- a/indra/newview/skins/default/xui/es/floater_model_preview.xml +++ b/indra/newview/skins/default/xui/es/floater_model_preview.xml @@ -1,10 +1,8 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> -<floater name="Model Preview" title="Cargar modelo"> - <string name="status_idle"> - Inactivo - </string> +<floater name="Model Preview" title="SUBIR MODELO"> + <string name="status_idle"/> <string name="status_parse_error"> - Problema de análisis de DAE - consulta los datos en el registro. + Error: Problema de análisis de DAE - consulta los datos en el registro. </string> <string name="status_reading_file"> Cargando... @@ -51,6 +49,9 @@ <string name="mesh_status_missing_lod"> Falta un nivel de detalle requerido. </string> + <string name="mesh_status_invalid_material_list"> + Los materiales con niveles de detalle no son un subconjunto del modelo de referencia. + </string> <string name="layer_all"> Todo </string> @@ -63,188 +64,211 @@ <string name="tbd"> TBD </string> - <text name="name_label"> - Nombre: - </text> - <text name="lod_label"> - Vista previa: - </text> - <combo_box name="preview_lod_combo" tool_tip="Nivel de detalle disponible en la vista previa"> - <combo_item name="high"> - Nivel de detalle: Alto - </combo_item> - <combo_item name="medium"> - Nivel de detalle: Media - </combo_item> - <combo_item name="low"> - Nivel de detalle: Bajo - </combo_item> - <combo_item name="lowest"> - Nivel de detalle: Mínimo - </combo_item> - </combo_box> - <text name="warning_title"> - ATENCIÓN: - </text> - <text name="warning_message"> - No podrás terminar de subir este modelo a los servidores de Second Life. [[VURL] Averigua cómo] puedes obtener autorización para subir modelos de malla. - </text> - <text name="weights_text"> - Descargar: -Física: -Servidor: - -Equiv. en prims: - </text> - <text name="weights"> - [ST] -[PH] -[SIM] - -[EQ] - </text> - <tab_container name="import_tab"> - <panel label="Nivel de detalle" name="lod_panel"> - <text name="lod_table_header"> - Seleccionar nivel de detalle: - </text> - <text name="high_label" value="Alto"/> - <text name="high_triangles" value="0"/> - <text name="high_vertices" value="0"/> - <text name="medium_label" value="Media"/> - <text name="medium_triangles" value="0"/> - <text name="medium_vertices" value="0"/> - <text name="low_label" value="Bajo"/> - <text name="low_triangles" value="0"/> - <text name="low_vertices" value="0"/> - <text name="lowest_label" value="Mínimo"/> - <text name="lowest_triangles" value="0"/> - <text name="lowest_vertices" value="0"/> - <text name="lod_table_footer"> - Nivel de detalle: [DETALLE] - </text> - <radio_group name="lod_file_or_limit" value="lod_from_file"> - <radio_item label="Cargar desde el archivo" name="lod_from_file"/> - <radio_item label="Generar automáticamente" name="lod_auto_generate"/> - <radio_item label="Ninguno" name="lod_none"/> - </radio_group> - <button label="Examinar..." name="lod_browse"/> - <combo_box name="lod_mode"> - <combo_item name="triangle_limit"> - Límite de triángulo - </combo_item> - <combo_item name="error_threshold"> - Margen de error - </combo_item> - </combo_box> - <text name="build_operator_text"> - Crear operador: + <panel name="left_panel"> + <panel name="model_name_representation_panel"> + <text name="name_label"> + Nombre del modelo: </text> - <text name="queue_mode_text"> - Modo de cola: + <text name="model_category_label"> + Este modelo representa... </text> - <combo_box name="build_operator"> - <combo_item name="edge_collapse"> - Cerrar bordes - </combo_item> - <combo_item name="half_edge_collapse"> - Cerrar la mitad de los bordes - </combo_item> - </combo_box> - <combo_box name="queue_mode"> - <combo_item name="greedy"> - Egoísta - </combo_item> - <combo_item name="lazy"> - Vago - </combo_item> - <combo_item name="independent"> - Independiente - </combo_item> + <combo_box name="model_category_combo"> + <combo_item label="Elegir uno..." name="Choose one"/> + <combo_item label="Forma del avatar" name="Avatar shape"/> + <combo_item label="Anexo del avatar" name="Avatar attachment"/> + <combo_item label="Objeto en movimiento (vehículo, animal)" name="Moving object (vehicle, animal)"/> + <combo_item label="Componente de construcción" name="Building Component"/> + <combo_item label="Grande, sin movimiento, etc." name="Large, non moving etc"/> + <combo_item label="Más pequeño, sin movimiento, etc." name="Smaller, non-moving etc"/> + <combo_item label="No es exactamente ninguno de estos" name="Not really any of these"/> </combo_box> - <text name="border_mode_text"> - Modo de borde: - </text> - <text name="share_tolderance_text"> - Tolerancia de uso compartido: - </text> - <combo_box name="border_mode"> - <combo_item name="border_unlock"> - Desbloquear - </combo_item> - <combo_item name="border_lock"> - Lock - </combo_item> - </combo_box> - <text name="crease_label"> - Ángulo de marca: - </text> - <spinner name="crease_angle" value="75"/> </panel> - <panel label="Física" name="physics_panel"> - <panel name="physics geometry"> - <radio_group name="physics_load_radio" value="physics_load_from_file"> - <radio_item label="Archivo:" name="physics_load_from_file"/> - <radio_item label="Utilizar nivel de detalle:" name="physics_use_lod"/> - </radio_group> - <combo_box name="physics_lod_combo" tool_tip="Nivel de detalle para forma física"> - <combo_item name="physics_lowest"> - Mínimo - </combo_item> - <combo_item name="physics_low"> - Bajo - </combo_item> - <combo_item name="physics_medium"> - Media - </combo_item> - <combo_item name="physics_high"> - Alto - </combo_item> - </combo_box> - <button label="Examinar..." name="physics_browse"/> + <tab_container name="import_tab"> + <panel label="Nivel de detalle" name="lod_panel" title="Nivel de detalle"> + <text initial_value="Origen" name="source" value="Origen"/> + <text initial_value="Triángulos" name="triangles" value="Triángulos"/> + <text initial_value="Vértices" name="vertices" value="Vértices"/> + <text initial_value="Alto" name="high_label" value="Alto"/> + <button label="Buscar..." name="lod_browse_high"/> + <text initial_value="0" name="high_triangles" value="0"/> + <text initial_value="0" name="high_vertices" value="0"/> + <text initial_value="Medio" name="medium_label" value="Medio"/> + <button label="Buscar..." name="lod_browse_medium"/> + <text initial_value="0" name="medium_triangles" value="0"/> + <text initial_value="0" name="medium_vertices" value="0"/> + <text initial_value="Bajo" name="low_label" value="Bajo"/> + <button label="Buscar..." name="lod_browse_low"/> + <text initial_value="0" name="low_triangles" value="0"/> + <text initial_value="0" name="low_vertices" value="0"/> + <text initial_value="Mínimo" name="lowest_label" value="Mínimo"/> + <button label="Buscar..." name="lod_browse_lowest"/> + <text initial_value="0" name="lowest_triangles" value="0"/> + <text initial_value="0" name="lowest_vertices" value="0"/> + <check_box label="Generar normales" name="gen_normals"/> + <text initial_value="Ángulo de pliegue:" name="crease_label" value="Ángulo de pliegue:"/> + <spinner name="crease_angle" value="75"/> </panel> - <panel name="physics analysis"> - <slider label="Leve:" name="Smooth"/> - <check_box label="Cerrar agujeros (lento)" name="Close Holes (Slow)"/> - <button label="Analizar" name="Decompose"/> - <button label="Cancelar" name="decompose_cancel"/> + <panel label="Física" name="physics_panel"> + <panel name="physics geometry"> + <text name="first_step_name"> + Paso 1: Nivel de detalle + </text> + <combo_box name="physics_lod_combo" tool_tip="Niveles de detalle para utilizar con la forma física"> + <combo_item name="choose_one"> + Elegir uno... + </combo_item> + <combo_item name="physics_high"> + Alto + </combo_item> + <combo_item name="physics_medium"> + Medio + </combo_item> + <combo_item name="physics_low"> + Bajo + </combo_item> + <combo_item name="physics_lowest"> + Mínimo + </combo_item> + <combo_item name="load_from_file"> + De archivo + </combo_item> + </combo_box> + <button label="Buscar..." name="physics_browse"/> + </panel> + <panel name="physics analysis"> + <text name="method_label"> + Paso 2: Analizar + </text> + <text name="analysis_method_label"> + Método: + </text> + <text name="quality_label"> + Calidad: + </text> + <text name="smooth_method_label"> + Leve: + </text> + <check_box label="Cerrar agujeros" name="Close Holes (Slow)"/> + <button label="Analizar" name="Decompose"/> + <button label="Cancelar" name="decompose_cancel"/> + </panel> + <panel name="physics simplification"> + <text name="second_step_label"> + Paso 3: Simplificar + </text> + <text name="simp_method_header"> + Método: + </text> + <text name="pass_method_header"> + Pases: + </text> + <text name="Detail Scale label"> + Escala de detalle: + </text> + <text name="Retain%_label"> + Retención: + </text> + <combo_box name="Combine Quality" value="1"/> + <button label="Simplificar" name="Simplify"/> + <button label="Cancelar" name="simplify_cancel"/> + </panel> + <panel name="physics info"> + <text name="results_text"> + Resultados: + </text> + <text name="physics_triangles"> + Triángulos: [TRIANGLES], + </text> + <text name="physics_points"> + Vértices: [POINTS], + </text> + <text name="physics_hulls"> + Apariencias: [HULLS] + </text> + </panel> </panel> - <panel name="physics simplification"> - <slider label="Pases:" name="Combine Quality"/> - <slider label="Escala de detalle:" name="Detail Scale"/> - <slider label="Retener:" name="Retain%"/> - <button label="Simplificar" name="Simplify"/> - <button label="Cancelar" name="simplify_cancel"/> - </panel> - <panel name="physics info"> - <slider label="Ampliación de vista previa:" name="physics_explode"/> - <text name="physics_triangles"> - Triángulos: [TRIÁNGULOS] + <panel label="Opciones de subida" name="modifiers_panel"> + <text name="scale_label"> + Escala (1=sin ajuste de escala): + </text> + <spinner name="import_scale" value="1.0"/> + <text name="dimensions_label"> + Dimensiones: </text> - <text name="physics_points"> - Intersecciones: [PUNTOS] + <text name="import_dimensions"> + [X] X [Y] X [Z] </text> - <text name="physics_hulls"> - Aspecto exterior: [ASPECTO EXTERIOR] + <check_box label="Incluir texturas" name="upload_textures"/> + <text name="include_label"> + Solo para modelos de avatar: </text> + <check_box label="Incluir el peso de la piel" name="upload_skin"/> + <check_box label="Incluir posturas de las articulaciones" name="upload_joints"/> + <text name="pelvis_offset_label"> + Desplazamiento Z (subir o bajar el avatar): + </text> + <spinner name="pelvis_offset" value="0.0"/> </panel> - </panel> - <panel label="Modificadores" name="modifiers_panel"> - <spinner name="import_scale" value="1.0"/> - <text name="import_dimensions"> - [X] x [Y] x [Z] m + </tab_container> + <panel name="weights_and_warning_panel"> + <button label="Calcular pesos y precio" name="calculate_btn" tool_tip="Calcular pesos y precio"/> + <button label="Cancelar" name="cancel_btn"/> + <button label="subir" name="ok_btn" tool_tip="Subir al simulador"/> + <button label="Limpiar la configuración y reiniciar el formulario" name="reset_btn"/> + <text name="upload_fee"> + Precio de subida: L$ [FEE] + </text> + <text name="prim_weight"> + Impacto en el terreno: [EQ] + </text> + <text name="download_weight"> + Descargar: [ST] + </text> + <text name="physics_weight"> + Física: [PH] + </text> + <text name="server_weight"> + Servidor: [SIM] + </text> + <text name="warning_title"> + NOTA: + </text> + <text name="warning_message"> + No tienes derechos para subir modelos de malla. [[VURL] Averigua cómo] puedes obtener la autorización. + </text> + <text name="status"> + [STATUS] </text> - <check_box label="Texturas" name="upload_textures"/> - <check_box label="Peso de la piel" name="upload_skin"/> - <check_box label="Posturas de las articulaciones" name="upload_joints"/> - <spinner name="pelvis_offset" value="0.0"/> </panel> - </tab_container> - <text name="upload_fee"> - Precio de subida: L$ [FEE] + </panel> + <text name="lod_label"> + Vista previa: </text> - <button label="Establecer en valores predeterminados" name="reset_btn" tool_tip="Establecer en valores predeterminados"/> - <button label="Calcular pesos y precio" name="calculate_btn" tool_tip="Calcular pesos y precio"/> - <button label="Subir" name="ok_btn" tool_tip="Cargar al simulador"/> - <button label="Cancelar" name="cancel_btn"/> + <panel name="right_panel"> + <combo_box name="preview_lod_combo" tool_tip="LOD para ver en renderizado de prueba"> + <combo_item name="high"> + Alto + </combo_item> + <combo_item name="medium"> + Media + </combo_item> + <combo_item name="low"> + Bajo + </combo_item> + <combo_item name="lowest"> + Mínimo + </combo_item> + </combo_box> + <text name="label_display"> + Mostrar... + </text> + <check_box label="Bordes" name="show_edges"/> + <check_box label="Física" name="show_physics"/> + <check_box label="Texturas" name="show_textures"/> + <check_box label="Pesos de la piel" name="show_skin_weight"/> + <check_box label="Articulaciones" name="show_joint_positions"/> + <text name="physics_explode_label"> + Ampliación de vista previa: + </text> + </panel> </floater> diff --git a/indra/newview/skins/default/xui/es/floater_model_wizard.xml b/indra/newview/skins/default/xui/es/floater_model_wizard.xml index 86de557ed9..c4eb5e955a 100644 --- a/indra/newview/skins/default/xui/es/floater_model_wizard.xml +++ b/indra/newview/skins/default/xui/es/floater_model_wizard.xml @@ -6,26 +6,20 @@ <button label="2. Optimizar" name="optimize_btn"/> <button label="1. Seleccionar archivo" name="choose_file_btn"/> <panel name="choose_file_panel"> - <panel name="choose_file_header_panel"> - <text name="choose_file_header_text"> + <panel name="header_panel"> + <text name="header_text"> Elige el archivo de modelo </text> </panel> - <panel name="choose_file_content_panel"> + <panel name="content"> <text name="advanced_users_text"> Usuarios avanzados: si tienes experiencia con las herramientas de creación de contenidos 3D, quizá te interese utilizar la función de subida avanzada. </text> <button label="Cambiar al modo Avanzado" name="switch_to_advanced"/> - <text name="choose_model_file_label"> + <text name="Cache location"> Elige el archivo de modelo que deseas subir </text> <button label="Buscar..." label_selected="Buscar..." name="browse"/> - <text name="support_collada_text"> - Second Life admite los archivos COLLADA (.dae) - </text> - <text name="dimensions_label"> - Dimensiones (metros): - </text> <text name="dimensions"> X Y Z </text> @@ -38,18 +32,15 @@ </panel> </panel> <panel name="optimize_panel"> - <panel name="optimize_header_panel"> - <text name="optimize_header_text"> + <panel name="header_panel"> + <text name="header_text"> Optimizar el modelo </text> </panel> - <text name="optimize_hint"> + <text name="description"> Hemos optimizado el rendimiento del modelo, pero puedes ajustarlo más si lo deseas. </text> - <panel name="optimize_content_panel"> - <text name="generating_lod_label"> - Generando el nivel de detalle - </text> + <panel name="content"> <text name="high_detail_text"> Generar el nivel de detalle: Alto </text> @@ -64,123 +55,64 @@ </text> </panel> <panel name="content2"> - <text name="optimize_performance_text"> - Rendimiento - </text> - <text name="optimize_faster_rendering_text"> - Renderizado más rápido -Menos detalles -Menos peso de prim - </text> - <text name="optimize_accuracy_text"> - Precisión - </text> - <text name="optimize_slower_rendering_text"> - Renderizado más lento -Más detalles -Más peso de prim - </text> - <text name="accuracy_slider_mark1"> - ' - </text> - <text name="accuracy_slider_mark2"> - ' - </text> - <text name="accuracy_slider_mark3"> - ' - </text> <button label="Recalcular la geometría" name="recalculate_geometry_btn"/> - <text name="geometry_preview_label"> + <text name="lod_label"> Vista previa de geometría </text> <combo_box name="preview_lod_combo" tool_tip="LOD para ver en renderizado de prueba"> - <combo_item name="preview_lod_high"> + <combo_item name="high"> Detalle alto </combo_item> - <combo_item name="preview_lod_medium"> + <combo_item name="medium"> Detalles medios </combo_item> - <combo_item name="preview_lod_low"> + <combo_item name="low"> Detalle bajo </combo_item> - <combo_item name="preview_lod_lowest"> + <combo_item name="lowest"> Detalles mínimos </combo_item> </combo_box> </panel> </panel> <panel name="physics_panel"> - <panel name="physics_header_panel"> - <text name="physics_header_text"> + <panel name="header_panel"> + <text name="header_text"> Ajustar la física </text> </panel> - <text name="physics_hint"> + <text name="description"> Crearemos una forma para la apariencia exterior del modelo. Ajusta el nivel de detalle de la forma según se necesite para el propósito proyectado del modelo. </text> - <panel name="physics_content_panel"> - <text name="physics_performance_text"> - Rendimiento - </text> - <text name="physics_faster_rendering_text"> - Renderizado más rápido -Menos detalles -Menos peso de prim - </text> - <text name="physics_accuracy_text"> - Precisión - </text> - <text name="physics_slower_dendering_text"> - Renderizado más lento -Más detalles -Más peso de prim - </text> - <text name="physics_example_1"> - Ejemplos: -Objetos en movimiento -Objetos voladores -Vehículos - </text> - <text name="physics_example_2"> - Ejemplos: -Objetos estáticos pequeños -Objetos con menos detalles -Muebles sencillos - </text> - <text name="physics_example_3"> - Ejemplos: -Objetos estáticos -Objetos con detalles -Edificios - </text> + <panel name="content"> <button label="Recalcular física" name="recalculate_physics_btn"/> <button label="Recalculando..." name="recalculating_physics_btn"/> - <text name="physics_preview_label"> + <text name="lod_label"> Prueba de física </text> <combo_box name="preview_lod_combo2" tool_tip="LOD para ver en renderizado de prueba"> - <combo_item name="preview_lod2_high"> + <combo_item name="high"> Detalle alto </combo_item> - <combo_item name="preview_lod2_medium"> + <combo_item name="medium"> Detalles medios </combo_item> - <combo_item name="preview_lod2_low"> + <combo_item name="low"> Detalle bajo </combo_item> - <combo_item name="preview_lod2_lowest"> + <combo_item name="lowest"> Detalles mínimos </combo_item> </combo_box> </panel> </panel> <panel name="review_panel"> - <panel name="review_header_panel"> - <text name="review_header_text"> + <panel name="header_panel"> + <text name="header_text"> Revisar </text> </panel> - <panel name="review_content_panel"> + <panel name="content"> <text name="review_prim_equiv"> Impacto en la parcela/región: [EQUIV] equivalentes en prim </text> @@ -193,8 +125,8 @@ Edificios </panel> </panel> <panel name="upload_panel"> - <panel name="upload_header_panel"> - <text name="upload_header_text"> + <panel name="header_panel"> + <text name="header_text"> Subida finalizada </text> </panel> diff --git a/indra/newview/skins/default/xui/es/floater_moveview.xml b/indra/newview/skins/default/xui/es/floater_moveview.xml index 258f84c361..b29fe04848 100644 --- a/indra/newview/skins/default/xui/es/floater_moveview.xml +++ b/indra/newview/skins/default/xui/es/floater_moveview.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> -<floater name="move_floater"> +<floater name="move_floater" title="MOVERME"> <string name="walk_forward_tooltip"> Caminar hacia adelante (cursor arriba o W) </string> @@ -58,14 +58,14 @@ Volar </string> <panel name="panel_actions"> - <button label="" label_selected="" name="move up btn" tool_tip="Volar (pulsa E para subir)"/> <button label="" label_selected="" name="turn left btn" tool_tip="Girar a la izq. (cursor izq. o A)"/> <joystick_slide name="move left btn" tool_tip="Caminar a la izq. (pulsa Mayúsculas + cursor izq. o A)"/> - <button label="" label_selected="" name="move down btn" tool_tip="Volar (pulsa C para descender)"/> <button label="" label_selected="" name="turn right btn" tool_tip="Girar a la der. (cursor der. o D)"/> <joystick_slide name="move right btn" tool_tip="Caminar a la der. (pulsa Mayúsculas + cursor der. o D)"/> <joystick_turn name="forward btn" tool_tip="Caminar hacia adelante (cursor arriba o W)"/> <joystick_turn name="backward btn" tool_tip="Caminar de espaldas (cursor abajo o S)"/> + <button label="" label_selected="" name="move up btn" tool_tip="Volar (pulsa E para subir)"/> + <button label="" label_selected="" name="move down btn" tool_tip="Volar (pulsa C para descender)"/> </panel> <panel name="panel_modes"> <button label="" name="mode_walk_btn" tool_tip="Modo de caminar"/> diff --git a/indra/newview/skins/default/xui/es/floater_my_appearance.xml b/indra/newview/skins/default/xui/es/floater_my_appearance.xml new file mode 100644 index 0000000000..774babf04e --- /dev/null +++ b/indra/newview/skins/default/xui/es/floater_my_appearance.xml @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes"?> +<floater name="floater_my_appearance" title="APARIENCIA"> + <panel label="Modificar la apariencia" name="main_panel"/> +</floater> diff --git a/indra/newview/skins/default/xui/es/floater_my_inventory.xml b/indra/newview/skins/default/xui/es/floater_my_inventory.xml new file mode 100644 index 0000000000..0efd9f1c6d --- /dev/null +++ b/indra/newview/skins/default/xui/es/floater_my_inventory.xml @@ -0,0 +1,2 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes"?> +<floater name="floater_my_inventory" title="INVENTARIO"/> diff --git a/indra/newview/skins/default/xui/es/floater_nearby_chat.xml b/indra/newview/skins/default/xui/es/floater_nearby_chat.xml index 1fee9ab056..b3b8cdcfff 100644 --- a/indra/newview/skins/default/xui/es/floater_nearby_chat.xml +++ b/indra/newview/skins/default/xui/es/floater_nearby_chat.xml @@ -1,4 +1,4 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <floater name="nearby_chat" title="CHAT"> - <check_box label="Traducir chat (mediante Google)" name="translate_chat_checkbox"/> + <check_box label="Traducir chat" name="translate_chat_checkbox"/> </floater> diff --git a/indra/newview/skins/default/xui/es/floater_object_weights.xml b/indra/newview/skins/default/xui/es/floater_object_weights.xml new file mode 100644 index 0000000000..50c4f0518d --- /dev/null +++ b/indra/newview/skins/default/xui/es/floater_object_weights.xml @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes"?> +<floater name="object_weights" title="AVANZADAS"> + <floater.string name="nothing_selected" value="--"/> + <text name="selected_text" value="SELECCIONADOS"/> + <text name="objects" value="--"/> + <text name="objects_label" value="Objetos"/> + <text name="prims" value="--"/> + <text name="prims_label" value="Primitivas"/> + <text name="weights_of_selected_text" value="PESOS DE SELECCIONADOS"/> + <text name="download" value="--"/> + <text name="download_label" value="Descargar"/> + <text name="physics" value="--"/> + <text name="physics_label" value="Física"/> + <text name="server" value="--"/> + <text name="server_label" value="Servidor"/> + <text name="display" value="--"/> + <text name="display_label" value="Mostrar"/> + <text name="land_impacts_text" value="IMPACTOS EN EL TERRENO"/> + <text name="selected" value="--"/> + <text name="selected_label" value="Seleccionados"/> + <text name="rezzed_on_land" value="--"/> + <text name="rezzed_on_land_label" value="Colocados en el terreno"/> + <text name="remaining_capacity" value="--"/> + <text name="remaining_capacity_label" value="Capacidad restante"/> + <text name="total_capacity" value="--"/> + <text name="total_capacity_label" value="Capacidad total"/> + <text name="help_SLURL" value="[secondlife:///app/help/object_weights ¿Qué es todo esto?...]"/> +</floater> diff --git a/indra/newview/skins/default/xui/es/floater_outfit_save_as.xml b/indra/newview/skins/default/xui/es/floater_outfit_save_as.xml new file mode 100644 index 0000000000..f48d0d2d0c --- /dev/null +++ b/indra/newview/skins/default/xui/es/floater_outfit_save_as.xml @@ -0,0 +1,2 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes"?> +<floater name="modal container" title="GUARDAR EL VESTUARIO"/> diff --git a/indra/newview/skins/default/xui/es/floater_people.xml b/indra/newview/skins/default/xui/es/floater_people.xml new file mode 100644 index 0000000000..f5a3eab008 --- /dev/null +++ b/indra/newview/skins/default/xui/es/floater_people.xml @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes"?> +<floater name="floater_people" title="GENTE"> + <panel_container name="main_panel"> + <panel label="Perfil del grupo" name="panel_group_info_sidetray"/> + <panel label="Residentes y objetos ignorados" name="panel_block_list_sidetray"/> + </panel_container> +</floater> diff --git a/indra/newview/skins/default/xui/es/floater_picks.xml b/indra/newview/skins/default/xui/es/floater_picks.xml new file mode 100644 index 0000000000..255aa5dcdc --- /dev/null +++ b/indra/newview/skins/default/xui/es/floater_picks.xml @@ -0,0 +1,2 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes"?> +<floater name="floater_picks" title="Destacados"/> diff --git a/indra/newview/skins/default/xui/es/floater_places.xml b/indra/newview/skins/default/xui/es/floater_places.xml new file mode 100644 index 0000000000..12c6548205 --- /dev/null +++ b/indra/newview/skins/default/xui/es/floater_places.xml @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes"?> +<floater name="floater_places" title="LUGARES"> + <panel label="Lugares" name="main_panel"/> +</floater> diff --git a/indra/newview/skins/default/xui/es/floater_sound_devices.xml b/indra/newview/skins/default/xui/es/floater_sound_devices.xml index a5ffbd517a..0291f9e796 100644 --- a/indra/newview/skins/default/xui/es/floater_sound_devices.xml +++ b/indra/newview/skins/default/xui/es/floater_sound_devices.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> -<floater name="floater_sound_devices" title="Dispositivos de sonido"> +<floater name="floater_sound_devices" title="DISPOSITIVOS DE SONIDO"> <text name="voice_label"> Chat de voz </text> diff --git a/indra/newview/skins/default/xui/es/floater_stats.xml b/indra/newview/skins/default/xui/es/floater_stats.xml index 5f4fabf375..ba4af2e866 100644 --- a/indra/newview/skins/default/xui/es/floater_stats.xml +++ b/indra/newview/skins/default/xui/es/floater_stats.xml @@ -10,8 +10,8 @@ </stat_view> <stat_view label="Avanzado" name="advanced"> <stat_view label="Renderización" name="render"> - <stat_bar label="KTris generados" name="ktrisframe"/> - <stat_bar label="KTris generados" name="ktrissec"/> + <stat_bar label="KTris generados por fotograma" name="ktrisframe"/> + <stat_bar label="KTris generados por segundo" name="ktrissec"/> <stat_bar label="Objetos en total" name="objs"/> <stat_bar label="Objetos nuevos" name="newobjs"/> </stat_view> @@ -43,18 +43,6 @@ <stat_bar label="Pin de objetos" name="physicspinnedtasks"/> <stat_bar label="Objetos con bajo nivel de detalle" name="physicslodtasks"/> <stat_bar label="Memoria asignada" name="physicsmemoryallocated"/> - <stat_bar label="Agentes: actual./seg." name="simagentups"/> - <stat_bar label="Agentes del grid principal" name="simmainagents"/> - <stat_bar label="Agentes secundarios" name="simchildagents"/> - <stat_bar label="Objetos" name="simobjects"/> - <stat_bar label="Objetos activos" name="simactiveobjects"/> - <stat_bar label="Scripts activos" name="simactivescripts"/> - <stat_bar label="Eventos de scripts" name="simscripteps"/> - <stat_bar label="Paquetes salientes" name="siminpps"/> - <stat_bar label="Paquetes entrantes" name="simoutpps"/> - <stat_bar label="Descargas pendientes" name="simpendingdownloads"/> - <stat_bar label="Subidas pendientes" name="simpendinguploads"/> - <stat_bar label="Total de bytes no reconocidos" name="simtotalunackedbytes"/> </stat_view> <stat_view label="Tiempo (ms)" name="simperf"> <stat_bar label="Tiempo total de los frames" name="simframemsec"/> @@ -64,6 +52,14 @@ <stat_bar label="Tiempo de los agentes" name="simagentmsec"/> <stat_bar label="Tiempo de las imágenes" name="simimagesmsec"/> <stat_bar label="Tiempo de los scripts" name="simscriptmsec"/> + <stat_bar label="Tiempo libre" name="simsparemsec"/> + <stat_view label="Datos de tiempo (ms)" name="timedetails"> + <stat_bar label="Paso de física" name="simsimphysicsstepmsec"/> + <stat_bar label="Actualizar formas físicas" name="simsimphysicsshapeupdatemsec"/> + <stat_bar label="Otros (Física)" name="simsimphysicsothermsec"/> + <stat_bar label="Tiempo de suspensión" name="simsleepmsec"/> + <stat_bar label="E/S bombeo" name="simpumpiomsec"/> + </stat_view> </stat_view> </stat_view> </container_view> diff --git a/indra/newview/skins/default/xui/es/floater_tools.xml b/indra/newview/skins/default/xui/es/floater_tools.xml index f6e246ebae..650b4b457d 100644 --- a/indra/newview/skins/default/xui/es/floater_tools.xml +++ b/indra/newview/skins/default/xui/es/floater_tools.xml @@ -25,10 +25,10 @@ Pulsa y arrastra para seleccionar el terreno. </floater.string> <floater.string name="status_selectcount"> - [OBJ_COUNT] objetos ( [PRIM_COUNT] prims[PE_STRING] ) seleccionados + [OBJ_COUNT] objetos seleccionados, impacto en el terreno [LAND_IMPACT] </floater.string> - <floater.string name="status_selectprimequiv"> - , [SEL_WEIGHT] equivalentes en prim + <floater.string name="status_remaining_capacity"> + Capacidad restante [LAND_CAPACITY]. </floater.string> <button label="" label_selected="" name="button focus" tool_tip="Visión"/> <button label="" label_selected="" name="button move" tool_tip="Mover"/> @@ -105,8 +105,8 @@ <text name="selection_empty"> No está seleccionado nada. </text> - <text name="selection_weight"> - Peso de física [PHYS_WEIGHT], Coste de renderizado [DISP_WEIGHT]. + <text name="remaining_capacity"> + [CAPACITY_STRING] [secondlife:///app/openfloater/object_weights Más información] </text> <tab_container name="Object Info Tabs" tab_max_width="62" tab_min_width="30" width="288"> <panel label="General" name="General"> @@ -319,7 +319,6 @@ Tipo de unión </text> <combo_box name="sculpt type control"> - <combo_box.item label="(ninguna)" name="None"/> <combo_box.item label="Esfera" name="Sphere"/> <combo_box.item label="Toroide" name="Torus"/> <combo_box.item label="Plano" name="Plane"/> diff --git a/indra/newview/skins/default/xui/es/floater_toybox.xml b/indra/newview/skins/default/xui/es/floater_toybox.xml new file mode 100644 index 0000000000..b36a05a6e4 --- /dev/null +++ b/indra/newview/skins/default/xui/es/floater_toybox.xml @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes"?> +<floater name="Toybox" title="PERSONALIZAR BARRAS DE HERRAMIENTAS"> + <text name="toybox label 1"> + Puedes agregar o quitar botones arrastrándolos a las barras de herramientas o desde ellas. + </text> + <text name="toybox label 2"> + Los botones aparecerán como se muestra o solo como iconos, según la configuración de cada barra de herramientas. + </text> + <button label="Restaurar valores predeterminados" label_selected="Restaurar valores predeterminados" name="btn_restore_defaults"/> +</floater> diff --git a/indra/newview/skins/default/xui/es/floater_voice_controls.xml b/indra/newview/skins/default/xui/es/floater_voice_controls.xml index f02855123c..cefec2a7a1 100644 --- a/indra/newview/skins/default/xui/es/floater_voice_controls.xml +++ b/indra/newview/skins/default/xui/es/floater_voice_controls.xml @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> -<floater name="floater_voice_controls" title="Controles de Voz"> +<floater name="floater_voice_controls" title="CONTROLES DE LA VOZ"> <string name="title_nearby"> - CHAT DE VOZ + Chat de voz </string> <string name="title_group"> Multiconferencia de voz con [GROUP] diff --git a/indra/newview/skins/default/xui/es/menu_hide_navbar.xml b/indra/newview/skins/default/xui/es/menu_hide_navbar.xml index 22a1873234..9945908c4f 100644 --- a/indra/newview/skins/default/xui/es/menu_hide_navbar.xml +++ b/indra/newview/skins/default/xui/es/menu_hide_navbar.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <menu name="hide_navbar_menu"> - <menu_item_check label="Mostrar la barra de navegación" name="ShowNavbarNavigationPanel"/> + <menu_item_check label="Mostrar la barra de navegación y de favoritos" name="ShowNavbarNavigationPanel"/> <menu_item_check label="Mostrar la barra de favoritos" name="ShowNavbarFavoritesPanel"/> <menu_item_check label="Mostrar mini-barra de ubicación" name="ShowMiniLocationPanel"/> </menu> diff --git a/indra/newview/skins/default/xui/es/menu_login.xml b/indra/newview/skins/default/xui/es/menu_login.xml index cabcacaed5..e3abf7ad62 100644 --- a/indra/newview/skins/default/xui/es/menu_login.xml +++ b/indra/newview/skins/default/xui/es/menu_login.xml @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <menu_bar name="Login Menu"> <menu label="Yo" name="File"> - <menu_item_call label="Preferencias" name="Preferences..."/> + <menu_item_call label="Preferencias..." name="Preferences..."/> <menu_item_call label="Salir de [APP_NAME]" name="Quit"/> </menu> <menu label="Ayuda" name="Help"> diff --git a/indra/newview/skins/default/xui/es/menu_toolbars.xml b/indra/newview/skins/default/xui/es/menu_toolbars.xml new file mode 100644 index 0000000000..f8ed1c54ca --- /dev/null +++ b/indra/newview/skins/default/xui/es/menu_toolbars.xml @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes"?> +<context_menu name="Toolbars Popup"> + <menu_item_call label="Elegir botones..." name="Chose Buttons"/> + <menu_item_check label="Iconos y etiquetas" name="icons_with_text"/> + <menu_item_check label="Solo iconos" name="icons_only"/> +</context_menu> diff --git a/indra/newview/skins/default/xui/es/menu_viewer.xml b/indra/newview/skins/default/xui/es/menu_viewer.xml index bc8a5731ab..0714e7f2c6 100644 --- a/indra/newview/skins/default/xui/es/menu_viewer.xml +++ b/indra/newview/skins/default/xui/es/menu_viewer.xml @@ -1,29 +1,30 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <menu_bar name="Main Menu"> <menu label="Yo" name="Me"> - <menu_item_call label="Preferencias" name="Preferences"/> - <menu_item_call label="Mi panel de control" name="Manage My Account"> + <menu_item_call label="Panel de control..." name="Manage My Account"> <menu_item_call.on_click name="ManageMyAccount_url" parameter="WebLaunchJoinNow,http://secondlife.com/account/index.php?lang=es"/> </menu_item_call> - <menu_item_call label="Comprar L$" name="Buy and Sell L$"/> - <menu_item_call label="Mi perfil" name="Profile"/> - <menu_item_call label="Mi apariencia" name="ChangeOutfit"/> - <menu_item_check label="Mi Inventario" name="Inventory"/> - <menu_item_check label="Mi Inventario" name="ShowSidetrayInventory"/> - <menu_item_check label="Mis gestos" name="Gestures"/> - <menu_item_check label="Mi voz" name="ShowVoice"/> + <menu_item_call label="Perfil..." name="Profile"/> + <menu_item_call label="Apariencia" name="ChangeOutfit"/> + <menu_item_check label="Inventario..." name="Inventory"/> + <menu_item_check label="Gestos..." name="Gestures"/> + <menu_item_check label="Voz..." name="ShowVoice"/> <menu label="Movimiento" name="Movement"> <menu_item_call label="Sentarte" name="Sit Down Here"/> <menu_item_check label="Volar" name="Fly"/> <menu_item_check label="Correr siempre" name="Always Run"/> <menu_item_call label="Parar mis animaciones" name="Stop Animating My Avatar"/> </menu> - <menu label="Mi estado" name="Status"> + <menu label="Estado" name="Status"> <menu_item_call label="Ausente" name="Set Away"/> <menu_item_call label="Ocupado" name="Set Busy"/> </menu> <menu_item_call label="Solicitar estatus de Administrador" name="Request Admin Options"/> <menu_item_call label="Dejar el estatus de Administrador" name="Leave Admin Options"/> + <menu_item_call label="Comprar L$" name="Buy and Sell L$"/> + <menu_item_call label="Preferencias..." name="Preferences"/> + <menu_item_call label="Barras de herramientas..." name="Toolbars"/> + <menu_item_call label="Ocultar todos los controles" name="Hide UI"/> <menu_item_call label="Salir de [APP_NAME]" name="Quit"/> </menu> <menu label="Comunicarme" name="Communicate"> @@ -145,7 +146,6 @@ </menu> <menu label="Ayuda" name="Help"> <menu_item_call label="Ayuda de [SECOND_LIFE]" name="Second Life Help"/> - <menu_item_check label="Permitir consejos" name="Enable Hints"/> <menu_item_call label="Denunciar una infracción" name="Report Abuse"/> <menu_item_call label="Informar de un fallo" name="Report Bug"/> <menu_item_call label="Acerca de [APP_NAME]" name="About Second Life"/> @@ -161,7 +161,7 @@ <menu label="Herramientas de rendimiento" name="Performance Tools"> <menu_item_call label="Medidor de lag" name="Lag Meter"/> <menu_item_check label="Estadísticas" name="Statistics Bar"/> - <menu_item_check label="Mostrar cuánto cuesta renderizar el avatar" name="Avatar Rendering Cost"/> + <menu_item_check label="Mostrar el peso del dibujo de los avatares" name="Avatar Rendering Cost"/> </menu> <menu label="Realzado y Visibilidad" name="Highlighting and Visibility"> <menu_item_check label="Baliza con destellos" name="Cheesy Beacon"/> @@ -271,6 +271,7 @@ <menu_item_check label="Actualizar el tipo" name="Update Type"/> <menu_item_check label="Información sobre el nivel de detalle" name="LOD Info"/> <menu_item_check label="Crear cola" name="Build Queue"/> + <menu_item_check label="Complejidad del renderizado" name="rendercomplexity"/> <menu_item_check label="Esculpir" name="Sculpt"/> </menu> <menu label="Rendering" name="Rendering"> diff --git a/indra/newview/skins/default/xui/es/notifications.xml b/indra/newview/skins/default/xui/es/notifications.xml index 4fb29b9427..9591b424fc 100644 --- a/indra/newview/skins/default/xui/es/notifications.xml +++ b/indra/newview/skins/default/xui/es/notifications.xml @@ -981,7 +981,7 @@ no tienes el permiso de comprar terreno para el grupo que tienes activado actual </form> </notification> <notification name="RemoveFromFriends"> - ¿Quieres eliminar a [NAME] de tu lista de amigos? + ¿Quieres eliminar a <nolink>[NAME]</nolink> de tu lista de amigos? <usetemplate name="okcancelbuttons" notext="Cancelar" yestext="OK"/> </notification> <notification name="RemoveMultipleFromFriends"> @@ -1919,6 +1919,12 @@ Dado que estos objetos tienen scripts, moverlos a tu inventario puede provocar u ¿Estás seguro de que quieres salir? <usetemplate ignoretext="Confirmar antes de salir" name="okcancelignore" notext="No salir" yestext="Salir"/> </notification> + <notification name="ConfirmRestoreToybox"> + ¿Estás seguro de que quieres restaurar los botones y barras de herramientas predeterminados? + +Esta acción no se puede deshacer. + <usetemplate name="okcancelbuttons" notext="Cancelar" yestext="OK"/> + </notification> <notification name="DeleteItems"> [QUESTION] <usetemplate ignoretext="Confirmar antes de eliminar elementos" name="okcancelignore" notext="Cancelar" yestext="OK"/> @@ -2122,10 +2128,10 @@ Al hacerlo se iniciará el navegador web. Asunto: [SUBJECT], Mensaje: [MESSAGE] </notification> <notification name="FriendOnline"> - [NAME] está conectado + <nolink>[NAME]</nolink> está conectado </notification> <notification name="FriendOffline"> - [NAME] está desconectado + <nolink>[NAME]</nolink> está desconectado </notification> <notification name="AddSelfFriend"> Aunque eres muy agradable, no puedes añadirte como amigo a ti mismo. @@ -2520,10 +2526,10 @@ Por favor, vuelve a intentarlo en unos momentos. </form> </notification> <notification name="FriendshipAccepted"> - [NAME] ha aceptado tu oferta de amistad. + <nolink>[NAME]</nolink> ha aceptado tu oferta de amistad. </notification> <notification name="FriendshipDeclined"> - [NAME] ha rehusado tu oferta de amistad. + <nolink>[NAME]</nolink> ha rehusado tu oferta de amistad. </notification> <notification name="FriendshipAcceptedByMe"> Aceptado el ofrecimiento de amistad. @@ -2999,10 +3005,6 @@ Al ocultar el botón Hablar se desactiva la función de voz. <button name="cancel" text="Cancelar"/> </form> </notification> - <notification label="" name="ModeChange"> - Para cambiar de modo tienes que salir y reiniciar. - <usetemplate name="okcancelbuttons" notext="No salir" yestext="Salir"/> - </notification> <notification label="" name="NoClassifieds"> La creación y edición de clasificados sólo está disponible en el modo Avanzado. ¿Quieres salir y cambiar de modo? El selector de modo se encuentra en la pantalla de inicio de sesión. <usetemplate name="okcancelbuttons" notext="No salir" yestext="Salir"/> @@ -3047,6 +3049,10 @@ Al ocultar el botón Hablar se desactiva la función de voz. Las búsquedas solo están disponibles en el modo Avanzado. ¿Quieres cerrar sesión y cambiar de modo? <usetemplate name="okcancelbuttons" notext="No salir" yestext="Salir"/> </notification> + <notification label="" name="ConfirmHideUI"> + Esta acción ocultará todos los botones y elementos de menú. Para restaurarlos, pulsa otra vez en [SHORTCUT]. + <usetemplate ignoretext="Confirmar antes de ocultar la IU" name="okcancelignore" notext="Cancelar" yestext="OK"/> + </notification> <global name="UnsupportedGLRequirements"> Parece que no tienes el hardware apropiado para [APP_NAME]. [APP_NAME] requiere una tarjeta gráfica OpenGL que admita texturas múltiples ('multitexture support'). Si la tienes, comprueba que tienes los últimos 'drivers' para tu tarjeta gráfica, así como los últimos parches y 'service packs' para tu sistema operativo. diff --git a/indra/newview/skins/default/xui/es/panel_chiclet_bar.xml b/indra/newview/skins/default/xui/es/panel_chiclet_bar.xml new file mode 100644 index 0000000000..eaaa5dbe78 --- /dev/null +++ b/indra/newview/skins/default/xui/es/panel_chiclet_bar.xml @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes"?> +<panel name="chiclet_bar"> + <layout_stack name="toolbar_stack"> + <layout_panel name="im_well_panel"> + <chiclet_im_well name="im_well"> + <button name="Unread IM messages" tool_tip="Conversaciones"/> + </chiclet_im_well> + </layout_panel> + <layout_panel name="notification_well_panel"> + <chiclet_notification name="notification_well"> + <button name="Unread" tool_tip="Notificaciones"/> + </chiclet_notification> + </layout_panel> + </layout_stack> +</panel> diff --git a/indra/newview/skins/default/xui/es/panel_me.xml b/indra/newview/skins/default/xui/es/panel_me.xml index ed253904aa..850cd6ec71 100644 --- a/indra/newview/skins/default/xui/es/panel_me.xml +++ b/indra/newview/skins/default/xui/es/panel_me.xml @@ -1,7 +1,4 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <panel label="Mi perfil" name="panel_me"> - <tab_container name="tabs"> - <panel label="MI PERFIL" name="panel_profile"/> - <panel label="MIS DESTACADOS" name="panel_picks"/> - </tab_container> + <panel label="MIS DESTACADOS" name="panel_picks"/> </panel> diff --git a/indra/newview/skins/default/xui/es/panel_my_profile.xml b/indra/newview/skins/default/xui/es/panel_my_profile.xml deleted file mode 100644 index 29e5e6f652..0000000000 --- a/indra/newview/skins/default/xui/es/panel_my_profile.xml +++ /dev/null @@ -1,31 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes"?> -<panel label="Perfil" name="panel_profile"> - <string name="no_partner_text" value="Ninguno/a"/> - <string name="no_group_text" value="Ninguno"/> - <string name="RegisterDateFormat"> - [REG_DATE] ([AGE]) - </string> - <string name="name_text_args"> - [NAME] - </string> - <string name="display_name_text_args"> - [DISPLAY_NAME] - </string> - <layout_stack name="layout"> - <layout_panel name="profile_stack"> - <scroll_container name="profile_scroll"> - <panel name="scroll_content_panel"> - <panel name="second_life_image_panel"> - <text name="display_name_descr_text"> - Nombre de usuario - </text> - <text name="name_descr_text"> - Nombre mostrado - </text> - <button label="Perfil" name="see_profile_btn" tool_tip="Ver el perfil de este avatar"/> - </panel> - </panel> - </scroll_container> - </layout_panel> - </layout_stack> -</panel> diff --git a/indra/newview/skins/default/xui/es/panel_navigation_bar.xml b/indra/newview/skins/default/xui/es/panel_navigation_bar.xml index 293c9ef1d9..d36c6283bc 100644 --- a/indra/newview/skins/default/xui/es/panel_navigation_bar.xml +++ b/indra/newview/skins/default/xui/es/panel_navigation_bar.xml @@ -1,18 +1,23 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <panel name="navigation_bar"> - <panel name="navigation_panel"> - <pull_button name="back_btn" tool_tip="Volver a la localización anterior"/> - <pull_button name="forward_btn" tool_tip="Ir una localización adelante"/> - <button name="home_btn" tool_tip="Teleportar a mi Base"/> - <location_input label="Localización" name="location_combo"/> - <search_combo_box label="Buscar" name="search_combo_box" tool_tip="Buscar"> - <combo_editor label="Buscar en [SECOND_LIFE]" name="search_combo_editor"/> - </search_combo_box> - </panel> - <favorites_bar name="favorite" tool_tip="¡Accede rápidamente a tus lugares favoritos de Second Life arrastrando hitos hasta aquí!"> - <label name="favorites_bar_label" tool_tip="¡Accede rápidamente a tus lugares favoritos de Second Life arrastrando hitos hasta aquí!"> - Barra de Favoritos - </label> - <chevron_button name=">>" tool_tip="Ver más de Mis favoritos"/> - </favorites_bar> + <layout_stack name="nvp_stack"> + <layout_panel name="navigation_layout_panel"> + <panel name="navigation_panel"> + <pull_button name="back_btn" tool_tip="Volver a la localización anterior"/> + <pull_button name="forward_btn" tool_tip="Ir una localización adelante"/> + <button name="home_btn" tool_tip="Teleportar a mi Base"/> + <location_input label="Lugar" name="location_combo"/> + </panel> + </layout_panel> + <layout_panel name="favorites_layout_panel"> + <favorites_bar name="favorite" tool_tip="¡Accede rápidamente a tus lugares favoritos de Second Life arrastrando hitos hasta aquí!"> + <label name="favorites_bar_label" tool_tip="¡Accede rápidamente a tus lugares favoritos de Second Life arrastrando hitos hasta aquí!"> + Barra de Favoritos + </label> + <more_button name=">>" tool_tip="Ver más de Mis favoritos"> + Más ▼ + </more_button> + </favorites_bar> + </layout_panel> + </layout_stack> </panel> diff --git a/indra/newview/skins/default/xui/es/panel_nearby_chat.xml b/indra/newview/skins/default/xui/es/panel_nearby_chat.xml new file mode 100644 index 0000000000..5a852a6711 --- /dev/null +++ b/indra/newview/skins/default/xui/es/panel_nearby_chat.xml @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes"?> +<panel name="nearby_chat"> + <check_box label="Traducir chat" name="translate_chat_checkbox"/> +</panel> diff --git a/indra/newview/skins/default/xui/es/panel_notes.xml b/indra/newview/skins/default/xui/es/panel_notes.xml deleted file mode 100644 index 00d4caf468..0000000000 --- a/indra/newview/skins/default/xui/es/panel_notes.xml +++ /dev/null @@ -1,35 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes"?> -<panel label="Notas y Privacidad" name="panel_notes"> - <layout_stack name="layout"> - <layout_panel name="notes_stack"> - <scroll_container name="profile_scroll"> - <panel name="profile_scroll_panel"> - <text name="status_message" value="Mis notas privadas:"/> - <text name="status_message2" value="Permitir que esta persona:"/> - <check_box label="Vea si estoy conectado" name="status_check"/> - <check_box label="Me vea en el mapa" name="map_check"/> - <check_box label="Edite, borre o coja mis objetos" name="objects_check"/> - </panel> - </scroll_container> - </layout_panel> - <layout_panel name="notes_buttons_panel"> - <layout_stack name="bottom_bar_ls"> - <layout_panel name="add_friend_btn_lp"> - <button label="Añadir como amigo" name="add_friend" tool_tip="Ofrecer amistad a este Residente"/> - </layout_panel> - <layout_panel name="im_btn_lp"> - <button label="MI" name="im" tool_tip="Abrir una sesión de mensajes instantáneos"/> - </layout_panel> - <layout_panel name="call_btn_lp"> - <button label="Llamar" name="call" tool_tip="Llamar a este Residente"/> - </layout_panel> - <layout_panel name="show_on_map_btn_lp"> - <button label="Mapa" name="show_on_map_btn" tool_tip="Mostrar al Residente en el mapa"/> - </layout_panel> - <layout_panel name="teleport_btn_lp"> - <button label="Teleporte" name="teleport" tool_tip="Ofrecer teleporte"/> - </layout_panel> - </layout_stack> - </layout_panel> - </layout_stack> -</panel> diff --git a/indra/newview/skins/default/xui/es/panel_people.xml b/indra/newview/skins/default/xui/es/panel_people.xml index 2fcbb00aed..a9d38dca25 100644 --- a/indra/newview/skins/default/xui/es/panel_people.xml +++ b/indra/newview/skins/default/xui/es/panel_people.xml @@ -76,7 +76,7 @@ <button label="Compartir" name="share_btn" tool_tip="Compartir un objeto del inventario"/> </layout_panel> <layout_panel name="teleport_btn_lp"> - <button label="Teleportarte" name="teleport_btn" tool_tip="Ofrecer teleporte"/> + <button label="Teleporte" name="teleport_btn" tool_tip="Ofrecer teleporte"/> </layout_panel> </layout_stack> <layout_stack name="bottom_bar_ls1"> diff --git a/indra/newview/skins/default/xui/es/panel_preferences_chat.xml b/indra/newview/skins/default/xui/es/panel_preferences_chat.xml index a15c8deaf9..e822585566 100644 --- a/indra/newview/skins/default/xui/es/panel_preferences_chat.xml +++ b/indra/newview/skins/default/xui/es/panel_preferences_chat.xml @@ -31,7 +31,7 @@ <spinner label="Tiempo de los otros interlocutores:" name="nearby_toasts_fadingtime"/> <check_box name="translate_chat_checkbox"/> <text name="translate_chb_label"> - Usar en el chat el traductor automático de Google + Usar en el chat el traductor automático </text> <text name="translate_language_text"> Traducir el chat al: @@ -51,7 +51,7 @@ <combo_box.item label="Русский (ruso)" name="Russian"/> <combo_box.item label="Türkçe (turco)" name="Turkish"/> <combo_box.item label="Українська (ucraniano)" name="Ukrainian"/> - <combo_box.item label="中文 (正體) (chino)" name="Chinese"/> + <combo_box.item label="中文 (正體) (Chino)" name="Chinese"/> <combo_box.item label="日本語 (japonés)" name="Japanese"/> <combo_box.item label="한국어 (coreano)" name="Korean"/> </combo_box> diff --git a/indra/newview/skins/default/xui/es/panel_preferences_general.xml b/indra/newview/skins/default/xui/es/panel_preferences_general.xml index c762e6b7fe..4fc163f5b6 100644 --- a/indra/newview/skins/default/xui/es/panel_preferences_general.xml +++ b/indra/newview/skins/default/xui/es/panel_preferences_general.xml @@ -13,7 +13,10 @@ <combo_box.item label="Italiano - Beta" name="Italian"/> <combo_box.item label="Polski (Polaco) - Beta" name="Polish"/> <combo_box.item label="Português (portugués) - Beta" name="Portugese"/> + <combo_box.item label="Русский (Ruso) - Beta" name="Russian"/> + <combo_box.item label="Türkçe (Turco) - Beta" name="Turkish"/> <combo_box.item label="日本語 (Japonés) - Beta" name="(Japanese)"/> + <combo_box.item label="正體中文 (Chino tradicional) - Beta" name="Traditional Chinese"/> </combo_box> <text name="language_textbox2"> (requiere reiniciar) @@ -48,7 +51,6 @@ <check_box label="Títulos de grupos" name="show_all_title_checkbox1" tool_tip="Mostrar títulos de grupos, como Jefe o Miembro"/> <check_box label="Realzar amigos" name="show_friends" tool_tip="Realzar las etiquetas de los nombres de tus amigos"/> <check_box label="Ver nombres mostrados" name="display_names_check" tool_tip="Comprobar para utilizar nombres mostrados en chat, MI, etiquetas de nombres, etc."/> - <check_box label="Permitir los consejos de la IU del visor" name="viewer_hints_check"/> <text name="inworld_typing_rg_label"> Si pulsas las teclas de letras: </text> diff --git a/indra/newview/skins/default/xui/es/panel_preferences_move.xml b/indra/newview/skins/default/xui/es/panel_preferences_move.xml index d95e167361..b2ff6b61c2 100644 --- a/indra/newview/skins/default/xui/es/panel_preferences_move.xml +++ b/indra/newview/skins/default/xui/es/panel_preferences_move.xml @@ -7,18 +7,33 @@ </text> <check_box label="Construir/Editar" name="edit_camera_movement" tool_tip="Usar el posicionamiento automático de la cámara al entrar en o salir del modo de edición"/> <check_box label="Apariencia" name="appearance_camera_movement" tool_tip="Usar el posicionamiento automático de la cámara mientras se está editando"/> - <check_box initial_value="verdadero" label="Barra lateral" name="appearance_sidebar_positioning" tool_tip="Usar el posicionamiento automático de la cámara para la barra lateral"/> + <text name="keyboard_lbl"> + Teclado: + </text> + <check_box label="Las teclas del cursor siempre para moverme" name="arrow_keys_move_avatar_check"/> + <check_box label="Correr siempre: atajo de teclado" name="tap_tap_hold_to_run"/> + <text name="mouse_lbl"> + Ratón: + </text> <check_box label="Verme en vista subjetiva" name="first_person_avatar_visible"/> <text name=" Mouse Sensitivity"> Sensibilidad del ratón en la Vista subjetiva: </text> <check_box label="Invertir" name="invert_mouse"/> - <check_box label="Las teclas del cursor siempre para moverme" name="arrow_keys_move_avatar_check"/> - <check_box label="Correr siempre: atajo de teclado" name="tap_tap_hold_to_run"/> - <check_box label="Haz doble clic para:" name="double_click_chkbox"/> - <radio_group name="double_click_action"> - <radio_item label="Teleportarte" name="radio_teleport"/> - <radio_item label="Piloto automático" name="radio_autopilot"/> - </radio_group> + <text name="single_click_action_lbl"> + Un clic en el terreno: + </text> + <combo_box name="single_click_action_combo"> + <combo_box.item label="Ninguna acción" name="0"/> + <combo_box.item label="Ir al punto seleccionado" name="1"/> + </combo_box> + <text name="double_click_action_lbl"> + Doble clic en el terreno: + </text> + <combo_box name="double_click_action_combo"> + <combo_box.item label="Ninguna acción" name="0"/> + <combo_box.item label="Ir al punto seleccionado" name="1"/> + <combo_box.item label="Teleportarte al punto seleccionado" name="2"/> + </combo_box> <button label="Otros dispositivos" name="joystick_setup_button"/> </panel> diff --git a/indra/newview/skins/default/xui/es/panel_profile.xml b/indra/newview/skins/default/xui/es/panel_profile.xml deleted file mode 100644 index 334c0541af..0000000000 --- a/indra/newview/skins/default/xui/es/panel_profile.xml +++ /dev/null @@ -1,70 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes"?> -<panel label="Perfil" name="panel_profile"> - <string name="CaptionTextAcctInfo"> - [ACCTTYPE] -[PAYMENTINFO] [AGEVERIFICATION] - </string> - <string name="payment_update_link_url"> - http://www.secondlife.com/account/billing.php?lang=es-ES - </string> - <string name="partner_edit_link_url"> - http://www.secondlife.com/account/partners.php?lang=es - </string> - <string name="my_account_link_url" value="http://secondlife.com/my/account/index.php?lang=es-ES"/> - <string name="no_partner_text" value="Ninguno"/> - <string name="no_group_text" value="Ninguno"/> - <string name="RegisterDateFormat"> - [REG_DATE] ([AGE]) - </string> - <string name="name_text_args"> - [NAME] - </string> - <string name="display_name_text_args"> - [DISPLAY_NAME] - </string> - <layout_stack name="layout"> - <layout_panel name="profile_stack"> - <scroll_container name="profile_scroll"> - <panel name="profile_scroll_panel"> - <panel name="second_life_image_panel"> - <text name="title_sl_descr_text" value="[SECOND_LIFE]:"/> - </panel> - <panel name="first_life_image_panel"> - <text name="title_rw_descr_text" value="Mundo real:"/> - </panel> - <text name="title_member_text" value="Residente desde:"/> - <text name="title_acc_status_text" value="Estado de la cuenta:"/> - <text name="title_partner_text" value="Compañero/a:"/> - <panel name="partner_data_panel"> - <text initial_value="(obteniendo)" name="partner_text"/> - </panel> - <text name="title_groups_text" value="Grupos:"/> - </panel> - </scroll_container> - </layout_panel> - </layout_stack> - <layout_stack name="layout_verb_buttons"> - <layout_panel name="profile_buttons_panel"> - <layout_stack name="bottom_bar_ls"> - <layout_panel name="add_friend_btn_lp"> - <button label="Añadir como amigo" name="add_friend" tool_tip="Ofrecer amistad a este Residente"/> - </layout_panel> - <layout_panel name="im_btn_lp"> - <button label="MI" name="im" tool_tip="Abrir una sesión de mensajes instantáneos"/> - </layout_panel> - <layout_panel name="call_btn_lp"> - <button label="Llamar" name="call" tool_tip="Llamar a este Residente"/> - </layout_panel> - <layout_panel name="chat_btn_lp"> - <button label="Teleporte" name="teleport" tool_tip="Ofrecer teleporte"/> - </layout_panel> - <layout_panel name="overflow_btn_lp"> - <menu_button label="▼" name="overflow_btn" tool_tip="Pagar dinero al Residente o compartir algo del inventario con él"/> - </layout_panel> - </layout_stack> - </layout_panel> - <layout_panel name="profile_me_buttons_panel"> - <button label="Editar el perfil" name="edit_profile_btn" tool_tip="Modificar tu información personal"/> - </layout_panel> - </layout_stack> -</panel> diff --git a/indra/newview/skins/default/xui/es/panel_profile_view.xml b/indra/newview/skins/default/xui/es/panel_profile_view.xml deleted file mode 100644 index cb374dee52..0000000000 --- a/indra/newview/skins/default/xui/es/panel_profile_view.xml +++ /dev/null @@ -1,20 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes"?> -<panel name="panel_target_profile"> - <string name="status_online"> - Conectado/a - </string> - <string name="status_offline"> - Desconectado/a - </string> - <text name="display_name_label" value="Nombre mostrado:"/> - <text name="solo_username_label" value="Nombre de usuario:"/> - <text name="status" value="Conectado/a"/> - <text name="user_name_small" value="Jack, ¿has visto esto? Es un nombre larguísimo."/> - <button name="copy_to_clipboard" tool_tip="Copiar al portapapeles"/> - <text name="user_label" value="Nombre de usuario:"/> - <tab_container name="tabs"> - <panel label="PERFIL" name="panel_profile"/> - <panel label="DESTACADOS" name="panel_picks"/> - <panel label="NOTAS Y PRIVACIDAD" name="panel_notes"/> - </tab_container> -</panel> diff --git a/indra/newview/skins/default/xui/es/panel_status_bar.xml b/indra/newview/skins/default/xui/es/panel_status_bar.xml index 0391258b75..d43790c8c6 100644 --- a/indra/newview/skins/default/xui/es/panel_status_bar.xml +++ b/indra/newview/skins/default/xui/es/panel_status_bar.xml @@ -17,12 +17,9 @@ </panel.string> <panel name="balance_bg"> <text name="balance" tool_tip="Haz clic para actualizar tu saldo en L$" value="20 L$"/> - <button label="COMPRAR L$" name="buyL" tool_tip="Pulsa para comprar más L$"/> + <button label="Comprar L$" name="buyL" tool_tip="Pulsa para comprar más L$"/> + <button label="Comprar" name="goShop" tool_tip="Abrir el mercado de Second Life"/> </panel> - <combo_box name="mode_combo" tool_tip="Selecciona el modo. Elige Básico para una exploración rápida y fácil y para chatear. Elige Avanzado para tener acceso a más funciones."> - <combo_box.item label="Modo Básico" name="Basic"/> - <combo_box.item label="Modo Avanzado" name="Advanced"/> - </combo_box> <text name="TimeText" tool_tip="Hora actual (Pacífico)"> 24:00 AM PST </text> diff --git a/indra/newview/skins/default/xui/es/sidepanel_inventory.xml b/indra/newview/skins/default/xui/es/sidepanel_inventory.xml index aae9bfc113..79d0cb84e8 100644 --- a/indra/newview/skins/default/xui/es/sidepanel_inventory.xml +++ b/indra/newview/skins/default/xui/es/sidepanel_inventory.xml @@ -14,7 +14,7 @@ </string> <button label="Objetos recibidos" name="inbox_btn"/> <text name="inbox_fresh_new_count"> - [NUM] Nuevos + [NUM] nuevos </text> <panel tool_tip="Drag and drop items to your inventory to manage and use them"> <text name="inbox_inventory_placeholder"> diff --git a/indra/newview/skins/default/xui/es/strings.xml b/indra/newview/skins/default/xui/es/strings.xml index cc044ba416..e3ea4baa6c 100644 --- a/indra/newview/skins/default/xui/es/strings.xml +++ b/indra/newview/skins/default/xui/es/strings.xml @@ -34,6 +34,9 @@ <string name="ProgressChangingResolution"> Cambiando la resolución... </string> + <string name="Fullbright"> + Brillo al máximo (antiguo) + </string> <string name="LoginInProgress"> Iniciando la sesión. [APP_NAME] debe de aparecer congelado. Por favor, espere. </string> @@ -116,7 +119,7 @@ No se pudo verificar la firma del certificado devuelta por el servidor de la cuadrícula. Ponte en contacto con el administrador de la cuadrícula. </string> <string name="LoginFailedNoNetwork"> - Error de red: no se ha podido conectar; por favor, revisa tu conexión a Internet. + Error de red: no se ha podido conectar; por favor, revisa tu conexión a internet. </string> <string name="LoginFailed"> Error en el inicio de sesión. @@ -583,6 +586,9 @@ Intenta iniciar sesión de nuevo en unos instantes. <string name="mesh"> red </string> + <string name="AvatarEditingAppearance"> + (Edición de Apariencia) + </string> <string name="AvatarAway"> Ausente </string> @@ -1255,6 +1261,9 @@ Intenta iniciar sesión de nuevo en unos instantes. <string name="Marketplace Error Internal Import"> Error: Este objeto tiene un problema. Vuelve a intentarlo más tarde. </string> + <string name="Open landmarks"> + Abrir hitos + </string> <string name="no_transfer" value="(no transferible)"/> <string name="no_modify" value="(no modificable)"/> <string name="no_copy" value="(no copiable)"/> @@ -3835,6 +3844,9 @@ Si sigues recibiendo este mensaje, contacta con [SUPPORT_SITE]. <string name="inventory_item_offered-im"> Ofrecido el item del inventario </string> + <string name="share_alert"> + Arrastra los ítems desde el invenbtario hasta aquí + </string> <string name="no_session_message"> (La sesión de MI no existe) </string> @@ -4158,8 +4170,8 @@ Denuncia de infracción <string name="Female - Wow"> Mujer - Admiración </string> - <string name="/bow1"> - /reverencia1 + <string name="/bow"> + /reverencia </string> <string name="/clap"> /aplaudir @@ -4671,4 +4683,172 @@ Inténtalo incluyendo la ruta de acceso al editor entre comillas <string name="ParticleHiding"> Ocultando las partículas </string> + <string name="Command_AboutLand_Label"> + Acerca del terreno + </string> + <string name="Command_Appearance_Label"> + Apariencia + </string> + <string name="Command_Avatar_Label"> + Avatar + </string> + <string name="Command_Build_Label"> + Construir + </string> + <string name="Command_Chat_Label"> + Chat + </string> + <string name="Command_Compass_Label"> + Brújula + </string> + <string name="Command_Destinations_Label"> + Destinos + </string> + <string name="Command_Gestures_Label"> + Gestos + </string> + <string name="Command_HowTo_Label"> + Cómo + </string> + <string name="Command_Inventory_Label"> + Inventario + </string> + <string name="Command_Map_Label"> + Mapa + </string> + <string name="Command_Marketplace_Label"> + Mercado + </string> + <string name="Command_MiniMap_Label"> + Minimapa + </string> + <string name="Command_Move_Label"> + Moverme + </string> + <string name="Command_People_Label"> + Gente + </string> + <string name="Command_Picks_Label"> + Destacados + </string> + <string name="Command_Places_Label"> + Lugares + </string> + <string name="Command_Preferences_Label"> + Preferencias + </string> + <string name="Command_Profile_Label"> + Perfil + </string> + <string name="Command_Search_Label"> + Buscar + </string> + <string name="Command_Snapshot_Label"> + Foto + </string> + <string name="Command_Speak_Label"> + Hablar + </string> + <string name="Command_View_Label"> + Visión + </string> + <string name="Command_Voice_Label"> + Chat de voz + </string> + <string name="Command_AboutLand_Tooltip"> + Información sobre el terreno que vas a visitar + </string> + <string name="Command_Appearance_Tooltip"> + Cambiar tu avatar + </string> + <string name="Command_Avatar_Tooltip"> + Elegir un avatar completo + </string> + <string name="Command_Build_Tooltip"> + Construir objetos y modificar la forma del terreno + </string> + <string name="Command_Chat_Tooltip"> + Habla por chat de texto con las personas próximas + </string> + <string name="Command_Compass_Tooltip"> + Brújula + </string> + <string name="Command_Destinations_Tooltip"> + Destinos de interés + </string> + <string name="Command_Gestures_Tooltip"> + Gestos para tu avatar + </string> + <string name="Command_HowTo_Tooltip"> + Cómo hacer las tareas habituales + </string> + <string name="Command_Inventory_Tooltip"> + Ver y usar tus pertenencias + </string> + <string name="Command_Map_Tooltip"> + Mapa del mundo + </string> + <string name="Command_Marketplace_Tooltip"> + Ir de compras + </string> + <string name="Command_MiniMap_Tooltip"> + Mostrar la gente que está cerca + </string> + <string name="Command_Move_Tooltip"> + Desplazando el avatar + </string> + <string name="Command_People_Tooltip"> + Amigos, grupos y personas próximas + </string> + <string name="Command_Picks_Tooltip"> + Lugares que se mostrarán como favoritos en tu perfil + </string> + <string name="Command_Places_Tooltip"> + Lugares que has guardado + </string> + <string name="Command_Preferences_Tooltip"> + Preferencias + </string> + <string name="Command_Profile_Tooltip"> + Consulta o edita tu perfil + </string> + <string name="Command_Search_Tooltip"> + Buscar lugares, eventos y personas + </string> + <string name="Command_Snapshot_Tooltip"> + Tomar una fotografía + </string> + <string name="Command_Speak_Tooltip"> + Utiliza el micrófono para hablar con las personas próximas + </string> + <string name="Command_View_Tooltip"> + Cambiando el ángulo de la cámara + </string> + <string name="Command_Voice_Tooltip"> + Personas próximas con capacidad de voz + </string> + <string name="Retain%"> + % retención + </string> + <string name="Detail"> + Detalle + </string> + <string name="Better Detail"> + Mejor detalle + </string> + <string name="Surface"> + Superficie + </string> + <string name="Solid"> + Sólido + </string> + <string name="Wrap"> + Envoltura + </string> + <string name="Preview"> + Vista previa + </string> + <string name="Normal"> + Normal + </string> </strings> diff --git a/indra/newview/skins/default/xui/es/teleport_strings.xml b/indra/newview/skins/default/xui/es/teleport_strings.xml index e0e0061729..e785a7ac40 100644 --- a/indra/newview/skins/default/xui/es/teleport_strings.xml +++ b/indra/newview/skins/default/xui/es/teleport_strings.xml @@ -19,6 +19,10 @@ Si sigues recibiendo este mensaje, por favor, acude al [SUPPORT_SITE]. Lo sentimos, pero el sistema no ha podido completar el teleporte. Vuelva a intentarlo en un momento. </message> + <message name="NoHelpIslandTP"> + No puede teleportarse de vuelta a la Welcome Island ('Isla de Ayuda'). +Vaya a la 'Welcome Island Public' ('Isla Pública de Ayuda') para repetir el tutorial. + </message> <message name="noaccess_tport"> Lo sentimos, pero no tienes acceso al destino de este teleporte. </message> diff --git a/indra/newview/skins/default/xui/fr/floater_buy_currency.xml b/indra/newview/skins/default/xui/fr/floater_buy_currency.xml index b3acc83078..d9e8e8821d 100644 --- a/indra/newview/skins/default/xui/fr/floater_buy_currency.xml +++ b/indra/newview/skins/default/xui/fr/floater_buy_currency.xml @@ -47,7 +47,7 @@ le Lindex... [AMT] L$ </text> <text name="currency_links"> - [http://www.secondlife.com/my/account/payment_method_management.php?lang=fr-FR mode de paiement] | [http://www.secondlife.com/my/account/currency.php?lang=fr-FR devise] | [http://www.secondlife.com/my/account/exchange_rates.php?lang=fr-FR taux de change] + [http://www.secondlife.com/my/account/payment_method_management.php?lang=fr-FR mode de paiement] | [http://www.secondlife.com/my/account/currency.php?lang=fr-FR devise] </text> <text name="exchange_rate_note"> Saisissez à nouveau le montant pour voir le taux de change actuel. diff --git a/indra/newview/skins/default/xui/fr/floater_camera.xml b/indra/newview/skins/default/xui/fr/floater_camera.xml index 97ff246c4d..77d3c2cfe4 100644 --- a/indra/newview/skins/default/xui/fr/floater_camera.xml +++ b/indra/newview/skins/default/xui/fr/floater_camera.xml @@ -9,15 +9,6 @@ <floater.string name="move_tooltip"> Déplacer la caméra vers le haut et le bas, la gauche et la droite </floater.string> - <floater.string name="camera_modes_title"> - Modes - </floater.string> - <floater.string name="pan_mode_title"> - Rotation - Zoom - Panoramique - </floater.string> - <floater.string name="presets_mode_title"> - Préréglages - </floater.string> <floater.string name="free_mode_title"> Voir l'objet </floater.string> diff --git a/indra/newview/skins/default/xui/fr/floater_nearby_chat.xml b/indra/newview/skins/default/xui/fr/floater_nearby_chat.xml index 9b1b21c434..8bbd34baae 100644 --- a/indra/newview/skins/default/xui/fr/floater_nearby_chat.xml +++ b/indra/newview/skins/default/xui/fr/floater_nearby_chat.xml @@ -1,4 +1,4 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <floater name="nearby_chat" title="CHAT PRÈS DE MOI"> - <check_box label="Traduction du chat (fournie par Google)" name="translate_chat_checkbox"/> + <check_box label="Traduction du chat" name="translate_chat_checkbox"/> </floater> diff --git a/indra/newview/skins/default/xui/fr/floater_object_weights.xml b/indra/newview/skins/default/xui/fr/floater_object_weights.xml index f1b063a3da..2667188308 100644 --- a/indra/newview/skins/default/xui/fr/floater_object_weights.xml +++ b/indra/newview/skins/default/xui/fr/floater_object_weights.xml @@ -1,28 +1,28 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <floater name="object_weights" title="AVANCÉ"> <floater.string name="nothing_selected" value="--"/> - <text name="selected_text" value="SELECTIONNÉ"/> + <text name="selected_text" value="SÉLECTION"/> <text name="objects" value="--"/> <text name="objects_label" value="Objets"/> <text name="prims" value="--"/> <text name="prims_label" value="Prims"/> - <text name="weights_of_selected_text" value="POIDS DES OBJETS SELECTIONNÉS"/> + <text name="weights_of_selected_text" value="POIDS DE LA SÉLECTION"/> <text name="download" value="--"/> - <text name="download_label" value="Télécharger"/> + <text name="download_label" value="Téléchargement"/> <text name="physics" value="--"/> - <text name="physics_label" value="Propriétés physiques"/> + <text name="physics_label" value="Physique"/> <text name="server" value="--"/> <text name="server_label" value="Serveur"/> <text name="display" value="--"/> - <text name="display_label" value="Afficher"/> + <text name="display_label" value="Affichage"/> <text name="land_impacts_text" value="IMPACTS SUR LE TERRAIN"/> <text name="selected" value="--"/> <text name="selected_label" value="Sélection"/> <text name="rezzed_on_land" value="--"/> - <text name="rezzed_on_land_label" value="Rezzé sur le terrain"/> + <text name="rezzed_on_land_label" value="Rezzés sur le terrain"/> <text name="remaining_capacity" value="--"/> <text name="remaining_capacity_label" value="Capacité restante"/> <text name="total_capacity" value="--"/> <text name="total_capacity_label" value="Capacité totale"/> - <text name="help_SLURL" value="[secondlife:///app/help/object_weights What is all this?...]"/> + <text name="help_SLURL" value="[secondlife:///app/help/object_weights De quoi s'agit-il ?...]"/> </floater> diff --git a/indra/newview/skins/default/xui/fr/floater_preview_animation.xml b/indra/newview/skins/default/xui/fr/floater_preview_animation.xml index a9407abfde..fdd2ac8beb 100644 --- a/indra/newview/skins/default/xui/fr/floater_preview_animation.xml +++ b/indra/newview/skins/default/xui/fr/floater_preview_animation.xml @@ -6,6 +6,6 @@ <text name="desc txt"> Description : </text> - <button label="Jouer dans Second Life" label_selected="Stop" name="Anim play btn" tool_tip="Lire cette animation de façon à ce que les autres puissent la voir" width="131"/> - <button label="Jouer localement" label_selected="Stop" left="160" name="Anim audition btn" tool_tip="Lire cette animation de façon à ce que vous soyez la seule personne à pouvoir la voir" width="120"/> + <button label="Exécuter dans Second Life" label_selected="Stop" name="Anim play btn" tool_tip="Lire cette animation de façon à ce que les autres puissent la voir" width="131"/> + <button label="Exécuter localement" label_selected="Stop" left="160" name="Anim audition btn" tool_tip="Lire cette animation de façon à ce que vous soyez la seule personne à pouvoir la voir" width="120"/> </floater> diff --git a/indra/newview/skins/default/xui/fr/floater_snapshot.xml b/indra/newview/skins/default/xui/fr/floater_snapshot.xml index 34d0957b46..365ff77ff9 100644 --- a/indra/newview/skins/default/xui/fr/floater_snapshot.xml +++ b/indra/newview/skins/default/xui/fr/floater_snapshot.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> -<floater name="Snapshot" title="APERÇU DE LA PHOTO" width="247"> +<floater name="Snapshot" title="APERÇU DE LA PHOTO"> <floater.string name="unknown"> inconnu </floater.string> diff --git a/indra/newview/skins/default/xui/fr/floater_stats.xml b/indra/newview/skins/default/xui/fr/floater_stats.xml index a74a338bd7..2ce2e6dcd5 100644 --- a/indra/newview/skins/default/xui/fr/floater_stats.xml +++ b/indra/newview/skins/default/xui/fr/floater_stats.xml @@ -38,7 +38,7 @@ <stat_view label="Simulateur" name="sim"> <stat_bar label="Dilatation temporelle" name="simtimedilation"/> <stat_bar label="FPS sim" name="simfps"/> - <stat_bar label="Propriétés physiques FPS" name="simphysicsfps"/> + <stat_bar label="FPS physique" name="simphysicsfps"/> <stat_view label="Détails des propriétés physiques" name="physicsdetail"> <stat_bar label="Objets fixés" name="physicspinnedtasks"/> <stat_bar label="Objets LOD faibles" name="physicslodtasks"/> @@ -53,17 +53,17 @@ <stat_bar label="Événements de scripts" name="simscripteps"/> <stat_bar label="Paquets en entrée" name="siminpps"/> <stat_bar label="Paquets en sortie" name="simoutpps"/> - <stat_bar label="En attente des téléchargements" name="simpendingdownloads"/> - <stat_bar label="En attente des chargements" name="simpendinguploads"/> + <stat_bar label="Téléchargements en attente" name="simpendingdownloads"/> + <stat_bar label="Chargements en attente" name="simpendinguploads"/> <stat_bar label="Total Unacked Bytes" name="simtotalunackedbytes"/> <stat_view label="Temps (ms)" name="simperf"> - <stat_bar label="Durée du cadre totale" name="simframemsec"/> + <stat_bar label="Durée totale de l'image" name="simframemsec"/> <stat_bar label="Durée nette" name="simnetmsec"/> - <stat_bar label="Durée physique" name="simsimphysicsmsec"/> - <stat_bar label="Durée de la simulation" name="simsimothermsec"/> - <stat_bar label="Durée de l'avatar" name="simagentmsec"/> + <stat_bar label="Durée sim (physique)" name="simsimphysicsmsec"/> + <stat_bar label="Durée sim (autre)" name="simsimothermsec"/> + <stat_bar label="Durée des avatars" name="simagentmsec"/> <stat_bar label="Durée des images" name="simimagesmsec"/> - <stat_bar label="Durée du script" name="simscriptmsec"/> + <stat_bar label="Durée des scripts" name="simscriptmsec"/> <stat_bar label="Temps d'inactivité" name="simsparemsec"/> <stat_view label="Détails Temps (ms)" name="timedetails"> <stat_bar label="Etape propr. physiques" name="simsimphysicsstepmsec"/> diff --git a/indra/newview/skins/default/xui/fr/floater_tools.xml b/indra/newview/skins/default/xui/fr/floater_tools.xml index 1ecf47f2e5..af5678ff0e 100644 --- a/indra/newview/skins/default/xui/fr/floater_tools.xml +++ b/indra/newview/skins/default/xui/fr/floater_tools.xml @@ -106,7 +106,7 @@ Aucune sélection effectuée. </text> <text name="remaining_capacity"> - [CAPACITY_STRING] [secondlife:///app/openfloater/object_weights More info] + [CAPACITY_STRING] [secondlife:///app/openfloater/object_weights Plus d'infos] </text> <tab_container name="Object Info Tabs"> <panel label="Général" name="General"> diff --git a/indra/newview/skins/default/xui/fr/floater_toybox.xml b/indra/newview/skins/default/xui/fr/floater_toybox.xml index e6fa212c65..33aea6bb2d 100644 --- a/indra/newview/skins/default/xui/fr/floater_toybox.xml +++ b/indra/newview/skins/default/xui/fr/floater_toybox.xml @@ -1,10 +1,10 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> -<floater name="Toybox" title="PERSONNALISER LA BARRE D'OUTILS"> +<floater name="Toybox" title="PERSONNALISER LES BARRES D'OUTILS"> <text name="toybox label 1"> - Ajouter ou supprimer des boutons en les faisant glisser vers les barres d'outils ou à partir de ces dernières. + Ajouter ou supprimer des boutons : les faire glisser vers ou depuis les barres d'outils. </text> <text name="toybox label 2"> - Les boutons s'afficheront comme indiqué ou comme des icônes, en fonction des paramètres de chaque barre d'outils. + Ils s'afficheront comme indiqué ou comme des icônes, selon les paramètres de barre d'outils. </text> - <button label="Restaurer les choix par défaut" label_selected="Restaurer les choix par défaut" name="btn_restore_defaults"/> + <button label="Valeurs par défaut" label_selected="Valeurs par défaut" name="btn_restore_defaults"/> </floater> diff --git a/indra/newview/skins/default/xui/fr/menu_group_plus.xml b/indra/newview/skins/default/xui/fr/menu_group_plus.xml index 0db5afedc7..ad76f11d79 100644 --- a/indra/newview/skins/default/xui/fr/menu_group_plus.xml +++ b/indra/newview/skins/default/xui/fr/menu_group_plus.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <menu name="menu_group_plus"> - <menu_item_call label="Rejoindre des groupes..." name="item_join"/> + <menu_item_call label="Rejoindre un groupe..." name="item_join"/> <menu_item_call label="Nouveau groupe..." name="item_new"/> </menu> diff --git a/indra/newview/skins/default/xui/fr/menu_inventory.xml b/indra/newview/skins/default/xui/fr/menu_inventory.xml index 53df8d11da..403111c4de 100644 --- a/indra/newview/skins/default/xui/fr/menu_inventory.xml +++ b/indra/newview/skins/default/xui/fr/menu_inventory.xml @@ -71,7 +71,7 @@ <menu_item_call label="Jouer dans Second Life" name="Animation Play"/> <menu_item_call label="Jouer localement" name="Animation Audition"/> <menu_item_call label="Envoyer un message instantané" name="Send Instant Message"/> - <menu_item_call label="Offrir de téléporter..." name="Offer Teleport..."/> + <menu_item_call label="Proposer une téléportation..." name="Offer Teleport..."/> <menu_item_call label="Démarrer le chat conférence" name="Conference Chat"/> <menu_item_call label="Activer" name="Activate"/> <menu_item_call label="Désactiver" name="Deactivate"/> diff --git a/indra/newview/skins/default/xui/fr/menu_people_nearby_view_sort.xml b/indra/newview/skins/default/xui/fr/menu_people_nearby_view_sort.xml index 0aad174fbd..8bb466b8d6 100644 --- a/indra/newview/skins/default/xui/fr/menu_people_nearby_view_sort.xml +++ b/indra/newview/skins/default/xui/fr/menu_people_nearby_view_sort.xml @@ -5,5 +5,5 @@ <menu_item_check label="Trier par distance" name="sort_distance"/> <menu_item_check label="Afficher les icônes des résidents" name="view_icons"/> <menu_item_check label="Afficher la carte" name="view_map"/> - <menu_item_call label="Afficher les résidents et les objets interdits" name="show_blocked_list"/> + <menu_item_call label="Afficher les résidents et les objets ignorés" name="show_blocked_list"/> </toggleable_menu> diff --git a/indra/newview/skins/default/xui/fr/menu_toolbars.xml b/indra/newview/skins/default/xui/fr/menu_toolbars.xml index bbfbe4b9ed..d3e9f92770 100644 --- a/indra/newview/skins/default/xui/fr/menu_toolbars.xml +++ b/indra/newview/skins/default/xui/fr/menu_toolbars.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <context_menu name="Toolbars Popup"> <menu_item_call label="Choisir les boutons..." name="Chose Buttons"/> - <menu_item_check label="Icônes et étiquettes" name="icons_with_text"/> + <menu_item_check label="Icônes et libellés" name="icons_with_text"/> <menu_item_check label="Icônes uniquement" name="icons_only"/> </context_menu> diff --git a/indra/newview/skins/default/xui/fr/menu_viewer.xml b/indra/newview/skins/default/xui/fr/menu_viewer.xml index 64cd463070..e2cb1f999d 100644 --- a/indra/newview/skins/default/xui/fr/menu_viewer.xml +++ b/indra/newview/skins/default/xui/fr/menu_viewer.xml @@ -24,7 +24,7 @@ <menu_item_call label="Acheter des L$" name="Buy and Sell L$"/> <menu_item_call label="Préférences..." name="Preferences"/> <menu_item_call label="Barres d'outils..." name="Toolbars"/> - <menu_item_call label="Cacher tous les contrôles" name="Hide UI"/> + <menu_item_call label="Masquer tous les contrôles" name="Hide UI"/> <menu_item_call label="Quitter [APP_NAME]" name="Quit"/> </menu> <menu label="Communiquer" name="Communicate"> @@ -319,7 +319,7 @@ <menu_item_check label="Pauser l'avatar" name="AgentPause"/> <menu_item_call label="Activer le journal des messages" name="Enable Message Log"/> <menu_item_call label="Désactiver le journal des messages" name="Disable Message Log"/> - <menu_item_check label="Velocity Interpolate Objects" name="Velocity Interpolate Objects"/> + <menu_item_check label="Objets d'interpolation de vitesse" name="Velocity Interpolate Objects"/> <menu_item_check label="Interpolation ping des positions des objets" name="Ping Interpolate Object Positions"/> <menu_item_call label="Abandonner un paquet" name="Drop a Packet"/> </menu> @@ -336,7 +336,7 @@ <menu_item_check label="Ignorer les paramètres du soleil de la sim" name="Sim Sun Override"/> <menu_item_check label="Balise animée" name="Cheesy Beacon"/> <menu_item_check label="Météo fixe" name="Fixed Weather"/> - <menu_item_call label="Dump Region Object Cache" name="Dump Region Object Cache"/> + <menu_item_call label="Vidage de cache d'objet de la région" name="Dump Region Object Cache"/> </menu> <menu label="Interface" name="UI"> <menu_item_call label="Test du navigateur de médias" name="Web Browser Test"/> diff --git a/indra/newview/skins/default/xui/fr/notifications.xml b/indra/newview/skins/default/xui/fr/notifications.xml index 31c29029b5..d8d79d8dde 100644 --- a/indra/newview/skins/default/xui/fr/notifications.xml +++ b/indra/newview/skins/default/xui/fr/notifications.xml @@ -980,7 +980,7 @@ Proposer à [NAME] de devenir votre ami(e) ? </form> </notification> <notification name="RemoveFromFriends"> - Voulez-vous supprimer [NAME] de votre liste d'amis ? + Voulez-vous supprimer <nolink>[NAME]</nolink> de votre liste d'amis ? <usetemplate name="okcancelbuttons" notext="Annuler" yestext="OK"/> </notification> <notification name="RemoveMultipleFromFriends"> @@ -2119,10 +2119,10 @@ Cette opération lancera votre navigateur Web. Sujet : [SUBJECT], Message : [MESSAGE] </notification> <notification name="FriendOnline"> - [NAME] est en ligne + <nolink>[NAME]</nolink> est en ligne </notification> <notification name="FriendOffline"> - [NAME] est hors ligne + <nolink>[NAME]</nolink> est hors ligne </notification> <notification name="AddSelfFriend"> Même si vous êtes extrêmement sympathique, vous ne pouvez pas devenir ami avec vous-même. @@ -2518,10 +2518,10 @@ Veuillez réessayer dans quelques minutes. </form> </notification> <notification name="FriendshipAccepted"> - [NAME] a accepté votre amitié. + <nolink>[NAME]</nolink> a accepté votre amitié. </notification> <notification name="FriendshipDeclined"> - [NAME] a refusé votre amitié. + <nolink>[NAME]</nolink> a refusé votre amitié. </notification> <notification name="FriendshipAcceptedByMe"> Amitié acceptée. @@ -3046,8 +3046,8 @@ Cliquez sur un point dans le monde et faites glisser votre souris pour faire tou <usetemplate name="okcancelbuttons" notext="Ne pas quitter" yestext="Quitter"/> </notification> <notification label="" name="ConfirmHideUI"> - Cette action cachera tous les objets des menus et boutons. Pour les récupérer, cliquez de nouveau sur [SHORTCUT]. - <usetemplate ignoretext="Confimer avant de cacher l'interface" name="okcancelignore" notext="Annuler" yestext="OK"/> + Cette action masquera tous les boutons et articles de menu. Pour les récupérer, cliquez de nouveau sur [SHORTCUT]. + <usetemplate ignoretext="Confirmer avant de masquer l'interface" name="okcancelignore" notext="Annuler" yestext="OK"/> </notification> <global name="UnsupportedGLRequirements"> Vous semblez ne pas avoir le matériel requis pour utiliser [APP_NAME]. [APP_NAME] requiert une carte graphique OpenGL avec une prise en charge du multitexturing. Si vous avez une telle carte, assurez-vous que vous avez aussi les pilotes les plus récents pour la carte, ainsi que les service packs et les patchs pour votre système d'exploitation. diff --git a/indra/newview/skins/default/xui/fr/panel_my_profile.xml b/indra/newview/skins/default/xui/fr/panel_my_profile.xml deleted file mode 100644 index 5207c5a28e..0000000000 --- a/indra/newview/skins/default/xui/fr/panel_my_profile.xml +++ /dev/null @@ -1,42 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes"?> -<panel label="Profil" name="panel_profile"> - <string name="CaptionTextAcctInfo"> - [ACCTTYPE] -[PAYMENTINFO] [AGEVERIFICATION] - </string> - <string name="payment_update_link_url"> - http://www.secondlife.com/account/billing.php?lang=en - </string> - <string name="partner_edit_link_url"> - http://www.secondlife.com/account/partners.php?lang=en - </string> - <string name="my_account_link_url" value="http://secondlife.com/account"/> - <string name="no_partner_text" value="Aucun"/> - <string name="no_group_text" value="Aucun"/> - <string name="RegisterDateFormat"> - [REG_DATE] ([AGE]) - </string> - <string name="name_text_args"> - [NAME] - </string> - <string name="display_name_text_args"> - [DISPLAY_NAME] - </string> - <layout_stack name="layout"> - <layout_panel name="profile_stack"> - <scroll_container name="profile_scroll"> - <panel name="scroll_content_panel"> - <panel name="second_life_image_panel"> - <text name="display_name_descr_text"> - Nom d'utilisateur - </text> - <text name="name_descr_text"> - Nom d'affichage - </text> - <button label="Profil" name="see_profile_btn" tool_tip="Afficher le profil de cet avatar."/> - </panel> - </panel> - </scroll_container> - </layout_panel> - </layout_stack> -</panel> diff --git a/indra/newview/skins/default/xui/fr/panel_nearby_chat.xml b/indra/newview/skins/default/xui/fr/panel_nearby_chat.xml index 98eddf196b..31cb3308e3 100644 --- a/indra/newview/skins/default/xui/fr/panel_nearby_chat.xml +++ b/indra/newview/skins/default/xui/fr/panel_nearby_chat.xml @@ -1,4 +1,4 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <panel name="nearby_chat"> - <check_box label="Traduction du chat (fournie par Google)" name="translate_chat_checkbox"/> + <check_box label="Traduction du chat" name="translate_chat_checkbox"/> </panel> diff --git a/indra/newview/skins/default/xui/fr/panel_notes.xml b/indra/newview/skins/default/xui/fr/panel_notes.xml deleted file mode 100644 index 1b44bc4b73..0000000000 --- a/indra/newview/skins/default/xui/fr/panel_notes.xml +++ /dev/null @@ -1,35 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes"?> -<panel label="Notes/Perso" name="panel_notes"> - <layout_stack name="layout"> - <layout_panel name="notes_stack"> - <scroll_container name="profile_scroll"> - <panel name="profile_scroll_panel"> - <text name="status_message" value="Mes notes perso :"/> - <text name="status_message2" value="Autoriser cette personne à :"/> - <check_box label="Afficher mon statut en ligne" name="status_check"/> - <check_box label="Me situer sur la carte" name="map_check"/> - <check_box label="Modifier, supprimer ou prendre mes objets" name="objects_check"/> - </panel> - </scroll_container> - </layout_panel> - <layout_panel name="notes_buttons_panel"> - <layout_stack name="bottom_bar_ls"> - <layout_panel name="add_friend_btn_lp"> - <button label="Devenir amis" name="add_friend" tool_tip="Proposer à ce résident de devenir votre ami"/> - </layout_panel> - <layout_panel name="im_btn_lp"> - <button label="IM" name="im" tool_tip="Ouvrir une session IM"/> - </layout_panel> - <layout_panel name="call_btn_lp"> - <button label="Appeler" name="call" tool_tip="Appeler ce résident"/> - </layout_panel> - <layout_panel name="show_on_map_btn_lp"> - <button label="Carte" name="show_on_map_btn" tool_tip="Afficher le résident sur la carte"/> - </layout_panel> - <layout_panel name="teleport_btn_lp"> - <button label="Téléporter" name="teleport" tool_tip="Proposer une téléportation"/> - </layout_panel> - </layout_stack> - </layout_panel> - </layout_stack> -</panel> diff --git a/indra/newview/skins/default/xui/fr/panel_preferences_chat.xml b/indra/newview/skins/default/xui/fr/panel_preferences_chat.xml index 646f53704c..fa026d8106 100644 --- a/indra/newview/skins/default/xui/fr/panel_preferences_chat.xml +++ b/indra/newview/skins/default/xui/fr/panel_preferences_chat.xml @@ -31,7 +31,7 @@ <spinner label="Disparition progressive du popup Chat près de moi :" name="nearby_toasts_fadingtime"/> <check_box name="translate_chat_checkbox"/> <text name="translate_chb_label"> - Utiliser la traduction automatique lors des chats (fournie par Google) + Utiliser la traduction automatique lors des chats </text> <text name="translate_language_text"> Traduire le chat en : diff --git a/indra/newview/skins/default/xui/fr/panel_preferences_general.xml b/indra/newview/skins/default/xui/fr/panel_preferences_general.xml index dd4c1c9f63..66b84af3aa 100644 --- a/indra/newview/skins/default/xui/fr/panel_preferences_general.xml +++ b/indra/newview/skins/default/xui/fr/panel_preferences_general.xml @@ -16,7 +16,7 @@ <combo_box.item label="Русский (Russe) - Bêta" name="Russian"/> <combo_box.item label="Türkçe (Turc) - Bêta" name="Turkish"/> <combo_box.item label="日本語 (Japonais) - Bêta" name="(Japanese)"/> - <combo_box.item label="正體 (Chinois traditionnel) - Bêta" name="Traditional Chinese"/> + <combo_box.item label="正體中文 (Chinois traditionnel) - Bêta" name="Traditional Chinese"/> </combo_box> <text name="language_textbox2"> (redémarrage requis) diff --git a/indra/newview/skins/default/xui/fr/panel_preferences_move.xml b/indra/newview/skins/default/xui/fr/panel_preferences_move.xml index efb520bfd3..94d7322b22 100644 --- a/indra/newview/skins/default/xui/fr/panel_preferences_move.xml +++ b/indra/newview/skins/default/xui/fr/panel_preferences_move.xml @@ -24,16 +24,16 @@ Clic simple sur le terrain : </text> <combo_box name="single_click_action_combo"> - <combo_box.item label="Pas d'action" name="0"/> - <combo_box.item label="Bouger vers le point cliqué" name="1"/> + <combo_box.item label="Aucune action" name="0"/> + <combo_box.item label="Déplacement vers le clic" name="1"/> </combo_box> <text name="double_click_action_lbl"> Double-clic sur le terrain : </text> <combo_box name="double_click_action_combo"> - <combo_box.item label="Pas d'action" name="0"/> - <combo_box.item label="Bouger vers le point cliqué" name="1"/> - <combo_box.item label="Téléporter vers le point cliqué" name="2"/> + <combo_box.item label="Aucune action" name="0"/> + <combo_box.item label="Déplacement vers le double clic" name="1"/> + <combo_box.item label="Téléportation vers le double clic" name="2"/> </combo_box> <button label="Autres accessoires" name="joystick_setup_button"/> </panel> diff --git a/indra/newview/skins/default/xui/fr/panel_preferences_privacy.xml b/indra/newview/skins/default/xui/fr/panel_preferences_privacy.xml index 3123a4c6fe..cf1a374da6 100644 --- a/indra/newview/skins/default/xui/fr/panel_preferences_privacy.xml +++ b/indra/newview/skins/default/xui/fr/panel_preferences_privacy.xml @@ -20,7 +20,7 @@ <check_box label="Inclure la date et l'heure pour chaque ligne du journal de chat" name="show_timestamps_check_im"/> <check_box label="Inclure la date dans le nom du fichier journal" name="logfile_name_datestamp"/> <text name="log_path_desc"> - Emplacement : + Emplacement journaux : </text> <line_editor left="308" name="log_path_string" right="-20"/> <button label="Parcourir" label_selected="Parcourir" name="log_path_button" width="150"/> diff --git a/indra/newview/skins/default/xui/fr/panel_preferences_sound.xml b/indra/newview/skins/default/xui/fr/panel_preferences_sound.xml index deaec2e14f..37eb6bbeb0 100644 --- a/indra/newview/skins/default/xui/fr/panel_preferences_sound.xml +++ b/indra/newview/skins/default/xui/fr/panel_preferences_sound.xml @@ -17,9 +17,9 @@ <check_box label="Activé" name="enable_media"/> <slider label="Chat vocal" name="Voice Volume"/> <check_box label="Activé" name="enable_voice_check"/> - <check_box label="Autoriser la lecture automatique du média" name="media_auto_play_btn" tool_tip="Cochez pour autoriser la lecture automatique du média" value="true"/> - <check_box label="Lecture du média aux autres avatars" name="media_show_on_others_btn" tool_tip="Décochez pour masquer le média aux autres avatars près de vous" value="true"/> - <check_box label="Lire les sons des gestes" name="gesture_audio_play_btn" tool_tip="Cochez cette case pour entendre les sons associés aux gestes." value="true"/> + <check_box label="Autoriser la lecture automatique du média" name="media_auto_play_btn" tool_tip="Cocher pour autoriser la lecture automatique du média." value="true"/> + <check_box label="Lire le média attaché aux autres avatars" name="media_show_on_others_btn" tool_tip="Décocher pour masquer le média attaché aux autres avatars près de vous." value="true"/> + <check_box label="Lire les sons des gestes" name="gesture_audio_play_btn" tool_tip="Cocher cette case pour entendre les sons associés aux gestes." value="true"/> <text name="voice_chat_settings"> Paramètres du chat vocal </text> diff --git a/indra/newview/skins/default/xui/fr/panel_prim_media_controls.xml b/indra/newview/skins/default/xui/fr/panel_prim_media_controls.xml index f16fcebd02..ad744b7760 100644 --- a/indra/newview/skins/default/xui/fr/panel_prim_media_controls.xml +++ b/indra/newview/skins/default/xui/fr/panel_prim_media_controls.xml @@ -13,10 +13,10 @@ </layout_stack> <layout_stack name="media_controls"> <layout_panel name="back"> - <button name="back_btn" tool_tip="Naviguer en arrière"/> + <button name="back_btn" tool_tip="Précédente"/> </layout_panel> <layout_panel name="fwd"> - <button name="fwd_btn" tool_tip="Naviguer vers l'avant"/> + <button name="fwd_btn" tool_tip="Suivante"/> </layout_panel> <layout_panel name="home"> <button name="home_btn" tool_tip="Page d'accueil"/> @@ -34,7 +34,7 @@ <button name="play_btn" tool_tip="Lire le média"/> </layout_panel> <layout_panel name="pause"> - <button name="pause_btn" tool_tip="Pauser le média"/> + <button name="pause_btn" tool_tip="Mettre le média sur pause"/> </layout_panel> <layout_panel name="media_address"> <line_editor name="media_address_url" tool_tip="URL du média"/> @@ -48,7 +48,7 @@ </layout_stack> </layout_panel> <layout_panel name="media_play_position"> - <slider_bar initial_value="0.5" name="media_play_slider" tool_tip="Progrès de la lecture du film"/> + <slider_bar initial_value="0.5" name="media_play_slider" tool_tip="Progression de la lecture du film"/> </layout_panel> <layout_panel name="skip_back"> <button name="skip_back_btn" tool_tip="Reculer"/> diff --git a/indra/newview/skins/default/xui/fr/panel_profile.xml b/indra/newview/skins/default/xui/fr/panel_profile.xml deleted file mode 100644 index 9aa6fe97a1..0000000000 --- a/indra/newview/skins/default/xui/fr/panel_profile.xml +++ /dev/null @@ -1,74 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes"?> -<panel label="Profil" name="panel_profile"> - <string name="CaptionTextAcctInfo"> - [ACCTTYPE] -[PAYMENTINFO] [AGEVERIFICATION] - </string> - <string name="payment_update_link_url"> - http://www.secondlife.com/account/billing.php?lang=fr-FR - </string> - <string name="partner_edit_link_url"> - http://www.secondlife.com/account/partners.php?lang=fr - </string> - <string name="my_account_link_url" value="http://secondlife.com/my/account/index.php?lang=fr-FR"/> - <string name="no_partner_text" value="Aucun"/> - <string name="no_group_text" value="Aucun"/> - <string name="RegisterDateFormat"> - [REG_DATE] ([AGE]) - </string> - <string name="name_text_args"> - [NAME] - </string> - <string name="display_name_text_args"> - [DISPLAY_NAME] - </string> - <layout_stack name="layout"> - <layout_panel name="profile_stack"> - <scroll_container name="profile_scroll"> - <panel name="profile_scroll_panel"> - <panel name="second_life_image_panel"> - <text name="title_sl_descr_text" value="[SECOND_LIFE]:"/> - </panel> - <panel name="first_life_image_panel"> - <text name="title_rw_descr_text" value="Vie réelle :"/> - </panel> - <text name="title_member_text" value="Résident depuis :"/> - <text name="title_acc_status_text" value="Statut du compte :"/> - <text_editor name="acc_status_text"> - Résident. Aucune info de paiement enregistrée. - Linden. - </text_editor> - <text name="title_partner_text" value="Partenaire :"/> - <panel name="partner_data_panel"> - <text initial_value="(récupération en cours)" name="partner_text"/> - </panel> - <text name="title_groups_text" value="Groupes :"/> - </panel> - </scroll_container> - </layout_panel> - </layout_stack> - <layout_stack name="layout_verb_buttons"> - <layout_panel name="profile_buttons_panel"> - <layout_stack name="bottom_bar_ls"> - <layout_panel name="add_friend_btn_lp"> - <button label="Devenir amis" name="add_friend" tool_tip="Proposer à ce résident de devenir votre ami"/> - </layout_panel> - <layout_panel name="im_btn_lp"> - <button label="IM" name="im" tool_tip="Ouvrir une session IM"/> - </layout_panel> - <layout_panel name="call_btn_lp"> - <button label="Appeler" name="call" tool_tip="Appeler ce résident"/> - </layout_panel> - <layout_panel name="chat_btn_lp"> - <button label="Téléporter" name="teleport" tool_tip="Proposer une téléportation"/> - </layout_panel> - <layout_panel name="overflow_btn_lp"> - <menu_button label="▼" name="overflow_btn" tool_tip="Payer le résident ou partager l'inventaire avec lui"/> - </layout_panel> - </layout_stack> - </layout_panel> - <layout_panel name="profile_me_buttons_panel"> - <button label="Modifier le profil" name="edit_profile_btn" tool_tip="Modifier vos informations personnelles"/> - </layout_panel> - </layout_stack> -</panel> diff --git a/indra/newview/skins/default/xui/fr/panel_profile_view.xml b/indra/newview/skins/default/xui/fr/panel_profile_view.xml deleted file mode 100644 index 76ba44e899..0000000000 --- a/indra/newview/skins/default/xui/fr/panel_profile_view.xml +++ /dev/null @@ -1,20 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes"?> -<panel name="panel_target_profile"> - <string name="status_online"> - En ligne - </string> - <string name="status_offline"> - Hors ligne - </string> - <text name="display_name_label" value="Nom d'affichage :"/> - <text name="solo_username_label" value="Nom d'utilisateur :"/> - <text name="status" value="En ligne"/> - <text name="user_name_small" value="Jack oh look at me this is a super duper long name"/> - <button name="copy_to_clipboard" tool_tip="Copier dans le presse-papiers"/> - <text name="user_label" value="Nom d'utilisateur :"/> - <tab_container name="tabs"> - <panel label="PROFIL" name="panel_profile"/> - <panel label="FAVORIS" name="panel_picks"/> - <panel label="NOTES/PERSO" name="panel_notes"/> - </tab_container> -</panel> diff --git a/indra/newview/skins/default/xui/fr/panel_region_debug.xml b/indra/newview/skins/default/xui/fr/panel_region_debug.xml index cb4a74e142..733c3f9a22 100644 --- a/indra/newview/skins/default/xui/fr/panel_region_debug.xml +++ b/indra/newview/skins/default/xui/fr/panel_region_debug.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> -<panel label="Débugger" name="Debug"> +<panel label="Débogage" name="Debug"> <text name="region_text_lbl"> Région : </text> diff --git a/indra/newview/skins/default/xui/fr/panel_status_bar.xml b/indra/newview/skins/default/xui/fr/panel_status_bar.xml index e836c24a94..ac61eb7e52 100644 --- a/indra/newview/skins/default/xui/fr/panel_status_bar.xml +++ b/indra/newview/skins/default/xui/fr/panel_status_bar.xml @@ -17,12 +17,12 @@ </panel.string> <panel name="balance_bg"> <text name="balance" tool_tip="Cliquer sur ce bouton pour actualiser votre solde en L$." value="20 L$"/> - <button label="Achat de L$" name="buyL" tool_tip="Cliquer pour acheter plus de L$"/> - <button label="Achats" name="goShop" tool_tip="Ouvrir la Place du marché Second Life"/> + <button label="Acheter L$" name="buyL" tool_tip="Cliquer pour acheter plus de L$."/> + <button label="Achats" name="goShop" tool_tip="Ouvrir la Place du marché Second Life."/> </panel> <text name="TimeText" tool_tip="Heure actuelle (Pacifique)"> 00h00 PST </text> - <button name="media_toggle_btn" tool_tip="Arrêter tous les médias (musique, vidéo, pages web)"/> - <button name="volume_btn" tool_tip="Contrôle du volume global"/> + <button name="media_toggle_btn" tool_tip="Arrêter tous les médias (musique, vidéo, pages web)."/> + <button name="volume_btn" tool_tip="Régler le volume global."/> </panel> diff --git a/indra/newview/skins/default/xui/fr/strings.xml b/indra/newview/skins/default/xui/fr/strings.xml index daa31c980a..f9f3366f63 100644 --- a/indra/newview/skins/default/xui/fr/strings.xml +++ b/indra/newview/skins/default/xui/fr/strings.xml @@ -4837,7 +4837,7 @@ Essayez avec le chemin d'accès à l'éditeur entre guillemets doubles Parler </string> <string name="Command_View_Label"> - Vue + Affichage </string> <string name="Command_Voice_Label"> Chat près de vous diff --git a/indra/newview/skins/default/xui/fr/teleport_strings.xml b/indra/newview/skins/default/xui/fr/teleport_strings.xml index 7c291c0984..401b272c81 100644 --- a/indra/newview/skins/default/xui/fr/teleport_strings.xml +++ b/indra/newview/skins/default/xui/fr/teleport_strings.xml @@ -20,6 +20,10 @@ Si vous ne parvenez toujours pas à être téléporté, déconnectez-vous puis r Désolé, la connexion vers votre lieu de téléportation n'a pas abouti. Veuillez réessayer dans un moment. </message> + <message name="NoHelpIslandTP"> + Vous ne pouvez pas retourner sur Welcome Island. +Pour répéter le didacticiel, veuillez aller sur Welcome Island Public. + </message> <message name="noaccess_tport"> Désolé, vous n'avez pas accès à cette destination. </message> diff --git a/indra/newview/skins/default/xui/it/floater_buy_currency.xml b/indra/newview/skins/default/xui/it/floater_buy_currency.xml index 635b56d37a..d985ad2b3c 100644 --- a/indra/newview/skins/default/xui/it/floater_buy_currency.xml +++ b/indra/newview/skins/default/xui/it/floater_buy_currency.xml @@ -46,7 +46,7 @@ [AMT]L$ </text> <text name="currency_links"> - [http://www.secondlife.com/my/account/payment_method_management.php payment method] | [http://www.secondlife.com/my/account/currency.php currency] | [http://www.secondlife.com/my/account/exchange_rates.php exchange rate] + [http://www.secondlife.com/my/account/payment_method_management.php payment method] | [http://www.secondlife.com/my/account/currency.php currency] </text> <text name="exchange_rate_note"> Riscrivi l'importo per vedere l'ultimo tasso al cambio. diff --git a/indra/newview/skins/default/xui/it/floater_camera.xml b/indra/newview/skins/default/xui/it/floater_camera.xml index be4b8e210d..7e6ca4307e 100644 --- a/indra/newview/skins/default/xui/it/floater_camera.xml +++ b/indra/newview/skins/default/xui/it/floater_camera.xml @@ -9,15 +9,6 @@ <floater.string name="move_tooltip"> Muovi la telecamera su e giù e a sinistra e destra </floater.string> - <floater.string name="camera_modes_title"> - Modalità della fotocamera - </floater.string> - <floater.string name="pan_mode_title"> - Ruota visuale - Ingrandisci - Panoramica - </floater.string> - <floater.string name="presets_mode_title"> - Visuali predefinite - </floater.string> <floater.string name="free_mode_title"> Vedi oggetto </floater.string> diff --git a/indra/newview/skins/default/xui/it/floater_nearby_chat.xml b/indra/newview/skins/default/xui/it/floater_nearby_chat.xml index 4c41df8a62..9e81899880 100644 --- a/indra/newview/skins/default/xui/it/floater_nearby_chat.xml +++ b/indra/newview/skins/default/xui/it/floater_nearby_chat.xml @@ -1,4 +1,4 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <floater name="nearby_chat" title="CHAT NEI DINTORNI"> - <check_box label="Traduci chat (tecnologia Google)" name="translate_chat_checkbox"/> + <check_box label="Traduci chat" name="translate_chat_checkbox"/> </floater> diff --git a/indra/newview/skins/default/xui/it/floater_snapshot.xml b/indra/newview/skins/default/xui/it/floater_snapshot.xml index 5bff19e8d7..f1c5cc4caf 100644 --- a/indra/newview/skins/default/xui/it/floater_snapshot.xml +++ b/indra/newview/skins/default/xui/it/floater_snapshot.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> -<floater name="Snapshot" title="ANTEPRIMA FOTOGRAFIA" width="247"> +<floater name="Snapshot" title="ANTEPRIMA FOTOGRAFIA"> <floater.string name="unknown"> sconosciuto </floater.string> diff --git a/indra/newview/skins/default/xui/it/notifications.xml b/indra/newview/skins/default/xui/it/notifications.xml index e19b84912a..2db0892cd6 100644 --- a/indra/newview/skins/default/xui/it/notifications.xml +++ b/indra/newview/skins/default/xui/it/notifications.xml @@ -978,7 +978,7 @@ Offri l'amicizia a [NAME]? </form> </notification> <notification name="RemoveFromFriends"> - Vuoi rimuovere [NAME] dalla lista dei tuoi amici? + Vuoi rimuovere <nolink>[NAME]</nolink> dalla lista dei tuoi amici? <usetemplate name="okcancelbuttons" notext="Annulla" yestext="OK"/> </notification> <notification name="RemoveMultipleFromFriends"> @@ -2125,10 +2125,10 @@ Verrà avviato il browser Web. Oggetto: [SUBJECT], Messaggio: [MESSAGE] </notification> <notification name="FriendOnline"> - [NAME] è Online + <nolink>[NAME]</nolink> è Online </notification> <notification name="FriendOffline"> - [NAME] è Offline + <nolink>[NAME]</nolink> è Offline </notification> <notification name="AddSelfFriend"> Anche se sei molto simpatico, non puoi aggiungere te stesso all'elenco degli amici. @@ -2520,10 +2520,10 @@ Riprova tra qualche istante. </form> </notification> <notification name="FriendshipAccepted"> - [NAME] ha accettato la tua offerta di amicizia. + <nolink>[NAME]</nolink> ha accettato la tua offerta di amicizia. </notification> <notification name="FriendshipDeclined"> - [NAME] ha rifiutato la tua offerta di amicizia. + <nolink>[NAME]</nolink> ha rifiutato la tua offerta di amicizia. </notification> <notification name="FriendshipAcceptedByMe"> Offerta di amicizia accettata. diff --git a/indra/newview/skins/default/xui/it/panel_my_profile.xml b/indra/newview/skins/default/xui/it/panel_my_profile.xml deleted file mode 100644 index 094b97962f..0000000000 --- a/indra/newview/skins/default/xui/it/panel_my_profile.xml +++ /dev/null @@ -1,31 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes"?> -<panel label="Profilo" name="panel_profile"> - <string name="no_partner_text" value="Nessuno"/> - <string name="no_group_text" value="Nessuno"/> - <string name="RegisterDateFormat"> - [REG_DATE] ([AGE]) - </string> - <string name="name_text_args"> - [NAME] - </string> - <string name="display_name_text_args"> - [DISPLAY_NAME] - </string> - <layout_stack name="layout"> - <layout_panel name="profile_stack"> - <scroll_container name="profile_scroll"> - <panel name="scroll_content_panel"> - <panel name="second_life_image_panel"> - <text name="display_name_descr_text"> - Nome utente - </text> - <text name="name_descr_text"> - Nome visualizzato - </text> - <button label="Profilo" name="see_profile_btn" tool_tip="Visualizza profilo per questo avatar"/> - </panel> - </panel> - </scroll_container> - </layout_panel> - </layout_stack> -</panel> diff --git a/indra/newview/skins/default/xui/it/panel_nearby_chat.xml b/indra/newview/skins/default/xui/it/panel_nearby_chat.xml index 7afc3cd7e7..1b529e2737 100644 --- a/indra/newview/skins/default/xui/it/panel_nearby_chat.xml +++ b/indra/newview/skins/default/xui/it/panel_nearby_chat.xml @@ -1,4 +1,4 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <panel name="nearby_chat"> - <check_box label="Traduci chat (tecnologia Google)" name="translate_chat_checkbox"/> + <check_box label="Traduci chat" name="translate_chat_checkbox"/> </panel> diff --git a/indra/newview/skins/default/xui/it/panel_notes.xml b/indra/newview/skins/default/xui/it/panel_notes.xml deleted file mode 100644 index e127138277..0000000000 --- a/indra/newview/skins/default/xui/it/panel_notes.xml +++ /dev/null @@ -1,35 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes"?> -<panel label="Note e Privacy" name="panel_notes"> - <layout_stack name="layout"> - <layout_panel name="notes_stack"> - <scroll_container name="profile_scroll"> - <panel name="profile_scroll_panel"> - <text name="status_message" value="Le mie note private:"/> - <text name="status_message2" value="Consenti a questa persona di:"/> - <check_box label="Vedere se sono online" name="status_check"/> - <check_box label="Vedermi sulla mappa" name="map_check"/> - <check_box label="Modificare, eliminare o prendere i miei oggetti" name="objects_check"/> - </panel> - </scroll_container> - </layout_panel> - <layout_panel name="notes_buttons_panel"> - <layout_stack name="bottom_bar_ls"> - <layout_panel name="add_friend_btn_lp"> - <button label="Aggiungi come amico" name="add_friend" tool_tip="Offri amicizia a questo residente"/> - </layout_panel> - <layout_panel name="im_btn_lp"> - <button label="IM" name="im" tool_tip="Apri una sessione messaggio istantaneo"/> - </layout_panel> - <layout_panel name="call_btn_lp"> - <button label="Chiama" name="call" tool_tip="Chiama questo residente"/> - </layout_panel> - <layout_panel name="show_on_map_btn_lp"> - <button label="Mappa" name="show_on_map_btn" tool_tip="Mostra il residente sulla mappa"/> - </layout_panel> - <layout_panel name="teleport_btn_lp"> - <button label="Teleport" name="teleport" tool_tip="Offri teleport"/> - </layout_panel> - </layout_stack> - </layout_panel> - </layout_stack> -</panel> diff --git a/indra/newview/skins/default/xui/it/panel_preferences_chat.xml b/indra/newview/skins/default/xui/it/panel_preferences_chat.xml index 72e687b6d1..1a0a1d8434 100644 --- a/indra/newview/skins/default/xui/it/panel_preferences_chat.xml +++ b/indra/newview/skins/default/xui/it/panel_preferences_chat.xml @@ -29,9 +29,9 @@ <check_box label="Chat IM" name="EnableIMChatPopups" tool_tip="Seleziona per vedere una finestra popup quando arriva un messaggio IM"/> <spinner label="Durata chat vicine:" name="nearby_toasts_lifetime"/> <spinner label="Durata dissolvenza chat vicine:" name="nearby_toasts_fadingtime"/> - <check_box label="Use machine translation while chatting (powered by Google)" name="translate_chat_checkbox"/> + <check_box label="Use machine translation while chatting" name="translate_chat_checkbox"/> <text name="translate_chb_label"> - Usa la traduzione meccanica durante le chat (tecnologia Google) + Usa la traduzione meccanica durante le chat </text> <text name="translate_language_text" width="110"> Traduci chat in: diff --git a/indra/newview/skins/default/xui/it/panel_preferences_general.xml b/indra/newview/skins/default/xui/it/panel_preferences_general.xml index 4f52105404..90a833471c 100644 --- a/indra/newview/skins/default/xui/it/panel_preferences_general.xml +++ b/indra/newview/skins/default/xui/it/panel_preferences_general.xml @@ -16,7 +16,7 @@ <combo_box.item label="Русский (Russo) - Beta" name="Russian"/> <combo_box.item label="Türkçe (Turco) - Beta" name="Turkish"/> <combo_box.item label="日本語 (Giapponese) - Beta" name="(Japanese)"/> - <combo_box.item label="正體 (Cinese tradizionale) - Beta" name="Traditional Chinese"/> + <combo_box.item label="正體中文 (Cinese tradizionale) - Beta" name="Traditional Chinese"/> </combo_box> <text name="language_textbox2"> (Richiede il riavvio) diff --git a/indra/newview/skins/default/xui/it/panel_profile.xml b/indra/newview/skins/default/xui/it/panel_profile.xml deleted file mode 100644 index 309937c5a0..0000000000 --- a/indra/newview/skins/default/xui/it/panel_profile.xml +++ /dev/null @@ -1,70 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes"?> -<panel label="Profilo" name="panel_profile"> - <string name="CaptionTextAcctInfo"> - [ACCTTYPE] -[PAYMENTINFO] [AGEVERIFICATION] - </string> - <string name="payment_update_link_url"> - http://www.secondlife.com/account/billing.php?lang=it-IT - </string> - <string name="partner_edit_link_url"> - http://www.secondlife.com/account/partners.php?lang=it - </string> - <string name="my_account_link_url" value="http://secondlife.com/my/account/index.php?lang=it-IT"/> - <string name="no_partner_text" value="Nessuno"/> - <string name="no_group_text" value="Nessuno"/> - <string name="RegisterDateFormat"> - [REG_DATE] ([AGE]) - </string> - <string name="name_text_args"> - [NAME] - </string> - <string name="display_name_text_args"> - [DISPLAY_NAME] - </string> - <layout_stack name="layout"> - <layout_panel name="profile_stack"> - <scroll_container name="profile_scroll"> - <panel name="profile_scroll_panel"> - <panel name="second_life_image_panel"> - <text name="title_sl_descr_text" value="[SECOND_LIFE]:"/> - </panel> - <panel name="first_life_image_panel"> - <text name="title_rw_descr_text" value="Mondo reale:"/> - </panel> - <text name="title_member_text" value="Residente dal:"/> - <text name="title_acc_status_text" value="Stato account:"/> - <text name="title_partner_text" value="Partner:"/> - <panel name="partner_data_panel"> - <text initial_value="(recupero)" name="partner_text"/> - </panel> - <text name="title_groups_text" value="Gruppi:"/> - </panel> - </scroll_container> - </layout_panel> - </layout_stack> - <layout_stack name="layout_verb_buttons"> - <layout_panel name="profile_buttons_panel"> - <layout_stack name="bottom_bar_ls"> - <layout_panel name="add_friend_btn_lp"> - <button label="Aggiungi come amico" name="add_friend" tool_tip="Offri amicizia a questo residente"/> - </layout_panel> - <layout_panel name="im_btn_lp"> - <button label="IM" name="im" tool_tip="Apri una sessione messaggio istantaneo"/> - </layout_panel> - <layout_panel name="call_btn_lp"> - <button label="Chiama" name="call" tool_tip="Chiama questo residente"/> - </layout_panel> - <layout_panel name="chat_btn_lp"> - <button label="Teleport" name="teleport" tool_tip="Offri teleport"/> - </layout_panel> - <layout_panel name="overflow_btn_lp"> - <menu_button label="▼" name="overflow_btn" tool_tip="Paga del denaro o condividi qualcosa dall'inventario con il residente"/> - </layout_panel> - </layout_stack> - </layout_panel> - <layout_panel name="profile_me_buttons_panel"> - <button label="Modifica profilo" name="edit_profile_btn" tool_tip="Modifica le tue informazioni personali"/> - </layout_panel> - </layout_stack> -</panel> diff --git a/indra/newview/skins/default/xui/it/panel_profile_view.xml b/indra/newview/skins/default/xui/it/panel_profile_view.xml deleted file mode 100644 index 409eb5d1f4..0000000000 --- a/indra/newview/skins/default/xui/it/panel_profile_view.xml +++ /dev/null @@ -1,22 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes"?> -<panel name="panel_target_profile"> - <string name="status_online"> - Online - </string> - <string name="status_offline"> - Offline - </string> - <text name="display_name_label" value="Nome visualizzato:"/> - <text name="solo_username_label" value="Nome utente:"/> - <text name="status" value="Online"/> - <text name="user_name_small" value="Jack guarda quanto è lungo questo splendido nome"/> - <text name="user_name" value="Jack Linden"/> - <button name="copy_to_clipboard" tool_tip="Copia negli appunti"/> - <text name="user_label" value="Nome utente:"/> - <text name="user_slid" value="jack.linden"/> - <tab_container name="tabs"> - <panel label="PROFILO" name="panel_profile"/> - <panel label="LUOGHI CONSIGLIATI" name="panel_picks"/> - <panel label="NOTE E PRIVACY" name="panel_notes"/> - </tab_container> -</panel> diff --git a/indra/newview/skins/default/xui/it/strings.xml b/indra/newview/skins/default/xui/it/strings.xml index e58ce0cd70..8f29233825 100644 --- a/indra/newview/skins/default/xui/it/strings.xml +++ b/indra/newview/skins/default/xui/it/strings.xml @@ -592,6 +592,9 @@ Prova ad accedere nuovamente tra un minuto. <string name="mesh"> reticolo </string> + <string name="AvatarEditingAppearance"> + (Modifica Aspetto) + </string> <string name="AvatarAway"> Assente </string> diff --git a/indra/newview/skins/default/xui/it/teleport_strings.xml b/indra/newview/skins/default/xui/it/teleport_strings.xml index 7a1046abd3..a0b324d8fb 100644 --- a/indra/newview/skins/default/xui/it/teleport_strings.xml +++ b/indra/newview/skins/default/xui/it/teleport_strings.xml @@ -18,6 +18,10 @@ Se si continua a visualizzare questo messaggio, consulta la pagina [SUPPORT_SITE <message name="timeout_tport"> Spiacenti, il sistema non riesce a completare il teletrasporto. Riprova tra un attimo. </message> + <message name="NoHelpIslandTP"> + Non è possibile per te ritornare all'Welcome Island. +Vai alla 'Welcome Island Public' per ripetere il tutorial. + </message> <message name="noaccess_tport"> Spiacenti, ma non hai accesso nel luogo di destinazione richiesto. </message> diff --git a/indra/newview/skins/default/xui/ja/floater_about.xml b/indra/newview/skins/default/xui/ja/floater_about.xml index 47bb2455cf..c628ade43e 100644 --- a/indra/newview/skins/default/xui/ja/floater_about.xml +++ b/indra/newview/skins/default/xui/ja/floater_about.xml @@ -10,7 +10,7 @@ <floater.string name="AboutPosition"> あなたの現在地は、[POSITION_0,number,1], [POSITION_1,number,1], [POSITION_2,number,1] の [REGION] です。位置は <nolink>[HOSTNAME]</nolink> です。([HOSTIP]) [SERVER_VERSION] -[[SERVER_RELEASE_NOTES_URL] [リリースノート]] +[SERVER_RELEASE_NOTES_URL] </floater.string> <floater.string name="AboutSystem"> CPU: [CPU] @@ -37,6 +37,9 @@ Qt Webkit バージョン: [QT_WEBKIT_VERSION] <floater.string name="AboutTraffic"> パケットロス: [PACKETS_LOST,number,0]/[PACKETS_IN,number,0] ([PACKETS_PCT,number,1]%) </floater.string> + <floater.string name="ErrorFetchingServerReleaseNotesURL"> + サーバーのリリースノートの URL を取得中にエラーが発生しました。 + </floater.string> <tab_container name="about_tab"> <panel label="情報" name="support_panel"> <button label="クリップボードにコピー" name="copy_btn"/> diff --git a/indra/newview/skins/default/xui/ja/floater_about_land.xml b/indra/newview/skins/default/xui/ja/floater_about_land.xml index e870a8ace9..3c88c902f8 100644 --- a/indra/newview/skins/default/xui/ja/floater_about_land.xml +++ b/indra/newview/skins/default/xui/ja/floater_about_land.xml @@ -214,19 +214,19 @@ オブジェクトボーナス: [BONUS] </text> <text name="Simulator primitive usage:"> - プリム使用状況: + リージョン(地域)の許容数: </text> <text name="objects_available"> [MAX] の内 [COUNT] ([AVAILABLE] 利用可能) </text> <text name="Primitives parcel supports:"> - 区画でサポートされるプリム数: + 区画の許容数: </text> <text name="object_contrib_text"> [COUNT] </text> <text name="Primitives on parcel:"> - 区画上のプリム数: + 区画の負荷: </text> <text name="total_objects_text"> [COUNT] diff --git a/indra/newview/skins/default/xui/ja/floater_avatar.xml b/indra/newview/skins/default/xui/ja/floater_avatar.xml new file mode 100644 index 0000000000..c4455282d2 --- /dev/null +++ b/indra/newview/skins/default/xui/ja/floater_avatar.xml @@ -0,0 +1,2 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes"?> +<floater name="Avatar" title="アバターピッカー"/> diff --git a/indra/newview/skins/default/xui/ja/floater_buy_currency.xml b/indra/newview/skins/default/xui/ja/floater_buy_currency.xml index 22af6e0ea2..e447eefe0e 100644 --- a/indra/newview/skins/default/xui/ja/floater_buy_currency.xml +++ b/indra/newview/skins/default/xui/ja/floater_buy_currency.xml @@ -46,7 +46,7 @@ L$ [AMT] </text> <text name="currency_links"> - [http://www.secondlife.com/my/account/payment_method_management.php?lang=ja-JP 支払方法] | [http://www.secondlife.com/my/account/currency.php?lang=ja-JP 通貨] | [http://www.secondlife.com/my/account/exchange_rates.php?lang=ja-JP 換算レート] + [http://www.secondlife.com/my/account/payment_method_management.php?lang=ja-JP 支払方法] | [http://www.secondlife.com/my/account/currency.php?lang=ja-JP 通貨] </text> <text name="exchange_rate_note"> 金額を再入力して最新換算レートを確認します。 diff --git a/indra/newview/skins/default/xui/ja/floater_camera.xml b/indra/newview/skins/default/xui/ja/floater_camera.xml index 71a20c8e18..0661e17309 100644 --- a/indra/newview/skins/default/xui/ja/floater_camera.xml +++ b/indra/newview/skins/default/xui/ja/floater_camera.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> -<floater name="camera_floater"> +<floater name="camera_floater" title="表示"> <floater.string name="rotate_tooltip"> フォーカスを中心にカメラを回転 </floater.string> @@ -9,15 +9,6 @@ <floater.string name="move_tooltip"> カメラを上下左右に移動 </floater.string> - <floater.string name="camera_modes_title"> - カメラモード - </floater.string> - <floater.string name="pan_mode_title"> - 旋回 - ズーム - 水平・垂直移動 - </floater.string> - <floater.string name="presets_mode_title"> - 事前設定の視野 - </floater.string> <floater.string name="free_mode_title"> オブジェクトを見る </floater.string> diff --git a/indra/newview/skins/default/xui/ja/floater_chat_bar.xml b/indra/newview/skins/default/xui/ja/floater_chat_bar.xml new file mode 100644 index 0000000000..9735afb101 --- /dev/null +++ b/indra/newview/skins/default/xui/ja/floater_chat_bar.xml @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes"?> +<floater name="chat_bar" title="近くのチャット"> + <panel> + <line_editor label="ここをクリックしてチャットを開始します。" name="chat_box" tool_tip="Enter キーを押して話し、Ctrl + Enter キーで叫びます。"/> + <button name="show_nearby_chat" tool_tip="近くのチャットログを表示・非表示"/> + </panel> +</floater> diff --git a/indra/newview/skins/default/xui/ja/floater_destinations.xml b/indra/newview/skins/default/xui/ja/floater_destinations.xml new file mode 100644 index 0000000000..b7f6ad4d4e --- /dev/null +++ b/indra/newview/skins/default/xui/ja/floater_destinations.xml @@ -0,0 +1,2 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes"?> +<floater name="Destinations" title="行き先"/> diff --git a/indra/newview/skins/default/xui/ja/floater_fast_timers.xml b/indra/newview/skins/default/xui/ja/floater_fast_timers.xml new file mode 100644 index 0000000000..5f538ecdb0 --- /dev/null +++ b/indra/newview/skins/default/xui/ja/floater_fast_timers.xml @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes"?> +<floater name="fast_timers"> + <string name="pause"> + 一時停止 + </string> + <string name="run"> + 走る + </string> + <button label="一時停止" name="pause_btn"/> +</floater> diff --git a/indra/newview/skins/default/xui/ja/floater_how_to.xml b/indra/newview/skins/default/xui/ja/floater_how_to.xml new file mode 100644 index 0000000000..4cebe27226 --- /dev/null +++ b/indra/newview/skins/default/xui/ja/floater_how_to.xml @@ -0,0 +1,2 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes"?> +<floater name="floater_how_to" title="ハウツー"/> diff --git a/indra/newview/skins/default/xui/ja/floater_map.xml b/indra/newview/skins/default/xui/ja/floater_map.xml index ff5a25fd7b..1122203446 100644 --- a/indra/newview/skins/default/xui/ja/floater_map.xml +++ b/indra/newview/skins/default/xui/ja/floater_map.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> -<floater name="Map" title=""> +<floater name="Map" title="ミニマップ"> <floater.string name="ToolTipMsg"> [REGION](ダブルクリックで地図を開く。Shift‐ドラッグで水平・垂直移動) </floater.string> diff --git a/indra/newview/skins/default/xui/ja/floater_model_preview.xml b/indra/newview/skins/default/xui/ja/floater_model_preview.xml index 07667bb697..157c68a570 100644 --- a/indra/newview/skins/default/xui/ja/floater_model_preview.xml +++ b/indra/newview/skins/default/xui/ja/floater_model_preview.xml @@ -1,10 +1,8 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> -<floater name="Model Preview" title="モデルをアップロード"> - <string name="status_idle"> - 待機状態 - </string> +<floater name="Model Preview" title="モデルウィザード"> + <string name="status_idle"/> <string name="status_parse_error"> - Dae に問題が見つかりました - 詳細についてはログをご参照ください。 + エラー:Dae に問題が見つかりました - 詳細についてはログをご参照ください。 </string> <string name="status_reading_file"> ローディング... @@ -51,6 +49,9 @@ <string name="mesh_status_missing_lod"> 必要な描画詳細度が見つかりません。 </string> + <string name="mesh_status_invalid_material_list"> + LOD 付きの材料は参考モデルのサブセットではありません。 + </string> <string name="layer_all"> 全て </string> @@ -63,188 +64,211 @@ <string name="tbd"> 未定 </string> - <text name="name_label"> - 名前: - </text> - <text name="lod_label"> - プレビュー: - </text> - <combo_box name="preview_lod_combo" tool_tip="プレビュー表示のLOD設定"> - <combo_item name="high"> - 描画詳細度:高 - </combo_item> - <combo_item name="medium"> - 描画詳細度:中 - </combo_item> - <combo_item name="low"> - 描画詳細度:低 - </combo_item> - <combo_item name="lowest"> - 描画詳細度:最低 - </combo_item> - </combo_box> - <text name="warning_title"> - 警告: - </text> - <text name="warning_message"> - このモデルを Second Life サーバーにアップロードすることはできません。メッシュモデルのアップロード手順については [[VURL] こちらを参照してください]。 - </text> - <text name="weights_text"> - ダウンロード: -物理演算: -サーバー負荷: - -プリム換算: - </text> - <text name="weights"> - [ST] -[PH] -[SIM] - -[EQ] - </text> - <tab_container name="import_tab"> - <panel label="描画詳細度" name="lod_panel"> - <text name="lod_table_header"> - 描画詳細度を選択: - </text> - <text name="high_label" value="高"/> - <text name="high_triangles" value="0"/> - <text name="high_vertices" value="0"/> - <text name="medium_label" value="中"/> - <text name="medium_triangles" value="0"/> - <text name="medium_vertices" value="0"/> - <text name="low_label" value="低"/> - <text name="low_triangles" value="0"/> - <text name="low_vertices" value="0"/> - <text name="lowest_label" value="最低"/> - <text name="lowest_triangles" value="0"/> - <text name="lowest_vertices" value="0"/> - <text name="lod_table_footer"> - 描画詳細度: [DETAIL] - </text> - <radio_group name="lod_file_or_limit" value="lod_from_file"> - <radio_item label="ファイルからロード" name="lod_from_file"/> - <radio_item label="自動作成" name="lod_auto_generate"/> - <radio_item label="なし" name="lod_none"/> - </radio_group> - <button label="参照" name="lod_browse"/> - <combo_box name="lod_mode"> - <combo_item name="triangle_limit"> - 三角形の限度数 - </combo_item> - <combo_item name="error_threshold"> - エラーしきい値 - </combo_item> - </combo_box> - <text name="build_operator_text"> - 制作演算子: + <panel name="left_panel"> + <panel name="model_name_representation_panel"> + <text name="name_label"> + モデル名: </text> - <text name="queue_mode_text"> - キューモード: + <text name="model_category_label"> + このモデルは... </text> - <combo_box name="build_operator"> - <combo_item name="edge_collapse"> - 稜の完全複合 - </combo_item> - <combo_item name="half_edge_collapse"> - 稜の半複合 - </combo_item> - </combo_box> - <combo_box name="queue_mode"> - <combo_item name="greedy"> - グリーディ - </combo_item> - <combo_item name="lazy"> - レイジー - </combo_item> - <combo_item name="independent"> - インディペンデント - </combo_item> + <combo_box name="model_category_combo"> + <combo_item label="1つを選択..." name="Choose one"/> + <combo_item label="アバターの形" name="Avatar shape"/> + <combo_item label="アバターのアタッチメント" name="Avatar attachment"/> + <combo_item label="動くオブジェクト(車、動物)" name="Moving object (vehicle, animal)"/> + <combo_item label="制作用コンポーネント" name="Building Component"/> + <combo_item label="大型、不動、等" name="Large, non moving etc"/> + <combo_item label="やや小型、不動、等" name="Smaller, non-moving etc"/> + <combo_item label="いずれにも該当しない" name="Not really any of these"/> </combo_box> - <text name="border_mode_text"> - 境界線モード: - </text> - <text name="share_tolderance_text"> - 共有誤差: - </text> - <combo_box name="border_mode"> - <combo_item name="border_unlock"> - ロック解除 - </combo_item> - <combo_item name="border_lock"> - ロック - </combo_item> - </combo_box> - <text name="crease_label"> - 折れ角度: - </text> - <spinner name="crease_angle" value="75"/> </panel> - <panel label="物理効果" name="physics_panel"> - <panel name="physics geometry"> - <radio_group name="physics_load_radio" value="physics_load_from_file"> - <radio_item label="ファイル:" name="physics_load_from_file"/> - <radio_item label="次の描画詳細度を使用:" name="physics_use_lod"/> - </radio_group> - <combo_box name="physics_lod_combo" tool_tip="実像に適用するLOD"> - <combo_item name="physics_lowest"> - 最低 - </combo_item> - <combo_item name="physics_low"> - 低 - </combo_item> - <combo_item name="physics_medium"> - 中 - </combo_item> - <combo_item name="physics_high"> - 高 - </combo_item> - </combo_box> - <button label="参照" name="physics_browse"/> + <tab_container name="import_tab"> + <panel label="描画詳細度" name="lod_panel" title="描画詳細度"> + <text initial_value="データ源" name="source" value="データ源"/> + <text initial_value="三角形" name="triangles" value="三角形"/> + <text initial_value="頂点" name="vertices" value="頂点"/> + <text initial_value="高" name="high_label" value="高"/> + <button label="参照" name="lod_browse_high"/> + <text initial_value="0" name="high_triangles" value="0"/> + <text initial_value="0" name="high_vertices" value="0"/> + <text initial_value="中" name="medium_label" value="中"/> + <button label="参照" name="lod_browse_medium"/> + <text initial_value="0" name="medium_triangles" value="0"/> + <text initial_value="0" name="medium_vertices" value="0"/> + <text initial_value="低" name="low_label" value="低"/> + <button label="参照" name="lod_browse_low"/> + <text initial_value="0" name="low_triangles" value="0"/> + <text initial_value="0" name="low_vertices" value="0"/> + <text initial_value="最低" name="lowest_label" value="最低"/> + <button label="参照" name="lod_browse_lowest"/> + <text initial_value="0" name="lowest_triangles" value="0"/> + <text initial_value="0" name="lowest_vertices" value="0"/> + <check_box label="ノーマルの作成" name="gen_normals"/> + <text initial_value="折れ角度:" name="crease_label" value="折れ角度:"/> + <spinner name="crease_angle" value="75"/> </panel> - <panel name="physics analysis"> - <slider label="滑らかさ:" name="Smooth"/> - <check_box label="穴を閉じる(スロー)" name="Close Holes (Slow)"/> - <button label="分析" name="Decompose"/> - <button label="取り消し" name="decompose_cancel"/> + <panel label="物理効果" name="physics_panel"> + <panel name="physics geometry"> + <text name="first_step_name"> + 手順1:描画詳細度 + </text> + <combo_box name="physics_lod_combo" tool_tip="実像に適用するLOD"> + <combo_item name="choose_one"> + 1つを選択... + </combo_item> + <combo_item name="physics_high"> + 高 + </combo_item> + <combo_item name="physics_medium"> + 中 + </combo_item> + <combo_item name="physics_low"> + 低 + </combo_item> + <combo_item name="physics_lowest"> + 最低 + </combo_item> + <combo_item name="load_from_file"> + ファイルから + </combo_item> + </combo_box> + <button label="参照" name="physics_browse"/> + </panel> + <panel name="physics analysis"> + <text name="method_label"> + 手順2:分析 + </text> + <text name="analysis_method_label"> + 方法: + </text> + <text name="quality_label"> + 品質: + </text> + <text name="smooth_method_label"> + 滑らかさ: + </text> + <check_box label="穴を閉じる" name="Close Holes (Slow)"/> + <button label="分析" name="Decompose"/> + <button label="取り消し" name="decompose_cancel"/> + </panel> + <panel name="physics simplification"> + <text name="second_step_label"> + 手順3:単純化 + </text> + <text name="simp_method_header"> + 方法: + </text> + <text name="pass_method_header"> + パス: + </text> + <text name="Detail Scale label"> + 詳細度: + </text> + <text name="Retain%_label"> + 維持率: + </text> + <combo_box name="Combine Quality" value="1"/> + <button label="単純化" name="Simplify"/> + <button label="取り消し" name="simplify_cancel"/> + </panel> + <panel name="physics info"> + <text name="results_text"> + 結果: + </text> + <text name="physics_triangles"> + 三角形:[TRIANGLES], + </text> + <text name="physics_points"> + 頂点:[POINTS], + </text> + <text name="physics_hulls"> + 外殻構造:[HULLS] + </text> + </panel> </panel> - <panel name="physics simplification"> - <slider label="パス:" name="Combine Quality"/> - <slider label="詳細度:" name="Detail Scale"/> - <slider label="維持率:" name="Retain%"/> - <button label="単純化" name="Simplify"/> - <button label="取り消し" name="simplify_cancel"/> - </panel> - <panel name="physics info"> - <slider label="プレビュースプレッド:" name="physics_explode"/> - <text name="physics_triangles"> - 三角形: [TRIANGLES] + <panel label="アップロードのオプション" name="modifiers_panel"> + <text name="scale_label"> + スケール(1=増減なし): + </text> + <spinner name="import_scale" value="1.0"/> + <text name="dimensions_label"> + サイズ: </text> - <text name="physics_points"> - 頂点: [POINTS] + <text name="import_dimensions"> + [X] X [Y] X [Z] </text> - <text name="physics_hulls"> - 外殻構造: [HULLS] + <check_box label="テクスチャを含む" name="upload_textures"/> + <text name="include_label"> + アバターモデル専用: </text> + <check_box label="スキンの重さを含む" name="upload_skin"/> + <check_box label="ジョイントポジションを含む" name="upload_joints"/> + <text name="pelvis_offset_label"> + Z オフセット(アバターを上下調整): + </text> + <spinner name="pelvis_offset" value="0.0"/> </panel> - </panel> - <panel label="修飾子" name="modifiers_panel"> - <spinner name="import_scale" value="1.0"/> - <text name="import_dimensions"> - [X] x [Y] x [Z] m + </tab_container> + <panel name="weights_and_warning_panel"> + <button label="ウェイトと料金の計算" name="calculate_btn" tool_tip="ウェイトと料金の計算"/> + <button label="取り消し" name="cancel_btn"/> + <button label="アップロード" name="ok_btn" tool_tip="シミュレーターにアップロード"/> + <button label="設定をクリアしてフォームをリセット" name="reset_btn"/> + <text name="upload_fee"> + アップロード料金:L$ [FEE] + </text> + <text name="prim_weight"> + 土地の負荷:[EQ] + </text> + <text name="download_weight"> + ダウンロード:[ST] + </text> + <text name="physics_weight"> + 物理演算:[PH] + </text> + <text name="server_weight"> + サーバー負荷:[SIM] + </text> + <text name="warning_title"> + ご注意: + </text> + <text name="warning_message"> + メッシュモデルをアップロードする権利がありません。権利の取得方法については [[VURL]] こちらを参照してください。 + </text> + <text name="status"> + [STATUS] </text> - <check_box label="テクスチャ" name="upload_textures"/> - <check_box label="スキンの重さ" name="upload_skin"/> - <check_box label="ジョイントポジション" name="upload_joints"/> - <spinner name="pelvis_offset" value="0.0"/> </panel> - </tab_container> - <text name="upload_fee"> - アップロード料金:L$ [FEE] + </panel> + <text name="lod_label"> + プレビュー: </text> - <button label="デフォルトに設定" name="reset_btn" tool_tip="デフォルトに設定"/> - <button label="ウェイトと料金の計算" name="calculate_btn" tool_tip="ウェイトと料金の計算"/> - <button label="アップロード" name="ok_btn" tool_tip="シミュレーターにアップロード"/> - <button label="取り消し" name="cancel_btn"/> + <panel name="right_panel"> + <combo_box name="preview_lod_combo" tool_tip="プレビュー表示の LOD 設定"> + <combo_item name="high"> + 高 + </combo_item> + <combo_item name="medium"> + 中 + </combo_item> + <combo_item name="low"> + 低 + </combo_item> + <combo_item name="lowest"> + 最低 + </combo_item> + </combo_box> + <text name="label_display"> + ディスプレイ... + </text> + <check_box label="稜" name="show_edges"/> + <check_box label="物理効果" name="show_physics"/> + <check_box label="テクスチャ" name="show_textures"/> + <check_box label="スキンの重さ" name="show_skin_weight"/> + <check_box label="ジョイント" name="show_joint_positions"/> + <text name="physics_explode_label"> + プレビュースプレッド: + </text> + </panel> </floater> diff --git a/indra/newview/skins/default/xui/ja/floater_model_wizard.xml b/indra/newview/skins/default/xui/ja/floater_model_wizard.xml index 2f336fcbde..915b37557f 100644 --- a/indra/newview/skins/default/xui/ja/floater_model_wizard.xml +++ b/indra/newview/skins/default/xui/ja/floater_model_wizard.xml @@ -6,26 +6,20 @@ <button label="2. 最適化" name="optimize_btn"/> <button label="1. ファイルを選択" name="choose_file_btn"/> <panel name="choose_file_panel"> - <panel name="choose_file_header_panel"> - <text name="choose_file_header_text"> + <panel name="header_panel"> + <text name="header_text"> モデルファイルを選択 </text> </panel> - <panel name="choose_file_content_panel"> + <panel name="content"> <text name="advanced_users_text"> 上級ユーザーの場合:3D コンテンツの制作ツールを使い慣れた方は、高度なアップローダーもお試しください。 </text> <button label="アドバンスモードに切り替える" name="switch_to_advanced"/> - <text name="choose_model_file_label"> + <text name="Cache location"> アップロードするモデルファイルの選択 </text> <button label="参照" label_selected="参照" name="browse"/> - <text name="support_collada_text"> - Second Life は COLLADA (.dae) ファイルをサポートします。 - </text> - <text name="dimensions_label"> - サイズ(メートル): - </text> <text name="dimensions"> X Y Z </text> @@ -38,18 +32,15 @@ </panel> </panel> <panel name="optimize_panel"> - <panel name="optimize_header_panel"> - <text name="optimize_header_text"> + <panel name="header_panel"> + <text name="header_text"> モデルを最適化 </text> </panel> - <text name="optimize_hint"> + <text name="description"> パフォーマンスを重視してモデルを最適化しました。必要に応じて調整してください。 </text> - <panel name="optimize_content_panel"> - <text name="generating_lod_label"> - 次の描画詳細度を作成 - </text> + <panel name="content"> <text name="high_detail_text"> 次の描画詳細度を作成:高 </text> @@ -64,123 +55,64 @@ </text> </panel> <panel name="content2"> - <text name="optimize_performance_text"> - パフォーマンス - </text> - <text name="optimize_faster_rendering_text"> - レンダリング速度の向上 -詳細度の低下 -プリム換算ウェイトの軽減 - </text> - <text name="optimize_accuracy_text"> - 正確さ - </text> - <text name="optimize_slower_rendering_text"> - レンダリング速度の低下 -詳細化 -プリム換算ウェイトの増加 - </text> - <text name="accuracy_slider_mark1"> - ' - </text> - <text name="accuracy_slider_mark2"> - ' - </text> - <text name="accuracy_slider_mark3"> - ' - </text> <button label="ジオメトリを再計算" name="recalculate_geometry_btn"/> - <text name="geometry_preview_label"> + <text name="lod_label"> ジオメトリのプレビュー </text> <combo_box name="preview_lod_combo" tool_tip="プレビュー表示の LOD 設定"> - <combo_item name="preview_lod_high"> + <combo_item name="high"> 高い詳細度 </combo_item> - <combo_item name="preview_lod_medium"> + <combo_item name="medium"> 中の詳細度 </combo_item> - <combo_item name="preview_lod_low"> + <combo_item name="low"> 低い詳細度 </combo_item> - <combo_item name="preview_lod_lowest"> + <combo_item name="lowest"> 最低の詳細度 </combo_item> </combo_box> </panel> </panel> <panel name="physics_panel"> - <panel name="physics_header_panel"> - <text name="physics_header_text"> + <panel name="header_panel"> + <text name="header_text"> 物理作用の調整 </text> </panel> - <text name="physics_hint"> + <text name="description"> モデルの外殻構造のシェイプは弊社が作成します。モデルの目的に応じてシェイプの詳細度を調整してください。 </text> - <panel name="physics_content_panel"> - <text name="physics_performance_text"> - パフォーマンス - </text> - <text name="physics_faster_rendering_text"> - レンダリング速度の向上 -詳細度の低下 -プリム換算ウェイトの軽減 - </text> - <text name="physics_accuracy_text"> - 正確 - </text> - <text name="physics_slower_dendering_text"> - レンダリング速度の低下 -詳細化 -プリム換算ウェイトの増加 - </text> - <text name="physics_example_1"> - 例: -動くオブジェクト -飛行オブジェクト -車 - </text> - <text name="physics_example_2"> - 例: -小さな静止オブジェクト -比較的詳細度の低いオブジェクト -シンプルな家具 - </text> - <text name="physics_example_3"> - 例: -静止オブジェクト -詳細なオブジェクト -建物 - </text> + <panel name="content"> <button label="物理演算ウェイトを再計算" name="recalculate_physics_btn"/> <button label="再計算中..." name="recalculating_physics_btn"/> - <text name="physics_preview_label"> + <text name="lod_label"> 物理作用のプレビュー </text> <combo_box name="preview_lod_combo2" tool_tip="プレビュー表示の LOD 設定"> - <combo_item name="preview_lod2_high"> + <combo_item name="high"> 高い詳細度 </combo_item> - <combo_item name="preview_lod2_medium"> + <combo_item name="medium"> 中の詳細度 </combo_item> - <combo_item name="preview_lod2_low"> + <combo_item name="low"> 低い詳細度 </combo_item> - <combo_item name="preview_lod2_lowest"> + <combo_item name="lowest"> 最低の詳細度 </combo_item> </combo_box> </panel> </panel> <panel name="review_panel"> - <panel name="review_header_panel"> - <text name="review_header_text"> + <panel name="header_panel"> + <text name="header_text"> 確認 </text> </panel> - <panel name="review_content_panel"> + <panel name="content"> <text name="review_prim_equiv"> 区画/リージョンへの負荷:[EQUIV] プリム換算値 </text> @@ -193,8 +125,8 @@ </panel> </panel> <panel name="upload_panel"> - <panel name="upload_header_panel"> - <text name="upload_header_text"> + <panel name="header_panel"> + <text name="header_text"> アップロード完了 </text> </panel> diff --git a/indra/newview/skins/default/xui/ja/floater_moveview.xml b/indra/newview/skins/default/xui/ja/floater_moveview.xml index 57ab32f486..88c1905b8a 100644 --- a/indra/newview/skins/default/xui/ja/floater_moveview.xml +++ b/indra/newview/skins/default/xui/ja/floater_moveview.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> -<floater name="move_floater"> +<floater name="move_floater" title="移動"> <string name="walk_forward_tooltip"> 前に進む(上矢印か W を押す) </string> @@ -58,14 +58,14 @@ 飛ぶ </string> <panel name="panel_actions"> - <button label="" label_selected="" name="move up btn" tool_tip="上に移動(E を押す)"/> <button label="" label_selected="" name="turn left btn" tool_tip="左を向く(左矢印か A を押す)"/> <joystick_slide name="move left btn" tool_tip="左に歩く(Shift + 左矢印か A を押す)"/> - <button label="" label_selected="" name="move down btn" tool_tip="下に移動(C を押す)"/> <button label="" label_selected="" name="turn right btn" tool_tip="右を向く(右矢印か D を押す)"/> <joystick_slide name="move right btn" tool_tip="右に歩く(Shift + 右矢印か D を押す)"/> <joystick_turn name="forward btn" tool_tip="前に進む(上矢印か W を押す)"/> <joystick_turn name="backward btn" tool_tip="後ろに歩く(下矢印か S を押す)"/> + <button label="" label_selected="" name="move up btn" tool_tip="上に移動(E を押す)"/> + <button label="" label_selected="" name="move down btn" tool_tip="下に移動(C を押す)"/> </panel> <panel name="panel_modes"> <button label="" name="mode_walk_btn" tool_tip="歩行モード"/> diff --git a/indra/newview/skins/default/xui/ja/floater_my_appearance.xml b/indra/newview/skins/default/xui/ja/floater_my_appearance.xml new file mode 100644 index 0000000000..c9a0ecefd7 --- /dev/null +++ b/indra/newview/skins/default/xui/ja/floater_my_appearance.xml @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes"?> +<floater name="floater_my_appearance" title="容姿"> + <panel label="容姿の編集" name="main_panel"/> +</floater> diff --git a/indra/newview/skins/default/xui/ja/floater_my_inventory.xml b/indra/newview/skins/default/xui/ja/floater_my_inventory.xml new file mode 100644 index 0000000000..c6a789b63b --- /dev/null +++ b/indra/newview/skins/default/xui/ja/floater_my_inventory.xml @@ -0,0 +1,2 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes"?> +<floater name="floater_my_inventory" title="持ち物"/> diff --git a/indra/newview/skins/default/xui/ja/floater_nearby_chat.xml b/indra/newview/skins/default/xui/ja/floater_nearby_chat.xml index a29c6a0630..bcddcc6907 100644 --- a/indra/newview/skins/default/xui/ja/floater_nearby_chat.xml +++ b/indra/newview/skins/default/xui/ja/floater_nearby_chat.xml @@ -1,4 +1,4 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <floater name="nearby_chat" title="近くのチャット"> - <check_box label="チャットを翻訳(Google翻訳)" name="translate_chat_checkbox"/> + <check_box label="チャットを翻訳" name="translate_chat_checkbox"/> </floater> diff --git a/indra/newview/skins/default/xui/ja/floater_object_weights.xml b/indra/newview/skins/default/xui/ja/floater_object_weights.xml new file mode 100644 index 0000000000..3bd9b6b069 --- /dev/null +++ b/indra/newview/skins/default/xui/ja/floater_object_weights.xml @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes"?> +<floater name="object_weights" title="詳しい設定"> + <floater.string name="nothing_selected" value="--"/> + <text name="selected_text" value="選択済"/> + <text name="objects" value="--"/> + <text name="objects_label" value="オブジェクト"/> + <text name="prims" value="--"/> + <text name="prims_label" value="プリム"/> + <text name="weights_of_selected_text" value="選択済み項目のウエイト"/> + <text name="download" value="--"/> + <text name="download_label" value="ダウンロード"/> + <text name="physics" value="--"/> + <text name="physics_label" value="物理効果"/> + <text name="server" value="--"/> + <text name="server_label" value="サーバー"/> + <text name="display" value="--"/> + <text name="display_label" value="ディスプレイ"/> + <text name="land_impacts_text" value="土地の負荷"/> + <text name="selected" value="--"/> + <text name="selected_label" value="選択済"/> + <text name="rezzed_on_land" value="--"/> + <text name="rezzed_on_land_label" value="土地に Rez 済み"/> + <text name="remaining_capacity" value="--"/> + <text name="remaining_capacity_label" value="残りの許容数"/> + <text name="total_capacity" value="--"/> + <text name="total_capacity_label" value="許容合計"/> + <text name="help_SLURL" value="[secondlife:///app/help/object_weights オブジェクトのウェイトとは?]"/> +</floater> diff --git a/indra/newview/skins/default/xui/ja/floater_people.xml b/indra/newview/skins/default/xui/ja/floater_people.xml new file mode 100644 index 0000000000..08bee88103 --- /dev/null +++ b/indra/newview/skins/default/xui/ja/floater_people.xml @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes"?> +<floater name="floater_people" title="人"> + <panel_container name="main_panel"> + <panel label="グループ情報" name="panel_group_info_sidetray"/> + <panel label="ブロックされた住人とオブジェクト" name="panel_block_list_sidetray"/> + </panel_container> +</floater> diff --git a/indra/newview/skins/default/xui/ja/floater_picks.xml b/indra/newview/skins/default/xui/ja/floater_picks.xml new file mode 100644 index 0000000000..359585eb86 --- /dev/null +++ b/indra/newview/skins/default/xui/ja/floater_picks.xml @@ -0,0 +1,2 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes"?> +<floater name="floater_picks" title="ピック"/> diff --git a/indra/newview/skins/default/xui/ja/floater_places.xml b/indra/newview/skins/default/xui/ja/floater_places.xml new file mode 100644 index 0000000000..0d167444db --- /dev/null +++ b/indra/newview/skins/default/xui/ja/floater_places.xml @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes"?> +<floater name="floater_places" title="場所"> + <panel label="場所" name="main_panel"/> +</floater> diff --git a/indra/newview/skins/default/xui/ja/floater_stats.xml b/indra/newview/skins/default/xui/ja/floater_stats.xml index 97927776c7..6a1f34cfd8 100644 --- a/indra/newview/skins/default/xui/ja/floater_stats.xml +++ b/indra/newview/skins/default/xui/ja/floater_stats.xml @@ -10,8 +10,8 @@ </stat_view> <stat_view label="アドバンス" name="advanced"> <stat_view label="描画" name="render"> - <stat_bar label="KTris 描画" name="ktrisframe"/> - <stat_bar label="KTris 描画" name="ktrissec"/> + <stat_bar label="フレームごとの KTris 描画" name="ktrisframe"/> + <stat_bar label="秒ごとの KTris 描画" name="ktrissec"/> <stat_bar label="オブジェクト合計" name="objs"/> <stat_bar label="新規オブジェクト" name="newobjs"/> </stat_view> @@ -64,6 +64,14 @@ <stat_bar label="エージェント時間" name="simagentmsec"/> <stat_bar label="イメージ時間" name="simimagesmsec"/> <stat_bar label="スクリプト時間" name="simscriptmsec"/> + <stat_bar label="余暇" name="simsparemsec"/> + <stat_view label="時間の詳細(ms)" name="timedetails"> + <stat_bar label="物理効果の単位" name="simsimphysicsstepmsec"/> + <stat_bar label="物理形状を更新" name="simsimphysicsshapeupdatemsec"/> + <stat_bar label="他の物理効果" name="simsimphysicsothermsec"/> + <stat_bar label="スリープ時間" name="simsleepmsec"/> + <stat_bar label="ポンプ I/O" name="simpumpiomsec"/> + </stat_view> </stat_view> </stat_view> </container_view> diff --git a/indra/newview/skins/default/xui/ja/floater_tools.xml b/indra/newview/skins/default/xui/ja/floater_tools.xml index a8b5febd54..8eddf55a44 100644 --- a/indra/newview/skins/default/xui/ja/floater_tools.xml +++ b/indra/newview/skins/default/xui/ja/floater_tools.xml @@ -25,10 +25,10 @@ 土地をクリックし、ドラッグして選択 </floater.string> <floater.string name="status_selectcount"> - [OBJ_COUNT] 個のオブジェクト([PRIM_COUNT] 個のプリム [PE_STRING])が選択されています + 選択されているオブジェクトは [OBJ_COUNT] 個、土地の負荷は [LAND_IMPACT] </floater.string> - <floater.string name="status_selectprimequiv"> - , [SEL_WEIGHT] プリム換算値 + <floater.string name="status_remaining_capacity"> + 残りの許容数 [LAND_CAPACITY]。 </floater.string> <button label="" label_selected="" name="button focus" tool_tip="フォーカス"/> <button label="" label_selected="" name="button move" tool_tip="動かす"/> @@ -105,8 +105,8 @@ <text name="selection_empty"> 何も選択されていません。 </text> - <text name="selection_weight"> - 物理演算ウェイト [PHYS_WEIGHT]、レンダリングコスト [DISP_WEIGHT]。 + <text name="remaining_capacity"> + [CAPACITY_STRING] [secondlife:///app/openfloater/object_weights 詳細] </text> <tab_container name="Object Info Tabs"> <panel label="一般" name="General"> @@ -325,7 +325,6 @@ 縫い目のタイプ </text> <combo_box name="sculpt type control"> - <combo_box.item label="(なし)" name="None"/> <combo_box.item label="球体" name="Sphere"/> <combo_box.item label="トーラス" name="Torus"/> <combo_box.item label="平面" name="Plane"/> diff --git a/indra/newview/skins/default/xui/ja/floater_toybox.xml b/indra/newview/skins/default/xui/ja/floater_toybox.xml new file mode 100644 index 0000000000..d7056f806c --- /dev/null +++ b/indra/newview/skins/default/xui/ja/floater_toybox.xml @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes"?> +<floater name="Toybox" title="ツールバーをカスタマイズ"> + <text name="toybox label 1"> + ボタンをツールバーに追加または削除するにはボタンをドラッグします。 + </text> + <text name="toybox label 2"> + 各ツールバーの設定に応じて、ボタンは以下のように表示されたり、アイコンのみで表示されます。 + </text> + <button label="デフォルト設定を復元" label_selected="デフォルト設定を復元" name="btn_restore_defaults"/> +</floater> diff --git a/indra/newview/skins/default/xui/ja/menu_hide_navbar.xml b/indra/newview/skins/default/xui/ja/menu_hide_navbar.xml index 3a1ae49700..2e633ae1b2 100644 --- a/indra/newview/skins/default/xui/ja/menu_hide_navbar.xml +++ b/indra/newview/skins/default/xui/ja/menu_hide_navbar.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <menu name="hide_navbar_menu"> - <menu_item_check label="ナビゲーションバーを表示" name="ShowNavbarNavigationPanel"/> + <menu_item_check label="ナビゲーションバーとお気に入りバーを表示" name="ShowNavbarNavigationPanel"/> <menu_item_check label="お気に入りバーを表示" name="ShowNavbarFavoritesPanel"/> <menu_item_check label="「場所」のミニフィールドを表示" name="ShowMiniLocationPanel"/> </menu> diff --git a/indra/newview/skins/default/xui/ja/menu_login.xml b/indra/newview/skins/default/xui/ja/menu_login.xml index dca872e9b8..4c88f17f3d 100644 --- a/indra/newview/skins/default/xui/ja/menu_login.xml +++ b/indra/newview/skins/default/xui/ja/menu_login.xml @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <menu_bar name="Login Menu"> <menu label="ミー" name="File"> - <menu_item_call label="環境設定" name="Preferences..."/> + <menu_item_call label="環境設定..." name="Preferences..."/> <menu_item_call label="[APP_NAME] を終了" name="Quit"/> </menu> <menu label="ヘルプ" name="Help"> diff --git a/indra/newview/skins/default/xui/ja/menu_toolbars.xml b/indra/newview/skins/default/xui/ja/menu_toolbars.xml new file mode 100644 index 0000000000..e911ca4a13 --- /dev/null +++ b/indra/newview/skins/default/xui/ja/menu_toolbars.xml @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes"?> +<context_menu name="Toolbars Popup"> + <menu_item_call label="ボタンを選択..." name="Chose Buttons"/> + <menu_item_check label="アイコンとラベル" name="icons_with_text"/> + <menu_item_check label="アイコンのみ" name="icons_only"/> +</context_menu> diff --git a/indra/newview/skins/default/xui/ja/menu_viewer.xml b/indra/newview/skins/default/xui/ja/menu_viewer.xml index edce5c50fc..b9dbb81c0a 100644 --- a/indra/newview/skins/default/xui/ja/menu_viewer.xml +++ b/indra/newview/skins/default/xui/ja/menu_viewer.xml @@ -1,29 +1,30 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <menu_bar name="Main Menu"> <menu label="ミー" name="Me"> - <menu_item_call label="環境設定" name="Preferences"/> - <menu_item_call label="マイアカウント" name="Manage My Account"> + <menu_item_call label="マイアカウント..." name="Manage My Account"> <menu_item_call.on_click name="ManageMyAccount_url" parameter="WebLaunchJoinNow,http://secondlife.com/account/index.php?lang=ja"/> </menu_item_call> - <menu_item_call label="L$ の購入" name="Buy and Sell L$"/> - <menu_item_call label="プロフィール" name="Profile"/> - <menu_item_call label="容姿" name="ChangeOutfit"/> - <menu_item_check label="持ち物" name="Inventory"/> - <menu_item_check label="持ち物" name="ShowSidetrayInventory"/> - <menu_item_check label="ジェスチャー" name="Gestures"/> - <menu_item_check label="マイボイス" name="ShowVoice"/> + <menu_item_call label="プロフィール..." name="Profile"/> + <menu_item_call label="容姿..." name="ChangeOutfit"/> + <menu_item_check label="持ち物..." name="Inventory"/> + <menu_item_check label="ジェスチャー..." name="Gestures"/> + <menu_item_check label="ボイス..." name="ShowVoice"/> <menu label="ムーブメント" name="Movement"> <menu_item_call label="座る" name="Sit Down Here"/> <menu_item_check label="飛ぶ" name="Fly"/> <menu_item_check label="常に走る" name="Always Run"/> <menu_item_call label="私のアニメーションを停止する" name="Stop Animating My Avatar"/> </menu> - <menu label="ログイン状態" name="Status"> + <menu label="ログイン" name="Status"> <menu_item_call label="一時退席中" name="Set Away"/> <menu_item_call label="取り込み中" name="Set Busy"/> </menu> <menu_item_call label="管理者権限のリクエスト" name="Request Admin Options"/> <menu_item_call label="管理者ステータス解除" name="Leave Admin Options"/> + <menu_item_call label="L$ の購入" name="Buy and Sell L$"/> + <menu_item_call label="環境設定..." name="Preferences"/> + <menu_item_call label="ツールバー..." name="Toolbars"/> + <menu_item_call label="全てのコントロールを非表示にする" name="Hide UI"/> <menu_item_call label="[APP_NAME] を終了" name="Quit"/> </menu> <menu label="コミュニケーション" name="Communicate"> @@ -145,7 +146,6 @@ </menu> <menu label="ヘルプ" name="Help"> <menu_item_call label="[SECOND_LIFE] ヘルプ" name="Second Life Help"/> - <menu_item_check label="ヒントを有効にする" name="Enable Hints"/> <menu_item_call label="嫌がらせを報告する" name="Report Abuse"/> <menu_item_call label="バグを報告する" name="Report Bug"/> <menu_item_call label="[APP_NAME] について" name="About Second Life"/> @@ -161,7 +161,7 @@ <menu label="パフォーマンスツール" name="Performance Tools"> <menu_item_call label="ラグ計測器" name="Lag Meter"/> <menu_item_check label="統計バー" name="Statistics Bar"/> - <menu_item_check label="アバターのレンダリングコストを表示する" name="Avatar Rendering Cost"/> + <menu_item_check label="アバターの描画ウェイトを表示" name="Avatar Rendering Cost"/> </menu> <menu label="ハイライトと目に見えるもの" name="Highlighting and Visibility"> <menu_item_check label="チージービーコン" name="Cheesy Beacon"/> @@ -289,6 +289,7 @@ <menu_item_check label="光" name="Lights"/> <menu_item_check label="骨組みの衝突判定" name="Collision Skeleton"/> <menu_item_check label="レイキャスト" name="Raycast"/> + <menu_item_check label="描画の詳細度" name="rendercomplexity"/> <menu_item_check label="スカルプト" name="Sculpt"/> </menu> <menu label="レンダリング" name="Rendering"> diff --git a/indra/newview/skins/default/xui/ja/notifications.xml b/indra/newview/skins/default/xui/ja/notifications.xml index c138aeb383..7dfa6d2f7a 100644 --- a/indra/newview/skins/default/xui/ja/notifications.xml +++ b/indra/newview/skins/default/xui/ja/notifications.xml @@ -1010,7 +1010,7 @@ L$ は返金されません。 </form> </notification> <notification name="RemoveFromFriends"> - フレンドリストから [NAME] を削除しますか? + フレンドリストから <nolink>[NAME]</nolink> を削除しますか? <usetemplate name="okcancelbuttons" notext="取り消し" yestext="OK"/> </notification> <notification name="RemoveMultipleFromFriends"> @@ -1953,6 +1953,12 @@ Adult 専用リージョンに入るには、住人のアカウントが年齢 終了しようとしています。続けますか? <usetemplate ignoretext="終了時の確認" name="okcancelignore" notext="終了しない" yestext="終了"/> </notification> + <notification name="ConfirmRestoreToybox"> + デフォルトのボタンとツールバーを復元しますか? + +この操作は元に戻せません。 + <usetemplate name="okcancelbuttons" notext="取り消し" yestext="OK"/> + </notification> <notification name="DeleteItems"> [QUESTION] <usetemplate ignoretext="アイテムを削除する前の確認" name="okcancelignore" notext="取り消し" yestext="OK"/> @@ -2161,10 +2167,10 @@ Web ページにリンクすると、他人がこの場所に簡単にアクセ 件名: [SUBJECT]、メッセージ: [MESSAGE] </notification> <notification name="FriendOnline"> - [NAME] はオンライン中です + <nolink>[NAME]</nolink> はオンライン中です </notification> <notification name="FriendOffline"> - [NAME] はオフライン中です + <nolink>[NAME]</nolink> はオフライン中です </notification> <notification name="AddSelfFriend"> 残念ながら自分自身をフレンド登録することはできません。 @@ -2561,10 +2567,10 @@ Web ページにリンクすると、他人がこの場所に簡単にアクセ </form> </notification> <notification name="FriendshipAccepted"> - [NAME]は、フレンド登録を受け入れました。 + <nolink>[NAME]</nolink>は、フレンド登録を受け入れました。 </notification> <notification name="FriendshipDeclined"> - [NAME]は、フレンド登録を断りました。 + <nolink>[NAME]</nolink>は、フレンド登録を断りました。 </notification> <notification name="FriendshipAcceptedByMe"> フレンドの登録依頼が承認されました。 @@ -3041,10 +3047,6 @@ M キーを押して変更します。 <button name="cancel" text="取り消し"/> </form> </notification> - <notification label="" name="ModeChange"> - モードを変更するには終了して再起動する必要があります。 - <usetemplate name="okcancelbuttons" notext="終了しない" yestext="終了"/> - </notification> <notification label="" name="NoClassifieds"> クラシファイド広告の作成と編集はアドバンスモードでのみ利用できます。終了してモードを変更しますか?モードはログイン画面で選択できます。 <usetemplate name="okcancelbuttons" notext="終了しない" yestext="終了"/> @@ -3089,6 +3091,10 @@ M キーを押して変更します。 検索はアドバンスモードでのみ利用できます。ログアウトしてモードを変更しますか? <usetemplate name="okcancelbuttons" notext="終了しない" yestext="終了"/> </notification> + <notification label="" name="ConfirmHideUI"> + この操作により、全てのメニュー項目とボタンが非表示になります。再び表示するには [SHORTCUT] をもう一度クリックしてください。 + <usetemplate ignoretext="UI を非表示にする前に確認" name="okcancelignore" notext="取り消し" yestext="OK"/> + </notification> <global name="UnsupportedGLRequirements"> [APP_NAME] に必要なハードウェアがないようです。 [APP_NAME] にはマルチテクスチャをサポートする OpenGL グラフィックカードが必要です。 お使いのグラフィックカードの最新ドライバがインストールされているかどうか、オペレーティングシステムのサービスパックとパッチが入っているかをご確認ください。 diff --git a/indra/newview/skins/default/xui/ja/panel_chiclet_bar.xml b/indra/newview/skins/default/xui/ja/panel_chiclet_bar.xml new file mode 100644 index 0000000000..6717ba9ba3 --- /dev/null +++ b/indra/newview/skins/default/xui/ja/panel_chiclet_bar.xml @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes"?> +<panel name="chiclet_bar"> + <layout_stack name="toolbar_stack"> + <layout_panel name="im_well_panel"> + <chiclet_im_well name="im_well"> + <button name="Unread IM messages" tool_tip="会話"/> + </chiclet_im_well> + </layout_panel> + <layout_panel name="notification_well_panel"> + <chiclet_notification name="notification_well"> + <button name="Unread" tool_tip="通知"/> + </chiclet_notification> + </layout_panel> + </layout_stack> +</panel> diff --git a/indra/newview/skins/default/xui/ja/panel_me.xml b/indra/newview/skins/default/xui/ja/panel_me.xml index dda5bc0009..896bbff0ee 100644 --- a/indra/newview/skins/default/xui/ja/panel_me.xml +++ b/indra/newview/skins/default/xui/ja/panel_me.xml @@ -1,7 +1,4 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <panel label="マイ プロフィール" name="panel_me"> - <tab_container name="tabs"> - <panel label="マイ プロフィール" name="panel_profile"/> - <panel label="マイ ピック" name="panel_picks"/> - </tab_container> + <panel label="マイ ピック" name="panel_picks"/> </panel> diff --git a/indra/newview/skins/default/xui/ja/panel_my_profile.xml b/indra/newview/skins/default/xui/ja/panel_my_profile.xml deleted file mode 100644 index a0d99ba5a8..0000000000 --- a/indra/newview/skins/default/xui/ja/panel_my_profile.xml +++ /dev/null @@ -1,42 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes"?> -<panel label="プロフィール" name="panel_profile"> - <string name="CaptionTextAcctInfo"> - [ACCTTYPE] -[PAYMENTINFO] [AGEVERIFICATION] - </string> - <string name="payment_update_link_url"> - http://www.secondlife.com/account/billing.php?lang=ja - </string> - <string name="partner_edit_link_url"> - http://www.secondlife.com/account/billing.php?lang=ja - </string> - <string name="my_account_link_url" value="http://secondlife.com/account"/> - <string name="no_partner_text" value="なし"/> - <string name="no_group_text" value="なし"/> - <string name="RegisterDateFormat"> - [REG_DATE] ([AGE]) - </string> - <string name="name_text_args"> - [NAME] - </string> - <string name="display_name_text_args"> - [DISPLAY_NAME] - </string> - <layout_stack name="layout"> - <layout_panel name="profile_stack"> - <scroll_container name="profile_scroll"> - <panel name="scroll_content_panel"> - <panel name="second_life_image_panel"> - <text name="display_name_descr_text"> - ユーザー名 - </text> - <text name="name_descr_text"> - 表示名 - </text> - <button label="プロフィール" name="see_profile_btn" tool_tip="このアバターのプロフィールを表示"/> - </panel> - </panel> - </scroll_container> - </layout_panel> - </layout_stack> -</panel> diff --git a/indra/newview/skins/default/xui/ja/panel_navigation_bar.xml b/indra/newview/skins/default/xui/ja/panel_navigation_bar.xml index 0426c4fe9a..51402b2e00 100644 --- a/indra/newview/skins/default/xui/ja/panel_navigation_bar.xml +++ b/indra/newview/skins/default/xui/ja/panel_navigation_bar.xml @@ -1,18 +1,23 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <panel name="navigation_bar"> - <panel name="navigation_panel"> - <pull_button name="back_btn" tool_tip="前の場所へ戻ります"/> - <pull_button name="forward_btn" tool_tip="次の場所へ進みます"/> - <button name="home_btn" tool_tip="「ホーム」にテレポート"/> - <location_input label="場所" name="location_combo"/> - <search_combo_box label="検索" name="search_combo_box" tool_tip="検索"> - <combo_editor label="[SECOND_LIFE] を検索:" name="search_combo_editor"/> - </search_combo_box> - </panel> - <favorites_bar name="favorite" tool_tip="ランドマークをここにドラッグして、Second Lifeのお気に入りの場所に素早くアクセス!"> - <label name="favorites_bar_label" tool_tip="ランドマークをここにドラッグして、Second Lifeのお気に入りの場所に素早くアクセス!"> - お気に入りバー - </label> - <chevron_button name=">>" tool_tip="お気に入りをもっと表示"/> - </favorites_bar> + <layout_stack name="nvp_stack"> + <layout_panel name="navigation_layout_panel"> + <panel name="navigation_panel"> + <pull_button name="back_btn" tool_tip="前の場所"/> + <pull_button name="forward_btn" tool_tip="次の場所"/> + <button name="home_btn" tool_tip="「ホーム」にテレポートします"/> + <location_input label="所在地" name="location_combo"/> + </panel> + </layout_panel> + <layout_panel name="favorites_layout_panel"> + <favorites_bar name="favorite" tool_tip="ランドマークをここにドラッグして、Second Lifeのお気に入りの場所に素早くアクセス!"> + <label name="favorites_bar_label" tool_tip="ランドマークをここにドラッグして、Second Lifeのお気に入りの場所に素早くアクセス!"> + お気に入りバー + </label> + <more_button name=">>" tool_tip="お気に入りをもっと表示"> + 詳細 ▼ + </more_button> + </favorites_bar> + </layout_panel> + </layout_stack> </panel> diff --git a/indra/newview/skins/default/xui/ja/panel_nearby_chat.xml b/indra/newview/skins/default/xui/ja/panel_nearby_chat.xml new file mode 100644 index 0000000000..aca055bb43 --- /dev/null +++ b/indra/newview/skins/default/xui/ja/panel_nearby_chat.xml @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes"?> +<panel name="nearby_chat"> + <check_box label="チャットを翻訳" name="translate_chat_checkbox"/> +</panel> diff --git a/indra/newview/skins/default/xui/ja/panel_notes.xml b/indra/newview/skins/default/xui/ja/panel_notes.xml deleted file mode 100644 index aa6d823c59..0000000000 --- a/indra/newview/skins/default/xui/ja/panel_notes.xml +++ /dev/null @@ -1,35 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes"?> -<panel label="メモとプライバシー" name="panel_notes"> - <layout_stack name="layout"> - <layout_panel name="notes_stack"> - <scroll_container name="profile_scroll"> - <panel name="profile_scroll_panel"> - <text name="status_message" value="個人的メモ:"/> - <text name="status_message2" value="この人に許可:"/> - <check_box label="オンライン状態の確認" name="status_check"/> - <check_box label="地図で居場所を確認" name="map_check"/> - <check_box label="私のオブジェクトの編集・削除・取得" name="objects_check"/> - </panel> - </scroll_container> - </layout_panel> - <layout_panel name="notes_buttons_panel"> - <layout_stack name="bottom_bar_ls"> - <layout_panel name="add_friend_btn_lp"> - <button label="フレンド登録" name="add_friend" tool_tip="フレンド登録を申し出ます"/> - </layout_panel> - <layout_panel name="im_btn_lp"> - <button label="IM" name="im" tool_tip="インスタントメッセージを開きます"/> - </layout_panel> - <layout_panel name="call_btn_lp"> - <button label="コール" name="call" tool_tip="この住人にコールする"/> - </layout_panel> - <layout_panel name="show_on_map_btn_lp"> - <button label="地図" name="show_on_map_btn" tool_tip="住人を地図上で表示する"/> - </layout_panel> - <layout_panel name="teleport_btn_lp"> - <button label="テレポート" name="teleport" tool_tip="テレポートを送ります"/> - </layout_panel> - </layout_stack> - </layout_panel> - </layout_stack> -</panel> diff --git a/indra/newview/skins/default/xui/ja/panel_preferences_chat.xml b/indra/newview/skins/default/xui/ja/panel_preferences_chat.xml index 20e17de5f1..1502442a06 100644 --- a/indra/newview/skins/default/xui/ja/panel_preferences_chat.xml +++ b/indra/newview/skins/default/xui/ja/panel_preferences_chat.xml @@ -29,9 +29,9 @@ <check_box label="IM チャット" name="EnableIMChatPopups" tool_tip="これを選択すると、インスタントメッセージを受信した際にポップアップが表示されます"/> <spinner label="近くのチャットメッセージが表示される長さ:" name="nearby_toasts_lifetime"/> <spinner label="近くのチャットメッセージが消えるまでの長さ:" name="nearby_toasts_fadingtime"/> - <check_box label="Use machine translation while chatting (powered by Google)" name="translate_chat_checkbox"/> + <check_box label="Use machine translation while chatting" name="translate_chat_checkbox"/> <text name="translate_chb_label"> - チャット中に内容を機械翻訳する(Google翻訳) + チャット中に内容を機械翻訳する </text> <text name="translate_language_text"> 翻訳する言語: @@ -51,7 +51,7 @@ <combo_box.item label="Русский(ロシア語)" name="Russian"/> <combo_box.item label="Türkçe(トルコ語)" name="Turkish"/> <combo_box.item label="Українська(ウクライナ語)" name="Ukrainian"/> - <combo_box.item label="中文 (正體)(中国語)" name="Chinese"/> + <combo_box.item label="中文 (正體) (Chinese)" name="Chinese"/> <combo_box.item label="日本語" name="Japanese"/> <combo_box.item label="한국어(韓国語)" name="Korean"/> </combo_box> diff --git a/indra/newview/skins/default/xui/ja/panel_preferences_general.xml b/indra/newview/skins/default/xui/ja/panel_preferences_general.xml index 4356f3d47f..1bafa52fbe 100644 --- a/indra/newview/skins/default/xui/ja/panel_preferences_general.xml +++ b/indra/newview/skins/default/xui/ja/panel_preferences_general.xml @@ -13,7 +13,10 @@ <combo_box.item label="Italiano (イタリア語) - ベータ" name="Italian"/> <combo_box.item label="Polski (ポーランド語) - ベータ" name="Polish"/> <combo_box.item label="Português(ポルトガル語) - ベータ" name="Portugese"/> + <combo_box.item label="Русский (ロシア語) - ベータ" name="Russian"/> + <combo_box.item label="Türkçe (トルコ語) - ベータ" name="Turkish"/> <combo_box.item label="日本語 – ベータ" name="(Japanese)"/> + <combo_box.item label="正體中文 (中国語 - 繁体字) - ベータ" name="Traditional Chinese"/> </combo_box> <text name="language_textbox2"> (再起動後に反映) @@ -48,7 +51,6 @@ <check_box label="グループタイトル" name="show_all_title_checkbox1" tool_tip="オフィサーまたはメンバーなど、グループタイトルを表示"/> <check_box label="フレンドをハイライト表示" name="show_friends" tool_tip="フレンドの名前をハイライト表示"/> <check_box label="表示名を表示" name="display_names_check" tool_tip="これを選択すると、チャット、IM などで表示名が表示されます。"/> - <check_box label="ビューワの UI ヒントを有効にする" name="viewer_hints_check"/> <text name="inworld_typing_rg_label"> 文字キーを押して次の操作: </text> diff --git a/indra/newview/skins/default/xui/ja/panel_preferences_move.xml b/indra/newview/skins/default/xui/ja/panel_preferences_move.xml index 806bcfc14a..121bebfd52 100644 --- a/indra/newview/skins/default/xui/ja/panel_preferences_move.xml +++ b/indra/newview/skins/default/xui/ja/panel_preferences_move.xml @@ -7,18 +7,33 @@ </text> <check_box label="制作・編集" name="edit_camera_movement" tool_tip="編集モードのオン・オフの切り替えに、自動カメラポジションを使います"/> <check_box label="容姿" name="appearance_camera_movement" tool_tip="編集モードに入ったときに、自動カメラポジションを使います"/> - <check_box initial_value="true" label="サイドバー" name="appearance_sidebar_positioning" tool_tip="サイドバーに自動カメラポジションを使います"/> + <text name="keyboard_lbl"> + キーボード: + </text> + <check_box label="常にキー操作で動くようにする" name="arrow_keys_move_avatar_check"/> + <check_box label="上矢印キー2度押し+長押しで走る" name="tap_tap_hold_to_run"/> + <text name="mouse_lbl"> + マウス: + </text> <check_box label="一人称視点で表示する" name="first_person_avatar_visible"/> <text name=" Mouse Sensitivity"> 一人称視点のマウスの感度: </text> <check_box label="切り替え" name="invert_mouse"/> - <check_box label="常にキー操作で動くようにする" name="arrow_keys_move_avatar_check"/> - <check_box label="上矢印キー2度押し+長押しで走る" name="tap_tap_hold_to_run"/> - <check_box label="ダブルクリックで次の操作:" name="double_click_chkbox"/> - <radio_group name="double_click_action"> - <radio_item label="テレポート" name="radio_teleport"/> - <radio_item label="自動追跡" name="radio_autopilot"/> - </radio_group> + <text name="single_click_action_lbl"> + 土地をシングルクリック: + </text> + <combo_box name="single_click_action_combo"> + <combo_box.item label="動作なし" name="0"/> + <combo_box.item label="クリックされた地点に移動" name="1"/> + </combo_box> + <text name="double_click_action_lbl"> + 土地をダブルクリック: + </text> + <combo_box name="double_click_action_combo"> + <combo_box.item label="動作なし" name="0"/> + <combo_box.item label="クリックされた地点に移動" name="1"/> + <combo_box.item label="クリックされた地点にテレポート" name="2"/> + </combo_box> <button label="その他のディバイス" name="joystick_setup_button"/> </panel> diff --git a/indra/newview/skins/default/xui/ja/panel_profile.xml b/indra/newview/skins/default/xui/ja/panel_profile.xml deleted file mode 100644 index 1acad9f81a..0000000000 --- a/indra/newview/skins/default/xui/ja/panel_profile.xml +++ /dev/null @@ -1,74 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes"?> -<panel label="プロフィール" name="panel_profile"> - <string name="CaptionTextAcctInfo"> - [ACCTTYPE] -[PAYMENTINFO] [AGEVERIFICATION] - </string> - <string name="payment_update_link_url"> - http://www.secondlife.com/account/billing.php?lang=ja-JP - </string> - <string name="partner_edit_link_url"> - http://www.secondlife.com/account/partners.php?lang=ja - </string> - <string name="my_account_link_url" value="http://secondlife.com/my/account/index.php?lang=ja-JP"/> - <string name="no_partner_text" value="なし"/> - <string name="no_group_text" value="なし"/> - <string name="RegisterDateFormat"> - [REG_DATE] ([AGE]) - </string> - <string name="name_text_args"> - [NAME] - </string> - <string name="display_name_text_args"> - [DISPLAY_NAME] - </string> - <layout_stack name="layout"> - <layout_panel name="profile_stack"> - <scroll_container name="profile_scroll"> - <panel name="profile_scroll_panel"> - <panel name="second_life_image_panel"> - <text name="title_sl_descr_text" value="[SECOND_LIFE]:"/> - </panel> - <panel name="first_life_image_panel"> - <text name="title_rw_descr_text" value="現実世界:"/> - </panel> - <text name="title_member_text" value="住人登録:"/> - <text name="title_acc_status_text" value="アカウントの状態:"/> - <text_editor name="acc_status_text"> - 住人。 支払情報未登録。 - リンデン。 - </text_editor> - <text name="title_partner_text" value="パートナー:"/> - <panel name="partner_data_panel"> - <text initial_value="(取得中)" name="partner_text"/> - </panel> - <text name="title_groups_text" value="グループ:"/> - </panel> - </scroll_container> - </layout_panel> - </layout_stack> - <layout_stack name="layout_verb_buttons"> - <layout_panel name="profile_buttons_panel"> - <layout_stack name="bottom_bar_ls"> - <layout_panel name="add_friend_btn_lp"> - <button label="フレンド登録" name="add_friend" tool_tip="フレンド登録を申し出ます"/> - </layout_panel> - <layout_panel name="im_btn_lp"> - <button label="IM" name="im" tool_tip="インスタントメッセージを開きます"/> - </layout_panel> - <layout_panel name="call_btn_lp"> - <button label="コール" name="call" tool_tip="この住人にコールする"/> - </layout_panel> - <layout_panel name="chat_btn_lp"> - <button label="テレポート" name="teleport" tool_tip="テレポートを送ります"/> - </layout_panel> - <layout_panel name="overflow_btn_lp"> - <menu_button label="▼" name="overflow_btn" tool_tip="住人にお金を渡すか持ち物を共有します"/> - </layout_panel> - </layout_stack> - </layout_panel> - <layout_panel name="profile_me_buttons_panel"> - <button label="プロフィールの編集" name="edit_profile_btn" tool_tip="個人的な情報を編集します"/> - </layout_panel> - </layout_stack> -</panel> diff --git a/indra/newview/skins/default/xui/ja/panel_profile_view.xml b/indra/newview/skins/default/xui/ja/panel_profile_view.xml deleted file mode 100644 index 5cb6575773..0000000000 --- a/indra/newview/skins/default/xui/ja/panel_profile_view.xml +++ /dev/null @@ -1,22 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes"?> -<panel name="panel_target_profile"> - <string name="status_online"> - オンライン - </string> - <string name="status_offline"> - オフライン - </string> - <text name="display_name_label" value="表示名:"/> - <text name="solo_username_label" value="ユーザー名:"/> - <text name="status" value="オンライン"/> - <text name="user_name_small" value="Jack oh look at me this is a super duper long name"/> - <text name="user_name" value="Jack Linden"/> - <button name="copy_to_clipboard" tool_tip="クリップボードにコピー"/> - <text name="user_label" value="ユーザー名:"/> - <text name="user_slid" value="jack.linden"/> - <tab_container name="tabs"> - <panel label="プロフィール" name="panel_profile"/> - <panel label="ピック" name="panel_picks"/> - <panel label="メモとプライバシー" name="panel_notes"/> - </tab_container> -</panel> diff --git a/indra/newview/skins/default/xui/ja/panel_status_bar.xml b/indra/newview/skins/default/xui/ja/panel_status_bar.xml index 35c1148cc1..93689b81af 100644 --- a/indra/newview/skins/default/xui/ja/panel_status_bar.xml +++ b/indra/newview/skins/default/xui/ja/panel_status_bar.xml @@ -18,11 +18,8 @@ <panel name="balance_bg"> <text name="balance" tool_tip="クリックして L$ 残高を更新" value="L$20"/> <button label="L$ の購入" name="buyL" tool_tip="クリックして L$ を購入します"/> + <button label="店" name="goShop" tool_tip="Second Life マーケットプレイスを開く"/> </panel> - <combo_box name="mode_combo" tool_tip="モードを選択します。ベーシックモードでは探索やチャットをすばやく簡単に実行でき、アドバンスモードでは、より多くの機能が利用できます。"> - <combo_box.item label="ベーシックモード" name="Basic"/> - <combo_box.item label="アドバンスモード" name="Advanced"/> - </combo_box> <text name="TimeText" tool_tip="現在時刻(太平洋)"> 24:00 AM PST </text> diff --git a/indra/newview/skins/default/xui/ja/strings.xml b/indra/newview/skins/default/xui/ja/strings.xml index 41dc098ba2..f611b96502 100644 --- a/indra/newview/skins/default/xui/ja/strings.xml +++ b/indra/newview/skins/default/xui/ja/strings.xml @@ -77,10 +77,10 @@ キャッシュファイルを検証しています(所要時間は 60 ~ 90 秒)... </string> <string name="LoginProcessingResponse"> - 応答を処理しています... + 対応を処理中です... </string> <string name="LoginInitializingWorld"> - ワールドを初期化しています... + ワールドを初期化中です... </string> <string name="LoginDecodingImages"> 画像をデコードしています... @@ -128,7 +128,7 @@ グリッドサーバーが返した証明書の署名を認証できませんでした。グリッドの管理者にお問い合わせください。 </string> <string name="LoginFailedNoNetwork"> - ネットワークエラー: 接続を確立できませんでした。お使いのネットワーク接続をご確認ください。 + ネットワークエラー:接続を確立できませんでした。お使いのネットワーク接続をご確認ください。 </string> <string name="LoginFailed"> ログインに失敗しました。 @@ -1276,6 +1276,9 @@ support@secondlife.com にお問い合わせください。 <string name="Marketplace Error Internal Import"> エラー:この商品に関して問題が発生しました。しばらくしてからお試しください。 </string> + <string name="Open landmarks"> + ランドマークを開く + </string> <string name="no_transfer" value=" (再販・プレゼント不可)"/> <string name="no_modify" value=" (編集不可)"/> <string name="no_copy" value=" (コピー不可)"/> @@ -4254,8 +4257,8 @@ www.secondlife.com から最新バージョンをダウンロードしてくだ <string name="Female - Wow"> 女性 - Wow </string> - <string name="/bow1"> - /bow1 + <string name="/bow"> + /おじぎする </string> <string name="/clap"> /拍手 @@ -4767,4 +4770,172 @@ www.secondlife.com から最新バージョンをダウンロードしてくだ <string name="ParticleHiding"> パーティクルを非表示 </string> + <string name="Command_AboutLand_Label"> + 土地情報 + </string> + <string name="Command_Appearance_Label"> + 容姿 + </string> + <string name="Command_Avatar_Label"> + アバター + </string> + <string name="Command_Build_Label"> + 制作 + </string> + <string name="Command_Chat_Label"> + チャット + </string> + <string name="Command_Compass_Label"> + コンパス + </string> + <string name="Command_Destinations_Label"> + 行き先 + </string> + <string name="Command_Gestures_Label"> + ジェスチャー + </string> + <string name="Command_HowTo_Label"> + ハウツー + </string> + <string name="Command_Inventory_Label"> + 持ち物 + </string> + <string name="Command_Map_Label"> + 地図 + </string> + <string name="Command_Marketplace_Label"> + マーケットプレイス + </string> + <string name="Command_MiniMap_Label"> + ミニマップ + </string> + <string name="Command_Move_Label"> + 移動 + </string> + <string name="Command_People_Label"> + 人 + </string> + <string name="Command_Picks_Label"> + ピック + </string> + <string name="Command_Places_Label"> + 場所 + </string> + <string name="Command_Preferences_Label"> + 環境設定 + </string> + <string name="Command_Profile_Label"> + プロフィール + </string> + <string name="Command_Search_Label"> + 検索 + </string> + <string name="Command_Snapshot_Label"> + スナップショット + </string> + <string name="Command_Speak_Label"> + 話す + </string> + <string name="Command_View_Label"> + 視界 + </string> + <string name="Command_Voice_Label"> + 近くのボイス + </string> + <string name="Command_AboutLand_Tooltip"> + 訪問先に関する情報 + </string> + <string name="Command_Appearance_Tooltip"> + アバターを変更 + </string> + <string name="Command_Avatar_Tooltip"> + アバター一式を選択 + </string> + <string name="Command_Build_Tooltip"> + オブジェクトの制作と地形の変形 + </string> + <string name="Command_Chat_Tooltip"> + 近くの人と文字チャットする + </string> + <string name="Command_Compass_Tooltip"> + コンパス + </string> + <string name="Command_Destinations_Tooltip"> + 行ってみたい場所 + </string> + <string name="Command_Gestures_Tooltip"> + アバターのジェスチャー + </string> + <string name="Command_HowTo_Tooltip"> + 一般的タスクの実行方法 + </string> + <string name="Command_Inventory_Tooltip"> + 持ち物を表示・使用 + </string> + <string name="Command_Map_Tooltip"> + 世界地図 + </string> + <string name="Command_Marketplace_Tooltip"> + ショッピングに出掛ける + </string> + <string name="Command_MiniMap_Tooltip"> + 近くの人を表示する + </string> + <string name="Command_Move_Tooltip"> + アバターの移動 + </string> + <string name="Command_People_Tooltip"> + フレンド、グループ、近くの人 + </string> + <string name="Command_Picks_Tooltip"> + プロフィールで紹介するお気に入りの場所 + </string> + <string name="Command_Places_Tooltip"> + 保存済みの場所 + </string> + <string name="Command_Preferences_Tooltip"> + 環境設定 + </string> + <string name="Command_Profile_Tooltip"> + プロフィールを編集・表示 + </string> + <string name="Command_Search_Tooltip"> + 場所、イベント、人を検索 + </string> + <string name="Command_Snapshot_Tooltip"> + ピクチャを撮る + </string> + <string name="Command_Speak_Tooltip"> + マイクを使って近くの人と話す + </string> + <string name="Command_View_Tooltip"> + カメラの角度を変更 + </string> + <string name="Command_Voice_Tooltip"> + ボイスチャット機能を持つ近くの人 + </string> + <string name="Retain%"> + 維持率 + </string> + <string name="Detail"> + 詳細 + </string> + <string name="Better Detail"> + もっと詳しく + </string> + <string name="Surface"> + 表面 + </string> + <string name="Solid"> + ソリッド + </string> + <string name="Wrap"> + ラップ + </string> + <string name="Preview"> + プレビュー + </string> + <string name="Normal"> + 普通 + </string> </strings> diff --git a/indra/newview/skins/default/xui/ja/teleport_strings.xml b/indra/newview/skins/default/xui/ja/teleport_strings.xml index 2f67d43707..04ea1c2438 100644 --- a/indra/newview/skins/default/xui/ja/teleport_strings.xml +++ b/indra/newview/skins/default/xui/ja/teleport_strings.xml @@ -20,6 +20,10 @@ 申し訳ございませんが、システムはテレポートの接続を完了できませんでした。 もう少し後でやり直してください。 </message> + <message name="NoHelpIslandTP"> + Welcome Islandには戻ることができません。 +「Welcome Island Public」に行き、 + </message> <message name="noaccess_tport"> 残念ながら、そのテレポート目的地へのアクセスがありません。 </message> diff --git a/indra/newview/skins/default/xui/pl/floater_about.xml b/indra/newview/skins/default/xui/pl/floater_about.xml index 637325ddd0..409429ffaa 100644 --- a/indra/newview/skins/default/xui/pl/floater_about.xml +++ b/indra/newview/skins/default/xui/pl/floater_about.xml @@ -10,7 +10,7 @@ <floater.string name="AboutPosition"> Położenie [POSITION_0,number,1], [POSITION_1,number,1], [POSITION_2,number,1] w [REGION] zlokalizowanym w <nolink>[HOSTNAME]</nolink> ([HOSTIP]) [SERVER_VERSION] -[[SERVER_RELEASE_NOTES_URL] [ReleaseNotes]] +[SERVER_RELEASE_NOTES_URL] </floater.string> <floater.string name="AboutSystem"> Procesor: [CPU] diff --git a/indra/newview/skins/default/xui/pl/floater_buy_currency.xml b/indra/newview/skins/default/xui/pl/floater_buy_currency.xml index f2a6579dc3..3e51761b37 100644 --- a/indra/newview/skins/default/xui/pl/floater_buy_currency.xml +++ b/indra/newview/skins/default/xui/pl/floater_buy_currency.xml @@ -46,7 +46,7 @@ [AMT]L$ </text> <text name="currency_links"> - [http://www.secondlife.com/my/account/payment_method_management.php metoda płatności] | [http://www.secondlife.com/my/account/currency.php waluta] | [http://www.secondlife.com/my/account/exchange_rates.php kurs wymiany] + [http://www.secondlife.com/my/account/payment_method_management.php metoda płatności] | [http://www.secondlife.com/my/account/currency.php waluta] </text> <text name="exchange_rate_note"> Wpisz ponownie kwotę aby zobaczyć ostatni kurs wymiany. diff --git a/indra/newview/skins/default/xui/pl/floater_camera.xml b/indra/newview/skins/default/xui/pl/floater_camera.xml index 5b9dd47616..60f3cd0fff 100644 --- a/indra/newview/skins/default/xui/pl/floater_camera.xml +++ b/indra/newview/skins/default/xui/pl/floater_camera.xml @@ -9,15 +9,6 @@ <floater.string name="move_tooltip"> Poruszaj kamerą w dół/górę oraz w prawo/lewo </floater.string> - <floater.string name="camera_modes_title"> - Ustawienia - </floater.string> - <floater.string name="pan_mode_title"> - W prawo lub w lewo - </floater.string> - <floater.string name="presets_mode_title"> - Ustaw widok - </floater.string> <floater.string name="free_mode_title"> Zobacz obiekt </floater.string> diff --git a/indra/newview/skins/default/xui/pl/floater_nearby_chat.xml b/indra/newview/skins/default/xui/pl/floater_nearby_chat.xml index 7dc3e1f22e..214d465f1c 100644 --- a/indra/newview/skins/default/xui/pl/floater_nearby_chat.xml +++ b/indra/newview/skins/default/xui/pl/floater_nearby_chat.xml @@ -1,4 +1,4 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <floater name="nearby_chat" title="CZAT LOKALNY"> - <check_box label="Tłumaczenie czatu (wspierane przez Google)" name="translate_chat_checkbox"/> + <check_box label="Tłumaczenie czatu" name="translate_chat_checkbox"/> </floater> diff --git a/indra/newview/skins/default/xui/pl/notifications.xml b/indra/newview/skins/default/xui/pl/notifications.xml index 7d3225ea31..e1fb6dd3f1 100644 --- a/indra/newview/skins/default/xui/pl/notifications.xml +++ b/indra/newview/skins/default/xui/pl/notifications.xml @@ -946,7 +946,7 @@ Zaproponować znajomość [NAME]? </form> </notification> <notification name="RemoveFromFriends"> - Czy chcesz usunąć [NAME] z listy znajomych? + Czy chcesz usunąć <nolink>[NAME]</nolink> z listy znajomych? <usetemplate name="okcancelbuttons" notext="Anuluj" yestext="OK"/> </notification> <notification name="RemoveMultipleFromFriends"> @@ -2078,10 +2078,10 @@ Zamieść go na stronie internetowej żeby umożliwić innym łatwy dostęp do t Temat: [SUBJECT], Treść: [MESSAGE] </notification> <notification name="FriendOnline"> - [NAME] jest w Second Life + <nolink>[NAME]</nolink> jest w Second Life </notification> <notification name="FriendOffline"> - [NAME] opuszcza Second Life + <nolink>[NAME]</nolink> opuszcza Second Life </notification> <notification name="AddSelfFriend"> Nie możesz dodać siebie do listy znajomych. @@ -2458,10 +2458,10 @@ Spróbuj ponowanie za kilka minut. </form> </notification> <notification name="FriendshipAccepted"> - Twoja propozycja znajomości została przyjęta przez [NAME]. + Twoja propozycja znajomości została przyjęta przez <nolink>[NAME]</nolink>. </notification> <notification name="FriendshipDeclined"> - Twoja propozycja znajomości została odrzucona przez [NAME]. + Twoja propozycja znajomości została odrzucona przez <nolink>[NAME]</nolink>. </notification> <notification name="FriendshipAcceptedByMe"> Propozycja znajomości została zaakceptowana. diff --git a/indra/newview/skins/default/xui/pl/panel_my_profile.xml b/indra/newview/skins/default/xui/pl/panel_my_profile.xml deleted file mode 100644 index cdc833241d..0000000000 --- a/indra/newview/skins/default/xui/pl/panel_my_profile.xml +++ /dev/null @@ -1,31 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes"?> -<panel label="Profil" name="panel_profile"> - <string name="no_partner_text" value="Żadne"/> - <string name="no_group_text" value="Żadne"/> - <string name="RegisterDateFormat"> - [REG_DATE] ([AGE]) - </string> - <string name="name_text_args"> - [NAME] - </string> - <string name="display_name_text_args"> - [DISPLAY_NAME] - </string> - <layout_stack name="layout"> - <layout_panel name="profile_stack"> - <scroll_container name="profile_scroll"> - <panel name="scroll_content_panel"> - <panel name="second_life_image_panel"> - <text name="display_name_descr_text"> - Nazwa użytkownika - </text> - <text name="name_descr_text"> - Wyświetlana nazwa - </text> - <button label="Profil" name="see_profile_btn" tool_tip="Zobacz profil tego awatara"/> - </panel> - </panel> - </scroll_container> - </layout_panel> - </layout_stack> -</panel> diff --git a/indra/newview/skins/default/xui/pl/panel_notes.xml b/indra/newview/skins/default/xui/pl/panel_notes.xml deleted file mode 100644 index 571171d64c..0000000000 --- a/indra/newview/skins/default/xui/pl/panel_notes.xml +++ /dev/null @@ -1,35 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes"?> -<panel label="Notatki & Prywatność" name="panel_notes"> - <layout_stack name="layout"> - <layout_panel name="notes_stack"> - <scroll_container name="profile_scroll"> - <panel name="profile_scroll_panel"> - <text name="status_message" value="Notatki:"/> - <text name="status_message2" value="Pozwól tej osobie na:"/> - <check_box label="Widzenie mojego statusu" name="status_check"/> - <check_box label="Lokalizowanie mnie na mapie" name="map_check"/> - <check_box label="Edytowanie, kasowanie lub zabieranie moich obiektów" name="objects_check"/> - </panel> - </scroll_container> - </layout_panel> - <layout_panel name="notes_buttons_panel"> - <layout_stack name="bottom_bar_ls"> - <layout_panel name="add_friend_btn_lp"> - <button label="Dodaj do Znajomych" name="add_friend" tool_tip="Zaoferuj znajomość Rezydentowi"/> - </layout_panel> - <layout_panel name="im_btn_lp"> - <button label="IM" name="im" tool_tip="Otwórz wiadomości IM"/> - </layout_panel> - <layout_panel name="call_btn_lp"> - <button label="Dzwoń" name="call" tool_tip="Zadzwoń do Rezydenta"/> - </layout_panel> - <layout_panel name="show_on_map_btn_lp"> - <button label="Mapa" name="show_on_map_btn" tool_tip="Pokaż Rezydenta na mapie"/> - </layout_panel> - <layout_panel name="teleport_btn_lp"> - <button label="Teleportuj" name="teleport" tool_tip="Teleportuj"/> - </layout_panel> - </layout_stack> - </layout_panel> - </layout_stack> -</panel> diff --git a/indra/newview/skins/default/xui/pl/panel_preferences_chat.xml b/indra/newview/skins/default/xui/pl/panel_preferences_chat.xml index be730eb73f..7fd1029e6a 100644 --- a/indra/newview/skins/default/xui/pl/panel_preferences_chat.xml +++ b/indra/newview/skins/default/xui/pl/panel_preferences_chat.xml @@ -31,7 +31,7 @@ <spinner label="Czas znikania czatu w pobliżu:" name="nearby_toasts_fadingtime"/> <check_box name="translate_chat_checkbox"/> <text name="translate_chb_label"> - Użyj translatora podczas rozmowy (wspierany przez Google) + Użyj translatora podczas rozmowy </text> <text name="translate_language_text"> Przetłumacz czat na: diff --git a/indra/newview/skins/default/xui/pl/panel_profile.xml b/indra/newview/skins/default/xui/pl/panel_profile.xml deleted file mode 100644 index 77dd951bc4..0000000000 --- a/indra/newview/skins/default/xui/pl/panel_profile.xml +++ /dev/null @@ -1,59 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes"?> -<panel label="Profil" name="panel_profile"> - <string name="no_partner_text" value="Brak"/> - <string name="no_group_text" value="Żadne"/> - <string name="RegisterDateFormat"> - [REG_DATE] ([AGE]) - </string> - <string name="name_text_args"> - [NAME] - </string> - <string name="display_name_text_args"> - [DISPLAY_NAME] - </string> - <layout_stack name="layout"> - <layout_panel name="profile_stack"> - <scroll_container name="profile_scroll"> - <panel name="profile_scroll_panel"> - <panel name="second_life_image_panel"> - <text name="title_sl_descr_text" value="[SECOND_LIFE]:"/> - </panel> - <panel name="first_life_image_panel"> - <text name="title_rw_descr_text" value="Życie#1:"/> - </panel> - <text name="title_member_text" value="Urodziny:"/> - <text name="title_acc_status_text" value="Konto:"/> - <text name="title_partner_text" value="Partner:"/> - <panel name="partner_data_panel"> - <text initial_value="(przetwarzanie)" name="partner_text"/> - </panel> - <text name="title_groups_text" value="Grupy:"/> - </panel> - </scroll_container> - </layout_panel> - </layout_stack> - <layout_stack name="layout_verb_buttons"> - <layout_panel name="profile_buttons_panel"> - <layout_stack name="bottom_bar_ls"> - <layout_panel name="add_friend_btn_lp"> - <button label="Poznaj" name="add_friend" tool_tip="Zaproponuj znajomość Rezydentowi"/> - </layout_panel> - <layout_panel name="im_btn_lp"> - <button label="IM" name="im" tool_tip="Otwórz wiadomości IM"/> - </layout_panel> - <layout_panel name="call_btn_lp"> - <button label="Dzwoń" name="call" tool_tip="Zadzwoń do tego Rezydenta"/> - </layout_panel> - <layout_panel name="chat_btn_lp"> - <button label="Teleportuj" name="teleport" tool_tip="Teleportuj"/> - </layout_panel> - <layout_panel name="overflow_btn_lp"> - <menu_button label="▼" name="overflow_btn" tool_tip="Zapłać lub udostępnij obiekt Rezydentowi"/> - </layout_panel> - </layout_stack> - </layout_panel> - <layout_panel name="profile_me_buttons_panel"> - <button label="Edytuj profil" name="edit_profile_btn" tool_tip="Edytuj informacje o sobie"/> - </layout_panel> - </layout_stack> -</panel> diff --git a/indra/newview/skins/default/xui/pl/panel_profile_view.xml b/indra/newview/skins/default/xui/pl/panel_profile_view.xml deleted file mode 100644 index 1fd6bc1d10..0000000000 --- a/indra/newview/skins/default/xui/pl/panel_profile_view.xml +++ /dev/null @@ -1,20 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes"?> -<panel name="panel_target_profile"> - <string name="status_online"> - Obecnie w SL - </string> - <string name="status_offline"> - Nieaktywny - </string> - <text name="display_name_label" value="Wyświetlana nazwa:"/> - <text name="solo_username_label" value="Nazwa użytkownika:"/> - <text name="status" value="Obecnie w SL"/> - <text name="user_name_small" value="Jack oh look at me this is a super duper long name"/> - <button name="copy_to_clipboard" tool_tip="Kopiuj do schowka"/> - <text name="user_label" value="Nazwa użytkownika:"/> - <tab_container name="tabs"> - <panel label="PROFIL" name="panel_profile"/> - <panel label="ULUBIONE" name="panel_picks"/> - <panel label="NOTATKI & PRYWATNOŚĆ" name="panel_notes"/> - </tab_container> -</panel> diff --git a/indra/newview/skins/default/xui/pl/strings.xml b/indra/newview/skins/default/xui/pl/strings.xml index 6a8309cca5..f6dec8536b 100644 --- a/indra/newview/skins/default/xui/pl/strings.xml +++ b/indra/newview/skins/default/xui/pl/strings.xml @@ -423,6 +423,9 @@ <string name="symbolic folder link"> link folderu </string> + <string name="AvatarEditingAppearance"> + (Edycja Wygląd) + </string> <string name="AvatarAway"> Śpi </string> diff --git a/indra/newview/skins/default/xui/pl/teleport_strings.xml b/indra/newview/skins/default/xui/pl/teleport_strings.xml index 57fb55bf4c..0366c3fdbc 100644 --- a/indra/newview/skins/default/xui/pl/teleport_strings.xml +++ b/indra/newview/skins/default/xui/pl/teleport_strings.xml @@ -19,6 +19,10 @@ Jeśli nadal nie możesz się teleportować wyloguj się i ponownie zaloguj. <message name="timeout_tport"> Przepraszamy, ale nie udało się przeprowadzić teleportacji. Spróbuj jeszcze raz. </message> + <message name="NoHelpIslandTP"> + Brak możliwości ponownej teleportacji do Welcome Island. +Odwiedź 'Welcome Island Public' by powtórzyć szkolenie. + </message> <message name="noaccess_tport"> Przepraszamy, ale nie masz dostępu do miejsca docelowego. </message> diff --git a/indra/newview/skins/default/xui/pt/floater_buy_currency.xml b/indra/newview/skins/default/xui/pt/floater_buy_currency.xml index a737212b50..b5ba477fe5 100644 --- a/indra/newview/skins/default/xui/pt/floater_buy_currency.xml +++ b/indra/newview/skins/default/xui/pt/floater_buy_currency.xml @@ -46,7 +46,7 @@ L$ [AMT] </text> <text name="currency_links"> - [http://www.secondlife.com/my/account/payment_method_management.php payment method] | [http://www.secondlife.com/my/account/currency.php currency] | [http://www.secondlife.com/my/account/exchange_rates.php exchange rate] + [http://www.secondlife.com/my/account/payment_method_management.php payment method] | [http://www.secondlife.com/my/account/currency.php currency] </text> <text name="exchange_rate_note"> Digite o valor novamente para ver o câmbio atual. diff --git a/indra/newview/skins/default/xui/pt/floater_camera.xml b/indra/newview/skins/default/xui/pt/floater_camera.xml index 0e4fc1b455..6b66d01781 100644 --- a/indra/newview/skins/default/xui/pt/floater_camera.xml +++ b/indra/newview/skins/default/xui/pt/floater_camera.xml @@ -9,15 +9,6 @@ <floater.string name="move_tooltip"> Mover a Câmera para Cima e para Baixo, para a Esquerda e para a Direita </floater.string> - <floater.string name="camera_modes_title"> - Modos de câmera - </floater.string> - <floater.string name="pan_mode_title"> - Pan zoom orbital - </floater.string> - <floater.string name="presets_mode_title"> - Ângulos predefinidos - </floater.string> <floater.string name="free_mode_title"> Visualizar objeto </floater.string> diff --git a/indra/newview/skins/default/xui/pt/floater_nearby_chat.xml b/indra/newview/skins/default/xui/pt/floater_nearby_chat.xml index 60edfa505f..653861f7d8 100644 --- a/indra/newview/skins/default/xui/pt/floater_nearby_chat.xml +++ b/indra/newview/skins/default/xui/pt/floater_nearby_chat.xml @@ -1,4 +1,4 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <floater name="nearby_chat" title="Bate-papo local"> - <check_box label="Traduzir bate-papo (via Google)" name="translate_chat_checkbox"/> + <check_box label="Traduzir bate-papo" name="translate_chat_checkbox"/> </floater> diff --git a/indra/newview/skins/default/xui/pt/notifications.xml b/indra/newview/skins/default/xui/pt/notifications.xml index 4bd9f86e0f..d3547beeb3 100644 --- a/indra/newview/skins/default/xui/pt/notifications.xml +++ b/indra/newview/skins/default/xui/pt/notifications.xml @@ -973,7 +973,7 @@ Oferecer amizade para [NAME]? </form> </notification> <notification name="RemoveFromFriends"> - Remover [NAME] da sua lista de amigos? + Remover <nolink>[NAME]</nolink> da sua lista de amigos? <usetemplate name="okcancelbuttons" notext="Cancelar" yestext="Remover"/> </notification> <notification name="RemoveMultipleFromFriends"> @@ -2109,10 +2109,10 @@ Isso abrirá o seu navegador. Assunto: [SUBJECT], Mensagem: [MESSAGE] </notification> <notification name="FriendOnline"> - [NAME] está online + <nolink>[NAME]</nolink> está online </notification> <notification name="FriendOffline"> - [NAME] está offline + <nolink>[NAME]</nolink> está offline </notification> <notification name="AddSelfFriend"> Você é o máximo! Mesmo assim, não dá para adicionar a si mesmo(a) como amigo(a). @@ -2501,10 +2501,10 @@ Cada um pode ver o status do outro (definição padrão). </form> </notification> <notification name="FriendshipAccepted"> - [NAME] aceitou seu convite de amizade. + <nolink>[NAME]</nolink> aceitou seu convite de amizade. </notification> <notification name="FriendshipDeclined"> - [NAME] recusou seu convite de amizade + <nolink>[NAME]</nolink> recusou seu convite de amizade </notification> <notification name="FriendshipAcceptedByMe"> Oferta de amizada aceita. diff --git a/indra/newview/skins/default/xui/pt/panel_my_profile.xml b/indra/newview/skins/default/xui/pt/panel_my_profile.xml deleted file mode 100644 index aa15a2445d..0000000000 --- a/indra/newview/skins/default/xui/pt/panel_my_profile.xml +++ /dev/null @@ -1,31 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes"?> -<panel label="Perfil" name="panel_profile"> - <string name="no_partner_text" value="Nenhum"/> - <string name="no_group_text" value="Nenhum"/> - <string name="RegisterDateFormat"> - [REG_DATE] ([AGE]) - </string> - <string name="name_text_args"> - [NAME] - </string> - <string name="display_name_text_args"> - [DISPLAY_NAME] - </string> - <layout_stack name="layout"> - <layout_panel name="profile_stack"> - <scroll_container name="profile_scroll"> - <panel name="scroll_content_panel"> - <panel name="second_life_image_panel"> - <text name="display_name_descr_text"> - Nome de usuário - </text> - <text name="name_descr_text"> - Nome de tela - </text> - <button label="Perfil" name="see_profile_btn" tool_tip="Ver o perfil deste avatar"/> - </panel> - </panel> - </scroll_container> - </layout_panel> - </layout_stack> -</panel> diff --git a/indra/newview/skins/default/xui/pt/panel_nearby_chat.xml b/indra/newview/skins/default/xui/pt/panel_nearby_chat.xml index 9d44c7f62d..15470dc94a 100644 --- a/indra/newview/skins/default/xui/pt/panel_nearby_chat.xml +++ b/indra/newview/skins/default/xui/pt/panel_nearby_chat.xml @@ -1,4 +1,4 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <panel name="nearby_chat"> - <check_box label="Traduzir bate-papo (via Google)" name="translate_chat_checkbox"/> + <check_box label="Traduzir bate-papo" name="translate_chat_checkbox"/> </panel> diff --git a/indra/newview/skins/default/xui/pt/panel_notes.xml b/indra/newview/skins/default/xui/pt/panel_notes.xml deleted file mode 100644 index c15e838b34..0000000000 --- a/indra/newview/skins/default/xui/pt/panel_notes.xml +++ /dev/null @@ -1,35 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes"?> -<panel label="Anotações e Privacidade" name="panel_notes"> - <layout_stack name="layout"> - <layout_panel name="notes_stack"> - <scroll_container name="profile_scroll"> - <panel name="profile_scroll_panel"> - <text name="status_message" value="Minhas anotações privadas:"/> - <text name="status_message2" value="Deixar esta pessoa:"/> - <check_box label="Ver meu status" name="status_check"/> - <check_box label="Ver minha localização no mapa" name="map_check"/> - <check_box label="Pegar, editar ou excluir objetos meus" name="objects_check"/> - </panel> - </scroll_container> - </layout_panel> - <layout_panel name="notes_buttons_panel"> - <layout_stack name="bottom_bar_ls"> - <layout_panel name="add_friend_btn_lp"> - <button label="Adicionar amigo" name="add_friend" tool_tip="Oferecer amizade ao residente"/> - </layout_panel> - <layout_panel name="im_btn_lp"> - <button label="MI" name="im" tool_tip="Abrir sessão de mensagem instantânea"/> - </layout_panel> - <layout_panel name="call_btn_lp"> - <button label="Ligar" name="call" tool_tip="Ligar para este residente"/> - </layout_panel> - <layout_panel name="show_on_map_btn_lp"> - <button label="Mapa" name="show_on_map_btn" tool_tip="Exibir o residente no mapa"/> - </layout_panel> - <layout_panel name="teleport_btn_lp"> - <button label="Teletransportar" name="teleport" tool_tip="Oferecer teletransporte"/> - </layout_panel> - </layout_stack> - </layout_panel> - </layout_stack> -</panel> diff --git a/indra/newview/skins/default/xui/pt/panel_preferences_chat.xml b/indra/newview/skins/default/xui/pt/panel_preferences_chat.xml index e5aa42aae0..f98659aa73 100644 --- a/indra/newview/skins/default/xui/pt/panel_preferences_chat.xml +++ b/indra/newview/skins/default/xui/pt/panel_preferences_chat.xml @@ -31,7 +31,7 @@ <spinner label="Transição de avisos de bate-papos por perto:" name="nearby_toasts_fadingtime"/> <check_box name="translate_chat_checkbox"/> <text name="translate_chb_label"> - Traduzir bate-papo automaticamente (via Google) + Traduzir bate-papo automaticamente </text> <text name="translate_language_text"> Traduzir bate-papo para: diff --git a/indra/newview/skins/default/xui/pt/panel_preferences_general.xml b/indra/newview/skins/default/xui/pt/panel_preferences_general.xml index 1c19a55de6..c53aa7d5f7 100644 --- a/indra/newview/skins/default/xui/pt/panel_preferences_general.xml +++ b/indra/newview/skins/default/xui/pt/panel_preferences_general.xml @@ -16,7 +16,7 @@ <combo_box.item label="Русский (Russo) - Beta" name="Russian"/> <combo_box.item label="Türkçe (Turco) - Beta" name="Turkish"/> <combo_box.item label="日本語 (Japonês) - Beta" name="(Japanese)"/> - <combo_box.item label="正體 (Chinês tradicional) - Beta" name="Traditional Chinese"/> + <combo_box.item label="正體中文 (Chinês tradicional) - Beta" name="Traditional Chinese"/> </combo_box> <text name="language_textbox2"> (Reinicie para trocar de idioma) diff --git a/indra/newview/skins/default/xui/pt/panel_profile.xml b/indra/newview/skins/default/xui/pt/panel_profile.xml deleted file mode 100644 index 075ef55dee..0000000000 --- a/indra/newview/skins/default/xui/pt/panel_profile.xml +++ /dev/null @@ -1,70 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes"?> -<panel label="Perfil" name="panel_profile"> - <string name="CaptionTextAcctInfo"> - [ACCTTYPE] -[PAYMENTINFO] [AGEVERIFICATION] - </string> - <string name="payment_update_link_url"> - http://www.secondlife.com/account/billing.php?lang=pt-BR - </string> - <string name="partner_edit_link_url"> - http://www.secondlife.com/account/partners.php?lang=pt - </string> - <string name="my_account_link_url" value="http://secondlife.com/my/account/index.php?lang=pt-BR"/> - <string name="no_partner_text" value="Ninguém"/> - <string name="no_group_text" value="Nenhum"/> - <string name="RegisterDateFormat"> - [REG_DATE] ([AGE]) - </string> - <string name="name_text_args"> - [NAME] - </string> - <string name="display_name_text_args"> - [DISPLAY_NAME] - </string> - <layout_stack name="layout"> - <layout_panel name="profile_stack"> - <scroll_container name="profile_scroll"> - <panel name="profile_scroll_panel"> - <panel name="second_life_image_panel"> - <text name="title_sl_descr_text" value="[SECOND_LIFE]:"/> - </panel> - <panel name="first_life_image_panel"> - <text name="title_rw_descr_text" value="Mundo real:"/> - </panel> - <text name="title_member_text" value="Residente desde:"/> - <text name="title_acc_status_text" value="Conta:"/> - <text name="title_partner_text" value="Parceiro(a):"/> - <panel name="partner_data_panel"> - <text initial_value="(pesquisando)" name="partner_text"/> - </panel> - <text name="title_groups_text" value="Grupos:"/> - </panel> - </scroll_container> - </layout_panel> - </layout_stack> - <layout_stack name="layout_verb_buttons"> - <layout_panel name="profile_buttons_panel"> - <layout_stack name="bottom_bar_ls"> - <layout_panel name="add_friend_btn_lp"> - <button label="Adicionar amigo" name="add_friend" tool_tip="Oferecer amizade ao residente"/> - </layout_panel> - <layout_panel name="im_btn_lp"> - <button label="MI" name="im" tool_tip="Abrir sessão de mensagem instantânea"/> - </layout_panel> - <layout_panel name="call_btn_lp"> - <button label="Ligar" name="call" tool_tip="Ligar para este residente"/> - </layout_panel> - <layout_panel name="chat_btn_lp"> - <button label="Teletransportar" name="teleport" tool_tip="Oferecer teletransporte"/> - </layout_panel> - <layout_panel name="overflow_btn_lp"> - <menu_button label="▼" name="overflow_btn" tool_tip="Pagar ou compartilhar inventário com o residente"/> - </layout_panel> - </layout_stack> - </layout_panel> - <layout_panel name="profile_me_buttons_panel"> - <button label="Editar perfil" name="edit_profile_btn" tool_tip="Editar dados pessoais"/> - </layout_panel> - </layout_stack> -</panel> diff --git a/indra/newview/skins/default/xui/pt/panel_profile_view.xml b/indra/newview/skins/default/xui/pt/panel_profile_view.xml deleted file mode 100644 index d81ee08e6c..0000000000 --- a/indra/newview/skins/default/xui/pt/panel_profile_view.xml +++ /dev/null @@ -1,20 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes"?> -<panel name="panel_target_profile"> - <string name="status_online"> - Conectado - </string> - <string name="status_offline"> - Desconectado - </string> - <text name="display_name_label" value="Nome de tela:"/> - <text name="solo_username_label" value="Nome de usuário:"/> - <text name="status" value="Conectado"/> - <text name="user_name_small" value="Jack oh look at me this is a super duper long name"/> - <button name="copy_to_clipboard" tool_tip="Copiar para área de transferência"/> - <text name="user_label" value="Nome de usuário:"/> - <tab_container name="tabs"> - <panel label="PERFIL" name="panel_profile"/> - <panel label="DESTAQUES" name="panel_picks"/> - <panel label="ANOTAÇÕES E PRIVACIDADE" name="panel_notes"/> - </tab_container> -</panel> diff --git a/indra/newview/skins/default/xui/pt/strings.xml b/indra/newview/skins/default/xui/pt/strings.xml index cc61ad76d7..4535c7aaeb 100644 --- a/indra/newview/skins/default/xui/pt/strings.xml +++ b/indra/newview/skins/default/xui/pt/strings.xml @@ -547,6 +547,9 @@ Titulares de contas gratuitas não poderão acessar o Second Life para acomodar <string name="mesh"> mesh </string> + <string name="AvatarEditingAppearance"> + (Edição Aparência) + </string> <string name="AvatarAway"> Distante </string> diff --git a/indra/newview/skins/default/xui/pt/teleport_strings.xml b/indra/newview/skins/default/xui/pt/teleport_strings.xml index 11ea0f4195..f8ded1ce69 100644 --- a/indra/newview/skins/default/xui/pt/teleport_strings.xml +++ b/indra/newview/skins/default/xui/pt/teleport_strings.xml @@ -18,6 +18,10 @@ Se você continuar a receber esta mensagem, por favor consulte o [SUPPORT_SITE]. <message name="timeout_tport"> Desculpe, não foi possível para o sistema executar o teletransporte. Tente novamente dentro de alguns instantes. </message> + <message name="NoHelpIslandTP"> + Você não pode se tele-transportar de volta à Ilha de Welcome. +Vá para a Ilha de Welcome Pública para repetir este tutorial. + </message> <message name="noaccess_tport"> Desculpe, você não tem acesso ao destino deste teletransporte. </message> diff --git a/indra/newview/skins/default/xui/ru/floater_about.xml b/indra/newview/skins/default/xui/ru/floater_about.xml index 6bc550c3fe..deb6be319c 100644 --- a/indra/newview/skins/default/xui/ru/floater_about.xml +++ b/indra/newview/skins/default/xui/ru/floater_about.xml @@ -10,7 +10,7 @@ <floater.string name="AboutPosition"> Вы в точке [POSITION_0,number,1], [POSITION_1,number,1], [POSITION_2,number,1] в регионе «[REGION]», расположенном на <nolink>[HOSTNAME]</nolink> ([HOSTIP]) [SERVER_VERSION] -[[SERVER_RELEASE_NOTES_URL] [ReleaseNotes]] +[SERVER_RELEASE_NOTES_URL] </floater.string> <floater.string name="AboutSystem"> ЦП: [CPU] @@ -36,6 +36,9 @@ <floater.string name="AboutTraffic"> Потеряно пакетов: [PACKETS_LOST,number,0]/[PACKETS_IN,number,0] ([PACKETS_PCT,number,1]%) </floater.string> + <floater.string name="ErrorFetchingServerReleaseNotesURL"> + Ошибка при получении URL-адреса заметок о выпуске сервера. + </floater.string> <tab_container name="about_tab"> <panel label="Данные" name="support_panel"> <button label="Копировать в буфер обмена" name="copy_btn"/> diff --git a/indra/newview/skins/default/xui/ru/floater_about_land.xml b/indra/newview/skins/default/xui/ru/floater_about_land.xml index cf43f41107..3c278fce52 100644 --- a/indra/newview/skins/default/xui/ru/floater_about_land.xml +++ b/indra/newview/skins/default/xui/ru/floater_about_land.xml @@ -141,16 +141,16 @@ </panel> <panel label="СОГЛАШЕНИЕ" name="land_covenant_panel"> <panel.string name="can_resell"> - Приобретенная в этом регионе земля может быть перепродана. + Купленная в этом регионе земля может быть перепродана. </panel.string> <panel.string name="can_not_resell"> - Приобретенная в этом регионе земля не может быть перепродана. + Купленная в этом регионе земля не может быть перепродана. </panel.string> <panel.string name="can_change"> - Приобретенная в этом регионе земля может быть объединена или разделена. + Купленная в этом регионе земля может быть объединена или разделена. </panel.string> <panel.string name="can_not_change"> - Приобретенная в этом регионе земля не может быть объединена или разделена. + Купленная в этом регионе земля не может быть объединена или разделена. </panel.string> <text name="estate_section_lbl"> Землевладение: @@ -212,19 +212,19 @@ Бонусный множитель для объектов: [BONUS] </text> <text name="Simulator primitive usage:"> - Примитивов используется: + Емкость региона: </text> <text name="objects_available"> [COUNT] из [MAX] ([AVAILABLE] доступно) </text> <text name="Primitives parcel supports:"> - Разрешено для размещения: + Емкость участка: </text> <text name="object_contrib_text"> [COUNT] </text> <text name="Primitives on parcel:"> - Примитивов на участке: + Воздействие участка: </text> <text name="total_objects_text"> [COUNT] @@ -270,7 +270,7 @@ <name_list name="owner list"> <name_list.columns label="Тип" name="type"/> <name_list.columns label="Название" name="name"/> - <name_list.columns label="Количество" name="count"/> + <name_list.columns label="Кол-во" name="count"/> <name_list.columns label="Последний объект" name="mostrecent"/> </name_list> </panel> @@ -286,10 +286,10 @@ Этот параметр недоступен, потому что вы не можете изменять его на этом участке. </panel.string> <panel.string name="mature_check_mature"> - Moderate-контент + Умеренный контент </panel.string> <panel.string name="mature_check_adult"> - Содержимое для взрослых + Контент для взрослых </panel.string> <panel.string name="mature_check_mature_tooltip"> Информация или содержимое вашего участка расценивается как moderate. @@ -366,7 +366,7 @@ <combo_box.item label="Аренда" name="item13"/> <combo_box.item label="Другое" name="item12"/> </combo_box> - <check_box label="Moderate-контент" name="MatureCheck" tool_tip=" "/> + <check_box label="Умеренный контент" name="MatureCheck" tool_tip=" "/> <text name="Snapshot:"> Снимок: </text> @@ -374,7 +374,7 @@ <text name="allow_label5"> Позволить жителям с других участков: </text> - <check_box label="Видеть аватары" name="SeeAvatarsCheck" tool_tip="Жители с других участков могут видеть жителей этого участка и общаться с ними в чате (вы также сможете видеть жителей с других участков и общаться с ними)."/> + <check_box label="Видны аватары" name="SeeAvatarsCheck" tool_tip="Жители с других участков могут видеть жителей этого участка и общаться с ними в чате (вы также сможете видеть жителей с других участков и общаться с ними)."/> <text name="landing_point"> В точку телепортации: [LANDING] </text> @@ -395,7 +395,7 @@ </text> <combo_box name="media type" tool_tip="Укажите, чем является ссылка – видео, веб-страница или другое медиа"/> <text name="at URL:"> - Домашняя страница: + Дом. страница: </text> <button label="Задать" name="set_media_url"/> <text name="Description:"> @@ -403,7 +403,7 @@ </text> <line_editor name="url_description" tool_tip="Текст, показываемый рядом с кнопкой проигрывания/загрузки"/> <text name="Media texture:"> - Заменяемая текстура: + Замена текстуры: </text> <texture_picker name="media texture" tool_tip="Щелкните для выбора изображения"/> <text name="replace_texture_help"> @@ -416,7 +416,7 @@ <spinner name="media_size_width" tool_tip="Размер отображения веб-медиа, по умолчанию – 0."/> <spinner name="media_size_height" tool_tip="Размер отображения веб-медиа, по умолчанию – 0."/> <text name="pixels"> - пикселей + пикс. </text> <text name="Options:"> Опции: @@ -425,7 +425,7 @@ </panel> <panel label="ЗВУК" name="land_audio_panel"> <text name="MusicURL:"> - URL-адрес для музыки: + URL музыки: </text> <text name="Sound:"> Звук: @@ -448,18 +448,18 @@ (Определено на землевладении) </panel.string> <panel.string name="allow_public_access"> - Разрешить публичный доступ ([MATURITY]) (Примечание. Снятие приведет к созданию линий запрета) + Разрешить общий доступ ([MATURITY]) (Снятие приведет к созданию линий запрета) </panel.string> <panel.string name="estate_override"> - Часть этих параметров установлены на уровне землевладения + Часть этих параметров установлена на уровне землевладения </panel.string> <text name="Limit access to this parcel to:"> Доступ на этот участок </text> <text name="Only Allow"> - Ограничить жителям доступ проверкой: + Разрешить доступ только жителям, у которых: </text> - <check_box label="Информация об оплате в файле [ESTATE_PAYMENT_LIMIT]" name="limit_payment" tool_tip="Банить нераспознанных жителей."/> + <check_box label="Записана информация об оплате [ESTATE_PAYMENT_LIMIT]" name="limit_payment" tool_tip="Банить нераспознанных жителей."/> <check_box label="Проверка возраста [ESTATE_AGE_LIMIT]" name="limit_age_verified" tool_tip="Банить жителей, не прошедших проверку возраста. Более подробная информация находится здесь: [SUPPORT_SITE]."/> <check_box label="Разрешить доступ группе: [GROUP]" name="GroupCheck" tool_tip="Группа устанавливается на основной вкладке."/> <check_box label="Продать доступ:" name="PassCheck" tool_tip="Разрешить временный доступ к участку."/> diff --git a/indra/newview/skins/default/xui/ru/floater_avatar.xml b/indra/newview/skins/default/xui/ru/floater_avatar.xml new file mode 100644 index 0000000000..6bdf819880 --- /dev/null +++ b/indra/newview/skins/default/xui/ru/floater_avatar.xml @@ -0,0 +1,2 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes"?> +<floater name="Avatar" title="ВЫБОР АВАТАРА"/> diff --git a/indra/newview/skins/default/xui/ru/floater_bulk_perms.xml b/indra/newview/skins/default/xui/ru/floater_bulk_perms.xml index a497c14cac..ccf13cf02a 100644 --- a/indra/newview/skins/default/xui/ru/floater_bulk_perms.xml +++ b/indra/newview/skins/default/xui/ru/floater_bulk_perms.xml @@ -24,7 +24,7 @@ <button label="√ Все" name="check_all"/> <button label="Очистить" label_selected="Нет" name="check_none"/> <text name="newperms"> - Новые разрешения на использование контента + Новые разрешения на контент </text> <text name="GroupLabel"> Группа: diff --git a/indra/newview/skins/default/xui/ru/floater_buy_currency.xml b/indra/newview/skins/default/xui/ru/floater_buy_currency.xml index 197a2a3327..7d34ca3274 100644 --- a/indra/newview/skins/default/xui/ru/floater_buy_currency.xml +++ b/indra/newview/skins/default/xui/ru/floater_buy_currency.xml @@ -46,7 +46,7 @@ L$ [AMT] </text> <text name="currency_links"> - [http://www.secondlife.com/my/account/payment_method_management.php способ оплаты] | [http://www.secondlife.com/my/account/currency.php валюта] | [http://www.secondlife.com/my/account/exchange_rates.php обменный курс] + [http://www.secondlife.com/my/account/payment_method_management.php способ оплаты] | [http://www.secondlife.com/my/account/currency.php валюта] </text> <text name="exchange_rate_note"> Повторно введите сумму, чтобы увидеть новый обменный курс. @@ -60,7 +60,7 @@ <button label="Приобрести" name="buy_btn"/> <button label="Отмена" name="cancel_btn"/> <text name="info_cannot_buy"> - Невозможно приобрести + Нельзя купить </text> <button label="Продолжить в Интернете" name="error_web"/> </floater> diff --git a/indra/newview/skins/default/xui/ru/floater_camera.xml b/indra/newview/skins/default/xui/ru/floater_camera.xml index 495c5d55fc..945a63c0eb 100644 --- a/indra/newview/skins/default/xui/ru/floater_camera.xml +++ b/indra/newview/skins/default/xui/ru/floater_camera.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> -<floater name="camera_floater"> +<floater name="camera_floater" title="КАМЕРА"> <floater.string name="rotate_tooltip"> Повернуть камеру вокруг точки фокусировки </floater.string> @@ -9,15 +9,6 @@ <floater.string name="move_tooltip"> Переместить камеру вверх, вниз, влево или вправо </floater.string> - <floater.string name="camera_modes_title"> - Режимы камеры - </floater.string> - <floater.string name="pan_mode_title"> - Вращение, приближение, сдвиг - </floater.string> - <floater.string name="presets_mode_title"> - Стандартные настройки - </floater.string> <floater.string name="free_mode_title"> Смотреть на объект </floater.string> diff --git a/indra/newview/skins/default/xui/ru/floater_chat_bar.xml b/indra/newview/skins/default/xui/ru/floater_chat_bar.xml new file mode 100644 index 0000000000..eceab1775a --- /dev/null +++ b/indra/newview/skins/default/xui/ru/floater_chat_bar.xml @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes"?> +<floater name="chat_bar" title="ЛОКАЛЬНЫЙ ЧАТ"> + <panel> + <line_editor label="Щелкните здесь для общения." name="chat_box" tool_tip="Нажмите Enter, чтобы сказать, Ctrl+Enter, чтобы прокричать"/> + <button name="show_nearby_chat" tool_tip="Показать/скрыть лог локального чата"/> + </panel> +</floater> diff --git a/indra/newview/skins/default/xui/ru/floater_color_picker.xml b/indra/newview/skins/default/xui/ru/floater_color_picker.xml index d6e737d584..b7034bef0b 100644 --- a/indra/newview/skins/default/xui/ru/floater_color_picker.xml +++ b/indra/newview/skins/default/xui/ru/floater_color_picker.xml @@ -13,7 +13,7 @@ Оттенок: </text> <text name="s_val_text"> - Насыщенность: + Насыщен.: </text> <text name="l_val_text"> Яркость: diff --git a/indra/newview/skins/default/xui/ru/floater_day_cycle_options.xml b/indra/newview/skins/default/xui/ru/floater_day_cycle_options.xml deleted file mode 100644 index 7c702f246d..0000000000 --- a/indra/newview/skins/default/xui/ru/floater_day_cycle_options.xml +++ /dev/null @@ -1,95 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes"?> -<floater name="Day Cycle Floater" title="РЕДАКТОР СУТОЧНОГО ЦИКЛА"> - <tab_container name="Day Cycle Tabs"> - <panel label="Суточный цикл" name="Day Cycle"> - <multi_slider initial_value="0" name="WLTimeSlider"/> - <multi_slider initial_value="0" name="WLDayCycleKeys"/> - <text name="WL12am"> - 00:00 - </text> - <text name="WL3am"> - 03:00 - </text> - <text name="WL6am"> - 06:00 - </text> - <text name="WL9amHash"> - 09:00 - </text> - <text name="WL12pmHash"> - 12:00 - </text> - <text name="WL3pm"> - 15:00 - </text> - <text name="WL6pm"> - 18:00 - </text> - <text name="WL9pm"> - 21:00 - </text> - <text name="WL12am2"> - 00:00 - </text> - <text name="WL12amHash"> - | - </text> - <text name="WL3amHash"> - I - </text> - <text name="WL6amHash"> - | - </text> - <text name="WL9amHash2"> - I - </text> - <text name="WL12pmHash2"> - | - </text> - <text name="WL3pmHash"> - I - </text> - <text name="WL6pmHash"> - | - </text> - <text name="WL9pmHash"> - I - </text> - <text name="WL12amHash2"> - | - </text> - <button label="Добавить ключ" label_selected="Добавить ключ" name="WLAddKey"/> - <button label="Удалить ключ" label_selected="Удалить ключ" name="WLDeleteKey"/> - <text name="WLCurKeyFrameText"> - Настройки ключевого кадра: - </text> - <text name="WLCurKeyTimeText"> - Ключевое время: - </text> - <spinner label="ч" name="WLCurKeyHour"/> - <spinner label="мин" name="WLCurKeyMin"/> - <text name="WLCurKeyTimeText2"> - Ключевая настройка: - </text> - <combo_box label="Настройка" name="WLKeyPresets"/> - <text name="DayCycleText"> - Привязка: - </text> - <combo_box label="5 мин" name="WLSnapOptions"/> - <text name="DayCycleText2"> - Длительность цикла: - </text> - <spinner label="ч" name="WLLengthOfDayHour"/> - <spinner label="мин" name="WLLengthOfDayMin"/> - <spinner label="с" name="WLLengthOfDaySec"/> - <text name="DayCycleText3"> - Просмотр: - </text> - <button label="Проиграть" label_selected="Проиграть" name="WLAnimSky"/> - <button label="Стоп!" label_selected="Стоп" name="WLStopAnimSky"/> - <button label="Использовать время в землевладении" label_selected="Перейти на время землевладения" name="WLUseLindenTime"/> - <button label="Сохранить тестовый день" label_selected="Сохранить тестовый день" name="WLSaveDayCycle"/> - <button label="Загрузить тестовый день" label_selected="Загрузить тестовый день" name="WLLoadDayCycle"/> - </panel> - </tab_container> -</floater> diff --git a/indra/newview/skins/default/xui/ru/floater_destinations.xml b/indra/newview/skins/default/xui/ru/floater_destinations.xml new file mode 100644 index 0000000000..5ba0841564 --- /dev/null +++ b/indra/newview/skins/default/xui/ru/floater_destinations.xml @@ -0,0 +1,2 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes"?> +<floater name="Destinations" title="ПУНКТЫ"/>
\ No newline at end of file diff --git a/indra/newview/skins/default/xui/ru/floater_edit_day_cycle.xml b/indra/newview/skins/default/xui/ru/floater_edit_day_cycle.xml index 1adc8173c6..61d708c567 100644 --- a/indra/newview/skins/default/xui/ru/floater_edit_day_cycle.xml +++ b/indra/newview/skins/default/xui/ru/floater_edit_day_cycle.xml @@ -16,25 +16,25 @@ -Выбор настройки- </string> <text name="label"> - Название настройки: + Имя настройки: </text> <text name="note"> Примечание. Если изменить имя настройки, будет создана новая настройка, а изменения в существующей не будут сохранены. </text> <text name="hint_item1"> - - Чтобы изменить определенные настройки неба и времени, выберите соответствующую вкладку. + - Для изменения настроек неба и времени выберите соответствующую вкладку. </text> <text name="hint_item2"> - - Чтобы задать время переходов, вабирайте и перетаскивайте вкладки. + - Чтобы задать время переходов, перетаскивайте вкладки. </text> <text name="hint_item3"> - - Используйте скребок для предварительного просмотра суточного цикла. + - Скребок служит для просмотра суточного цикла. </text> <panel name="day_cycle_slider_panel"> <multi_slider initial_value="0" name="WLTimeSlider"/> <multi_slider initial_value="0" name="WLDayCycleKeys"/> - <button label="Добавить отметку" label_selected="Добавить отметку" name="WLAddKey"/> - <button label="Удалить отметку" label_selected="Удалить отметку" name="WLDeleteKey"/> + <button label="+ отметку" label_selected="+ отметку" name="WLAddKey"/> + <button label="- отметку" label_selected="- отметку" name="WLDeleteKey"/> <text name="WL12am"> 12 ночи </text> @@ -91,14 +91,14 @@ </text> </panel> <text name="WLCurKeyPresetText"> - Настройка неба: + Небо: </text> - <combo_box label="Стандартная" name="WLSkyPresets"/> + <combo_box label="Стандарт" name="WLSkyPresets"/> <text name="WLCurKeyTimeText"> Время: </text> <time name="time" value="6:00"/> - <check_box label="Установить в качестве нового суточного цикла" name="make_default_cb"/> + <check_box label="Установить как новый суточный цикл" name="make_default_cb"/> <button label="Сохранить" name="save"/> <button label="Отмена" name="cancel"/> </floater> diff --git a/indra/newview/skins/default/xui/ru/floater_edit_sky_preset.xml b/indra/newview/skins/default/xui/ru/floater_edit_sky_preset.xml index aa60cb6337..354120ea72 100644 --- a/indra/newview/skins/default/xui/ru/floater_edit_sky_preset.xml +++ b/indra/newview/skins/default/xui/ru/floater_edit_sky_preset.xml @@ -19,7 +19,7 @@ Чтобы изменить настройку, задайте ее параметры с помощью элементов управления и нажмите кнопку «Сохранить». </text> <text name="label"> - Название настройки: + Имя настройки: </text> <text name="note"> Примечание. Если изменить имя настройки, будет создана новая настройка, а изменения в существующей не будут сохранены. @@ -58,7 +58,7 @@ <text name="SunGlowText"> Сияние солнца </text> - <slider label="Отчетливость" name="WLGlowB"/> + <slider label="Фокус" name="WLGlowB"/> <slider label="Размер" name="WLGlowR"/> <text name="WLStarText"> Яркость звезд @@ -102,7 +102,7 @@ </text> <time name="WLDayTime" value="6:00"/> <text name="WLEastAngleText"> - Смещение относительно востока + Смещение отн. востока </text> </panel> <panel label="ОБЛАКА" name="Clouds"> @@ -122,7 +122,7 @@ Размеры </text> <text name="WLCloudDetailText"> - Детализация (положение/плотность) + Детали (положение/плотность) </text> <slider label="X" name="WLCloudDetailX"/> <slider label="Y" name="WLCloudDetailY"/> diff --git a/indra/newview/skins/default/xui/ru/floater_edit_water_preset.xml b/indra/newview/skins/default/xui/ru/floater_edit_water_preset.xml index 3befe4b038..f6def86380 100644 --- a/indra/newview/skins/default/xui/ru/floater_edit_water_preset.xml +++ b/indra/newview/skins/default/xui/ru/floater_edit_water_preset.xml @@ -19,7 +19,7 @@ Чтобы изменить настройку, задайте ее параметры с помощью элементов управления и нажмите кнопку «Сохранить». </text> <text name="label"> - Название настройки: + Имя настройки: </text> <text name="note"> Примечание. Если изменить имя настройки, будет создана новая настройка, а изменения в существующей не будут сохранены. diff --git a/indra/newview/skins/default/xui/ru/floater_fast_timers.xml b/indra/newview/skins/default/xui/ru/floater_fast_timers.xml new file mode 100644 index 0000000000..20936b8494 --- /dev/null +++ b/indra/newview/skins/default/xui/ru/floater_fast_timers.xml @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes"?> +<floater name="fast_timers"> + <string name="pause"> + Пауза + </string> + <string name="run"> + Бег + </string> + <button label="Пауза" name="pause_btn"/> +</floater> diff --git a/indra/newview/skins/default/xui/ru/floater_god_tools.xml b/indra/newview/skins/default/xui/ru/floater_god_tools.xml index ec64a5c7af..81329475aa 100644 --- a/indra/newview/skins/default/xui/ru/floater_god_tools.xml +++ b/indra/newview/skins/default/xui/ru/floater_god_tools.xml @@ -72,10 +72,10 @@ </panel> <panel label="Запрос" name="request"> <text name="Destination:"> - Место назначения: + Пункт назначения: </text> <combo_box name="destination"> - <combo_box.item label="назначенное" name="item1"/> + <combo_box.item label="назначенный" name="item1"/> <combo_box.item label="текущий регион" name="item2"/> </combo_box> <text name="Request:"> diff --git a/indra/newview/skins/default/xui/ru/floater_how_to.xml b/indra/newview/skins/default/xui/ru/floater_how_to.xml new file mode 100644 index 0000000000..52525e5d33 --- /dev/null +++ b/indra/newview/skins/default/xui/ru/floater_how_to.xml @@ -0,0 +1,2 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes"?> +<floater name="floater_how_to" title="ПОМОЩЬ"/> diff --git a/indra/newview/skins/default/xui/ru/floater_image_preview.xml b/indra/newview/skins/default/xui/ru/floater_image_preview.xml index ae7c77ea0e..dbc4c32b98 100644 --- a/indra/newview/skins/default/xui/ru/floater_image_preview.xml +++ b/indra/newview/skins/default/xui/ru/floater_image_preview.xml @@ -23,7 +23,7 @@ </combo_box> <text name="bad_image_text"> Невозможно прочитать изображение. -Попробуйте сохранить изображение как 24-разрядный TGA-файл (Targa). +Попробуйте сохранить изображение как 24-битный TGA-файл (Targa). </text> <check_box label="Использовать сжатие без потерь" name="lossless_check"/> <button label="Отмена" name="cancel_btn"/> diff --git a/indra/newview/skins/default/xui/ru/floater_joystick.xml b/indra/newview/skins/default/xui/ru/floater_joystick.xml index 2390789746..66568563da 100644 --- a/indra/newview/skins/default/xui/ru/floater_joystick.xml +++ b/indra/newview/skins/default/xui/ru/floater_joystick.xml @@ -3,14 +3,14 @@ <floater.string name="NoDevice"> устройство не выбрано </floater.string> - <check_box label="Включить джойстик:" name="enable_joystick"/> - <spinner label="Наложение по оси X" name="JoystickAxis1"/> - <spinner label="Наложение по оси Y" name="JoystickAxis2"/> - <spinner label="Наложение по оси Z" name="JoystickAxis0"/> - <spinner label="Наложение уклонов" name="JoystickAxis4"/> - <spinner label="Наложение сгибов" name="JoystickAxis5"/> - <spinner label="Наложение вращения" name="JoystickAxis3"/> - <spinner label="Наложение масштабирования" name="JoystickAxis6"/> + <check_box label="Вкл. джойстик:" name="enable_joystick"/> + <spinner label="Наложение по X" name="JoystickAxis1"/> + <spinner label="Наложение по Y" name="JoystickAxis2"/> + <spinner label="Наложение по Z" name="JoystickAxis0"/> + <spinner label="Н. уклонов" name="JoystickAxis4"/> + <spinner label="Н. сгибов" name="JoystickAxis5"/> + <spinner label="Н. вращения" name="JoystickAxis3"/> + <spinner label="Н. масштабир." name="JoystickAxis6"/> <check_box label="Масштабирование" name="ZoomDirect"/> <check_box label="3D курсор" name="Cursor3D"/> <check_box label="Автоуровень" name="AutoLeveling"/> @@ -18,7 +18,7 @@ Режимы управления: </text> <check_box label="Аватар" name="JoystickAvatarEnabled"/> - <check_box label="Строительство" name="JoystickBuildEnabled"/> + <check_box label="Стройка" name="JoystickBuildEnabled"/> <check_box label="Камера" name="JoystickFlycamEnabled"/> <stat_view label="Монитор джойстика" name="axis_view"> <stat_bar label="Ось 0" name="axis0"/> @@ -56,13 +56,13 @@ Невидимая зона по Z </text> <text name="PitchDeadZone"> - Невидимая зона уклона + Невид. зона уклона </text> <text name="YawDeadZone"> - Невидимая зона сгиба + Невид. зона сгиба </text> <text name="RollDeadZone"> - Невидимая зона вращения + Невид. зона вращения </text> <text name="Feathering"> Размывка краев @@ -71,7 +71,7 @@ Масштаб </text> <text name="ZoomDeadZone"> - Невидимая зона при масштабировании + Невид. зона масшт. </text> <button label="Стандартные значения SpaceNavigator" name="SpaceNavigatorDefaults"/> <button label="OK" label_selected="OK" name="ok_btn"/> diff --git a/indra/newview/skins/default/xui/ru/floater_lagmeter.xml b/indra/newview/skins/default/xui/ru/floater_lagmeter.xml index 48f7dd969f..c420006a03 100644 --- a/indra/newview/skins/default/xui/ru/floater_lagmeter.xml +++ b/indra/newview/skins/default/xui/ru/floater_lagmeter.xml @@ -106,7 +106,7 @@ Возможная причина: слишком много физических объектов </floater.string> <floater.string name="server_scripts_cause_msg"> - Возможная причина: слишком мало физических объектов + Возможная причина: слишком много скриптовых объектов </floater.string> <floater.string name="server_net_cause_msg"> Возможная причина: слишком большой сетевой трафик diff --git a/indra/newview/skins/default/xui/ru/floater_land_holdings.xml b/indra/newview/skins/default/xui/ru/floater_land_holdings.xml index c88c88988b..17d347867d 100644 --- a/indra/newview/skins/default/xui/ru/floater_land_holdings.xml +++ b/indra/newview/skins/default/xui/ru/floater_land_holdings.xml @@ -9,7 +9,7 @@ <scroll_list.columns label="Тип" name="type"/> <scroll_list.columns label="Площадь" name="area"/> </scroll_list> - <button label="Телепортация" label_selected="Телепортация" name="Teleport" tool_tip="Телепортироваться в центр этой земли."/> + <button label="Телепорт" label_selected="Телепорт" name="Teleport" tool_tip="Телепортироваться в центр этой земли."/> <button label="Карта" label_selected="Карта" name="Show on Map" tool_tip="Показать эту землю на карте мира."/> <text name="contrib_label"> Ваши вложения в группы: diff --git a/indra/newview/skins/default/xui/ru/floater_map.xml b/indra/newview/skins/default/xui/ru/floater_map.xml index 169bac5bd2..59ceb0a773 100644 --- a/indra/newview/skins/default/xui/ru/floater_map.xml +++ b/indra/newview/skins/default/xui/ru/floater_map.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> -<floater name="Map" title=""> +<floater name="Map" title="МИНИКАРТА"> <floater.string name="ToolTipMsg"> [REGION](Двойной щелчок открывает карту, shift+перетягивание – обзор) </floater.string> @@ -7,7 +7,7 @@ [REGION](Двойной щелчок – телепортация, shift+перетягивание – обзор) </floater.string> <floater.string name="mini_map_caption"> - МИНИКАРТА + Миникарта </floater.string> <text label="С" name="floater_map_north"> С diff --git a/indra/newview/skins/default/xui/ru/floater_model_preview.xml b/indra/newview/skins/default/xui/ru/floater_model_preview.xml index 53ef685f9e..31517e722d 100644 --- a/indra/newview/skins/default/xui/ru/floater_model_preview.xml +++ b/indra/newview/skins/default/xui/ru/floater_model_preview.xml @@ -1,10 +1,8 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> -<floater name="Model Preview" title="Передать модель"> - <string name="status_idle"> - Неактивно - </string> +<floater name="Model Preview" title="ПЕРЕДАЧА МОДЕЛИ"> + <string name="status_idle"/> <string name="status_parse_error"> - Проблема при анализе файла DAE – см. подробности в журнале. + Ошибка. Проблема при анализе файла DAE – см. подробности в журнале. </string> <string name="status_reading_file"> Загрузка... @@ -51,6 +49,9 @@ <string name="mesh_status_missing_lod"> Отсутствует необходимый уровень детализации. </string> + <string name="mesh_status_invalid_material_list"> + Материалы уровня детализации не входят в эталонную модель. + </string> <string name="layer_all"> Все </string> @@ -63,186 +64,211 @@ <string name="tbd"> Позже </string> - <text name="name_label"> - Название: - </text> - <text name="lod_label"> - Просмотр: - </text> - <combo_box name="preview_lod_combo" tool_tip="Уровень детализации при предварительном просмотре"> - <combo_item name="high"> - Уровень детализации: высокий - </combo_item> - <combo_item name="medium"> - Уровень детализации: средний - </combo_item> - <combo_item name="low"> - Уровень детализации: низкий - </combo_item> - <combo_item name="lowest"> - Уровень детализации: самый низкий - </combo_item> - </combo_box> - <text name="warning_title"> - ВНИМАНИЕ! - </text> - <text name="warning_message"> - Вы не сможете завершить передачу этой модели на серверы Second Life. [[VURL] Узнайте, как] получить право на передачу сеточных моделей. - </text> - <text name="weights_text"> - Загрузка: -Физические данные: -Сервер: -Эквивалент в примитивах: - </text> - <text name="weights"> - [ST] -[PH] -[SIM] -[EQ] - </text> - <tab_container name="import_tab"> - <panel label="Уровень детализации" name="lod_panel"> - <text name="lod_table_header"> - Выберите уровень детализации: - </text> - <text name="high_label" value="высокий"/> - <text name="high_triangles" value="0"/> - <text name="high_vertices" value="0"/> - <text name="medium_label" value="средний"/> - <text name="medium_triangles" value="0"/> - <text name="medium_vertices" value="0"/> - <text name="low_label" value="низкий"/> - <text name="low_triangles" value="0"/> - <text name="low_vertices" value="0"/> - <text name="lowest_label" value="самый низкий"/> - <text name="lowest_triangles" value="0"/> - <text name="lowest_vertices" value="0"/> - <text name="lod_table_footer"> - Уровень детализации: [DETAIL] - </text> - <radio_group name="lod_file_or_limit" value="lod_from_file"> - <radio_item label="Загрузка из файла" name="lod_from_file"/> - <radio_item label="Автосоздание" name="lod_auto_generate"/> - <radio_item label="Нет" name="lod_none"/> - </radio_group> - <button label="Обзор..." name="lod_browse"/> - <combo_box name="lod_mode"> - <combo_item name="triangle_limit"> - Предельное число треугольников - </combo_item> - <combo_item name="error_threshold"> - Порог ошибки - </combo_item> - </combo_box> - <text name="build_operator_text"> - Оператор построения: + <panel name="left_panel"> + <panel name="model_name_representation_panel"> + <text name="name_label"> + Имя модели: </text> - <text name="queue_mode_text"> - Режим очереди: + <text name="model_category_label"> + Эта модель представляет... </text> - <combo_box name="build_operator"> - <combo_item name="edge_collapse"> - Слияние ребер - </combo_item> - <combo_item name="half_edge_collapse"> - Слияние ребер к одной вершине - </combo_item> - </combo_box> - <combo_box name="queue_mode"> - <combo_item name="greedy"> - интенсивный - </combo_item> - <combo_item name="lazy"> - медленный - </combo_item> - <combo_item name="independent"> - независимый - </combo_item> + <combo_box name="model_category_combo"> + <combo_item label="Выберите вариант..." name="Choose one"/> + <combo_item label="Форма аватара" name="Avatar shape"/> + <combo_item label="Присоединение аватара" name="Avatar attachment"/> + <combo_item label="Подвижный объект (машина, животное)" name="Moving object (vehicle, animal)"/> + <combo_item label="Строительный компонент" name="Building Component"/> + <combo_item label="Большая, неподвижная и т.д." name="Large, non moving etc"/> + <combo_item label="Малая, неподвижная и т.д." name="Smaller, non-moving etc"/> + <combo_item label="Ни один из них" name="Not really any of these"/> </combo_box> - <text name="border_mode_text"> - Границы: - </text> - <text name="share_tolderance_text"> - Допуск на совпадение: - </text> - <combo_box name="border_mode"> - <combo_item name="border_unlock"> - нефиксированные - </combo_item> - <combo_item name="border_lock"> - фиксированные - </combo_item> - </combo_box> - <text name="crease_label"> - Угол сгиба: - </text> - <spinner name="crease_angle" value="75"/> </panel> - <panel label="Физика" name="physics_panel"> - <panel name="physics geometry"> - <radio_group name="physics_load_radio" value="physics_load_from_file"> - <radio_item label="Файл:" name="physics_load_from_file"/> - <radio_item label="Использовать уровни детализации:" name="physics_use_lod"/> - </radio_group> - <combo_box name="physics_lod_combo" tool_tip="Уровень детализации для физической формы"> - <combo_item name="physics_lowest"> - самый низкий - </combo_item> - <combo_item name="physics_low"> - низкий - </combo_item> - <combo_item name="physics_medium"> - средний - </combo_item> - <combo_item name="physics_high"> - высокий - </combo_item> - </combo_box> - <button label="Обзор..." name="physics_browse"/> + <tab_container name="import_tab"> + <panel label="Уровень детализации" name="lod_panel" title="Уровень детализации"> + <text initial_value="Источник" name="source" value="Источник"/> + <text initial_value="Треугольники" name="triangles" value="Треугольники"/> + <text initial_value="Вершины" name="vertices" value="Вершины"/> + <text initial_value="Высокий" name="high_label" value="Высокий"/> + <button label="Обзор..." name="lod_browse_high"/> + <text initial_value="0" name="high_triangles" value="0"/> + <text initial_value="0" name="high_vertices" value="0"/> + <text initial_value="Средний" name="medium_label" value="Средний"/> + <button label="Обзор..." name="lod_browse_medium"/> + <text initial_value="0" name="medium_triangles" value="0"/> + <text initial_value="0" name="medium_vertices" value="0"/> + <text initial_value="Низкий" name="low_label" value="Низкий"/> + <button label="Обзор..." name="lod_browse_low"/> + <text initial_value="0" name="low_triangles" value="0"/> + <text initial_value="0" name="low_vertices" value="0"/> + <text initial_value="Самый низкий" name="lowest_label" value="Самый низкий"/> + <button label="Обзор..." name="lod_browse_lowest"/> + <text initial_value="0" name="lowest_triangles" value="0"/> + <text initial_value="0" name="lowest_vertices" value="0"/> + <check_box label="Генерировать нормали" name="gen_normals"/> + <text initial_value="Угол сгиба:" name="crease_label" value="Угол сгиба:"/> + <spinner name="crease_angle" value="75"/> </panel> - <panel name="physics analysis"> - <slider label="Гладкость:" name="Smooth"/> - <check_box label="Закрыть отверстия (медленно)" name="Close Holes (Slow)"/> - <button label="Анализ" name="Decompose"/> - <button label="Отмена" name="decompose_cancel"/> + <panel label="Физика" name="physics_panel"> + <panel name="physics geometry"> + <text name="first_step_name"> + Шаг 1. Уровень детализации + </text> + <combo_box name="physics_lod_combo" tool_tip="Уровень детализации для физической формы"> + <combo_item name="choose_one"> + Выберите вариант... + </combo_item> + <combo_item name="physics_high"> + Высокое + </combo_item> + <combo_item name="physics_medium"> + Средний + </combo_item> + <combo_item name="physics_low"> + Низкий + </combo_item> + <combo_item name="physics_lowest"> + Самый низкий + </combo_item> + <combo_item name="load_from_file"> + Из файла + </combo_item> + </combo_box> + <button label="Обзор..." name="physics_browse"/> + </panel> + <panel name="physics analysis"> + <text name="method_label"> + Шаг 2. Анализ + </text> + <text name="analysis_method_label"> + Метод: + </text> + <text name="quality_label"> + Качество: + </text> + <text name="smooth_method_label"> + Гладкость: + </text> + <check_box label="Закрыть отверстия" name="Close Holes (Slow)"/> + <button label="Анализ" name="Decompose"/> + <button label="Отмена" name="decompose_cancel"/> + </panel> + <panel name="physics simplification"> + <text name="second_step_label"> + Шаг 3. Упрощение + </text> + <text name="simp_method_header"> + Метод: + </text> + <text name="pass_method_header"> + Проходов: + </text> + <text name="Detail Scale label"> + Масштаб деталей: + </text> + <text name="Retain%_label"> + Сохранять: + </text> + <combo_box name="Combine Quality" value="1"/> + <button label="Упрощение" name="Simplify"/> + <button label="Отмена" name="simplify_cancel"/> + </panel> + <panel name="physics info"> + <text name="results_text"> + Результаты: + </text> + <text name="physics_triangles"> + Треугольников: [TRIANGLES], + </text> + <text name="physics_points"> + Вершин: [POINTS], + </text> + <text name="physics_hulls"> + Оболочек: [HULLS] + </text> + </panel> </panel> - <panel name="physics simplification"> - <slider label="Проходов:" name="Combine Quality"/> - <slider label="Масштаб деталей:" name="Detail Scale"/> - <slider label="Сохранять:" name="Retain%"/> - <button label="Упрощение" name="Simplify"/> - <button label="Отмена" name="simplify_cancel"/> - </panel> - <panel name="physics info"> - <slider label="Просмотр разложения:" name="physics_explode"/> - <text name="physics_triangles"> - Треугольников: [TRIANGLES] + <panel label="Параметры передачи" name="modifiers_panel"> + <text name="scale_label"> + Масштаб (1=не масштабировать): + </text> + <spinner name="import_scale" value="1.0"/> + <text name="dimensions_label"> + Размеры: </text> - <text name="physics_points"> - Вершин: [POINTS] + <text name="import_dimensions"> + [X] X [Y] X [Z] </text> - <text name="physics_hulls"> - Оболочек: [HULLS] + <check_box label="Включить текстуры" name="upload_textures"/> + <text name="include_label"> + Только для моделей аватаров: </text> + <check_box label="Включить вес кожи" name="upload_skin"/> + <check_box label="Включить положения суставов" name="upload_joints"/> + <text name="pelvis_offset_label"> + Смещение по Z (поднять или опустить аватар): + </text> + <spinner name="pelvis_offset" value="0.0"/> </panel> - </panel> - <panel label="Модификаторы" name="modifiers_panel"> - <spinner name="import_scale" value="1.0"/> - <text name="import_dimensions"> - [X] x [Y] x [Z] м + </tab_container> + <panel name="weights_and_warning_panel"> + <button label="Рассчитать вес и плату" name="calculate_btn" tool_tip="Рассчитать вес и плату"/> + <button label="Отмена" name="cancel_btn"/> + <button label="Передать" name="ok_btn" tool_tip="Передать в симулятор"/> + <button label="Очистить настройки и сбросить форму" name="reset_btn"/> + <text name="upload_fee"> + Плата за передачу: L$ [FEE] + </text> + <text name="prim_weight"> + Влияние земли: [EQ] + </text> + <text name="download_weight"> + Загрузка: [ST] + </text> + <text name="physics_weight"> + Физика: [PH] + </text> + <text name="server_weight"> + Сервер: [SIM] + </text> + <text name="warning_title"> + ПРИМЕЧАНИЕ. + </text> + <text name="warning_message"> + У вас нет прав на передачу сеточных моделей. [[VURL] Узнайте, как] получить их. + </text> + <text name="status"> + [STATUS] </text> - <check_box label="Текстуры" name="upload_textures"/> - <check_box label="Вес кожи" name="upload_skin"/> - <check_box label="Положение сочленений" name="upload_joints"/> - <spinner name="pelvis_offset" value="0.0"/> </panel> - </tab_container> - <text name="upload_fee"> - Плата за передачу: L$ [FEE] + </panel> + <text name="lod_label"> + Просмотр: </text> - <button label="По умолчанию" name="reset_btn" tool_tip="По умолчанию"/> - <button label="Рассчитать вес и плату" name="calculate_btn" tool_tip="Рассчитать вес и плату"/> - <button label="Передача" name="ok_btn" tool_tip="Передать в симулятор"/> - <button label="Отмена" name="cancel_btn"/> + <panel name="right_panel"> + <combo_box name="preview_lod_combo" tool_tip="Уровень детализации при предварительном просмотре"> + <combo_item name="high"> + Высокий + </combo_item> + <combo_item name="medium"> + Среднее + </combo_item> + <combo_item name="low"> + Низкий + </combo_item> + <combo_item name="lowest"> + Самый низкий + </combo_item> + </combo_box> + <text name="label_display"> + Показать... + </text> + <check_box label="Ребра" name="show_edges"/> + <check_box label="Физика" name="show_physics"/> + <check_box label="Текстуры" name="show_textures"/> + <check_box label="Вес кожи" name="show_skin_weight"/> + <check_box label="Суставы" name="show_joint_positions"/> + <text name="physics_explode_label"> + Просмотр разложения: + </text> + </panel> </floater> diff --git a/indra/newview/skins/default/xui/ru/floater_model_wizard.xml b/indra/newview/skins/default/xui/ru/floater_model_wizard.xml index 9b2924a3db..ef2fe8e5a5 100644 --- a/indra/newview/skins/default/xui/ru/floater_model_wizard.xml +++ b/indra/newview/skins/default/xui/ru/floater_model_wizard.xml @@ -6,26 +6,20 @@ <button label="2. Оптимизировать" name="optimize_btn"/> <button label="1. Выбрать файл" name="choose_file_btn"/> <panel name="choose_file_panel"> - <panel name="choose_file_header_panel"> - <text name="choose_file_header_text"> - Выберите файл + <panel name="header_panel"> + <text name="header_text"> + Выберите файл модели </text> </panel> - <panel name="choose_file_content_panel"> + <panel name="content"> <text name="advanced_users_text"> - Пользователям, работающим в расширенном режиме: если вы умеете создавать трехмерные графические объекты, то, возможно, захотите воспользоваться средством Advanced Uploader, которое предоставляет расширенные возможности передачи объектов. + Пользователям в расширенном режиме: если вы умеете создавать трехмерные графические объекты, то, возможно, захотите воспользоваться средством Advanced Uploader, которое предоставляет расширенные возможности передачи объектов. </text> <button label="Перейти в расширенный режим" name="switch_to_advanced"/> - <text name="choose_model_file_label"> + <text name="Cache location"> Выберите файл модели для передачи </text> <button label="Обзор..." label_selected="Обзор..." name="browse"/> - <text name="support_collada_text"> - В Second Life поддерживаются файлы COLLADA (DAE) - </text> - <text name="dimensions_label"> - Размеры (в метрах): - </text> <text name="dimensions"> X Y Z </text> @@ -38,18 +32,15 @@ </panel> </panel> <panel name="optimize_panel"> - <panel name="optimize_header_panel"> - <text name="optimize_header_text"> + <panel name="header_panel"> + <text name="header_text"> Оптимизировать модель </text> </panel> - <text name="optimize_hint"> + <text name="description"> Мы оптимизировали модель для повышения быстродействия. По желанию можно выполнить дополнительную настройку. </text> - <panel name="optimize_content_panel"> - <text name="generating_lod_label"> - Создается уровень детализации - </text> + <panel name="content"> <text name="high_detail_text"> Создать уровень детализации: высокий </text> @@ -64,123 +55,64 @@ </text> </panel> <panel name="content2"> - <text name="optimize_performance_text"> - Быстродействие - </text> - <text name="optimize_faster_rendering_text"> - Ускорить прорисовку -Меньше деталей -Уменьшить вес примитива - </text> - <text name="optimize_accuracy_text"> - Точность - </text> - <text name="optimize_slower_rendering_text"> - Замедлить прорисовку -Больше деталей -Повысить вес примитива - </text> - <text name="accuracy_slider_mark1"> - ' - </text> - <text name="accuracy_slider_mark2"> - ' - </text> - <text name="accuracy_slider_mark3"> - ' - </text> <button label="Пересчитать геометрию" name="recalculate_geometry_btn"/> - <text name="geometry_preview_label"> + <text name="lod_label"> Просмотр геометрии </text> <combo_box name="preview_lod_combo" tool_tip="Детализация при предварительном просмотре"> - <combo_item name="preview_lod_high"> + <combo_item name="high"> Детально </combo_item> - <combo_item name="preview_lod_medium"> + <combo_item name="medium"> Средняя детализация </combo_item> - <combo_item name="preview_lod_low"> + <combo_item name="low"> Мало деталей </combo_item> - <combo_item name="preview_lod_lowest"> + <combo_item name="lowest"> Минимум деталей </combo_item> </combo_box> </panel> </panel> <panel name="physics_panel"> - <panel name="physics_header_panel"> - <text name="physics_header_text"> - Настроить физические параметры + <panel name="header_panel"> + <text name="header_text"> + Настроить физику </text> </panel> - <text name="physics_hint"> + <text name="description"> Мы создадим форму для внешнего каркаса модели. Настройте уровень детализации формы в соответствии с целями, для которых предназначена модель. </text> - <panel name="physics_content_panel"> - <text name="physics_performance_text"> - Быстродействие - </text> - <text name="physics_faster_rendering_text"> - Ускорить прорисовку -Меньше деталей -Уменьшить вес примитива - </text> - <text name="physics_accuracy_text"> - Точность - </text> - <text name="physics_slower_dendering_text"> - Замедлить прорисовку -Больше деталей -Повысить вес примитива - </text> - <text name="physics_example_1"> - Примеры: -подвижные объекты; -летающие объекты; -транспорт. - </text> - <text name="physics_example_2"> - Примеры: -небольшие неподвижные объекты; -простые объекты; -простая мебель. - </text> - <text name="physics_example_3"> - Примеры: -неподвижные объекты; -сложные объекты; -здания. - </text> - <button label="Пересчитать физические данные" name="recalculate_physics_btn"/> + <panel name="content"> + <button label="Пересчитать физику" name="recalculate_physics_btn"/> <button label="Пересчет..." name="recalculating_physics_btn"/> - <text name="physics_preview_label"> - Просмотр физических данных + <text name="lod_label"> + Просмотр физики </text> - <combo_box name="preview_lod_combo2" tool_tip="Детализация при предварительном просмотре"> - <combo_item name="preview_lod2_high"> + <combo_box name="preview_lod_combo2" tool_tip="Уровень детализации при предварительном просмотре"> + <combo_item name="high"> Детально </combo_item> - <combo_item name="preview_lod2_medium"> + <combo_item name="medium"> Средняя детализация </combo_item> - <combo_item name="preview_lod2_low"> + <combo_item name="low"> Мало деталей </combo_item> - <combo_item name="preview_lod2_lowest"> + <combo_item name="lowest"> Минимум деталей </combo_item> </combo_box> </panel> </panel> <panel name="review_panel"> - <panel name="review_header_panel"> - <text name="review_header_text"> - Пересмотреть + <panel name="header_panel"> + <text name="header_text"> + Просмотр </text> </panel> - <panel name="review_content_panel"> + <panel name="content"> <text name="review_prim_equiv"> Воздействие на участок/регион: эквивалент в примитивах: [EQUIV] </text> @@ -193,8 +125,8 @@ </panel> </panel> <panel name="upload_panel"> - <panel name="upload_header_panel"> - <text name="upload_header_text"> + <panel name="header_panel"> + <text name="header_text"> Передача завершена </text> </panel> diff --git a/indra/newview/skins/default/xui/ru/floater_moveview.xml b/indra/newview/skins/default/xui/ru/floater_moveview.xml index c6ef4a06b3..6e01f997e1 100644 --- a/indra/newview/skins/default/xui/ru/floater_moveview.xml +++ b/indra/newview/skins/default/xui/ru/floater_moveview.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> -<floater name="move_floater"> +<floater name="move_floater" title="ПЕРЕМЕЩЕНИЕ"> <string name="walk_forward_tooltip"> Идти вперед (нажмите стрелку вверх или клавишу W) </string> diff --git a/indra/newview/skins/default/xui/ru/floater_my_appearance.xml b/indra/newview/skins/default/xui/ru/floater_my_appearance.xml new file mode 100644 index 0000000000..b90d80f3fd --- /dev/null +++ b/indra/newview/skins/default/xui/ru/floater_my_appearance.xml @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes"?> +<floater name="floater_my_appearance" title="ВНЕШНОСТЬ"> + <panel label="Изменить внешний вид" name="main_panel"/> +</floater> diff --git a/indra/newview/skins/default/xui/ru/floater_my_inventory.xml b/indra/newview/skins/default/xui/ru/floater_my_inventory.xml new file mode 100644 index 0000000000..534d2a5774 --- /dev/null +++ b/indra/newview/skins/default/xui/ru/floater_my_inventory.xml @@ -0,0 +1,2 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes"?> +<floater name="floater_my_inventory" title="ИНВЕНТАРЬ"/> diff --git a/indra/newview/skins/default/xui/ru/floater_nearby_chat.xml b/indra/newview/skins/default/xui/ru/floater_nearby_chat.xml index fd3c9f3512..184c753e40 100644 --- a/indra/newview/skins/default/xui/ru/floater_nearby_chat.xml +++ b/indra/newview/skins/default/xui/ru/floater_nearby_chat.xml @@ -1,4 +1,4 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <floater name="nearby_chat" title="ЛОКАЛЬНЫЙ ЧАТ"> - <check_box label="Перевод чата (используется Google)" name="translate_chat_checkbox"/> + <check_box label="Перевод чата" name="translate_chat_checkbox"/> </floater> diff --git a/indra/newview/skins/default/xui/ru/floater_object_weights.xml b/indra/newview/skins/default/xui/ru/floater_object_weights.xml new file mode 100644 index 0000000000..41e0118732 --- /dev/null +++ b/indra/newview/skins/default/xui/ru/floater_object_weights.xml @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes"?> +<floater name="object_weights" title="ДОПОЛНИТЕЛЬНО"> + <floater.string name="nothing_selected" value="--"/> + <text name="selected_text" value="ВЫБРАНО"/> + <text name="objects" value="--"/> + <text name="objects_label" value="Объекты"/> + <text name="prims" value="--"/> + <text name="prims_label" value="Примитивы"/> + <text name="weights_of_selected_text" value="ВЕС ВЫБРАННОГО"/> + <text name="download" value="--"/> + <text name="download_label" value="Загрузить"/> + <text name="physics" value="--"/> + <text name="physics_label" value="Физика"/> + <text name="server" value="--"/> + <text name="server_label" value="Сервер"/> + <text name="display" value="--"/> + <text name="display_label" value="Показать"/> + <text name="land_impacts_text" value="ВОЗДЕЙСТВИЕ НА ЗЕМЛЮ"/> + <text name="selected" value="--"/> + <text name="selected_label" value="Выбрано"/> + <text name="rezzed_on_land" value="--"/> + <text name="rezzed_on_land_label" value="Выложено на землю"/> + <text name="remaining_capacity" value="--"/> + <text name="remaining_capacity_label" value="Остаток емкости"/> + <text name="total_capacity" value="--"/> + <text name="total_capacity_label" value="Общая емкость"/> + <text name="help_SLURL" value="[secondlife:///app/help/object_weights Что это такое?...]"/> +</floater> diff --git a/indra/newview/skins/default/xui/ru/floater_outfit_save_as.xml b/indra/newview/skins/default/xui/ru/floater_outfit_save_as.xml index 781ee8c771..301206e473 100644 --- a/indra/newview/skins/default/xui/ru/floater_outfit_save_as.xml +++ b/indra/newview/skins/default/xui/ru/floater_outfit_save_as.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> -<floater name="modal container" title="Сохранение костюма"> +<floater name="modal container" title="СОХРАНИТЬ КОСТЮМ"> <button label="Сохранить" label_selected="Сохранить" name="Save"/> <button label="Отмена" label_selected="Отмена" name="Cancel"/> <text name="Save item as:"> diff --git a/indra/newview/skins/default/xui/ru/floater_people.xml b/indra/newview/skins/default/xui/ru/floater_people.xml new file mode 100644 index 0000000000..7abc34986a --- /dev/null +++ b/indra/newview/skins/default/xui/ru/floater_people.xml @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes"?> +<floater name="floater_people" title="ЛЮДИ"> + <panel_container name="main_panel"> + <panel label="Профиль группы" name="panel_group_info_sidetray"/> + <panel label="Черный список жителей и объектов" name="panel_block_list_sidetray"/> + </panel_container> +</floater> diff --git a/indra/newview/skins/default/xui/ru/floater_picks.xml b/indra/newview/skins/default/xui/ru/floater_picks.xml new file mode 100644 index 0000000000..e0ae8d6f03 --- /dev/null +++ b/indra/newview/skins/default/xui/ru/floater_picks.xml @@ -0,0 +1,2 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes"?> +<floater name="floater_picks" title="Подборка"/> diff --git a/indra/newview/skins/default/xui/ru/floater_places.xml b/indra/newview/skins/default/xui/ru/floater_places.xml new file mode 100644 index 0000000000..2a22a855ef --- /dev/null +++ b/indra/newview/skins/default/xui/ru/floater_places.xml @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes"?> +<floater name="floater_places" title="МЕСТА"> + <panel label="Места" name="main_panel"/> +</floater> diff --git a/indra/newview/skins/default/xui/ru/floater_preferences.xml b/indra/newview/skins/default/xui/ru/floater_preferences.xml index 31c751250e..fc244b9d8b 100644 --- a/indra/newview/skins/default/xui/ru/floater_preferences.xml +++ b/indra/newview/skins/default/xui/ru/floater_preferences.xml @@ -11,7 +11,7 @@ <panel label="Уведомления" name="msgs"/> <panel label="Цвета" name="colors"/> <panel label="Приватность" name="im"/> - <panel label="Настройка" name="input"/> - <panel label="Расширенный" name="advanced1"/> + <panel label="Конфигурация" name="input"/> + <panel label="Дополнительно" name="advanced1"/> </tab_container> </floater> diff --git a/indra/newview/skins/default/xui/ru/floater_select_key.xml b/indra/newview/skins/default/xui/ru/floater_select_key.xml index 84cc4a3ef3..99c2b9a2c4 100644 --- a/indra/newview/skins/default/xui/ru/floater_select_key.xml +++ b/indra/newview/skins/default/xui/ru/floater_select_key.xml @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <floater name="modal container"> <text name="Save item as:"> - Нажмите кнопку для установки триггера включения разговора. + Нажмите клавишу для включения/выключения речи. </text> <button label="Отмена" label_selected="Отмена" name="Cancel"/> </floater> diff --git a/indra/newview/skins/default/xui/ru/floater_snapshot.xml b/indra/newview/skins/default/xui/ru/floater_snapshot.xml index a3b40a4f1c..f85d602be7 100644 --- a/indra/newview/skins/default/xui/ru/floater_snapshot.xml +++ b/indra/newview/skins/default/xui/ru/floater_snapshot.xml @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <floater name="Snapshot" title="ПРОСМОТР СНИМКА"> <floater.string name="unknown"> - неизвестен + неизвестно </floater.string> <radio_group label="Тип снимка" name="snapshot_type_radio"> <radio_item label="Электронная почта" name="postcard"/> diff --git a/indra/newview/skins/default/xui/ru/floater_sound_devices.xml b/indra/newview/skins/default/xui/ru/floater_sound_devices.xml index 809cea5aa1..fc8de858cd 100644 --- a/indra/newview/skins/default/xui/ru/floater_sound_devices.xml +++ b/indra/newview/skins/default/xui/ru/floater_sound_devices.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> -<floater name="floater_sound_devices" title="Звуковые устройства"> +<floater name="floater_sound_devices" title="ЗВУКОВЫЕ УСТРОЙСТВА"> <text name="voice_label"> Голосовой чат </text> diff --git a/indra/newview/skins/default/xui/ru/floater_stats.xml b/indra/newview/skins/default/xui/ru/floater_stats.xml index c5cccd4091..b1f60c8029 100644 --- a/indra/newview/skins/default/xui/ru/floater_stats.xml +++ b/indra/newview/skins/default/xui/ru/floater_stats.xml @@ -10,8 +10,8 @@ </stat_view> <stat_view label="Дополнительно" name="advanced"> <stat_view label="Отрисовка" name="render"> - <stat_bar label="Треугольников за секунду" name="ktrisframe"/> - <stat_bar label="Треугольников за секунду" name="ktrissec"/> + <stat_bar label="Треугольников на кадр" name="ktrisframe"/> + <stat_bar label="Треугольников в секунду" name="ktrissec"/> <stat_bar label="Всего объектов" name="objs"/> <stat_bar label="Новых объектов" name="newobjs"/> </stat_view> @@ -32,7 +32,7 @@ <stat_bar label="Слои" name="layerskbitstat"/> <stat_bar label="Действительный ввод" name="actualinkbitstat"/> <stat_bar label="Действительный вывод" name="actualoutkbitstat"/> - <stat_bar label="Ожидающие оп-ции VFS" name="vfspendingoperations"/> + <stat_bar label="Ожидающие операции VFS" name="vfspendingoperations"/> </stat_view> </stat_view> <stat_view label="Симулятор" name="sim"> @@ -64,6 +64,14 @@ <stat_bar label="Время на клиент" name="simagentmsec"/> <stat_bar label="Время на изображения" name="simimagesmsec"/> <stat_bar label="Время на скрипт" name="simscriptmsec"/> + <stat_bar label="Резервное время" name="simsparemsec"/> + <stat_view label="Данные времени (мс)" name="timedetails"> + <stat_bar label="Шаг физики" name="simsimphysicsstepmsec"/> + <stat_bar label="Обновить физ. формы" name="simsimphysicsshapeupdatemsec"/> + <stat_bar label="Физика - прочее" name="simsimphysicsothermsec"/> + <stat_bar label="Время сна" name="simsleepmsec"/> + <stat_bar label="Ввод/вывод" name="simpumpiomsec"/> + </stat_view> </stat_view> </stat_view> </container_view> diff --git a/indra/newview/skins/default/xui/ru/floater_tools.xml b/indra/newview/skins/default/xui/ru/floater_tools.xml index 7200ec80fa..eb9083f7fc 100644 --- a/indra/newview/skins/default/xui/ru/floater_tools.xml +++ b/indra/newview/skins/default/xui/ru/floater_tools.xml @@ -1,42 +1,42 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <floater name="toolbox floater" short_title="ИНСТРУМЕНТЫ ДЛЯ СТРОИТЕЛЬСТВА"> <floater.string name="status_rotate"> - Перемещайте цветные полосы для вращения объекта + Перетягивайте цветные полосы для вращения объекта </floater.string> <floater.string name="status_scale"> - Щелкните и переместите для растяжения выбранной стороны + Щелкните и перетащите для растяжения выбранной стороны </floater.string> <floater.string name="status_move"> - Переместите для перемещения, переместите с одновременным нажатием клавиши Shift для копирования + Перемещение: перетащить, копирование: перетащить при нажатой клавише Shift </floater.string> <floater.string name="status_modifyland"> Щелкните и удерживайте для изменения земли </floater.string> <floater.string name="status_camera"> - Щелкните и переместите для перемещения камеры + Щелкните и перетащите для перемещения камеры </floater.string> <floater.string name="status_grab"> - Переместите для перемещения, нажмите клавишу Ctrl для подъема, нажмите клавиши Ctrl+Shift для вращения + Перемещение: перетащить, подъем: нажать Ctrl, вращение: нажать Ctrl+Shift </floater.string> <floater.string name="status_place"> Щелкните для создания </floater.string> <floater.string name="status_selectland"> - Щелкните и переместите для выделения земли + Щелкните и перетащите для выделения земли </floater.string> <floater.string name="status_selectcount"> - Выбрано объектов: [OBJ_COUNT] (примитивов: [PRIM_COUNT] [PE_STRING]) + Выбрано объектов: [OBJ_COUNT], влияние на землю [LAND_IMPACT] </floater.string> - <floater.string name="status_selectprimequiv"> - , в примитивах: [SEL_WEIGHT] + <floater.string name="status_remaining_capacity"> + Остаток емкости [LAND_CAPACITY]. </floater.string> - <button name="button focus" tool_tip="Отчетливость"/> + <button name="button focus" tool_tip="Фокус"/> <button name="button move" tool_tip="Переместить"/> <button name="button edit" tool_tip="Изменить"/> <button name="button create" tool_tip="Создать"/> <button name="button land" tool_tip="Земля"/> <text name="text status"> - Переместите для перемещения, переместите с одновременным нажатием клавиши Shift для копирования + Перемещение: перетащить, копирование: перетащить при нажатой клавише Shift </text> <radio_group name="focus_radio_group"> <radio_item label="Увеличение" name="radio zoom"/> @@ -52,14 +52,14 @@ <radio_group name="edit_radio_group"> <radio_item label="Переместить" name="radio position"/> <radio_item label="Вращение (Ctrl)" name="radio rotate"/> - <radio_item label="Растягивание (Ctrl+Shift)" name="radio stretch"/> + <radio_item label="Растяжка (Ctrl+Shift)" name="radio stretch"/> <radio_item label="Выбор грани" name="radio select face"/> </radio_group> <check_box label="Редактировать объединенные" name="checkbox edit linked parts"/> <button label="Объединить" name="link_btn"/> <button label="Разъединить" name="unlink_btn"/> - <text label="Растягивать в обе стороны" name="checkbox uniform label"> - Растягивать в обе стороны + <text label="Растяжка обеих сторон" name="checkbox uniform label"> + Растяжка обеих сторон </text> <check_box initial_value="истина" label="Растягивать текстуры" name="checkbox stretch textures"/> <check_box initial_value="истина" label="Привязка" name="checkbox snap to grid"/> @@ -79,9 +79,9 @@ <button name="ToolRing" tool_tip="Кольцо"/> <button name="ToolTree" tool_tip="Дерево"/> <button name="ToolGrass" tool_tip="Трава"/> - <check_box label="Оставить инструмент выбранным" name="checkbox sticky"/> - <check_box label="Копировать выделенное" name="checkbox copy selection"/> - <check_box initial_value="истина" label="Центрировать копию" name="checkbox copy centers"/> + <check_box label="Держать инструмент" name="checkbox sticky"/> + <check_box label="Копировать выдел." name="checkbox copy selection"/> + <check_box initial_value="истина" label="Центрир. копию" name="checkbox copy centers"/> <check_box label="Повернуть копию" name="checkbox copy rotates"/> <radio_group name="land_radio_group"> <radio_item label="Выбрать землю" name="radio select land"/> @@ -105,10 +105,10 @@ <slider_bar initial_value="0.00" name="slider force"/> <button label="Применить" label_selected="Применить" name="button apply to selection" tool_tip="Изменить выбранную землю"/> <text name="selection_empty"> - Ничего не выбрано. + Не выбрано. </text> - <text name="selection_weight"> - Вес физических параметров [PHYS_WEIGHT], стоимость прорисовки [DISP_WEIGHT]. + <text name="remaining_capacity"> + [CAPACITY_STRING] [secondlife:///app/openfloater/object_weights Дополнительная информация] </text> <tab_container name="Object Info Tabs"> <panel label="Общие" name="General"> @@ -168,7 +168,7 @@ <check_box label="Поделиться" name="checkbox share with group" tool_tip="Позволить всем участникам выбранной группы получить установленные вам права на этот объект. Для включения ролевых ограничений необходимо произвести сделку."/> <button label="Сделка" label_selected="Сделка" name="button deed" tool_tip="В результате сделки объект передается группе, при этом права на него будут соответствовать правам следующего владельца. Переданный группе объект может передаваться должностным лицом группы."/> <text name="label click action"> - Действие по щелчку: + По щелчку: </text> <combo_box name="clickaction"> <combo_box.item label="Коснуться (по умолчанию)" name="Touch/grab(default)"/> @@ -185,7 +185,7 @@ <combo_box.item label="Оригинал" name="Original"/> </combo_box> <spinner label="Цена: L$" name="Edit Cost"/> - <check_box label="Показать в результатах поиска" name="search_check" tool_tip="Показывать объект в результатах поиска"/> + <check_box label="Показать в поиске" name="search_check" tool_tip="Показывать объект в результатах поиска"/> <panel name="perms_build"> <text name="perm_modify"> Этот объект можно изменять @@ -321,7 +321,6 @@ Тип стыковки </text> <combo_box name="sculpt type control"> - <combo_box.item label="(нет)" name="None"/> <combo_box.item label="По сфере" name="Sphere"/> <combo_box.item label="По тору" name="Torus"/> <combo_box.item label="По плоскости" name="Plane"/> @@ -350,9 +349,9 @@ <spinner label="Парусность" name="FlexFriction"/> <spinner label="Ветер" name="FlexWind"/> <spinner label="Упругость" name="FlexTension"/> - <spinner label="Действие по X" name="FlexForceX"/> - <spinner label="Действие по Y" name="FlexForceY"/> - <spinner label="Действие по Z" name="FlexForceZ"/> + <spinner label="X-действие" name="FlexForceX"/> + <spinner label="Y-действие" name="FlexForceY"/> + <spinner label="Z-действие" name="FlexForceZ"/> <check_box label="Свет" name="Light Checkbox Ctrl" tool_tip="Объект будет излучать свет"/> <color_swatch name="colorswatch" tool_tip="Щелкните для выбора цвета"/> <texture_picker label="" name="light texture control" tool_tip="Щелкните для выбора проецируемого изображения (действует только с включенной отложенной отрисовкой)"/> @@ -363,7 +362,7 @@ <spinner label="Ослабление" name="Light Falloff"/> <spinner label="Окружение" name="Light Ambiance"/> <text name="label physicsshapetype"> - Тип физической формы: + Тип физич. формы: </text> <combo_box name="Physics Shape Type Combo Ctrl" tool_tip="Выберите тип физической формы"/> <combo_box name="material"> @@ -395,7 +394,7 @@ <text name="glow label"> Свечение </text> - <check_box label="Собственная яркость" name="checkbox fullbright"/> + <check_box label="Собств. яркость" name="checkbox fullbright"/> <text name="tex gen"> Наложение </text> @@ -477,7 +476,7 @@ Площадь: [AREA] м² </text> <button label="О земле" label_selected="О земле" name="button about land"/> - <check_box label="Показать владельцев" name="checkbox show owners" tool_tip="Цвет участка в зависимости от типа владения: зеленый = ваша земля голубой = земля вашей группы красный = чужая земля желтый = для продажи фиолетовый = для аукциона серый = общая"/> + <check_box label="Показать владельцев" name="checkbox show owners" tool_tip="Цвет участка в зависимости от типа владения: зеленый = ваша земля; голубой = земля вашей группы; красный = чужая земля; желтый = для продажи; фиолетовый = для аукциона; серый = общая"/> <text name="label_parcel_modify"> Изменение участка </text> diff --git a/indra/newview/skins/default/xui/ru/floater_toybox.xml b/indra/newview/skins/default/xui/ru/floater_toybox.xml new file mode 100644 index 0000000000..8d7431d393 --- /dev/null +++ b/indra/newview/skins/default/xui/ru/floater_toybox.xml @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes"?> +<floater name="Toybox" title="НАСТРОИТЬ ПАНЕЛИ ИНСТРУМЕНТОВ"> + <text name="toybox label 1"> + Добавьте или удалите кнопки, перетягивая их на панели инструментов или с них. + </text> + <text name="toybox label 2"> + Кнопки будут отображены в исходном виде или в виде значков, в зависимости от настроек каждой панели инструментов. + </text> + <button label="Вернуть стандартные" label_selected="Вернуть стандартные" name="btn_restore_defaults"/> +</floater> diff --git a/indra/newview/skins/default/xui/ru/floater_voice_controls.xml b/indra/newview/skins/default/xui/ru/floater_voice_controls.xml index 9fd6518984..c1fb858d48 100644 --- a/indra/newview/skins/default/xui/ru/floater_voice_controls.xml +++ b/indra/newview/skins/default/xui/ru/floater_voice_controls.xml @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> -<floater name="floater_voice_controls" title="Управление голосом"> +<floater name="floater_voice_controls" title="УПРАВЛЕНИЕ ГОЛОСОМ"> <string name="title_nearby"> - ЛОКАЛЬНЫЙ ГОЛОСОВОЙ ЧАТ + Настройки голоса </string> <string name="title_group"> Звонок группе [GROUP] diff --git a/indra/newview/skins/default/xui/ru/floater_windlight_options.xml b/indra/newview/skins/default/xui/ru/floater_windlight_options.xml index 6667e6b19a..bbb37aaaa0 100644 --- a/indra/newview/skins/default/xui/ru/floater_windlight_options.xml +++ b/indra/newview/skins/default/xui/ru/floater_windlight_options.xml @@ -98,7 +98,7 @@ <text name="SunGlowText"> Сияние солнца </text> - <slider label="Отчетливость" name="WLGlowB"/> + <slider label="Фокус" name="WLGlowB"/> <slider label="Размер" name="WLGlowR"/> <text name="SceneGammaText"> Гамма-коррекция сцены diff --git a/indra/newview/skins/default/xui/ru/floater_world_map.xml b/indra/newview/skins/default/xui/ru/floater_world_map.xml index 5fa45bd5e5..ef8dfe22ae 100644 --- a/indra/newview/skins/default/xui/ru/floater_world_map.xml +++ b/indra/newview/skins/default/xui/ru/floater_world_map.xml @@ -37,7 +37,7 @@ </text> <check_box initial_value="истина" name="events_mature_chk"/> <text name="events_mature_label"> - Умеренный + Умеренные </text> <text name="events_adult_label"> Для взрослых @@ -62,7 +62,7 @@ Место: </text> <button label="Телепортация" name="Teleport" tool_tip="Телепортация в выбранное место"/> - <button label="Копировать URL-адрес SL" name="copy_slurl" tool_tip="Копировать текущее место в виде URL-адреса SL для использования в Интернете."/> + <button label="Копировать URL SL" name="copy_slurl" tool_tip="Копировать текущее место в виде URL-адреса SL для использования в интернете."/> <button label="Показать выбранное" name="Show Destination" tool_tip="Центрировать карту на выбранном месте"/> </panel> <panel name="layout_panel_5"> diff --git a/indra/newview/skins/default/xui/ru/menu_attachment_other.xml b/indra/newview/skins/default/xui/ru/menu_attachment_other.xml index 72063737eb..fb1c24448b 100644 --- a/indra/newview/skins/default/xui/ru/menu_attachment_other.xml +++ b/indra/newview/skins/default/xui/ru/menu_attachment_other.xml @@ -4,7 +4,7 @@ <menu_item_call label="Смотреть профиль" name="Profile..."/> <menu_item_call label="В друзья" name="Add Friend"/> <menu_item_call label="IM" name="Send IM..."/> - <menu_item_call label="Позвонить" name="Call"/> + <menu_item_call label="Звонок" name="Call"/> <menu_item_call label="Пригласить в группу" name="Invite..."/> <menu_item_call label="Заблокировать" name="Avatar Mute"/> <menu_item_call label="Пожаловаться" name="abuse"/> diff --git a/indra/newview/skins/default/xui/ru/menu_gesture_gear.xml b/indra/newview/skins/default/xui/ru/menu_gesture_gear.xml index 78b1768761..d0b68cefbd 100644 --- a/indra/newview/skins/default/xui/ru/menu_gesture_gear.xml +++ b/indra/newview/skins/default/xui/ru/menu_gesture_gear.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <toggleable_menu name="menu_gesture_gear"> - <menu_item_call label="Добавить/удалить из избранного" name="activate"/> + <menu_item_call label="Добавить в избранное/удалить" name="activate"/> <menu_item_call label="Копировать" name="copy_gesture"/> <menu_item_call label="Вставить" name="paste"/> <menu_item_call label="Копировать UUID" name="copy_uuid"/> diff --git a/indra/newview/skins/default/xui/ru/menu_hide_navbar.xml b/indra/newview/skins/default/xui/ru/menu_hide_navbar.xml index f77896677d..34e5f4c0e4 100644 --- a/indra/newview/skins/default/xui/ru/menu_hide_navbar.xml +++ b/indra/newview/skins/default/xui/ru/menu_hide_navbar.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <menu name="hide_navbar_menu"> - <menu_item_check label="Показать панель навигации" name="ShowNavbarNavigationPanel"/> + <menu_item_check label="Показать панель навигации и избранного" name="ShowNavbarNavigationPanel"/> <menu_item_check label="Показать панель избранного" name="ShowNavbarFavoritesPanel"/> <menu_item_check label="Показать мини-панель местоположения" name="ShowMiniLocationPanel"/> </menu> diff --git a/indra/newview/skins/default/xui/ru/menu_inventory_gear_default.xml b/indra/newview/skins/default/xui/ru/menu_inventory_gear_default.xml index d500f0fac6..9fc0b6d44e 100644 --- a/indra/newview/skins/default/xui/ru/menu_inventory_gear_default.xml +++ b/indra/newview/skins/default/xui/ru/menu_inventory_gear_default.xml @@ -8,7 +8,7 @@ <menu_item_call label="Показать фильтры" name="show_filters"/> <menu_item_call label="Сбросить фильтры" name="reset_filters"/> <menu_item_call label="Закрыть все папки" name="close_folders"/> - <menu_item_call label="Очистить Lost and Found" name="empty_lostnfound"/> + <menu_item_call label="Очистить бюро находок" name="empty_lostnfound"/> <menu_item_call label="Сохранить текстуру как" name="Save Texture As"/> <menu_item_call label="Поделиться" name="Share"/> <menu_item_call label="Найти оригинал" name="Find Original"/> diff --git a/indra/newview/skins/default/xui/ru/menu_landmark.xml b/indra/newview/skins/default/xui/ru/menu_landmark.xml index 11d6e37e81..24b60f9d86 100644 --- a/indra/newview/skins/default/xui/ru/menu_landmark.xml +++ b/indra/newview/skins/default/xui/ru/menu_landmark.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <toggleable_menu name="landmark_overflow_menu"> - <menu_item_call label="Копировать URL-адрес SL" name="copy"/> + <menu_item_call label="Копировать URL SL" name="copy"/> <menu_item_call label="Удалить" name="delete"/> <menu_item_call label="Создать подборку" name="pick"/> <menu_item_call label="Добавить в любимые" name="add_to_favbar"/> diff --git a/indra/newview/skins/default/xui/ru/menu_login.xml b/indra/newview/skins/default/xui/ru/menu_login.xml index 3b545bf593..aa3570f176 100644 --- a/indra/newview/skins/default/xui/ru/menu_login.xml +++ b/indra/newview/skins/default/xui/ru/menu_login.xml @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <menu_bar name="Login Menu"> <menu label="Я" name="File"> - <menu_item_call label="Настройки" name="Preferences..."/> + <menu_item_call label="Настройки..." name="Preferences..."/> <menu_item_call label="Выход из [APP_NAME]" name="Quit"/> </menu> <menu label="Справка" name="Help"> diff --git a/indra/newview/skins/default/xui/ru/menu_model_import_gear_default.xml b/indra/newview/skins/default/xui/ru/menu_model_import_gear_default.xml index b7949b30d9..5ae5e7dfbc 100644 --- a/indra/newview/skins/default/xui/ru/menu_model_import_gear_default.xml +++ b/indra/newview/skins/default/xui/ru/menu_model_import_gear_default.xml @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <toggleable_menu name="model_menu_gear_default"> <menu_item_check label="Показать грани" name="show_edges"/> - <menu_item_check label="Показать физические параметры" name="show_physics"/> + <menu_item_check label="Показать физику" name="show_physics"/> <menu_item_check label="Показать текстуры" name="show_textures"/> <menu_item_check label="Показать вес кожи" name="show_skin_weight"/> <menu_item_check label="Показать положение сочленений" name="show_joint_positions"/> diff --git a/indra/newview/skins/default/xui/ru/menu_participant_list.xml b/indra/newview/skins/default/xui/ru/menu_participant_list.xml index 8bbf2d52bf..932ad5bacf 100644 --- a/indra/newview/skins/default/xui/ru/menu_participant_list.xml +++ b/indra/newview/skins/default/xui/ru/menu_participant_list.xml @@ -5,7 +5,7 @@ <menu_item_call label="Открыть профиль" name="View Profile"/> <menu_item_call label="Добавить в друзья" name="Add Friend"/> <menu_item_call label="IM" name="IM"/> - <menu_item_call label="Позвонить" name="Call"/> + <menu_item_call label="Звонок" name="Call"/> <menu_item_call label="Поделиться" name="Share"/> <menu_item_call label="Заплатить" name="Pay"/> <menu_item_check label="Показывать значки участников" name="View Icons"/> diff --git a/indra/newview/skins/default/xui/ru/menu_places_gear_landmark.xml b/indra/newview/skins/default/xui/ru/menu_places_gear_landmark.xml index a838dd5c42..b1ebd4af83 100644 --- a/indra/newview/skins/default/xui/ru/menu_places_gear_landmark.xml +++ b/indra/newview/skins/default/xui/ru/menu_places_gear_landmark.xml @@ -8,7 +8,7 @@ <menu_item_call label="Восстановить вещь" name="restore_item"/> <menu_item_call label="Вырезать" name="cut"/> <menu_item_call label="Копировать закладку" name="copy_landmark"/> - <menu_item_call label="Копировать URL-адрес SL" name="copy_slurl"/> + <menu_item_call label="Копировать URL SL" name="copy_slurl"/> <menu_item_call label="Вставить" name="paste"/> <menu_item_call label="Переименовать" name="rename"/> <menu_item_call label="Удалить" name="delete"/> diff --git a/indra/newview/skins/default/xui/ru/menu_toolbars.xml b/indra/newview/skins/default/xui/ru/menu_toolbars.xml new file mode 100644 index 0000000000..e04a9ee57d --- /dev/null +++ b/indra/newview/skins/default/xui/ru/menu_toolbars.xml @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes"?> +<context_menu name="Toolbars Popup"> + <menu_item_call label="Выбор кнопок..." name="Chose Buttons"/> + <menu_item_check label="Значки и подписи" name="icons_with_text"/> + <menu_item_check label="Только значки" name="icons_only"/> +</context_menu> diff --git a/indra/newview/skins/default/xui/ru/menu_viewer.xml b/indra/newview/skins/default/xui/ru/menu_viewer.xml index c4e553f918..b9f403c04b 100644 --- a/indra/newview/skins/default/xui/ru/menu_viewer.xml +++ b/indra/newview/skins/default/xui/ru/menu_viewer.xml @@ -1,27 +1,28 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <menu_bar name="Main Menu"> <menu label="Я" name="Me"> - <menu_item_call label="Настройки" name="Preferences"/> - <menu_item_call label="Моя информационная панель" name="Manage My Account"/> - <menu_item_call label="Купить L$" name="Buy and Sell L$"/> - <menu_item_call label="Мой профиль" name="Profile"/> - <menu_item_call label="Мой внешний вид" name="ChangeOutfit"/> - <menu_item_check label="Мой инвентарь" name="Inventory"/> - <menu_item_check label="Мой инвентарь" name="ShowSidetrayInventory"/> - <menu_item_check label="Мои жесты" name="Gestures"/> - <menu_item_check label="Мой голос" name="ShowVoice"/> + <menu_item_call label="Информационная панель..." name="Manage My Account"/> + <menu_item_call label="Профиль…" name="Profile"/> + <menu_item_call label="Внешность..." name="ChangeOutfit"/> + <menu_item_check label="Инвентарь..." name="Inventory"/> + <menu_item_check label="Жесты..." name="Gestures"/> + <menu_item_check label="Голос..." name="ShowVoice"/> <menu label="Движение" name="Movement"> <menu_item_call label="Сесть" name="Sit Down Here"/> <menu_item_check label="Полет" name="Fly"/> <menu_item_check label="Всегда бегать" name="Always Run"/> <menu_item_call label="Остановить анимацию" name="Stop Animating My Avatar"/> </menu> - <menu label="Мой статус" name="Status"> + <menu label="Статус" name="Status"> <menu_item_call label="Нет на месте" name="Set Away"/> <menu_item_call label="Не беспокоить" name="Set Busy"/> </menu> <menu_item_call label="Запрос статуса администратора" name="Request Admin Options"/> <menu_item_call label="Выход из статуса администратора" name="Leave Admin Options"/> + <menu_item_call label="Купить L$" name="Buy and Sell L$"/> + <menu_item_call label="Настройки..." name="Preferences"/> + <menu_item_call label="Панели инструментов..." name="Toolbars"/> + <menu_item_call label="Скрыть все элементы управления" name="Hide UI"/> <menu_item_call label="Выход из [APP_NAME]" name="Quit"/> </menu> <menu label="Общение" name="Communicate"> @@ -32,7 +33,7 @@ <menu_item_check label="Голоса собеседников" name="Nearby Voice"/> </menu> <menu label="Мир" name="World"> - <menu_item_check label="Мини-карта" name="Mini-Map"/> + <menu_item_check label="Миникарта" name="Mini-Map"/> <menu_item_check label="Карта мира" name="World Map"/> <menu_item_check label="Поиск" name="Search"/> <menu_item_call label="Снимок" name="Take Snapshot"/> @@ -53,7 +54,7 @@ <menu_item_check label="Владельцы земли" name="Land Owners"/> <menu_item_check label="Координаты" name="Coordinates"/> <menu_item_check label="Свойства участка" name="Parcel Properties"/> - <menu_item_check label="Дополнительное меню" name="Show Advanced Menu"/> + <menu_item_check label="Меню «Дополнительно»" name="Show Advanced Menu"/> </menu> <menu_item_call label="Телепортироваться домой" name="Teleport Home"/> <menu_item_call label="Установить дом здесь" name="Set Home to Here"/> @@ -144,7 +145,6 @@ </menu> <menu label="Справка" name="Help"> <menu_item_call label="Справка по [SECOND_LIFE]" name="Second Life Help"/> - <menu_item_check label="Включить подсказки" name="Enable Hints"/> <menu_item_call label="Жалоба" name="Report Abuse"/> <menu_item_call label="Сообщить об ошибке" name="Report Bug"/> <menu_item_call label="О [APP_NAME]" name="About Second Life"/> @@ -160,7 +160,7 @@ <menu label="Производительность" name="Performance Tools"> <menu_item_call label="Запаздывание" name="Lag Meter"/> <menu_item_check label="Статистика" name="Statistics Bar"/> - <menu_item_check label="Стоимость отрисовки аватара" name="Avatar Rendering Cost"/> + <menu_item_check label="Показать вес отрисовки для аватаров" name="Avatar Rendering Cost"/> </menu> <menu label="Подсветка и видимость" name="Highlighting and Visibility"> <menu_item_check label="Мигающий маяк" name="Cheesy Beacon"/> @@ -203,7 +203,7 @@ <menu_item_check label="Поиск" name="Search"/> <menu_item_call label="Освободить клавиши" name="Release Keys"/> <menu_item_call label="Сбросить размер интерфейса" name="Set UI Size to Default"/> - <menu_item_check label="Показать дополнительное меню – устаревшее сочетание клавиш" name="Show Advanced Menu - legacy shortcut"/> + <menu_item_check label="Показать меню «Дополнительно» - старое сочетание клавиш" name="Show Advanced Menu - legacy shortcut"/> <menu_item_call label="Закрыть окно" name="Close Window"/> <menu_item_call label="Закрыть все окна" name="Close All Windows"/> <menu_item_call label="Сохранить снимок на диске" name="Snapshot to Disk"/> @@ -288,6 +288,7 @@ <menu_item_check label="Освещение" name="Lights"/> <menu_item_check label="Каркас столкновений" name="Collision Skeleton"/> <menu_item_check label="Лучи" name="Raycast"/> + <menu_item_check label="Сложность визуализации" name="rendercomplexity"/> <menu_item_check label="Лепка" name="Sculpt"/> </menu> <menu label="Визуализация" name="Rendering"> diff --git a/indra/newview/skins/default/xui/ru/notifications.xml b/indra/newview/skins/default/xui/ru/notifications.xml index 91c8dbf761..1be14160ed 100644 --- a/indra/newview/skins/default/xui/ru/notifications.xml +++ b/indra/newview/skins/default/xui/ru/notifications.xml @@ -724,13 +724,13 @@ Телепортация сейчас заблокирована. Повторите попытку позже. Если все равно не удается телепортироваться, выйдите из программы и войдите снова, чтобы устранить проблему. </notification> <notification name="nolandmark_tport"> - Системе не удалось определить место назначения закладки. + Системе не удалось определить пункт назначения закладки. </notification> <notification name="timeout_tport"> Системе не удалось выполнить подключение телепорта. Повторите попытку позже. </notification> <notification name="noaccess_tport"> - У вас нет доступа к точке назначения этого телепорта. + У вас нет доступа в пункт назначения этого телепорта. </notification> <notification name="missing_attach_tport"> Ваши присоединения еще не доставлены. Подождите несколько секунд либо выйдите из программы и войдите снова, прежде чем повторить попытку телепортации. @@ -745,7 +745,7 @@ Системе не удалось своевременно выполнить ваше пересечение границы. Повторите попытку через несколько минут. </notification> <notification name="no_host"> - Не удалось найти точку назначения телепорта. Возможно, место назначения временно недоступно или уже не существует. Повторите попытку через несколько минут. + Не удалось найти точку назначения телепорта. Возможно, пункт назначения временно недоступен или уже не существует. Повторите попытку через несколько минут. </notification> <notification name="no_inventory_host"> Система инвентаря сейчас недоступна. @@ -979,7 +979,7 @@ </form> </notification> <notification name="RemoveFromFriends"> - Удалить жителя [NAME] из вашего списка друзей? + Удалить жителя <nolink>[NAME]</nolink> из вашего списка друзей? <usetemplate name="okcancelbuttons" notext="Отмена" yestext="OK"/> </notification> <notification name="RemoveMultipleFromFriends"> @@ -1909,6 +1909,12 @@ http://secondlife.com/download. Выйти из программы? <usetemplate ignoretext="Подтверждать перед выходом" name="okcancelignore" notext="Не выходить" yestext="Выйти"/> </notification> + <notification name="ConfirmRestoreToybox"> + Вы действительно хотите восстановить принятые по умолчанию кнопки и панели инструментов? + +Это действие нельзя отменить. + <usetemplate name="okcancelbuttons" notext="Отмена" yestext="OK"/> + </notification> <notification name="DeleteItems"> [QUESTION] <usetemplate ignoretext="Подтверждать перед удалением предметов" name="okcancelignore" notext="Отмена" yestext="OK"/> @@ -2113,10 +2119,10 @@ http://secondlife.com/download. Раздел: [SUBJECT], сообщение: [MESSAGE] </notification> <notification name="FriendOnline"> - [NAME] в сети + <nolink>[NAME]</nolink> в сети </notification> <notification name="FriendOffline"> - [NAME] не в сети + <nolink>[NAME]</nolink> не в сети </notification> <notification name="AddSelfFriend"> Вы лучше всех, но нельзя добавить в друзья себя самого. @@ -2375,7 +2381,7 @@ http://secondlife.com/download. Не найден регион назначения. </notification> <notification name="NotAllowedInDest"> - Вам не разрешен доступ к месту назначения. + Вам не разрешен доступ в пункт назначения. </notification> <notification name="RegionParcelBan"> Нельзя пересечь границу региона по пути на забаненный участок. Выберите другой путь. @@ -2384,7 +2390,7 @@ http://secondlife.com/download. Вы перенаправлены на телехаб. </notification> <notification name="CouldntTPCloser"> - Не удалось телепортироваться ближе к месту назначения. + Не удалось телепортироваться ближе к пункту назначения. </notification> <notification name="TPCancelled"> Телепортация отменена. @@ -2512,10 +2518,10 @@ http://secondlife.com/download. </form> </notification> <notification name="FriendshipAccepted"> - [NAME] принял(а) ваше предложение дружить. + <nolink>[NAME]</nolink> принял(а) ваше предложение дружить. </notification> <notification name="FriendshipDeclined"> - [NAME] отклонил(а) ваше предложение дружить. + <nolink>[NAME]</nolink> отклонил(а) ваше предложение дружить. </notification> <notification name="FriendshipAcceptedByMe"> Предложение дружить принято. @@ -2898,7 +2904,7 @@ http://secondlife.com/download. При скрытии кнопки «Говорить» голосовая функция отключается. </notification> <notification label="Исследование мира" name="HintDestinationGuide"> - Путеводитель по местам назначения содержит тысячи новых мест, в которых вы можете побывать. Выберите место и нажмите кнопку «Телепортация», чтобы начать исследование. + Путеводитель по пунктам назначения содержит тысячи новых мест, в которых вы можете побывать. Выберите место и нажмите кнопку «Телепортация», чтобы начать исследование. </notification> <notification label="Боковая панель" name="HintSidePanel"> Быстрый доступ к вашему инвентарю, костюмам, профилю и многому другому открывается на боковой панели. @@ -2995,10 +3001,6 @@ http://secondlife.com/download. <button name="cancel" text="Отмена"/> </form> </notification> - <notification label="" name="ModeChange"> - Для смены режима требуется выйти из программы и перезапустить ее. - <usetemplate name="okcancelbuttons" notext="Не выходить" yestext="Выйти"/> - </notification> <notification label="" name="NoClassifieds"> Создание и редактирование рекламы доступно только в расширенном режиме. Выйти из программы и сменить режим? Меню смены режима находится на экране входа. <usetemplate name="okcancelbuttons" notext="Не выходить" yestext="Выйти"/> @@ -3043,6 +3045,10 @@ http://secondlife.com/download. Поиск доступен только в расширенном режиме. Выйти из программы и сменить режим? <usetemplate name="okcancelbuttons" notext="Не выходить" yestext="Выход"/> </notification> + <notification label="" name="ConfirmHideUI"> + Это действие приведет к скрытию всех меню и кнопок. Чтобы вернуть их, щелкните [SHORTCUT] снова. + <usetemplate ignoretext="Подтверждать перед скрытием интерфейса" name="okcancelignore" notext="Отмена" yestext="OK"/> + </notification> <global name="UnsupportedGLRequirements"> По-видимому, ваше оборудование не удовлетворяет требованиям [APP_NAME]. Для работы [APP_NAME] необходима графическая карта OpenGL с поддержкой мультитекстур. Если у вас есть такая карта, убедитесь, что установлены новейшие версии драйверов для нее и пакеты обновлений и исправления для операционной системы. diff --git a/indra/newview/skins/default/xui/ru/panel_chiclet_bar.xml b/indra/newview/skins/default/xui/ru/panel_chiclet_bar.xml new file mode 100644 index 0000000000..f203ecde4b --- /dev/null +++ b/indra/newview/skins/default/xui/ru/panel_chiclet_bar.xml @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes"?> +<panel name="chiclet_bar"> + <layout_stack name="toolbar_stack"> + <layout_panel name="im_well_panel"> + <chiclet_im_well name="im_well"> + <button name="Unread IM messages" tool_tip="Разговоры"/> + </chiclet_im_well> + </layout_panel> + <layout_panel name="notification_well_panel"> + <chiclet_notification name="notification_well"> + <button name="Unread" tool_tip="Уведомления"/> + </chiclet_notification> + </layout_panel> + </layout_stack> +</panel> diff --git a/indra/newview/skins/default/xui/ru/panel_edit_alpha.xml b/indra/newview/skins/default/xui/ru/panel_edit_alpha.xml index 38789c1c5e..7cde4099ef 100644 --- a/indra/newview/skins/default/xui/ru/panel_edit_alpha.xml +++ b/indra/newview/skins/default/xui/ru/panel_edit_alpha.xml @@ -2,8 +2,8 @@ <panel name="edit_alpha_panel"> <scroll_container name="avatar_alpha_color_panel_scroll"> <panel name="avatar_alpha_color_panel"> - <texture_picker label="Альфа нижних частей тела" name="Lower Alpha" tool_tip="Щелкните для выбора изображения"/> - <texture_picker label="Альфа верхних частей тела" name="Upper Alpha" tool_tip="Щелкните для выбора изображения"/> + <texture_picker label="Альфа низа" name="Lower Alpha" tool_tip="Щелкните для выбора изображения"/> + <texture_picker label="Альфа верха" name="Upper Alpha" tool_tip="Щелкните для выбора изображения"/> <texture_picker label="Альфа головы" name="Head Alpha" tool_tip="Щелкните для выбора изображения"/> <texture_picker label="Альфа глаз" name="Eye Alpha" tool_tip="Щелкните для выбора изображения"/> <texture_picker label="Альфа волос" name="Hair Alpha" tool_tip="Щелкните для выбора изображения"/> diff --git a/indra/newview/skins/default/xui/ru/panel_edit_shape.xml b/indra/newview/skins/default/xui/ru/panel_edit_shape.xml index b185ce1d45..312ad593a1 100644 --- a/indra/newview/skins/default/xui/ru/panel_edit_shape.xml +++ b/indra/newview/skins/default/xui/ru/panel_edit_shape.xml @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <panel name="edit_shape_panel"> <string name="meters"> - метров + м </string> <string name="feet"> футов diff --git a/indra/newview/skins/default/xui/ru/panel_im_control_panel.xml b/indra/newview/skins/default/xui/ru/panel_im_control_panel.xml index f1cba0d3be..2a23cdb800 100644 --- a/indra/newview/skins/default/xui/ru/panel_im_control_panel.xml +++ b/indra/newview/skins/default/xui/ru/panel_im_control_panel.xml @@ -17,7 +17,7 @@ <button label="Заплатить" name="pay_btn"/> </layout_panel> <layout_panel name="call_btn_panel"> - <button label="Позвонить" name="call_btn"/> + <button label="Звонок" name="call_btn"/> </layout_panel> <layout_panel name="end_call_btn_panel"> <button label="Завершить звонок" name="end_call_btn"/> diff --git a/indra/newview/skins/default/xui/ru/panel_landmarks.xml b/indra/newview/skins/default/xui/ru/panel_landmarks.xml index 66c5b3b574..7d684cd479 100644 --- a/indra/newview/skins/default/xui/ru/panel_landmarks.xml +++ b/indra/newview/skins/default/xui/ru/panel_landmarks.xml @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <panel name="Landmarks"> <accordion name="landmarks_accordion"> - <accordion_tab name="tab_favorites" title="Панель «Избранное»"/> + <accordion_tab name="tab_favorites" title="Избранное"/> <accordion_tab name="tab_landmarks" title="Мои закладки"/> <accordion_tab name="tab_inventory" title="Мой инвентарь"/> <accordion_tab name="tab_library" title="Библиотека"/> diff --git a/indra/newview/skins/default/xui/ru/panel_me.xml b/indra/newview/skins/default/xui/ru/panel_me.xml index b37627b4d9..21a125af87 100644 --- a/indra/newview/skins/default/xui/ru/panel_me.xml +++ b/indra/newview/skins/default/xui/ru/panel_me.xml @@ -1,7 +1,4 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <panel label="Мой профиль" name="panel_me"> - <tab_container name="tabs"> - <panel label="МОЙ ПРОФИЛЬ" name="panel_profile"/> - <panel label="МОЯ ПОДБОРКА" name="panel_picks"/> - </tab_container> + <panel label="МОЯ ПОДБОРКА" name="panel_picks"/> </panel> diff --git a/indra/newview/skins/default/xui/ru/panel_my_profile.xml b/indra/newview/skins/default/xui/ru/panel_my_profile.xml deleted file mode 100644 index 9117bfec18..0000000000 --- a/indra/newview/skins/default/xui/ru/panel_my_profile.xml +++ /dev/null @@ -1,42 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes"?> -<panel label="Профиль" name="panel_profile"> - <string name="CaptionTextAcctInfo"> - [ACCTTYPE] -[PAYMENTINFO] [AGEVERIFICATION] - </string> - <string name="payment_update_link_url"> - http://www.secondlife.com/account/billing.php?lang=en - </string> - <string name="partner_edit_link_url"> - http://www.secondlife.com/account/partners.php?lang=en - </string> - <string name="my_account_link_url" value="http://secondlife.com/account"/> - <string name="no_partner_text" value="Нет"/> - <string name="no_group_text" value="Нет"/> - <string name="RegisterDateFormat"> - [REG_DATE] ([AGE]) - </string> - <string name="name_text_args"> - [NAME] - </string> - <string name="display_name_text_args"> - [DISPLAY_NAME] - </string> - <layout_stack name="layout"> - <layout_panel name="profile_stack"> - <scroll_container name="profile_scroll"> - <panel name="scroll_content_panel"> - <panel name="second_life_image_panel"> - <text name="display_name_descr_text"> - Имя пользователя - </text> - <text name="name_descr_text"> - Экранное имя - </text> - <button label="Профиль" name="see_profile_btn" tool_tip="Посмотреть профиль этого аватара"/> - </panel> - </panel> - </scroll_container> - </layout_panel> - </layout_stack> -</panel> diff --git a/indra/newview/skins/default/xui/ru/panel_navigation_bar.xml b/indra/newview/skins/default/xui/ru/panel_navigation_bar.xml index 3bda315261..5e3de180f9 100644 --- a/indra/newview/skins/default/xui/ru/panel_navigation_bar.xml +++ b/indra/newview/skins/default/xui/ru/panel_navigation_bar.xml @@ -1,18 +1,23 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <panel name="navigation_bar"> - <panel name="navigation_panel"> - <pull_button name="back_btn" tool_tip="Вернуться в предыдущее место"/> - <pull_button name="forward_btn" tool_tip="Перейти в следующее место"/> - <button name="home_btn" tool_tip="Телепортироваться домой"/> - <location_input label="Место" name="location_combo"/> - <search_combo_box label="Поиск" name="search_combo_box" tool_tip="Поиск"> - <combo_editor label="Поиск [SECOND_LIFE]" name="search_combo_editor"/> - </search_combo_box> - </panel> - <favorites_bar name="favorite" tool_tip="Перетаскивайте сюда закладки, чтобы было удобнее переходить в любимые места в Second Life!"> - <label name="favorites_bar_label" tool_tip="Перетаскивайте сюда закладки, чтобы было удобнее переходить в любимые места в Second Life!"> - Панель «Избранное» - </label> - <chevron_button name=">>" tool_tip="Показать больше избранного"/> - </favorites_bar> + <layout_stack name="nvp_stack"> + <layout_panel name="navigation_layout_panel"> + <panel name="navigation_panel"> + <pull_button name="back_btn" tool_tip="Вернуться в предыдущее место"/> + <pull_button name="forward_btn" tool_tip="Перейти в следующее место"/> + <button name="home_btn" tool_tip="Телепортация домой"/> + <location_input label="Место" name="location_combo"/> + </panel> + </layout_panel> + <layout_panel name="favorites_layout_panel"> + <favorites_bar name="favorite" tool_tip="Перетаскивайте сюда закладки, чтобы было удобнее переходить в любимые места в Second Life!"> + <label name="favorites_bar_label" tool_tip="Перетаскивайте сюда закладки, чтобы было удобнее переходить в любимые места в Second Life!"> + Избранное + </label> + <more_button name=">>" tool_tip="Показать больше избранного"> + Больше ▼ + </more_button> + </favorites_bar> + </layout_panel> + </layout_stack> </panel> diff --git a/indra/newview/skins/default/xui/ru/panel_nearby_chat.xml b/indra/newview/skins/default/xui/ru/panel_nearby_chat.xml new file mode 100644 index 0000000000..1d26eecf87 --- /dev/null +++ b/indra/newview/skins/default/xui/ru/panel_nearby_chat.xml @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes"?> +<panel name="nearby_chat"> + <check_box label="Перевод чата" name="translate_chat_checkbox"/> +</panel> diff --git a/indra/newview/skins/default/xui/ru/panel_notes.xml b/indra/newview/skins/default/xui/ru/panel_notes.xml deleted file mode 100644 index f88b4f13c3..0000000000 --- a/indra/newview/skins/default/xui/ru/panel_notes.xml +++ /dev/null @@ -1,35 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes"?> -<panel label="Заметки и приватность" name="panel_notes"> - <layout_stack name="layout"> - <layout_panel name="notes_stack"> - <scroll_container name="profile_scroll"> - <panel name="profile_scroll_panel"> - <text name="status_message" value="Мои личные заметки:"/> - <text name="status_message2" value="Разрешить этому жителю:"/> - <check_box label="Видеть мой статус в сети" name="status_check"/> - <check_box label="Видеть меня на карте" name="map_check"/> - <check_box label="Редактировать, удалять или брать мои объекты" name="objects_check"/> - </panel> - </scroll_container> - </layout_panel> - <layout_panel name="notes_buttons_panel"> - <layout_stack name="bottom_bar_ls"> - <layout_panel name="add_friend_btn_lp"> - <button label="Добавить в друзья" name="add_friend" tool_tip="Предложить дружбу этому жителю"/> - </layout_panel> - <layout_panel name="im_btn_lp"> - <button label="IM" name="im" tool_tip="Начать сеанс IM"/> - </layout_panel> - <layout_panel name="call_btn_lp"> - <button label="Позвонить" name="call" tool_tip="Позвонить этому жителю"/> - </layout_panel> - <layout_panel name="show_on_map_btn_lp"> - <button label="Карта" name="show_on_map_btn" tool_tip="Показать жителя на карте"/> - </layout_panel> - <layout_panel name="teleport_btn_lp"> - <button label="Телепортация" name="teleport" tool_tip="Предложить телепортацию"/> - </layout_panel> - </layout_stack> - </layout_panel> - </layout_stack> -</panel> diff --git a/indra/newview/skins/default/xui/ru/panel_outfit_edit.xml b/indra/newview/skins/default/xui/ru/panel_outfit_edit.xml index 0657e6ff40..91c03342a7 100644 --- a/indra/newview/skins/default/xui/ru/panel_outfit_edit.xml +++ b/indra/newview/skins/default/xui/ru/panel_outfit_edit.xml @@ -2,7 +2,7 @@ <!-- Side tray Outfit Edit panel --> <panel name="outfit_edit"> <string name="No Outfit" value="Нет костюма"/> - <string name="unsaved_changes" value="Не сохраненные изменения"/> + <string name="unsaved_changes" value="Несохраненные изменения"/> <string name="now_editing" value="Сейчас редактируется"/> <panel.string name="not_available"> (нет) @@ -35,7 +35,7 @@ </layout_stack> </layout_panel> <layout_panel name="add_wearables_panel"> - <button label="Вещь, которая носится" name="plus_btn"/> + <button label="Носимая вещь" name="plus_btn"/> </layout_panel> </layout_stack> <panel name="no_add_wearables_button_bar"> diff --git a/indra/newview/skins/default/xui/ru/panel_people.xml b/indra/newview/skins/default/xui/ru/panel_people.xml index e8a25d5349..607921f2d6 100644 --- a/indra/newview/skins/default/xui/ru/panel_people.xml +++ b/indra/newview/skins/default/xui/ru/panel_people.xml @@ -64,13 +64,13 @@ <panel name="button_bar"> <layout_stack name="bottom_bar_ls"> <layout_panel name="view_profile_btn_lp"> - <button label="Профиль" name="view_profile_btn" tool_tip="Показывает изображение, группы и прочую информацию о жителе"/> + <button label="Профиль" name="view_profile_btn" tool_tip="Показать изображение, группы и прочую информацию о жителе"/> </layout_panel> <layout_panel name="im_btn_lp"> <button label="IM" name="im_btn" tool_tip="Начать сеанс IM"/> </layout_panel> <layout_panel name="call_btn_lp"> - <button label="Позвонить" name="call_btn" tool_tip="Позвонить этому жителю"/> + <button label="Звонок" name="call_btn" tool_tip="Позвонить этому жителю"/> </layout_panel> <layout_panel name="share_btn_lp"> <button label="Поделиться" name="share_btn" tool_tip="Поделиться объектом из инвентаря"/> @@ -81,13 +81,13 @@ </layout_stack> <layout_stack name="bottom_bar_ls1"> <layout_panel name="group_info_btn_lp"> - <button label="Профиль группы" name="group_info_btn" tool_tip="Показывает информацию о группе"/> + <button label="Профиль группы" name="group_info_btn" tool_tip="Показать информацию о группе"/> </layout_panel> <layout_panel name="chat_btn_lp"> - <button label="Групповой чат" name="chat_btn" tool_tip="Открывает сеанс чата"/> + <button label="Групповой чат" name="chat_btn" tool_tip="Открыть сеанс чата"/> </layout_panel> <layout_panel name="group_call_btn_lp"> - <button label="Звонок группе" name="group_call_btn" tool_tip="Звонок этой группе"/> + <button label="Звонок группе" name="group_call_btn" tool_tip="Позвонить этой группе"/> </layout_panel> </layout_stack> </panel> diff --git a/indra/newview/skins/default/xui/ru/panel_preferences_advanced.xml b/indra/newview/skins/default/xui/ru/panel_preferences_advanced.xml index ae6d8bf94d..7d8ee96924 100644 --- a/indra/newview/skins/default/xui/ru/panel_preferences_advanced.xml +++ b/indra/newview/skins/default/xui/ru/panel_preferences_advanced.xml @@ -17,7 +17,7 @@ <button label="Обзор" label_selected="Обзор" name="set_cache"/> <button label="Расположение по умолчанию" label_selected="Расположение по умолчанию" name="default_cache_location"/> <text name="UI Size:"> - Размер интерфейса: + Интерфейс: </text> <check_box label="Показывать ошибки скрипта в:" name="show_script_errors"/> <radio_group name="show_location"> diff --git a/indra/newview/skins/default/xui/ru/panel_preferences_alerts.xml b/indra/newview/skins/default/xui/ru/panel_preferences_alerts.xml index e1135b5ee1..9d7ae546fd 100644 --- a/indra/newview/skins/default/xui/ru/panel_preferences_alerts.xml +++ b/indra/newview/skins/default/xui/ru/panel_preferences_alerts.xml @@ -3,7 +3,7 @@ <text name="tell_me_label"> Сообщать мне: </text> - <check_box label="о тратах и доходах" name="notify_money_change_checkbox"/> + <check_box label="о расходах и доходах" name="notify_money_change_checkbox"/> <check_box label="о входе и выходе моих друзей" name="friends_online_notify_checkbox"/> <text name="show_label"> Всегда показывать: diff --git a/indra/newview/skins/default/xui/ru/panel_preferences_chat.xml b/indra/newview/skins/default/xui/ru/panel_preferences_chat.xml index bc9e9a24ba..a3ee5b7815 100644 --- a/indra/newview/skins/default/xui/ru/panel_preferences_chat.xml +++ b/indra/newview/skins/default/xui/ru/panel_preferences_chat.xml @@ -4,39 +4,39 @@ Размер шрифта: </text> <radio_group name="chat_font_size"> - <radio_item label="Маленький" name="radio" value="0"/> + <radio_item label="Мелкий" name="radio" value="0"/> <radio_item label="Средний" name="radio2" value="1"/> - <radio_item label="Большой" name="radio3" value="2"/> + <radio_item label="Крупный" name="radio3" value="2"/> </radio_group> <check_box initial_value="истина" label="Воспроизводить анимацию ввода текста при общении" name="play_typing_animation"/> - <check_box label="Отправлять мне сообщения по Email, когда я в оффлайне" name="send_im_to_email"/> - <check_box label="Включить текстовые сообщения и журнал общения в чате" name="plain_text_chat_history"/> + <check_box label="Отправлять мне сообщения по почте, когда меня нет в сети" name="send_im_to_email"/> + <check_box label="Вести журнал текстового IM и чата" name="plain_text_chat_history"/> <check_box label="Чат в пузырьках" name="bubble_text_chat"/> <text name="show_ims_in_label"> - Показать сообщения в: + Показывать сообщения: </text> <text name="requires_restart_label"> (требуется перезапуск) </text> <radio_group name="chat_window" tool_tip="Показывать IM-сообщения в отдельных окнах или же в одном окне с несколькими вкладками (требуется перезапуск)"> - <radio_item label="Отдельные окна" name="radio" value="0"/> - <radio_item label="Вкладки" name="radio2" value="1"/> + <radio_item label="В отдельных окнах" name="radio" value="0"/> + <radio_item label="На вкладках" name="radio2" value="1"/> </radio_group> <text name="disable_toast_label"> Включить всплывающие сообщения с новыми репликами в чате: </text> <check_box label="Групповой чат" name="EnableGroupChatPopups" tool_tip="Отображать всплывающие уведомления при появлении сообщений в групповом чате"/> <check_box label="Текстовые чаты" name="EnableIMChatPopups" tool_tip="Отображать всплывающие уведомления при получении IM-сообщений"/> - <spinner label="Время отображения всплывающих сообщений чата:" name="nearby_toasts_lifetime"/> - <spinner label="Время затухания всплывающих сообщений чата:" name="nearby_toasts_fadingtime"/> + <spinner label="Время отображения всплывающих реплик:" name="nearby_toasts_lifetime"/> + <spinner label="Время затухания всплывающих реплик:" name="nearby_toasts_fadingtime"/> <text name="translate_chb_label"> - Использовать машинный перевод во время общения (используется Google) + Использовать машинный перевод при общении </text> <text name="translate_language_text"> Переводить чат на: </text> <combo_box name="translate_language_combobox"> - <combo_box.item label="Стандартная система" name="System Default Language"/> + <combo_box.item label="Язык системы" name="System Default Language"/> <combo_box.item label="English" name="English"/> <combo_box.item label="Dansk" name="Danish"/> <combo_box.item label="Deutsch" name="German"/> @@ -50,7 +50,7 @@ <combo_box.item label="Русский" name="Russian"/> <combo_box.item label="Türkçe" name="Turkish"/> <combo_box.item label="Українська" name="Ukrainian"/> - <combo_box.item label="中文 (简体) (Chinese)" name="Chinese"/> + <combo_box.item label="中文 (简体) (китайский)" name="Chinese"/> <combo_box.item label="日本語 (Japanese)" name="Japanese"/> <combo_box.item label="한국어 (Korean)" name="Korean"/> </combo_box> diff --git a/indra/newview/skins/default/xui/ru/panel_preferences_colors.xml b/indra/newview/skins/default/xui/ru/panel_preferences_colors.xml index 17d84e2a39..48c34fcbb2 100644 --- a/indra/newview/skins/default/xui/ru/panel_preferences_colors.xml +++ b/indra/newview/skins/default/xui/ru/panel_preferences_colors.xml @@ -35,9 +35,9 @@ Цвет фона тегов имен (также для чата в пузырьках): </text> <color_swatch name="background" tool_tip="Выберите цвет для тегов имен"/> - <slider label="Прозрачность:" name="bubble_chat_opacity" tool_tip="Задайте прозрачность тегов имен"/> + <slider label="Видимость:" name="bubble_chat_opacity" tool_tip="Задайте непрозрачность тегов имен"/> <text name="floater_opacity"> - Прозрачность окон: + Непрозрачность окон: </text> <slider label="Активные:" name="active"/> <slider label="Неактивные:" name="inactive"/> diff --git a/indra/newview/skins/default/xui/ru/panel_preferences_general.xml b/indra/newview/skins/default/xui/ru/panel_preferences_general.xml index 28d08d7702..49f743a6ba 100644 --- a/indra/newview/skins/default/xui/ru/panel_preferences_general.xml +++ b/indra/newview/skins/default/xui/ru/panel_preferences_general.xml @@ -4,31 +4,33 @@ Язык: </text> <combo_box name="language_combobox"> - <combo_box.item label="Стандартная настройка системы" name="System Default Language"/> - <combo_box.item label="Английский" name="English"/> + <combo_box.item label="Язык системы" name="System Default Language"/> + <combo_box.item label="English - Английский" name="English"/> <combo_box.item label="Dansk – датский (бета-версия)" name="Danish"/> <combo_box.item label="Deutsch – немецкий (бета-версия)" name="Deutsch(German)"/> <combo_box.item label="Español – испанский (бета-версия)" name="Spanish"/> <combo_box.item label="Français – французский (бета-версия)" name="French"/> <combo_box.item label="Italiano – итальянский (бета-версия)" name="Italian"/> - <combo_box.item label="Nederlands – нидерландский (бета-версия)" name="Dutch"/> <combo_box.item label="Polski – польский (бета-версия)" name="Polish"/> <combo_box.item label="Português – португальский (бета-версия)" name="Portugese"/> + <combo_box.item label="Русский (бета-версия)" name="Russian"/> + <combo_box.item label="Türkçe - турецкий (бета-версия)" name="Turkish"/> <combo_box.item label="日本語 – японский (бета-версия)" name="(Japanese)"/> + <combo_box.item label="正體中文 - китайский, традиционное письмо (бета-версия)" name="Traditional Chinese"/> </combo_box> <text name="language_textbox2"> (Требуется перезапуск) </text> <text name="maturity_desired_prompt"> - Я хочу видеть содержимое: + Показывать контент: </text> <combo_box name="maturity_desired_combobox"> - <combo_box.item label="General, Moderate, Adult" name="Desired_Adult"/> - <combo_box.item label="General и Moderate" name="Desired_Mature"/> - <combo_box.item label="Общие" name="Desired_PG"/> + <combo_box.item label="Общий, умеренный, для взрослых" name="Desired_Adult"/> + <combo_box.item label="Общий и умеренный" name="Desired_Mature"/> + <combo_box.item label="Общий" name="Desired_PG"/> </combo_box> <text name="start_location_textbox"> - Начальное место: + Место старта: </text> <combo_box name="start_location_combo"> <combo_box.item label="Мое последнее место" name="MyLastLocation"/> @@ -36,7 +38,7 @@ </combo_box> <check_box initial_value="истина" label="Показывать на экране входа" name="show_location_checkbox"/> <text name="name_tags_textbox"> - Теги имени: + Теги имен: </text> <radio_group name="Name_Tag_Preference"> <radio_item label="Выкл." name="radio" value="0"/> @@ -44,10 +46,10 @@ <radio_item label="Временный показ" name="radio3" value="2"/> </radio_group> <check_box label="Мое имя" name="show_my_name_checkbox1"/> - <check_box label="Имена пользователей" name="show_slids" tool_tip="Показывать имя пользователя, такое, как bobsmith123"/> - <check_box label="Титулы группы" name="show_all_title_checkbox1" tool_tip="Показывать титулы групп, такие, как Officer или Member"/> + <check_box label="Имена пользователей" name="show_slids" tool_tip="Показывать имя пользователя, например, bobsmith123"/> + <check_box label="Титулы групп" name="show_all_title_checkbox1" tool_tip="Показывать титулы групп, например, Officer или Member"/> <check_box label="Подсветка друзей" name="show_friends" tool_tip="Подсвечивать теги имен ваших друзей"/> - <check_box label="Просмотреть экранные имена" name="display_names_check" tool_tip="Показывать экранные имена в чате, IM, тегах имен и пр."/> + <check_box label="Экранные имена" name="display_names_check" tool_tip="Показывать экранные имена в чате, IM, тегах имен и пр."/> <text name="inworld_typing_rg_label"> Нажатие клавиш с буквами: </text> @@ -56,9 +58,9 @@ <radio_item label="Приводит к перемещению (т. е. WASD)" name="radio_move" value="0"/> </radio_group> <text name="title_afk_text"> - Включение режима «Отошел» через: + Задержка режима «Отошел»: </text> - <combo_box label="Включение режима «Отошел» через:" name="afk"> + <combo_box label="Задержка режима «Отошел»:" name="afk"> <combo_box.item label="2 мин" name="item0"/> <combo_box.item label="5 мин" name="item1"/> <combo_box.item label="10 мин" name="item2"/> diff --git a/indra/newview/skins/default/xui/ru/panel_preferences_graphics1.xml b/indra/newview/skins/default/xui/ru/panel_preferences_graphics1.xml index 867307cc43..a7e826f5fc 100644 --- a/indra/newview/skins/default/xui/ru/panel_preferences_graphics1.xml +++ b/indra/newview/skins/default/xui/ru/panel_preferences_graphics1.xml @@ -42,10 +42,10 @@ <combo_box.item label="Солнце/луна + осветители" name="2"/> </combo_box> <text name="reflection_label"> - Отражения от воды: + Вода отражает: </text> <combo_box name="Reflections"> - <combo_box.item label="Минимальные" name="0"/> + <combo_box.item label="Минимум" name="0"/> <combo_box.item label="Ландшафт и деревья" name="1"/> <combo_box.item label="Все статичные объекты" name="2"/> <combo_box.item label="Все аватары и объекты" name="3"/> @@ -99,16 +99,16 @@ <check_box initial_value="истина" label="Аппаратная отрисовка" name="AvatarVertexProgram"/> <check_box initial_value="истина" label="Одежда аватара" name="AvatarCloth"/> <text name="TerrainDetailText"> - Детализация ландшафта: + Ландшафт: </text> <radio_group name="TerrainDetailRadio"> - <radio_item label="Низко" name="0"/> - <radio_item label="Высоко" name="2"/> + <radio_item label="Грубо" name="0"/> + <radio_item label="Детально" name="2"/> </radio_group> --> </panel> <button label="Применить" label_selected="Применить" name="Apply"/> <button label="Сброс" name="Defaults"/> <button label="Дополнительно" name="Advanced"/> - <button label="Аппаратные" label_selected="Аппаратные" name="GraphicsHardwareButton"/> + <button label="Аппаратура" label_selected="Аппаратура" name="GraphicsHardwareButton"/> </panel> diff --git a/indra/newview/skins/default/xui/ru/panel_preferences_move.xml b/indra/newview/skins/default/xui/ru/panel_preferences_move.xml index 331776902f..a6e9b00f2a 100644 --- a/indra/newview/skins/default/xui/ru/panel_preferences_move.xml +++ b/indra/newview/skins/default/xui/ru/panel_preferences_move.xml @@ -5,20 +5,35 @@ <text name="heading2"> Автоматическая установка позиции для: </text> - <check_box label="Создания/редактирование" name="edit_camera_movement" tool_tip="Производить автоматическое позиционирование камеры при входе в режим редактирования и выходе из него"/> - <check_box label="Внешность" name="appearance_camera_movement" tool_tip="Производить автоматическое позиционирование камеры в режиме изменения внешности"/> - <check_box initial_value="истина" label="Боковая панель" name="appearance_sidebar_positioning" tool_tip="Производить автоматическое позиционирование камеры для боковой панели"/> + <check_box label="создания/редактирования" name="edit_camera_movement" tool_tip="Автоматическое позиционирование камеры при входе в режим редактирования и выходе из него"/> + <check_box label="внешности" name="appearance_camera_movement" tool_tip="Автоматическое позиционирование камеры в режиме редактирования"/> + <text name="keyboard_lbl"> + Клавиатура: + </text> + <check_box label="Клавиши со стрелками всегда перемещают меня" name="arrow_keys_move_avatar_check"/> + <check_box label="Бег после двойного нажатия клавиши" name="tap_tap_hold_to_run"/> + <text name="mouse_lbl"> + Мышь: + </text> <check_box label="Показывать меня при обзоре мышью" name="first_person_avatar_visible"/> <text name=" Mouse Sensitivity"> Чувствительность мыши: </text> <check_box label="Инвертировать" name="invert_mouse"/> - <check_box label="Клавиши стрелок всегда перемещают меня" name="arrow_keys_move_avatar_check"/> - <check_box label="Бег после двойного нажатия клавиши" name="tap_tap_hold_to_run"/> - <check_box label="Двойной щелчок для:" name="double_click_chkbox"/> - <radio_group name="double_click_action"> - <radio_item label="Телепорт" name="radio_teleport"/> - <radio_item label="Автопилот" name="radio_autopilot"/> - </radio_group> + <text name="single_click_action_lbl"> + Один щелчок на земле: + </text> + <combo_box name="single_click_action_combo"> + <combo_box.item label="Без действия" name="0"/> + <combo_box.item label="Перемещение в точку щелчка" name="1"/> + </combo_box> + <text name="double_click_action_lbl"> + Двойной щелчок на земле: + </text> + <combo_box name="double_click_action_combo"> + <combo_box.item label="Без действия" name="0"/> + <combo_box.item label="Перемещение в точку щелчка" name="1"/> + <combo_box.item label="Телепортация в точку щелчка" name="2"/> + </combo_box> <button label="Другие устройства" name="joystick_setup_button"/> </panel> diff --git a/indra/newview/skins/default/xui/ru/panel_preferences_privacy.xml b/indra/newview/skins/default/xui/ru/panel_preferences_privacy.xml index f3c7e43022..20bb839eed 100644 --- a/indra/newview/skins/default/xui/ru/panel_preferences_privacy.xml +++ b/indra/newview/skins/default/xui/ru/panel_preferences_privacy.xml @@ -20,7 +20,7 @@ <check_box label="Метка времени в каждой строке журнала чата" name="show_timestamps_check_im"/> <check_box label="Метка времени в имени файла журнала." name="logfile_name_datestamp"/> <text name="log_path_desc"> - Размещение журналов: + Папка журналов: </text> <button label="Обзор" label_selected="Обзор" name="log_path_button"/> <button label="Черный список" name="block_list"/> diff --git a/indra/newview/skins/default/xui/ru/panel_preferences_setup.xml b/indra/newview/skins/default/xui/ru/panel_preferences_setup.xml index 9f23e2f5f7..db88189169 100644 --- a/indra/newview/skins/default/xui/ru/panel_preferences_setup.xml +++ b/indra/newview/skins/default/xui/ru/panel_preferences_setup.xml @@ -1,10 +1,10 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> -<panel label="Настройка" name="Input panel"> +<panel label="Конфигурация" name="Input panel"> <text name="Network:"> Сеть: </text> <text name="Maximum bandwidth"> - Максимальная ширина канала + Макс. ширина канала </text> <text name="text_box2"> Кбит/с @@ -32,5 +32,5 @@ <text name="Proxy Settings:"> Настройки прокси-сервера: </text> - <button label="Задать настройки прокси" label_selected="Обзор" name="set_proxy"/> + <button label="Задать настройки" label_selected="Обзор" name="set_proxy"/> </panel> diff --git a/indra/newview/skins/default/xui/ru/panel_preferences_sound.xml b/indra/newview/skins/default/xui/ru/panel_preferences_sound.xml index 123989966c..bf673750d2 100644 --- a/indra/newview/skins/default/xui/ru/panel_preferences_sound.xml +++ b/indra/newview/skins/default/xui/ru/panel_preferences_sound.xml @@ -1,9 +1,9 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <panel label="Звуки" name="Preference Media panel"> <panel.string name="middle_mouse"> - Средняя кнопка мыши + среднюю кнопку мыши </panel.string> - <slider label="Главный регулятор" name="System Volume"/> + <slider label="Общая громкость" name="System Volume"/> <check_box initial_value="истина" name="mute_when_minimized"/> <text name="mute_chb_label"> Заглушать, когда свернуто @@ -24,11 +24,11 @@ Настройки голосового чата </text> <text name="Listen from"> - Прослушивание с позиции: + Слушать с: </text> <radio_group name="ear_location"> - <radio_item label="Камера" name="0"/> - <radio_item label="Аватар" name="1"/> + <radio_item label="Камеры" name="0"/> + <radio_item label="Аватара" name="1"/> </radio_group> <check_box label="Губы аватара двигаются при разговоре" name="enable_lip_sync"/> <check_box label="Включать/выключать микрофон, когда я нажимаю:" name="push_to_talk_toggle_check" tool_tip="В режиме переключения ОДНОКРАТНОЕ нажатие и отпускание данной клавиши включает/выключает микрофон. Если режим переключения отключен, то микрофон передает голос, только когда клавиша нажата."/> diff --git a/indra/newview/skins/default/xui/ru/panel_profile.xml b/indra/newview/skins/default/xui/ru/panel_profile.xml deleted file mode 100644 index 79c060c050..0000000000 --- a/indra/newview/skins/default/xui/ru/panel_profile.xml +++ /dev/null @@ -1,67 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes"?> -<panel label="Профиль" name="panel_profile"> - <string name="CaptionTextAcctInfo"> - [ACCTTYPE] -[PAYMENTINFO] [AGEVERIFICATION] - </string> - <string name="payment_update_link_url"> - http://www.secondlife.com/account/billing.php?lang=en - </string> - <string name="partner_edit_link_url"> - http://www.secondlife.com/account/partners.php?lang=en - </string> - <string name="my_account_link_url" value="http://secondlife.com/account"/> - <string name="no_partner_text" value="Нет"/> - <string name="no_group_text" value="Нет"/> - <string name="RegisterDateFormat"> - [REG_DATE] ([AGE]) - </string> - <string name="name_text_args"> - [NAME] - </string> - <string name="display_name_text_args"> - [DISPLAY_NAME] - </string> - <layout_stack name="layout"> - <layout_panel name="profile_stack"> - <scroll_container name="profile_scroll"> - <panel name="profile_scroll_panel"> - <panel name="second_life_image_panel"> - <text name="title_sl_descr_text" value="[SECOND_LIFE]:"/> - </panel> - <panel name="first_life_image_panel"> - <text name="title_rw_descr_text" value="Реальный мир:"/> - </panel> - <text name="title_member_text" value="Обитатель SL с:"/> - <text name="title_acc_status_text" value="Статус аккаунта:"/> - <text name="title_partner_text" value="Партнер:"/> - <panel name="partner_data_panel"> - <text initial_value="(получение информации)" name="partner_text"/> - </panel> - <text name="title_groups_text" value="Группы:"/> - </panel> - </scroll_container> - </layout_panel> - </layout_stack> - <layout_stack name="layout_verb_buttons"> - <layout_panel name="profile_buttons_panel"> - <layout_stack name="bottom_bar_ls"> - <layout_panel name="add_friend_btn_lp"> - <button label="В друзья" name="add_friend" tool_tip="Предложить дружбу этому жителю"/> - </layout_panel> - <layout_panel name="im_btn_lp"> - <button label="IM" name="im" tool_tip="Начать сеанс IM"/> - </layout_panel> - <layout_panel name="call_btn_lp"> - <button label="Позвонить" name="call" tool_tip="Позвонить этому жителю"/> - </layout_panel> - <layout_panel name="chat_btn_lp"> - <button label="Телепортироваться" name="teleport" tool_tip="Предложить телепортацию"/> - </layout_panel> - <layout_panel name="overflow_btn_lp"> - <menu_button label="▼" name="overflow_btn" tool_tip="Заплатить жителю или поделиться с ним вещами"/> - </layout_panel> - </layout_stack> - </layout_panel> - </layout_stack> -</panel> diff --git a/indra/newview/skins/default/xui/ru/panel_profile_view.xml b/indra/newview/skins/default/xui/ru/panel_profile_view.xml deleted file mode 100644 index c97c5afc01..0000000000 --- a/indra/newview/skins/default/xui/ru/panel_profile_view.xml +++ /dev/null @@ -1,20 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes"?> -<panel name="panel_target_profile"> - <string name="status_online"> - Онлайн - </string> - <string name="status_offline"> - Оффлайн - </string> - <text name="display_name_label" value="Экранное имя:"/> - <text name="solo_username_label" value="Имя пользователя:"/> - <text name="status" value="Онлайн"/> - <text name="user_name_small" value="Взгляни-ка, друг, какое длиннющее имя"/> - <button name="copy_to_clipboard" tool_tip="Копировать в буфер обмена"/> - <text name="user_label" value="Имя пользователя:"/> - <tab_container name="tabs"> - <panel label="ПРОФИЛЬ" name="panel_profile"/> - <panel label="ПОДБОРКА" name="panel_picks"/> - <panel label="ЗАМЕТКИ И ДОСТУП" name="panel_notes"/> - </tab_container> -</panel> diff --git a/indra/newview/skins/default/xui/ru/panel_region_estate.xml b/indra/newview/skins/default/xui/ru/panel_region_estate.xml index d957274026..27ec10b323 100644 --- a/indra/newview/skins/default/xui/ru/panel_region_estate.xml +++ b/indra/newview/skins/default/xui/ru/panel_region_estate.xml @@ -18,16 +18,16 @@ <check_box label="Глобальное время" name="use_global_time_check"/> <check_box label="Фиксированное" name="fixed_sun_check"/> <slider label="Фаза" name="sun_hour_slider"/> - <check_box label="Разрешить публичный доступ" name="externally_visible_check"/> + <check_box label="Разрешить общий доступ" name="externally_visible_check"/> <text name="Only Allow"> - Ограничить доступ проверкой: + Разрешить доступ только аккаунтам с подтверждением: </text> <check_box label="Информации об оплате в файле" name="limit_payment" tool_tip="Банить нераспознанных жителей"/> <check_box label="Проверка возраста" name="limit_age_verified" tool_tip="Банить жителей, не прошедших проверку возраста. Более подробная информация находится здесь: [SUPPORT_SITE]."/> <check_box label="Разрешить голосовое общение" name="voice_chat_check"/> <check_box label="Разрешить прямой телепорт" name="allow_direct_teleport"/> <button label="Применить" name="apply_btn"/> - <button label="Отправить сообщение в землевладение..." name="message_estate_btn"/> + <button label="Сообщение в землевладение..." name="message_estate_btn"/> <button label="Выкинуть жителя с землевладения..." name="kick_user_from_estate_btn"/> <text name="estate_manager_label"> Менеджеры землевладения: diff --git a/indra/newview/skins/default/xui/ru/panel_region_general.xml b/indra/newview/skins/default/xui/ru/panel_region_general.xml index 97bfbbeeea..8559be6c9e 100644 --- a/indra/newview/skins/default/xui/ru/panel_region_general.xml +++ b/indra/newview/skins/default/xui/ru/panel_region_general.xml @@ -31,10 +31,10 @@ <text label="Дозволенность" name="access_text"> Категория: </text> - <icons_combo_box label="Умеренная" name="access_combo"> + <icons_combo_box label="Умеренный" name="access_combo"> <icons_combo_box.item label="Для взрослых" name="Adult" value="42"/> - <icons_combo_box.item label="Умеренная" name="Mature" value="21"/> - <icons_combo_box.item label="Общая" name="PG" value="13"/> + <icons_combo_box.item label="Умеренный" name="Mature" value="21"/> + <icons_combo_box.item label="Общий" name="PG" value="13"/> </icons_combo_box> <button label="Применить" name="apply_btn"/> <button label="Телепортировать домой одного жителя..." name="kick_btn"/> diff --git a/indra/newview/skins/default/xui/ru/panel_region_terrain.xml b/indra/newview/skins/default/xui/ru/panel_region_terrain.xml index 08258b5034..af25565226 100644 --- a/indra/newview/skins/default/xui/ru/panel_region_terrain.xml +++ b/indra/newview/skins/default/xui/ru/panel_region_terrain.xml @@ -7,13 +7,13 @@ неизвестен </text> <spinner label="Уровень воды" name="water_height_spin"/> - <spinner label="Верхняя точка ландшафта" name="terrain_raise_spin"/> - <spinner label="Нижняя точка ландшафта" name="terrain_lower_spin"/> + <spinner label="Верх. точка ландшафта" name="terrain_raise_spin"/> + <spinner label="Ниж. точка ландшафта" name="terrain_lower_spin"/> <text name="detail_texture_text"> - Текстуры ландшафта (требования: 512x512, 24-разрядные, TGA) + Текстуры ландшафта (требования: 512x512, 24-битные, TGA) </text> <text name="height_text_lbl"> - 1 (Нижняя) + 1 (Низ) </text> <text name="height_text_lbl2"> 2 @@ -22,7 +22,7 @@ 3 </text> <text name="height_text_lbl4"> - 4 (Верхняя) + 4 (Верх) </text> <text name="height_text_lbl5"> Диапазон высот текстур @@ -31,7 +31,7 @@ Эти значения определяют степень смешивания наложенных текстур. </text> <text name="height_text_lbl11"> - Измеряются в метрах. Значение «Нижняя» – это МАКСИМАЛЬНАЯ высота текстуры №1, а значение «Верхняя» – это МИНИМАЛЬНАЯ высота текстуры №4. + Измеряются в метрах. Значение «Низ» – это МАКСИМАЛЬНАЯ высота текстуры №1, а значение «Верх» – это МИНИМАЛЬНАЯ высота текстуры №4. </text> <text name="height_text_lbl6"> Северо-запад @@ -39,20 +39,20 @@ <text name="height_text_lbl7"> Северо-восток </text> - <spinner label="Нижняя" name="height_start_spin_1"/> - <spinner label="Нижняя" name="height_start_spin_3"/> - <spinner label="Верхняя" name="height_range_spin_1"/> - <spinner label="Верхняя" name="height_range_spin_3"/> + <spinner label="Низ" name="height_start_spin_1"/> + <spinner label="Низ" name="height_start_spin_3"/> + <spinner label="Верх" name="height_range_spin_1"/> + <spinner label="Верх" name="height_range_spin_3"/> <text name="height_text_lbl8"> Юго-запад </text> <text name="height_text_lbl9"> Юго-восток </text> - <spinner label="Нижняя" name="height_start_spin_0"/> - <spinner label="Нижняя" name="height_start_spin_2"/> - <spinner label="Верхняя" name="height_range_spin_0"/> - <spinner label="Верхняя" name="height_range_spin_2"/> + <spinner label="Низ" name="height_start_spin_0"/> + <spinner label="Низ" name="height_start_spin_2"/> + <spinner label="Верх" name="height_range_spin_0"/> + <spinner label="Верх" name="height_range_spin_2"/> <button label="Загрузить ландшафт RAW..." name="download_raw_btn" tool_tip="Доступно только землевладельцам, не менеджерам"/> <button label="Передать ландшафт RAW..." name="upload_raw_btn" tool_tip="Доступно только землевладельцам, не менеджерам"/> <button label="Зафиксировать пределы" name="bake_terrain_btn" tool_tip="Установить высоту ландшафта по средней точке между верхней и нижней точками"/> diff --git a/indra/newview/skins/default/xui/ru/panel_region_texture.xml b/indra/newview/skins/default/xui/ru/panel_region_texture.xml index 369beb1e9b..c4b35a536d 100644 --- a/indra/newview/skins/default/xui/ru/panel_region_texture.xml +++ b/indra/newview/skins/default/xui/ru/panel_region_texture.xml @@ -7,10 +7,10 @@ неизвестен </text> <text name="detail_texture_text"> - Текстуры ландшафта (требования: 512x512, 24-разрядные TGA-файлы) + Текстуры ландшафта (требования: 512x512, 24-битные TGA-файлы) </text> <text name="height_text_lbl"> - 1 (нижняя) + 1 (низ) </text> <text name="height_text_lbl2"> 2 @@ -19,7 +19,7 @@ 3 </text> <text name="height_text_lbl4"> - 4 (верхняя) + 4 (верх) </text> <text name="height_text_lbl5"> Диапазон высот текстур @@ -30,25 +30,25 @@ <text name="height_text_lbl7"> Северо-восток </text> - <spinner label="Низко" name="height_start_spin_1"/> - <spinner label="Низко" name="height_start_spin_3"/> - <spinner label="Высоко" name="height_range_spin_1"/> - <spinner label="Высоко" name="height_range_spin_3"/> + <spinner label="Низ" name="height_start_spin_1"/> + <spinner label="Низ" name="height_start_spin_3"/> + <spinner label="Верх" name="height_range_spin_1"/> + <spinner label="Верх" name="height_range_spin_3"/> <text name="height_text_lbl8"> Юго-запад </text> <text name="height_text_lbl9"> Юго-восток </text> - <spinner label="Низко" name="height_start_spin_0"/> - <spinner label="Низко" name="height_start_spin_2"/> - <spinner label="Высоко" name="height_range_spin_0"/> - <spinner label="Высоко" name="height_range_spin_2"/> + <spinner label="Низ" name="height_start_spin_0"/> + <spinner label="Низ" name="height_start_spin_2"/> + <spinner label="Верх" name="height_range_spin_0"/> + <spinner label="Верх" name="height_range_spin_2"/> <text name="height_text_lbl10"> Эти значения отображают диапазон перекрытия вышеуказанных текстур. </text> <text name="height_text_lbl11"> - Измеряется в метрах, НИЖНЕЕ значение – это МАКСИМАЛЬНАЯ высота текстуры №1, ВЕРХНЕЕ значение – это МИНИМАЛЬНАЯ высота текстуры №4. + Измеряется в метрах, значение «Низ» – это МАКСИМАЛЬНАЯ высота текстуры №1, значение «Верх» – это МИНИМАЛЬНАЯ высота текстуры №4. </text> <button label="Применить" name="apply_btn"/> </panel> diff --git a/indra/newview/skins/default/xui/ru/panel_sound_devices.xml b/indra/newview/skins/default/xui/ru/panel_sound_devices.xml index 4a57ed4f4f..98dab288a3 100644 --- a/indra/newview/skins/default/xui/ru/panel_sound_devices.xml +++ b/indra/newview/skins/default/xui/ru/panel_sound_devices.xml @@ -20,6 +20,6 @@ </text> <slider_bar initial_value="1.0" name="mic_volume_slider" tool_tip="Измените значение, используя ползунок"/> <text name="wait_text"> - Ожидайте + Подождите </text> </panel> diff --git a/indra/newview/skins/default/xui/ru/panel_status_bar.xml b/indra/newview/skins/default/xui/ru/panel_status_bar.xml index ddf63d69c2..6822244196 100644 --- a/indra/newview/skins/default/xui/ru/panel_status_bar.xml +++ b/indra/newview/skins/default/xui/ru/panel_status_bar.xml @@ -17,12 +17,9 @@ </panel.string> <panel name="balance_bg"> <text name="balance" tool_tip="Щелкните для обновления вашего баланса L$" value="L$20"/> - <button label="КУПИТЬ L$" name="buyL" tool_tip="Щелкните для покупки L$"/> + <button label="Купить L$" name="buyL" tool_tip="Щелкните для покупки L$"/> + <button label="Торговый центр" name="goShop" tool_tip="Открыть торговый центр Second Life"/> </panel> - <combo_box name="mode_combo" tool_tip="Выберите режим. Основной – для быстрого и простого ознакомления с игрой, а также общения. Расширенный – для доступа к более широким возможностям."> - <combo_box.item label="Основной режим" name="Basic"/> - <combo_box.item label="Расширенный режим" name="Advanced"/> - </combo_box> <text name="TimeText" tool_tip="Текущее время (тихоокеанское)"> 00:00 (тихоокеанское время) </text> diff --git a/indra/newview/skins/default/xui/ru/strings.xml b/indra/newview/skins/default/xui/ru/strings.xml index 44440ea542..7fef5797a9 100644 --- a/indra/newview/skins/default/xui/ru/strings.xml +++ b/indra/newview/skins/default/xui/ru/strings.xml @@ -872,7 +872,7 @@ support@secondlife.com. Новое сопоставление элементов управления </string> <string name="AnimateYourAvatar"> - Анимация аватара + Анимировать ваш аватар </string> <string name="AttachToYourAvatar"> Прикрепить к аватару @@ -899,10 +899,10 @@ support@secondlife.com. Нет подключения </string> <string name="SIM_ACCESS_PG"> - Общая + Общий </string> <string name="SIM_ACCESS_MATURE"> - Умеренная + Умеренный </string> <string name="SIM_ACCESS_ADULT"> Для взрослых @@ -1073,7 +1073,7 @@ support@secondlife.com. Тату не надето </string> <string name="physics_not_worn"> - Физические данные не учитываются + Физика не учитывается </string> <string name="invalid_not_worn"> ошибка @@ -1124,7 +1124,7 @@ support@secondlife.com. Создать тату </string> <string name="create_new_physics"> - Создать физические данные + Создать физику </string> <string name="create_new_invalid"> ошибка @@ -1273,6 +1273,9 @@ support@secondlife.com. <string name="Marketplace Error Internal Import"> Ошибка. Эта вещь создает проблему. Повторите попытку позже. </string> + <string name="Open landmarks"> + Открыть закладки + </string> <string name="no_transfer" value="(не передается)"/> <string name="no_modify" value="(не изменяется)"/> <string name="no_copy" value="(не копируется)"/> @@ -1434,7 +1437,7 @@ support@secondlife.com. Резина </string> <string name="Light"> - Освещение + Светлый </string> <string name="KBShift"> SHIFT @@ -1614,7 +1617,7 @@ support@secondlife.com. Есть информация о платежах </string> <string name="PaymentInfoOnFile"> - Есть информация в файле о платежах + Есть зарегистрир. информация о платежах </string> <string name="NoPaymentInfoOnFile"> Нет информации о платежах @@ -1937,7 +1940,7 @@ support@secondlife.com. Новый скрипт </string> <string name="BusyModeResponseDefault"> - У жителя, которому вы адресовали сообщение, задан статус «Не беспокоить». Ваше сообщение все равно будет отображено на панели IM для просмотра позже. + У адресата вашего сообщения задан статус «Не беспокоить». Ваше сообщение все равно будет отображено на панели IM для просмотра позже. </string> <string name="MuteByName"> (по имени) @@ -2337,13 +2340,13 @@ support@secondlife.com. Не удается получить описание формата пикселей </string> <string name="MBTrueColorWindow"> - Для работы [APP_NAME] необходим режим True Color (32 разряда). -Задайте в настройках дисплея 32-разрядный режим цвета. + Для работы [APP_NAME] необходим режим True Color (32 бита). +Задайте в настройках дисплея 32-битный режим цвета. </string> <string name="MBAlpha"> - Не удается запустить [APP_NAME] из-за отсутствия доступа к 8-разрядному альфа-каналу. Обычно эта проблема возникает из-за неполадок с драйвером видеокарты. + Не удается запустить [APP_NAME] из-за отсутствия доступа к 8-битному альфа-каналу. Обычно эта проблема возникает из-за неполадок с драйвером видеокарты. Установите новые драйверы видеокарты. -Также задайте для монитора 32-разрядный режим True Color (Панель управления > Экран > Параметры). +Также задайте для монитора 32-битный режим True Color (Панель управления > Экран > Параметры). Если это сообщение продолжает отображаться, обратитесь на сайт [SUPPORT_SITE]. </string> <string name="MBPixelFmtSetErr"> @@ -2360,7 +2363,7 @@ support@secondlife.com. Если это сообщение продолжает отображаться, обратитесь на сайт [SUPPORT_SITE]. </string> <string name="5 O'Clock Shadow"> - Легкие сумерки + Жидкие </string> <string name="All White"> Полностью белые @@ -2378,10 +2381,10 @@ support@secondlife.com. Прикреплено </string> <string name="Attached Earlobes"> - Примыкающие мочки + Приросшие мочки </string> <string name="Back Fringe"> - Черная челка + Затылок </string> <string name="Baggy"> С мешками @@ -2414,7 +2417,7 @@ support@secondlife.com. Большая голова </string> <string name="Big Pectorals"> - Большие грудные мышцы + Выпуклая грудь </string> <string name="Big Spikes"> Большие «шипы» @@ -2600,7 +2603,7 @@ support@secondlife.com. Кустистые брови </string> <string name="Bushy Hair"> - Вьющиеся волосы + Пышные </string> <string name="Butt Size"> Размер зада @@ -2633,7 +2636,7 @@ support@secondlife.com. Ямка на подбородке </string> <string name="Chin Curtains"> - Борода в стиле Линкольна + Шкиперская бородка </string> <string name="Chin Depth"> Толщина подбородка @@ -2651,10 +2654,10 @@ support@secondlife.com. Переход от подбородка к шее </string> <string name="Clear"> - Очистить + Чистый </string> <string name="Cleft"> - Щелкой + Ямка </string> <string name="Close Set Eyes"> Близко посаженные @@ -2708,7 +2711,7 @@ support@secondlife.com. Темнее </string> <string name="Deep"> - Глубокий + Глубоко </string> <string name="Default Heels"> Стандартные каблуки @@ -2723,7 +2726,7 @@ support@secondlife.com. Вниз </string> <string name="Duffle Bag"> - Сумка из плотной ткани + Больше </string> <string name="Ear Angle"> Оттопыренность ушей @@ -2753,7 +2756,7 @@ support@secondlife.com. Открытость глаз </string> <string name="Eye Pop"> - Взмах ресницами + Вытаращить глаз </string> <string name="Eye Size"> Размер глаз @@ -2771,7 +2774,7 @@ support@secondlife.com. Высота бровей </string> <string name="Eyebrow Points"> - Точки бровей + Кончики бровей </string> <string name="Eyebrow Size"> Размер бровей @@ -2789,10 +2792,10 @@ support@secondlife.com. Выпученные глаза </string> <string name="Face Shear"> - Овал лица + Перекос лица </string> <string name="Facial Definition"> - Описание лица + Черты лица </string> <string name="Far Set Eyes"> Широко расставленные глаза @@ -2813,7 +2816,7 @@ support@secondlife.com. С манжетами </string> <string name="Flat"> - Плоский + Плоские </string> <string name="Flat Butt"> Плоский зад @@ -2900,7 +2903,7 @@ support@secondlife.com. Размер кисти </string> <string name="Handlebars"> - Рули + Длинные усы </string> <string name="Head Length"> Длина головы @@ -2921,10 +2924,10 @@ support@secondlife.com. Форма каблука </string> <string name="Height"> - Высота + Рост </string> <string name="High"> - высокий + Высокие </string> <string name="High Heels"> Высокий каблук @@ -2936,7 +2939,7 @@ support@secondlife.com. Высокая платформа </string> <string name="High and Tight"> - Высокое и плотное + Высокий и плотный </string> <string name="Higher"> Выше @@ -2948,13 +2951,13 @@ support@secondlife.com. Ширина бедер </string> <string name="In"> - Внутри + Внутрь </string> <string name="In Shdw Color"> Цвет внутренних теней </string> <string name="In Shdw Opacity"> - Прозрачность внутренних теней + Прозрачность внутр. теней </string> <string name="Inner Eye Corner"> Внутренние уголки глаз @@ -2987,13 +2990,13 @@ support@secondlife.com. Щеки </string> <string name="Knee Angle"> - Угол коленей + Угол колен </string> <string name="Knock Kneed"> - Ровность ног + Колченогие </string> <string name="Large"> - Большие + Больше </string> <string name="Large Hands"> Большие кисти @@ -3026,7 +3029,7 @@ support@secondlife.com. Меньше притяжения </string> <string name="Less Love"> - Меньше любви + Меньше </string> <string name="Less Muscles"> Меньше мышц @@ -3041,7 +3044,7 @@ support@secondlife.com. Меньше округлости </string> <string name="Less Saddle"> - Меньше седлообразности + Меньше </string> <string name="Less Square"> Меньше угловатости @@ -3050,16 +3053,16 @@ support@secondlife.com. Меньше объема </string> <string name="Less soul"> - Меньше энергичности + Меньше </string> <string name="Lighter"> Светлее </string> <string name="Lip Cleft"> - Зазор между губ + Ямка между губ </string> <string name="Lip Cleft Depth"> - Глубина зазора + Глубина ямки </string> <string name="Lip Fullness"> Полнота губ @@ -3125,28 +3128,28 @@ support@secondlife.com. Отложения на талии </string> <string name="Low"> - Низкое + Низкие </string> <string name="Low Heels"> Низкий каблук </string> <string name="Low Jaw"> - Низкая челюсть + Челюсть низко </string> <string name="Low Platforms"> Низкая платформа </string> <string name="Low and Loose"> - Низкое и свободное + Низкий и свободный </string> <string name="Lower"> Ниже </string> <string name="Lower Bridge"> - Ниже переносицу + Спинка носа </string> <string name="Lower Cheeks"> - Ниже щеки + Щеки ниже </string> <string name="Male"> Мужчина @@ -3182,7 +3185,7 @@ support@secondlife.com. Больше помады </string> <string name="More Love"> - Больше любви + Больше </string> <string name="More Lower Lip"> Больше нижняя губа @@ -3191,7 +3194,7 @@ support@secondlife.com. Больше мышц </string> <string name="More Muscular"> - Более мускулистое + Больше мышц </string> <string name="More Rosy"> Больше румянца @@ -3200,7 +3203,7 @@ support@secondlife.com. Больше округлости </string> <string name="More Saddle"> - Более седлообразно + Больше </string> <string name="More Sloped"> Более наклонный @@ -3215,10 +3218,10 @@ support@secondlife.com. Более вертикальный </string> <string name="More Volume"> - Больший объем + Больше объема </string> <string name="More soul"> - Больше духа + Больше </string> <string name="Moustache"> Усы @@ -3248,7 +3251,7 @@ support@secondlife.com. Узко </string> <string name="Narrow Back"> - Узкая спина + Узко сзади </string> <string name="Narrow Front"> Узкий перед @@ -3257,7 +3260,7 @@ support@secondlife.com. Узкие губы </string> <string name="Natural"> - Естественно + Естественный </string> <string name="Neck Length"> Длина шеи @@ -3353,13 +3356,13 @@ support@secondlife.com. Оранжевый </string> <string name="Out"> - Снаружи + Наружу </string> <string name="Out Shdw Color"> Цвет внешних теней </string> <string name="Out Shdw Opacity"> - Прозрачность внешних теней + Прозрачность внеш. теней </string> <string name="Outer Eye Corner"> Внешние уголки глаз @@ -3374,7 +3377,7 @@ support@secondlife.com. Глубокий прикус </string> <string name="Package"> - Пакет + Гульфик </string> <string name="Painted Nails"> Покрашенные @@ -3383,7 +3386,7 @@ support@secondlife.com. Бледный </string> <string name="Pants Crotch"> - Мотня + Шаг </string> <string name="Pants Fit"> Облегающие брюки @@ -3401,13 +3404,13 @@ support@secondlife.com. Пробор </string> <string name="Part Bangs"> - Челки с пробором + Челка с пробором </string> <string name="Pectorals"> Грудные мышцы </string> <string name="Pigment"> - Пигмент + Пигментация </string> <string name="Pigtails"> Хвосты по бокам @@ -3425,7 +3428,7 @@ support@secondlife.com. Ширина платформы </string> <string name="Pointy"> - Острый + Острые </string> <string name="Pointy Heels"> Острый каблук @@ -3437,13 +3440,13 @@ support@secondlife.com. Пышная юбка </string> <string name="Pop Left Eye"> - Хлопнуть левым глазом + Левый глаз </string> <string name="Pop Right Eye"> - Хлопнуть правым глазом + Правый глаз </string> <string name="Puffy"> - Припухшие + Пухлые </string> <string name="Puffy Eyelids"> Припухлость век @@ -3470,13 +3473,13 @@ support@secondlife.com. Румянец </string> <string name="Ruddy"> - Румяное + Румяный </string> <string name="Rumpled Hair"> Взъерошенные </string> <string name="Saddle Bags"> - Седельные сумки + Галифе </string> <string name="Scrawny Leg"> Сухопарая нога @@ -3485,25 +3488,25 @@ support@secondlife.com. Разделить </string> <string name="Shallow"> - Мелкий + Мелко </string> <string name="Shear Back"> - Очертание спины + Скос сзади </string> <string name="Shear Face"> - Овал лица + Перекос лица </string> <string name="Shear Front"> - Очертание спереди + Скос спереди </string> <string name="Shear Left Up"> - Очертание левой верхней части + Скос влево вверх </string> <string name="Shear Right Up"> - Очертание правой верхней части + Скос вправо вверх </string> <string name="Sheared Back"> - Уменьшенная спина + Уменьшено сзади </string> <string name="Sheared Front"> Уменьшено спереди @@ -3530,7 +3533,7 @@ support@secondlife.com. Высота обуви </string> <string name="Short"> - Короче + Ниже </string> <string name="Short Arms"> Короткие руки @@ -3605,7 +3608,7 @@ support@secondlife.com. Разрез: справа </string> <string name="Small"> - Маленький + Меньше </string> <string name="Small Hands"> Маленькие кисти @@ -3617,13 +3620,13 @@ support@secondlife.com. Гладко </string> <string name="Smooth Hair"> - Приглаженные волосы + Приглаженные </string> <string name="Socks Length"> Длина носков </string> <string name="Soulpatch"> - Бородка под губой + Эспаньолка </string> <string name="Sparse"> Жидкие @@ -3659,13 +3662,13 @@ support@secondlife.com. Зачесанные вперед </string> <string name="Tall"> - Высокие + Выше </string> <string name="Taper Back"> - Градуировка сзади + Конус сзади </string> <string name="Taper Front"> - Градуировка спереди + Конус спереди </string> <string name="Thick Heels"> Широкий каблук @@ -3734,16 +3737,16 @@ support@secondlife.com. Неестественный </string> <string name="Upper Bridge"> - Переносицу выше + Переносица </string> <string name="Upper Cheeks"> Щеки выше </string> <string name="Upper Chin Cleft"> - Ямку на подбородке выше + Ямка на подбородке выше </string> <string name="Upper Eyelid Fold"> - Складку века выше + Складка верхнего века </string> <string name="Upturned"> Вверх @@ -3755,7 +3758,7 @@ support@secondlife.com. Высота талии </string> <string name="Well-Fed"> - Упитанное + Упитанные </string> <string name="White Hair"> Белые волосы @@ -3764,7 +3767,7 @@ support@secondlife.com. Широко </string> <string name="Wide Back"> - Широкая спина + Широко сзади </string> <string name="Wide Front"> Широкий перед @@ -4248,8 +4251,8 @@ support@secondlife.com. <string name="Female - Wow"> Женщина – ух ты! </string> - <string name="/bow1"> - /поклон1 + <string name="/bow"> + /поклониться </string> <string name="/clap"> /хлопнуть @@ -4772,4 +4775,172 @@ support@secondlife.com. <string name="ParticleHiding"> Частицы скрыты </string> + <string name="Command_AboutLand_Label"> + О земле + </string> + <string name="Command_Appearance_Label"> + Внешность + </string> + <string name="Command_Avatar_Label"> + Аватар + </string> + <string name="Command_Build_Label"> + Строительство + </string> + <string name="Command_Chat_Label"> + Чат + </string> + <string name="Command_Compass_Label"> + Компас + </string> + <string name="Command_Destinations_Label"> + Пункты + </string> + <string name="Command_Gestures_Label"> + Жесты + </string> + <string name="Command_HowTo_Label"> + Инструкции + </string> + <string name="Command_Inventory_Label"> + Инвентарь + </string> + <string name="Command_Map_Label"> + Карта + </string> + <string name="Command_Marketplace_Label"> + Торговый центр + </string> + <string name="Command_MiniMap_Label"> + Миникарта + </string> + <string name="Command_Move_Label"> + Переместить + </string> + <string name="Command_People_Label"> + Люди + </string> + <string name="Command_Picks_Label"> + Подборка + </string> + <string name="Command_Places_Label"> + Места + </string> + <string name="Command_Preferences_Label"> + Настройки + </string> + <string name="Command_Profile_Label"> + Профиль + </string> + <string name="Command_Search_Label"> + Поиск + </string> + <string name="Command_Snapshot_Label"> + Снимок + </string> + <string name="Command_Speak_Label"> + Говорить + </string> + <string name="Command_View_Label"> + Вид + </string> + <string name="Command_Voice_Label"> + Настройки голоса + </string> + <string name="Command_AboutLand_Tooltip"> + Информация о посещаемой вами земле + </string> + <string name="Command_Appearance_Tooltip"> + Изменить аватар + </string> + <string name="Command_Avatar_Tooltip"> + Выбор аватара + </string> + <string name="Command_Build_Tooltip"> + Построение объектов и формирование ландшафта + </string> + <string name="Command_Chat_Tooltip"> + Обменивайтесь текстовыми репликами с людьми вокруг вас + </string> + <string name="Command_Compass_Tooltip"> + Компас + </string> + <string name="Command_Destinations_Tooltip"> + Интересные места + </string> + <string name="Command_Gestures_Tooltip"> + Жесты для аватара + </string> + <string name="Command_HowTo_Tooltip"> + Выполнение типичных задач + </string> + <string name="Command_Inventory_Tooltip"> + Просмотр и использование вашего имущества + </string> + <string name="Command_Map_Tooltip"> + Карта мира + </string> + <string name="Command_Marketplace_Tooltip"> + Покупки + </string> + <string name="Command_MiniMap_Tooltip"> + Показать людей поблизости + </string> + <string name="Command_Move_Tooltip"> + Перемещение аватара + </string> + <string name="Command_People_Tooltip"> + Друзья, группы и люди поблизости + </string> + <string name="Command_Picks_Tooltip"> + Места, которые будут показаны в вашем профиле как избранное + </string> + <string name="Command_Places_Tooltip"> + Сохраненные вами места + </string> + <string name="Command_Preferences_Tooltip"> + Настройки + </string> + <string name="Command_Profile_Tooltip"> + Редактирование или просмотр вашего профиля + </string> + <string name="Command_Search_Tooltip"> + Поиск мест, событий, людей + </string> + <string name="Command_Snapshot_Tooltip"> + Сделать снимок + </string> + <string name="Command_Speak_Tooltip"> + Говорите с людьми вокруг вас с помощью микрофона + </string> + <string name="Command_View_Tooltip"> + Изменение угла камеры + </string> + <string name="Command_Voice_Tooltip"> + Громкость звонков и голосов окружающих вас людей + </string> + <string name="Retain%"> + Остаток% + </string> + <string name="Detail"> + Детализация + </string> + <string name="Better Detail"> + Более детально + </string> + <string name="Surface"> + Поверхность + </string> + <string name="Solid"> + Сплошной + </string> + <string name="Wrap"> + Оболочка + </string> + <string name="Preview"> + Предварительный просмотр + </string> + <string name="Normal"> + Нормальный + </string> </strings> diff --git a/indra/newview/skins/default/xui/ru/teleport_strings.xml b/indra/newview/skins/default/xui/ru/teleport_strings.xml index 6a7a181046..296562e6f1 100644 --- a/indra/newview/skins/default/xui/ru/teleport_strings.xml +++ b/indra/newview/skins/default/xui/ru/teleport_strings.xml @@ -20,6 +20,10 @@ Системе не удалось выполнить подключение телепорта. Повторите попытку позже. </message> + <message name="NoHelpIslandTP"> + Вы не можете телепортироваться обратно на Остров Помощи. +Телепортируйтесь на Общественный Остров Помощи, чтобы повторить обучение + </message> <message name="noaccess_tport"> У вас нет доступа к точке назначения этого телепорта. </message> diff --git a/indra/newview/skins/default/xui/tr/floater_about.xml b/indra/newview/skins/default/xui/tr/floater_about.xml index 2fdbafdfb4..993ec42958 100644 --- a/indra/newview/skins/default/xui/tr/floater_about.xml +++ b/indra/newview/skins/default/xui/tr/floater_about.xml @@ -10,7 +10,7 @@ <floater.string name="AboutPosition"> <nolink>[HOSTNAME]</nolink> ([HOSTIP]) üzerinde bulunan [REGION] içerisinde [POSITION_0,number,1], [POSITION_1,number,1], [POSITION_2,number,1] konumundasınız [SERVER_VERSION] -[[SERVER_RELEASE_NOTES_URL] [Sürüm Notları]] +[SERVER_RELEASE_NOTES_URL] </floater.string> <floater.string name="AboutSystem"> CPU: [CPU] @@ -37,22 +37,25 @@ Ses Sunucusu Sürümü: [VOICE_VERSION] <floater.string name="AboutTraffic"> Kaybolan Paketler: [PACKETS_LOST,number,0]/[PACKETS_IN,number,0] ([PACKETS_PCT,number,1]%) </floater.string> + <floater.string name="ErrorFetchingServerReleaseNotesURL"> + Sunucu sürümü notları URL'si alınırken hata oluştu. + </floater.string> <tab_container name="about_tab"> <panel label="Bilgi" name="support_panel"> <button label="Panoya Kopyala" name="copy_btn"/> </panel> <panel label="Katkıda Bulunanlar" name="credits_panel"> <text name="linden_intro"> - Second Life, Lindens'lar tarafından geliştirilmiştir: + Second Life, Linden'lar tarafından geliştirilmiştir: </text> <text name="contrib_intro"> - açık kaynak kod katkısında bulunanlar: + Açık kaynak kod katkısında bulunanlar: </text> <text_editor name="contrib_names"> Geçici Ad çalıştırma sırasında değiştirilir </text_editor> <text name="trans_intro"> - çevirileri yapanlar: + Çevirileri yapanlar: </text> <text_editor name="trans_names"> Geçici Ad çalıştırma sırasında değiştirilir diff --git a/indra/newview/skins/default/xui/tr/floater_about_land.xml b/indra/newview/skins/default/xui/tr/floater_about_land.xml index 6256f954b2..e0350964b5 100644 --- a/indra/newview/skins/default/xui/tr/floater_about_land.xml +++ b/indra/newview/skins/default/xui/tr/floater_about_land.xml @@ -102,7 +102,7 @@ <text name="For Sale: Price L$[PRICE]."> Fiyat: L$[PRICE] (L$[PRICE_PER_SQM]/m²) </text> - <button label="Arazi Sat" name="Sell Land..."/> + <button label="Araziyi Sat" name="Sell Land..."/> <text name="For sale to"> Şu Alıcıya Satılık: [BUYER] </text> @@ -212,19 +212,19 @@ Bölge Nesne Bonusu Faktörü: [BONUS] </text> <text name="Simulator primitive usage:"> - İlkel Kullanım: + Bölge kapasitesi: </text> <text name="objects_available"> [COUNT] / [MAX] ([AVAILABLE]) uygun </text> <text name="Primitives parcel supports:"> - Prim parsel desteği: + Parsel arazi kapasitesi: </text> <text name="object_contrib_text"> [COUNT] </text> <text name="Primitives on parcel:"> - Parseldeki prims: + Parsel arazi etkisi: </text> <text name="total_objects_text"> [COUNT] @@ -307,7 +307,7 @@ Sadece büyük parseller aramada görünür. İtme Yok (Bölge Geçersiz Kılma) </panel.string> <panel.string name="see_avs_text"> - Bu parseldeki sakinleri gör ve onlarla sohbet et + Parseldeki sakinleri gör ve onlarla sohbet et </panel.string> <text name="allow_label"> Sakinlere şunun için izin ver: @@ -336,7 +336,7 @@ Sadece büyük parseller aramada görünür. <check_box label="İtme Yok" name="PushRestrictCheck" tool_tip="Komut dosyalarının itmesini önler Bu seçeneğin işaretlenmesi arazinizdeki bozucu davranışları önlemeye yardımcı olabilir."/> <check_box label="Konumu Arama sonuçlarında göster (L$30/hafta)" name="ShowDirectoryCheck" tool_tip="Arama sonuçlarında bu parsel görünsün"/> <combo_box name="land category with adult"> - <combo_box.item label="Herhangi Bir Kategori" name="item0"/> + <combo_box.item label="Herh. Bir Kategori" name="item0"/> <combo_box.item label="Linden Konumu" name="item1"/> <combo_box.item label="Yetişkin" name="item2"/> <combo_box.item label="Sanat ve Kültür" name="item3"/> @@ -352,7 +352,7 @@ Sadece büyük parseller aramada görünür. <combo_box.item label="Diğer" name="item12"/> </combo_box> <combo_box name="land category"> - <combo_box.item label="Herhangi Bir Kategori" name="item0"/> + <combo_box.item label="Herh. Bir Kategori" name="item0"/> <combo_box.item label="Linden Konumu" name="item1"/> <combo_box.item label="Sanat ve Kültür" name="item3"/> <combo_box.item label="İş" name="item4"/> @@ -372,7 +372,7 @@ Sadece büyük parseller aramada görünür. </text> <texture_picker name="snapshot_ctrl" tool_tip="Bir resim seçmek için tıklayın"/> <text name="allow_label5"> - Diğer parsellerdeki Sakinlere şunun için izin verin: + Diğer parsel Sakinlerine şunun için izin verin: </text> <check_box label="Avatarları Gör" name="SeeAvatarsCheck" tool_tip="Diğer parsellerdeki sakinlerin bu parseldeki sakinleri görmesine ve onlarla sohbet etmesine, sizin de onları görüp, onlarla sohbet etmenize imkan tanır."/> <text name="landing_point"> @@ -419,7 +419,7 @@ Sadece büyük parseller aramada görünür. piksel </text> <text name="Options:"> - Seçenekler: + Seçenklr.: </text> <check_box label="Döngü" name="media_loop" tool_tip="Ortamı döngüsel olarak oynat. Ortamın oynatılması bittiğinde baştan tekrar başlayacaktır."/> </panel> @@ -448,7 +448,7 @@ Sadece büyük parseller aramada görünür. (Gayrimenkul tarafından tanımlanır) </panel.string> <panel.string name="allow_public_access"> - Kamusal Erişime İzin Ver ([MATURITY]) (Not: Bunun işaretinin kaldırılması yasaklama çizgileri oluşturacaktır) + Kamusal Erişime İzin Ver ([MATURITY]) (Not: İşaret kaldırılırsa yasaklama çizgileri oluşur) </panel.string> <panel.string name="estate_override"> Bu seçeneklerden biri veya daha fazlası gayrimenkul düzeyinde ayarlanır @@ -462,7 +462,7 @@ Sadece büyük parseller aramada görünür. <check_box label="Dosyadaki ödeme bilgileri [ESTATE_PAYMENT_LIMIT]" name="limit_payment" tool_tip="Tanınmayan Sakinleri Yasakla."/> <check_box label="Yaş doğrulama [ESTATE_AGE_LIMIT]" name="limit_age_verified" tool_tip="Yaşını doğrulamayan Sakinleri yasakla Daha fazla bilgi için [SUPPORT_SITE] adresini ziyaret edin."/> <check_box label="Grup Erişimine İzin Ver: [GROUP]" name="GroupCheck" tool_tip="Genel sekmesinde grup ayarla."/> - <check_box label="Geçiş haklarını şuna sat:" name="PassCheck" tool_tip="Bu parsele geçici erişim verir"/> + <check_box label="Geçiş haklr. şuna sat:" name="PassCheck" tool_tip="Bu parsele geçici erişim verir"/> <combo_box name="pass_combo"> <combo_box.item label="Herkes" name="Anyone"/> <combo_box.item label="Grup" name="Group"/> diff --git a/indra/newview/skins/default/xui/tr/floater_avatar.xml b/indra/newview/skins/default/xui/tr/floater_avatar.xml new file mode 100644 index 0000000000..fc9e3c8a9b --- /dev/null +++ b/indra/newview/skins/default/xui/tr/floater_avatar.xml @@ -0,0 +1,2 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes"?> +<floater name="Avatar" title="AVATAR SEÇİCİ"/> diff --git a/indra/newview/skins/default/xui/tr/floater_buy_currency.xml b/indra/newview/skins/default/xui/tr/floater_buy_currency.xml index 48cd93ccf9..6608fd72e1 100644 --- a/indra/newview/skins/default/xui/tr/floater_buy_currency.xml +++ b/indra/newview/skins/default/xui/tr/floater_buy_currency.xml @@ -46,7 +46,7 @@ L$ [AMT] </text> <text name="currency_links"> - [http://www.secondlife.com/my/account/payment_method_management.php ödeme yöntemi] | [http://www.secondlife.com/my/account/currency.php para birimi | [http://www.secondlife.com/my/account/exchange_rates.php döviz kurları] + [http://www.secondlife.com/my/account/payment_method_management.php ödeme yöntemi] | [http://www.secondlife.com/my/account/currency.php para birimi </text> <text name="exchange_rate_note"> En son döviz kurunu görmek için miktarı yeniden girin. diff --git a/indra/newview/skins/default/xui/tr/floater_buy_land.xml b/indra/newview/skins/default/xui/tr/floater_buy_land.xml index 4d43157f99..7b43af2ea4 100644 --- a/indra/newview/skins/default/xui/tr/floater_buy_land.xml +++ b/indra/newview/skins/default/xui/tr/floater_buy_land.xml @@ -53,7 +53,7 @@ Daha küçük bir alan seçmeyi deneyin. Arazi alma bilgileri çekilirken hata oluştu. </floater.string> <floater.string name="buying_will"> - Bu arazinin satın alınması sonucu: + Arazinin satın alınması sonucu: </floater.string> <floater.string name="buying_for_group"> Bu arazinin grup için satın alınması sonucu: @@ -185,7 +185,7 @@ Daha küçük bir alan seçmeyi deneyin. nesnelerle satılır </text> <text name="info_action"> - Bu arazinin satın alınması sonucu: + Arazinin satın alınması sonucu: </text> <text name="error_message"> Bir şeyler yolunda değil. diff --git a/indra/newview/skins/default/xui/tr/floater_camera.xml b/indra/newview/skins/default/xui/tr/floater_camera.xml index 066b7cc933..c92d4e9db4 100644 --- a/indra/newview/skins/default/xui/tr/floater_camera.xml +++ b/indra/newview/skins/default/xui/tr/floater_camera.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> -<floater name="camera_floater"> +<floater name="camera_floater" title="GÖSTER"> <floater.string name="rotate_tooltip"> Odak Etrafında Kamerayı Döndür </floater.string> @@ -9,15 +9,6 @@ <floater.string name="move_tooltip"> Kamerayı Yukarı ve Aşağı, Sola ve Sağa Hareket Ettir </floater.string> - <floater.string name="camera_modes_title"> - Kamera modları - </floater.string> - <floater.string name="pan_mode_title"> - Yörünge Değişimi - Yakınlaştırma - Kamerayı Çevirme - </floater.string> - <floater.string name="presets_mode_title"> - Ön Ayarlı Görünümler - </floater.string> <floater.string name="free_mode_title"> Nesneyi Göster </floater.string> diff --git a/indra/newview/skins/default/xui/tr/floater_chat_bar.xml b/indra/newview/skins/default/xui/tr/floater_chat_bar.xml new file mode 100644 index 0000000000..d2385e6be3 --- /dev/null +++ b/indra/newview/skins/default/xui/tr/floater_chat_bar.xml @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes"?> +<floater name="chat_bar" title="YAKINDAKİ SOHBET"> + <panel> + <line_editor label="Sohbet etmek için buraya tıklayın." name="chat_box" tool_tip="Söylemek için Enter, bağırmak için Ctrl+Enter yapın"/> + <button name="show_nearby_chat" tool_tip="yakın sohbet günlüğünü gösterir/gizler"/> + </panel> +</floater> diff --git a/indra/newview/skins/default/xui/tr/floater_day_cycle_options.xml b/indra/newview/skins/default/xui/tr/floater_day_cycle_options.xml deleted file mode 100644 index 9e706d9892..0000000000 --- a/indra/newview/skins/default/xui/tr/floater_day_cycle_options.xml +++ /dev/null @@ -1,95 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes"?> -<floater name="Day Cycle Floater" title="GÜN DÖNGÜSÜ DÜZENLEYİCİ"> - <tab_container name="Day Cycle Tabs"> - <panel label="Gün Döngüsü" name="Day Cycle"> - <multi_slider initial_value="0" name="WLTimeSlider"/> - <multi_slider initial_value="0" name="WLDayCycleKeys"/> - <text name="WL12am"> - 12öö - </text> - <text name="WL3am"> - 3öö - </text> - <text name="WL6am"> - 6öö - </text> - <text name="WL9amHash"> - 9öö - </text> - <text name="WL12pmHash"> - 12ös - </text> - <text name="WL3pm"> - 3ös - </text> - <text name="WL6pm"> - 6ös - </text> - <text name="WL9pm"> - 9ös - </text> - <text name="WL12am2"> - 12öö - </text> - <text name="WL12amHash"> - | - </text> - <text name="WL3amHash"> - I - </text> - <text name="WL6amHash"> - | - </text> - <text name="WL9amHash2"> - I - </text> - <text name="WL12pmHash2"> - | - </text> - <text name="WL3pmHash"> - I - </text> - <text name="WL6pmHash"> - | - </text> - <text name="WL9pmHash"> - I - </text> - <text name="WL12amHash2"> - | - </text> - <button label="Anahtar Ekle" label_selected="Anahtar Ekle" name="WLAddKey"/> - <button label="Anahtarı Sil" label_selected="Anahtarı Sil" name="WLDeleteKey"/> - <text name="WLCurKeyFrameText"> - Anahtar Kare Ayarları: - </text> - <text name="WLCurKeyTimeText"> - Anahtar Zamanı: - </text> - <spinner label="Saat" name="WLCurKeyHour"/> - <spinner label="Dak" name="WLCurKeyMin"/> - <text name="WLCurKeyTimeText2"> - Anahtar Ön Ayarı: - </text> - <combo_box label="Ön Ayar" name="WLKeyPresets"/> - <text name="DayCycleText"> - Yasla: - </text> - <combo_box label="5 dak" name="WLSnapOptions"/> - <text name="DayCycleText2"> - Döngü Uzunluğu: - </text> - <spinner label="Saat" name="WLLengthOfDayHour"/> - <spinner label="Dak" name="WLLengthOfDayMin"/> - <spinner label="San" name="WLLengthOfDaySec"/> - <text name="DayCycleText3"> - Önizleme: - </text> - <button label="Oyna" label_selected="Oyna" name="WLAnimSky"/> - <button label="Durdur!" label_selected="Durdur" name="WLStopAnimSky"/> - <button label="Gayrimenkul Saati Kullan" label_selected="Gayrimenkul Saatine Git" name="WLUseLindenTime"/> - <button label="Test Gününü Kaydet" label_selected="Test Gününü Kaydet" name="WLSaveDayCycle"/> - <button label="Test Gününü Yükle" label_selected="Test Gününü Yükle" name="WLLoadDayCycle"/> - </panel> - </tab_container> -</floater> diff --git a/indra/newview/skins/default/xui/tr/floater_destinations.xml b/indra/newview/skins/default/xui/tr/floater_destinations.xml new file mode 100644 index 0000000000..4504366d63 --- /dev/null +++ b/indra/newview/skins/default/xui/tr/floater_destinations.xml @@ -0,0 +1,2 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes"?> +<floater name="Destinations" title="HEDEF KONUMLAR"/> diff --git a/indra/newview/skins/default/xui/tr/floater_edit_day_cycle.xml b/indra/newview/skins/default/xui/tr/floater_edit_day_cycle.xml index a5cbe3a416..4be1068dcc 100644 --- a/indra/newview/skins/default/xui/tr/floater_edit_day_cycle.xml +++ b/indra/newview/skins/default/xui/tr/floater_edit_day_cycle.xml @@ -22,10 +22,10 @@ Not: Ön ayarınızın adını değiştirirseniz, yeni bir ön ayar oluşturursunuz ve mevcut ön ayar değişmez. </text> <text name="hint_item1"> - - Belirli gökyüzü ayarlarını ve zamanı düzenlemek için bir sekmeye tıklayın. + - Birine tıklayarak gökyüzü ayarlarını/zamanı düzenleyin. </text> <text name="hint_item2"> - - Geçiş sürelerini ayarlamak için sekmelere tıklayın ve bunları sürükleyin. + - Sekmelere tıklayıp sürükleyerek geçiş sürlrn. ayarlayın. </text> <text name="hint_item3"> - Gün döngünüzü önizlemek için fırçayı kullanın. @@ -36,31 +36,31 @@ <button label="Anahtar Ekle" label_selected="Anahtar Ekle" name="WLAddKey"/> <button label="Anahtarı Sil" label_selected="Anahtarı Sil" name="WLDeleteKey"/> <text name="WL12am"> - 12öö + 12 </text> <text name="WL3am"> - 3öö + 3 </text> <text name="WL6am"> - 6öö + 6 </text> <text name="WL9amHash"> - 9öö + 9 </text> <text name="WL12pmHash"> - 12ös + 24 </text> <text name="WL3pm"> - 3ös + 15 </text> <text name="WL6pm"> - 6ös + 18 </text> <text name="WL9pm"> - 9ös + 21 </text> <text name="WL12am2"> - 12öö + 12 </text> <text name="WL12amHash"> | @@ -97,7 +97,7 @@ <text name="WLCurKeyTimeText"> Zaman: </text> - <time name="time" value="6:00 ÖÖ"/> + <time name="time" value="6:00"/> <check_box label="Bunu yeni gün döngüm yap" name="make_default_cb"/> <button label="Kaydet" name="save"/> <button label="İptal" name="cancel"/> diff --git a/indra/newview/skins/default/xui/tr/floater_edit_sky_preset.xml b/indra/newview/skins/default/xui/tr/floater_edit_sky_preset.xml index 16564963e5..0e9f86148d 100644 --- a/indra/newview/skins/default/xui/tr/floater_edit_sky_preset.xml +++ b/indra/newview/skins/default/xui/tr/floater_edit_sky_preset.xml @@ -86,21 +86,21 @@ | </text> <text name="WL12am"> - 12öö + 12 </text> <text name="WL6am"> - 6öö + 6 </text> <text name="WL12pmHash"> - 12ös + 24 </text> <text name="WL6pm"> - 6ös + 18 </text> <text name="WL12am2"> - 12öö + 12 </text> - <time name="WLDayTime" value="6:00 ÖÖ"/> + <time name="WLDayTime" value="6:00"/> <text name="WLEastAngleText"> Doğu Açısı </text> diff --git a/indra/newview/skins/default/xui/tr/floater_environment_settings.xml b/indra/newview/skins/default/xui/tr/floater_environment_settings.xml index 943e1e810d..e702da7e1b 100644 --- a/indra/newview/skins/default/xui/tr/floater_environment_settings.xml +++ b/indra/newview/skins/default/xui/tr/floater_environment_settings.xml @@ -18,7 +18,7 @@ <combo_box.item label="-Bir ön ayar seçin-" name="item0"/> </combo_box> <text name="sky_dayc_settings_title"> - Gökyüzü / Gün Döngüsü + Gökyüzü/Gün Dön. </text> <radio_group name="sky_dayc_settings_radio_group"> <radio_item label="Sabit gökyüzü" name="my_sky_settings"/> diff --git a/indra/newview/skins/default/xui/tr/floater_fast_timers.xml b/indra/newview/skins/default/xui/tr/floater_fast_timers.xml new file mode 100644 index 0000000000..5736bda45e --- /dev/null +++ b/indra/newview/skins/default/xui/tr/floater_fast_timers.xml @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes"?> +<floater name="fast_timers"> + <string name="pause"> + Duraklat + </string> + <string name="run"> + Koş + </string> + <button label="Duraklat" name="pause_btn"/> +</floater> diff --git a/indra/newview/skins/default/xui/tr/floater_god_tools.xml b/indra/newview/skins/default/xui/tr/floater_god_tools.xml index ce7f7badcc..26e5ebd18b 100644 --- a/indra/newview/skins/default/xui/tr/floater_god_tools.xml +++ b/indra/newview/skins/default/xui/tr/floater_god_tools.xml @@ -67,7 +67,7 @@ <button label="Hedefin *Herhangi Bir* Arazideki Komut Dosyalı Nesnelerini Sil" label_selected="Hedefin *Herhangi Bir* Arazideki Komut Dosyalı Nesnelerini Sil" name="Delete Target's Scripted Objects On *Any* Land" tool_tip="Bu bölgede hedefe ait olan tüm komut dosyalı nesneleri silin. (kopya yok) nesneler geri döndürülür."/> <button label="Hedefin *TÜM* Nesnelerini Sil" label_selected="Hedefin *TÜM* Nesnelerini Sil" name="Delete *ALL* Of Target's Objects" tool_tip="Bu bölgede hedefe ait olan tüm nesneleri silin. (kopya yok) nesneler geri döndürülür."/> <button label="En Çok Çarpışanlar" label_selected="En Çok Çarpışanlar" name="Get Top Colliders" tool_tip="En dar fazda geri aramaları yaşayan nesnelerin listesini alır"/> - <button label="En Çok Komut Dosyası Çalıştıranlar" label_selected="En Çok Komut Dosyası Çalıştıranlar" name="Get Top Scripts" tool_tip="Komut dosyalarını çalıştırırken en çok zaman harcayan nesnelerin listesini alır"/> + <button label="En Çok Komut Dsy. Çalştr." label_selected="En Çok Komut Dsy. Çalştr." name="Get Top Scripts" tool_tip="Komut dosyalarını çalıştırırken en çok zaman harcayan nesnelerin listesini alır"/> <button label="Komut dosyaları özeti" label_selected="Komut dosyaları özeti" name="Scripts digest" tool_tip="Tüm komut dosyalarının ve her birinin ne kadar kullanıldığının listesini alır"/> </panel> <panel label="Talep" name="request"> diff --git a/indra/newview/skins/default/xui/tr/floater_how_to.xml b/indra/newview/skins/default/xui/tr/floater_how_to.xml new file mode 100644 index 0000000000..a42fe0b122 --- /dev/null +++ b/indra/newview/skins/default/xui/tr/floater_how_to.xml @@ -0,0 +1,2 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes"?> +<floater name="floater_how_to" title="NASIL YAPILIR"/> diff --git a/indra/newview/skins/default/xui/tr/floater_joystick.xml b/indra/newview/skins/default/xui/tr/floater_joystick.xml index 31d819743c..4a27aac3c1 100644 --- a/indra/newview/skins/default/xui/tr/floater_joystick.xml +++ b/indra/newview/skins/default/xui/tr/floater_joystick.xml @@ -3,10 +3,10 @@ <floater.string name="NoDevice"> cihaz tespit edilmedi </floater.string> - <check_box label="Oyun Çubuğunu Etkinleştir:" name="enable_joystick"/> - <spinner label="X Eksen Haritalama" name="JoystickAxis1"/> - <spinner label="Y Eksen Haritalama" name="JoystickAxis2"/> - <spinner label="Z Eksen Haritalama" name="JoystickAxis0"/> + <check_box label="Oyun Çub. Etkşt:" name="enable_joystick"/> + <spinner label="X Eks. Haritalama" name="JoystickAxis1"/> + <spinner label="Y Eks. Haritalama" name="JoystickAxis2"/> + <spinner label="Z Eks. Haritalama" name="JoystickAxis0"/> <spinner label="Eğim Haritalama" name="JoystickAxis4"/> <spinner label="Düşey Sapma Haritalama" name="JoystickAxis5"/> <spinner label="Tilt Haritalama" name="JoystickAxis3"/> diff --git a/indra/newview/skins/default/xui/tr/floater_map.xml b/indra/newview/skins/default/xui/tr/floater_map.xml index 36ec097cc4..7d6c314f04 100644 --- a/indra/newview/skins/default/xui/tr/floater_map.xml +++ b/indra/newview/skins/default/xui/tr/floater_map.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> -<floater name="Map" title=""> +<floater name="Map" title="MİNİ-HARİTA"> <floater.string name="ToolTipMsg"> [REGION](Haritayı açmak için çift tıkla, yatay hareket için shift çek) </floater.string> @@ -7,7 +7,7 @@ [REGION](Işınlamak için çift tıkla, yatay hareket için shift çek) </floater.string> <floater.string name="mini_map_caption"> - MİNİHARİTA + Mini-harita </floater.string> <text label="K" name="floater_map_north"> K diff --git a/indra/newview/skins/default/xui/tr/floater_model_preview.xml b/indra/newview/skins/default/xui/tr/floater_model_preview.xml index 7388d236ed..339545f96e 100644 --- a/indra/newview/skins/default/xui/tr/floater_model_preview.xml +++ b/indra/newview/skins/default/xui/tr/floater_model_preview.xml @@ -1,10 +1,8 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> -<floater name="Model Preview" title="Modeli Karşıya Yükle"> - <string name="status_idle"> - Boşta - </string> +<floater name="Model Preview" title="MODELİ KARŞIYA YÜKLE"> + <string name="status_idle"/> <string name="status_parse_error"> - Dae ayrıştırma sorunu - ayrıntılar için günlüğe bakın. + Hata: Tarih ayrıştırma sorunu - ayrıntılar için günlüğe bakın. </string> <string name="status_reading_file"> Yükleniyor... @@ -51,6 +49,9 @@ <string name="mesh_status_missing_lod"> Gereken ayrıntı seviyesi eksik. </string> + <string name="mesh_status_invalid_material_list"> + Ayrıntı seviyesi malzemeleri, referans modelin bir alt kümesi değil. + </string> <string name="layer_all"> Tümü </string> @@ -63,188 +64,211 @@ <string name="tbd"> ileride belirlenecektir </string> - <text name="name_label"> - Ad: - </text> - <text name="lod_label"> - Önizleme: - </text> - <combo_box name="preview_lod_combo" tool_tip="Önizleme işlemesinde görülecek ayrıntı seviyesi"> - <combo_item name="high"> - Ayrıntı Seviyesi: Yüksek - </combo_item> - <combo_item name="medium"> - Ayrıntı Seviyesi: Orta - </combo_item> - <combo_item name="low"> - Ayrıntı Seviyesi: Düşük - </combo_item> - <combo_item name="lowest"> - Ayrıntı Seviyesi: En Düşük - </combo_item> - </combo_box> - <text name="warning_title"> - UYARI: - </text> - <text name="warning_message"> - Bu modelin Second Life sunucularına nihai karşıya yüklemesini tamamlayamayacaksınız. Örgü modellerinin karşıya yüklenmesi için etkinleştirmenin [[VURL] nasıl yapılacağını öğrenin]. - </text> - <text name="weights_text"> - Karşıdan Yükle: -Fizik: -Sunucu: - -Prim eşdeğerleri: - </text> - <text name="weights"> - [ST] -[PH] -[SIM] - -[EQ] - </text> - <tab_container name="import_tab"> - <panel label="Ayrıntı Seviyesi" name="lod_panel"> - <text name="lod_table_header"> - Ayrıntı Seviyesini Seç: - </text> - <text name="high_label" value="Yüksek"/> - <text name="high_triangles" value="0"/> - <text name="high_vertices" value="0"/> - <text name="medium_label" value="Orta"/> - <text name="medium_triangles" value="0"/> - <text name="medium_vertices" value="0"/> - <text name="low_label" value="Düşük"/> - <text name="low_triangles" value="0"/> - <text name="low_vertices" value="0"/> - <text name="lowest_label" value="En Düşük"/> - <text name="lowest_triangles" value="0"/> - <text name="lowest_vertices" value="0"/> - <text name="lod_table_footer"> - Ayrıntı Seviyesi: [DETAIL] - </text> - <radio_group name="lod_file_or_limit" value="lod_from_file"> - <radio_item label="Dosyadan yükle" name="lod_from_file"/> - <radio_item label="Otomatik oluştur" name="lod_auto_generate"/> - <radio_item label="Hiçbiri" name="lod_none"/> - </radio_group> - <button label="Gözat..." name="lod_browse"/> - <combo_box name="lod_mode"> - <combo_item name="triangle_limit"> - Üçgen Limiti - </combo_item> - <combo_item name="error_threshold"> - Hata Eşiği - </combo_item> - </combo_box> - <text name="build_operator_text"> - İnşa İşleci: + <panel name="left_panel"> + <panel name="model_name_representation_panel"> + <text name="name_label"> + Model adı: </text> - <text name="queue_mode_text"> - Kuyruk Modu: + <text name="model_category_label"> + Bu modelin temsil ettiği... </text> - <combo_box name="build_operator"> - <combo_item name="edge_collapse"> - Kenar Bütünleştirme - </combo_item> - <combo_item name="half_edge_collapse"> - Yarım Kenar Bütünleştirme - </combo_item> - </combo_box> - <combo_box name="queue_mode"> - <combo_item name="greedy"> - Açgözlü - </combo_item> - <combo_item name="lazy"> - Tembel - </combo_item> - <combo_item name="independent"> - Bağımsız - </combo_item> + <combo_box name="model_category_combo"> + <combo_item label="Birini Seçin..." name="Choose one"/> + <combo_item label="Avatar şekli" name="Avatar shape"/> + <combo_item label="Avatar aksesuarı" name="Avatar attachment"/> + <combo_item label="Hareket eden nesne (araç, hayvan)" name="Moving object (vehicle, animal)"/> + <combo_item label="Bina Bileşeni" name="Building Component"/> + <combo_item label="Büyük, hareketsiz, vs." name="Large, non moving etc"/> + <combo_item label="Daha küçük, hareketsiz, vs." name="Smaller, non-moving etc"/> + <combo_item label="Bunlardan herhangi biri değil" name="Not really any of these"/> </combo_box> - <text name="border_mode_text"> - Sınır Modu: - </text> - <text name="share_tolderance_text"> - Paylaşma Toleransı: - </text> - <combo_box name="border_mode"> - <combo_item name="border_unlock"> - Kilidi Kaldır - </combo_item> - <combo_item name="border_lock"> - Kilitle - </combo_item> - </combo_box> - <text name="crease_label"> - Kıvrım Açısı: - </text> - <spinner name="crease_angle" value="75"/> </panel> - <panel label="Fizik" name="physics_panel"> - <panel name="physics geometry"> - <radio_group name="physics_load_radio" value="physics_load_from_file"> - <radio_item label="Dosya:" name="physics_load_from_file"/> - <radio_item label="Ayrıntı Seviyesini Kullan:" name="physics_use_lod"/> - </radio_group> - <combo_box name="physics_lod_combo" tool_tip="Fizik şekli için kullanılacak ayrıntı seviyesi"> - <combo_item name="physics_lowest"> - En Düşük - </combo_item> - <combo_item name="physics_low"> - Düşük - </combo_item> - <combo_item name="physics_medium"> - Orta - </combo_item> - <combo_item name="physics_high"> - Yüksek - </combo_item> - </combo_box> - <button label="Gözat..." name="physics_browse"/> + <tab_container name="import_tab"> + <panel label="Ayrıntı Seviyesi" name="lod_panel" title="Ayrıntı Seviyesi"> + <text initial_value="Kaynak" name="source" value="Kaynak"/> + <text initial_value="Üçgenler" name="triangles" value="Üçgenler"/> + <text initial_value="Köşeler" name="vertices" value="Köşeler"/> + <text initial_value="Yüksek" name="high_label" value="Yüksek"/> + <button label="Gözat..." name="lod_browse_high"/> + <text initial_value="0" name="high_triangles" value="0"/> + <text initial_value="0" name="high_vertices" value="0"/> + <text initial_value="Orta" name="medium_label" value="Orta"/> + <button label="Gözat..." name="lod_browse_medium"/> + <text initial_value="0" name="medium_triangles" value="0"/> + <text initial_value="0" name="medium_vertices" value="0"/> + <text initial_value="Düşük" name="low_label" value="Düşük"/> + <button label="Gözat..." name="lod_browse_low"/> + <text initial_value="0" name="low_triangles" value="0"/> + <text initial_value="0" name="low_vertices" value="0"/> + <text initial_value="En Düşük" name="lowest_label" value="En Düşük"/> + <button label="Gözat..." name="lod_browse_lowest"/> + <text initial_value="0" name="lowest_triangles" value="0"/> + <text initial_value="0" name="lowest_vertices" value="0"/> + <check_box label="Normalleri Oluştur" name="gen_normals"/> + <text initial_value="Kıvrım Açısı:" name="crease_label" value="Kıvrım Açısı:"/> + <spinner name="crease_angle" value="75"/> </panel> - <panel name="physics analysis"> - <slider label="Düzeltme:" name="Smooth"/> - <check_box label="Delikleri Kapa (yavaş)" name="Close Holes (Slow)"/> - <button label="Çözümle" name="Decompose"/> - <button label="İptal" name="decompose_cancel"/> + <panel label="Fizik" name="physics_panel"> + <panel name="physics geometry"> + <text name="first_step_name"> + 1. Adım: Ayrıntı Seviyesi + </text> + <combo_box name="physics_lod_combo" tool_tip="Fizik şekli için kullanılacak ayrıntı"> + <combo_item name="choose_one"> + Birini seçin... + </combo_item> + <combo_item name="physics_high"> + Yüksek + </combo_item> + <combo_item name="physics_medium"> + Orta + </combo_item> + <combo_item name="physics_low"> + Düşük + </combo_item> + <combo_item name="physics_lowest"> + En Düşük + </combo_item> + <combo_item name="load_from_file"> + Dosyadan + </combo_item> + </combo_box> + <button label="Gözat..." name="physics_browse"/> + </panel> + <panel name="physics analysis"> + <text name="method_label"> + 2. Adım: Çözümle + </text> + <text name="analysis_method_label"> + Yöntem: + </text> + <text name="quality_label"> + Kalite: + </text> + <text name="smooth_method_label"> + Düzeltme: + </text> + <check_box label="Delikleri Kapat" name="Close Holes (Slow)"/> + <button label="Çözümle" name="Decompose"/> + <button label="İptal" name="decompose_cancel"/> + </panel> + <panel name="physics simplification"> + <text name="second_step_label"> + 3. Adım: Basitleştir + </text> + <text name="simp_method_header"> + Yöntem: + </text> + <text name="pass_method_header"> + Geçişler: + </text> + <text name="Detail Scale label"> + Ayrıntı ölçeği: + </text> + <text name="Retain%_label"> + Koru: + </text> + <combo_box name="Combine Quality" value="1"/> + <button label="Basitleştir" name="Simplify"/> + <button label="İptal" name="simplify_cancel"/> + </panel> + <panel name="physics info"> + <text name="results_text"> + Sonuçlar: + </text> + <text name="physics_triangles"> + Üçgenler: [TRIANGLES], + </text> + <text name="physics_points"> + Köşeler: [POINTS], + </text> + <text name="physics_hulls"> + Gövdeler: [HULLS] + </text> + </panel> </panel> - <panel name="physics simplification"> - <slider label="Geçişler:" name="Combine Quality"/> - <slider label="Ayrıntı Ölçeği:" name="Detail Scale"/> - <slider label="Koru:" name="Retain%"/> - <button label="Basitleştir" name="Simplify"/> - <button label="İptal" name="simplify_cancel"/> - </panel> - <panel name="physics info"> - <slider label="Önizleme Yayılımı:" name="physics_explode"/> - <text name="physics_triangles"> - Üçgenler: [TRIANGLES] + <panel label="Karşıya yükleme seçenekleri" name="modifiers_panel"> + <text name="scale_label"> + Ölçek (1=ölçekleme yok): + </text> + <spinner name="import_scale" value="1.0"/> + <text name="dimensions_label"> + Boyutlar: </text> - <text name="physics_points"> - Köşeler: [POINTS] + <text name="import_dimensions"> + [X] X [Y] X [Z] </text> - <text name="physics_hulls"> - Gövdeler: [HULLS] + <check_box label="Dokuları dahil et" name="upload_textures"/> + <text name="include_label"> + Sadece avatar modelleri için: </text> + <check_box label="Dış katman ağırlığını dahil et" name="upload_skin"/> + <check_box label="Eklem konumlarını dahil et" name="upload_joints"/> + <text name="pelvis_offset_label"> + Z kayması (avatarı kaldırmak veya indirmek için): + </text> + <spinner name="pelvis_offset" value="0.0"/> </panel> - </panel> - <panel label="Değiştiriciler" name="modifiers_panel"> - <spinner name="import_scale" value="1.0"/> - <text name="import_dimensions"> - [X] x [Y] x [Z] m + </tab_container> + <panel name="weights_and_warning_panel"> + <button label="Ağırlıkları ve ücreti hesapla" name="calculate_btn" tool_tip="Ağırlıkları ve ücreti hesapla"/> + <button label="İptal" name="cancel_btn"/> + <button label="Karşıya Yükle" name="ok_btn" tool_tip="Simülatöre karşıya yükle"/> + <button label="Ayarları temizle ve formu sıfırla" name="reset_btn"/> + <text name="upload_fee"> + Karşıya yükleme ücreti: L$ [FEE] + </text> + <text name="prim_weight"> + Arazi etkisi [EQ] + </text> + <text name="download_weight"> + Karşıdan Yükle: [ST] + </text> + <text name="physics_weight"> + Fizik: [PH] + </text> + <text name="server_weight"> + Sunucu: [SIM] + </text> + <text name="warning_title"> + NOT: + </text> + <text name="warning_message"> + Örgü modellerini karşıya yüklemeye hakkınız yok. Nasıl onaylanacağınızı [[VURL] öğrenin]. + </text> + <text name="status"> + [STATUS] </text> - <check_box label="Dokular" name="upload_textures"/> - <check_box label="Dış katman ağırlığı" name="upload_skin"/> - <check_box label="Eklem konumları" name="upload_joints"/> - <spinner name="pelvis_offset" value="0.0"/> </panel> - </tab_container> - <text name="upload_fee"> - Karşıya yükleme ücreti: L$ [FEE] + </panel> + <text name="lod_label"> + Önizleme: </text> - <button label="Varsayılanlara ayarla" name="reset_btn" tool_tip="Varsayılanlara ayarla"/> - <button label="Ağırlıkları ve ücreti hesapla" name="calculate_btn" tool_tip="Ağırlıkları ve ücreti hesapla"/> - <button label="Karşıya Yükle" name="ok_btn" tool_tip="Simülatöre karşıya yükle"/> - <button label="İptal" name="cancel_btn"/> + <panel name="right_panel"> + <combo_box name="preview_lod_combo" tool_tip="Önizleme işlemesinde görülecek ayrıntı seviyesi"> + <combo_item name="high"> + Yüksek + </combo_item> + <combo_item name="medium"> + Orta + </combo_item> + <combo_item name="low"> + Düşük + </combo_item> + <combo_item name="lowest"> + En Düşük + </combo_item> + </combo_box> + <text name="label_display"> + Ekran... + </text> + <check_box label="Kenarlar" name="show_edges"/> + <check_box label="Fizik" name="show_physics"/> + <check_box label="Dokular" name="show_textures"/> + <check_box label="Dış katman ağırlıkları" name="show_skin_weight"/> + <check_box label="Eklemler" name="show_joint_positions"/> + <text name="physics_explode_label"> + Önizleme Yayılımı: + </text> + </panel> </floater> diff --git a/indra/newview/skins/default/xui/tr/floater_model_wizard.xml b/indra/newview/skins/default/xui/tr/floater_model_wizard.xml index a0a67e2def..108d20cfac 100644 --- a/indra/newview/skins/default/xui/tr/floater_model_wizard.xml +++ b/indra/newview/skins/default/xui/tr/floater_model_wizard.xml @@ -6,26 +6,20 @@ <button label="2. Optimize et" name="optimize_btn"/> <button label="1. Dosya Seç" name="choose_file_btn"/> <panel name="choose_file_panel"> - <panel name="choose_file_header_panel"> - <text name="choose_file_header_text"> + <panel name="header_panel"> + <text name="header_text"> Model dosyasını seçin </text> </panel> - <panel name="choose_file_content_panel"> + <panel name="content"> <text name="advanced_users_text"> Gelişmiş kullanıcılar: Eğer 3B içerik oluşturma araçlarını kullanmayı biliyorsanız, Gelişmiş Karşıya Yükleyiciyi kullanmak isteyebilirsiniz. </text> <button label="Gelişmişe geç" name="switch_to_advanced"/> - <text name="choose_model_file_label"> + <text name="Cache location"> Karşıya yüklenecek model dosyasını seçin </text> <button label="Gözat..." label_selected="Gözat..." name="browse"/> - <text name="support_collada_text"> - Second Life, COLLADA (.dae) dosyalarını destekler - </text> - <text name="dimensions_label"> - Boyutlar (metre): - </text> <text name="dimensions"> X Y Z </text> @@ -38,18 +32,15 @@ </panel> </panel> <panel name="optimize_panel"> - <panel name="optimize_header_panel"> - <text name="optimize_header_text"> + <panel name="header_panel"> + <text name="header_text"> Modeli optimize et </text> </panel> - <text name="optimize_hint"> + <text name="description"> Modeli performans için optimize ettik. İstiyorsanız daha da ayarlayabilirsiniz. </text> - <panel name="optimize_content_panel"> - <text name="generating_lod_label"> - Ayrıntı Seviyesi Oluşturuluyor - </text> + <panel name="content"> <text name="high_detail_text"> Ayrıntı Seviyesi Oluştur: Yüksek </text> @@ -64,123 +55,64 @@ </text> </panel> <panel name="content2"> - <text name="optimize_performance_text"> - Performans - </text> - <text name="optimize_faster_rendering_text"> - Daha hızlı işleme -Daha az ayrıntı -Daha düşük prim ağırlığı - </text> - <text name="optimize_accuracy_text"> - Hassasiyet - </text> - <text name="optimize_slower_rendering_text"> - Daha yavaş işleme -Daha çok ayrıntı -Daha yüksek prim ağırlığı - </text> - <text name="accuracy_slider_mark1"> - ' - </text> - <text name="accuracy_slider_mark2"> - ' - </text> - <text name="accuracy_slider_mark3"> - ' - </text> <button label="Geometri hesaplarını tekrar yap" name="recalculate_geometry_btn"/> - <text name="geometry_preview_label"> + <text name="lod_label"> Geometri önizleme </text> <combo_box name="preview_lod_combo" tool_tip="Önizleme işlemesinde görülecek ayrıntı seviyesi"> - <combo_item name="preview_lod_high"> + <combo_item name="high"> Çok ayrıntı </combo_item> - <combo_item name="preview_lod_medium"> + <combo_item name="medium"> Orta düzey ayrıntı </combo_item> - <combo_item name="preview_lod_low"> + <combo_item name="low"> Az ayrıntı </combo_item> - <combo_item name="preview_lod_lowest"> + <combo_item name="lowest"> En az ayrıntı </combo_item> </combo_box> </panel> </panel> <panel name="physics_panel"> - <panel name="physics_header_panel"> - <text name="physics_header_text"> + <panel name="header_panel"> + <text name="header_text"> Fizik ayarlarını yap </text> </panel> - <text name="physics_hint"> + <text name="description"> Modelin dış gövdesi için bir şekil oluşturacağız. Modelinizin amacına uygun olarak şeklin ayrıntı seviyesini belirleyin. </text> - <panel name="physics_content_panel"> - <text name="physics_performance_text"> - Performans - </text> - <text name="physics_faster_rendering_text"> - Daha hızlı işleme -Daha az ayrıntı -Daha düşük prim ağırlığı - </text> - <text name="physics_accuracy_text"> - Hassasiyet - </text> - <text name="physics_slower_dendering_text"> - Daha yavaş işleme -Daha çok ayrıntı -Daha yüksek prim ağırlığı - </text> - <text name="physics_example_1"> - Örnekler: -Hareketli nesneler -Uçan nesneler -Araçlar - </text> - <text name="physics_example_2"> - Örnekler: -Küçük statik nesneler -Daha az ayrıntılı nesneler -Basit eşyalar - </text> - <text name="physics_example_3"> - Örnekler: -Statik nesneler -Ayrıntılı nesneler -Binalar - </text> + <panel name="content"> <button label="Fizik hesaplarını tekrar yap" name="recalculate_physics_btn"/> <button label="Tekrar hesaplanıyor..." name="recalculating_physics_btn"/> - <text name="physics_preview_label"> + <text name="lod_label"> Fizik önizleme </text> <combo_box name="preview_lod_combo2" tool_tip="Önizleme işlemesinde görülecek ayrıntı seviyesi"> - <combo_item name="preview_lod2_high"> + <combo_item name="high"> Çok ayrıntı </combo_item> - <combo_item name="preview_lod2_medium"> + <combo_item name="medium"> Orta düzey ayrıntı </combo_item> - <combo_item name="preview_lod2_low"> + <combo_item name="low"> Az ayrıntı </combo_item> - <combo_item name="preview_lod2_lowest"> + <combo_item name="lowest"> En az ayrıntı </combo_item> </combo_box> </panel> </panel> <panel name="review_panel"> - <panel name="review_header_panel"> - <text name="review_header_text"> + <panel name="header_panel"> + <text name="header_text"> İncele </text> </panel> - <panel name="review_content_panel"> + <panel name="content"> <text name="review_prim_equiv"> Parsele/bölgeye etkisi: [EQUIV] prim eşdeğerleri </text> @@ -193,8 +125,8 @@ Binalar </panel> </panel> <panel name="upload_panel"> - <panel name="upload_header_panel"> - <text name="upload_header_text"> + <panel name="header_panel"> + <text name="header_text"> Karşıya yükleme bitti </text> </panel> diff --git a/indra/newview/skins/default/xui/tr/floater_moveview.xml b/indra/newview/skins/default/xui/tr/floater_moveview.xml index 0d7c118f1e..74ed613a62 100644 --- a/indra/newview/skins/default/xui/tr/floater_moveview.xml +++ b/indra/newview/skins/default/xui/tr/floater_moveview.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> -<floater name="move_floater"> +<floater name="move_floater" title="HAREKET ET"> <string name="walk_forward_tooltip"> İleri Yürü (Yukarı Okuna veya W'ye basın) </string> diff --git a/indra/newview/skins/default/xui/tr/floater_my_appearance.xml b/indra/newview/skins/default/xui/tr/floater_my_appearance.xml new file mode 100644 index 0000000000..4d71187a1f --- /dev/null +++ b/indra/newview/skins/default/xui/tr/floater_my_appearance.xml @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes"?> +<floater name="floater_my_appearance" title="GÖRÜNÜM"> + <panel label="Görünümü Düzenle" name="main_panel"/> +</floater> diff --git a/indra/newview/skins/default/xui/tr/floater_my_inventory.xml b/indra/newview/skins/default/xui/tr/floater_my_inventory.xml new file mode 100644 index 0000000000..8c62692a88 --- /dev/null +++ b/indra/newview/skins/default/xui/tr/floater_my_inventory.xml @@ -0,0 +1,2 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes"?> +<floater name="floater_my_inventory" title="ENVANTER"/> diff --git a/indra/newview/skins/default/xui/tr/floater_nearby_chat.xml b/indra/newview/skins/default/xui/tr/floater_nearby_chat.xml index 6570c4379c..6b12ad0ef5 100644 --- a/indra/newview/skins/default/xui/tr/floater_nearby_chat.xml +++ b/indra/newview/skins/default/xui/tr/floater_nearby_chat.xml @@ -1,4 +1,4 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <floater name="nearby_chat" title="YAKINDAKİ SOHBET"> - <check_box label="Sohbeti çevir (Google tarafından desteklenir)" name="translate_chat_checkbox"/> + <check_box label="Sohbeti çevir" name="translate_chat_checkbox"/> </floater> diff --git a/indra/newview/skins/default/xui/tr/floater_object_weights.xml b/indra/newview/skins/default/xui/tr/floater_object_weights.xml new file mode 100644 index 0000000000..b57943f666 --- /dev/null +++ b/indra/newview/skins/default/xui/tr/floater_object_weights.xml @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes"?> +<floater name="object_weights" title="GELİŞMİŞ"> + <floater.string name="nothing_selected" value="--"/> + <text name="selected_text" value="SEÇİLİ"/> + <text name="objects" value="--"/> + <text name="objects_label" value="Nesneler"/> + <text name="prims" value="--"/> + <text name="prims_label" value="Primler"/> + <text name="weights_of_selected_text" value="SEÇİLENLERİN AĞIRLIKLARI"/> + <text name="download" value="--"/> + <text name="download_label" value="Karşıdan yükle"/> + <text name="physics" value="--"/> + <text name="physics_label" value="Fizik"/> + <text name="server" value="--"/> + <text name="server_label" value="Sunucu"/> + <text name="display" value="--"/> + <text name="display_label" value="Ekran"/> + <text name="land_impacts_text" value="ARAZİ ETKİLERİ"/> + <text name="selected" value="--"/> + <text name="selected_label" value="Seçili"/> + <text name="rezzed_on_land" value="--"/> + <text name="rezzed_on_land_label" value="Arazide oluşturulmuş"/> + <text name="remaining_capacity" value="--"/> + <text name="remaining_capacity_label" value="Kalan kapasite"/> + <text name="total_capacity" value="--"/> + <text name="total_capacity_label" value="Toplam kapasite"/> + <text name="help_SLURL" value="[secondlife:///app/help/object_weights Bunların tümü ne?...]"/> +</floater> diff --git a/indra/newview/skins/default/xui/tr/floater_outfit_save_as.xml b/indra/newview/skins/default/xui/tr/floater_outfit_save_as.xml index 849fdcdbbc..7a9f507c93 100644 --- a/indra/newview/skins/default/xui/tr/floater_outfit_save_as.xml +++ b/indra/newview/skins/default/xui/tr/floater_outfit_save_as.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> -<floater name="modal container" title="Dış Görünümü Kaydet"> +<floater name="modal container" title="DIŞ GÖRÜNÜMÜ KAYDET"> <button label="Kaydet" label_selected="Kaydet" name="Save"/> <button label="İptal" label_selected="İptal" name="Cancel"/> <text name="Save item as:"> diff --git a/indra/newview/skins/default/xui/tr/floater_people.xml b/indra/newview/skins/default/xui/tr/floater_people.xml new file mode 100644 index 0000000000..94a27bff57 --- /dev/null +++ b/indra/newview/skins/default/xui/tr/floater_people.xml @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes"?> +<floater name="floater_people" title="KİŞİLER"> + <panel_container name="main_panel"> + <panel label="Grup Profili" name="panel_group_info_sidetray"/> + <panel label="Engellenmiş Sakinler ve Nesneler" name="panel_block_list_sidetray"/> + </panel_container> +</floater> diff --git a/indra/newview/skins/default/xui/tr/floater_picks.xml b/indra/newview/skins/default/xui/tr/floater_picks.xml new file mode 100644 index 0000000000..513a2e319a --- /dev/null +++ b/indra/newview/skins/default/xui/tr/floater_picks.xml @@ -0,0 +1,2 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes"?> +<floater name="floater_picks" title="Seçmeler"/> diff --git a/indra/newview/skins/default/xui/tr/floater_places.xml b/indra/newview/skins/default/xui/tr/floater_places.xml new file mode 100644 index 0000000000..4e09a699f6 --- /dev/null +++ b/indra/newview/skins/default/xui/tr/floater_places.xml @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes"?> +<floater name="floater_places" title="YERLER"> + <panel label="Yerler" name="main_panel"/> +</floater> diff --git a/indra/newview/skins/default/xui/tr/floater_preferences.xml b/indra/newview/skins/default/xui/tr/floater_preferences.xml index a0be9dc53f..edb3c19b81 100644 --- a/indra/newview/skins/default/xui/tr/floater_preferences.xml +++ b/indra/newview/skins/default/xui/tr/floater_preferences.xml @@ -7,7 +7,7 @@ <panel label="Grafikler" name="display"/> <panel label="Ses ve Ortamlar" name="audio"/> <panel label="Sohbet" name="chat"/> - <panel label="Hareketler ve Görünümler" name="move"/> + <panel label="Hareket ve Görünümler" name="move"/> <panel label="Bildirimler" name="msgs"/> <panel label="Renkler" name="colors"/> <panel label="Gizlilik" name="im"/> diff --git a/indra/newview/skins/default/xui/tr/floater_preview_gesture.xml b/indra/newview/skins/default/xui/tr/floater_preview_gesture.xml index fa9fd37e6c..dc6f66f657 100644 --- a/indra/newview/skins/default/xui/tr/floater_preview_gesture.xml +++ b/indra/newview/skins/default/xui/tr/floater_preview_gesture.xml @@ -65,7 +65,7 @@ <check_box label="tüm animasyonlar bitinceye kadar" name="wait_anim_check"/> <check_box label="saniye olarak zaman:" name="wait_time_check"/> <text name="help_label"> - Bekleme adımlar eklemediğiniz sürece tüm adımlar aynı anda gerçekleşir. + Bekleme adımları eklemediğiniz sürece tüm adımlar aynı anda gerçekleşir. </text> <check_box label="Etkin" name="active_check" tool_tip="Etkin mimikleri tetiklemek için tetikleme fazları için sohbet gerçekleştirebilir veya kısayol tuşlarına basabilirsiniz. Bir anahtar bağlama ihtilafı olduğunda mimikler genellikle inaktif hale geçer."/> <button label="Önizleme" name="preview_btn"/> diff --git a/indra/newview/skins/default/xui/tr/floater_preview_texture.xml b/indra/newview/skins/default/xui/tr/floater_preview_texture.xml index 4548fbae64..79e184130a 100644 --- a/indra/newview/skins/default/xui/tr/floater_preview_texture.xml +++ b/indra/newview/skins/default/xui/tr/floater_preview_texture.xml @@ -34,7 +34,7 @@ <combo_item name="16:10"> 16:10 </combo_item> - <combo_item name="16:9" tool_tip="Profil favorileri"> + <combo_item name="16:9" tool_tip="Profil seçmeleri"> 16:9 </combo_item> <combo_item name="2:1"> diff --git a/indra/newview/skins/default/xui/tr/floater_report_abuse.xml b/indra/newview/skins/default/xui/tr/floater_report_abuse.xml index ae4c3cc75e..c5765883c4 100644 --- a/indra/newview/skins/default/xui/tr/floater_report_abuse.xml +++ b/indra/newview/skins/default/xui/tr/floater_report_abuse.xml @@ -81,7 +81,7 @@ Özet: </text> <text name="dscr_title"> - Ayrıntılar: + Ayrıntl: </text> <text name="bug_aviso"> Mümkün olduğunca spesifik olun diff --git a/indra/newview/skins/default/xui/tr/floater_sound_devices.xml b/indra/newview/skins/default/xui/tr/floater_sound_devices.xml index 99c3bea954..470a222d7e 100644 --- a/indra/newview/skins/default/xui/tr/floater_sound_devices.xml +++ b/indra/newview/skins/default/xui/tr/floater_sound_devices.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> -<floater name="floater_sound_devices" title="Ses Aygıtları"> +<floater name="floater_sound_devices" title="SES CİHAZLARI"> <text name="voice_label"> Sesli Sohbet </text> diff --git a/indra/newview/skins/default/xui/tr/floater_stats.xml b/indra/newview/skins/default/xui/tr/floater_stats.xml index 2218060cc7..17f1166c46 100644 --- a/indra/newview/skins/default/xui/tr/floater_stats.xml +++ b/indra/newview/skins/default/xui/tr/floater_stats.xml @@ -10,8 +10,8 @@ </stat_view> <stat_view label="Gelişmiş" name="advanced"> <stat_view label="İşle" name="render"> - <stat_bar label="Çizilen Üçgenler" name="ktrisframe"/> - <stat_bar label="Çizilen Üçgenler" name="ktrissec"/> + <stat_bar label="Çerçeve Başına Çizilen Üçgenler" name="ktrisframe"/> + <stat_bar label="Saniyede Bir Çizilen Üçgenler" name="ktrissec"/> <stat_bar label="Toplam Nesne" name="objs"/> <stat_bar label="Yeni Nesne" name="newobjs"/> </stat_view> @@ -64,6 +64,14 @@ <stat_bar label="Aracı Süresi" name="simagentmsec"/> <stat_bar label="Görüntü Süresi" name="simimagesmsec"/> <stat_bar label="Komut Dosyası Süresi" name="simscriptmsec"/> + <stat_bar label="Yedek Zaman" name="simsparemsec"/> + <stat_view label="Zaman Ayrıntıları (ms)" name="timedetails"> + <stat_bar label="Fizik Adımı" name="simsimphysicsstepmsec"/> + <stat_bar label="Fizik Şekillerini Güncelle" name="simsimphysicsshapeupdatemsec"/> + <stat_bar label="Fizik Diğer" name="simsimphysicsothermsec"/> + <stat_bar label="Uyku Zamanı" name="simsleepmsec"/> + <stat_bar label="Pompa Giriş Çıkış" name="simpumpiomsec"/> + </stat_view> </stat_view> </stat_view> </container_view> diff --git a/indra/newview/skins/default/xui/tr/floater_texture_ctrl.xml b/indra/newview/skins/default/xui/tr/floater_texture_ctrl.xml index 1ba9f8c2aa..4ef789f585 100644 --- a/indra/newview/skins/default/xui/tr/floater_texture_ctrl.xml +++ b/indra/newview/skins/default/xui/tr/floater_texture_ctrl.xml @@ -1,10 +1,10 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> -<floater name="texture picker" title="FAVORİ: DOKU"> +<floater name="texture picker" title="SEÇME: DOKU"> <floater.string name="choose_picture"> Bir resim seçmek için tıklayın </floater.string> <floater.string name="pick title"> - Favori: + Seçme: </floater.string> <text name="Multiple"> Birden çok doku diff --git a/indra/newview/skins/default/xui/tr/floater_tools.xml b/indra/newview/skins/default/xui/tr/floater_tools.xml index 68c18d65e8..d4ee9995dd 100644 --- a/indra/newview/skins/default/xui/tr/floater_tools.xml +++ b/indra/newview/skins/default/xui/tr/floater_tools.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> -<floater name="toolbox floater" short_title="İNŞA ARAÇLARI"> +<floater name="toolbox floater" short_title="İNŞA ET ARAÇLARI"> <floater.string name="status_rotate"> Nesneyi döndürmek için renkli bantları sürükleyin </floater.string> @@ -25,10 +25,10 @@ Araziyi seçmek için tıklayın ve sürükleyin </floater.string> <floater.string name="status_selectcount"> - [OBJ_COUNT] nesne ( [PRIM_COUNT] prim [PE_STRING] ) seçili + [OBJ_COUNT] nesne seçili, [LAND_IMPACT] arazi etkisi </floater.string> - <floater.string name="status_selectprimequiv"> - , [SEL_WEIGHT] prim eşdeğerleri + <floater.string name="status_remaining_capacity"> + Kalan kapasite [LAND_CAPACITY]. </floater.string> <button name="button focus" tool_tip="Odak"/> <button name="button move" tool_tip="Hareket Et"/> @@ -55,7 +55,7 @@ <radio_item label="Uzat (Ctrl+Shift)" name="radio stretch"/> <radio_item label="Yüzü Seç" name="radio select face"/> </radio_group> - <check_box label="Bağlantılı olanları düzenle" name="checkbox edit linked parts"/> + <check_box label="Bağlantılıları düzenle" name="checkbox edit linked parts"/> <button label="Bağla" name="link_btn"/> <button label="Bağlantıyı Kopar" name="unlink_btn"/> <text label="Her İki Tarafı Uzat" name="checkbox uniform label"> @@ -81,7 +81,7 @@ <button name="ToolGrass" tool_tip="Çimen"/> <check_box label="Seçili Aracı tut" name="checkbox sticky"/> <check_box label="Seçimi kopyala" name="checkbox copy selection"/> - <check_box initial_value="true" label="Kopyayı Merkeze Al" name="checkbox copy centers"/> + <check_box initial_value="true" label="Kopyayı Merkezle" name="checkbox copy centers"/> <check_box label="Kopyayı Döndür" name="checkbox copy rotates"/> <radio_group name="land_radio_group"> <radio_item label="Araziyi Seç" name="radio select land"/> @@ -107,8 +107,8 @@ <text name="selection_empty"> Seçilen bir şey yok. </text> - <text name="selection_weight"> - Fizik ağırlığı [PHYS_WEIGHT], İşleme Maliyeti [DISP_WEIGHT]. + <text name="remaining_capacity"> + [CAPACITY_STRING] [secondlife:///app/openfloater/object_weights Ek bilgi] </text> <tab_container name="Object Info Tabs"> <panel label="Genel" name="General"> @@ -321,7 +321,6 @@ Dikiş türü </text> <combo_box name="sculpt type control"> - <combo_box.item label="(hiçbiri)" name="None"/> <combo_box.item label="Küre" name="Sphere"/> <combo_box.item label="Torus" name="Torus"/> <combo_box.item label="Düzlem" name="Plane"/> @@ -377,7 +376,7 @@ </combo_box> <spinner label="Yerçekimi" name="Physics Gravity"/> <spinner label="Sürtünme" name="Physics Friction"/> - <spinner label="100 kg/m^3 cinsinden yoğunluk" name="Physics Density"/> + <spinner label="100 kg/m3 cinsinden yoğunluk" name="Physics Density"/> <spinner label="Restitüsyon" name="Physics Restitution"/> </panel> <panel label="Doku" name="Texture"> diff --git a/indra/newview/skins/default/xui/tr/floater_toybox.xml b/indra/newview/skins/default/xui/tr/floater_toybox.xml new file mode 100644 index 0000000000..05d3633df0 --- /dev/null +++ b/indra/newview/skins/default/xui/tr/floater_toybox.xml @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes"?> +<floater name="Toybox" title="ARAÇ ÇUBUKLARINI ÖZELLEŞTİR"> + <text name="toybox label 1"> + Düğmeleri araç çubuklarına veya araç çubuklarından sürükleyerek ekleyin ya da kaldırın. + </text> + <text name="toybox label 2"> + Her bir araç çubuğunun ayarına göre düğmeler gösterilir veya sadece simgeleri yer alır. + </text> + <button label="Varsayılanları geri yükle" label_selected="Varsayılanları geri yükle" name="btn_restore_defaults"/> +</floater> diff --git a/indra/newview/skins/default/xui/tr/floater_voice_controls.xml b/indra/newview/skins/default/xui/tr/floater_voice_controls.xml index d5d6606e4e..dac05d8327 100644 --- a/indra/newview/skins/default/xui/tr/floater_voice_controls.xml +++ b/indra/newview/skins/default/xui/tr/floater_voice_controls.xml @@ -1,13 +1,13 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> -<floater name="floater_voice_controls" title="Ses Denetimleri"> +<floater name="floater_voice_controls" title="SES DENETİMLERİ"> <string name="title_nearby"> - YAKINDAKİ SES + Yakındaki ses </string> <string name="title_group"> - [GROUP] ile Grup Araması + [GROUP] ile grup araması </string> <string name="title_adhoc"> - Konferans Araması + Konferans araması </string> <string name="title_peer_2_peer"> [NAME] ile arama diff --git a/indra/newview/skins/default/xui/tr/floater_windlight_options.xml b/indra/newview/skins/default/xui/tr/floater_windlight_options.xml index 02910e2539..6c5fba374c 100644 --- a/indra/newview/skins/default/xui/tr/floater_windlight_options.xml +++ b/indra/newview/skins/default/xui/tr/floater_windlight_options.xml @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <floater name="WindLight floater" title="GELİŞMİŞ GÖKYÜZÜ DÜZENLEYİCİ"> <floater.string name="WLDefaultSkyNames"> - A-12ÖÖ:A-12ÖS:A-3ÖÖ:A-3ÖS:A-4.30ÖS:A-6ÖÖ:A-6ÖS:A-9ÖÖ:A-9ÖS:Barselona:Tipi:Mavi Gün Ortası:Sahilde Öğleden Sonra:Sahilde Gün Batımı:Varsayılan:Çölde Gün Batımı:Güzel Bir Gün:Kabarık Büyük Bulutlar:Sisli:Şık Şık:Şık Şık Şık:Dondurma:Hayalet:Uygunsuz Gerçekler:Gün Ortası1:Gün Ortası 2:Gün Ortası 3:Gün Ortası 4:Gece:Korsan:Mor:Denizcinin Keyfi:Saf Tensel + A-12:A-24:A-3:A-15:A-16.30:A-6:A-18:A-9:A-21:Barselona:Tipi:Mavi Gün Ortası:Sahilde Öğleden Sonra:Sahilde Gün Batımı:Varsayılan:Çölde Gün Batımı:Güzel Bir Gün:Kabarık Büyük Bulutlar:Sisli:Şık Şık:Şık Şık Şık:Dondurma:Hayalet:Uygunsuz Gerçekler:Gün Ortası1:Gün Ortası 2:Gün Ortası 3:Gün Ortası 4:Gece:Korsan:Mor:Denizcinin Keyfi:Saf Tensel </floater.string> <text name="KeyFramePresetsText"> Gökyüzü Ön Ayarları: diff --git a/indra/newview/skins/default/xui/tr/menu_bottomtray.xml b/indra/newview/skins/default/xui/tr/menu_bottomtray.xml index c437669704..f17c0f9971 100644 --- a/indra/newview/skins/default/xui/tr/menu_bottomtray.xml +++ b/indra/newview/skins/default/xui/tr/menu_bottomtray.xml @@ -8,7 +8,7 @@ <menu_item_check label="İnşa Et düğmesi" name="ShowBuildButton"/> <menu_item_check label="Arama düğmesi" name="ShowSearchButton"/> <menu_item_check label="Harita düğmesi" name="ShowWorldMapButton"/> - <menu_item_check label="Mini-Harita düğmesi" name="ShowMiniMapButton"/> + <menu_item_check label="Mini-harita düğmesi" name="ShowMiniMapButton"/> <menu_item_call label="Kes" name="NearbyChatBar_Cut"/> <menu_item_call label="Kopyala" name="NearbyChatBar_Copy"/> <menu_item_call label="Yapıştır" name="NearbyChatBar_Paste"/> diff --git a/indra/newview/skins/default/xui/tr/menu_gesture_gear.xml b/indra/newview/skins/default/xui/tr/menu_gesture_gear.xml index 9ae433d8bb..cb9b678fdd 100644 --- a/indra/newview/skins/default/xui/tr/menu_gesture_gear.xml +++ b/indra/newview/skins/default/xui/tr/menu_gesture_gear.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <toggleable_menu name="menu_gesture_gear"> - <menu_item_call label="Sık Kullanılanlara Ekle/Çıkar" name="activate"/> + <menu_item_call label="Favorilere Ekle/Çıkar" name="activate"/> <menu_item_call label="Kopyala" name="copy_gesture"/> <menu_item_call label="Yapıştır" name="paste"/> <menu_item_call label="UUID'yi Kopyala" name="copy_uuid"/> diff --git a/indra/newview/skins/default/xui/tr/menu_hide_navbar.xml b/indra/newview/skins/default/xui/tr/menu_hide_navbar.xml index d9b99e040b..d1f213516b 100644 --- a/indra/newview/skins/default/xui/tr/menu_hide_navbar.xml +++ b/indra/newview/skins/default/xui/tr/menu_hide_navbar.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <menu name="hide_navbar_menu"> - <menu_item_check label="Gezinme Çubuğunu Göster" name="ShowNavbarNavigationPanel"/> - <menu_item_check label="Sık Kullanılanlar Çubuğunu Göster" name="ShowNavbarFavoritesPanel"/> + <menu_item_check label="Gezinme ve Favoriler Çubuğunu Göster" name="ShowNavbarNavigationPanel"/> + <menu_item_check label="Favoriler Çubuğunu Göster" name="ShowNavbarFavoritesPanel"/> <menu_item_check label="Mini Konum Çubuğunu Göster" name="ShowMiniLocationPanel"/> </menu> diff --git a/indra/newview/skins/default/xui/tr/menu_landmark.xml b/indra/newview/skins/default/xui/tr/menu_landmark.xml index 17068d445d..c68a2f6a90 100644 --- a/indra/newview/skins/default/xui/tr/menu_landmark.xml +++ b/indra/newview/skins/default/xui/tr/menu_landmark.xml @@ -2,6 +2,6 @@ <toggleable_menu name="landmark_overflow_menu"> <menu_item_call label="SLurl'i Kopyala" name="copy"/> <menu_item_call label="Sil" name="delete"/> - <menu_item_call label="Favori Oluştur" name="pick"/> - <menu_item_call label="Sık Kullanılanlar Çubuğuna Ekle" name="add_to_favbar"/> + <menu_item_call label="Seçme Oluştur" name="pick"/> + <menu_item_call label="Favoriler Çubuğuna Ekle" name="add_to_favbar"/> </toggleable_menu> diff --git a/indra/newview/skins/default/xui/tr/menu_login.xml b/indra/newview/skins/default/xui/tr/menu_login.xml index a726925bd3..4c3539b38b 100644 --- a/indra/newview/skins/default/xui/tr/menu_login.xml +++ b/indra/newview/skins/default/xui/tr/menu_login.xml @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <menu_bar name="Login Menu"> <menu label="Ben" name="File"> - <menu_item_call label="Tercihler" name="Preferences..."/> + <menu_item_call label="Tercihler..." name="Preferences..."/> <menu_item_call label="[APP_NAME]'den Çık" name="Quit"/> </menu> <menu label="Yardım" name="Help"> diff --git a/indra/newview/skins/default/xui/tr/menu_picks_plus.xml b/indra/newview/skins/default/xui/tr/menu_picks_plus.xml index 0bd84fa88e..d9c4fefc97 100644 --- a/indra/newview/skins/default/xui/tr/menu_picks_plus.xml +++ b/indra/newview/skins/default/xui/tr/menu_picks_plus.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <toggleable_menu name="picks_plus_menu"> - <menu_item_call label="Yeni Favori" name="create_pick"/> + <menu_item_call label="Yeni Seçme" name="create_pick"/> <menu_item_call label="Yeni İlan" name="create_classified"/> </toggleable_menu> diff --git a/indra/newview/skins/default/xui/tr/menu_place.xml b/indra/newview/skins/default/xui/tr/menu_place.xml index 4ef7c01f09..ad167a328a 100644 --- a/indra/newview/skins/default/xui/tr/menu_place.xml +++ b/indra/newview/skins/default/xui/tr/menu_place.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <toggleable_menu name="place_overflow_menu"> <menu_item_call label="Yer İmi Yap" name="landmark"/> - <menu_item_call label="Favori Oluştur" name="pick"/> + <menu_item_call label="Seçme Oluştur" name="pick"/> </toggleable_menu> diff --git a/indra/newview/skins/default/xui/tr/menu_places_gear_landmark.xml b/indra/newview/skins/default/xui/tr/menu_places_gear_landmark.xml index 5282d9fec7..939ee2c7cb 100644 --- a/indra/newview/skins/default/xui/tr/menu_places_gear_landmark.xml +++ b/indra/newview/skins/default/xui/tr/menu_places_gear_landmark.xml @@ -15,5 +15,5 @@ <menu_item_call label="Tüm klasörleri genişlet" name="expand_all"/> <menu_item_call label="Tüm klasörleri daralt" name="collapse_all"/> <menu_item_check label="Tarihe Göre Sırala" name="sort_by_date"/> - <menu_item_call label="Favori Oluştur" name="create_pick"/> + <menu_item_call label="Seçme Oluştur" name="create_pick"/> </toggleable_menu> diff --git a/indra/newview/skins/default/xui/tr/menu_slurl.xml b/indra/newview/skins/default/xui/tr/menu_slurl.xml index 03e3837ea0..73ac068b26 100644 --- a/indra/newview/skins/default/xui/tr/menu_slurl.xml +++ b/indra/newview/skins/default/xui/tr/menu_slurl.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <menu name="Popup"> <menu_item_call label="URL Hakkında" name="about_url"/> - <menu_item_call label="URL'ye Işınlan" name="teleport_to_url"/> + <menu_item_call label="URL'ye Işınla" name="teleport_to_url"/> <menu_item_call label="Harita" name="show_on_map"/> </menu> diff --git a/indra/newview/skins/default/xui/tr/menu_toolbars.xml b/indra/newview/skins/default/xui/tr/menu_toolbars.xml new file mode 100644 index 0000000000..7cb3192ec4 --- /dev/null +++ b/indra/newview/skins/default/xui/tr/menu_toolbars.xml @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes"?> +<context_menu name="Toolbars Popup"> + <menu_item_call label="Düğmeleri seç..." name="Chose Buttons"/> + <menu_item_check label="Simgeler ve etiketler" name="icons_with_text"/> + <menu_item_check label="Sadece simgeler" name="icons_only"/> +</context_menu> diff --git a/indra/newview/skins/default/xui/tr/menu_viewer.xml b/indra/newview/skins/default/xui/tr/menu_viewer.xml index fa09e42a14..75294e38d5 100644 --- a/indra/newview/skins/default/xui/tr/menu_viewer.xml +++ b/indra/newview/skins/default/xui/tr/menu_viewer.xml @@ -1,27 +1,28 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <menu_bar name="Main Menu"> <menu label="Ben" name="Me"> - <menu_item_call label="Tercihler" name="Preferences"/> - <menu_item_call label="Kontrol Panelim" name="Manage My Account"/> - <menu_item_call label="L$ Satın Al" name="Buy and Sell L$"/> - <menu_item_call label="Profilim" name="Profile"/> - <menu_item_call label="Görünümüm" name="ChangeOutfit"/> - <menu_item_check label="Envanterim" name="Inventory"/> - <menu_item_check label="Envanterim" name="ShowSidetrayInventory"/> - <menu_item_check label="Mimiklerim" name="Gestures"/> - <menu_item_check label="Sesim" name="ShowVoice"/> + <menu_item_call label="Kontrol Paneli..." name="Manage My Account"/> + <menu_item_call label="Profil..." name="Profile"/> + <menu_item_call label="Görünüm..." name="ChangeOutfit"/> + <menu_item_check label="Envanter..." name="Inventory"/> + <menu_item_check label="Mimikler..." name="Gestures"/> + <menu_item_check label="Ses..." name="ShowVoice"/> <menu label="Hareket" name="Movement"> <menu_item_call label="Otur" name="Sit Down Here"/> <menu_item_check label="Uç" name="Fly"/> <menu_item_check label="Daima Koş" name="Always Run"/> <menu_item_call label="Beni Anime Etmeyi Durdur" name="Stop Animating My Avatar"/> </menu> - <menu label="Durumum" name="Status"> + <menu label="Durum" name="Status"> <menu_item_call label="Uzakta" name="Set Away"/> <menu_item_call label="Meşgul" name="Set Busy"/> </menu> <menu_item_call label="Yönetici Durumu Talep Et" name="Request Admin Options"/> <menu_item_call label="Yönetici Durumundan Ayrıl" name="Leave Admin Options"/> + <menu_item_call label="L$ Satın Al" name="Buy and Sell L$"/> + <menu_item_call label="Tercihler..." name="Preferences"/> + <menu_item_call label="Araç çubukları..." name="Toolbars"/> + <menu_item_call label="Tüm denetimleri sakla" name="Hide UI"/> <menu_item_call label="[APP_NAME]'den Çık" name="Quit"/> </menu> <menu label="İletişim Kur" name="Communicate"> @@ -32,7 +33,7 @@ <menu_item_check label="Yakındaki Ses" name="Nearby Voice"/> </menu> <menu label="Dünya" name="World"> - <menu_item_check label="Mini-Harita" name="Mini-Map"/> + <menu_item_check label="Mini-harita" name="Mini-Map"/> <menu_item_check label="Dünya Haritası" name="World Map"/> <menu_item_check label="Ara" name="Search"/> <menu_item_call label="Anlık Görüntü" name="Take Snapshot"/> @@ -55,7 +56,7 @@ <menu_item_check label="Parsel Özellikleri" name="Parcel Properties"/> <menu_item_check label="Gelişmiş Menü" name="Show Advanced Menu"/> </menu> - <menu_item_call label="Ana Konuma Işınlan" name="Teleport Home"/> + <menu_item_call label="Ana Konuma Işınla" name="Teleport Home"/> <menu_item_call label="Ana Konumu Burası Olarak Seç" name="Set Home to Here"/> <menu label="Güneş" name="Environment Settings"> <menu_item_call label="Gün Doğumu" name="Sunrise"/> @@ -92,7 +93,7 @@ <menu_item_call label="Arazi Aracı" name="Land"/> </menu> <menu_item_call label="Bağla" name="Link"/> - <menu_item_call label="Bağlantıyı Kopar" name="Unlink"/> + <menu_item_call label="Bağlnty. Kopar" name="Unlink"/> <menu_item_check label="Bağlantılı Parçaları Düzenle" name="Edit Linked Parts"/> <menu label="Bağlantılı Parçaları Seç" name="Select Linked Parts"> <menu_item_call label="Sonraki Parçayı Seç" name="Select Next Part"/> @@ -117,7 +118,7 @@ <menu_item_call label="Komut Dosyalarını Çalışıyor Olarak Ayarla" name="Set Scripts to Running"/> <menu_item_call label="Komut Dosyalarını Çalışmıyor Olarak Ayarla" name="Set Scripts to Not Running"/> </menu> - <menu label="Seçenekler" name="Options"> + <menu label="Seçenklr." name="Options"> <menu_item_check label="Gelişmiş İzinleri Göster" name="DebugPermissions"/> <menu_item_check label="Sadece Nesnelerimi Seç" name="Select Only My Objects"/> <menu_item_check label="Sadece Hareket Ettirilebilir Nesneleri Seç" name="Select Only Movable Objects"/> @@ -144,7 +145,6 @@ </menu> <menu label="Yardım" name="Help"> <menu_item_call label="[SECOND_LIFE] Yardımı" name="Second Life Help"/> - <menu_item_check label="İpuçlarını Etkinleştir" name="Enable Hints"/> <menu_item_call label="Kötüye Kullanımı Bildir" name="Report Abuse"/> <menu_item_call label="Hata Bildir" name="Report Bug"/> <menu_item_call label="[APP_NAME] Hakkında" name="About Second Life"/> @@ -160,7 +160,7 @@ <menu label="Performans Araçları" name="Performance Tools"> <menu_item_call label="Gecikme Ölçer" name="Lag Meter"/> <menu_item_check label="İstatistik Çubuğu" name="Statistics Bar"/> - <menu_item_check label="Avatar İşlemi Maaliyetini Göster" name="Avatar Rendering Cost"/> + <menu_item_check label="Avatarlar İçin Çizim Ağırlığını Göster" name="Avatar Rendering Cost"/> </menu> <menu label="Vurgulama ve Görünürlük" name="Highlighting and Visibility"> <menu_item_check label="Yanıp Sönen İşaret" name="Cheesy Beacon"/> @@ -288,6 +288,7 @@ <menu_item_check label="Işıklar" name="Lights"/> <menu_item_check label="Çarpışma İskeleti" name="Collision Skeleton"/> <menu_item_check label="Işın Yayını" name="Raycast"/> + <menu_item_check label="İşleme Karmaşıklığı" name="rendercomplexity"/> <menu_item_check label="Şekillendir" name="Sculpt"/> </menu> <menu label="İşleme" name="Rendering"> diff --git a/indra/newview/skins/default/xui/tr/notifications.xml b/indra/newview/skins/default/xui/tr/notifications.xml index 5eff0cf570..6908f6867f 100644 --- a/indra/newview/skins/default/xui/tr/notifications.xml +++ b/indra/newview/skins/default/xui/tr/notifications.xml @@ -189,7 +189,7 @@ Bu Yetenek '[ROLE_NAME]' rolüne eklensin mi? <usetemplate ignoretext="Aksesuarları çıkarmadan önce doğrulama iste" name="okcancelignore" notext="Hayır" yestext="Evet"/> </notification> <notification name="JoinGroupCanAfford"> - Bu gruba katılmanın maliyeti: [COST] L$. + Bu gruba katılmanın maliyeti: L$ [COST]. Devam etmek istiyor musunuz? <usetemplate name="okcancelbuttons" notext="İptal Et" yestext="Katıl"/> </notification> @@ -199,33 +199,33 @@ Devam etmek istiyor musunuz? <usetemplate name="okcancelbuttons" notext="İptal Et" yestext="Katıl"/> </notification> <notification name="JoinGroupCannotAfford"> - Bu gruba katılmanın maliyeti: [COST] L$. + Bu gruba katılmanın maliyeti: L$ [COST]. Bu gruba katılmak için yeterli L$'na sahip değilsiniz. </notification> <notification name="CreateGroupCost"> - Bu grubu oluşturmanın maliyeti: 100 L$. + Bu grubu oluşturmanın maliyeti: L$ 100. Grupların birden fazla üyeye sahip olması gereklidir, aksi takdirde grup kalıcı olarak silinir. Lütfen 48 saat içinde diğer üyeleri davet edin. - <usetemplate canceltext="İptal" name="okcancelbuttons" notext="İptal" yestext="100 L$ ödeyerek grubu oluştur"/> + <usetemplate canceltext="İptal" name="okcancelbuttons" notext="İptal" yestext="L$ 100 ödeyerek grubu oluştur"/> </notification> <notification name="LandBuyPass"> - [COST] L$ ödeyerek ('[PARCEL_NAME]') arazisine [TIME] saat süreyle girebilirsiniz. Giriş hakkı satın almak istiyor musunuz? + L$ [COST] ödeyerek ('[PARCEL_NAME]') arazisine [TIME] saat süreyle girebilirsiniz. Giriş hakkı satın almak istiyor musunuz? <usetemplate name="okcancelbuttons" notext="İptal" yestext="Tamam"/> </notification> <notification name="SalePriceRestriction"> - Herhangi birine satış yaparken satış fiyatı 0 L$'ndan daha yüksek bir değere ayarlanmalıdır. -0 L$ fiyatla satış yapıyorsanız lütfen satışın yapılacağı kişiyi seçin. + Herhangi birine satış yaparken satış fiyatı L$ 0'dan daha yüksek bir değere ayarlanmalıdır. +L$ 0 fiyatla satış yapıyorsanız lütfen satışın yapılacağı kişiyi seçin. </notification> <notification name="ConfirmLandSaleChange"> Seçili [LAND_SIZE] m² arazi satışa çıkarılmak üzere ayarlanıyor. -Satış fiyatınız [SALE_PRICE] L$ olacak ve [NAME] için satışa açık olacaktır. +Satış fiyatınız L$ [SALE_PRICE] olacak ve [NAME] için satışa açık olacaktır. <usetemplate name="okcancelbuttons" notext="İptal" yestext="Tamam"/> </notification> <notification name="ConfirmLandSaleToAnyoneChange"> DİKKAT: 'Herkes için satışa açık' seçeneğinin tıklanması, arazinizi tüm [SECOND_LIFE] topluluğuna açık hale getirir, bu bölgede bulunmayanlar da buna dahildir. Seçili [LAND_SIZE] m² arazi satışa çıkarılmak üzere ayarlanıyor. -Satış fiyatınız [SALE_PRICE] L$ olacak ve [NAME] için satışa açık olacaktır. +Satış fiyatınız L$ [SALE_PRICE] olacak ve [NAME] için satışa açık olacaktır. <usetemplate name="okcancelbuttons" notext="İptal" yestext="Tamam"/> </notification> <notification name="ReturnObjectsDeededToGroup"> @@ -365,7 +365,7 @@ Devam etmek istediğinize emin misiniz? <usetemplate name="okbutton" yestext="Tamam"/> </notification> <notification name="DeleteAvatarPick"> - Favori <nolink>[PICK]</nolink> silinsin mi? + Seçme <nolink>[PICK]</nolink> silinsin mi? <usetemplate name="okcancelbuttons" notext="İptal" yestext="Tamam"/> </notification> <notification name="DeleteOutfits"> @@ -979,7 +979,7 @@ Etkin grubunuz adına arazi satın almak için gerekli izne sahip değilsiniz. </form> </notification> <notification name="RemoveFromFriends"> - [NAME] adlı kişiyi Arkadaş Listenizden çıkarmak istiyor musunuz? + <nolink>[NAME]</nolink> adlı kişiyi Arkadaş Listenizden çıkarmak istiyor musunuz? <usetemplate name="okcancelbuttons" notext="İptal" yestext="Tamam"/> </notification> <notification name="RemoveMultipleFromFriends"> @@ -1008,7 +1008,7 @@ bu simdeki TÜM ARAZİLERDEN SİLMEK istediğinize emin misiniz? İlanınız için bir ad belirtmelisiniz. </notification> <notification name="MinClassifiedPrice"> - Listeleme için ödenmesi gereken tutar en az [MIN_PRICE] L$ olmalıdır. + Listeleme için ödenmesi gereken tutar en az L$ [MIN_PRICE] olmalıdır. Lütfen daha yüksek bir tutar girin. </notification> @@ -1586,7 +1586,7 @@ Lütfen daha sonra tekrar deneyin. </notification> <notification name="TeleportToPick"> [PICK] konumuna ışınlanılsın mı? - <usetemplate ignoretext="Favori sekmesindeki bir konuma ışınlanma istediğimde doğrulama iste" name="okcancelignore" notext="İptal Et" yestext="Işınla"/> + <usetemplate ignoretext="Seçme sekmesindeki bir konuma ışınlanma istediğimde doğrulama iste" name="okcancelignore" notext="İptal Et" yestext="Işınla"/> </notification> <notification name="TeleportToClassified"> [CLASSIFIED] konumuna ışınlanılsın mı? @@ -1766,7 +1766,7 @@ Erişkinlik Seviyesi tercihinizi şimdi yükseltmek ve araziye girebilmek için <notification name="PublishClassified"> Hatırla: İlan ücretleri iade edilmez. -Şimdi [AMOUNT] L$ ödeyerek bu ilanı yayınlamak istiyor musunuz? +Şimdi L$ [AMOUNT] ödeyerek bu ilanı yayınlamak istiyor musunuz? <usetemplate name="okcancelbuttons" notext="İptal" yestext="Tamam"/> </notification> <notification name="SetClassifiedMature"> @@ -1810,7 +1810,7 @@ Lütfen sadece bir nesne seçin ve tekrar deneyin. Lütfen sadece bir nesne seçin ve tekrar deneyin. </notification> <notification name="BuyOriginal"> - Özgün nesne [OWNER] kullanıcısından [PRICE] L$ karşılığında satın alınsın mı? + Özgün nesne [OWNER] kullanıcısından L$ [PRICE] karşılığında satın alınsın mı? Nesnenin sahibi siz olacaksınız. Şu işlemleri yapabileceksiniz: Değiştirme: [MODIFYPERM] @@ -1819,7 +1819,7 @@ Nesnenin sahibi siz olacaksınız. <usetemplate name="okcancelbuttons" notext="İptal" yestext="Tamam"/> </notification> <notification name="BuyOriginalNoOwner"> - Özgün nesne PRICE] L$ karşılığında satın alınsın mı? + Özgün nesne L$ [PRICE] karşılığında satın alınsın mı? Nesnenin sahibi siz olacaksınız. Şu işlemleri yapabileceksiniz: Değiştirme: [MODIFYPERM] @@ -1828,7 +1828,7 @@ Nesnenin sahibi siz olacaksınız. <usetemplate name="okcancelbuttons" notext="İptal" yestext="Tamam"/> </notification> <notification name="BuyCopy"> - Bir kopyası [OWNER] kullanıcısından [PRICE] L$ karşılığında satın alınsın mı? + Bir kopyası [OWNER] kullanıcısından L$ [PRICE] karşılığında satın alınsın mı? Nesne envanterinize kopyalanacak. Şu işlemleri yapabileceksiniz: Değiştirme: [MODIFYPERM] @@ -1837,7 +1837,7 @@ Nesne envanterinize kopyalanacak. <usetemplate name="okcancelbuttons" notext="İptal" yestext="Tamam"/> </notification> <notification name="BuyCopyNoOwner"> - Bir kopyası [PRICE] L$ karşılığında satın alınsın mı? + Bir kopyası L$ [PRICE] karşılığında satın alınsın mı? Nesne envanterinize kopyalanacak. Şu işlemleri yapabileceksiniz: Değiştirme: [MODIFYPERM] @@ -1846,12 +1846,12 @@ Nesne envanterinize kopyalanacak. <usetemplate name="okcancelbuttons" notext="İptal" yestext="Tamam"/> </notification> <notification name="BuyContents"> - İçerik [OWNER] kullanıcısından [PRICE] L$ karşılığında satın alınsın mı? + İçerik [OWNER] kullanıcısından L$ [PRICE] karşılığında satın alınsın mı? İçerik envanterinize kopyalanacak. <usetemplate name="okcancelbuttons" notext="İptal" yestext="Tamam"/> </notification> <notification name="BuyContentsNoOwner"> - İçerik [PRICE] L$ karşılığında satın alınsın mı? + İçerik L$ [PRICE] karşılığında satın alınsın mı? İçerik envanterinize kopyalanacak. <usetemplate name="okcancelbuttons" notext="İptal" yestext="Tamam"/> </notification> @@ -1875,7 +1875,7 @@ Lütfen parolanızı yeniden girin ve Tamam'ı tıklatın. </notification> <notification name="SetPickLocation"> Not: -Bu favorinin konumunu güncellediniz fakat diğer detaylar özgün değerlerini koruyacak. +Bu seçmenin konumunu güncellediniz fakat diğer detaylar özgün değerlerini koruyacak. <usetemplate name="okbutton" yestext="Tamam"/> </notification> <notification name="MoveInventoryFromObject"> @@ -1909,6 +1909,12 @@ Envanter öğesi/öğeleri taşınsın mı? Çıkmak istediğinize emin misiniz? <usetemplate ignoretext="Çıkmadan önce doğrulama iste" name="okcancelignore" notext="Çıkma" yestext="Çık"/> </notification> + <notification name="ConfirmRestoreToybox"> + Varsayılan düğmelerinizi ve araç çubuklarınızı geri yüklemek istediğinize emin misiniz? + +Bu eylemi geri alamazsınız. + <usetemplate name="okcancelbuttons" notext="İptal" yestext="Tamam"/> + </notification> <notification name="DeleteItems"> [QUESTION] <usetemplate ignoretext="Öğeleri silmeden önce doğrulama iste" name="okcancelignore" notext="İptal" yestext="Tamam"/> @@ -2113,10 +2119,10 @@ Bu adımda web tarayıcınızın başlatılacağına dikkat edin. Konu: [SUBJECT], İleti: [MESSAGE] </notification> <notification name="FriendOnline"> - [NAME] Çevrimiçi + <nolink>[NAME]</nolink> Çevrimiçi </notification> <notification name="FriendOffline"> - [NAME] Çevrimdışı + <nolink>[NAME]</nolink> Çevrimdışı </notification> <notification name="AddSelfFriend"> Çok iyi biri olduğunuza eminiz fakat kendinizi arkadaş olarak ekleyemezsiniz. @@ -2126,7 +2132,7 @@ Bu adımda web tarayıcınızın başlatılacağına dikkat edin. (Yaklaşık 5 dakika sürecektir.) </notification> <notification name="UploadPayment"> - Karşıya yüklemek için [AMOUNT] L$ ödediniz. + Karşıya yüklemek için L$ [AMOUNT] ödediniz. </notification> <notification name="UploadWebSnapshotDone"> Web sitesinde yer alan anlık görüntülerin karşıya yüklenmesi tamamlandı. @@ -2264,7 +2270,7 @@ Daha küçük bir arazi parçası seçmeyi deneyin. [NAME] [DATE] <form name="form"> - <button name="Details" text="Ayrıntılar"/> + <button name="Details" text="Ayrıntl"/> <button name="Cancel" text="İptal"/> </form> </notification> @@ -2473,7 +2479,7 @@ Lütfen biraz sonra tekrar deneyin. [MESSAGE] - [MATURITY_STR] <icon>[MATURITY_ICON]</icon> <form name="form"> - <button name="Teleport" text="Işınlan"/> + <button name="Teleport" text="Işınla"/> <button name="Cancel" text="İptal"/> </form> </notification> @@ -2512,10 +2518,10 @@ Lütfen biraz sonra tekrar deneyin. </form> </notification> <notification name="FriendshipAccepted"> - [NAME] arkadaşlık teklifinizi kabul etti. + <nolink>[NAME]</nolink> arkadaşlık teklifinizi kabul etti. </notification> <notification name="FriendshipDeclined"> - [NAME] arkadaşlık teklifinizi reddetti. + <nolink>[NAME]</nolink> arkadaşlık teklifinizi reddetti. </notification> <notification name="FriendshipAcceptedByMe"> Arkadaşlık teklifi kabul edildi. @@ -2995,10 +3001,6 @@ Görünümünüzü döndürmek için dünya üzerindeki herhangi bir yeri tıkla <button name="cancel" text="İptal Et"/> </form> </notification> - <notification label="" name="ModeChange"> - Mod değiştirme, uygulamadan çıkıp yeniden başlatmanızı gerektiriyor. - <usetemplate name="okcancelbuttons" notext="Çıkma" yestext="Çık"/> - </notification> <notification label="" name="NoClassifieds"> İlan oluşturma ve düzenleme sadece Gelişmiş modda kullanılabilir. Uygulamadan çıkıp, mod değiştirmek ister misiniz? Mod seçici oturum açma ekranında bulunabilir. <usetemplate name="okcancelbuttons" notext="Çıkma" yestext="Çık"/> @@ -3012,7 +3014,7 @@ Görünümünüzü döndürmek için dünya üzerindeki herhangi bir yeri tıkla <usetemplate name="okcancelbuttons" notext="Çıkma" yestext="Çık"/> </notification> <notification label="" name="NoPicks"> - Favorileri oluşturma ve düzenleme sadece Gelişmiş modda kullanılabilir. Uygulamadan çıkıp, mod değiştirmek ister misiniz? Mod seçici oturum açma ekranında bulunabilir. + Seçmeleri oluşturma ve düzenleme sadece Gelişmiş modda kullanılabilir. Uygulamadan çıkıp, mod değiştirmek ister misiniz? Mod seçici oturum açma ekranında bulunabilir. <usetemplate name="okcancelbuttons" notext="Çıkma" yestext="Çık"/> </notification> <notification label="" name="NoWorldMap"> @@ -3043,6 +3045,10 @@ Görünümünüzü döndürmek için dünya üzerindeki herhangi bir yeri tıkla Arama sadece Gelişmiş modda kullanılabilir. Oturumunuzu kapatıp, mod değiştirmek ister misiniz? <usetemplate name="okcancelbuttons" notext="Çıkma" yestext="Çık"/> </notification> + <notification label="" name="ConfirmHideUI"> + Bu eylem tüm menü öğelerini ve düğmelerini gizler. Bunları geri almak için [SHORTCUT] üzerine tekrar tıklayın. + <usetemplate ignoretext="KA'ni gizlemeden önce onayla" name="okcancelignore" notext="İptal" yestext="Tamam"/> + </notification> <global name="UnsupportedGLRequirements"> [APP_NAME] uygulaması için gerekli donanım gereksinimlerine sahip olmadığınız görünüyor. [APP_NAME] çoklu doku desteği sunan bir OpenGL grafik kartı gerektiriyor. Eğer grafik kartınız bu özellikteyse, grafik kartınızın en son sürücülerine ve işletim sisteminiz için gerekli Service Pack ve yamalara sahip olup olmadığınızı kontrol etmeyi deneyebilirsiniz. diff --git a/indra/newview/skins/default/xui/tr/panel_chiclet_bar.xml b/indra/newview/skins/default/xui/tr/panel_chiclet_bar.xml new file mode 100644 index 0000000000..a1e8190bbc --- /dev/null +++ b/indra/newview/skins/default/xui/tr/panel_chiclet_bar.xml @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes"?> +<panel name="chiclet_bar"> + <layout_stack name="toolbar_stack"> + <layout_panel name="im_well_panel"> + <chiclet_im_well name="im_well"> + <button name="Unread IM messages" tool_tip="Sohbetler"/> + </chiclet_im_well> + </layout_panel> + <layout_panel name="notification_well_panel"> + <chiclet_notification name="notification_well"> + <button name="Unread" tool_tip="Bildirimler"/> + </chiclet_notification> + </layout_panel> + </layout_stack> +</panel> diff --git a/indra/newview/skins/default/xui/tr/panel_edit_pick.xml b/indra/newview/skins/default/xui/tr/panel_edit_pick.xml index 446beb6eb8..98b02d27df 100644 --- a/indra/newview/skins/default/xui/tr/panel_edit_pick.xml +++ b/indra/newview/skins/default/xui/tr/panel_edit_pick.xml @@ -4,7 +4,7 @@ (kaydedildikten sonra güncelleştirilir) </panel.string> <text name="title"> - Favori Düzenle + Seçme Düzenle </text> <scroll_container name="profile_scroll"> <panel name="scroll_content_panel"> @@ -27,7 +27,7 @@ <panel label="bottom_panel" name="bottom_panel"> <layout_stack name="layout_stack1"> <layout_panel name="layout_panel1"> - <button label="Favori Kaydet" name="save_changes_btn"/> + <button label="Seçme Kaydet" name="save_changes_btn"/> </layout_panel> <layout_panel name="layout_panel2"> <button label="İptal" name="cancel_btn"/> diff --git a/indra/newview/skins/default/xui/tr/panel_landmarks.xml b/indra/newview/skins/default/xui/tr/panel_landmarks.xml index 7543decb36..d40d0c1543 100644 --- a/indra/newview/skins/default/xui/tr/panel_landmarks.xml +++ b/indra/newview/skins/default/xui/tr/panel_landmarks.xml @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <panel name="Landmarks"> <accordion name="landmarks_accordion"> - <accordion_tab name="tab_favorites" title="Sık Kullanılanlar çubuğu"/> + <accordion_tab name="tab_favorites" title="Favoriler çubuğu"/> <accordion_tab name="tab_landmarks" title="Yer İmlerim"/> <accordion_tab name="tab_inventory" title="Envanterim"/> <accordion_tab name="tab_library" title="Kütüphane"/> diff --git a/indra/newview/skins/default/xui/tr/panel_me.xml b/indra/newview/skins/default/xui/tr/panel_me.xml index dcf4f19be2..4b911c9ce6 100644 --- a/indra/newview/skins/default/xui/tr/panel_me.xml +++ b/indra/newview/skins/default/xui/tr/panel_me.xml @@ -1,7 +1,4 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <panel label="Profilim" name="panel_me"> - <tab_container name="tabs"> - <panel label="PROFİLİM" name="panel_profile"/> - <panel label="FAVORİLERİM" name="panel_picks"/> - </tab_container> + <panel label="SEÇMELERİM" name="panel_picks"/> </panel> diff --git a/indra/newview/skins/default/xui/tr/panel_my_profile.xml b/indra/newview/skins/default/xui/tr/panel_my_profile.xml deleted file mode 100644 index fc0b9b6e03..0000000000 --- a/indra/newview/skins/default/xui/tr/panel_my_profile.xml +++ /dev/null @@ -1,42 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes"?> -<panel label="Profil" name="panel_profile"> - <string name="CaptionTextAcctInfo"> - [ACCTTYPE] -[PAYMENTINFO] [AGEVERIFICATION] - </string> - <string name="payment_update_link_url"> - http://www.secondlife.com/account/billing.php?lang=en - </string> - <string name="partner_edit_link_url"> - http://www.secondlife.com/account/partners.php?lang=en - </string> - <string name="my_account_link_url" value="http://secondlife.com/account"/> - <string name="no_partner_text" value="Hiçbiri"/> - <string name="no_group_text" value="Hiçbiri"/> - <string name="RegisterDateFormat"> - [REG_DATE] ([AGE]) - </string> - <string name="name_text_args"> - [NAME] - </string> - <string name="display_name_text_args"> - [DISPLAY_NAME] - </string> - <layout_stack name="layout"> - <layout_panel name="profile_stack"> - <scroll_container name="profile_scroll"> - <panel name="scroll_content_panel"> - <panel name="second_life_image_panel"> - <text name="display_name_descr_text"> - Kullanıcı adı - </text> - <text name="name_descr_text"> - Görüntü Adı - </text> - <button label="Profil" name="see_profile_btn" tool_tip="Bu avatar profiline bak"/> - </panel> - </panel> - </scroll_container> - </layout_panel> - </layout_stack> -</panel> diff --git a/indra/newview/skins/default/xui/tr/panel_navigation_bar.xml b/indra/newview/skins/default/xui/tr/panel_navigation_bar.xml index b28036228f..8d43e3fb5a 100644 --- a/indra/newview/skins/default/xui/tr/panel_navigation_bar.xml +++ b/indra/newview/skins/default/xui/tr/panel_navigation_bar.xml @@ -1,18 +1,23 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <panel name="navigation_bar"> - <panel name="navigation_panel"> - <pull_button name="back_btn" tool_tip="Önceki konuma geri git"/> - <pull_button name="forward_btn" tool_tip="Bir konum ileri git"/> - <button name="home_btn" tool_tip="Ana konumuma ışınla"/> - <location_input label="Konum" name="location_combo"/> - <search_combo_box label="Ara" name="search_combo_box" tool_tip="Ara"> - <combo_editor label="[SECOND_LIFE] içinde arama yap" name="search_combo_editor"/> - </search_combo_box> - </panel> - <favorites_bar name="favorite" tool_tip="Second Life içerisinde sık kullandığınız yerlere hızla erişmek için Yer İmlerini buraya sürükleyin!"> - <label name="favorites_bar_label" tool_tip="Second Life içerisinde sık kullandığınız yerlere hızla erişmek için Yer İmlerini buraya sürükleyin!"> - Sık Kullanılanlar Çubuğu - </label> - <chevron_button name=">>" tool_tip="Sık Kullanılanlarımdan daha çok göster"/> - </favorites_bar> + <layout_stack name="nvp_stack"> + <layout_panel name="navigation_layout_panel"> + <panel name="navigation_panel"> + <pull_button name="back_btn" tool_tip="Önceki konuma geri git"/> + <pull_button name="forward_btn" tool_tip="Bir konum ileri git"/> + <button name="home_btn" tool_tip="Ana konumuma ışınla"/> + <location_input label="Konum" name="location_combo"/> + </panel> + </layout_panel> + <layout_panel name="favorites_layout_panel"> + <favorites_bar name="favorite" tool_tip="Second Life içerisinde sık kullandığınız yerlere hızla erişmek için Yer İmlerini buraya sürükleyin!"> + <label name="favorites_bar_label" tool_tip="Second Life içerisinde sık kullandığınız yerlere hızla erişmek için Yer İmlerini buraya sürükleyin!"> + Favoriler Çubuğu + </label> + <more_button name=">>" tool_tip="Favorilerimden daha çok göster"> + Daha Fazla ▼ + </more_button> + </favorites_bar> + </layout_panel> + </layout_stack> </panel> diff --git a/indra/newview/skins/default/xui/tr/panel_nearby_chat.xml b/indra/newview/skins/default/xui/tr/panel_nearby_chat.xml new file mode 100644 index 0000000000..c405105e00 --- /dev/null +++ b/indra/newview/skins/default/xui/tr/panel_nearby_chat.xml @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes"?> +<panel name="nearby_chat"> + <check_box label="Sohbeti çevir" name="translate_chat_checkbox"/> +</panel> diff --git a/indra/newview/skins/default/xui/tr/panel_notes.xml b/indra/newview/skins/default/xui/tr/panel_notes.xml deleted file mode 100644 index ff5b60996a..0000000000 --- a/indra/newview/skins/default/xui/tr/panel_notes.xml +++ /dev/null @@ -1,35 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes"?> -<panel label="Notlar ve Gizlilik" name="panel_notes"> - <layout_stack name="layout"> - <layout_panel name="notes_stack"> - <scroll_container name="profile_scroll"> - <panel name="profile_scroll_panel"> - <text name="status_message" value="Özel notlarım:"/> - <text name="status_message2" value="Bu kişiye şu izinler verilsin:"/> - <check_box label="Çevrimiçi durumumu görme" name="status_check"/> - <check_box label="Beni haritada görme" name="map_check"/> - <check_box label="Nesnelerimi düzenleme, silme veya alma" name="objects_check"/> - </panel> - </scroll_container> - </layout_panel> - <layout_panel name="notes_buttons_panel"> - <layout_stack name="bottom_bar_ls"> - <layout_panel name="add_friend_btn_lp"> - <button label="Arkadaş Ekle" name="add_friend" tool_tip="Sakine arkadaşlık öner"/> - </layout_panel> - <layout_panel name="im_btn_lp"> - <button label="Aİ" name="im" tool_tip="Anlık ileti oturumu aç"/> - </layout_panel> - <layout_panel name="call_btn_lp"> - <button label="Ara" name="call" tool_tip="Bu Sakini ara"/> - </layout_panel> - <layout_panel name="show_on_map_btn_lp"> - <button label="Harita" name="show_on_map_btn" tool_tip="Sakini haritada göster"/> - </layout_panel> - <layout_panel name="teleport_btn_lp"> - <button label="Işınla" name="teleport" tool_tip="Işınlama teklif et"/> - </layout_panel> - </layout_stack> - </layout_panel> - </layout_stack> -</panel> diff --git a/indra/newview/skins/default/xui/tr/panel_outfit_edit.xml b/indra/newview/skins/default/xui/tr/panel_outfit_edit.xml index cc9f531831..00cd49abcd 100644 --- a/indra/newview/skins/default/xui/tr/panel_outfit_edit.xml +++ b/indra/newview/skins/default/xui/tr/panel_outfit_edit.xml @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <!-- Side tray Outfit Edit panel --> <panel name="outfit_edit"> - <string name="No Outfit" value="Kıyafet Yok"/> + <string name="No Outfit" value="Dış Görünüm Yok"/> <string name="unsaved_changes" value="Kaydedilmemiş Değişiklikler"/> <string name="now_editing" value="Şimdi Düzenleniyor"/> <panel.string name="not_available"> @@ -20,7 +20,7 @@ <panel name="header_panel"> <panel name="outfit_name_and_status"> <text name="status" value="Şimdi düzenleniyor..."/> - <text name="curr_outfit_name" value="[Mevcut Kıyafet]"/> + <text name="curr_outfit_name" value="[Mevcut Dış Görünüm]"/> </panel> </panel> <layout_stack name="im_panels"> diff --git a/indra/newview/skins/default/xui/tr/panel_outfits_list.xml b/indra/newview/skins/default/xui/tr/panel_outfits_list.xml index 12892e1642..60a3576d84 100644 --- a/indra/newview/skins/default/xui/tr/panel_outfits_list.xml +++ b/indra/newview/skins/default/xui/tr/panel_outfits_list.xml @@ -6,6 +6,6 @@ </accordion> <panel name="bottom_panel"> <menu_button name="options_gear_btn" tool_tip="İlave seçenekleri göster"/> - <button name="trash_btn" tool_tip="Seçili kıyafeti sil"/> + <button name="trash_btn" tool_tip="Seçili dış görünümü sil"/> </panel> </panel> diff --git a/indra/newview/skins/default/xui/tr/panel_people.xml b/indra/newview/skins/default/xui/tr/panel_people.xml index 96701fbd84..1a1e53bac2 100644 --- a/indra/newview/skins/default/xui/tr/panel_people.xml +++ b/indra/newview/skins/default/xui/tr/panel_people.xml @@ -3,7 +3,7 @@ <panel label="Kişiler" name="people_panel"> <string name="no_recent_people" value="Yakın zamanlı kişi yok. Birlikte takılacak kişiler mi arıyorsunuz? [secondlife:///app/search/people Arayı] veya [secondlife:///app/worldmap Dünya Haritasını] deneyin."/> <string name="no_filtered_recent_people" value="Aradığınızı bulamadınız mı? [secondlife:///app/search/people/[SEARCH_TERM] Ara] deneyin."/> - <string name="no_one_near" value="Yakında kimse yok. Birlikte takılacak kişiler mi arıyorsunuz? [secondlife:///app/search/people Arayı] veya [secondlife:///app/worldmap Dünya Haritasını] deneyin."/> + <string name="no_one_near" value="Yakında kimse yok. Birlikte takılacak kişiler mi arıyorsunuz? [secondlife:///app/search/people Arayın] veya [secondlife:///app/worldmap Dünya Haritasını] deneyin."/> <string name="no_one_filtered_near" value="Aradığınızı bulamadınız mı? [secondlife:///app/search/people/[SEARCH_TERM] Ara] deneyin."/> <string name="no_friends_online" value="Çevrimiçi arkadaş yok"/> <string name="no_friends" value="Arkadaş yok"/> @@ -24,7 +24,7 @@ Birlikte takılacak kişiler mi arıyorsunuz? [secondlife:///app/worldmap Dünya <tab_container name="tabs"> <panel label="YAKIN" name="nearby_panel"> <panel label="bottom_panel" name="bottom_panel"> - <menu_button name="nearby_view_sort_btn" tool_tip="Seçenekler"/> + <menu_button name="nearby_view_sort_btn" tool_tip="Seçenklr."/> <button name="add_friend_btn" tool_tip="Seçilen Sakini arkadaş listene ekle"/> </panel> </panel> @@ -49,14 +49,14 @@ Birlikte takılacak kişiler mi arıyorsunuz? [secondlife:///app/worldmap Dünya </panel> <panel label="GRUPLARIM" name="groups_panel"> <panel label="bottom_panel" name="bottom_panel"> - <menu_button name="groups_viewsort_btn" tool_tip="Seçenekler"/> + <menu_button name="groups_viewsort_btn" tool_tip="Seçenklr."/> <button name="plus_btn" tool_tip="Gruba katıl/yeni grup oluştur"/> <button name="activate_btn" tool_tip="Seçilen grubu etkinleştir"/> </panel> </panel> <panel label="SON" name="recent_panel"> <panel label="bottom_panel" name="bottom_panel"> - <menu_button name="recent_viewsort_btn" tool_tip="Seçenekler"/> + <menu_button name="recent_viewsort_btn" tool_tip="Seçenklr."/> <button name="add_friend_btn" tool_tip="Seçilen Sakini arkadaş listene ekle"/> </panel> </panel> diff --git a/indra/newview/skins/default/xui/tr/panel_picks.xml b/indra/newview/skins/default/xui/tr/panel_picks.xml index a36f3faf03..26beac7854 100644 --- a/indra/newview/skins/default/xui/tr/panel_picks.xml +++ b/indra/newview/skins/default/xui/tr/panel_picks.xml @@ -1,22 +1,22 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <panel label="Favorilerim" name="panel_picks"> - <string name="no_picks" value="Favori Yok"/> + <string name="no_picks" value="Seçme Yok"/> <string name="no_classifieds" value="İlan Yok"/> <accordion name="accordion"> - <accordion_tab name="tab_picks" title="Favorilerim"/> + <accordion_tab name="tab_picks" title="Seçmelerim"/> <accordion_tab name="tab_classifieds" title="İlanlar"/> </accordion> <panel label="bottom_panel" name="edit_panel"> <layout_stack name="edit_panel_ls"> <layout_panel name="gear_menu_btn"> - <button name="new_btn" tool_tip="Mevcut konumda yeni bir favori veya ilan oluşturun"/> + <button name="new_btn" tool_tip="Mevcut konumda yeni bir seçme veya ilan oluşturun"/> </layout_panel> </layout_stack> </panel> <panel name="buttons_cucks"> <layout_stack name="buttons_cucks_ls"> <layout_panel name="info_btn_lp"> - <button label="Bilgi" name="info_btn" tool_tip="Favori bilgilerini göster"/> + <button label="Bilgi" name="info_btn" tool_tip="Seçme bilgilerini göster"/> </layout_panel> <layout_panel name="teleport_btn_lp"> <button label="Işınla" name="teleport_btn" tool_tip="İlişkili alana ışınlanın"/> diff --git a/indra/newview/skins/default/xui/tr/panel_preferences_advanced.xml b/indra/newview/skins/default/xui/tr/panel_preferences_advanced.xml index 787efa32f4..770cdc6efd 100644 --- a/indra/newview/skins/default/xui/tr/panel_preferences_advanced.xml +++ b/indra/newview/skins/default/xui/tr/panel_preferences_advanced.xml @@ -6,11 +6,11 @@ <text name="Cache:"> Önbellek: </text> - <spinner label="Önbellek büyüklüğü (64 - 9984 MB)" name="cachesizespinner"/> + <spinner label="Önbellek boyutu (64-9984 MB)" name="cachesizespinner"/> <text name="text_box5"> MB </text> - <button label="Önbelleği Temizle" label_selected="Önbelleği Temizle" name="clear_cache"/> + <button label="Önbelleği Sil" label_selected="Önbelleği Sil" name="clear_cache"/> <text name="Cache location"> Önbellek konumu: </text> diff --git a/indra/newview/skins/default/xui/tr/panel_preferences_chat.xml b/indra/newview/skins/default/xui/tr/panel_preferences_chat.xml index bb7e6da68c..f7f0698a31 100644 --- a/indra/newview/skins/default/xui/tr/panel_preferences_chat.xml +++ b/indra/newview/skins/default/xui/tr/panel_preferences_chat.xml @@ -16,9 +16,9 @@ Aİ'leri şurada göster: </text> <text name="requires_restart_label"> - (yeniden başlatma gerektirir) + (tekrar başlatma gerekir) </text> - <radio_group name="chat_window" tool_tip="Anlık İletilerinizi ayrı gezdiricilerde veya birden çok sekmeye sahip tek bir gezdiricide gösterin (Yeniden başlatma gerektirir)"> + <radio_group name="chat_window" tool_tip="Anlık İletileri ayrı gezdiricilerde veya çoklu sekmelere sahip tek bir gezdiricide gösterin (tekrar başlatma gerekir)"> <radio_item label="Ayrı Pencereler" name="radio" value="0"/> <radio_item label="Sekmeler" name="radio2" value="1"/> </radio_group> @@ -30,7 +30,7 @@ <spinner label="Yakındaki sohbet iletilerinin vurgulanma süresi:" name="nearby_toasts_lifetime"/> <spinner label="Yakındaki sohbet iletilerinin sönme süresi:" name="nearby_toasts_fadingtime"/> <text name="translate_chb_label"> - Sohbet ederken makine çevirisi kullanılsın (Google tarafından desteklenir) + Sohbet ederken makine çevirisi kullanılsın </text> <text name="translate_language_text"> Sohbeti şu dile çevir: @@ -50,7 +50,7 @@ <combo_box.item label="Русский (Rusça)" name="Russian"/> <combo_box.item label="Türkçe (Türkçe)" name="Turkish"/> <combo_box.item label="Українська (Ukraynaca)" name="Ukrainian"/> - <combo_box.item label="中文 (简体) (Çince)" name="Chinese"/> + <combo_box.item label="中文 (正體) (Çince)" name="Chinese"/> <combo_box.item label="日本語 (Japonca)" name="Japanese"/> <combo_box.item label="한국어 (Korece)" name="Korean"/> </combo_box> diff --git a/indra/newview/skins/default/xui/tr/panel_preferences_general.xml b/indra/newview/skins/default/xui/tr/panel_preferences_general.xml index bd651049d0..4a48b1588c 100644 --- a/indra/newview/skins/default/xui/tr/panel_preferences_general.xml +++ b/indra/newview/skins/default/xui/tr/panel_preferences_general.xml @@ -5,22 +5,24 @@ </text> <combo_box name="language_combobox"> <combo_box.item label="Sistem varsayılanı" name="System Default Language"/> - <combo_box.item label="İngilizce" name="English"/> + <combo_box.item label="English (İngilizce)" name="English"/> <combo_box.item label="Dansk (Danca) - Beta" name="Danish"/> <combo_box.item label="Deutsch (Almanca) - Beta" name="Deutsch(German)"/> <combo_box.item label="Español (İspanyolca) - Beta" name="Spanish"/> <combo_box.item label="Français (Fransızca) - Beta" name="French"/> <combo_box.item label="Italiano (İtalyanca) - Beta" name="Italian"/> - <combo_box.item label="Nederlands (Felemekçe) - Beta" name="Dutch"/> <combo_box.item label="Polski (Lehçe) - Beta" name="Polish"/> <combo_box.item label="Português (Portekizce) - Beta" name="Portugese"/> + <combo_box.item label="Русский (Rusça) - Beta" name="Russian"/> + <combo_box.item label="Türkçe - Beta" name="Turkish"/> <combo_box.item label="日本語 (Japonca) - Beta" name="(Japanese)"/> + <combo_box.item label="正體中文 (Geleneksel Çince) - Beta" name="Traditional Chinese"/> </combo_box> <text name="language_textbox2"> (Yeniden başlatma gerekir) </text> <text name="maturity_desired_prompt"> - Seviyelendirdiğim şu içeriğe erişim istiyorum: + Seviyelndrl. içeriğe erişim istiyorum:: </text> <combo_box name="maturity_desired_combobox"> <combo_box.item label="Genel, Orta, Yetişkin" name="Desired_Adult"/> diff --git a/indra/newview/skins/default/xui/tr/panel_preferences_graphics1.xml b/indra/newview/skins/default/xui/tr/panel_preferences_graphics1.xml index ba31640e9c..ddb83ffc69 100644 --- a/indra/newview/skins/default/xui/tr/panel_preferences_graphics1.xml +++ b/indra/newview/skins/default/xui/tr/panel_preferences_graphics1.xml @@ -51,7 +51,7 @@ <combo_box.item label="Tüm avatarlar ve nesneler" name="3"/> <combo_box.item label="Her şey" name="4"/> </combo_box> - <slider label="Avatarın Fiziksel Özellikleri:" name="AvatarPhysicsDetail"/> + <slider label="Avatar Fzk. Özlk.:" name="AvatarPhysicsDetail"/> <text name="AvatarPhysicsDetailText"> Düşük </text> @@ -60,7 +60,7 @@ m </text> <slider label="Maks. parçacık sayısı:" name="MaxParticleCount"/> - <slider label="Düşük grafik özellikli olmayan maks. avatar sayısı:" name="MaxNumberAvatarDrawn"/> + <slider label="Düşük gr. özl. olmayan mks. avatar:" name="MaxNumberAvatarDrawn"/> <slider label="Son işleme kalitesi:" name="RenderPostProcess"/> <text name="MeshDetailText"> Örgü detayı: diff --git a/indra/newview/skins/default/xui/tr/panel_preferences_move.xml b/indra/newview/skins/default/xui/tr/panel_preferences_move.xml index da102b078c..c35eaec9c3 100644 --- a/indra/newview/skins/default/xui/tr/panel_preferences_move.xml +++ b/indra/newview/skins/default/xui/tr/panel_preferences_move.xml @@ -7,18 +7,33 @@ </text> <check_box label="İnşa Et/Düzenle" name="edit_camera_movement" tool_tip="Düzenleme moduna girerken ve düzenleme modundan çıkarken otomatik kamera konumunu kullanın"/> <check_box label="Görünüm" name="appearance_camera_movement" tool_tip="Düzenleme modundayken otomatik kamera konumunu kullan"/> - <check_box initial_value="true" label="Kenar çubuğu" name="appearance_sidebar_positioning" tool_tip="Kenar çubuğu için otomatik kamera konumunu kullan"/> + <text name="keyboard_lbl"> + Klavye: + </text> + <check_box label="Ok tuşları beni her zaman hareket ettirir" name="arrow_keys_move_avatar_check"/> + <check_box label="Koşmak için iki kez dokun ve tut" name="tap_tap_hold_to_run"/> + <text name="mouse_lbl"> + Fare: + </text> <check_box label="Fare üzerinden görünümde beni göster" name="first_person_avatar_visible"/> <text name=" Mouse Sensitivity"> Fare üzerinden görünümde fare hassasiyeti </text> <check_box label="Tersine çevir" name="invert_mouse"/> - <check_box label="Ok tuşları beni her zaman hareket ettirir" name="arrow_keys_move_avatar_check"/> - <check_box label="Koşmak için iki kez dokun ve tut" name="tap_tap_hold_to_run"/> - <check_box label="Çift Tıklayınca şunu yap:" name="double_click_chkbox"/> - <radio_group name="double_click_action"> - <radio_item label="Işınla" name="radio_teleport"/> - <radio_item label="Otomatik pilot" name="radio_autopilot"/> - </radio_group> + <text name="single_click_action_lbl"> + Arazi üzerine tek tıklama: + </text> + <combo_box name="single_click_action_combo"> + <combo_box.item label="Eylem yok" name="0"/> + <combo_box.item label="Tıklanan noktaya hareket et" name="1"/> + </combo_box> + <text name="double_click_action_lbl"> + Arazi üzerine çift tıklama: + </text> + <combo_box name="double_click_action_combo"> + <combo_box.item label="Eylem yok" name="0"/> + <combo_box.item label="Tıklanan noktaya hareket et" name="1"/> + <combo_box.item label="Tıklanan noktaya ışınla" name="2"/> + </combo_box> <button label="Diğer Aygıtlar" name="joystick_setup_button"/> </panel> diff --git a/indra/newview/skins/default/xui/tr/panel_preferences_privacy.xml b/indra/newview/skins/default/xui/tr/panel_preferences_privacy.xml index 38fa8ab7f9..9111594979 100644 --- a/indra/newview/skins/default/xui/tr/panel_preferences_privacy.xml +++ b/indra/newview/skins/default/xui/tr/panel_preferences_privacy.xml @@ -11,7 +11,7 @@ <check_box label="Çevrimiçi olduğumu sadece arkadaşlar ve gruplar bilsin" name="online_visibility"/> <check_box label="Sadece arkadaşlar ve gruplar beni arasın veya Aİ göndersin" name="voice_call_friends_only_check"/> <check_box label="Aramaları sonlandırırken mikrofonu kapat" name="auto_disengage_mic_check"/> - <check_box label="Oturum Açarken Sık Kullanılan Yer İmlerimi Göster ('Buradan başla' açılır menüsünden)" name="favorites_on_login_check"/> + <check_box label="Oturum Açarken Favori Yer İmlerimi Göster ('Buradan başla' menüsünden)" name="favorites_on_login_check"/> <text name="Logs:"> Sohbet Günlükleri: </text> diff --git a/indra/newview/skins/default/xui/tr/panel_profile.xml b/indra/newview/skins/default/xui/tr/panel_profile.xml deleted file mode 100644 index 4b7a964537..0000000000 --- a/indra/newview/skins/default/xui/tr/panel_profile.xml +++ /dev/null @@ -1,67 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes"?> -<panel label="Profil" name="panel_profile"> - <string name="CaptionTextAcctInfo"> - [ACCTTYPE] -[PAYMENTINFO] [AGEVERIFICATION] - </string> - <string name="payment_update_link_url"> - http://www.secondlife.com/account/billing.php?lang=en - </string> - <string name="partner_edit_link_url"> - http://www.secondlife.com/account/partners.php?lang=en - </string> - <string name="my_account_link_url" value="http://secondlife.com/account"/> - <string name="no_partner_text" value="Hiçbiri"/> - <string name="no_group_text" value="Hiçbiri"/> - <string name="RegisterDateFormat"> - [REG_DATE] ([AGE]) - </string> - <string name="name_text_args"> - [NAME] - </string> - <string name="display_name_text_args"> - [DISPLAY_NAME] - </string> - <layout_stack name="layout"> - <layout_panel name="profile_stack"> - <scroll_container name="profile_scroll"> - <panel name="profile_scroll_panel"> - <panel name="second_life_image_panel"> - <text name="title_sl_descr_text" value="[SECOND_LIFE]:"/> - </panel> - <panel name="first_life_image_panel"> - <text name="title_rw_descr_text" value="Gerçek Dünya:"/> - </panel> - <text name="title_member_text" value="Ne Zamandan Beri SL Sakini:"/> - <text name="title_acc_status_text" value="Hesap Durumu:"/> - <text name="title_partner_text" value="Partner:"/> - <panel name="partner_data_panel"> - <text initial_value="(alınıyor)" name="partner_text"/> - </panel> - <text name="title_groups_text" value="Gruplar:"/> - </panel> - </scroll_container> - </layout_panel> - </layout_stack> - <layout_stack name="layout_verb_buttons"> - <layout_panel name="profile_buttons_panel"> - <layout_stack name="bottom_bar_ls"> - <layout_panel name="add_friend_btn_lp"> - <button label="Arkadaş Ekle" name="add_friend" tool_tip="Sakine arkadaşlık öner"/> - </layout_panel> - <layout_panel name="im_btn_lp"> - <button label="Aİ" name="im" tool_tip="Anlık ileti oturumu aç"/> - </layout_panel> - <layout_panel name="call_btn_lp"> - <button label="Ara" name="call" tool_tip="Bu Sakini ara"/> - </layout_panel> - <layout_panel name="chat_btn_lp"> - <button label="Işınla" name="teleport" tool_tip="Işınlama teklif et"/> - </layout_panel> - <layout_panel name="overflow_btn_lp"> - <menu_button label="▼" name="overflow_btn" tool_tip="Sakine para öde veya envanteri paylaş"/> - </layout_panel> - </layout_stack> - </layout_panel> - </layout_stack> -</panel> diff --git a/indra/newview/skins/default/xui/tr/panel_profile_view.xml b/indra/newview/skins/default/xui/tr/panel_profile_view.xml deleted file mode 100644 index c5cee39b70..0000000000 --- a/indra/newview/skins/default/xui/tr/panel_profile_view.xml +++ /dev/null @@ -1,20 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes"?> -<panel name="panel_target_profile"> - <string name="status_online"> - Çevrimiçi - </string> - <string name="status_offline"> - Çevrimdışı - </string> - <text name="display_name_label" value="Ekran Adı:"/> - <text name="solo_username_label" value="Kullanıcı Adı:"/> - <text name="status" value="Çevrimiçi"/> - <text name="user_name_small" value="Bak arkadaşım bu çok uzun bir ad"/> - <button name="copy_to_clipboard" tool_tip="Panoya Kopyala"/> - <text name="user_label" value="Kullanıcı Adı:"/> - <tab_container name="tabs"> - <panel label="PROFİL" name="panel_profile"/> - <panel label="FAVORİLER" name="panel_picks"/> - <panel label="NOTLAR & GİZLİLİK" name="panel_notes"/> - </tab_container> -</panel> diff --git a/indra/newview/skins/default/xui/tr/panel_region_debug.xml b/indra/newview/skins/default/xui/tr/panel_region_debug.xml index f16c666e86..6e15e0f6f6 100644 --- a/indra/newview/skins/default/xui/tr/panel_region_debug.xml +++ b/indra/newview/skins/default/xui/tr/panel_region_debug.xml @@ -21,14 +21,14 @@ </line_editor> <button label="Seç" name="choose_avatar_btn"/> <text name="options_text_lbl"> - Seçenekler: + Seçenklr.: </text> <check_box label="Komut dosyaları ile" name="return_scripts" tool_tip="Sadece komut dosyaları olan nesneler iade edilsin"/> <check_box label="Başkasına ait arazi üzerinde" name="return_other_land" tool_tip="Sadece başkasına ait arazi üzerinde olan nesneler iade edilsin"/> <check_box label="Bu gayrimenkulu oluşturan bölgelerin tümünde" name="return_estate_wide" tool_tip="Bu gayrimenkulu oluşturan bölgelerin tümündeki nesneler iade edilsin"/> <button label="İade Et" name="return_btn"/> <button label="En Çok Çarpışanlar..." name="top_colliders_btn" tool_tip="En çok potansiyel çarpışma yaşayan nesnelerin listesi"/> - <button label="En Çok Komut Dosyası Çalıştıranlar..." name="top_scripts_btn" tool_tip="Komut dosyalarını çalıştırırken en çok zaman harcayan nesnelerin listesi"/> + <button label="En Çok Komut Dsy. Çalştr...." name="top_scripts_btn" tool_tip="Komut dosyalarını çalıştırırken en çok zaman harcayan nesnelerin listesi"/> <button label="Bölgeyi Yeniden Başlat" name="restart_btn" tool_tip="2 dakikalık bir geri sayımdan sonra bölgeyi yeniden başlat"/> <button label="Yeniden Başlatmayı Ertele" name="cancel_restart_btn" tool_tip="Bölgenin yeniden başlatılmasını 1 saat ertele"/> </panel> diff --git a/indra/newview/skins/default/xui/tr/panel_region_environment.xml b/indra/newview/skins/default/xui/tr/panel_region_environment.xml index 851cd23f30..058ea91b70 100644 --- a/indra/newview/skins/default/xui/tr/panel_region_environment.xml +++ b/indra/newview/skins/default/xui/tr/panel_region_environment.xml @@ -15,7 +15,7 @@ <combo_box.item label="-Bir ön ayar seçin-" name="item0"/> </combo_box> <text name="sky_dayc_settings_title"> - Gökyüzü / Gün Döngüsü + Gökyüzü/Gün Dön. </text> <radio_group name="sky_dayc_settings_radio_group"> <radio_item label="Sabit gökyüzü" name="my_sky_settings"/> diff --git a/indra/newview/skins/default/xui/tr/panel_region_terrain.xml b/indra/newview/skins/default/xui/tr/panel_region_terrain.xml index 874d27abfb..3226ee008e 100644 --- a/indra/newview/skins/default/xui/tr/panel_region_terrain.xml +++ b/indra/newview/skins/default/xui/tr/panel_region_terrain.xml @@ -7,7 +7,7 @@ bilinmiyor </text> <spinner label="Su Yüksekliği" name="water_height_spin"/> - <spinner label="Yüzey Yükseltme Limiti" name="terrain_raise_spin"/> + <spinner label="Yüzey Yükslt. Limiti" name="terrain_raise_spin"/> <spinner label="Yüzey Alçatma Limiti" name="terrain_lower_spin"/> <text name="detail_texture_text"> Yüzey Dokuları (512x512, 24 bit .tga dosyalar gerektirir) diff --git a/indra/newview/skins/default/xui/tr/panel_status_bar.xml b/indra/newview/skins/default/xui/tr/panel_status_bar.xml index a7491e9c88..63726b94e2 100644 --- a/indra/newview/skins/default/xui/tr/panel_status_bar.xml +++ b/indra/newview/skins/default/xui/tr/panel_status_bar.xml @@ -17,12 +17,9 @@ </panel.string> <panel name="balance_bg"> <text name="balance" tool_tip="L$ bakiyenizi yenilemek için buraya tıklayın" value="L$20"/> - <button label="L$ SATIN AL" name="buyL" tool_tip="Daha fazla L$ satın almak için tıklayın"/> + <button label="L$ Satın Al" name="buyL" tool_tip="Daha fazla L$ satın almak için tıklayın"/> + <button label="Alışveriş yap" name="goShop" tool_tip="Second Life Pazaryeri Aç"/> </panel> - <combo_box name="mode_combo" tool_tip="Modunuzu seçin. Hızlı ve kolay keşif yapmak ile sohbet etmek için Temel seçimini yapın. Daha fazla özelliğe erişmek için Gelişmiş seçimini yapın."> - <combo_box.item label="Temel Mod" name="Basic"/> - <combo_box.item label="Gelişmiş Mod" name="Advanced"/> - </combo_box> <text name="TimeText" tool_tip="Geçerli zaman (Pasifik)"> 24:00 AM PST </text> diff --git a/indra/newview/skins/default/xui/tr/role_actions.xml b/indra/newview/skins/default/xui/tr/role_actions.xml index 002589b276..655ac64172 100644 --- a/indra/newview/skins/default/xui/tr/role_actions.xml +++ b/indra/newview/skins/default/xui/tr/role_actions.xml @@ -44,7 +44,7 @@ <action_set description="Bu Yeteneklere, grubun sahip olduğu parsellere erişime izin verme veya buralara erişimi yasaklama ve Second Life Sakinlerini dondurma veya parselden dışarı çıkarma da dahildir." name="Parcel Access"> <action description="Parselin Erişim listelerini yönet" longdescription="Parselin Erişim listelerini Arazi Hakkında > Erişim sekmesinden yönetin." name="land manage allowed" value="29"/> <action description="Parselin Yasaklama listelerini yönet" longdescription="Parselin Yasaklama listelerini Arazi Hakkında > Erişim sekmesinden yönetin." name="land manage banned" value="30"/> - <action description="Parselin 'Geçiş haklarını şuna sat' ayarlarını değiştir" longdescription="Parselin 'Geçiş haklarını şuna sat' ayarlarını Arazi Hakkında > Erişim sekmesinden değiştirin." name="land manage passes" value="31"/> + <action description="Parselin 'Geçiş haklr. şuna sat' ayarlarını değiştir" longdescription="Parselin 'Geçiş haklr. şuna sat' ayarlarını Arazi Hakkında > Erişim sekmesinden değiştirin." name="land manage passes" value="31"/> <action description="Parsel üzerindeki Second Life Sakinlerini dışarı çıkar veya dondur" longdescription="Bu Yeteneğe sahip olan bir Roldeki Üyeler, grubun sahip olduğu bir parsel üzerinde olmasını istemedikleri bir Second Life sakininin üzerini sağ tıklatıp 'Dışarı Çıkar' veya 'Dondur'u seçebilirler." name="land admin" value="32"/> </action_set> <action_set description="Bu Yeteneklere üyelerin nesneleri iade etmelerine, Linden bitkilerini yerleştirmelerine ve bu bitkilerin yerlerini değiştirmelerine izin veren güçler de dahildir. Bu özellik, Üyelerin çöpleri temizlemeleri ve bahçe düzenlemesi yapmaları için kullanışlıdır; fakat dikkatle kullanılmalıdır, çünkü nesneleri iade etmenin geri alınma imkanı yoktur." name="Parcel Content"> @@ -53,10 +53,10 @@ <action description="Gruba ait olmayan nesneleri iade et" longdescription="Grubun sahip olduğu parseller üzerinde gruba ait olmayan nesneleri Arazi Hakkında > Nesneler sekmesinden iade edin." name="land return non group" value="34"/> <action description="Linden bitkilerini kullanarak bahçe düzenleme" longdescription="Linden ağaçlarını, bitkilerini ve çimleri yerleştirerek veya yerlerini değiştirerek bahçe düzenleme yeteneği. Bu öğeler envanterinizin Kütüphane > Nesneler klasörü içinde bulunabilir veya İnşa Et menüsünden oluşturulabilir." name="land gardening" value="35"/> </action_set> - <action_set description="Bu Yeteneklere grubun sahip olduğu nesneleri devretme, değiştirme ve satma güçleri de dahildir. Bu değişiklikler İnşa Araçları > Genel sekmesinden yapılabilir. Bir nesneyi sağ tıklatıp Düzenle'yi seçerek ayarlarını görebilirsiniz." name="Object Management"> - <action description="Nesneleri gruba devret" longdescription="Nesneleri İnşa Araçları > Genel sekmesinden gruba devredin." name="object deed" value="36"/> - <action description="Grubun sahip olduğu nesneleri kullan (taşı, kopyala, değiştir)" longdescription="Grubun sahip olduğu nesneleri, İnşa Araçları > Genel sekmesi üzerinden kullanın (taşıyın, kopyalayın, değiştirin)." name="object manipulate" value="38"/> - <action description="Grubun sahip olduğu nesneleri satışa çıkar" longdescription="Grubun sahip olduğu nesneleri İnşa Araçları > Genel sekmesinden satışa çıkarın." name="object set sale" value="39"/> + <action_set description="Bu Yeteneklere grubun sahip olduğu nesneleri devretme, değiştirme ve satma güçleri de dahildir. Bu değişiklikler İnşa Et Araçları > Genel sekmesinden yapılabilir. Bir nesneyi sağ tıklatıp Düzenle'yi seçerek ayarlarını görebilirsiniz." name="Object Management"> + <action description="Nesneleri gruba devret" longdescription="Nesneleri İnşa Et Araçları > Genel sekmesinden gruba devredin." name="object deed" value="36"/> + <action description="Grubun sahip olduğu nesneleri kullan (taşı, kopyala, değiştir)" longdescription="Grubun sahip olduğu nesneleri, İnşa Et Araçları > Genel sekmesi üzerinden kullanın (taşıyın, kopyalayın, değiştirin)." name="object manipulate" value="38"/> + <action description="Grubun sahip olduğu nesneleri satışa çıkar" longdescription="Grubun sahip olduğu nesneleri İnşa Et Araçları > Genel sekmesinden satışa çıkarın." name="object set sale" value="39"/> </action_set> <action_set description="Bu Yeteneklere Üyelerin grup borçlarını ödemesini ve grup kâr paylarını almasını sağlayan ve grup hesabının geçmiş bilgilerine erişimi sınırlandıran güçler de dahildir." name="Accounting"> <action description="Grup borçlarını öde ve grup kâr paylarını al" longdescription="Bu Yeteneğe sahip bir Roldeki Üyeler otomatik olarak grup borçlarını ödeyecek ve grup kâr paylarını alacaktır. Bu da grubun sahip olduğu arazi satışlarından kendilerine düşen ve günlük olarak dağıtılan ksımı alacakları gibi parsel için ilan verme ücreti gibi masraflara da katkıda bulunacakları anlamına gelir." name="accounting accountable" value="40"/> diff --git a/indra/newview/skins/default/xui/tr/sidepanel_appearance.xml b/indra/newview/skins/default/xui/tr/sidepanel_appearance.xml index 75528974ec..b632f21cf5 100644 --- a/indra/newview/skins/default/xui/tr/sidepanel_appearance.xml +++ b/indra/newview/skins/default/xui/tr/sidepanel_appearance.xml @@ -1,9 +1,9 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> -<panel label="Kıyafetler" name="appearance panel"> - <string name="No Outfit" value="Kıyafet Yok"/> +<panel label="Dış Görünümler" name="appearance panel"> + <string name="No Outfit" value="Dış Görünüm Yok"/> <string name="Unsaved Changes" value="Kaydedilmemiş değişiklikler"/> <string name="Now Wearing" value="Şimdi giyiyor..."/> - <string name="Changing outfits" value="Kıyafetleri değiştiriyor"/> + <string name="Changing outfits" value="Dış görünümler değiştiriliyor"/> <panel name="panel_currentlook"> <button label="E" name="editappearance_btn"/> <button label="O" name="openoutfit_btn"/> @@ -11,9 +11,9 @@ (Durum) </text> <text name="currentlook_name"> - MOOSE gibi gerçekten Uzun bir Adla Kıyafetim + MOOSE gibi gerçekten Uzun bir Adla Dış Görünümüm </text> - <button label="" name="edit_outfit_btn" tool_tip="Bu kıyafeti düzenle"/> + <button label="" name="edit_outfit_btn" tool_tip="Bu dış görünümü düzenle"/> </panel> - <filter_editor label="Kıyafetleri Filtrele" name="Filter"/> + <filter_editor label="Dış Görünümleri Filtrele" name="Filter"/> </panel> diff --git a/indra/newview/skins/default/xui/tr/sidepanel_inventory.xml b/indra/newview/skins/default/xui/tr/sidepanel_inventory.xml index e02eae1d92..70c449b402 100644 --- a/indra/newview/skins/default/xui/tr/sidepanel_inventory.xml +++ b/indra/newview/skins/default/xui/tr/sidepanel_inventory.xml @@ -7,14 +7,14 @@ <layout_panel name="inbox_layout_panel"> <panel label="" name="marketplace_inbox"> <string name="InboxLabelWithArg"> - Alınan Öğeler ([NUM]) + Alınan öğeler ([NUM]) </string> <string name="InboxLabelNoArg"> - Alınan Öğeler + Alınan öğeler </string> - <button label="Alınan Öğeler" name="inbox_btn"/> + <button label="Alınan öğeler" name="inbox_btn"/> <text name="inbox_fresh_new_count"> - [NUM] Yeni + [NUM] yeni </text> <panel tool_tip="Drag and drop items to your inventory to manage and use them"> <text name="inbox_inventory_placeholder"> @@ -26,12 +26,12 @@ <layout_panel name="outbox_layout_panel"> <panel label="" name="marketplace_outbox"> <string name="OutboxLabelWithArg"> - Satıcı Giden Kutusu ([NUM]) + Satıcı giden kutusu ([NUM]) </string> <string name="OutboxLabelNoArg"> - Satıcı Giden Kutusu + Satıcı giden kutusu </string> - <button label="Satıcı Giden Kutusu" name="outbox_btn"/> + <button label="Satıcı giden kutusu" name="outbox_btn"/> <button label="" name="outbox_sync_btn" tool_tip="Pazaryeri Vitrinime Gönder"/> <panel> <panel name="outbox_inventory_placeholder_panel"> diff --git a/indra/newview/skins/default/xui/tr/sidepanel_task_info.xml b/indra/newview/skins/default/xui/tr/sidepanel_task_info.xml index 28eeef02d3..2fa6281f05 100644 --- a/indra/newview/skins/default/xui/tr/sidepanel_task_info.xml +++ b/indra/newview/skins/default/xui/tr/sidepanel_task_info.xml @@ -118,6 +118,6 @@ <button label="Aç" name="open_btn"/> <button label="Öde" name="pay_btn"/> <button label="Satın Al" name="buy_btn"/> - <button label="Ayrıntılar" name="details_btn"/> + <button label="Ayrıntl" name="details_btn"/> </panel> </panel> diff --git a/indra/newview/skins/default/xui/tr/strings.xml b/indra/newview/skins/default/xui/tr/strings.xml index 543989804a..bf331dc3cf 100644 --- a/indra/newview/skins/default/xui/tr/strings.xml +++ b/indra/newview/skins/default/xui/tr/strings.xml @@ -29,22 +29,22 @@ Önbellek temizleniyor... </string> <string name="StartupInitializingTextureCache"> - Doku Önbelleği Başlatılıyor... + Doku önbelleği başlatılıyor... </string> <string name="StartupInitializingVFS"> VFS Başlatılıyor... </string> <string name="StartupRequireDriverUpdate"> - Grafik Başlatma Başarılamadı. Lütfen Grafik Sürücünüzü Güncelleştirin! + Grafik başlatma başarılamadı. Lütfen grafik sürücünüzü güncelleştirin! </string> <string name="ProgressRestoring"> Geri yükleniyor... </string> <string name="ProgressChangingResolution"> - Çözünürlük Değiştiriliyor... + Çözünürlük değiştiriliyor... </string> <string name="Fullbright"> - Tam Parlak (Eski) + Tam parlak (eski) </string> <string name="LoginInProgress"> Oturum açılıyor. [APP_NAME] kilitlenmiş görünebilir. Lütfen bekleyin. @@ -77,10 +77,10 @@ Önbellek dosyaları doğrulanıyor (60-90 saniye zaman alabilir)... </string> <string name="LoginProcessingResponse"> - Yanıt İşleniyor... + Yanıt işleniyor... </string> <string name="LoginInitializingWorld"> - Dünya Başlatılıyor... + Dünya başlatılıyor... </string> <string name="LoginDecodingImages"> Görüntülerin kodu çözülüyor... @@ -128,7 +128,7 @@ Ağ sunucusu tarafından döndürülen sertifika imzası doğrulanamadı. Lütfen Ağ yöneticinize başvurun. </string> <string name="LoginFailedNoNetwork"> - Ağ Hatası: Bağlantı kurulamadı, lütfen ağ bağlantınızı kontrol edin. + Ağ hatası: Bağlantı kurulamadı, lütfen ağ bağlantınızı kontrol edin. </string> <string name="LoginFailed"> Oturum açılamadı. @@ -584,7 +584,7 @@ Lütfen bir dakika içerisinde tekrar oturum açmayı deneyin. sim durumu </string> <string name="favorite"> - sık kullanılan + favori </string> <string name="symbolic link"> bağlantı @@ -1205,7 +1205,7 @@ Lütfen bir dakika içerisinde tekrar oturum açmayı deneyin. Aradığınızı bulamadınız mı? [secondlife:///app/search/places/[SEARCH_TERM] Arama] ile bulmayı deneyin. </string> <string name="FavoritesNoMatchingItems"> - Bir yer imini sık kullanılanlarınıza eklemek için buraya sürükleyin. + Bir yer imini favorilerinize eklemek için buraya sürükleyin. </string> <string name="InventoryNoTexture"> Envanterinizde bu dokunun kopyası yok @@ -1273,6 +1273,9 @@ Lütfen bir dakika içerisinde tekrar oturum açmayı deneyin. <string name="Marketplace Error Internal Import"> Hata: Bu öğede bir sorun var. Daha sonra tekrar deneyin. </string> + <string name="Open landmarks"> + Açık yer imleri + </string> <string name="no_transfer" value="(aktarım yok)"/> <string name="no_modify" value="(değiştirme yok)"/> <string name="no_copy" value="(kopya yok)"/> @@ -1377,10 +1380,10 @@ Lütfen bir dakika içerisinde tekrar oturum açmayı deneyin. Mimikler </string> <string name="InvFolder Favorite"> - Sık Kullanılanlarım + Favorilerim </string> <string name="InvFolder favorite"> - Sık Kullanılanlarım + Favorilerim </string> <string name="InvFolder Current Outfit"> Mevcut Dış Görünüm @@ -1982,10 +1985,10 @@ Lütfen bir dakika içerisinde tekrar oturum açmayı deneyin. (yayınlandıktan sonra güncelleştirilir) </string> <string name="NoPicksClassifiedsText"> - Herhangi bir Favori veya İlan oluşturmadınız. Bir Favori veya İlan oluşturmak için aşağıdaki Artı düğmesine tıklayın. + Herhangi bir Seçme veya İlan oluşturmadınız. Bir Seçme veya İlan oluşturmak için aşağıdaki Artı düğmesine tıklayın. </string> <string name="NoAvatarPicksClassifiedsText"> - Kullanıcının herhangi bir favorisi veya ilanı yok + Kullanıcının herhangi bir seçmesi veya ilanı yok </string> <string name="PicksClassifiedsLoadingText"> Yükleniyor... @@ -2157,7 +2160,7 @@ Lütfen bir dakika içerisinde tekrar oturum açmayı deneyin. Aşağı </string> <string name="Any Category"> - Herhangi Bir Kategori + Herh. Bir Kategori </string> <string name="Shopping"> Alışveriş @@ -2187,7 +2190,7 @@ Lütfen bir dakika içerisinde tekrar oturum açmayı deneyin. Kişisel </string> <string name="None"> - Hiçbiri + Renksiz </string> <string name="Linden Location"> Linden Konumu @@ -2387,7 +2390,7 @@ Bu iletiyi almaya devam ederseniz, lütfen [SUPPORT_SITE] bölümüne başvurun. Arka Perçem </string> <string name="Baggy"> - Lüleler + Torbalı </string> <string name="Bangs"> Kahküller @@ -2477,7 +2480,7 @@ Bu iletiyi almaya devam ederseniz, lütfen [SUPPORT_SITE] bölümüne başvurun. Geniş </string> <string name="Brow Size"> - Kaş Büyüklüğü + Alın Genişliği </string> <string name="Bug Eyes"> Patlak Gözlü @@ -2774,7 +2777,7 @@ Bu iletiyi almaya devam ederseniz, lütfen [SUPPORT_SITE] bölümüne başvurun. Kaş Yüksekliği </string> <string name="Eyebrow Points"> - Kaş Noktaları + Kaş Yapısı </string> <string name="Eyebrow Size"> Kaş Büyüklüğü @@ -2843,13 +2846,13 @@ Bu iletiyi almaya devam ederseniz, lütfen [SUPPORT_SITE] bölümüne başvurun. Ön Perçem </string> <string name="Full Back"> - Saçlar Arkada + Arkası Düz </string> <string name="Full Eyeliner"> Çift Taraflı Göz Kalemi </string> <string name="Full Front"> - Saçlar Önde + Önü Düz </string> <string name="Full Hair Sides"> Saçlar Yanda @@ -2933,13 +2936,13 @@ Bu iletiyi almaya devam ederseniz, lütfen [SUPPORT_SITE] bölümüne başvurun. Yüksek Topuklar </string> <string name="High Jaw"> - Yüksek Çene Ucu + Ayrık </string> <string name="High Platforms"> - Yüksek Topuklu Ayakkabılar + Yüksek Topuklu </string> <string name="High and Tight"> - Tepede Bırakılmış Saç + Düşük </string> <string name="Higher"> Daha Yüksek @@ -2951,7 +2954,7 @@ Bu iletiyi almaya devam ederseniz, lütfen [SUPPORT_SITE] bölümüne başvurun. Kalça Genişliği </string> <string name="In"> - İç + İçeri </string> <string name="In Shdw Color"> İç Gölge Rengi @@ -2975,19 +2978,19 @@ Bu iletiyi almaya devam ederseniz, lütfen [SUPPORT_SITE] bölümüne başvurun. Ceket Kırışıklıkları </string> <string name="Jaw Angle"> - Çene Ucu Açısı + Çenenin Boyuna Uzaklığı </string> <string name="Jaw Jut"> - Çene Ucu Çıkıntısı + Alt Çene Uzunluğu </string> <string name="Jaw Shape"> - Çene Ucu Şekli + Çene Kemiği Genişliği </string> <string name="Join"> - Birleştir + Birleşik </string> <string name="Jowls"> - Gıdıklar + Avurtlar </string> <string name="Knee Angle"> Diz Açısı @@ -3026,7 +3029,7 @@ Bu iletiyi almaya devam ederseniz, lütfen [SUPPORT_SITE] bölümüne başvurun. Daha Az Dolgun </string> <string name="Less Gravity"> - Daha Az Yerçekimi + Dik Göğüs </string> <string name="Less Love"> Daha İnce Bel @@ -3044,7 +3047,7 @@ Bu iletiyi almaya devam ederseniz, lütfen [SUPPORT_SITE] bölümüne başvurun. Daha Az Yuvarlak </string> <string name="Less Saddle"> - Daha Dar Kalça + Basensiz </string> <string name="Less Square"> Daha Az Küt @@ -3095,7 +3098,7 @@ Bu iletiyi almaya devam ederseniz, lütfen [SUPPORT_SITE] bölümüne başvurun. Uzun Kafa </string> <string name="Long Hips"> - Geniş Kalçalar + Yüksek kalça </string> <string name="Long Legs"> Uzun Bacaklar @@ -3104,7 +3107,7 @@ Bu iletiyi almaya devam ederseniz, lütfen [SUPPORT_SITE] bölümüne başvurun. Uzun Boyun </string> <string name="Long Pigtails"> - Uzun Saç Örgüleri + Yandan Uzun Kuyruk </string> <string name="Long Ponytail"> Uzun Atkuyruğu @@ -3134,13 +3137,13 @@ Bu iletiyi almaya devam ederseniz, lütfen [SUPPORT_SITE] bölümüne başvurun. Alçak Topuklar </string> <string name="Low Jaw"> - Düşük Çene Ucu + Bitişik </string> <string name="Low Platforms"> Alçak Topuklu </string> <string name="Low and Loose"> - Serbest At Kuyruğu + Yüksek </string> <string name="Lower"> Daha Alçak @@ -3179,7 +3182,7 @@ Bu iletiyi almaya devam ederseniz, lütfen [SUPPORT_SITE] bölümüne başvurun. Daha Dolgun </string> <string name="More Gravity"> - Daha Çok Yerçekimi + Sarkık Göğüs </string> <string name="More Lipstick"> Daha Çok Ruj @@ -3188,7 +3191,7 @@ Bu iletiyi almaya devam ederseniz, lütfen [SUPPORT_SITE] bölümüne başvurun. Daha Kalın Bel </string> <string name="More Lower Lip"> - Daha Çok Alt Dudak + Daha Dolgun Alt Dudak </string> <string name="More Muscles"> Daha Çok Kas @@ -3203,7 +3206,7 @@ Bu iletiyi almaya devam ederseniz, lütfen [SUPPORT_SITE] bölümüne başvurun. Daha Yuvarlak </string> <string name="More Saddle"> - Daha Geniş Kalça + Basenli </string> <string name="More Sloped"> Daha Eğimli @@ -3212,7 +3215,7 @@ Bu iletiyi almaya devam ederseniz, lütfen [SUPPORT_SITE] bölümüne başvurun. Daha Küt </string> <string name="More Upper Lip"> - Daha Çok Üst Dudak + Daha Dolgun Üst Dudak </string> <string name="More Vertical"> Daha Dikey @@ -3257,7 +3260,7 @@ Bu iletiyi almaya devam ederseniz, lütfen [SUPPORT_SITE] bölümüne başvurun. Önü Dar </string> <string name="Narrow Lips"> - İnce Dudaklar + Küçük Dudaklar </string> <string name="Natural"> Doğal @@ -3356,7 +3359,7 @@ Bu iletiyi almaya devam ederseniz, lütfen [SUPPORT_SITE] bölümüne başvurun. Turuncu </string> <string name="Out"> - Dış + Dışarı </string> <string name="Out Shdw Color"> Dış Gölge Rengi @@ -3374,7 +3377,7 @@ Bu iletiyi almaya devam ederseniz, lütfen [SUPPORT_SITE] bölümüne başvurun. Dış Gölge </string> <string name="Overbite"> - Üst Dişler Önde + Öne Doğru </string> <string name="Package"> Apış Arası Şişkinliği @@ -3413,7 +3416,7 @@ Bu iletiyi almaya devam ederseniz, lütfen [SUPPORT_SITE] bölümüne başvurun. Pigment </string> <string name="Pigtails"> - Saç Örgüleri + Yan Kuyruklar </string> <string name="Pink"> Pembe @@ -3428,7 +3431,7 @@ Bu iletiyi almaya devam ederseniz, lütfen [SUPPORT_SITE] bölümüne başvurun. Topuk Genişliği </string> <string name="Pointy"> - Sivri + Dar </string> <string name="Pointy Heels"> Sivri Topuklar @@ -3479,25 +3482,25 @@ Bu iletiyi almaya devam ederseniz, lütfen [SUPPORT_SITE] bölümüne başvurun. Dağınık Saç </string> <string name="Saddle Bags"> - Kalça Kalınlığı + Basen Genişliği </string> <string name="Scrawny Leg"> Sıska Bacak </string> <string name="Separate"> - Ayrı + Ayrık </string> <string name="Shallow"> Sığ </string> <string name="Shear Back"> - Arkayı Dikey Kaydır + Arka Dolgunluğu </string> <string name="Shear Face"> Yüzü Dikey Kaydır </string> <string name="Shear Front"> - Önü Dikey Kaydır + Ön Dolgunluğu </string> <string name="Shear Left Up"> Solu Yukarı Kaydır @@ -3506,10 +3509,10 @@ Bu iletiyi almaya devam ederseniz, lütfen [SUPPORT_SITE] bölümüne başvurun. Sağı Yukarı Kaydır </string> <string name="Sheared Back"> - Arkası Dikey Kaydırılmış + Arkası Dolgun </string> <string name="Sheared Front"> - Önü Dikey Kaydırılmış + Önü Dolgun </string> <string name="Shift Left"> Sola Kaydır @@ -3545,7 +3548,7 @@ Bu iletiyi almaya devam ederseniz, lütfen [SUPPORT_SITE] bölümüne başvurun. Kısa Boyun </string> <string name="Short Pigtails"> - Kısa Atkuyrukları + Yandan Kısa Kuyruk </string> <string name="Short Ponytail"> Kısa Atkuyruğu @@ -3557,7 +3560,7 @@ Bu iletiyi almaya devam ederseniz, lütfen [SUPPORT_SITE] bölümüne başvurun. Kısa Gövde </string> <string name="Short hips"> - Dar kalçalar + Düşük kalça </string> <string name="Shoulders"> Omuzlar @@ -3635,7 +3638,7 @@ Bu iletiyi almaya devam ederseniz, lütfen [SUPPORT_SITE] bölümüne başvurun. Dikleştirilmiş Saç </string> <string name="Square"> - Kare + Geniş </string> <string name="Square Toe"> Küt Burunlu @@ -3677,7 +3680,7 @@ Bu iletiyi almaya devam ederseniz, lütfen [SUPPORT_SITE] bölümüne başvurun. Kalın Boyun </string> <string name="Thick Toe"> - Kalın kabu Burnu + Kalın Ayak Ucu </string> <string name="Thin"> İnce @@ -3692,7 +3695,7 @@ Bu iletiyi almaya devam ederseniz, lütfen [SUPPORT_SITE] bölümüne başvurun. İnce Burun </string> <string name="Tight Chin"> - Dar Çene + Çift Çene </string> <string name="Tight Cuffs"> Dar Paçalar @@ -3707,7 +3710,7 @@ Bu iletiyi almaya devam ederseniz, lütfen [SUPPORT_SITE] bölümüne başvurun. Dar Etek </string> <string name="Tight Sleeves"> - Dar Kollar + Dar Kollu </string> <string name="Toe Shape"> Ayakkabu Burnu Şekli @@ -3725,13 +3728,13 @@ Bu iletiyi almaya devam ederseniz, lütfen [SUPPORT_SITE] bölümüne başvurun. Sıska Gövde </string> <string name="Unattached"> - Bağımsız + Ayrık </string> <string name="Uncreased"> Buruşuk olmayan </string> <string name="Underbite"> - Alt Dişler Önde + Geriye Doğru </string> <string name="Unnatural"> Doğal Olmayan @@ -3767,7 +3770,7 @@ Bu iletiyi almaya devam ederseniz, lütfen [SUPPORT_SITE] bölümüne başvurun. Geniş </string> <string name="Wide Back"> - Geniş Sırt + Geniş Arka </string> <string name="Wide Front"> Geniş Ön @@ -4162,7 +4165,7 @@ Kötüye Kullanımı Bildirme Konuşma Mimikleri </string> <string name="Common Gestures"> - Sık Kullanılan Mimikler + Favori Mimikler </string> <string name="Male - Excuse me"> Erkek - Afedersiniz @@ -4251,8 +4254,8 @@ Kötüye Kullanımı Bildirme <string name="Female - Wow"> Kadın - Vay be </string> - <string name="/bow1"> - /selamlama1 + <string name="/bow"> + /selamlama </string> <string name="/clap"> /alkış @@ -4776,4 +4779,172 @@ Düzenleyici yolunu çift tırnakla çevrelemeyi deneyin. <string name="ParticleHiding"> Parçacıklar Gizleniyor </string> + <string name="Command_AboutLand_Label"> + Arazi hakkında + </string> + <string name="Command_Appearance_Label"> + Görünüm + </string> + <string name="Command_Avatar_Label"> + Avatar + </string> + <string name="Command_Build_Label"> + İnşa Et + </string> + <string name="Command_Chat_Label"> + Sohbet + </string> + <string name="Command_Compass_Label"> + Pusula + </string> + <string name="Command_Destinations_Label"> + Hedef Konum + </string> + <string name="Command_Gestures_Label"> + Mimikler + </string> + <string name="Command_HowTo_Label"> + Nasıl yapılır + </string> + <string name="Command_Inventory_Label"> + Envanter + </string> + <string name="Command_Map_Label"> + Harita + </string> + <string name="Command_Marketplace_Label"> + Pazaryeri + </string> + <string name="Command_MiniMap_Label"> + Mini-harita + </string> + <string name="Command_Move_Label"> + Hareket Et + </string> + <string name="Command_People_Label"> + Kişiler + </string> + <string name="Command_Picks_Label"> + Seçmeler + </string> + <string name="Command_Places_Label"> + Yerler + </string> + <string name="Command_Preferences_Label"> + Tercihler + </string> + <string name="Command_Profile_Label"> + Profil + </string> + <string name="Command_Search_Label"> + Ara + </string> + <string name="Command_Snapshot_Label"> + Anlık görüntü + </string> + <string name="Command_Speak_Label"> + Konuş + </string> + <string name="Command_View_Label"> + Görünüm + </string> + <string name="Command_Voice_Label"> + Yakındaki ses + </string> + <string name="Command_AboutLand_Tooltip"> + Ziyaret ettiğiniz araziyle ilgili bilgi + </string> + <string name="Command_Appearance_Tooltip"> + Avatarınızı değiştirin + </string> + <string name="Command_Avatar_Tooltip"> + Eksiksiz bir avatar seçin + </string> + <string name="Command_Build_Tooltip"> + Nesneler oluşturma ve yüzeyi şekillendirme + </string> + <string name="Command_Chat_Tooltip"> + Metin kullanarak yakındaki kişilerle sohbet etmek + </string> + <string name="Command_Compass_Tooltip"> + Pusula + </string> + <string name="Command_Destinations_Tooltip"> + İlgilendiğiniz hedef konumlar + </string> + <string name="Command_Gestures_Tooltip"> + Avatarınız için mimikler + </string> + <string name="Command_HowTo_Tooltip"> + Genel görevleri nasıl yapacağınız + </string> + <string name="Command_Inventory_Tooltip"> + Eşyalarınızı görüntüleyin ve kullanın + </string> + <string name="Command_Map_Tooltip"> + Dünya haritası + </string> + <string name="Command_Marketplace_Tooltip"> + Alışveriş yap + </string> + <string name="Command_MiniMap_Tooltip"> + Yakındaki kişileri göster + </string> + <string name="Command_Move_Tooltip"> + Avatarınızı hareket ettirmek + </string> + <string name="Command_People_Tooltip"> + Arkadaşlar, gruplar ve yakındaki kişiler + </string> + <string name="Command_Picks_Tooltip"> + Profilinizde favori olarak gösterilecek yerler + </string> + <string name="Command_Places_Tooltip"> + Kaydettiğiniz yerler + </string> + <string name="Command_Preferences_Tooltip"> + Tercihler + </string> + <string name="Command_Profile_Tooltip"> + Profilinizi düzenleyin veya görüntüleyin + </string> + <string name="Command_Search_Tooltip"> + Yerler, etkinlikler ve kişiler bulmak + </string> + <string name="Command_Snapshot_Tooltip"> + Resim çekin + </string> + <string name="Command_Speak_Tooltip"> + Mikrofonunuzu kullanarak yakındaki kişilerle konuşun + </string> + <string name="Command_View_Tooltip"> + Kamera açısını değiştirmek + </string> + <string name="Command_Voice_Tooltip"> + Ses imkanına sahip yakındaki kişiler + </string> + <string name="Retain%"> + Koru % + </string> + <string name="Detail"> + Ayrıntı + </string> + <string name="Better Detail"> + Daha İyi Ayrıntı + </string> + <string name="Surface"> + Yüzey + </string> + <string name="Solid"> + Katı + </string> + <string name="Wrap"> + Sar + </string> + <string name="Preview"> + Önizleme + </string> + <string name="Normal"> + Normal + </string> </strings> diff --git a/indra/newview/skins/default/xui/tr/teleport_strings.xml b/indra/newview/skins/default/xui/tr/teleport_strings.xml index c0c4be1393..c506bb8a58 100644 --- a/indra/newview/skins/default/xui/tr/teleport_strings.xml +++ b/indra/newview/skins/default/xui/tr/teleport_strings.xml @@ -20,6 +20,10 @@ Hala ışınlanamıyorsanız, sorunu çözmek için lütfen çıkış yapıp otu Üzgünüz fakat sistem ışınlama bağlantısını tamamlayamadı. Bir dakika sonra tekrar deneyin. </message> + <message name="NoHelpIslandTP"> +You cannot teleport back to Welcome Island. +Go to 'Welcome Island Public' to repeat the tutorial. + </message> <message name="noaccess_tport"> Üzgünüz, bu ışınlanma hedef konumuna erişim hakkına sahip değilsiniz. </message> diff --git a/indra/newview/skins/default/xui/zh/floater_about.xml b/indra/newview/skins/default/xui/zh/floater_about.xml index 0ac85d399e..7e19c124a1 100644 --- a/indra/newview/skins/default/xui/zh/floater_about.xml +++ b/indra/newview/skins/default/xui/zh/floater_about.xml @@ -10,7 +10,7 @@ <floater.string name="AboutPosition"> You are at [POSITION_0,number,1], [POSITION_1,number,1], [POSITION_2,number,1] in [REGION] located at <nolink>[HOSTNAME]</nolink> ([HOSTIP]) [SERVER_VERSION] -[[SERVER_RELEASE_NOTES_URL] [ReleaseNotes]] +[SERVER_RELEASE_NOTES_URL] </floater.string> <floater.string name="AboutSystem"> CPU:[CPU] diff --git a/indra/newview/skins/default/xui/zh/floater_buy_currency.xml b/indra/newview/skins/default/xui/zh/floater_buy_currency.xml index d63e73c6f1..9f6591faf9 100644 --- a/indra/newview/skins/default/xui/zh/floater_buy_currency.xml +++ b/indra/newview/skins/default/xui/zh/floater_buy_currency.xml @@ -46,7 +46,7 @@ L$ [AMT] </text> <text name="currency_links"> - [http://www.secondlife.com/my/account/payment_method_management.php payment method] | [http://www.secondlife.com/my/account/currency.php currency] | [http://www.secondlife.com/my/account/exchange_rates.php exchange rate] + [http://www.secondlife.com/my/account/payment_method_management.php payment method] | [http://www.secondlife.com/my/account/currency.php currency] </text> <text name="exchange_rate_note"> Re-enter amount to see the latest exchange rate. diff --git a/indra/newview/skins/default/xui/zh/floater_camera.xml b/indra/newview/skins/default/xui/zh/floater_camera.xml index f4db20684c..b75474340c 100644 --- a/indra/newview/skins/default/xui/zh/floater_camera.xml +++ b/indra/newview/skins/default/xui/zh/floater_camera.xml @@ -9,15 +9,6 @@ <floater.string name="move_tooltip"> Move Camera Up and Down, Left and Right </floater.string> - <floater.string name="camera_modes_title"> - 攝影機模式 - </floater.string> - <floater.string name="pan_mode_title"> - 環繞縮放平移 - </floater.string> - <floater.string name="presets_mode_title"> - 預設視角 - </floater.string> <floater.string name="free_mode_title"> 視角物件 </floater.string> diff --git a/indra/newview/skins/default/xui/zh/floater_day_cycle_options.xml b/indra/newview/skins/default/xui/zh/floater_day_cycle_options.xml deleted file mode 100644 index 84186c5836..0000000000 --- a/indra/newview/skins/default/xui/zh/floater_day_cycle_options.xml +++ /dev/null @@ -1,95 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes"?> -<floater name="Day Cycle Floater" title="日循環編輯器"> - <tab_container name="Day Cycle Tabs"> - <panel label="日循環" name="Day Cycle"> - <multi_slider initial_value="0" name="WLTimeSlider"/> - <multi_slider initial_value="0" name="WLDayCycleKeys"/> - <text name="WL12am"> - 12am - </text> - <text name="WL3am"> - 3am - </text> - <text name="WL6am"> - 6am - </text> - <text name="WL9amHash"> - 9am - </text> - <text name="WL12pmHash"> - 12pm - </text> - <text name="WL3pm"> - 3pm - </text> - <text name="WL6pm"> - 6pm - </text> - <text name="WL9pm"> - 9pm - </text> - <text name="WL12am2"> - 12am - </text> - <text name="WL12amHash"> - | - </text> - <text name="WL3amHash"> - I - </text> - <text name="WL6amHash"> - | - </text> - <text name="WL9amHash2"> - I - </text> - <text name="WL12pmHash2"> - | - </text> - <text name="WL3pmHash"> - I - </text> - <text name="WL6pmHash"> - | - </text> - <text name="WL9pmHash"> - I - </text> - <text name="WL12amHash2"> - | - </text> - <button label="Add Key" label_selected="Add Key" name="WLAddKey"/> - <button label="Delete Key" label_selected="Delete Key" name="WLDeleteKey"/> - <text name="WLCurKeyFrameText"> - Key Frame Settings: - </text> - <text name="WLCurKeyTimeText"> - Key Time: - </text> - <spinner label="Hour" name="WLCurKeyHour"/> - <spinner label="Min" name="WLCurKeyMin"/> - <text name="WLCurKeyTimeText2"> - Key Preset: - </text> - <combo_box label="Preset" name="WLKeyPresets"/> - <text name="DayCycleText"> - Snap: - </text> - <combo_box label="五分鐘" name="WLSnapOptions"/> - <text name="DayCycleText2"> - Length of Cycle: - </text> - <spinner label="小時" name="WLLengthOfDayHour"/> - <spinner label="分" name="WLLengthOfDayMin"/> - <spinner label="秒" name="WLLengthOfDaySec"/> - <text name="DayCycleText3"> - 預覽: - </text> - <button label="播放" label_selected="播放" name="WLAnimSky"/> - <button label="停止!" label_selected="停止" name="WLStopAnimSky"/> - <button label="Use Estate Time" label_selected="Go to Estate Time" name="WLUseLindenTime"/> - <button label="Save Test Day" label_selected="Save Test Day" name="WLSaveDayCycle"/> - <button label="Load Test Day" label_selected="Load Test Day" name="WLLoadDayCycle"/> - </panel> - </tab_container> -</floater> diff --git a/indra/newview/skins/default/xui/zh/floater_nearby_chat.xml b/indra/newview/skins/default/xui/zh/floater_nearby_chat.xml index f0c34acb06..38a5dab523 100644 --- a/indra/newview/skins/default/xui/zh/floater_nearby_chat.xml +++ b/indra/newview/skins/default/xui/zh/floater_nearby_chat.xml @@ -1,4 +1,4 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <floater name="nearby_chat" title="附近的聊天"> - <check_box label="Translate chat (powered by Google)" name="translate_chat_checkbox"/> + <check_box label="Translate chat" name="translate_chat_checkbox"/> </floater> diff --git a/indra/newview/skins/default/xui/zh/notifications.xml b/indra/newview/skins/default/xui/zh/notifications.xml index 2d309a2af0..17ff6288a5 100644 --- a/indra/newview/skins/default/xui/zh/notifications.xml +++ b/indra/newview/skins/default/xui/zh/notifications.xml @@ -966,7 +966,7 @@ Offer friendship to [NAME]? </form> </notification> <notification name="RemoveFromFriends"> - Do you want to remove [NAME] from your Friends List? + Do you want to remove <nolink>[NAME]</nolink> from your Friends List? <usetemplate name="okcancelbuttons" notext="取消" yestext="確定"/> </notification> <notification name="RemoveMultipleFromFriends"> @@ -2109,10 +2109,10 @@ Link to this from a web page to give others easy access to this location, or try Topic: [SUBJECT], Message: [MESSAGE] </notification> <notification name="FriendOnline"> - [NAME] 上線 + <nolink>[NAME]</nolink> 上線 </notification> <notification name="FriendOffline"> - [NAME] 離線 + <nolink>[NAME]</nolink> 離線 </notification> <notification name="AddSelfFriend"> Although you're very nice, you can't add yourself as a friend. @@ -2491,10 +2491,10 @@ Please try again in a few moments. </form> </notification> <notification name="FriendshipAccepted"> - [NAME] accepted your friendship offer. + <nolink>[NAME]</nolink> accepted your friendship offer. </notification> <notification name="FriendshipDeclined"> - [NAME] 謝絕你的交友邀請。 + <nolink>[NAME]</nolink> 謝絕你的交友邀請。 </notification> <notification name="FriendshipAcceptedByMe"> 交友邀請被接受。 diff --git a/indra/newview/skins/default/xui/zh/panel_my_profile.xml b/indra/newview/skins/default/xui/zh/panel_my_profile.xml deleted file mode 100644 index 79817d7be9..0000000000 --- a/indra/newview/skins/default/xui/zh/panel_my_profile.xml +++ /dev/null @@ -1,42 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes"?> -<panel label="檔案" name="panel_profile"> - <string name="CaptionTextAcctInfo"> - [ACCTTYPE] -[PAYMENTINFO] [AGEVERIFICATION] - </string> - <string name="payment_update_link_url"> - http://www.secondlife.com/account/billing.php?lang=en - </string> - <string name="partner_edit_link_url"> - http://www.secondlife.com/account/partners.php?lang=en - </string> - <string name="my_account_link_url" value="http://secondlife.com/account"/> - <string name="no_partner_text" value="無"/> - <string name="no_group_text" value="無"/> - <string name="RegisterDateFormat"> - [REG_DATE] ([AGE]) - </string> - <string name="name_text_args"> - [NAME] - </string> - <string name="display_name_text_args"> - [DISPLAY_NAME] - </string> - <layout_stack name="layout"> - <layout_panel name="profile_stack"> - <scroll_container name="profile_scroll"> - <panel name="scroll_content_panel"> - <panel name="second_life_image_panel"> - <text name="display_name_descr_text"> - User name - </text> - <text name="name_descr_text"> - 顯示名稱 - </text> - <button label="檔案" name="see_profile_btn" tool_tip="察看這位化身的檔案"/> - </panel> - </panel> - </scroll_container> - </layout_panel> - </layout_stack> -</panel> diff --git a/indra/newview/skins/default/xui/zh/panel_notes.xml b/indra/newview/skins/default/xui/zh/panel_notes.xml deleted file mode 100644 index 875c6bb328..0000000000 --- a/indra/newview/skins/default/xui/zh/panel_notes.xml +++ /dev/null @@ -1,35 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes"?> -<panel label="Notes & Privacy" name="panel_notes"> - <layout_stack name="layout"> - <layout_panel name="notes_stack"> - <scroll_container name="profile_scroll"> - <panel name="profile_scroll_panel"> - <text name="status_message" value="My private notes:"/> - <text name="status_message2" value="允許這個人可以:"/> - <check_box label="看到我上線狀態" name="status_check"/> - <check_box label="在地圖上看見我" name="map_check"/> - <check_box label="邊輯,刪除或取下我的物件" name="objects_check"/> - </panel> - </scroll_container> - </layout_panel> - <layout_panel name="notes_buttons_panel"> - <layout_stack name="bottom_bar_ls"> - <layout_panel name="add_friend_btn_lp"> - <button label="加為朋友" name="add_friend" tool_tip="向這個居民提出交友邀請"/> - </layout_panel> - <layout_panel name="im_btn_lp"> - <button label="IM" name="im" tool_tip="開啟即時訊息會話"/> - </layout_panel> - <layout_panel name="call_btn_lp"> - <button label="通話" name="call" tool_tip="與這位居民通話"/> - </layout_panel> - <layout_panel name="show_on_map_btn_lp"> - <button label="地圖" name="show_on_map_btn" tool_tip="在地圖上顯示這個居民"/> - </layout_panel> - <layout_panel name="teleport_btn_lp"> - <button label="瞬間傳送" name="teleport" tool_tip="發給瞬間傳送請求"/> - </layout_panel> - </layout_stack> - </layout_panel> - </layout_stack> -</panel> diff --git a/indra/newview/skins/default/xui/zh/panel_preferences_chat.xml b/indra/newview/skins/default/xui/zh/panel_preferences_chat.xml index fc326c2ce2..738c77fd08 100644 --- a/indra/newview/skins/default/xui/zh/panel_preferences_chat.xml +++ b/indra/newview/skins/default/xui/zh/panel_preferences_chat.xml @@ -30,7 +30,7 @@ <spinner label="Nearby chat toasts life time:" name="nearby_toasts_lifetime"/> <spinner label="Nearby chat toasts fading time:" name="nearby_toasts_fadingtime"/> <text name="translate_chb_label"> - 聊天時使用機器自動進行翻譯(由 Google 所提供) + 聊天時使用機器自動進行翻譯 </text> <text name="translate_language_text"> 聊天翻譯為: diff --git a/indra/newview/skins/default/xui/zh/panel_preferences_general.xml b/indra/newview/skins/default/xui/zh/panel_preferences_general.xml index 29f9599c97..6827fab6e6 100644 --- a/indra/newview/skins/default/xui/zh/panel_preferences_general.xml +++ b/indra/newview/skins/default/xui/zh/panel_preferences_general.xml @@ -5,15 +5,15 @@ </text> <combo_box name="language_combobox"> <combo_box.item label="系統預設" name="System Default Language"/> - <combo_box.item label="英語" name="English"/> - <combo_box.item label="Dansk (Danish) - Beta" name="Danish"/> - <combo_box.item label="Deutsch (German) - Beta" name="Deutsch(German)"/> - <combo_box.item label="Español (Spanish) - Beta" name="Spanish"/> - <combo_box.item label="Français (French) - Beta" name="French"/> - <combo_box.item label="Italiano (Italian) - Beta" name="Italian"/> - <combo_box.item label="Polski (Polish) - Beta" name="Polish"/> - <combo_box.item label="Português (Portuguese) - Beta" name="Portugese"/> - <combo_box.item label="日本語 (Japanese) - Beta" name="(Japanese)"/> + <combo_box.item label="English (英語)" name="English"/> + <combo_box.item label="Dansk (丹麥語) - Beta" name="Danish"/> + <combo_box.item label="Deutsch (德語) - Beta" name="Deutsch(German)"/> + <combo_box.item label="Español (西班牙語) - Beta" name="Spanish"/> + <combo_box.item label="Français (法語) - Beta" name="French"/> + <combo_box.item label="Italiano (義大利語) - Beta" name="Italian"/> + <combo_box.item label="Polski (波蘭語) - Beta" name="Polish"/> + <combo_box.item label="Português (葡萄牙語) - Beta" name="Portugese"/> + <combo_box.item label="日本語 (日語) - Beta" name="(Japanese)"/> </combo_box> <text name="language_textbox2"> (須重新啟動) diff --git a/indra/newview/skins/default/xui/zh/panel_profile.xml b/indra/newview/skins/default/xui/zh/panel_profile.xml deleted file mode 100644 index 502449ac3a..0000000000 --- a/indra/newview/skins/default/xui/zh/panel_profile.xml +++ /dev/null @@ -1,67 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes"?> -<panel label="檔案" name="panel_profile"> - <string name="CaptionTextAcctInfo"> - [ACCTTYPE] -[PAYMENTINFO] [AGEVERIFICATION] - </string> - <string name="payment_update_link_url"> - http://www.secondlife.com/account/billing.php?lang=en - </string> - <string name="partner_edit_link_url"> - http://www.secondlife.com/account/partners.php?lang=en - </string> - <string name="my_account_link_url" value="http://secondlife.com/account"/> - <string name="no_partner_text" value="無"/> - <string name="no_group_text" value="無"/> - <string name="RegisterDateFormat"> - [REG_DATE] ([AGE]) - </string> - <string name="name_text_args"> - [NAME] - </string> - <string name="display_name_text_args"> - [DISPLAY_NAME] - </string> - <layout_stack name="layout"> - <layout_panel name="profile_stack"> - <scroll_container name="profile_scroll"> - <panel name="profile_scroll_panel"> - <panel name="second_life_image_panel"> - <text name="title_sl_descr_text" value="[SECOND_LIFE]:"/> - </panel> - <panel name="first_life_image_panel"> - <text name="title_rw_descr_text" value="真實世界:"/> - </panel> - <text name="title_member_text" value="成為居民自:"/> - <text name="title_acc_status_text" value="帳戶狀態:"/> - <text name="title_partner_text" value="配偶:"/> - <panel name="partner_data_panel"> - <text initial_value="(檢索中)" name="partner_text"/> - </panel> - <text name="title_groups_text" value="群組:"/> - </panel> - </scroll_container> - </layout_panel> - </layout_stack> - <layout_stack name="layout_verb_buttons"> - <layout_panel name="profile_buttons_panel"> - <layout_stack name="bottom_bar_ls"> - <layout_panel name="add_friend_btn_lp"> - <button label="加為朋友" name="add_friend" tool_tip="發出交友邀請給這居民"/> - </layout_panel> - <layout_panel name="im_btn_lp"> - <button label="IM" name="im" tool_tip="開啟即時訊息會話"/> - </layout_panel> - <layout_panel name="call_btn_lp"> - <button label="通話" name="call" tool_tip="與這位居民通話"/> - </layout_panel> - <layout_panel name="chat_btn_lp"> - <button label="瞬間傳送" name="teleport" tool_tip="發給瞬間傳送請求"/> - </layout_panel> - <layout_panel name="overflow_btn_lp"> - <menu_button label="▼" name="overflow_btn" tool_tip="支付金錢,或分享收納區給居民"/> - </layout_panel> - </layout_stack> - </layout_panel> - </layout_stack> -</panel> diff --git a/indra/newview/skins/default/xui/zh/panel_profile_view.xml b/indra/newview/skins/default/xui/zh/panel_profile_view.xml deleted file mode 100644 index 2684287692..0000000000 --- a/indra/newview/skins/default/xui/zh/panel_profile_view.xml +++ /dev/null @@ -1,20 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes"?> -<panel name="panel_target_profile"> - <string name="status_online"> - 上線 - </string> - <string name="status_offline"> - 離線 - </string> - <text name="display_name_label" value="顯示名稱:"/> - <text name="solo_username_label" value="使用者名稱:"/> - <text name="status" value="上線"/> - <text name="user_name_small" value="Jack oh look at me this is a super duper long name"/> - <button name="copy_to_clipboard" tool_tip="覆製到剪貼簿"/> - <text name="user_label" value="使用者名稱:"/> - <tab_container name="tabs"> - <panel label="檔案" name="panel_profile"/> - <panel label="精選地點" name="panel_picks"/> - <panel label="NOTES & PRIVACY" name="panel_notes"/> - </tab_container> -</panel> diff --git a/indra/newview/skins/default/xui/zh/teleport_strings.xml b/indra/newview/skins/default/xui/zh/teleport_strings.xml index ffb4c903bb..bfdb107810 100644 --- a/indra/newview/skins/default/xui/zh/teleport_strings.xml +++ b/indra/newview/skins/default/xui/zh/teleport_strings.xml @@ -20,6 +20,10 @@ 抱歉,不過系統無法完成瞬間傳送的聯接。 請稍後再試。 </message> + <message name="NoHelpIslandTP"> + 您不能瞬间转移回“援助岛”。 +去“公共援助岛”重复您的教程。 + </message> <message name="noaccess_tport"> 抱歉,你並沒有權限進入要瞬間傳送的目的地。 </message> diff --git a/indra/newview/skins/minimal/xui/ru/menu_script_chiclet.xml b/indra/newview/skins/minimal/xui/ru/menu_script_chiclet.xml deleted file mode 100644 index f95913ef2b..0000000000 --- a/indra/newview/skins/minimal/xui/ru/menu_script_chiclet.xml +++ /dev/null @@ -1,4 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes"?> -<menu name="ScriptChiclet Menu"> - <menu_item_call label="Close (TODO: translate to Russian)" name="Close"/> -</menu> diff --git a/indra/newview/skins/minimal/xui/tr/menu_script_chiclet.xml b/indra/newview/skins/minimal/xui/tr/menu_script_chiclet.xml deleted file mode 100644 index 2efe6d7e71..0000000000 --- a/indra/newview/skins/minimal/xui/tr/menu_script_chiclet.xml +++ /dev/null @@ -1,4 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes"?> -<menu name="ScriptChiclet Menu"> - <menu_item_call label="Close (TODO: translate to Turkish)" name="Close"/> -</menu> diff --git a/indra/newview/skins/minimal/xui/zh/menu_script_chiclet.xml b/indra/newview/skins/minimal/xui/zh/menu_script_chiclet.xml deleted file mode 100644 index a0a8520650..0000000000 --- a/indra/newview/skins/minimal/xui/zh/menu_script_chiclet.xml +++ /dev/null @@ -1,4 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes"?> -<menu name="ScriptChiclet Menu"> - <menu_item_call label="Close (TODO: translate to Traditional Chinese)" name="Close"/> -</menu> diff --git a/indra/newview/tests/lltranslate_test.cpp b/indra/newview/tests/lltranslate_test.cpp new file mode 100644 index 0000000000..10e37fae97 --- /dev/null +++ b/indra/newview/tests/lltranslate_test.cpp @@ -0,0 +1,345 @@ +/** + * @file lltranslate_test.cpp + * + * $LicenseInfo:firstyear=2011&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2011, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#include "linden_common.h" + +#include "../test/lltut.h" +#include "../lltranslate.h" +#include "../llversioninfo.h" +#include "../llviewercontrol.h" + +#include "llbufferstream.h" +#include "lltrans.h" +#include "llui.h" + +static const std::string GOOGLE_VALID_RESPONSE1 = +"{\ + \"data\": {\ + \"translations\": [\ + {\ + \"translatedText\": \"привет\",\ + \"detectedSourceLanguage\": \"es\"\ + }\ + ]\ + }\ +}"; + +static const std::string GOOGLE_VALID_RESPONSE2 = +"{\ + \"data\": {\ + \"translations\": [\ + {\ + \"translatedText\": \"привет\"\ + }\ + ]\ + }\ +}\ +"; + +static const std::string GOOGLE_VALID_RESPONSE3 = +"{\ + \"error\": {\ + \"errors\": [\ + {\ + \"domain\": \"global\",\ + \"reason\": \"invalid\",\ + \"message\": \"Invalid Value\"\ + }\ + ],\ + \"code\": 400,\ + \"message\": \"Invalid Value\"\ + }\ +}"; + +static const std::string BING_VALID_RESPONSE1 = +"<string xmlns=\"http://schemas.microsoft.com/2003/10/Serialization/\">Привет</string>"; + +static const std::string BING_VALID_RESPONSE2 = +"<html><body><h1>Argument Exception</h1><p>Method: Translate()</p><p>Parameter: </p>\ +<p>Message: 'from' must be a valid language</p><code></code>\ +<p>message id=3743.V2_Rest.Translate.58E8454F</p></body></html>"; + +static const std::string BING_VALID_RESPONSE3 = +"<html><body><h1>Argument Exception</h1><p>Method: Translate()</p>\ +<p>Parameter: appId</p><p>Message: Invalid appId
\nParameter name: appId</p>\ +<code></code><p>message id=3737.V2_Rest.Translate.56016759</p></body></html>"; + +namespace tut +{ + class translate_test + { + protected: + void test_translation( + LLTranslationAPIHandler& handler, + int status, const std::string& resp, + const std::string& exp_trans, const std::string& exp_lang, const std::string& exp_err) + { + std::string translation, detected_lang, err_msg; + bool rc = handler.parseResponse(status, resp, translation, detected_lang, err_msg); + ensure_equals("rc", rc, (status == 200)); + ensure_equals("err_msg", err_msg, exp_err); + ensure_equals("translation", translation, exp_trans); + ensure_equals("detected_lang", detected_lang, exp_lang); + } + + LLGoogleTranslationHandler mGoogle; + LLBingTranslationHandler mBing; + }; + + typedef test_group<translate_test> translate_test_group_t; + typedef translate_test_group_t::object translate_test_object_t; + tut::translate_test_group_t tut_translate("LLTranslate"); + + template<> template<> + void translate_test_object_t::test<1>() + { + test_translation(mGoogle, 200, GOOGLE_VALID_RESPONSE1, "привет", "es", ""); + } + + template<> template<> + void translate_test_object_t::test<2>() + { + test_translation(mGoogle, 200, GOOGLE_VALID_RESPONSE2, "привет", "", ""); + } + + template<> template<> + void translate_test_object_t::test<3>() + { + test_translation(mGoogle, 400, GOOGLE_VALID_RESPONSE3, "", "", "Invalid Value"); + } + + template<> template<> + void translate_test_object_t::test<4>() + { + test_translation(mGoogle, 400, + "", + "", "", "* Line 1, Column 1\n Syntax error: value, object or array expected.\n"); + } + + template<> template<> + void translate_test_object_t::test<5>() + { + test_translation(mGoogle, 400, + "[]", + "", "", ""); + } + + template<> template<> + void translate_test_object_t::test<6>() + { + test_translation(mGoogle, 400, + "{\"oops\": \"invalid\"}", + "", "", ""); + } + + template<> template<> + void translate_test_object_t::test<7>() + { + test_translation(mGoogle, 400, + "{\"data\": {}}", + "", "", ""); + } + + template<> template<> + void translate_test_object_t::test<8>() + { + test_translation(mGoogle, 400, + "{\"data\": { \"translations\": [ {} ] }}", + "", "", ""); + } + + template<> template<> + void translate_test_object_t::test<9>() + { + test_translation(mGoogle, 400, + "{\"data\": { \"translations\": [ { \"translatedTextZZZ\": \"привет\", \"detectedSourceLanguageZZZ\": \"es\" } ] }}", + "", "", ""); + } + + template<> template<> + void translate_test_object_t::test<10>() + { + test_translation(mBing, 200, BING_VALID_RESPONSE1, "Привет", "", ""); + } + + template<> template<> + void translate_test_object_t::test<11>() + { + test_translation(mBing, 400, BING_VALID_RESPONSE2, "", "", "'from' must be a valid language"); + } + + template<> template<> + void translate_test_object_t::test<12>() + { + test_translation(mBing, 400, BING_VALID_RESPONSE3, "", "", "Invalid appId\nParameter name: appId"); + } + + template<> template<> + void translate_test_object_t::test<13>() + { + test_translation(mBing, 200, + "Привет</string>", + "Привет", "", ""); + } + + template<> template<> + void translate_test_object_t::test<14>() + { + test_translation(mBing, 200, + "<string xmlns=\"http://schemas.microsoft.com/2003/10/Serialization/\">Привет", + "Привет", "", ""); + } + + template<> template<> + void translate_test_object_t::test<15>() + { + test_translation(mBing, 200, + "Привет", + "Привет", "", ""); + } + + template<> template<> + void translate_test_object_t::test<16>() + { + test_translation(mBing, 400, + "Message: some error</p>", + "", "", "some error"); + } + + template<> template<> + void translate_test_object_t::test<17>() + { + test_translation(mBing, 400, + "Message: some error", + "", "", "some error"); + } + + template<> template<> + void translate_test_object_t::test<18>() + { + test_translation(mBing, 400, + "some error</p>", + "", "", "some error"); + } + + template<> template<> + void translate_test_object_t::test<19>() + { + test_translation(mBing, 400, + "some error", + "", "", "some error"); + } + + template<> template<> + void translate_test_object_t::test<20>() + { + std::string url; + mBing.getTranslateURL(url, "en", "es", "hi"); + ensure_equals("bing URL", url, + "http://api.microsofttranslator.com/v2/Http.svc/Translate?appId=dummy&text=hi&to=es&from=en"); + } + + template<> template<> + void translate_test_object_t::test<21>() + { + std::string url; + mBing.getTranslateURL(url, "", "es", "hi"); + ensure_equals("bing URL", url, + "http://api.microsofttranslator.com/v2/Http.svc/Translate?appId=dummy&text=hi&to=es"); + } + + template<> template<> + void translate_test_object_t::test<22>() + { + std::string url; + mGoogle.getTranslateURL(url, "en", "es", "hi"); + ensure_equals("google URL", url, + "https://www.googleapis.com/language/translate/v2?key=dummy&q=hi&target=es&source=en"); + } + + template<> template<> + void translate_test_object_t::test<23>() + { + std::string url; + mGoogle.getTranslateURL(url, "", "es", "hi"); + ensure_equals("google URL", url, + "https://www.googleapis.com/language/translate/v2?key=dummy&q=hi&target=es"); + } +} + +//== Misc stubs =============================================================== +LLControlGroup gSavedSettings("test"); + +std::string LLUI::getLanguage() { return "en"; } +std::string LLTrans::getString(const std::string &xml_desc, const LLStringUtil::format_map_t& args) { return "dummy"; } + +LLControlGroup::LLControlGroup(const std::string& name) : LLInstanceTracker<LLControlGroup, std::string>(name) {} +std::string LLControlGroup::getString(const std::string& name) { return "dummy"; } +LLControlGroup::~LLControlGroup() {} + +namespace boost { + void intrusive_ptr_add_ref(LLCurl::Responder*) {} + void intrusive_ptr_release(LLCurl::Responder*) {} +} + +LLCurl::Responder::Responder() {} +void LLCurl::Responder::completedHeader(U32, std::string const&, LLSD const&) {} +void LLCurl::Responder::completedRaw(U32, const std::string&, const LLChannelDescriptors&, const LLIOPipe::buffer_ptr_t& buffer) {} +void LLCurl::Responder::completed(U32, std::string const&, LLSD const&) {} +void LLCurl::Responder::error(U32, std::string const&) {} +void LLCurl::Responder::errorWithContent(U32, std::string const&, LLSD const&) {} +void LLCurl::Responder::result(LLSD const&) {} +LLCurl::Responder::~Responder() {} + +void LLHTTPClient::get(const std::string&, const LLSD&, ResponderPtr, const LLSD&, const F32) {} +void LLHTTPClient::get(const std::string&, boost::intrusive_ptr<LLCurl::Responder>, const LLSD&, const F32) {} + +LLBufferStream::LLBufferStream(const LLChannelDescriptors& channels, LLBufferArray* buffer) +: std::iostream(&mStreamBuf), mStreamBuf(channels, buffer) {} +LLBufferStream::~LLBufferStream() {} + +LLBufferStreamBuf::LLBufferStreamBuf(const LLChannelDescriptors&, LLBufferArray*) {} +#if( LL_WINDOWS || __GNUC__ > 2) +LLBufferStreamBuf::pos_type LLBufferStreamBuf::seekoff( + off_type off, + std::ios::seekdir way, + std::ios::openmode which) +#else +streampos LLBufferStreamBuf::seekoff( + streamoff off, + std::ios::seekdir way, + std::ios::openmode which) +#endif +{ return 0; } +int LLBufferStreamBuf::sync() {return 0;} +int LLBufferStreamBuf::underflow() {return 0;} +int LLBufferStreamBuf::overflow(int) {return 0;} +LLBufferStreamBuf::~LLBufferStreamBuf() {} + +S32 LLVersionInfo::getBuild() { return 0; } +const std::string& LLVersionInfo::getChannel() {static std::string dummy; return dummy;} +S32 LLVersionInfo::getMajor() { return 0; } +S32 LLVersionInfo::getMinor() { return 0; } +S32 LLVersionInfo::getPatch() { return 0; } diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index f0bee2bfee..0931c4ec9b 100644 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -495,8 +495,9 @@ class WindowsManifest(ViewerManifest): # tag:"crash-logger" here as a cue to the exporter self.path(src='../win_crash_logger/%s/windows-crash-logger.exe' % self.args['configuration'], dst="win_crash_logger.exe") - self.path(src='../win_updater/%s/windows-updater.exe' % self.args['configuration'], - dst="updater.exe") +# For CHOP-397, windows updater no longer used. +# self.path(src='../win_updater/%s/windows-updater.exe' % self.args['configuration'], +# dst="updater.exe") if not self.is_packaging_viewer(): self.package_file = "copied_deps" @@ -573,10 +574,10 @@ class WindowsManifest(ViewerManifest): grid_vars_template = """ OutFile "%(installer_file)s" !define INSTFLAGS "%(flags)s" - !define INSTNAME "SecondLifeViewer2" - !define SHORTCUT "Second Life Viewer 2" + !define INSTNAME "SecondLifeViewer" + !define SHORTCUT "Second Life Viewer" !define URLNAME "secondlife" - Caption "Second Life ${VERSION}" + Caption "Second Life" """ else: # beta grid viewer @@ -804,7 +805,7 @@ class DarwinManifest(ViewerManifest): self.run_command("chmod +x %r" % os.path.join(self.get_dst_prefix(), script)) def package_finish(self): - channel_standin = 'Second Life Viewer 2' # hah, our default channel is not usable on its own + channel_standin = 'Second Life Viewer' # hah, our default channel is not usable on its own if not self.default_channel(): channel_standin = self.channel() |