Merge branch 'release/materials_featurette' of https://github.com/secondlife/viewer

# Conflicts:
#	indra/cmake/Copy3rdPartyLibs.cmake
#	indra/newview/app_settings/settings.xml
#	indra/newview/skins/default/xui/de/panel_region_terrain.xml
#	indra/newview/skins/default/xui/es/panel_region_terrain.xml
#	indra/newview/skins/default/xui/fr/panel_region_terrain.xml
#	indra/newview/skins/default/xui/it/panel_region_terrain.xml
#	indra/newview/skins/default/xui/ja/panel_region_terrain.xml
#	indra/newview/skins/default/xui/pt/panel_region_terrain.xml
#	indra/newview/skins/default/xui/ru/panel_region_terrain.xml
#	indra/newview/skins/default/xui/tr/panel_region_terrain.xml
#	indra/newview/viewer_manifest.py
master
Ansariel 2024-03-15 22:52:24 +01:00
commit efe7cdf153
29 changed files with 295 additions and 190 deletions

View File

@ -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 }}

View File

@ -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

View File

@ -2612,25 +2612,39 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors</string>
<key>archive</key>
<map>
<key>hash</key>
<string>158cbe79bef4ecafb870052bbaca541e07107228</string>
<string>17cd63922214b588d9a36137fadf927237ec0f25</string>
<key>hash_algorithm</key>
<string>sha1</string>
<key>url</key>
<string>https://github.com/secondlife/3p-openexr/releases/download/v1.8/openexr-3.2.2-darwin64-6501c65.tar.zst</string>
<string>https://github.com/secondlife/3p-openexr/releases/download/v1.10/openexr-3.2.2-darwin64-df7544d.tar.zst</string>
</map>
<key>name</key>
<string>darwin64</string>
</map>
<key>linux64</key>
<map>
<key>archive</key>
<map>
<key>hash</key>
<string>b092658ab5ec009a5875e8b6e5b7109730ad6846</string>
<key>hash_algorithm</key>
<string>sha1</string>
<key>url</key>
<string>https://github.com/secondlife/3p-openexr/releases/download/v1.10/openexr-3.2.2-linux64-df7544d.tar.zst</string>
</map>
<key>name</key>
<string>linux64</string>
</map>
<key>windows64</key>
<map>
<key>archive</key>
<map>
<key>hash</key>
<string>924f6ddf6669af023d1f3832cb79b50b913ae0ca</string>
<string>c511ae9a3e401375af2199b498a75f32cebc010f</string>
<key>hash_algorithm</key>
<string>sha1</string>
<key>url</key>
<string>https://github.com/secondlife/3p-openexr/releases/download/v1.8/openexr-3.2.2-windows64-6501c65.tar.zst</string>
<string>https://github.com/secondlife/3p-openexr/releases/download/v1.10/openexr-3.2.2-windows64-df7544d.tar.zst</string>
</map>
<key>name</key>
<string>windows64</string>

View File

@ -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))

View File

@ -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

View File

@ -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.

View File

@ -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.

View File

@ -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.

View File

@ -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
)

View File

@ -12362,6 +12362,17 @@ Change of this parameter will affect the layout of buttons in notification toast
<key>Value</key>
<real>0.0</real>
</map>
<key>RenderHDRISplitScreen</key>
<map>
<key>Comment</key>
<string>What percentage of screen to render using HDRI vs EEP sky.</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>F32</string>
<key>Value</key>
<real>1.0</real>
</map>
<key>RenderMaxOpenGLVersion</key>
<map>
<key>Comment</key>
@ -12394,6 +12405,17 @@ Change of this parameter will affect the layout of buttons in notification toast
<string>U32</string>
<key>Value</key>
<integer>16</integer>
</map>
<key>RenderMaxTextureResolution</key>
<map>
<key>Comment</key>
<string>Maximum texture resolution to download for non-boosted textures.</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>U32</string>
<key>Value</key>
<integer>2048</integer>
</map>
<key>RenderDebugTextureBind</key>
<map>
@ -14036,7 +14058,7 @@ Change of this parameter will affect the layout of buttons in notification toast
<key>Type</key>
<string>F32</string>
<key>Value</key>
<real>4.0</real>
<real>8.0</real>
</map>
<key>RenderTerrainPBRPlanarSampleCount</key>
<map>

