Merge branch 'release/2024.09-ExtraFPS' of https://github.com/secondlife/viewer

# Conflicts:
#	indra/newview/llviewertexture.cpp
#	indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml
master
Ansariel 2024-12-04 16:11:44 +01:00
commit 7c3b74a0df
34 changed files with 421 additions and 231 deletions

View File

@ -42,7 +42,7 @@ jobs:
needs: setup
strategy:
matrix:
runner: [windows-large, macos-12-xl]
runner: [windows-large, macos-13-xlarge]
configuration: ${{ fromJSON(needs.setup.outputs.configurations) }}
runs-on: ${{ matrix.runner }}
outputs:
@ -64,7 +64,7 @@ jobs:
# autobuild-package.xml.
AUTOBUILD_VCS_INFO: "true"
AUTOBUILD_VSVER: "170"
DEVELOPER_DIR: "/Applications/Xcode_14.0.1.app/Contents/Developer"
DEVELOPER_DIR: "/Applications/Xcode_14.1.app/Contents/Developer"
# Ensure that Linden viewer builds engage Bugsplat.
BUGSPLAT_DB: ${{ needs.setup.outputs.bugsplat_db }}
build_coverity: false

View File

@ -2068,6 +2068,14 @@ F32 LLSettingsSky::getTonemapMix() const
return mTonemapMix;
}
void LLSettingsSky::setTonemapMix(F32 mix)
{
if (mCanAutoAdjust)
return;
mTonemapMix = mix;
}
void LLSettingsSky::setGamma(F32 val)
{
mGamma = val;

View File

@ -213,6 +213,7 @@ public:
F32 getHDRMax() const;
F32 getHDROffset() const;
F32 getTonemapMix() const;
void setTonemapMix(F32 mix);
void setGamma(F32 val);

View File

@ -1324,6 +1324,7 @@ bool LLGLManager::initGL()
glGetIntegerv(GL_MAX_INTEGER_SAMPLES, &mMaxIntegerSamples);
glGetIntegerv(GL_MAX_SAMPLE_MASK_WORDS, &mMaxSampleMaskWords);
glGetIntegerv(GL_MAX_SAMPLES, &mMaxSamples);
glGetIntegerv(GL_MAX_VARYING_VECTORS, &mMaxVaryingVectors);
glGetIntegerv(GL_MAX_UNIFORM_BLOCK_SIZE, &mMaxUniformBlockSize);
// sanity clamp max uniform block size to 64k just in case

View File

@ -90,6 +90,7 @@ public:
S32 mGLMaxTextureSize;
F32 mMaxAnisotropy = 0.f;
S32 mMaxUniformBlockSize = 0;
S32 mMaxVaryingVectors = 0;
// GL 4.x capabilities
bool mHasCubeMapArray = false;

View File

@ -29,6 +29,7 @@
<string>RenderDesaturateIrradiance</string>
<string>RenderDiffuseLuminanceScale</string>
<string>RenderDisablePostProcessing</string>
<string>RenderDisableVintageMode</string>
<string>RenderDefaultProbeUpdatePeriod</string>
<string>RenderDynamicExposureCoefficient</string>
<string>RenderExposure</string>
@ -99,7 +100,6 @@
<string>RenderUnloadedAvatar</string>
<string>RenderUseStreamVBO</string>
<string>RenderVBOEnable</string>
<string>RenderVintageMode</string>
<string>RenderVSyncEnable</string>
<string>RenderVolumeLODFactor</string>
<string>RenderWaterRefResolution</string>

View File

@ -23219,16 +23219,16 @@ Change of this parameter will affect the layout of buttons in notification toast
<key>Value</key>
<integer>1</integer>
</map>
<key>RenderVintageMode</key>
<key>RenderDisableVintageMode</key>
<map>
<key>Comment</key>
<string>Disable different rendering pipeline features to improve performance on older machines that makes the world look closer to how it used to prior to V7.</string>
<string>Enables additional rendering pipeline features on newer machines such as HDR and emissive textures on PBR content.</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
<integer>1</integer>
</map>
<key>FSNetMapPhantomOpacity</key>

View File

@ -544,8 +544,10 @@ vec3 pbrCalcPointLightOrSpotLight(vec3 diffuseColor, vec3 specularColor,
pbrPunctual(diffuseColor, specularColor, perceptualRoughness, metallic, n.xyz, v, lv, nl, diffPunc, specPunc);
color = intensity * clamp(nl * (diffPunc + specPunc), vec3(0), vec3(10));
}
return color;
float final_scale = 1.0;
if (classic_mode > 0)
final_scale = 0.9;
return color * final_scale;
}
void calcDiffuseSpecular(vec3 baseColor, float metallic, inout vec3 diffuseColor, inout vec3 specularColor)
@ -576,22 +578,25 @@ vec3 pbrBaseLight(vec3 diffuseColor, vec3 specularColor, float metallic, vec3 v,
// Depending on the sky, we combine these differently.
if (classic_mode > 0)
{
irradiance.rgb = srgb_to_linear(irradiance * 0.9); // BINGO
// Reconstruct the diffuse lighting that we do for blinn-phong materials here.
// A special note about why we do some really janky stuff for classic mode.
// Since adding classic mode, we've moved the lambertian diffuse multiply out from pbrPunctual and instead handle it in the different light type calcs.
// For classic mode, this baiscally introduces a double multiplication that we need to somehow avoid
// Using one of the old mobile gamma correction tricks (val * val to "linearize", sqrt(val) to bring back into sRGB), we can _mostly_ avert this
// This will never be 100% correct, but at the very least we can make it look mostly correct with legacy skies and classic mode.
float da = pow(sqrt(nl), 1.2);
float da = pow(nl, 1.2);
vec3 sun_contrib = vec3(min(da, scol));
// Multiply by PI to account for lambertian diffuse colors. Otherwise things will be too dark when lit by the sun on legacy skies.
sun_contrib = srgb_to_linear(color.rgb * 0.9 + linear_to_srgb(sun_contrib) * sunlit * 0.7) * M_PI;
sun_contrib = srgb_to_linear(linear_to_srgb(sun_contrib) * sunlit * 0.7) * M_PI;
// Manually recombine everything here. We have to separate the shading to ensure that lighting is able to more closely match blinn-phong.
color.rgb = srgb_to_linear(iblDiff) + clamp(sun_contrib * (da * (diffPunc.rgb + specPunc.rgb) * scol), vec3(0), vec3(10));
vec3 finalAmbient = irradiance.rgb * diffuseColor.rgb; // BINGO
vec3 finalSun = clamp(sun_contrib * ((diffPunc.rgb + specPunc.rgb) * scol), vec3(0), vec3(10)); // QUESTIONABLE BINGO?
color.rgb = srgb_to_linear(linear_to_srgb(finalAmbient) + (linear_to_srgb(finalSun) * 1.1));
//color.rgb = sun_contrib * diffuseColor.rgb;
}
else
{

View File

@ -163,7 +163,10 @@ vec3 calcPointLightOrSpotLight(vec3 light_col, vec3 diffuse, vec3 v, vec3 n, vec
// no spec for alpha shader...
}
col = max(col, vec3(0));
float final_scale = 1.0;
if (classic_mode > 0)
final_scale = 0.9;
col = max(col * final_scale, vec3(0));
return col;
}
@ -241,7 +244,8 @@ void main()
vec3 atten;
calcAtmosphericVarsLinear(pos.xyz, norm, light_dir, sunlit, amblit, additive, atten);
if (classic_mode > 0)
sunlit *= 1.35;
vec3 sunlit_linear = sunlit;
vec3 amblit_linear = amblit;
@ -296,11 +300,14 @@ void main()
color.rgb = applySkyAndWaterFog(pos.xyz, additive, atten, color).rgb;
#endif // #else // FOR_IMPOSTOR
float final_scale = 1;
if (classic_mode > 0)
final_scale = 1.1;
#ifdef IS_HUD
color.rgb = linear_to_srgb(color.rgb);
final_scale = 1;
#endif
frag_color = max(color, vec4(0));
frag_color = max(color * final_scale, vec4(0));
}

