Merge pull request #1353 from Azaezel/alpha41/probeAttention

shift attenuation to probes in general.
This commit is contained in:
Brian Roberts 2025-01-09 08:10:56 -06:00 committed by GitHub
commit 4a8f8302a5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 25 additions and 35 deletions

View file

@ -78,7 +78,6 @@ BoxEnvironmentProbe::BoxEnvironmentProbe() : ReflectionProbe()
{
mCaptureMask = REFLECTION_PROBE_CAPTURE_TYPEMASK;
mProbeShapeType = ProbeInfo::Box;
mAtten = 0.0;
}
BoxEnvironmentProbe::~BoxEnvironmentProbe()
@ -94,8 +93,6 @@ void BoxEnvironmentProbe::initPersistFields()
// SceneObject already handles exposing the transform
Parent::initPersistFields();
addField("attenuation", TypeF32, Offset(mAtten, BoxEnvironmentProbe), "falloff percent");
removeField("radius");
}
@ -127,12 +124,6 @@ U32 BoxEnvironmentProbe::packUpdate(NetConnection *conn, U32 mask, BitStream *st
{
// Allow the Parent to get a crack at writing its info
U32 retMask = Parent::packUpdate(conn, mask, stream);
if (stream->writeFlag(mask & StaticDataMask))
{
stream->write(mAtten);
}
return retMask;
}
@ -141,12 +132,6 @@ void BoxEnvironmentProbe::unpackUpdate(NetConnection *conn, BitStream *stream)
// Let the Parent read any info it sent
Parent::unpackUpdate(conn, stream);
if (stream->readFlag()) // StaticDataMask
{
stream->read(&mAtten);
mDirty = true;
}
if (mDirty)
{
updateProbeParams();
@ -160,8 +145,6 @@ void BoxEnvironmentProbe::unpackUpdate(NetConnection *conn, BitStream *stream)
void BoxEnvironmentProbe::updateProbeParams()
{
mProbeShapeType = ProbeInfo::Box;
mProbeInfo.mAtten = mAtten;
Parent::updateProbeParams();
}

View file

@ -56,7 +56,6 @@ class BaseMatInstance;
class BoxEnvironmentProbe : public ReflectionProbe
{
typedef ReflectionProbe Parent;
F32 mAtten;
private:
//Debug rendering

View file

@ -133,6 +133,7 @@ ReflectionProbe::ReflectionProbe()
mCaptureMask = REFLECTION_PROBE_CAPTURE_TYPEMASK;
mCanDamp = false;
mAtten = 0.0f;
}
ReflectionProbe::~ReflectionProbe()
@ -152,10 +153,11 @@ ReflectionProbe::~ReflectionProbe()
void ReflectionProbe::initPersistFields()
{
docsURL;
addField("canDamp", TypeBool, Offset(mCanDamp, ReflectionProbe),"wetness allowed");
addGroup("Rendering");
addProtectedField("enabled", TypeBool, Offset(mEnabled, ReflectionProbe),
&_setEnabled, &defaultProtectedGetFn, "Is the probe enabled or not");
addField("canDamp", TypeBool, Offset(mCanDamp, ReflectionProbe),"wetness allowed");
addField("attenuation", TypeF32, Offset(mAtten, ReflectionProbe), "falloff percent");
endGroup("Rendering");
addGroup("Reflection");
@ -436,6 +438,7 @@ U32 ReflectionProbe::packUpdate(NetConnection *conn, U32 mask, BitStream *stream
stream->write(mProbeUniqueID);
stream->write((U32)mReflectionModeType);
stream->writeString(mCubemapName);
stream->write(mAtten);
}
if (stream->writeFlag(mask & EnabledMask))
@ -490,6 +493,7 @@ void ReflectionProbe::unpackUpdate(NetConnection *conn, BitStream *stream)
if(oldReflectModeType != mReflectionModeType || oldCubemapName != mCubemapName)
mCubemapDirty = true;
stream->read(&mAtten);
mDirty = true;
}
@ -565,6 +569,7 @@ void ReflectionProbe::updateProbeParams()
mProbeInfo.mProbeRefOffset = mProbeRefOffset;
mProbeInfo.mProbeRefScale = mProbeRefScale;
mProbeInfo.mCanDamp = mCanDamp;
mProbeInfo.mAtten = mAtten;
mProbeInfo.mDirty = true;

View file

@ -167,6 +167,7 @@ protected:
/// Whether this probe is enabled or not
/// </summary>
bool mEnabled;
F32 mAtten;
bool mDirty;