Merge remote-tracking branch 'origin/release/materials_featurette' into project/gltf_development

master
Brad Linden 2024-06-04 17:39:39 -07:00
commit 7889df945b
14 changed files with 146 additions and 109 deletions

View File

@ -2887,11 +2887,11 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors</string>
<key>archive</key> <key>archive</key>
<map> <map>
<key>hash</key> <key>hash</key>
<string>9e0092c6a3aed1cb40a9e26df689c42c68142c9d</string> <string>8278a2368136cb12319ca00e7aceb2829bf3ebd8</string>
<key>hash_algorithm</key> <key>hash_algorithm</key>
<string>sha1</string> <string>sha1</string>
<key>url</key> <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> </map>
<key>name</key> <key>name</key>
<string>common</string> <string>common</string>

View File

@ -246,7 +246,7 @@ Ansariel Hiller
SL-4126 SL-4126
SL-20224 SL-20224
SL-20524 SL-20524
https://github.com/secondlife/viewer/issues/1051 secondlife/viewer#1051
Aralara Rajal Aralara Rajal
Arare Chantilly Arare Chantilly
CHUIBUG-191 CHUIBUG-191

View File

@ -494,45 +494,70 @@ void LLAvatarAppearance::computeBodySize()
mCurrBodySizeState["mAnkleLeft scale"] = mAnkleLeftp->getScale(); mCurrBodySizeState["mAnkleLeft scale"] = mAnkleLeftp->getScale();
mCurrBodySizeState["mFootLeft pos"] = mFootLeftp->getPosition(); mCurrBodySizeState["mFootLeft pos"] = mFootLeftp->getPosition();
F32 old_height = mBodySize.mV[VZ]; LLVector3 pelvis_scale = mPelvisp->getScale();
// some of the joints have not been cached
LLVector3 skull = mSkullp->getPosition();
//LLVector3 skull_scale = mSkullp->getScale();
LLVector3 neck = mNeckp->getPosition();
LLVector3 neck_scale = mNeckp->getScale();
LLVector3 chest = mChestp->getPosition();
LLVector3 chest_scale = mChestp->getScale();
// the rest of the joints have been cached
LLVector3 head = mHeadp->getPosition();
LLVector3 head_scale = mHeadp->getScale();
LLVector3 torso = mTorsop->getPosition();
LLVector3 torso_scale = mTorsop->getScale();
LLVector3 hip = mHipLeftp->getPosition();
LLVector3 hip_scale = mHipLeftp->getScale();
LLVector3 knee = mKneeLeftp->getPosition();
LLVector3 knee_scale = mKneeLeftp->getScale();
LLVector3 ankle = mAnkleLeftp->getPosition();
LLVector3 ankle_scale = mAnkleLeftp->getScale();
LLVector3 foot = mFootLeftp->getPosition();
F32 old_offset = mAvatarOffset.mV[VZ]; F32 old_offset = mAvatarOffset.mV[VZ];
// TODO: Measure the real depth and width mAvatarOffset.mV[VZ] = getVisualParamWeight(AVATAR_HOVER);
mPelvisToFoot = computePelvisToFoot();
F32 new_height = computeBodyHeight();
mBodySize.set(DEFAULT_AGENT_DEPTH, DEFAULT_AGENT_WIDTH, new_height);
F32 new_offset = getVisualParamWeight(AVATAR_HOVER);
mAvatarOffset.set(0, 0, new_offset);
if (mBodySize.mV[VZ] != old_height || new_offset != old_offset) mPelvisToFoot = hip.mV[VZ] * pelvis_scale.mV[VZ] -
knee.mV[VZ] * hip_scale.mV[VZ] -
ankle.mV[VZ] * knee_scale.mV[VZ] -
foot.mV[VZ] * ankle_scale.mV[VZ];
LLVector3 new_body_size;
new_body_size.mV[VZ] = mPelvisToFoot +
// the sqrt(2) correction below is an approximate
// correction to get to the top of the head
F_SQRT2 * (skull.mV[VZ] * head_scale.mV[VZ]) +
head.mV[VZ] * neck_scale.mV[VZ] +
neck.mV[VZ] * chest_scale.mV[VZ] +
chest.mV[VZ] * torso_scale.mV[VZ] +
torso.mV[VZ] * pelvis_scale.mV[VZ];
// TODO -- measure the real depth and width
new_body_size.mV[VX] = DEFAULT_AGENT_DEPTH;
new_body_size.mV[VY] = DEFAULT_AGENT_WIDTH;
mAvatarOffset.mV[VX] = 0.0f;
mAvatarOffset.mV[VY] = 0.0f;
if (new_body_size != mBodySize || old_offset != mAvatarOffset.mV[VZ])
{ {
mBodySize = new_body_size;
compareJointStateMaps(mLastBodySizeState, mCurrBodySizeState); compareJointStateMaps(mLastBodySizeState, mCurrBodySizeState);
} }
} }
F32 LLAvatarAppearance::computeBodyHeight()
{
F32 result = mPelvisToFoot +
// all these relative positions usually are positive
mPelvisp->getScale().mV[VZ] * mTorsop->getPosition().mV[VZ] +
mTorsop->getScale().mV[VZ] * mChestp->getPosition().mV[VZ] +
mChestp->getScale().mV[VZ] * mNeckp->getPosition().mV[VZ] +
mNeckp->getScale().mV[VZ] * mHeadp->getPosition().mV[VZ] +
mHeadp->getScale().mV[VZ] * mSkullp->getPosition().mV[VZ] * 2;
return result;
}
F32 LLAvatarAppearance::computePelvisToFoot()
{
F32 result =
// all these relative positions usually are negative
mPelvisp->getScale().mV[VZ] * mHipLeftp->getPosition().mV[VZ] +
mHipLeftp->getScale().mV[VZ] * mKneeLeftp->getPosition().mV[VZ] +
mKneeLeftp->getScale().mV[VZ] * mAnkleLeftp->getPosition().mV[VZ] +
mAnkleLeftp->getScale().mV[VZ] * mFootLeftp->getPosition().mV[VZ] / 2;
return -result;
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// parseSkeletonFile() // parseSkeletonFile()
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------

View File

@ -147,8 +147,6 @@ public:
void compareJointStateMaps(joint_state_map_t& last_state, void compareJointStateMaps(joint_state_map_t& last_state,
joint_state_map_t& curr_state); joint_state_map_t& curr_state);
void computeBodySize(); void computeBodySize();
F32 computeBodyHeight();
F32 computePelvisToFoot();
public: public:
typedef std::vector<LLAvatarJoint*> avatar_joint_list_t; typedef std::vector<LLAvatarJoint*> avatar_joint_list_t;

View File

@ -142,18 +142,9 @@ vec2 getScreenCoordinate(vec2 screenpos)
} }
vec4 getNorm(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); vec4 norm = texture(normalMap, screenpos.xy);
n = norm.xyz; norm.xyz = normalize(norm.xyz);
envIntensity = texture(emissiveRect, screenpos.xy).r;
return norm; return norm;
} }

