@@ -319,6 +319,11 @@ void ProbesRendererService::Update()
|
||||
// Calculate time delta since last update
|
||||
auto timeNow = Time::Update.UnscaledTime;
|
||||
auto timeSinceUpdate = timeNow - _lastProbeUpdate;
|
||||
if (timeSinceUpdate < 0)
|
||||
{
|
||||
_lastProbeUpdate = timeNow;
|
||||
timeSinceUpdate = 0;
|
||||
}
|
||||
|
||||
// Check if render job is done
|
||||
if (isUpdateSynced())
|
||||
@@ -352,8 +357,9 @@ void ProbesRendererService::Update()
|
||||
auto dt = (float)Time::Update.UnscaledDeltaTime.GetTotalSeconds();
|
||||
for (int32 i = 0; i < _probesToBake.Count(); i++)
|
||||
{
|
||||
_probesToBake[i].Timeout -= dt;
|
||||
if (_probesToBake[i].Timeout <= 0)
|
||||
auto& e = _probesToBake[i];
|
||||
e.Timeout -= dt;
|
||||
if (e.Timeout <= 0)
|
||||
{
|
||||
firstValidEntryIndex = i;
|
||||
break;
|
||||
@@ -418,6 +424,9 @@ void ProbesRenderer::OnRender(RenderTask* task, GPUContext* context)
|
||||
if (_current.Actor == nullptr)
|
||||
{
|
||||
// Probe has been unlinked (or deleted)
|
||||
_task->Enabled = false;
|
||||
_updateFrameNumber = 0;
|
||||
_current.Type = EntryType::Invalid;
|
||||
return;
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -28,21 +28,9 @@ public:
|
||||
|
||||
struct Entry
|
||||
{
|
||||
EntryType Type;
|
||||
EntryType Type = EntryType::Invalid;
|
||||
ScriptingObjectReference<Actor> Actor;
|
||||
float Timeout;
|
||||
|
||||
Entry()
|
||||
{
|
||||
Type = EntryType::Invalid;
|
||||
}
|
||||
|
||||
Entry(const Entry& other)
|
||||
{
|
||||
Type = other.Type;
|
||||
Actor = other.Actor;
|
||||
Timeout = other.Timeout;
|
||||
}
|
||||
float Timeout = 0.0f;
|
||||
|
||||
bool UseTextureData() const;
|
||||
int32 GetResolution() const;
|
||||
|
||||
Reference in New Issue
Block a user