View File

@ -43,6 +43,7 @@ uniform sampler2D lightMap;
uniform int sun_up_factor;
uniform vec3 sun_dir;
uniform vec3 moon_dir;
uniform int classic_mode;
out vec4 frag_color;
@ -160,7 +161,8 @@ void main()
vec3 additive;
vec3 atten;
calcAtmosphericVarsLinear(pos.xyz, norm, light_dir, sunlit, amblit, additive, atten);
if (classic_mode > 0)
sunlit *= 1.35;
vec3 sunlit_linear = sunlit;
vec2 frag = vary_fragcoord.xy/vary_fragcoord.z*0.5+0.5;
@ -212,8 +214,10 @@ void main()
color.rgb = applySkyAndWaterFog(pos.xyz, additive, atten, vec4(color, 1.0)).rgb;
float a = basecolor.a*vertex_color.a;
frag_color = max(vec4(color.rgb,a), vec4(0));
float final_scale = 1;
if (classic_mode > 0)
final_scale = 1.1;
frag_color = max(vec4(color.rgb * final_scale,a), vec4(0));
}
#else

View File

@ -178,8 +178,10 @@ vec3 calcPointLightOrSpotLight(vec3 light_col, vec3 npos, vec3 diffuse, vec4 spe
}
}
}
return max(col, vec3(0.0, 0.0, 0.0));
float final_scale = 1.0;
if (classic_mode > 0)
final_scale = 0.9;
return max(col * final_scale, vec3(0.0, 0.0, 0.0));
}
#else
@ -329,7 +331,8 @@ void main()
vec3 additive;
vec3 atten;
calcAtmosphericVarsLinear(pos.xyz, norm.xyz, light_dir, sunlit, amblit, additive, atten);
if (classic_mode > 0)
sunlit *= 1.35;
vec3 sunlit_linear = sunlit;
vec3 amblit_linear = amblit;
@ -418,8 +421,10 @@ void main()
glare *= 1.0-emissive;
glare = min(glare, 1.0);
float al = max(diffcol.a, glare) * vertex_color.a;
frag_color = max(vec4(color, al), vec4(0));
float final_scale = 1;
if (classic_mode > 0)
final_scale = 1.1;
frag_color = max(vec4(color * final_scale, al), vec4(0));
#else // mode is not DIFFUSE_ALPHA_MODE_BLEND, encode to gbuffer
// deferred path // See: C++: addDeferredAttachment(), shader: softenLightF.glsl

View File

@ -38,6 +38,7 @@ uniform vec4 light_col[LIGHT_COUNT]; // .a = falloff
uniform vec2 screen_res;
uniform float far_z;
uniform mat4 inv_proj;
uniform int classic_mode;
in vec4 vary_fragcoord;
@ -169,8 +170,10 @@ void main()
}
}
}
frag_color.rgb = max(final_color, vec3(0));
float final_scale = 1.0;
if (classic_mode > 0)
final_scale = 0.9;
frag_color.rgb = max(final_color * final_scale, vec3(0));
frag_color.a = 0.0;
#ifdef IS_AMD_CARD

View File

@ -44,6 +44,7 @@ uniform vec2 screen_res;
uniform mat4 inv_proj;
uniform vec4 viewport;
uniform int classic_mode;
void calcHalfVectors(vec3 lv, vec3 n, vec3 v, out vec3 h, out vec3 l, out float nh, out float nl, out float nv, out float vh, out float lightDist);
float calcLegacyDistanceAttenuation(float distance, float falloff);
@ -149,7 +150,9 @@ void main()
discard;
}
}
frag_color.rgb = max(final_color, vec3(0));
float final_scale = 1.0;
if (classic_mode > 0)
final_scale = 0.9;
frag_color.rgb = max(final_color * final_scale, vec3(0));
frag_color.a = 0.0;
}

View File

@ -155,6 +155,9 @@ void main()
calcAtmosphericVarsLinear(pos.xyz, gb.normal, light_dir, sunlit, amblit, additive, atten);
if (classic_mode > 0)
sunlit *= 1.35;
vec3 sunlit_linear = sunlit;
vec3 amblit_linear = amblit;
@ -224,7 +227,7 @@ void main()
da = pow(da,1.2);
vec3 sun_contrib = vec3(min(da, scol));
color.rgb = srgb_to_linear(color.rgb * 0.9 + linear_to_srgb(sun_contrib) * sunlit_linear * 0.7);
color.rgb = srgb_to_linear(color.rgb * 0.9 + (linear_to_srgb(sun_contrib) * sunlit_linear * 0.7));
sunlit_linear = srgb_to_linear(sunlit_linear);
}
else
@ -272,6 +275,9 @@ void main()
}
//color.r = classic_mode > 0 ? 1.0 : 0.0;
frag_color.rgb = max(color.rgb, vec3(0)); //output linear since local lights will be added to this shader's results
float final_scale = 1;
if (classic_mode > 0)
final_scale = 1.1;
frag_color.rgb = max(color.rgb * final_scale, vec3(0)); //output linear since local lights will be added to this shader's results
frag_color.a = 0.0;
}

View File

@ -47,6 +47,7 @@ uniform vec3 proj_origin; //origin of projection to be used for angular attenuat
uniform float sun_wash;
uniform int proj_shadow_idx;
uniform float shadow_fade;
uniform int classic_mode;
// Light params
#if defined(MULTI_SPOTLIGHT)
@ -267,8 +268,10 @@ void main()
//not sure why, but this line prevents MATBUG-194
final_color = max(final_color, vec3(0.0));
float final_scale = 1.0;
if (classic_mode > 0)
final_scale = 0.9;
//output linear
frag_color.rgb = final_color;
frag_color.rgb = final_color * final_scale;
frag_color.a = 0.0;
}

View File

