Vulkan Schnee 0.0.1
High-performance rendering engine
Loading...
Searching...
No Matches
Rendering Data Hierarchy

This document describes the data structures used by the renderer and their relationships.

Scene Graph to GPU Data

The renderer transforms the scene graph into flat GPU buffers. The hierarchy is:

Object (Actor/Entity)
└── MeshComponent (0..n)
└── Primitive (1..n)
└── Meshlet (1..n)

Object

An object is an Actor or Entity in the ECS (EnTT). Each object has:

  • Transform: World-space position, rotation, scale

Objects can have zero or more MeshComponents attached.

MeshComponent

A MeshComponent references its parent entity and contains a SceneNode for local transforms. Each MeshComponent has:

  • Transform: Local transform relative to the parent object

Primitive

Each mesh consists of one or more primitives. A primitive represents a single draw unit with:

  • MaterialData: Material type and parameters (stored as std::variant)
  • SphereBounds: Bounding sphere for object-level culling
    • boundingSphereRadius: float
    • boundingSphereWorldCenter: vec3

Meshlet

Primitives are subdivided into meshlets for the mesh shader pipeline. Each meshlet contains:

  • Vertices: Offset and count into the vertex buffer
  • Triangles: Offset and count into the triangle index buffer
  • BoundsRadius: float
  • BoundsCenter: vec3

Meshlet bounds are used for fine-grained culling before rendering.

GPU Buffer Data Types

Dispatch

Indirect dispatch parameters for compute shaders:

struct Dispatch {
uint32_t groupCountX;
uint32_t groupCountY;
uint32_t groupCountZ;
};

ObjectCullingData

Per-object data for frustum culling:

struct ObjectCullingData {
float boundingSphereRadius;
glm::vec3 boundingSphereWorldCenter;
};

MeshletAlignmentInfo

Describes where meshlet data is located in the buffer:

struct MeshletAlignmentInfo {
uint32_t start; // Offset into the buffer
uint32_t count; // Number of elements
uint32_t stride; // Element size in bytes
};

FrustumData

Frustum planes for stereo culling:

std::array<glm::vec4, 6> planes[2]; // [eyeIndex][planeIndex]
// Plane order: left, right, top, bottom, near, far

Counters

Simple atomic counters track surviving objects/meshlets:

uint32_t counter; // Single counter for total count

Binned counters track per-pipeline counts:

uint32_t counters[MAX_PIPELINE_COUNT]; // One counter per pipeline

Related Pages