diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index df49f5fa42..7e82e42862 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -42,8 +42,6 @@ jobs: DEVELOPER_DIR: ${{ matrix.developer_dir }} # Ensure that Linden viewer builds engage Bugsplat. BUGSPLAT_DB: ${{ matrix.configuration != 'ReleaseOS' && 'SecondLife_Viewer_2018' || '' }} - BUGSPLAT_PASS: ${{ secrets.BUGSPLAT_PASS }} - BUGSPLAT_USER: ${{ secrets.BUGSPLAT_USER }} build_coverity: false build_log_dir: ${{ github.workspace }}/.logs build_viewer: true @@ -262,23 +260,36 @@ jobs: ${{ steps.build.outputs.physicstpv }} sign-and-package-windows: + env: + AZURE_KEY_VAULT_URI: ${{ secrets.AZURE_KEY_VAULT_URI }} + AZURE_CERT_NAME: ${{ secrets.AZURE_CERT_NAME }} + AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }} + AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }} + AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }} needs: build runs-on: windows steps: - name: Sign and package Windows viewer + if: env.AZURE_KEY_VAULT_URI && env.AZURE_CERT_NAME && env.AZURE_CLIENT_ID && env.AZURE_CLIENT_SECRET && env.AZURE_TENANT_ID uses: secondlife/viewer-build-util/sign-pkg-windows@v1 with: - vault_uri: "${{ secrets.AZURE_KEY_VAULT_URI }}" - cert_name: "${{ secrets.AZURE_CERT_NAME }}" - client_id: "${{ secrets.AZURE_CLIENT_ID }}" - client_secret: "${{ secrets.AZURE_CLIENT_SECRET }}" - tenant_id: "${{ secrets.AZURE_TENANT_ID }}" + vault_uri: "${{ env.AZURE_KEY_VAULT_URI }}" + cert_name: "${{ env.AZURE_CERT_NAME }}" + client_id: "${{ env.AZURE_CLIENT_ID }}" + client_secret: "${{ env.AZURE_CLIENT_SECRET }}" + tenant_id: "${{ env.AZURE_TENANT_ID }}" sign-and-package-mac: + env: + NOTARIZE_CREDS_MACOS: ${{ secrets.NOTARIZE_CREDS_MACOS }} + SIGNING_CERT_MACOS: ${{ secrets.SIGNING_CERT_MACOS }} + SIGNING_CERT_MACOS_IDENTITY: ${{ secrets.SIGNING_CERT_MACOS_IDENTITY }} + SIGNING_CERT_MACOS_PASSWORD: ${{ secrets.SIGNING_CERT_MACOS_PASSWORD }} needs: build runs-on: macos-latest steps: - name: Unpack Mac notarization credentials + if: env.NOTARIZE_CREDS_MACOS id: note-creds shell: bash run: | @@ -286,7 +297,7 @@ jobs: # USERNAME="..." # PASSWORD="..." # TEAM_ID="..." - eval "${{ secrets.NOTARIZE_CREDS_MACOS }}" + eval "${{ env.NOTARIZE_CREDS_MACOS }}" echo "::add-mask::$USERNAME" echo "::add-mask::$PASSWORD" echo "::add-mask::$TEAM_ID" @@ -298,39 +309,48 @@ jobs: [[ -n "$USERNAME" && -n "$PASSWORD" && -n "$TEAM_ID" ]] - name: Sign and package Mac viewer + if: env.SIGNING_CERT_MACOS && env.SIGNING_CERT_MACOS_IDENTITY && env.SIGNING_CERT_MACOS_PASSWORD && steps.note-creds.outputs.note_user && steps.note-creds.outputs.note_pass && steps.note-creds.outputs.note_team uses: secondlife/viewer-build-util/sign-pkg-mac@v1 with: channel: ${{ needs.build.outputs.viewer_channel }} imagename: ${{ needs.build.outputs.imagename }} - cert_base64: ${{ secrets.SIGNING_CERT_MACOS }} - cert_name: ${{ secrets.SIGNING_CERT_MACOS_IDENTITY }} - cert_pass: ${{ secrets.SIGNING_CERT_MACOS_PASSWORD }} + cert_base64: ${{ env.SIGNING_CERT_MACOS }} + cert_name: ${{ env.SIGNING_CERT_MACOS_IDENTITY }} + cert_pass: ${{ env.SIGNING_CERT_MACOS_PASSWORD }} note_user: ${{ steps.note-creds.outputs.note_user }} note_pass: ${{ steps.note-creds.outputs.note_pass }} note_team: ${{ steps.note-creds.outputs.note_team }} post-windows-symbols: + env: + BUGSPLAT_USER: ${{ secrets.BUGSPLAT_USER }} + BUGSPLAT_PASS: ${{ secrets.BUGSPLAT_PASS }} needs: build runs-on: ubuntu-latest steps: - name: Post Windows symbols + if: env.BUGSPLAT_USER && env.BUGSPLAT_PASS uses: secondlife/viewer-build-util/post-bugsplat-windows@v1 with: - username: ${{ secrets.BUGSPLAT_USER }} - password: ${{ secrets.BUGSPLAT_PASS }} + username: ${{ env.BUGSPLAT_USER }} + password: ${{ env.BUGSPLAT_PASS }} database: "SecondLife_Viewer_2018" channel: ${{ needs.build.outputs.viewer_channel }} version: ${{ needs.build.outputs.viewer_version }} post-mac-symbols: + env: + BUGSPLAT_USER: ${{ secrets.BUGSPLAT_USER }} + BUGSPLAT_PASS: ${{ secrets.BUGSPLAT_PASS }} needs: build runs-on: ubuntu-latest steps: - name: Post Mac symbols + if: env.BUGSPLAT_USER && env.BUGSPLAT_PASS uses: secondlife/viewer-build-util/post-bugsplat-mac@v1 with: - username: ${{ secrets.BUGSPLAT_USER }} - password: ${{ secrets.BUGSPLAT_PASS }} + username: ${{ env.BUGSPLAT_USER }} + password: ${{ env.BUGSPLAT_PASS }} database: "SecondLife_Viewer_2018" channel: ${{ needs.build.outputs.viewer_channel }} version: ${{ needs.build.outputs.viewer_version }} diff --git a/.github/workflows/stale.yaml b/.github/workflows/stale.yaml index 35ac41420c..e44e223589 100644 --- a/.github/workflows/stale.yaml +++ b/.github/workflows/stale.yaml @@ -17,7 +17,8 @@ jobs: with: stale-pr-message: This pull request is stale because it has been open 30 days with no activity. Remove stale label or comment or it will be closed in 7 days days-before-stale: 30 - days-before-close: 7 + days-before-close: 7 + days-before-issue-close: -1 exempt-pr-labels: blocked,must,should,keep stale-pr-label: stale - name: Print outputs diff --git a/autobuild.xml b/autobuild.xml index a3ba88a34c..6de3092616 100644 --- a/autobuild.xml +++ b/autobuild.xml @@ -2612,25 +2612,39 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors archive hash - 158cbe79bef4ecafb870052bbaca541e07107228 + 17cd63922214b588d9a36137fadf927237ec0f25 hash_algorithm sha1 url - https://github.com/secondlife/3p-openexr/releases/download/v1.8/openexr-3.2.2-darwin64-6501c65.tar.zst + https://github.com/secondlife/3p-openexr/releases/download/v1.10/openexr-3.2.2-darwin64-df7544d.tar.zst name darwin64 + linux64 + + archive + + hash + b092658ab5ec009a5875e8b6e5b7109730ad6846 + hash_algorithm + sha1 + url + https://github.com/secondlife/3p-openexr/releases/download/v1.10/openexr-3.2.2-linux64-df7544d.tar.zst + + name + linux64 + windows64 archive hash - 924f6ddf6669af023d1f3832cb79b50b913ae0ca + c511ae9a3e401375af2199b498a75f32cebc010f hash_algorithm sha1 url - https://github.com/secondlife/3p-openexr/releases/download/v1.8/openexr-3.2.2-windows64-6501c65.tar.zst + https://github.com/secondlife/3p-openexr/releases/download/v1.10/openexr-3.2.2-windows64-df7544d.tar.zst name windows64 diff --git a/build.sh b/build.sh index bf90465f9a..dea8fb4f2e 100755 --- a/build.sh +++ b/build.sh @@ -175,28 +175,6 @@ pre_build() VIEWER_SYMBOL_FILE="$(native_path "$abs_build_dir/newview/$variant/secondlife-symbols-$symplat-${AUTOBUILD_ADDRSIZE}.tar.bz2")" fi - # expect these variables to be set in the environment from GitHub secrets - if [[ -n "$BUGSPLAT_DB" ]] - then - # don't spew credentials into build log - set +x - if [[ -z "$BUGSPLAT_USER" || -z "$BUGSPLAT_PASS" ]] - then - # older mechanism involving build-secrets repo - - # if build_secrets_checkout isn't set, report its name - bugsplat_sh="${build_secrets_checkout:-\$build_secrets_checkout}/bugsplat/bugsplat.sh" - if [ -r "$bugsplat_sh" ] - then # show that we're doing this, just not the contents - echo source "$bugsplat_sh" - source "$bugsplat_sh" - else - fatal "BUGSPLAT_USER or BUGSPLAT_PASS missing, and no $bugsplat_sh" - fi - fi - set -x - export BUGSPLAT_USER BUGSPLAT_PASS - fi - # honor autobuild_configure_parameters same as sling-buildscripts eval_autobuild_configure_parameters=$(eval $(echo echo $autobuild_configure_parameters)) diff --git a/doc/testplans/RenderMaxTextureResolution.md b/doc/testplans/RenderMaxTextureResolution.md new file mode 100644 index 0000000000..2b117050c7 --- /dev/null +++ b/doc/testplans/RenderMaxTextureResolution.md @@ -0,0 +1,16 @@ +The Setting RenderMaxTextureResolution controls the maximum resolution of non-boosted textures as displayed by the viewer. + +Valid values are 512-2048 (clamped in C++). + +![image](https://github.com/secondlife/viewer/assets/23218274/d0f889fc-8135-41d2-9d83-871ad4eebed5) + +![image](https://github.com/secondlife/viewer/assets/23218274/19950828-7eb1-4bb2-85d7-f35c63b34294) + +![image](https://github.com/secondlife/viewer/assets/23218274/249afc83-4de6-488d-a05e-4877d08573b1) + +Test Asset available on beta grid: +Object: 'Damaged Helmet', AssetID 0623e759-11b5-746c-a75e-7ba1caa6eb0e + + + + diff --git a/doc/testplans/hdri_local_preview.md b/doc/testplans/hdri_local_preview.md new file mode 100644 index 0000000000..ba4f085100 --- /dev/null +++ b/doc/testplans/hdri_local_preview.md @@ -0,0 +1,21 @@ +A resident may swap out their sky for an EXR format HDRI for the purposes of previewing how their object would render in Second Life in an environment that matches the supplied HDRI. This should aid in matching inworld lighting with external tools so artists can know if their content has imported properly. + +To load an HDRI, click Develop->Render Tests->HDRI Preview: + +![image](https://github.com/secondlife/viewer/assets/23218274/fbdeab5f-dc1f-4406-be19-0c9ee7437b3f) + +Choose an EXR image. A library of publicly available HDRIs can be found here: https://polyhaven.com/hdris + +The Personal Lighting floater will open, and the sky will be replaced with the HDRI you chose. Reflection Probes will reset, and the scene will be illuminated by the HDRI. + +Three debug settings affect how the HDRI is displayed: + +RenderHDRIExposure - Exposure adjustment of HDRI when previewing an HDRI. Units are EV. Sane values would be -10 to 10. +RenderHDRIRotation - Rotation (in degrees) of environment when previewing an HDRI. +RenderHDRISplitScreen - What percentage of screen to render using HDRI vs EEP sky. + +Exposure and Rotation should behave similarly to the rotation and exposure controls in Substance Painter. + +Split Screen can be used to display an EEP sky side-by-side with an HDRI sky to aid in authoring an EEP sky that matches an HDRI sky. It is currently expected that EEP sun disc, moon, clouds, and stars do not render when previewing an HDRI, but that may change in the future. + + diff --git a/doc/testplans/pbr_terrain_feature_gating.md b/doc/testplans/pbr_terrain_appearance.md similarity index 69% rename from doc/testplans/pbr_terrain_feature_gating.md rename to doc/testplans/pbr_terrain_appearance.md index 2d27a5d73e..4f0ee5c943 100644 --- a/doc/testplans/pbr_terrain_feature_gating.md +++ b/doc/testplans/pbr_terrain_appearance.md @@ -1,8 +1,17 @@ -# PBR Terrain Feature Gating +# PBR Terrain Appearance + +## Tiling + +If two adjacent regions have the same PBR terrain settings, then: + +- There should not be seams between the two regions at their shared border +- The ground should not suddenly slide beneath the avatar when moving between regions (except due to movement of the avatar, which is not covered by this test plan) + +## Feature Gating PBR terrain should have lower detail on lower graphics settings. PBR terrain will also not show emissive textures on some machines (like Macs) which do not support more than 16 textures. -## Triplanar Mapping +### Triplanar Mapping Triplanar mapping improves the texture repeats on the sides of terrain slopes. @@ -11,7 +20,7 @@ Availability of Triplanar mapping: - Medium-High and below: No triplanar mapping - High and above: Triplanar mapping -## PBR Textures +### PBR Textures At the highest graphics support level, PBR terrain supports all PBR textures. @@ -21,6 +30,6 @@ Availability of PBR textures varies by machine and graphics setting: - Medium-Low, and machines that do not support greater than 16 textures such as Macs: All PBR textures enabled except emissive textures. - Medium: All PBR textures enabled -## PBR Alpha +### PBR Alpha PBR terrain does not support materials with alpha blend or double-sided. In addition, the viewer does not make any guarantees about what will render behind the terrain if alpha is used. diff --git a/doc/testplans/pbr_terrain_composition.md b/doc/testplans/pbr_terrain_composition.md index 127fe950a8..8cc5560f64 100644 --- a/doc/testplans/pbr_terrain_composition.md +++ b/doc/testplans/pbr_terrain_composition.md @@ -29,6 +29,8 @@ When the Region/Estate floater is opened to the terrain Tab, the current terrain - If it is texture terrain, the "PBR Metallic Roughness" checkbox should be unchecked, and the floater should display the four textures applied to the terrain. - If it is material terrain, the "PBR Metallic Roughness" checkbox should be checked, and the floater should display the four materials applied to the terrain. +In addition, where possible, textual labels and descriptions in the tab should make sense given the current value of the "PBR Metallic Roughness" checkbox. If the checkbox is unchecked, the labels should refer to textures. If the checkbox is checked, the labels should refer to materials. + ### Toggling Composition Type When toggling the "PBR Metallic Roughness" checkbox to the opposite value, which does not correspond to the current terrain type, one of the following sets of four terrain swatches will be displayed: @@ -48,7 +50,7 @@ A user with appropriate permissions can change and save the textures or material Saving may fail for the following reasons: - A terrain or material texture is invalid or null -- A terrain texture is greater than 1024 resolution (Subject to change. See https://github.com/secondlife/viewer/issues/760) +- A terrain texture is greater than the max texture upload resolution Unlike a viewer without PBR terrain support, the new viewer will no longer treat textures with alpha channels as invalid. diff --git a/indra/cmake/Copy3rdPartyLibs.cmake b/indra/cmake/Copy3rdPartyLibs.cmake index 8c30eb399f..7c6c02e4df 100644 --- a/indra/cmake/Copy3rdPartyLibs.cmake +++ b/indra/cmake/Copy3rdPartyLibs.cmake @@ -223,12 +223,6 @@ elseif(DARWIN) liburiparser.dylib liburiparser.1.dylib liburiparser.1.0.27.dylib - libIex-3_2.dylib - libIlmThread-3_2.dylib - libImath-3_1.dylib - libOpenEXR-3_2.dylib - libOpenEXRCore-3_2.dylib - libOpenEXRUtil-3_2.dylib libgrowl.dylib libgrowl++.dylib ) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 541c083389..3b1d2d61da 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -12362,6 +12362,17 @@ Change of this parameter will affect the layout of buttons in notification toast Value 0.0 + RenderHDRISplitScreen + + Comment + What percentage of screen to render using HDRI vs EEP sky. + Persist + 1 + Type + F32 + Value + 1.0 + RenderMaxOpenGLVersion Comment @@ -12394,6 +12405,17 @@ Change of this parameter will affect the layout of buttons in notification toast U32 Value 16 + + RenderMaxTextureResolution + + Comment + Maximum texture resolution to download for non-boosted textures. + Persist + 1 + Type + U32 + Value + 2048 RenderDebugTextureBind @@ -14036,7 +14058,7 @@ Change of this parameter will affect the layout of buttons in notification toast Type F32 Value - 4.0 + 8.0 RenderTerrainPBRPlanarSampleCount diff --git a/indra/newview/app_settings/shaders/class1/deferred/skyF.glsl b/indra/newview/app_settings/shaders/class1/deferred/skyF.glsl index cc5280d929..785c748234 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/skyF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/skyF.glsl @@ -28,8 +28,10 @@ in vec3 vary_HazeColor; in float vary_LightNormPosDot; #ifdef HAS_HDRI -in vec3 vary_position; +in vec4 vary_position; +in vec3 vary_rel_pos; uniform float sky_hdr_scale; +uniform float hdri_split_screen; uniform mat3 env_mat; uniform sampler2D environmentMap; #endif @@ -81,35 +83,42 @@ vec3 halo22(float d) void main() { + vec3 color; #ifdef HAS_HDRI - vec3 pos = normalize(vary_position); - pos = env_mat * pos; - vec2 texCoord = vec2(atan(pos.z, pos.x) + PI, acos(pos.y)) / vec2(2.0 * PI, PI); - vec3 color = textureLod(environmentMap, texCoord.xy, 0).rgb * sky_hdr_scale; - color = min(color, vec3(8192*8192*16)); -#else - - // Potential Fill-rate optimization. Add cloud calculation - // back in and output alpha of 0 (so that alpha culling kills - // the fragment) if the sky wouldn't show up because the clouds - // are fully opaque. - - vec3 color = vary_HazeColor; - - float rel_pos_lightnorm = vary_LightNormPosDot; - float optic_d = rel_pos_lightnorm; - vec3 halo_22 = halo22(optic_d); - color.rgb += rainbow(optic_d); - color.rgb += halo_22; - color.rgb *= 2.; - color.rgb = clamp(color.rgb, vec3(0), vec3(5)); + vec3 frag_coord = vary_position.xyz/vary_position.w; + if (-frag_coord.x > ((1.0-hdri_split_screen)*2.0-1.0)) + { + vec3 pos = normalize(vary_rel_pos); + pos = env_mat * pos; + vec2 texCoord = vec2(atan(pos.z, pos.x) + PI, acos(pos.y)) / vec2(2.0 * PI, PI); + color = textureLod(environmentMap, texCoord.xy, 0).rgb * sky_hdr_scale; + color = min(color, vec3(8192*8192*16)); // stupidly large value arrived at by binary search -- avoids framebuffer corruption from some HDRIs + frag_data[2] = vec4(0.0,0.0,0.0,GBUFFER_FLAG_HAS_HDRI); + } + else #endif + { + // Potential Fill-rate optimization. Add cloud calculation + // back in and output alpha of 0 (so that alpha culling kills + // the fragment) if the sky wouldn't show up because the clouds + // are fully opaque. + + color = vary_HazeColor; + + float rel_pos_lightnorm = vary_LightNormPosDot; + float optic_d = rel_pos_lightnorm; + vec3 halo_22 = halo22(optic_d); + color.rgb += rainbow(optic_d); + color.rgb += halo_22; + color.rgb *= 2.; + color.rgb = clamp(color.rgb, vec3(0), vec3(5)); + + frag_data[2] = vec4(0.0,0.0,0.0,GBUFFER_FLAG_SKIP_ATMOS); + } frag_data[0] = vec4(0); frag_data[1] = vec4(0); - frag_data[2] = vec4(0.0,0.0,0.0,GBUFFER_FLAG_SKIP_ATMOS); frag_data[3] = vec4(color.rgb, 1.0); - } diff --git a/indra/newview/app_settings/shaders/class1/deferred/skyV.glsl b/indra/newview/app_settings/shaders/class1/deferred/skyV.glsl index bbe9a5a838..e48f69dab5 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/skyV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/skyV.glsl @@ -36,7 +36,8 @@ out vec3 vary_HazeColor; out float vary_LightNormPosDot; #ifdef HAS_HDRI -out vec3 vary_position; +out vec4 vary_position; +out vec3 vary_rel_pos; #endif // Inputs @@ -77,7 +78,8 @@ void main() vec3 rel_pos = position.xyz - camPosLocal.xyz + vec3(0, 50, 0); #ifdef HAS_HDRI - vary_position = rel_pos; + vary_rel_pos = rel_pos; + vary_position = pos; #endif // Adj position vector to clamp altitude diff --git a/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl index 5cc7ea698a..9b9739ba22 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl @@ -191,11 +191,12 @@ void main() } else if (GET_GBUFFER_FLAG(GBUFFER_FLAG_HAS_HDRI)) { + // actual HDRI sky, just copy color value color = texture(emissiveRect, tc).rgb; } - else if (!GET_GBUFFER_FLAG(GBUFFER_FLAG_HAS_ATMOS)) + else if (GET_GBUFFER_FLAG(GBUFFER_FLAG_SKIP_ATMOS)) { - //should only be true of WL sky, just port over base color value + //should only be true of WL sky, port over base color value and scale for fake HDR color = texture(emissiveRect, tc).rgb; color = srgb_to_linear(color); color *= sky_hdr_scale; diff --git a/indra/newview/lldrawpoolwlsky.cpp b/indra/newview/lldrawpoolwlsky.cpp index a9cc138549..323ab5fc07 100644 --- a/indra/newview/lldrawpoolwlsky.cpp +++ b/indra/newview/lldrawpoolwlsky.cpp @@ -153,12 +153,15 @@ void LLDrawPoolWLSky::renderSkyHazeDeferred(const LLVector3& camPosLocal, F32 ca static LLCachedControl hdri_exposure(gSavedSettings, "RenderHDRIExposure", 0.0f); static LLCachedControl hdri_rotation(gSavedSettings, "RenderHDRIRotation", 0.f); - + static LLCachedControl hdri_split(gSavedSettings, "RenderHDRISplitScreen", 1.f); + static LLStaticHashedString hdri_split_screen("hdri_split_screen"); + LLMatrix3 rot; rot.setRot(0.f, hdri_rotation*DEG_TO_RAD, 0.f); sky_shader->uniform1f(LLShaderMgr::SKY_HDR_SCALE, powf(2.f, hdri_exposure)); sky_shader->uniformMatrix3fv(LLShaderMgr::DEFERRED_ENV_MAT, 1, GL_FALSE, (F32*) rot.mMatrix); + sky_shader->uniform1f(hdri_split_screen, hdri_split); } else { @@ -470,8 +473,6 @@ void LLDrawPoolWLSky::renderDeferred(S32 pass) const F32 camHeightLocal = LLEnvironment::instance().getCamHeight(); - gGL.setColorMask(true, false); - LLVector3 const & origin = LLViewerCamera::getInstance()->getOrigin(); if (gPipeline.canUseWindLightShaders()) @@ -488,7 +489,6 @@ void LLDrawPoolWLSky::renderDeferred(S32 pass) renderSkyCloudsDeferred(origin, camHeightLocal, cloud_shader); } } - gGL.setColorMask(true, true); } diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp index 3b70a97648..b74c62bf6a 100644 --- a/indra/newview/llfloaterregioninfo.cpp +++ b/indra/newview/llfloaterregioninfo.cpp @@ -1500,20 +1500,18 @@ void LLPanelRegionDebugInfo::onClickDebugConsole(void* data) BOOL LLPanelRegionTerrainInfo::validateTextureSizes() { - LLCheckBoxCtrl* material_type_ctrl = getChild("terrain_material_type"); - if (material_type_ctrl) + if (mMaterialTypeCtrl) { - const LLTerrainMaterials::Type material_type = material_type_from_ctrl(material_type_ctrl); + const LLTerrainMaterials::Type material_type = material_type_from_ctrl(mMaterialTypeCtrl); const bool is_material_selected = material_type == LLTerrainMaterials::Type::PBR; if (is_material_selected) { return TRUE; } } - static const S32 MAX_TERRAIN_TEXTURE_SIZE = 1024; + static LLCachedControl max_texture_resolution(gSavedSettings, "RenderMaxTextureResolution", 2048); + const S32 max_terrain_texture_size = (S32)max_texture_resolution; for(S32 i = 0; i < LLTerrainMaterials::ASSET_COUNT; ++i) { - std::string buffer; - buffer = llformat("texture_detail_%d", i); - LLTextureCtrl* texture_ctrl = getChild(buffer); + LLTextureCtrl* texture_ctrl = mTextureDetailCtrl[i]; if (!texture_ctrl) continue; LLUUID image_asset_id = texture_ctrl->getImageAssetID(); @@ -1530,19 +1528,19 @@ BOOL LLPanelRegionTerrainInfo::validateTextureSizes() LLSD args; args["TEXTURE_NUM"] = i+1; args["TEXTURE_BIT_DEPTH"] = llformat("%d",components * 8); - args["MAX_SIZE"] = MAX_TERRAIN_TEXTURE_SIZE; + args["MAX_SIZE"] = max_terrain_texture_size; LLNotificationsUtil::add("InvalidTerrainBitDepth", args); return FALSE; } - if (width > MAX_TERRAIN_TEXTURE_SIZE || height > MAX_TERRAIN_TEXTURE_SIZE) + if (width > max_terrain_texture_size || height > max_terrain_texture_size) { LLSD args; args["TEXTURE_NUM"] = i+1; args["TEXTURE_SIZE_X"] = width; args["TEXTURE_SIZE_Y"] = height; - args["MAX_SIZE"] = MAX_TERRAIN_TEXTURE_SIZE; + args["MAX_SIZE"] = max_terrain_texture_size; LLNotificationsUtil::add("InvalidTerrainSize", args); return FALSE; @@ -1596,7 +1594,8 @@ BOOL LLPanelRegionTerrainInfo::postBuild() initCtrl("terrain_raise_spin"); initCtrl("terrain_lower_spin"); - getChild("terrain_material_type")->setCommitCallback(boost::bind(&LLPanelRegionTerrainInfo::onSelectMaterialType, this)); + mMaterialTypeCtrl = findChild("terrain_material_type"); + if (mMaterialTypeCtrl) { mMaterialTypeCtrl->setCommitCallback(boost::bind(&LLPanelRegionTerrainInfo::onSelectMaterialType, this)); } std::string buffer; @@ -1604,11 +1603,13 @@ BOOL LLPanelRegionTerrainInfo::postBuild() { buffer = llformat("texture_detail_%d", i); initCtrl(buffer); + mTextureDetailCtrl[i] = findChild(buffer); } for(S32 i = 0; i < LLTerrainMaterials::ASSET_COUNT; ++i) { buffer = llformat("material_detail_%d", i); initCtrl(buffer); + mMaterialDetailCtrl[i] = findChild(buffer); } for(S32 i = 0; i < CORNER_COUNT; ++i) @@ -1626,11 +1627,6 @@ BOOL LLPanelRegionTerrainInfo::postBuild() mAskedTextureHeights = false; mConfirmedTextureHeights = false; - if (!mRegionChangedSlot.connected()) - { - mRegionChangedSlot = gAgent.addRegionChangedCallback(boost::bind(&LLPanelRegionTerrainInfo::onRegionChanged,this)); - } - return LLPanelRegionInfo::postBuild(); } @@ -1642,19 +1638,15 @@ void LLPanelRegionTerrainInfo::onSelectMaterialType() void LLPanelRegionTerrainInfo::updateForMaterialType() { - LLCheckBoxCtrl* material_type_ctrl = getChild("terrain_material_type"); - if (!material_type_ctrl) { return; } - const LLTerrainMaterials::Type material_type = material_type_from_ctrl(material_type_ctrl); + if (!mMaterialTypeCtrl) { return; } + const LLTerrainMaterials::Type material_type = material_type_from_ctrl(mMaterialTypeCtrl); const bool show_texture_controls = material_type == LLTerrainMaterials::Type::TEXTURE; const bool show_material_controls = material_type == LLTerrainMaterials::Type::PBR; // Toggle visibility of correct swatches - std::string buffer; - LLTextureCtrl* texture_ctrl; for(S32 i = 0; i < LLTerrainMaterials::ASSET_COUNT; ++i) { - buffer = llformat("texture_detail_%d", i); - texture_ctrl = getChild(buffer); + LLTextureCtrl* texture_ctrl = mTextureDetailCtrl[i]; if (texture_ctrl) { texture_ctrl->setVisible(show_texture_controls); @@ -1662,40 +1654,31 @@ void LLPanelRegionTerrainInfo::updateForMaterialType() } for(S32 i = 0; i < LLTerrainMaterials::ASSET_COUNT; ++i) { - buffer = llformat("material_detail_%d", i); - texture_ctrl = getChild(buffer); - if (texture_ctrl) + LLTextureCtrl* material_ctrl = mMaterialDetailCtrl[i]; + if (material_ctrl) { - texture_ctrl->setVisible(show_material_controls); + material_ctrl->setVisible(show_material_controls); } } // Toggle visibility of labels - LLUICtrl* texture_label = getChild("detail_texture_text"); + LLUICtrl* texture_label = findChild("detail_texture_text"); if (texture_label) { texture_label->setVisible(show_texture_controls); } - LLUICtrl* material_label = getChild("detail_material_text"); + LLUICtrl* material_label = findChild("detail_material_text"); if (material_label) { material_label->setVisible(show_material_controls); } -} -void LLPanelRegionTerrainInfo::onRegionChanged() -{ - LLViewerRegion *region = gAgent.getRegion(); - if (!region) { return; } - - if (region->simulatorFeaturesReceived()) + // Toggle visibility of documentation labels for terrain blending ranges + const std::vector doc_suffixes { "5", "10", "11" }; + std::string buffer; + for (const std::string& suffix : doc_suffixes) { - onSimulatorFeaturesReceived(region->getRegionID(), region); + buffer = "height_text_lbl" + suffix; + LLUICtrl* texture_doc_label = findChild(buffer); + if (texture_doc_label) { texture_doc_label->setVisible(show_texture_controls); } + buffer += "_material"; + LLUICtrl* material_doc_label = findChild(buffer); + if (material_doc_label) { material_doc_label->setVisible(show_material_controls); } } - else - { - // See "RenderTerrainPBREnabled" in LLViewerRegion::setSimulatorFeatures - region->setSimulatorFeaturesReceivedCallback(boost::bind(&LLPanelRegionTerrainInfo::onSimulatorFeaturesReceived,this,_1, _2)); - } -} - -void LLPanelRegionTerrainInfo::onSimulatorFeaturesReceived(const LLUUID& region_id, LLViewerRegion* regionp) -{ - refresh(); } // virtual @@ -1744,22 +1727,21 @@ bool LLPanelRegionTerrainInfo::refreshFromRegion(LLViewerRegion* region) reset_material_swatches = !set_material_swatches; } - LLCheckBoxCtrl* material_type_ctrl = getChild("terrain_material_type"); - if (material_type_ctrl) { material_type_to_ctrl(material_type_ctrl, material_type); } - updateForMaterialType(); - material_type_ctrl->setVisible(feature_pbr_terrain_enabled); + if (mMaterialTypeCtrl) + { + material_type_to_ctrl(mMaterialTypeCtrl, material_type); + updateForMaterialType(); + mMaterialTypeCtrl->setVisible(feature_pbr_terrain_enabled); + } - LLTextureCtrl* asset_ctrl; - std::string buffer; if (set_texture_swatches) { for(S32 i = 0; i < LLTerrainMaterials::ASSET_COUNT; ++i) { - buffer = llformat("texture_detail_%d", i); - asset_ctrl = getChild(buffer); + LLTextureCtrl* asset_ctrl = mTextureDetailCtrl[i]; if(asset_ctrl) { - LL_DEBUGS() << "Detail Texture " << i << ": " + LL_DEBUGS("Terrain", "Texture") << "Detail Texture " << i << ": " << compp->getDetailAssetID(i) << LL_ENDL; LLUUID tmp_id(compp->getDetailAssetID(i)); asset_ctrl->setImageAssetID(tmp_id); @@ -1770,11 +1752,10 @@ bool LLPanelRegionTerrainInfo::refreshFromRegion(LLViewerRegion* region) { for(S32 i = 0; i < LLTerrainMaterials::ASSET_COUNT; ++i) { - buffer = llformat("material_detail_%d", i); - asset_ctrl = getChild(buffer); + LLTextureCtrl* asset_ctrl = mMaterialDetailCtrl[i]; if(asset_ctrl) { - LL_DEBUGS() << "Detail Material " << i << ": " + LL_DEBUGS("Terrain", "Material") << "Detail Material " << i << ": " << compp->getDetailAssetID(i) << LL_ENDL; LLUUID tmp_id(compp->getDetailAssetID(i)); asset_ctrl->setImageAssetID(tmp_id); @@ -1785,8 +1766,9 @@ bool LLPanelRegionTerrainInfo::refreshFromRegion(LLViewerRegion* region) { for(S32 i = 0; i < LLTerrainMaterials::ASSET_COUNT; ++i) { - buffer = llformat("texture_detail_%d", i); - asset_ctrl = getChild(buffer); + LL_DEBUGS("Terrain", "Texture") << "Reset Texture swatch " << i + << LL_ENDL; + LLTextureCtrl* asset_ctrl = mTextureDetailCtrl[i]; if(asset_ctrl) { asset_ctrl->setImageAssetID(mLastSetTextures[i]); @@ -1797,8 +1779,9 @@ bool LLPanelRegionTerrainInfo::refreshFromRegion(LLViewerRegion* region) { for(S32 i = 0; i < LLTerrainMaterials::ASSET_COUNT; ++i) { - buffer = llformat("material_detail_%d", i); - asset_ctrl = getChild(buffer); + LL_DEBUGS("Terrain", "Material") << "Reset Material swatch " << i + << LL_ENDL; + LLTextureCtrl* asset_ctrl = mMaterialDetailCtrl[i]; if(asset_ctrl) { asset_ctrl->setImageAssetID(mLastSetMaterials[i]); @@ -1806,6 +1789,7 @@ bool LLPanelRegionTerrainInfo::refreshFromRegion(LLViewerRegion* region) } } + std::string buffer; for(S32 i = 0; i < CORNER_COUNT; ++i) { buffer = llformat("height_start_spin_%d", i); @@ -1881,25 +1865,23 @@ BOOL LLPanelRegionTerrainInfo::sendUpdate() } } - LLTextureCtrl* asset_ctrl; std::string id_str; LLMessageSystem* msg = gMessageSystem; // Send either material IDs instead of texture IDs depending on - // terrain_material_type - they both occupy the same slot. - LLCheckBoxCtrl* material_type_ctrl = getChild("terrain_material_type"); - const LLTerrainMaterials::Type material_type = material_type_ctrl ? material_type_from_ctrl(material_type_ctrl) : LLTerrainMaterials::Type::TEXTURE; + // material_type - they both occupy the same slot. + const LLTerrainMaterials::Type material_type = mMaterialTypeCtrl ? material_type_from_ctrl(mMaterialTypeCtrl) : LLTerrainMaterials::Type::TEXTURE; for(S32 i = 0; i < LLTerrainMaterials::ASSET_COUNT; ++i) { + LLTextureCtrl* asset_ctrl; if (material_type == LLTerrainMaterials::Type::PBR) { - buffer = llformat("material_detail_%d", i); + asset_ctrl = mMaterialDetailCtrl[i]; } else { - buffer = llformat("texture_detail_%d", i); + asset_ctrl = mTextureDetailCtrl[i]; } - asset_ctrl = getChild(buffer); if (!asset_ctrl) { continue; } diff --git a/indra/newview/llfloaterregioninfo.h b/indra/newview/llfloaterregioninfo.h index a2e3d21fe0..dd09065f0d 100644 --- a/indra/newview/llfloaterregioninfo.h +++ b/indra/newview/llfloaterregioninfo.h @@ -56,6 +56,7 @@ class LLRadioGroup; class LLSliderCtrl; class LLSpinCtrl; class LLTextBox; +class LLTextureCtrl; class LLPanelRegionGeneralInfo; // Aurora Sim - Region Settings Panel @@ -275,8 +276,6 @@ public: BOOL postBuild() override; - void onRegionChanged(); - void onSimulatorFeaturesReceived(const LLUUID& region_id, LLViewerRegion* regionp); bool refreshFromRegion(LLViewerRegion* region) override; // refresh local settings from region update from simulator void setEnvControls(bool available); // Whether environment settings are available for this region @@ -304,7 +303,9 @@ protected: private: bool mConfirmedTextureHeights; bool mAskedTextureHeights; - boost::signals2::connection mRegionChangedSlot; + LLCheckBoxCtrl* mMaterialTypeCtrl = nullptr; + LLTextureCtrl* mTextureDetailCtrl[LLTerrainMaterials::ASSET_COUNT]; + LLTextureCtrl* mMaterialDetailCtrl[LLTerrainMaterials::ASSET_COUNT]; LLUUID mLastSetTextures[LLTerrainMaterials::ASSET_COUNT]; LLUUID mLastSetMaterials[LLTerrainMaterials::ASSET_COUNT]; }; diff --git a/indra/newview/llheroprobemanager.cpp b/indra/newview/llheroprobemanager.cpp index 10b743ceef..13c12b5e55 100644 --- a/indra/newview/llheroprobemanager.cpp +++ b/indra/newview/llheroprobemanager.cpp @@ -581,7 +581,7 @@ bool LLHeroProbeManager::registerViewerObject(LLVOVolume* drawablep) void LLHeroProbeManager::unregisterViewerObject(LLVOVolume* drawablep) { - std::vector::iterator found_itr = std::find(mHeroVOList.begin(), mHeroVOList.end(), drawablep); + std::vector>::iterator found_itr = std::find(mHeroVOList.begin(), mHeroVOList.end(), drawablep); if (found_itr != mHeroVOList.end()) { mHeroVOList.erase(found_itr); diff --git a/indra/newview/llheroprobemanager.h b/indra/newview/llheroprobemanager.h index 04027cd57e..17e75a18d4 100644 --- a/indra/newview/llheroprobemanager.h +++ b/indra/newview/llheroprobemanager.h @@ -146,8 +146,8 @@ private: U32 mCurrentProbeUpdateFrame = 0; - std::vector mHeroVOList; - LLVOVolume* mNearestHero; + std::vector> mHeroVOList; + LLPointer mNearestHero; }; diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index 4fda68c80f..90a5126194 100644 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -3171,7 +3171,15 @@ void LLViewerLODTexture::processTextureStats() updateVirtualSize(); static LLCachedControl textures_fullres(gSavedSettings,"TextureLoadFullRes", false); - + + { // restrict texture resolution to download based on RenderMaxTextureResolution + static LLCachedControl max_texture_resolution(gSavedSettings, "RenderMaxTextureResolution", 2048); + // sanity clamp debug setting to avoid settings hack shenanigans + F32 tex_res = (F32)llclamp((S32)max_texture_resolution, 512, 2048); + tex_res *= tex_res; + mMaxVirtualSize = llmin(mMaxVirtualSize, tex_res); + } + if (textures_fullres) { mDesiredDiscardLevel = 0; diff --git a/indra/newview/skins/default/xui/en/panel_region_terrain.xml b/indra/newview/skins/default/xui/en/panel_region_terrain.xml index f8d2c90d0a..38d885d72d 100644 --- a/indra/newview/skins/default/xui/en/panel_region_terrain.xml +++ b/indra/newview/skins/default/xui/en/panel_region_terrain.xml @@ -257,6 +257,19 @@ width="300"> Texture Elevation Ranges + + Material Elevation Ranges + These values represent the blend range for the textures above. + + These values represent the blend range for the materials above. + Measured in meters, the LOW value is the MAXIMUM height of Texture #1, and the HIGH value is the MINIMUM height of Texture #4. + + Measured in meters, the LOW value is the MAXIMUM height of Material #1, and the HIGH value is the MINIMUM height of Material #4. + - - Texturas del terreno (requiere archivos .tga de 1024x1024, 24 bits) - +terreno" name="terrain_lower_spin"/> + + Texturas del terreno + 1 (bajo) diff --git a/indra/newview/skins/default/xui/it/panel_region_terrain.xml b/indra/newview/skins/default/xui/it/panel_region_terrain.xml index 0c21ef16b9..e571888832 100644 --- a/indra/newview/skins/default/xui/it/panel_region_terrain.xml +++ b/indra/newview/skins/default/xui/it/panel_region_terrain.xml @@ -10,8 +10,8 @@ - Texture terreno (richiede file 1024x1024 24 bit TGA) - + Texture terreno + 1 (basso) diff --git a/indra/newview/skins/default/xui/ja/panel_region_terrain.xml b/indra/newview/skins/default/xui/ja/panel_region_terrain.xml index 29145ac7a1..94c8442dbd 100644 --- a/indra/newview/skins/default/xui/ja/panel_region_terrain.xml +++ b/indra/newview/skins/default/xui/ja/panel_region_terrain.xml @@ -10,7 +10,7 @@ - 地形テクスチャ(1024x1024 の 24 bit .tga ファイル) + 地形テクスチャ 1(低) diff --git a/indra/newview/skins/default/xui/pl/panel_region_terrain.xml b/indra/newview/skins/default/xui/pl/panel_region_terrain.xml index 62ce4d1965..1fc8c24a8e 100644 --- a/indra/newview/skins/default/xui/pl/panel_region_terrain.xml +++ b/indra/newview/skins/default/xui/pl/panel_region_terrain.xml @@ -7,7 +7,7 @@ - Tekstury terenu (1024x1024, 24 bitowy plik .tga) + Tekstury terenu 1 (Nisko) diff --git a/indra/newview/skins/default/xui/pt/panel_region_terrain.xml b/indra/newview/skins/default/xui/pt/panel_region_terrain.xml index c63dff8c9f..92d6859882 100644 --- a/indra/newview/skins/default/xui/pt/panel_region_terrain.xml +++ b/indra/newview/skins/default/xui/pt/panel_region_terrain.xml @@ -12,8 +12,8 @@ terreno" name="terrain_raise_spin"/> - Texturas de terreno (exige arquivos .tga 1024x1024, 24 bit) - + Texturas de terreno + 1 (Baixo) 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 a2a2988da7..9d4f3c127c 100644 --- a/indra/newview/skins/default/xui/ru/panel_region_terrain.xml +++ b/indra/newview/skins/default/xui/ru/panel_region_terrain.xml @@ -10,8 +10,8 @@ - Текстуры ландшафта (требования: 1024x1024, 24-битные, TGA) - + Текстуры ландшафта + 1 (Низ) 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 92de4c7f54..00560d4c5b 100644 --- a/indra/newview/skins/default/xui/tr/panel_region_terrain.xml +++ b/indra/newview/skins/default/xui/tr/panel_region_terrain.xml @@ -10,8 +10,8 @@ - Yüzey Dokuları (1024x1024, 24 bit .tga dosyalar gerektirir) - + Yüzey Dokuları + 1 (Düşük) diff --git a/indra/newview/skins/default/xui/zh/panel_region_terrain.xml b/indra/newview/skins/default/xui/zh/panel_region_terrain.xml index 81bce46876..8490eeaafc 100644 --- a/indra/newview/skins/default/xui/zh/panel_region_terrain.xml +++ b/indra/newview/skins/default/xui/zh/panel_region_terrain.xml @@ -10,7 +10,7 @@ - 地形材質(須 1024x1024,24 位元 .tga 檔格式) + 地形材質 1(低) diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index 759b936de7..db3b2a76d9 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -1168,12 +1168,6 @@ class Darwin_x86_64_Manifest(ViewerManifest): # with self.prefix(src=relpkgdir, dst=""): # self.path("libndofdev.dylib") # self.path("libhunspell-1.3.a") - # self.path("libIex-3_2.dylib") - # self.path("libIlmThread-3_2.dylib") - # self.path("libImath-3_1.dylib") - # self.path("libOpenEXR-3_2.dylib") - # self.path("libOpenEXRCore-3_2.dylib") - # self.path("libOpenEXRUtil-3_2.dylib") # with self.prefix(src_dst="cursors_mac"): # self.path("*.tif") @@ -1450,12 +1444,6 @@ class Darwin_x86_64_Manifest(ViewerManifest): # copy additional libs in /Contents/MacOS/ self.path(os.path.join(relpkgdir, "libndofdev.dylib"), dst="Resources/libndofdev.dylib") self.path(os.path.join(relpkgdir, "libhunspell-1.3.0.dylib"), dst="Resources/libhunspell-1.3.0.dylib") - self.path(os.path.join(relpkgdir, "libIex-3_2.dylib"), dst="Resources/libIex-3_2.dylib") - self.path(os.path.join(relpkgdir, "libIlmThread-3_2.dylib"), dst="Resources/libIlmThread-3_2.dylib") - self.path(os.path.join(relpkgdir, "libImath-3_1.dylib"), dst="Resources/libImath-3_1.dylib") - self.path(os.path.join(relpkgdir, "libOpenEXR-3_2.dylib"), dst="Resources/libOpenEXR-3_2.dylib") - self.path(os.path.join(relpkgdir, "libOpenEXRCore-3_2.dylib"), dst="Resources/libOpenEXRCore-3_2.dylib") - self.path(os.path.join(relpkgdir, "libOpenEXRUtil-3_2.dylib"), dst="Resources/libOpenEXRUtil-3_2.dylib") # CEF framework goes inside Contents/Frameworks. # Remember where we parked this car.