View File

@ -193,7 +193,7 @@ void main()
rm_factors[3] = vec2(roughnessFactors.w, metallicFactors.w); rm_factors[3] = vec2(roughnessFactors.w, metallicFactors.w);
#endif #endif
PBRMix mix = init_pbr_mix(); PBRMix pbr_mix = init_pbr_mix();
PBRMix mix2; PBRMix mix2;
TerrainCoord terrain_texcoord; TerrainCoord terrain_texcoord;
switch (tm.type & MIX_X) switch (tm.type & MIX_X)
@ -233,7 +233,7 @@ void main()
#if (TERRAIN_PBR_DETAIL >= TERRAIN_PBR_DETAIL_NORMAL) #if (TERRAIN_PBR_DETAIL >= TERRAIN_PBR_DETAIL_NORMAL)
mix2.vNt = mikktspace(mix2.vNt, vary_tangents[0]); mix2.vNt = mikktspace(mix2.vNt, vary_tangents[0]);
#endif #endif
mix = mix_pbr(mix, mix2, tm.weight.x); pbr_mix = mix_pbr(mix, mix2, tm.weight.x);
break; break;
default: default:
break; break;
@ -275,7 +275,7 @@ void main()
#if (TERRAIN_PBR_DETAIL >= TERRAIN_PBR_DETAIL_NORMAL) #if (TERRAIN_PBR_DETAIL >= TERRAIN_PBR_DETAIL_NORMAL)
mix2.vNt = mikktspace(mix2.vNt, vary_tangents[1]); mix2.vNt = mikktspace(mix2.vNt, vary_tangents[1]);
#endif #endif
mix = mix_pbr(mix, mix2, tm.weight.y); pbr_mix = mix_pbr(mix, mix2, tm.weight.y);
break; break;
default: default:
break; break;
@ -317,7 +317,7 @@ void main()
#if (TERRAIN_PBR_DETAIL >= TERRAIN_PBR_DETAIL_NORMAL) #if (TERRAIN_PBR_DETAIL >= TERRAIN_PBR_DETAIL_NORMAL)
mix2.vNt = mikktspace(mix2.vNt, vary_tangents[2]); mix2.vNt = mikktspace(mix2.vNt, vary_tangents[2]);
#endif #endif
mix = mix_pbr(mix, mix2, tm.weight.z); pbr_mix = mix_pbr(mix, mix2, tm.weight.z);
break; break;
default: default:
break; break;
@ -359,21 +359,21 @@ void main()
#if (TERRAIN_PBR_DETAIL >= TERRAIN_PBR_DETAIL_NORMAL) #if (TERRAIN_PBR_DETAIL >= TERRAIN_PBR_DETAIL_NORMAL)
mix2.vNt = mikktspace(mix2.vNt, vary_tangents[3]); mix2.vNt = mikktspace(mix2.vNt, vary_tangents[3]);
#endif #endif
mix = mix_pbr(mix, mix2, tm.weight.w); pbr_mix = mix_pbr(mix, mix2, tm.weight.w);
break; break;
default: default:
break; break;
} }
float minimum_alpha = terrain_mix(tm, minimum_alphas); float minimum_alpha = terrain_mix(tm, minimum_alphas);
if (mix.col.a < minimum_alpha) if (pbr_mix.col.a < minimum_alpha)
{ {
discard; discard;
} }
float base_color_factor_alpha = terrain_mix(tm, vec4(baseColorFactors[0].z, baseColorFactors[1].z, baseColorFactors[2].z, baseColorFactors[3].z)); float base_color_factor_alpha = terrain_mix(tm, vec4(baseColorFactors[0].z, baseColorFactors[1].z, baseColorFactors[2].z, baseColorFactors[3].z));
#if (TERRAIN_PBR_DETAIL >= TERRAIN_PBR_DETAIL_NORMAL) #if (TERRAIN_PBR_DETAIL >= TERRAIN_PBR_DETAIL_NORMAL)
vec3 tnorm = normalize(mix.vNt); vec3 tnorm = normalize(pbr_mix.vNt);
#else #else
vec3 tnorm = vary_normal; vec3 tnorm = vary_normal;
#endif #endif
@ -381,21 +381,21 @@ void main()
#if (TERRAIN_PBR_DETAIL >= TERRAIN_PBR_DETAIL_EMISSIVE) #if (TERRAIN_PBR_DETAIL >= TERRAIN_PBR_DETAIL_EMISSIVE)
#define emissive mix.emissive #define mix_emissive pbr_mix.emissive
#else #else
#define emissive vec3(0) #define mix_emissive vec3(0)
#endif #endif
#if (TERRAIN_PBR_DETAIL >= TERRAIN_PBR_DETAIL_OCCLUSION) #if (TERRAIN_PBR_DETAIL >= TERRAIN_PBR_DETAIL_OCCLUSION)
#define orm mix.orm #define mix_orm pbr_mix.orm
#elif (TERRAIN_PBR_DETAIL >= TERRAIN_PBR_DETAIL_METALLIC_ROUGHNESS) #elif (TERRAIN_PBR_DETAIL >= TERRAIN_PBR_DETAIL_METALLIC_ROUGHNESS)
#define orm vec3(1.0, mix.rm) #define mix_orm vec3(1.0, pbr_mix.rm)
#else #else
// Matte plastic potato terrain // Matte plastic potato terrain
#define orm vec3(1.0, 1.0, 0.0) #define mix_orm vec3(1.0, 1.0, 0.0)
#endif #endif
frag_data[0] = max(vec4(mix.col.xyz, 0.0), vec4(0)); // Diffuse frag_data[0] = max(vec4(pbr_mix.col.xyz, 0.0), vec4(0)); // Diffuse
frag_data[1] = max(vec4(orm.rgb, base_color_factor_alpha), vec4(0)); // PBR linear packed Occlusion, Roughness, Metal. frag_data[1] = max(vec4(mix_orm.rgb, base_color_factor_alpha), vec4(0)); // PBR linear packed Occlusion, Roughness, Metal.
frag_data[2] = vec4(tnorm, GBUFFER_FLAG_HAS_PBR); // normal, flags frag_data[2] = vec4(tnorm, GBUFFER_FLAG_HAS_PBR); // normal, flags
frag_data[3] = max(vec4(emissive,0), vec4(0)); // PBR sRGB Emissive frag_data[3] = max(vec4(mix_emissive,0), vec4(0)); // PBR sRGB Emissive
} }

