4#include <glm/mat4x4.hpp>
123 struct alignas( 16 ) [[deprecated(
"Use mat4 directly via RenderingDataManager::getPerObjectDataBuffer()")]]
PerObjectData
272 static_assert(
sizeof(
MeshGeometryData) == 32,
"MeshGeometryData size mismatch");
416 static_assert(
sizeof(
GpuPbrMaterial) == 80,
"GpuPbrMaterial size mismatch with GLSL std430 layout");
417 static_assert(offsetof(
GpuPbrMaterial, baseColorFactor) == 16,
"baseColorFactor must be at offset 16");
418 static_assert(offsetof(
GpuPbrMaterial, emissiveFactor) == 32,
"emissiveFactor must be at offset 32 (16-byte aligned for std430 vec3)");
445 static_assert(
sizeof(
SHProbeData) == 160,
"SHProbeData size mismatch");
468 static_assert(
sizeof(
ClusterLodData) == 32,
"ClusterLodData size mismatch");
486 static_assert(
sizeof(
ClusterGroupData) == 32,
"ClusterGroupData size mismatch");
507 static_assert(
sizeof(
LodConfigUBO) == 48,
"LodConfigUBO size mismatch");
525 static_assert(
sizeof(
ClusterSurvivor) == 16,
"ClusterSurvivor size mismatch");
Log category system implementation.
Per-group LOD data representing a simplified version of child clusters. Groups are created by merging...
int32_t depth
DAG depth (0 = coarsest level)
float simplifiedError
Error threshold for this group.
glm::vec4 simplifiedBoundsPositionAndRadius
xyz = local center, w = radius
Per-cluster LOD data for GPU-driven LOD selection. Each cluster maps to exactly one meshlet and conta...
glm::vec4 boundsPositionAndRadius
xyz = local center, w = radius
float error
Simplification error (mesh-local units)
uint32_t meshletIndex
Index into UnifiedMeshlet buffer.
int32_t refinedGroupId
Parent group index (-1 for base/finest geometry)
Cluster survivor data passed from culling to binning shaders. Contains the LOD selection result inclu...
uint32_t primitiveID
For transform/material lookup.
uint32_t clusterIndex
Global cluster index → maps to meshlet.
float ditherFactor
0.0-1.0 for transition blending
CPU side data for per object data. This will get divided up into multiple gpu buffers.
std::vector< CpuPrimitiveData > primitives
Cpu primitive data. Stores data which corresponds to a primitive.
float boundingSphereRadius
glm::vec3 boundingSphereWorldPosition
Frustum planes for frustum culling in the first compute shader stage.
std::array< glm::vec4, 6 > planes[2]
GPU-side layout for flat color material Matches GLSL struct in triangle_flat.frag.
GPU-side layout for diffuse shader material Used for basic textured materials.
uint32_t baseColorTextureIndex
glm::vec4 baseColorFactor
Describes a mesh on the gpu. Where it is in the memory and how many meshlets it consists of.
GPU-side layout for normals debug material.
GPU-side layout for PBR material with spherical harmonics Used by MovableDiffuseShader,...
uint32_t baseColorTextureIndex
uint32_t lightmapTextureIndex
glm::vec4 baseColorFactor
uint32_t normalTextureIndex
uint32_t emissiveTextureIndex
uint32_t roughnessMetallicTextureIndex
View-projection data for Hi-Z occlusion culling Contains matrices and screen info needed to project b...
glm::mat4 viewProjection[2]
Instance culling data - replaces ObjectCullingData for instancing. Contains world-space bounding sphe...
uint32_t meshGeometryId
Index into MeshGeometryData buffer.
uint32_t _padding[2]
Padding for 32-byte alignment.
uint32_t instanceId
Index into InstanceData buffer.
glm::vec4 worldPositionAndRadius
xyz = world position, w = radius
Per-instance data - one per visible MeshComponent. References shared geometry via meshGeometryId.
uint32_t materialId
Material instance ID (for material variations)
uint32_t colorTextureId
Texture array index.
glm::mat4 worldMatrix
64 bytes - world transform
uint32_t meshGeometryId
Index into MeshGeometryData buffer.
uint32_t _padding
Padding for 16-byte alignment.
Local-space bounding sphere data - uploaded once, never changes.
glm::vec4 localCenterAndRadius
xyz = local center, w = local radius
LOD configuration for GPU shader selection. Updated per-frame with camera and screen information.
glm::vec4 cameraPosition
World-space camera position.
glm::vec2 _padding
Pad to 48 bytes (std140 alignment)
float cameraProj11
projection[1][1] = cot(fov/2)
float errorThresholdPixels
Target pixel error (default 1.0)
uint32_t ditherEnabled
1 = dither transitions, 0 = hard cut
float cameraNear
Positive near plane distance.
glm::vec2 screenSize
Render target dimensions.
Shared geometry metadata - one per unique MeshAsset primitive. Allows multiple instances to reference...
uint32_t clusterCount
Total clusters (all LOD levels)
uint32_t meshletStartIndex
First meshlet in shared meshlet buffer.
uint32_t meshletCount
Number of meshlets for this geometry.
uint32_t pipelineIndex
Material pipeline index.
uint32_t groupCount
Total groups in LOD hierarchy.
uint32_t clusterStartIndex
First ClusterLodData (0xFFFFFFFF if no LOD)
uint32_t groupStartIndex
First ClusterGroupData.
uint32_t singleMeshletGeoIndex
Index into SingleMeshletGeometryData (0xFFFFFFFF if multi-meshlet)
Mapping from MeshAsset primitive to shared geometry buffer location. Used by RenderingDataManager to ...
bool isSingleMeshlet
True if meshletCount == 1 (use vertex shader path)
uint32_t vsIndexOffset
Offset into VS index buffer (contiguous uint32_t)
float localBoundsRadius
Cached local bounding sphere radius.
uint32_t meshGeometryId
Index into MeshGeometryData buffer.
glm::vec3 localBoundsCenter
Cached local bounding sphere center.
uint32_t pipelineIndex
Cached pipeline index from material.
uint32_t meshletStartIndex
First meshlet in shared buffer.
uint32_t triangleBaseOffset
Offset into triangle buffer.
uint32_t meshletCount
Number of meshlets.
uint32_t vertexBaseOffset
Offset into vertex buffer.
uint32_t vsIndexCount
Number of indices (triangleCount * 3)
Data for the metadata buffer which handles the unpacking of meshes into their meshlets.
glm::vec4 worldPositionAndRadius
uint32_t totalMeshletCount
glm::vec4 worldPositionAndRadius
The center point of the bounding sphere (w component stores radius)
uint32_t objectIndex
Object index linking back to the Object Data.
Stores all data which is unique to each object.
float boundingSphereRadius
glm::vec4 colorMultiplier
std::vector< uint8_t > tris
std::vector< UnifiedMeshlet > meshletData
std::vector< uint32_t > vertices
Data for the primitive culling shader to assemble and pass on to the unpacking shader.
uint32_t meshletStartIndex
SH Probe data structure for dynamic lighting Contains L0-L2 RGB spherical harmonic coefficients.
glm::vec4 coefficients[9]
GPU data for single-meshlet geometry using vertex shader path. One entry per unique single-meshlet ge...
uint32_t firstIndex
Offset into index buffer.
uint32_t pipelineIndex
Material pipeline index.
int32_t vertexOffset
Added to each index value.
uint32_t indexCount
Number of indices to draw.
Information about the wereabouts of a meshlet in memory on the gpu.
uint32_t vertexDataOffset
uint32_t triangleDataOffset
Struct for the result buffer of the culling operation. Stores which objects have passed the culling t...
float ditherFactor
LOD transition dither factor (0.0-1.0)