@ -1,4 +1,4 @@
version 72
version 73
// The version number above should be incremented 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
@ -86,7 +86,7 @@ RenderTonemapType 1 1
RenderTonemapMix 1 1
RenderEnableEmissiveBuffer 1 1
RenderHDREnabled 1 1
RenderVintageMode 1 1
RenderDisableVintageMode 1 1
//
// Low Graphics Settings
@ -127,7 +127,7 @@ RenderCASSharpness 1 0
RenderExposure 1 1
RenderTonemapType 1 1
RenderTonemapMix 1 0.7
RenderVintageMode 1 1
RenderDisableVintageMode 1 0
//
// Medium Low Graphics Settings
@ -168,7 +168,7 @@ RenderCASSharpness 1 0
RenderExposure 1 1
RenderTonemapType 1 1
RenderTonemapMix 1 0.7
RenderVintageMode 1 1
RenderDisableVintageMode 1 0
//
// Medium Graphics Settings (standard)
@ -378,7 +378,7 @@ RenderShadowDetail 1 0
RenderDeferredSSAO 1 0
RenderMirrors 1 0
RenderEnableEmissiveBuffer 1 0
RenderVintageMode 1 1
RenderDisableVintageMode 1 0
//
// VRAM > 512MB
@ -401,7 +401,7 @@ RenderDeferredSSAO 0 0
RenderShadowDetail 0 0
RenderReflectionProbeDetail 0 -1
RenderMirrors 0 0
RenderVintageMode 1 1
RenderDisableVintageMode 1 0
list Intel
RenderAnisotropic 1 0
@ -424,7 +424,11 @@ RenderEnableEmissiveBuffer 1 0
RenderGLMultiThreadedTextures 0 0
RenderGLMultiThreadedMedia 0 0
RenderHDREnabled 1 0
RenderVintageMode 1 1
RenderDisableVintageMode 1 0
list TexUnit16orLess
RenderTerrainPBRDetail 1 -1
list VaryingVectors16orLess
RenderTerrainPBRPlanarSampleCount 1 1

View File

@ -1,4 +1,4 @@
version 52
version 53
// The version number above should be incremented 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
@ -86,7 +86,7 @@ RenderTonemapType 1 1
RenderTonemapMix 1 1
RenderEnableEmissiveBuffer 1 1
RenderHDREnabled 1 1
RenderVintageMode 1 1
RenderDisableVintageMode 1 1
//
// Low Graphics Settings
@ -127,7 +127,7 @@ RenderCASSharpness 1 0
RenderExposure 1 1
RenderTonemapType 1 1
RenderTonemapMix 1 0.7
RenderVintageMode 1 1
RenderDisableVintageMode 1 0
//
// Medium Low Graphics Settings
@ -168,7 +168,7 @@ RenderCASSharpness 1 0
RenderExposure 1 1
RenderTonemapType 1 1
RenderTonemapMix 1 0.7
RenderVintageMode 1 1
RenderDisableVintageMode 1 0
//
// Medium Graphics Settings (standard)
@ -378,7 +378,7 @@ RenderShadowDetail 1 0
RenderDeferredSSAO 1 0
RenderMirrors 1 0
RenderEnableEmissiveBuffer 1 0
RenderVintageMode 1 1
RenderDisableVintageMode 1 0
//
// VRAM > 512MB
@ -401,7 +401,7 @@ RenderDeferredSSAO 0 0
RenderShadowDetail 0 0
RenderReflectionProbeDetail 0 -1
RenderMirrors 0 0
RenderVintageMode 1 1
RenderDisableVintageMode 1 0
list Intel
RenderAnisotropic 1 0
@ -428,7 +428,11 @@ RenderEnableEmissiveBuffer 1 0
RenderGLMultiThreadedTextures 0 0
RenderGLMultiThreadedMedia 0 0
RenderHDREnabled 1 0
RenderVintageMode 1 1
RenderDisableVintageMode 1 0
list TexUnit16orLess
RenderTerrainPBRDetail 1 -1
list VaryingVectors16orLess
RenderTerrainPBRPlanarSampleCount 1 1

View File

@ -1,4 +1,4 @@
version 66
version 68
// The version number above should be incremented 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
@ -83,7 +83,7 @@ RenderCASSharpness 1 1
RenderExposure 1 1
RenderTonemapType 1 1
RenderTonemapMix 1 1
RenderVintageMode 1 1
RenderDisableVintageMode 1 1
//
// Low Graphics Settings
@ -124,7 +124,7 @@ RenderCASSharpness 1 0
RenderExposure 1 1
RenderTonemapType 1 1
RenderTonemapMix 1 0.7
RenderVintageMode 1 1
RenderDisableVintageMode 1 0
//
// Medium Low Graphics Settings
@ -165,7 +165,7 @@ RenderCASSharpness 1 0
RenderExposure 1 1
RenderTonemapType 1 1
RenderTonemapMix 1 0.7
RenderVintageMode 1 1
RenderDisableVintageMode 1 0
//
// Medium Graphics Settings (standard)
@ -374,7 +374,7 @@ list Unknown
RenderShadowDetail 1 0
RenderDeferredSSAO 1 0
RenderMirrors 1 0
RenderVintageMode 1 1
RenderDisableVintageMode 1 0
//
@ -396,7 +396,7 @@ RenderTerrainDetail 1 0
RenderDeferredSSAO 0 0
RenderShadowDetail 0 0
RenderMirrors 0 0
RenderVintageMode 1 1
RenderDisableVintageMode 1 0
list TexUnit8orLess
RenderDeferredSSAO 0 0
@ -425,4 +425,7 @@ RenderFSAASamples 0 0
RenderReflectionProbeDetail 0 0
RenderReflectionsEnabled 0 0
RenderMirrors 0 0
RenderVintageMode 1 1
RenderDisableVintageMode 1 0
list VaryingVectors16orLess
RenderTerrainPBRPlanarSampleCount 1 1

View File

@ -729,7 +729,11 @@ void LLFeatureManager::applyBaseMasks()
LLImageGLThread::sEnabledTextures = false;
// Make extra sure that vintage mode also gets enabled.
gSavedSettings.setBOOL("RenderVintageMode", true);
gSavedSettings.setBOOL("RenderDisableVintageMode", false);
}
if (gGLManager.mMaxVaryingVectors <= 16)
{
maskFeatures("VaryingVectors16orLess");
}
// now mask by gpu string

View File

@ -2318,17 +2318,17 @@ void LLFloaterPreference::disableUnavailableSettings()
}
// Vintage mode
LLCachedControl<bool> is_vintage(gSavedSettings, "RenderVintageMode");
LLCachedControl<bool> is_not_vintage(gSavedSettings, "RenderDisableVintageMode");
LLSliderCtrl* tonemapMix = getChild<LLSliderCtrl>("TonemapMix");
LLComboBox* tonemapSelect = getChild<LLComboBox>("TonemapType");
LLTextBox* tonemapLabel = getChild<LLTextBox>("TonemapTypeText");
LLSliderCtrl* exposureSlider = getChild<LLSliderCtrl>("RenderExposure");
tonemapSelect->setEnabled(!is_vintage);
tonemapLabel->setEnabled(!is_vintage);
tonemapMix->setEnabled(!is_vintage);
exposureSlider->setEnabled(!is_vintage);
cas_slider->setEnabled(!is_vintage);
tonemapSelect->setEnabled(is_not_vintage);
tonemapLabel->setEnabled(is_not_vintage);
tonemapMix->setEnabled(is_not_vintage);
exposureSlider->setEnabled(is_not_vintage);
cas_slider->setEnabled(is_not_vintage);
}

View File

