summaryrefslogtreecommitdiff
path: root/indra/newview/llreflectionmap.h
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llreflectionmap.h')
-rw-r--r--indra/newview/llreflectionmap.h51
1 files changed, 43 insertions, 8 deletions
diff --git a/indra/newview/llreflectionmap.h b/indra/newview/llreflectionmap.h
index 7d39e7e562..ed1c2680b6 100644
--- a/indra/newview/llreflectionmap.h
+++ b/indra/newview/llreflectionmap.h
@@ -26,26 +26,61 @@
#pragma once
-#include "llcubemap.h"
+#include "llcubemaparray.h"
+#include "llmemory.h"
-class LLReflectionMap : public LLRefCount
+class LLSpatialGroup;
+
+class alignas(16) LLReflectionMap : public LLRefCount
{
+ LL_ALIGN_NEW
public:
// allocate an environment map of the given resolution
LLReflectionMap();
// update this environment map
- // origin - position in agent space to generate environment map from in agent space
// resolution - size of cube map to generate
- void update(const LLVector3& origin, U32 resolution);
-
- // point at which environment map was generated from (in agent space)
- LLVector4a mOrigin;
+ void update(U32 resolution, U32 face);
+
+ // return true if this probe should update *now*
+ bool shouldUpdate();
+ // Mark this reflection map as needing an update (resets last update time, so spamming this call will cause a cube map to never update)
+ void dirty();
+
+ // for volume partition probes, try to place this probe in the best spot
+ void autoAdjustOrigin();
+
+ // return true if given Reflection Map's influence volume intersect's with this one's
+ bool intersects(LLReflectionMap* other);
+
+ // point at which environment map was last generated from (in agent space)
+ LLVector4a mOrigin;
+
// distance from viewer camera
F32 mDistance;
+ // radius of this probe's affected area
+ F32 mRadius = 16.f;
+
+ // last time this probe was updated (or when its update timer got reset)
+ F32 mLastUpdateTime = 0.f;
+
+ // last time this probe was bound for rendering
+ F32 mLastBindTime = 0.f;
+
// cube map used to sample this environment map
- LLPointer<LLCubeMap> mCubeMap;
+ LLPointer<LLCubeMapArray> mCubeArray;
+ S32 mCubeIndex = -1; // index into cube map array or -1 if not currently stored in cube map array
+
+ // index into array packed by LLReflectionMapManager::getReflectionMaps
+ // WARNING -- only valid immediately after call to getReflectionMaps
+ S32 mProbeIndex = -1;
+
+ // set of any LLReflectionMaps that intersect this map (maintained by LLReflectionMapManager
+ std::vector<LLReflectionMap*> mNeighbors;
+
+ LLSpatialGroup* mGroup = nullptr;
+ bool mDirty = true;
};