View File

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

View File

@ -175,7 +175,7 @@ S32 LLAgentBenefits::getTextureUploadCost(const LLViewerTexture* tex) const
return getTextureUploadCost(); return getTextureUploadCost();
} }
} }
return getTextureUploadCost(); return 0;
} }
S32 LLAgentBenefits::getTextureUploadCost(const LLImageBase* tex) const S32 LLAgentBenefits::getTextureUploadCost(const LLImageBase* tex) const

View File

@ -75,7 +75,7 @@ LLHeroProbeManager::~LLHeroProbeManager()
// helper class to seed octree with probes // helper class to seed octree with probes
void LLHeroProbeManager::update() void LLHeroProbeManager::update()
{ {
if (!LLPipeline::RenderMirrors || gTeleportDisplay || LLStartUp::getStartupState() < STATE_PRECACHE) if (!LLPipeline::RenderMirrors || !LLPipeline::sReflectionProbesEnabled || gTeleportDisplay || LLStartUp::getStartupState() < STATE_PRECACHE)
{ {
return; return;
} }
@ -112,7 +112,6 @@ void LLHeroProbeManager::update()
LLVector4a probe_pos; LLVector4a probe_pos;
LLVector3 camera_pos = LLViewerCamera::instance().mOrigin; LLVector3 camera_pos = LLViewerCamera::instance().mOrigin;
F32 near_clip = 0.1f;
bool probe_present = false; bool probe_present = false;
LLQuaternion cameraOrientation = LLViewerCamera::instance().getQuaternion(); LLQuaternion cameraOrientation = LLViewerCamera::instance().getQuaternion();
LLVector3 cameraDirection = LLVector3::z_axis * cameraOrientation; LLVector3 cameraDirection = LLVector3::z_axis * cameraOrientation;
@ -124,7 +123,7 @@ void LLHeroProbeManager::update()
float camera_center_distance = 99999.f; float camera_center_distance = 99999.f;
for (auto vo : mHeroVOList) 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 distance = (LLViewerCamera::instance().getOrigin() - vo->getPositionAgent()).magVec();
float center_distance = cameraDirection * (vo->getPositionAgent() - camera_pos); float center_distance = cameraDirection * (vo->getPositionAgent() - camera_pos);
@ -192,20 +191,15 @@ void LLHeroProbeManager::update()
// Iterate through each face of the cube // Iterate through each face of the cube
for (int i = 0; i < 6; i++) for (int i = 0; i < 6; i++)
{ {
float cube_facing = fmax(-1, fmin(1.0f, cameraDirection * cubeFaces[i])) * 0.6 + 0.4; float cube_facing = fmax(-1, fmin(1.0f, cameraDirection * cubeFaces[i]));
float updateRate; cube_facing = 1 - cube_facing;
if (cube_facing < 0.1f)
{ mFaceUpdateList[i] = ceilf(cube_facing * gPipeline.RenderHeroProbeConservativeUpdateMultiplier);
updateRate = 0;
}
else
{
updateRate = ceilf(cube_facing * gPipeline.RenderHeroProbeConservativeUpdateMultiplier);
} }
mFaceUpdateList[i] = updateRate;
} mProbes[0]->mOrigin = probe_pos;
} }
else else
{ {
@ -214,20 +208,24 @@ void LLHeroProbeManager::update()
mHeroProbeStrength = 1; mHeroProbeStrength = 1;
} }
else
{
probe_pos.load3(camera_pos.mV);
} }
void LLHeroProbeManager::renderProbes()
{
if (!LLPipeline::RenderMirrors || !LLPipeline::sReflectionProbesEnabled || gTeleportDisplay ||
LLStartUp::getStartupState() < STATE_PRECACHE)
{
return;
}
static LLCachedControl<S32> sDetail(gSavedSettings, "RenderHeroReflectionProbeDetail", -1); static LLCachedControl<S32> sDetail(gSavedSettings, "RenderHeroReflectionProbeDetail", -1);
static LLCachedControl<S32> sLevel(gSavedSettings, "RenderHeroReflectionProbeLevel", 3); static LLCachedControl<S32> sLevel(gSavedSettings, "RenderHeroReflectionProbeLevel", 3);
if (mNearestHero != nullptr) F32 near_clip = 0.01f;
if (mNearestHero != nullptr && (gPipeline.RenderHeroProbeUpdateRate == 0 || (gFrameCount % gPipeline.RenderHeroProbeUpdateRate) == 0) &&
!gTeleportDisplay && !gDisconnected && !LLAppViewer::instance()->logoutRequestSent())
{ {
LL_PROFILE_ZONE_NAMED_CATEGORY_DISPLAY("hpmu - realtime"); LL_PROFILE_ZONE_NAMED_CATEGORY_DISPLAY("hpmu - realtime");
// Probe 0 is always our mirror probe.
mProbes[0]->mOrigin = probe_pos;
bool radiance_pass = gPipeline.mReflectionMapManager.isRadiancePass(); bool radiance_pass = gPipeline.mReflectionMapManager.isRadiancePass();
@ -585,8 +583,6 @@ void LLHeroProbeManager::cleanup()
mDefaultProbe = nullptr; mDefaultProbe = nullptr;
mUpdatingProbe = nullptr; mUpdatingProbe = nullptr;
/*
*/
} }
void LLHeroProbeManager::doOcclusion() void LLHeroProbeManager::doOcclusion()

View File

@ -68,6 +68,8 @@ public:
// maintain reflection probes // maintain reflection probes
void update(); void update();
void renderProbes();
// debug display, called from llspatialpartition if reflection // debug display, called from llspatialpartition if reflection
// probe debug display is active // probe debug display is active
void renderDebug(); void renderDebug();
@ -152,5 +154,6 @@ private:
std::vector<LLPointer<LLVOVolume>> mHeroVOList; std::vector<LLPointer<LLVOVolume>> mHeroVOList;
LLPointer<LLVOVolume> mNearestHero; LLPointer<LLVOVolume> mNearestHero;
}; };