@ -322,17 +322,17 @@ void LLFloaterPreferenceGraphicsAdvanced::disableUnavailableSettings()
}
// Vintage mode
LLCachedControl<bool> is_vintage(gSavedSettings, "RenderVintageMode");
LLCachedControl<bool> is_not_vintage(gSavedSettings, "RenderDisableVintageMode");
LLSliderCtrl* tonemapMix = getChild<LLSliderCtrl>("TonemapMix");
LLComboBox* tonemapSelect = getChild<LLComboBox>("TonemapType");
LLTextBox* tonemapLabel = getChild<LLTextBox>("TonemapTypeText");
LLSliderCtrl* exposureSlider = getChild<LLSliderCtrl>("RenderExposure");
tonemapSelect->setEnabled(!is_vintage);
tonemapLabel->setEnabled(!is_vintage);
tonemapMix->setEnabled(!is_vintage);
exposureSlider->setEnabled(!is_vintage);
cas_slider->setEnabled(!is_vintage);
tonemapSelect->setEnabled(is_not_vintage);
tonemapLabel->setEnabled(is_not_vintage);
tonemapMix->setEnabled(is_not_vintage);
exposureSlider->setEnabled(is_not_vintage);
cas_slider->setEnabled(is_not_vintage);
}
void LLFloaterPreferenceGraphicsAdvanced::refreshEnabledState()

View File

