4#include "Resources/Resources.h"
5#include "Components/Core/RenderComponent.h"
7#include "Foundation/Geometry/BoundingBox.hpp"
8#include "Foundation/Memory/MemoryBuffer.h"
21 typedef uint64_t TileKey;
23 inline TileKey createTileKey(
const glm::u16vec4& ix4,
const glm::i16vec3& alignMinToZeroShift)
25 return (uint64_t(ix4.w) << 48)
26 | (uint64_t(uint16_t((ix4.z << ix4.w) + alignMinToZeroShift.z)) << 32)
27 | (uint64_t(uint16_t((ix4.y << ix4.w) + alignMinToZeroShift.y)) << 16)
28 | uint64_t(uint16_t((ix4.x << ix4.w) + alignMinToZeroShift.x));
32 typedef uint64_t RegionKey;
74 glm::vec3 blockExtent = glm::vec3(1.f);
79 float turbidity = 100.f;
80 float ageScale = 0.1f;
82 uint32_t tileSize = 64u;
83 uint32_t gpuCacheSize = 5u;
85 OctSource source = OctSource::Value;
90 float(*func)(
void* data, uint64_t clientData) =
nullptr;
97 bool drawDebug =
false;
110 void submitTileResponse(
TileResponse* res,
bool success);
115 static void registerType();
123template<>
inline Cogs::StringView getName<Cogs::Core::Volumetric::OctComponent>() {
return "VolOctComponent"; }
Base class for Component instances.
Provides a weakly referenced view over the contents of a string.
Contains all Cogs related functionality.
bool clearAllRegions
If set to true, all current regions are discarded before regionsToAdd is processed.
std::vector< RegionKey > regionsToRemove
Set of regions to remove. Blocks with no regions are purged from the oct-tree.
float tolerance
Requested refinement tolerance, may be somewhat ignored when atlas size is insufficient.
glm::vec3 blockShift
Object space grid origin, tweak if block boundaries happen at unfortunate places.
bool forceWipe
Discard all processed data, but regions persist.
std::vector< TileRequest > tileRequests
Requests for tiles, populated by OctSystem::update, consumed by provider.
std::vector< Region > regionsToAdd
Regions to add this frame. It is OK to add a region multiple times, and this will invalidate regions ...
glm::vec3 max
Object space max corner of region bounding box.
RegionKey regionKey
User-defined key to keep track of regions.
glm::vec3 min
Object space min corner of region bounding box.
glm::uvec3 N
Number of samples expected along each dimension (total=N^3).
uint64_t clientData
Passed along to alpha-callback.
glm::vec3 max
Tile world-space bounding box max corner.
glm::vec3 min
Tile world-space bounding box min corner.
std::set< RegionKey > regionKeys
Regions present in that tile.