summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/testplans/RenderMaxTextureResolution.md16
-rw-r--r--doc/testplans/hdri_local_preview.md21
-rw-r--r--doc/testplans/pbr_terrain_appearance.md (renamed from doc/testplans/pbr_terrain_feature_gating.md)17
-rw-r--r--indra/newview/app_settings/settings.xml24
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/skyF.glsl60
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/skyV.glsl6
-rw-r--r--indra/newview/lldrawpoolwlsky.cpp5
-rw-r--r--indra/newview/llheroprobemanager.cpp2
-rw-r--r--indra/newview/llheroprobemanager.h4
-rw-r--r--indra/newview/llviewertexture.cpp10
10 files changed, 127 insertions, 38 deletions
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
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/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index 8420f32db8..a28ea7294c 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -9373,6 +9373,17 @@
<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>
@@ -9406,6 +9417,17 @@
<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>
<key>Comment</key>
@@ -10919,7 +10941,7 @@
<key>Type</key>
<string>F32</string>
<key>Value</key>
- <real>4.0</real>
+ <real>8.0</real>
</map>
<key>RenderTerrainPBRPlanarSampleCount</key>
<map>
diff --git a/indra/newview/app_settings/shaders/class1/deferred/skyF.glsl b/indra/newview/app_settings/shaders/class1/deferred/skyF.glsl
index 596e9321e8..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,33 +83,39 @@ 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)); // 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
-
- // 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));
-
- frag_data[2] = vec4(0.0,0.0,0.0,GBUFFER_FLAG_SKIP_ATMOS);
+ 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);
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/lldrawpoolwlsky.cpp b/indra/newview/lldrawpoolwlsky.cpp
index 303916110c..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<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
{
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<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);
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<LLVOVolume*> mHeroVOList;
- LLVOVolume* mNearestHero;
+ std::vector<LLPointer<LLVOVolume>> mHeroVOList;
+ LLPointer<LLVOVolume> mNearestHero;
};
diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp
index 8436159e14..9759b9a31b 100644
--- a/indra/newview/llviewertexture.cpp
+++ b/indra/newview/llviewertexture.cpp
@@ -3079,7 +3079,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;