@ -776,7 +776,7 @@ void LLModelPreview::rebuildUploadData()
{
// in case user provided a missing file later
texture->setIsMissingAsset(false);
texture->setLoadedCallback(LLModelPreview::textureLoadedCallback, 0, true, false, this, &mCallbackTextureList, false);
texture->setLoadedCallback(LLModelPreview::textureLoadedCallback, 0, true, false, new LLHandle<LLModelPreview>(getHandle()), &mCallbackTextureList, false);
texture->forceToSaveRawImage(0, F32_MAX);
texture->updateFetch();
if (mModelLoader)
@ -1023,6 +1023,10 @@ void LLModelPreview::loadModel(std::string filename, S32 lod, bool force_disable
std::map<std::string, std::string> joint_alias_map;
getJointAliases(joint_alias_map);
LLHandle<LLModelPreview> preview_handle = getHandle();
auto load_textures_cb =
[preview_handle](LLImportMaterial& material, void* opaque) { return LLModelPreview::loadTextures(material, preview_handle); };
// three possible file extensions, .dae .gltf .glb
// check for .dae and if not then assume one of the .gl??
std::string filename_lc(filename);
@ -1042,7 +1046,7 @@ void LLModelPreview::loadModel(std::string filename, S32 lod, bool force_disable
lod,
&LLModelPreview::loadedCallback,
&LLModelPreview::lookupJointByName,
&LLModelPreview::loadTextures,
load_textures_cb,
&LLModelPreview::stateChangedCallback,
this,
mJointTransformMap,
@ -1062,7 +1066,7 @@ void LLModelPreview::loadModel(std::string filename, S32 lod, bool force_disable
lod,
&LLModelPreview::loadedCallback,
&LLModelPreview::lookupJointByName,
&LLModelPreview::loadTextures,
load_textures_cb,
&LLModelPreview::stateChangedCallback,
this,
mJointTransformMap,
@ -4189,9 +4193,9 @@ LLJoint* LLModelPreview::lookupJointByName(const std::string& str, void* opaque)
return NULL;
}
U32 LLModelPreview::loadTextures(LLImportMaterial& material, void* opaque)
U32 LLModelPreview::loadTextures(LLImportMaterial& material, LLHandle<LLModelPreview> handle)
{
if (material.mDiffuseMapFilename.size())
if (material.mDiffuseMapFilename.size() && !handle.isDead())
{
material.mOpaqueData = new LLPointer< LLViewerFetchedTexture >;
LLPointer< LLViewerFetchedTexture >& tex = (*reinterpret_cast< LLPointer< LLViewerFetchedTexture > * >(material.mOpaqueData));
@ -4202,10 +4206,8 @@ U32 LLModelPreview::loadTextures(LLImportMaterial& material, void* opaque)
// file was loaded previosly, reload image to get potential changes
tex->clearFetchedResults();
}
// Todo: might cause a crash if preview gets closed before we get the callback.
// Use a callback list or guard callback in some way
LLModelPreview* preview = (LLModelPreview*)opaque;
tex->setLoadedCallback(LLModelPreview::textureLoadedCallback, 0, true, false, opaque, &preview->mCallbackTextureList, false);
LLModelPreview* preview = (LLModelPreview*)handle.get();
tex->setLoadedCallback(LLModelPreview::textureLoadedCallback, 0, true, false, new LLHandle<LLModelPreview>(handle), &preview->mCallbackTextureList, false);
tex->forceToSaveRawImage(0, F32_MAX);
material.setDiffuseMap(tex->getID()); // record tex ID
return 1;
@ -5151,16 +5153,29 @@ void LLModelPreview::textureLoadedCallback(
bool final,
void* userdata)
{
LLModelPreview* preview = (LLModelPreview*)userdata;
preview->refresh();
if (!userdata)
return;
if (final && preview->mModelLoader)
LLHandle<LLModelPreview>* handle = (LLHandle<LLModelPreview>*)userdata;
if (!handle->isDead())
{
if (preview->mModelLoader->mNumOfFetchingTextures > 0)
LLModelPreview* preview = static_cast<LLModelPreview*>(handle->get());
preview->refresh();
if (final && preview->mModelLoader)
{
preview->mModelLoader->mNumOfFetchingTextures--;
if (preview->mModelLoader->mNumOfFetchingTextures > 0)
{
preview->mModelLoader->mNumOfFetchingTextures--;
}
}
}
if (final || !success)
{
delete handle;
}
}
// static

View File

@ -111,7 +111,7 @@ static const std::string lod_label_name[NUM_LOD + 1] =
"I went off the end of the lod_label_name array. Me so smart."
};
class LLModelPreview : public LLViewerDynamicTexture, public LLMutex
class LLModelPreview : public LLViewerDynamicTexture, public LLMutex, public LLHandleProvider<LLModelPreview>
{
LOG_CLASS(LLModelPreview);
@ -217,7 +217,7 @@ protected:
static void stateChangedCallback(U32 state, void* opaque);
static LLJoint* lookupJointByName(const std::string&, void* opaque);
static U32 loadTextures(LLImportMaterial& material, void* opaque);
static U32 loadTextures(LLImportMaterial& material, LLHandle<LLModelPreview> handle);
void lookupLODModelFiles(S32 lod);

View File

@ -804,10 +804,16 @@ void LLSettingsVOSky::applySpecial(void *ptarget, bool force)
static LLCachedControl<F32> sunlight_scale(gSavedSettings, "RenderSkySunlightScale", 1.5f);
static LLCachedControl<F32> sunlight_hdr_scale(gSavedSettings, "RenderHDRSkySunlightScale", 1.5f);
static LLCachedControl<F32> ambient_scale(gSavedSettings, "RenderSkyAmbientScale", 1.5f);
static LLCachedControl<F32> tonemap_mix_setting(gSavedSettings, "RenderTonemapMix", 1.f);
// sky is a "classic" sky following pre SL 7.0 shading
bool classic_mode = psky->canAutoAdjust();
if (!classic_mode)
{
psky->setTonemapMix(tonemap_mix_setting);
}
shader->uniform1f(LLShaderMgr::SKY_SUNLIGHT_SCALE, hdr ? sunlight_hdr_scale : sunlight_scale);
shader->uniform1f(LLShaderMgr::SKY_AMBIENT_SCALE, ambient_scale);
shader->uniform1i(LLShaderMgr::CLASSIC_MODE, classic_mode);

View File

@ -2752,7 +2752,7 @@ S32 LLTextureFetch::createRequest(FTType f_type, const std::string& url, const L
LL_PROFILE_ZONE_SCOPED;
if (mDebugPause)
{
return -1;
return CREATE_REQUEST_ERROR_DEFAULT;
}
if (f_type == FTT_SERVER_BAKE)
@ -2768,7 +2768,7 @@ S32 LLTextureFetch::createRequest(FTType f_type, const std::string& url, const L
<< host << " != " << worker->mHost << LL_ENDL;
removeRequest(worker, true);
worker = NULL;
return -1;
return CREATE_REQUEST_ERROR_MHOSTS;
}
}
@ -2821,13 +2821,13 @@ S32 LLTextureFetch::createRequest(FTType f_type, const std::string& url, const L
{
if (worker->wasAborted())
{
return -1; // need to wait for previous aborted request to complete
return CREATE_REQUEST_ERROR_ABORTED; // need to wait for previous aborted request to complete
}
worker->lockWorkMutex(); // +Mw
if (worker->mState == LLTextureFetchWorker::DONE && worker->mDesiredSize == llmax(desired_size, TEXTURE_CACHE_ENTRY_SIZE) && worker->mDesiredDiscard == desired_discard) {
worker->unlockWorkMutex(); // -Mw
return -1; // similar request has failed or is in a transitional state
return CREATE_REQUEST_ERROR_TRANSITION; // similar request has finished, failed or is in a transitional state
}
worker->mActiveCount++;
worker->mNeedsAux = needs_aux;
@ -3852,6 +3852,43 @@ S32 LLTextureFetch::getFetchState(const LLUUID& id, F32& data_progress_p, F32& r
return state;
}
// Threads: T*
S32 LLTextureFetch::getLastFetchState(const LLUUID& id, S32& requested_discard, S32& decoded_discard, bool& decoded)
{
LL_PROFILE_ZONE_SCOPED;
S32 state = LLTextureFetchWorker::INVALID;
LLTextureFetchWorker* worker = getWorker(id);
if (worker) // Don't check haveWork, intent is to get whatever is in the worker
{
worker->lockWorkMutex(); // +Mw
state = worker->mState;
requested_discard = worker->mDesiredDiscard;
decoded_discard = worker->mDecodedDiscard;
decoded = worker->mDecoded;
worker->unlockWorkMutex(); // -Mw
}
return state;
}
// Threads: T*
S32 LLTextureFetch::getLastRawImage(const LLUUID& id,
LLPointer<LLImageRaw>& raw, LLPointer<LLImageRaw>& aux)
{
LL_PROFILE_ZONE_SCOPED;
S32 decoded_discard = -1;
LLTextureFetchWorker* worker = getWorker(id);
if (worker && !worker->haveWork() && worker->mDecodedDiscard >= 0)
{
worker->lockWorkMutex(); // +Mw
raw = worker->mRawImage;
aux = worker->mAuxImage;
decoded_discard = worker->mDecodedDiscard;
worker->unlockWorkMutex(); // -Mw
}
return decoded_discard;
}
void LLTextureFetch::dump()
{
LL_INFOS(LOG_TXT) << "LLTextureFetch ACTIVE_HTTP:" << LL_ENDL;

View File

@ -76,6 +76,14 @@ public:
// Threads: Tmain
void shutDownImageDecodeThread();
enum e_crete_request_errors
{
CREATE_REQUEST_ERROR_DEFAULT = -1,
CREATE_REQUEST_ERROR_MHOSTS = -2,
CREATE_REQUEST_ERROR_ABORTED = -3,
CREATE_REQUEST_ERROR_TRANSITION = -4,
};
// Threads: T* (but Tmain mostly)
S32 createRequest(FTType f_type, const std::string& url, const LLUUID& id, const LLHost& host, F32 priority,
S32 w, S32 h, S32 c, S32 discard, bool needs_aux, bool can_use_http);
@ -122,12 +130,20 @@ public:
// get the current fetch state, if any, from the given UUID
S32 getFetchState(const LLUUID& id);
// @return Fetch state of given image and associates statistics
// @return Fetch state of an active given image and associates statistics
// See also getStateString
// Threads: T*
S32 getFetchState(const LLUUID& id, F32& decode_progress_p, F32& requested_priority_p,
U32& fetch_priority_p, F32& fetch_dtime_p, F32& request_dtime_p, bool& can_use_http);
// @return Fetch last state of given image
// Threads: T*
S32 getLastFetchState(const LLUUID& id, S32& requested_discard, S32 &decoded_discard, bool &decoded);
// @return Fetch last raw image
// Threads: T*
S32 getLastRawImage(const LLUUID& id, LLPointer<LLImageRaw>& raw, LLPointer<LLImageRaw>& aux);
// Debug utility - generally not safe
void dump();

View File

@ -331,10 +331,10 @@ static bool handleEnableEmissiveChanged(const LLSD& newvalue)
return handleReleaseGLBufferChanged(newvalue) && handleSetShaderChanged(newvalue);
}
static bool handleEnableClassicMode(const LLSD& newvalue)
static bool handleDisableVintageMode(const LLSD& newvalue)
{
gSavedSettings.setBOOL("RenderEnableEmissiveBuffer", !newvalue.asBoolean());
gSavedSettings.setBOOL("RenderHDREnabled", !newvalue.asBoolean());
gSavedSettings.setBOOL("RenderEnableEmissiveBuffer", newvalue.asBoolean());
gSavedSettings.setBOOL("RenderHDREnabled", newvalue.asBoolean());
return true;
}
@ -1275,7 +1275,7 @@ void settings_setup_listeners()
setting_setup_signal_listener(gSavedSettings, "RenderGlowResolutionPow", handleReleaseGLBufferChanged);
setting_setup_signal_listener(gSavedSettings, "RenderGlowHDR", handleReleaseGLBufferChanged);
setting_setup_signal_listener(gSavedSettings, "RenderEnableEmissiveBuffer", handleEnableEmissiveChanged);
setting_setup_signal_listener(gSavedSettings, "RenderVintageMode", handleEnableClassicMode);
setting_setup_signal_listener(gSavedSettings, "RenderDisableVintageMode", handleDisableVintageMode);
setting_setup_signal_listener(gSavedSettings, "RenderHDREnabled", handleEnableHDR);
setting_setup_signal_listener(gSavedSettings, "RenderGlowNoise", handleSetShaderChanged);
setting_setup_signal_listener(gSavedSettings, "RenderGammaFull", handleSetShaderChanged);

View File

@ -1881,6 +1881,141 @@ void LLViewerFetchedTexture::setBoostLevel(S32 level)
}
}
bool LLViewerFetchedTexture::processFetchResults(S32& desired_discard, S32 current_discard, S32 fetch_discard, F32 decode_priority)
{
// We may have data ready regardless of whether or not we are finished (e.g. waiting on write)
if (mRawImage.notNull())
{
LL_PROFILE_ZONE_NAMED_CATEGORY_TEXTURE("vftuf - has raw image");
LLTexturePipelineTester* tester = (LLTexturePipelineTester*)LLMetricPerformanceTesterBasic::getTester(sTesterName);
if (tester)
{
mIsFetched = true;
tester->updateTextureLoadingStats(this, mRawImage, LLAppViewer::getTextureFetch()->isFromLocalCache(mID));
}
mRawDiscardLevel = fetch_discard;
if ((mRawImage->getDataSize() > 0 && mRawDiscardLevel >= 0) &&
(current_discard < 0 || mRawDiscardLevel < current_discard))
{
LL_PROFILE_ZONE_NAMED_CATEGORY_TEXTURE("vftuf - data good");
// This is going to conflict with Develop, just pick from develop
// where it uses setDimensions instead of setTexelsPerImage
mFullWidth = mRawImage->getWidth() << mRawDiscardLevel;
mFullHeight = mRawImage->getHeight() << mRawDiscardLevel;
setTexelsPerImage();
if (mFullWidth > MAX_IMAGE_SIZE || mFullHeight > MAX_IMAGE_SIZE)
{
//discard all oversized textures.
destroyRawImage();
LL_WARNS() << "oversize, setting as missing" << LL_ENDL;
setIsMissingAsset();
mRawDiscardLevel = INVALID_DISCARD_LEVEL;
mIsFetching = false;
mLastPacketTimer.reset();
}
else
{
mIsRawImageValid = true;
addToCreateTexture();
}
if (mBoostLevel == LLGLTexture::BOOST_ICON)
{
S32 expected_width = mKnownDrawWidth > 0 ? mKnownDrawWidth : DEFAULT_ICON_DIMENSIONS;
S32 expected_height = mKnownDrawHeight > 0 ? mKnownDrawHeight : DEFAULT_ICON_DIMENSIONS;
if (mRawImage && (mRawImage->getWidth() > expected_width || mRawImage->getHeight() > expected_height))
{
// scale oversized icon, no need to give more work to gl
// since we got mRawImage from thread worker and image may be in use (ex: writing cache), make a copy
//
// BOOST_ICON gets scaling because profile icons can have a bunch of different formats, not just j2c
// Might need another pass to use discard for j2c and scaling for everything else.
mRawImage = mRawImage->scaled(expected_width, expected_height);
}
}
if (mBoostLevel == LLGLTexture::BOOST_THUMBNAIL)
{
S32 expected_width = mKnownDrawWidth > 0 ? mKnownDrawWidth : DEFAULT_THUMBNAIL_DIMENSIONS;
S32 expected_height = mKnownDrawHeight > 0 ? mKnownDrawHeight : DEFAULT_THUMBNAIL_DIMENSIONS;
if (mRawImage && (mRawImage->getWidth() > expected_width || mRawImage->getHeight() > expected_height))
{
// scale oversized icon, no need to give more work to gl
// since we got mRawImage from thread worker and image may be in use (ex: writing cache), make a copy
//
// Todo: probably needs to be remade to use discard, all thumbnails are supposed to be j2c,
// so no need to scale, should be posible to use discard to scale image down.
mRawImage = mRawImage->scaled(expected_width, expected_height);
}
}
return true;
}
else
{
LL_PROFILE_ZONE_NAMED_CATEGORY_TEXTURE("vftuf - data not needed");
// Data is ready but we don't need it
// (received it already while fetcher was writing to disk)
destroyRawImage();
return false; // done
}
}
if (!mIsFetching)
{
if ((decode_priority > 0)
&& (mRawDiscardLevel < 0 || mRawDiscardLevel == INVALID_DISCARD_LEVEL)
&& mFetchState > 1) // 1 - initial, make sure fetcher did at least something
{
// We finished but received no data
if (getDiscardLevel() < 0)
{
if (getFTType() != FTT_MAP_TILE)
{
LL_WARNS() << mID
<< " Fetch failure, setting as missing, decode_priority " << decode_priority
<< " mRawDiscardLevel " << mRawDiscardLevel
<< " current_discard " << current_discard
<< " stats " << mLastHttpGetStatus.toHex()
<< " worker state " << mFetchState
<< LL_ENDL;
}
setIsMissingAsset();
desired_discard = -1;
}
else
{
//LL_WARNS() << mID << ": Setting min discard to " << current_discard << LL_ENDL;
if (current_discard >= 0)
{
mMinDiscardLevel = current_discard;
//desired_discard = current_discard;
}
else
{
S32 dis_level = getDiscardLevel();
mMinDiscardLevel = dis_level;
//desired_discard = dis_level;
}
}
destroyRawImage();
}
else if (mRawImage.notNull())
{
// We have data, but our fetch failed to return raw data
// *TODO: FIgure out why this is happening and fix it
// Potentially can happen when TEX_LIST_SCALE and TEX_LIST_STANDARD
// get requested for the same texture id at the same time
// (two textures, one fetcher)
destroyRawImage();
}
}
return true;
}
bool LLViewerFetchedTexture::updateFetch()
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_TEXTURE;
@ -1965,130 +2100,12 @@ bool LLViewerFetchedTexture::updateFetch()
mFetchPriority, mFetchDeltaTime, mRequestDeltaTime, mCanUseHTTP);
}
// We may have data ready regardless of whether or not we are finished (e.g. waiting on write)
if (mRawImage.notNull())
if (!processFetchResults(desired_discard, current_discard, fetch_discard, decode_priority))
{
LL_PROFILE_ZONE_NAMED_CATEGORY_TEXTURE("vftuf - has raw image");
LLTexturePipelineTester* tester = (LLTexturePipelineTester*)LLMetricPerformanceTesterBasic::getTester(sTesterName);
if (tester)
{
mIsFetched = true;
tester->updateTextureLoadingStats(this, mRawImage, LLAppViewer::getTextureFetch()->isFromLocalCache(mID));
}
mRawDiscardLevel = fetch_discard;
if ((mRawImage->getDataSize() > 0 && mRawDiscardLevel >= 0) &&
(current_discard < 0 || mRawDiscardLevel < current_discard))
{
LL_PROFILE_ZONE_NAMED_CATEGORY_TEXTURE("vftuf - data good");
mFullWidth = mRawImage->getWidth() << mRawDiscardLevel;
mFullHeight = mRawImage->getHeight() << mRawDiscardLevel;
setTexelsPerImage();
if(mFullWidth > MAX_IMAGE_SIZE || mFullHeight > MAX_IMAGE_SIZE)
{
//discard all oversized textures.
LL_INFOS() << "Discarding oversized texture, width= "
<< mFullWidth << ", height= "
<< mFullHeight << LL_ENDL;
destroyRawImage();
LL_WARNS() << "oversize, setting as missing" << LL_ENDL;
setIsMissingAsset();
mRawDiscardLevel = INVALID_DISCARD_LEVEL;
mIsFetching = false;
mLastPacketTimer.reset();
}
else
{
mIsRawImageValid = true;
addToCreateTexture();
}
if (mBoostLevel == LLGLTexture::BOOST_ICON)
{
S32 expected_width = mKnownDrawWidth > 0 ? mKnownDrawWidth : DEFAULT_ICON_DIMENSIONS;
S32 expected_height = mKnownDrawHeight > 0 ? mKnownDrawHeight : DEFAULT_ICON_DIMENSIONS;
if (mRawImage && (mRawImage->getWidth() > expected_width || mRawImage->getHeight() > expected_height))
{
// scale oversized icon, no need to give more work to gl
// since we got mRawImage from thread worker and image may be in use (ex: writing cache), make a copy
mRawImage = mRawImage->scaled(expected_width, expected_height);
}
}
if (mBoostLevel == LLGLTexture::BOOST_THUMBNAIL)
{
S32 expected_width = mKnownDrawWidth > 0 ? mKnownDrawWidth : DEFAULT_THUMBNAIL_DIMENSIONS;
S32 expected_height = mKnownDrawHeight > 0 ? mKnownDrawHeight : DEFAULT_THUMBNAIL_DIMENSIONS;
if (mRawImage && (mRawImage->getWidth() > expected_width || mRawImage->getHeight() > expected_height))
{
// scale oversized icon, no need to give more work to gl
// since we got mRawImage from thread worker and image may be in use (ex: writing cache), make a copy
mRawImage = mRawImage->scaled(expected_width, expected_height);
}
}
return true;
}
else
{
LL_PROFILE_ZONE_NAMED_CATEGORY_TEXTURE("vftuf - data not needed");
// Data is ready but we don't need it
// (received it already while fetcher was writing to disk)
destroyRawImage();
return false; // done
}
return false;
}
if (!mIsFetching)
{
if ((decode_priority > 0)
&& (mRawDiscardLevel < 0 || mRawDiscardLevel == INVALID_DISCARD_LEVEL)
&& mFetchState > 1) // 1 - initial, make sure fetcher did at least something
{
// We finished but received no data
if (getDiscardLevel() < 0)
{
if (getFTType() != FTT_MAP_TILE)
{
LL_WARNS() << mID
<< " Fetch failure, setting as missing, decode_priority " << decode_priority
<< " mRawDiscardLevel " << mRawDiscardLevel
<< " current_discard " << current_discard
<< " stats " << mLastHttpGetStatus.toHex()
<< " worker state " << mFetchState
<< LL_ENDL;
}
setIsMissingAsset();
desired_discard = -1;
}
else
{
//LL_WARNS() << mID << ": Setting min discard to " << current_discard << LL_ENDL;
if(current_discard >= 0)
{
mMinDiscardLevel = current_discard;
//desired_discard = current_discard;
}
else
{
S32 dis_level = getDiscardLevel();
mMinDiscardLevel = dis_level;
//desired_discard = dis_level;
}
}
destroyRawImage();
}
else if (mRawImage.notNull())
{
// We have data, but our fetch failed to return raw data
// *TODO: FIgure out why this is happening and fix it
// Potentially can happen when TEX_LIST_SCALE and TEX_LIST_STANDARD
// get requested for the same texture id at the same time
// (two textures, one fetcher)
destroyRawImage();
}
}
else
if (mIsFetching)
{
static const F32 MAX_HOLD_TIME = 5.0f; //seconds to wait before canceling fecthing if decode_priority is 0.f.
if(decode_priority > 0.0f || mStopFetchingTimer.getElapsedTimeF32() > MAX_HOLD_TIME)
@ -2167,21 +2184,49 @@ bool LLViewerFetchedTexture::updateFetch()
}
// bypass texturefetch directly by pulling from LLTextureCache
S32 fetch_request_discard = -1;
fetch_request_discard = LLAppViewer::getTextureFetch()->createRequest(mFTType, mUrl, getID(), getTargetHost(), decode_priority,
S32 fetch_request_response = -1;
S32 worker_discard = -1;
fetch_request_response = LLAppViewer::getTextureFetch()->createRequest(mFTType, mUrl, getID(), getTargetHost(), decode_priority,
w, h, c, desired_discard, needsAux(), mCanUseHTTP);
if (fetch_request_discard >= 0)
if (fetch_request_response >= 0) // positive values and 0 are discard values
{
LL_PROFILE_ZONE_NAMED_CATEGORY_TEXTURE("vftuf - request created");
mHasFetcher = true;
mIsFetching = true;
// in some cases createRequest can modify discard, as an example
// bake textures are always at discard 0
mRequestedDiscardLevel = llmin(desired_discard, fetch_request_discard);
mRequestedDiscardLevel = llmin(desired_discard, fetch_request_response);
mFetchState = LLAppViewer::getTextureFetch()->getFetchState(mID, mDownloadProgress, mRequestedDownloadPriority,
mFetchPriority, mFetchDeltaTime, mRequestDeltaTime, mCanUseHTTP);
}
else if (fetch_request_response == LLTextureFetch::CREATE_REQUEST_ERROR_TRANSITION)
{
LL_PROFILE_ZONE_NAMED_CATEGORY_TEXTURE("vftuf - processing transition error");
// Request wasn't created because similar one finished or is in a transitional state, check worker state
// As an example can happen if an image (like a server bake always fetches at dis 0), was scaled down to
// needed discard after fetching then sudenly needed higher dis and worker wasn't yet deleted. Worker
// discard will be identical to requested one and worker will have nothing new to do despite GL image
// not being up to data.
S32 desired_discard;
S32 decoded_discard;
bool decoded;
S32 fetch_state = LLAppViewer::getTextureFetch()->getLastFetchState(mID, desired_discard, decoded_discard, decoded);
if (fetch_state > 1 && decoded && decoded_discard >=0 && decoded_discard <= desired_discard)
{
// worker actually has the image
if (mRawImage.notNull()) sRawCount--;
if (mAuxRawImage.notNull()) sAuxCount--;
decoded_discard = LLAppViewer::getTextureFetch()->getLastRawImage(getID(), mRawImage, mAuxRawImage);
if (mRawImage.notNull()) sRawCount++;
if (mAuxRawImage.notNull())
{
mHasAux = true;
sAuxCount++;
}
processFetchResults(desired_discard, current_discard, decoded_discard, decode_priority);
}
}
// If createRequest() failed, that means one of two things:
// 1. We're finishing up a request for this UUID, so we
@ -3006,7 +3051,7 @@ void LLViewerLODTexture::processTextureStats()
mDesiredDiscardLevel = 0;
}
// Generate the request priority and render priority
else if (mDontDiscard || !mUseMipMaps || (getFTType() == FTT_MAP_TILE))
else if (mDontDiscard || !mUseMipMaps)
{
mDesiredDiscardLevel = 0;
if (mFullWidth > MAX_IMAGE_SIZE_DEFAULT || mFullHeight > MAX_IMAGE_SIZE_DEFAULT)

View File

@ -457,6 +457,8 @@ private:
void init(bool firstinit) ;
void cleanup() ;
bool processFetchResults(S32& desired_discard, S32 current_discard, S32 fetch_discard, F32 decode_priority);
void saveRawImage() ;
private:

View File

@ -919,8 +919,10 @@ void LLVOVolume::updateTextureVirtualSize(bool forced)
for (S32 i = 0; i < num_faces; i++)
{
LLFace* face = mDrawable->getFace(i);
if (!face) continue;
if (!face || face->mExtents[0].equals3(face->mExtents[1])) continue;
const LLTextureEntry *te = face->getTextureEntry();
if (!te) continue;
LLViewerTexture *imagep = nullptr;
U32 ch_min;
U32 ch_max;
@ -939,8 +941,7 @@ void LLVOVolume::updateTextureVirtualSize(bool forced)
// Get _a_ non-null texture if possible (usually diffuse/basecolor, but could be something else)
imagep = face->getTexture(ch);
}
if (!imagep || !te ||
face->mExtents[0].equals3(face->mExtents[1]))
if (!imagep)
{
continue;
}

View File

@ -7292,8 +7292,6 @@ void LLPipeline::tonemap(LLRenderTarget* src, LLRenderTarget* dst)
static LLCachedControl<U32> tonemap_type_setting(gSavedSettings, "RenderTonemapType", 0U);
shader.uniform1i(tonemap_type, tonemap_type_setting);
static LLCachedControl<F32> tonemap_mix_setting(gSavedSettings, "RenderTonemapMix", 1.f);
shader.uniform1f(tonemap_mix, psky->getTonemapMix());
mScreenTriangleVB->setBuffer();
@ -8737,6 +8735,7 @@ void LLPipeline::renderDeferredLighting()
std::list<LLVector4> fullscreen_lights;
LLDrawable::drawable_list_t spot_lights;
LLDrawable::drawable_list_t fullscreen_spot_lights;
LLSettingsSky::ptr_t psky = LLEnvironment::instance().getCurrentSky();
if (!gCubeSnapshot)
{
@ -8838,6 +8837,8 @@ void LLPipeline::renderDeferredLighting()
gDeferredLightProgram.uniform1f(LLShaderMgr::LIGHT_SIZE, s);
gDeferredLightProgram.uniform3fv(LLShaderMgr::DIFFUSE_COLOR, 1, col.mV);
gDeferredLightProgram.uniform1f(LLShaderMgr::LIGHT_FALLOFF, volume->getLightFalloff(DEFERRED_LIGHT_FALLOFF));
gDeferredLightProgram.uniform1i(LLShaderMgr::CLASSIC_MODE, (psky->canAutoAdjust()) ? 1 : 0);
gGL.syncMatrices();
mCubeVB->drawRange(LLRender::TRIANGLE_FAN, 0, 7, 8, get_box_fan_indices(camera, center));
@ -8898,6 +8899,8 @@ void LLPipeline::renderDeferredLighting()
gDeferredSpotLightProgram.uniform1f(LLShaderMgr::LIGHT_SIZE, s);
gDeferredSpotLightProgram.uniform3fv(LLShaderMgr::DIFFUSE_COLOR, 1, col.mV);
gDeferredSpotLightProgram.uniform1f(LLShaderMgr::LIGHT_FALLOFF, volume->getLightFalloff(DEFERRED_LIGHT_FALLOFF));
gDeferredSpotLightProgram.uniform1i(LLShaderMgr::CLASSIC_MODE, (psky->canAutoAdjust()) ? 1 : 0);
gGL.syncMatrices();
mCubeVB->drawRange(LLRender::TRIANGLE_FAN, 0, 7, 8, get_box_fan_indices(camera, center));
@ -8936,6 +8939,7 @@ void LLPipeline::renderDeferredLighting()
gDeferredMultiLightProgram[idx].uniform4fv(LLShaderMgr::MULTI_LIGHT, count, (GLfloat*)light);
gDeferredMultiLightProgram[idx].uniform4fv(LLShaderMgr::MULTI_LIGHT_COL, count, (GLfloat*)col);
gDeferredMultiLightProgram[idx].uniform1f(LLShaderMgr::MULTI_LIGHT_FAR_Z, far_z);
gDeferredMultiLightProgram[idx].uniform1i(LLShaderMgr::CLASSIC_MODE, (psky->canAutoAdjust()) ? 1 : 0);
far_z = 0.f;
count = 0;
mScreenTriangleVB->setBuffer();
@ -8973,6 +8977,8 @@ void LLPipeline::renderDeferredLighting()
gDeferredMultiSpotLightProgram.uniform1f(LLShaderMgr::LIGHT_SIZE, light_size_final);
gDeferredMultiSpotLightProgram.uniform3fv(LLShaderMgr::DIFFUSE_COLOR, 1, col.mV);
gDeferredMultiSpotLightProgram.uniform1f(LLShaderMgr::LIGHT_FALLOFF, light_falloff_final);
gDeferredMultiSpotLightProgram.uniform1i(LLShaderMgr::CLASSIC_MODE, (psky->canAutoAdjust()) ? 1 : 0);
mScreenTriangleVB->drawArrays(LLRender::TRIANGLES, 0, 3);
}

View File

@ -223,7 +223,7 @@
<text name="Miscellaneous Rendering">
Sonstige Darstellungsoptionen:
</text>
<check_box label="Vintage-Modus" tool_tip="Deaktiviert diverse Features der Rendering-Pipeline um die Leistung auf älteren Maschinen zu verbessern und nähert das Aussehen der Welt näher an das Aussehen vor Version 7 an." name="RenderVintageMode"/>
<check_box label="HDR und Emissive" tool_tip="Aktiviert zusätzliche Features der Rendering-Pipeline auf neueren Maschinen, wie HDR und Emissive-Texturen auf PBR-Materialien." name="VintageMode"/>
<check_box label="Alpha-Masken verwenden" tool_tip="Falls aktiviert werden Alpha-Masken korrekt dargestellt." name="RenderAutoMaskAlphaDeferred"/>
<check_box label="Leuchten anzeigen" tool_tip="Stellt Leuchteffekte dar. Stärke muss auf 0 gesetzt werden, um Leuchteffekte zu deaktiveren, falls Schatten aktiviert sind." name="RenderGlow"/>
<slider label="Stärke:" tool_tip="Leuchtstärke. Größer = Breitere und weichere Darstellung (Standardwert: 2)" name="glow_strength"/>

View File

@ -685,10 +685,10 @@
</check_box>
<check_box
control_name="RenderVintageMode"
control_name="RenderDisableVintageMode"
height="16"
initial_value="false"
label="Vintage Mode"
label="HDR and Emissive"
layout="topleft"
left="420"
name="VintageMode"

View File

@ -754,7 +754,7 @@
<slider
control_name="RenderExposure"
disabled_control="RenderVintageMode"
disabled_control="RenderDisableVintageMode"
decimal_digits="1"
follows="left|top"
height="15"
@ -1421,14 +1421,14 @@ If you do not understand the distinction then leave this control alone."
Miscellaneous Rendering:
</text>
<check_box
control_name="RenderVintageMode"
control_name="RenderDisableVintageMode"
height="16"
initial_value="false"
label="Vintage Mode"
tool_tip="Disable different rendering pipeline features to improve performance on older machines that makes the world look closer to how it used to prior to V7."
label="HDR and Emissive"
tool_tip="Enables additional rendering pipeline features on newer machines such as HDR and emissive textures on PBR content."
layout="topleft"
left_delta="10"
name="RenderVintageMode"
name="VintageMode"
top_pad="6"
width="256">
<check_box.commit_callback