View File

@ -489,10 +489,7 @@ bool LLMaterialEditor::postBuild()
} }
else else
{ {
getChild<LLUICtrl>("base_color_upload_fee")->setTextArg("[FEE]", llformat("%d", LLAgentBenefitsMgr::current().getTextureUploadCost(mBaseColorFetched))); refreshUploadCost();
getChild<LLUICtrl>("metallic_upload_fee")->setTextArg("[FEE]", llformat("%d", LLAgentBenefitsMgr::current().getTextureUploadCost(mMetallicRoughnessFetched)));
getChild<LLUICtrl>("emissive_upload_fee")->setTextArg("[FEE]", llformat("%d", LLAgentBenefitsMgr::current().getTextureUploadCost(mEmissiveFetched)));
getChild<LLUICtrl>("normal_upload_fee")->setTextArg("[FEE]", llformat("%d", LLAgentBenefitsMgr::current().getTextureUploadCost(mNormalFetched)));
} }
boost::function<void(LLUICtrl*, void*)> changes_callback = [this](LLUICtrl * ctrl, void* userData) boost::function<void(LLUICtrl*, void*)> changes_callback = [this](LLUICtrl * ctrl, void* userData)
@ -811,6 +808,37 @@ void LLMaterialEditor::resetUnsavedChanges()
} }
} }
void LLMaterialEditor::refreshUploadCost()
{
mExpectedUploadCost = 0;
if (mBaseColorTextureUploadId.notNull() && mBaseColorTextureUploadId == getBaseColorId() && mBaseColorFetched)
{
S32 upload_cost = LLAgentBenefitsMgr::current().getTextureUploadCost(mBaseColorFetched);
mExpectedUploadCost += upload_cost;
getChild<LLUICtrl>("base_color_upload_fee")->setTextArg("[FEE]", llformat("%d", upload_cost));
}
if (mMetallicTextureUploadId.notNull() && mMetallicTextureUploadId == getMetallicRoughnessId() && mMetallicRoughnessFetched)
{
S32 upload_cost = LLAgentBenefitsMgr::current().getTextureUploadCost(mMetallicRoughnessFetched);
mExpectedUploadCost += upload_cost;
getChild<LLUICtrl>("metallic_upload_fee")->setTextArg("[FEE]", llformat("%d", upload_cost));
}
if (mEmissiveTextureUploadId.notNull() && mEmissiveTextureUploadId == getEmissiveId() && mEmissiveFetched)
{
S32 upload_cost = LLAgentBenefitsMgr::current().getTextureUploadCost(mEmissiveFetched);
mExpectedUploadCost += upload_cost;
getChild<LLUICtrl>("emissive_upload_fee")->setTextArg("[FEE]", llformat("%d", upload_cost));
}
if (mNormalTextureUploadId.notNull() && mNormalTextureUploadId == getNormalId() && mNormalFetched)
{
S32 upload_cost = LLAgentBenefitsMgr::current().getTextureUploadCost(mNormalFetched);
mExpectedUploadCost += upload_cost;
getChild<LLUICtrl>("normal_upload_fee")->setTextArg("[FEE]", llformat("%d", upload_cost));
}
getChild<LLUICtrl>("total_upload_fee")->setTextArg("[FEE]", llformat("%d", mExpectedUploadCost));
}
void LLMaterialEditor::markChangesUnsaved(U32 dirty_flag) void LLMaterialEditor::markChangesUnsaved(U32 dirty_flag)
{ {
mUnsavedChanges |= dirty_flag; mUnsavedChanges |= dirty_flag;
@ -841,25 +869,15 @@ void LLMaterialEditor::markChangesUnsaved(U32 dirty_flag)
setCanSave(false); setCanSave(false);
} }
mExpectedUploadCost = 0; if ((dirty_flag & MATERIAL_BASE_COLOR_TEX_DIRTY)
if (mBaseColorTextureUploadId.notNull() && mBaseColorTextureUploadId == getBaseColorId() && mBaseColorFetched) || (dirty_flag & MATERIAL_NORMAL_TEX_DIRTY)
|| (dirty_flag & MATERIAL_METALLIC_ROUGHTNESS_TEX_DIRTY)
|| (dirty_flag & MATERIAL_EMISIVE_TEX_DIRTY)
|| (dirty_flag == 0)
|| (dirty_flag == U32_MAX))
{ {
mExpectedUploadCost += LLAgentBenefitsMgr::current().getTextureUploadCost(mBaseColorFetched); refreshUploadCost();
} }
if (mMetallicTextureUploadId.notNull() && mMetallicTextureUploadId == getMetallicRoughnessId() && mMetallicRoughnessFetched)
{
mExpectedUploadCost += LLAgentBenefitsMgr::current().getTextureUploadCost(mMetallicRoughnessFetched);
}
if (mEmissiveTextureUploadId.notNull() && mEmissiveTextureUploadId == getEmissiveId() && mEmissiveFetched)
{
mExpectedUploadCost += LLAgentBenefitsMgr::current().getTextureUploadCost(mEmissiveFetched);
}
if (mNormalTextureUploadId.notNull() && mNormalTextureUploadId == getNormalId() && mNormalFetched)
{
mExpectedUploadCost += LLAgentBenefitsMgr::current().getTextureUploadCost(mNormalFetched);
}
getChild<LLUICtrl>("total_upload_fee")->setTextArg("[FEE]", llformat("%d", mExpectedUploadCost));
} }
void LLMaterialEditor::setCanSaveAs(bool value) void LLMaterialEditor::setCanSaveAs(bool value)