View File

@ -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);
}

View File

@ -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

View File

@ -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;

View File

@ -153,12 +153,15 @@ void LLDrawPoolWLSky::renderSkyHazeDeferred(const LLVector3& camPosLocal, F32 ca
static LLCachedControl<F32> hdri_exposure(gSavedSettings, "RenderHDRIExposure", 0.0f);
static LLCachedControl<F32> hdri_rotation(gSavedSettings, "RenderHDRIRotation", 0.f);
static LLCachedControl<F32> 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);
}

View File

@ -1500,20 +1500,18 @@ void LLPanelRegionDebugInfo::onClickDebugConsole(void* data)
BOOL LLPanelRegionTerrainInfo::validateTextureSizes()
{
LLCheckBoxCtrl* material_type_ctrl = getChild<LLCheckBoxCtrl>("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<U32> 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<LLTextureCtrl>(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<LLUICtrl>("terrain_material_type")->setCommitCallback(boost::bind(&LLPanelRegionTerrainInfo::onSelectMaterialType, this));
mMaterialTypeCtrl = findChild<LLCheckBoxCtrl>("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<LLTextureCtrl>(buffer);
}
for(S32 i = 0; i < LLTerrainMaterials::ASSET_COUNT; ++i)
{
buffer = llformat("material_detail_%d", i);
initCtrl(buffer);
mMaterialDetailCtrl[i] = findChild<LLTextureCtrl>(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<LLCheckBoxCtrl>("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<LLTextureCtrl>(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<LLTextureCtrl>(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<LLUICtrl>("detail_texture_text");
LLUICtrl* texture_label = findChild<LLUICtrl>("detail_texture_text");
if (texture_label) { texture_label->setVisible(show_texture_controls); }
LLUICtrl* material_label = getChild<LLUICtrl>("detail_material_text");
LLUICtrl* material_label = findChild<LLUICtrl>("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<std::string> 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<LLUICtrl>(buffer);
if (texture_doc_label) { texture_doc_label->setVisible(show_texture_controls); }
buffer += "_material";
LLUICtrl* material_doc_label = findChild<LLUICtrl>(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<LLCheckBoxCtrl>("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<LLTextureCtrl>(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<LLTextureCtrl>(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<LLTextureCtrl>(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<LLTextureCtrl>(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<LLCheckBoxCtrl>("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<LLTextureCtrl>(buffer);
if (!asset_ctrl) { continue; }

View File

@ -56,6 +56,7 @@ class LLRadioGroup;
class LLSliderCtrl;
class LLSpinCtrl;
class LLTextBox;
class LLTextureCtrl;
class LLPanelRegionGeneralInfo;
// <FS:CR> 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];
};

View File

@ -581,7 +581,7 @@ bool LLHeroProbeManager::registerViewerObject(LLVOVolume* drawablep)
void LLHeroProbeManager::unregisterViewerObject(LLVOVolume* drawablep)
{
std::vector<LLVOVolume*>::iterator found_itr = std::find(mHeroVOList.begin(), mHeroVOList.end(), drawablep);
std::vector<LLPointer<LLVOVolume>>::iterator found_itr = std::find(mHeroVOList.begin(), mHeroVOList.end(), drawablep);
if (found_itr != mHeroVOList.end())
{
mHeroVOList.erase(found_itr);

View File

@ -146,8 +146,8 @@ private:
U32 mCurrentProbeUpdateFrame = 0;
std::vector<LLVOVolume*> mHeroVOList;
LLVOVolume* mNearestHero;
std::vector<LLPointer<LLVOVolume>> mHeroVOList;
LLPointer<LLVOVolume> mNearestHero;
};

View File

@ -3171,7 +3171,15 @@ void LLViewerLODTexture::processTextureStats()
updateVirtualSize();
static LLCachedControl<bool> textures_fullres(gSavedSettings,"TextureLoadFullRes", false);
{ // restrict texture resolution to download based on RenderMaxTextureResolution
static LLCachedControl<U32> 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;

View File

@ -257,6 +257,19 @@
width="300">
Texture Elevation Ranges
</text>
<text
visible="false"
type="string"
length="1"
follows="left|top"
height="20"
layout="topleft"
left="10"
name="height_text_lbl5_material"
top_delta="0"
width="300">
Material Elevation Ranges
</text>
<text
follows="left|top"
height="20"
@ -268,6 +281,18 @@
word_wrap="true">
These values represent the blend range for the textures above.
</text>
<text
visible="false"
follows="left|top"
height="20"
layout="topleft"
left="10"
name="height_text_lbl10_material"
top_delta="0"
width="200"
word_wrap="true">
These values represent the blend range for the materials above.
</text>
<text
follows="left|top"
height="60"
@ -279,6 +304,18 @@
word_wrap="true">
Measured in meters, the LOW value is the MAXIMUM height of Texture #1, and the HIGH value is the MINIMUM height of Texture #4.
</text>
<text
visible="false"
follows="left|top"
height="60"
layout="topleft"
left_delta="0"
name="height_text_lbl11_material"
top_delta="0"
width="200"
word_wrap="true">
Measured in meters, the LOW value is the MAXIMUM height of Material #1, and the HIGH value is the MINIMUM height of Material #4.
</text>
<text
follows="left|top"
height="20"

View File

@ -10,10 +10,10 @@
<spinner label="Límite de elevación
del terreno" name="terrain_raise_spin" left="180" label_width="180" width="250"/>
<spinner bottom_delta="-34" label="Límite de bajada del
terreno" name="terrain_lower_spin" left="180" label_width="180" width="250"/>
<text name="detail_texture_text" width="350">
Texturas del terreno (requiere archivos .tga de 1024x1024, 24 bits)
</text>
terreno" name="terrain_lower_spin"/>
<text name="detail_texture_text">
Texturas del terreno
</text>
<text name="height_text_lbl">
1 (bajo)
</text>

View File

@ -10,8 +10,8 @@
<spinner label="Limite altezza" name="terrain_raise_spin"/>
<spinner bottom_delta="-34" label="Limite profondità" name="terrain_lower_spin"/>
<text name="detail_texture_text">
Texture terreno (richiede file 1024x1024 24 bit TGA)
</text>
Texture terreno
</text>
<text name="height_text_lbl">
1 (basso)
</text>

View File

@ -10,7 +10,7 @@
<spinner label="地形の上昇限度" name="terrain_raise_spin"/>
<spinner label="地形の下降限度" name="terrain_lower_spin"/>
<text name="detail_texture_text">
地形テクスチャ1024x1024 の 24 bit .tga ファイル)
地形テクスチャ
</text>
<text name="height_text_lbl">
1

View File

@ -7,7 +7,7 @@
<spinner label="Górny limit terenu" name="terrain_raise_spin" />
<spinner label="Dolny limit terenu" name="terrain_lower_spin" />
<text name="detail_texture_text">
Tekstury terenu (1024x1024, 24 bitowy plik .tga)
Tekstury terenu
</text>
<text name="height_text_lbl">
1 (Nisko)

View File

@ -12,8 +12,8 @@ terreno" name="terrain_raise_spin"/>
<spinner bottom_delta="-34" label="Limite mais baixo do
terreno" name="terrain_lower_spin"/>
<text name="detail_texture_text">
Texturas de terreno (exige arquivos .tga 1024x1024, 24 bit)
</text>
Texturas de terreno
</text>
<text name="height_text_lbl">
1 (Baixo)
</text>

View File

@ -10,8 +10,8 @@
<spinner label="Лимит подьема ландшафта" name="terrain_raise_spin" left="220" label_width="160" width="230"/>
<spinner label="Лимит спуска ландшафта" name="terrain_lower_spin" left="220" label_width="160" width="230"/>
<text name="detail_texture_text">
Текстуры ландшафта (требования: 1024x1024, 24-битные, TGA)
</text>
Текстуры ландшафта
</text>
<text name="height_text_lbl">
1 (Низ)
</text>

View File

@ -10,8 +10,8 @@
<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ı (1024x1024, 24 bit .tga dosyalar gerektirir)
</text>
Yüzey Dokuları
</text>
<text name="height_text_lbl">
1 (Düşük)
</text>

View File

@ -10,7 +10,7 @@
<spinner label="地形提升限制" name="terrain_raise_spin"/>
<spinner label="地形降低限制" name="terrain_lower_spin"/>
<text name="detail_texture_text">
地形材質(須 1024x102424 位元 .tga 檔格式)
地形材質
</text>
<text name="height_text_lbl">
1

View File

@ -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 <bundle>/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.