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

master
Ansariel 2024-06-05 11:25:09 +02:00
commit 6adaf39c13
5 changed files with 16 additions and 20 deletions

View File

@ -3302,11 +3302,11 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors</string>
<key>archive</key>
<map>
<key>hash</key>
<string>9e0092c6a3aed1cb40a9e26df689c42c68142c9d</string>
<string>8278a2368136cb12319ca00e7aceb2829bf3ebd8</string>
<key>hash_algorithm</key>
<string>sha1</string>
<key>url</key>
<string>https://github.com/secondlife/3p-tinyexr/releases/download/v1.0.8-r1/tinyexr-v1.0.8-common-8755737750.tar.zst</string>
<string>https://github.com/secondlife/3p-tinyexr/releases/download/v1.0.8-ba4bc64/tinyexr-v1.0.8-common-9373975608.tar.zst</string>
</map>
<key>name</key>
<string>common</string>

View File

@ -142,18 +142,9 @@ vec2 getScreenCoordinate(vec2 screenpos)
}
vec4 getNorm(vec2 screenpos)
{
return texture(normalMap, screenpos.xy);
}
// return packedNormalEnvIntensityFlags since GBUFFER_FLAG_HAS_PBR needs .w
// See: C++: addDeferredAttachments(), GLSL: softenLightF
vec4 getNormalEnvIntensityFlags(vec2 screenpos, out vec3 n, out float envIntensity)
{
vec4 norm = texture(normalMap, screenpos.xy);
n = norm.xyz;
envIntensity = texture(emissiveRect, screenpos.xy).r;
norm.xyz = normalize(norm.xyz);
return norm;
}

View File

@ -47,7 +47,9 @@ vec2 texgen_object(vec4 vpos, mat4 mat, vec4 tp0, vec4 tp1)
tcoord.x = dot(vpos, tp0);
tcoord.y = dot(vpos, tp1);
tcoord.z = 0;
tcoord.w = 1;
tcoord = mat * tcoord;
return tcoord.xy;

View File

@ -123,7 +123,7 @@ void LLHeroProbeManager::update()
float camera_center_distance = 99999.f;
for (auto vo : mHeroVOList)
{
if (vo && !vo->isDead() && vo->mDrawable.notNull())
if (vo && !vo->isDead() && vo->mDrawable.notNull() && vo->isReflectionProbe() && vo->getReflectionProbeIsBox())
{
float distance = (LLViewerCamera::instance().getOrigin() - vo->getPositionAgent()).magVec();
float center_distance = cameraDirection * (vo->getPositionAgent() - camera_pos);

View File

@ -391,6 +391,7 @@ void LLPanelVolume::getState( )
// Reflection Probe
BOOL is_probe = volobjp && volobjp->isReflectionProbe();
bool is_mirror = volobjp && volobjp->getReflectionProbeIsMirror();
getChild<LLUICtrl>("Reflection Probe")->setValue(is_probe);
getChildView("Reflection Probe")->setEnabled(editable && single_volume && volobjp && !volobjp->isMesh());
@ -404,9 +405,9 @@ void LLPanelVolume::getState( )
getChildView("Probe Dynamic")->setEnabled(probe_enabled);
getChildView("Probe Update Type")->setEnabled(probe_enabled);
getChildView("Probe Volume Type")->setEnabled(probe_enabled);
getChildView("Probe Ambiance")->setEnabled(probe_enabled);
getChildView("Probe Near Clip")->setEnabled(probe_enabled);
getChildView("Probe Volume Type")->setEnabled(probe_enabled && !is_mirror);
getChildView("Probe Ambiance")->setEnabled(probe_enabled && !is_mirror);
getChildView("Probe Near Clip")->setEnabled(probe_enabled && !is_mirror);
getChildView("Probe Update Label")->setEnabled(probe_enabled);
if (!probe_enabled)
@ -445,8 +446,8 @@ void LLPanelVolume::getState( )
update_type = "Dynamic Mirror";
}
getChildView("Probe Ambiance")->setEnabled(update_type != "Mirror");
getChildView("Probe Near Clip")->setEnabled(update_type != "Mirror");
getChildView("Probe Ambiance")->setEnabled(!is_mirror);
getChildView("Probe Near Clip")->setEnabled(!is_mirror);
getChild<LLComboBox>("Probe Volume Type", true)->setValue(volume_type);
getChild<LLSpinCtrl>("Probe Ambiance", true)->setValue(volobjp->getReflectionProbeAmbiance());
@ -1494,6 +1495,8 @@ void LLPanelVolume::onCommitProbe(LLUICtrl* ctrl, void* userdata)
bool is_mirror = update_type.find("Mirror") != std::string::npos;
self->getChildView("Probe Volume Type")->setEnabled(!is_mirror);
volobjp->setReflectionProbeIsDynamic(update_type.find("Dynamic") != std::string::npos);
volobjp->setReflectionProbeIsMirror(is_mirror);
@ -1502,7 +1505,7 @@ void LLPanelVolume::onCommitProbe(LLUICtrl* ctrl, void* userdata)
std::string shape_type = self->getChild<LLUICtrl>("Probe Volume Type")->getValue().asString();
bool is_box = shape_type == "Box";
bool is_box = shape_type == "Box" || is_mirror;
if (volobjp->setReflectionProbeIsBox(is_box))
{