View File

@ -288,6 +288,7 @@ private:
// utility function for building a description of the imported material // utility function for building a description of the imported material
// based on what we know about it. // based on what we know about it.
const std::string buildMaterialDescription(); const std::string buildMaterialDescription();
void refreshUploadCost();
void resetUnsavedChanges(); void resetUnsavedChanges();
void markChangesUnsaved(U32 dirty_flag); void markChangesUnsaved(U32 dirty_flag);

View File

@ -401,7 +401,7 @@ void LLPanelVolume::getState( )
getChildView("Probe Dynamic")->setEnabled(probe_enabled); getChildView("Probe Dynamic")->setEnabled(probe_enabled);
getChildView("Probe Update Type")->setEnabled(probe_enabled); getChildView("Probe Update Type")->setEnabled(probe_enabled);
getChildView("Probe Volume Type")->setEnabled(probe_enabled); getChildView("Probe Volume Type")->setEnabled(probe_enabled && !is_mirror);
getChildView("Probe Ambiance")->setEnabled(probe_enabled && !is_mirror); getChildView("Probe Ambiance")->setEnabled(probe_enabled && !is_mirror);
getChildView("Probe Near Clip")->setEnabled(probe_enabled && !is_mirror); getChildView("Probe Near Clip")->setEnabled(probe_enabled && !is_mirror);
getChildView("Probe Update Label")->setEnabled(probe_enabled); getChildView("Probe Update Label")->setEnabled(probe_enabled);
@ -1432,6 +1432,8 @@ void LLPanelVolume::onCommitProbe(LLUICtrl* ctrl, void* userdata)
bool is_mirror = update_type.find("Mirror") != std::string::npos; 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->setReflectionProbeIsDynamic(update_type.find("Dynamic") != std::string::npos);
volobjp->setReflectionProbeIsMirror(is_mirror); volobjp->setReflectionProbeIsMirror(is_mirror);
@ -1440,7 +1442,7 @@ void LLPanelVolume::onCommitProbe(LLUICtrl* ctrl, void* userdata)
std::string shape_type = self->getChild<LLUICtrl>("Probe Volume Type")->getValue().asString(); 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)) if (volobjp->setReflectionProbeIsBox(is_box))
{ {

View File

@ -658,10 +658,11 @@ void display(bool rebuild, F32 zoom_factor, int subfield, bool for_snapshot)
{ {
// Render mirrors and associated hero probes before we render the rest of the scene. // Render mirrors and associated hero probes before we render the rest of the scene.
// This ensures the scene state in the hero probes are exactly the same as the rest of the scene before we render it. // This ensures the scene state in the hero probes are exactly the same as the rest of the scene before we render it.
if (gPipeline.RenderMirrors && !gSnapshot && (gPipeline.RenderHeroProbeUpdateRate == 0 || (gFrameCount % gPipeline.RenderHeroProbeUpdateRate) == 0)) if (gPipeline.RenderMirrors && !gSnapshot)
{ {
LL_PROFILE_ZONE_NAMED_CATEGORY_DISPLAY("Update hero probes"); LL_PROFILE_ZONE_NAMED_CATEGORY_DISPLAY("Update hero probes");
gPipeline.mHeroProbeManager.update(); gPipeline.mHeroProbeManager.update();
gPipeline.mHeroProbeManager.renderProbes();
} }
LL_PROFILE_ZONE_NAMED_CATEGORY_DISPLAY("display - 1"); LL_PROFILE_ZONE_NAMED_CATEGORY_DISPLAY("display - 1");