Geometry data for ray tracing (backend-agnostic) More...
#include <RayTracingTypes.h>
Public Member Functions | |
| size_t | getPerPrimitiveBufferSize () const |
| Get expected buffer size for per-primitive data. | |
| size_t | getUUIDLookupBufferSize () const |
| Get expected buffer size for UUID→position lookup table. | |
| void | validate () const |
| Validate geometry buffer consistency (debug builds only) | |
Data Fields | |
| std::vector< float > | transform_matrices |
| Transform matrices (16 floats per primitive, row-major) | |
| std::vector< uint > | primitive_types |
| Primitive type: 0=patch, 1=triangle, 2=disk, 3=tile, 4=voxel, 5=bbox. | |
| std::vector< uint > | primitive_UUIDs |
| UUID for each primitive (for result mapping) | |
| std::vector< uint > | primitive_IDs |
| Primitive ID within parent object (for sub-patch calculations) | |
| std::vector< uint > | object_IDs |
| Parent object ID for each primitive. | |
| std::vector< helios::int2 > | object_subdivisions |
| Object subdivisions (for mapping) | |
| std::vector< char > | twosided_flags |
| Two-sided flag (1=two-sided, 0=one-sided) | |
| std::vector< float > | solid_fractions |
| Solid fraction (0-1, for porous surfaces) | |
| std::vector< uint > | primitive_positions |
| PrimitiveTypeGeometry | patches |
| Patch data (4 vertices per patch) | |
| PrimitiveTypeGeometry | triangles |
| Triangle data (3 vertices per triangle) | |
| PrimitiveTypeGeometry | tiles |
| Tile data (4 vertices per tile) | |
| PrimitiveTypeGeometry | voxels |
| Voxel data (8 vertices per voxel) | |
| PrimitiveTypeGeometry | bboxes |
| Bounding box data (8 vertices per bbox) | |
| std::vector< helios::vec3 > | disk_centers |
| Disk center positions. | |
| std::vector< float > | disk_radii |
| Disk radii. | |
| std::vector< helios::vec3 > | disk_normals |
| Disk normal vectors. | |
| std::vector< uint > | disk_UUIDs |
| Disk UUIDs. | |
| size_t | disk_count = 0 |
| Number of disks. | |
| std::vector< bool > | mask_data |
| Flattened 3D mask data [mask_id][y][x]. | |
| std::vector< helios::int2 > | mask_sizes |
| Size (width, height) for each mask. | |
| std::vector< int > | mask_IDs |
| Mask ID for each primitive (-1 if no mask) | |
| std::vector< helios::vec2 > | uv_data |
| Flattened 2D UV coordinates [primitive][vertex]. | |
| std::vector< int > | uv_IDs |
| UV data start index for each primitive (-1 if no UVs) | |
| helios::vec2 | periodic_flag |
| Periodic boundary flags (x, y directions) | |
| size_t | primitive_count = 0 |
| Total number of primitives (all types) | |
| size_t | patch_count = 0 |
| Number of patches. | |
| size_t | triangle_count = 0 |
| Number of triangles. | |
| size_t | tile_count = 0 |
| Number of tiles. | |
| size_t | voxel_count = 0 |
| Number of voxels. | |
| size_t | bbox_count = 0 |
| Number of bounding boxes. | |
| uint | bbox_UUID_base = 0 |
| Starting UUID for bboxes (max_real_UUID + 1) | |
| UUIDPositionMapper | mapper |
Geometry data for ray tracing (backend-agnostic)
All geometry data for 6 primitive types: patch, triangle, disk, tile, voxel, bbox. Data is organized per-primitive and per-type.
Definition at line 40 of file RayTracingTypes.h.
|
inline |
Get expected buffer size for per-primitive data.
Use when allocating buffers indexed by position (0..primitive_count-1). CRITICAL: Use this instead of Nobjects to avoid buffer undersizing bugs!
Buffers to size with this:
Historical bug (commit 53ca9687d): primitive_IDs sized by Nobjects instead of Nprimitives
Definition at line 111 of file RayTracingTypes.h.
|
inline |
Get expected buffer size for UUID→position lookup table.
The lookup table is a SPARSE array indexed by UUID value. Must be sized to accommodate the highest UUID, not the primitive count!
Example: If UUIDs are [10, 42, 100], size must be 101, not 3. Entries for non-existent UUIDs contain UINT_MAX.
Definition at line 125 of file RayTracingTypes.h.
| void helios::RayTracingGeometry::validate | ( | ) | const |
Validate geometry buffer consistency (debug builds only)
Comprehensive validation of all indexing invariants. Catches buffer sizing errors BEFORE GPU upload, preventing crashes and silent corruption.
Validates:
Call this at the START of every backend's updateGeometry() method.
| helios_runtime_error | with detailed message if validation fails |
Historical bugs this prevents:
Definition at line 23 of file RayTracingTypes.cpp.
| size_t helios::RayTracingGeometry::bbox_count = 0 |
Number of bounding boxes.
Definition at line 88 of file RayTracingTypes.h.
| uint helios::RayTracingGeometry::bbox_UUID_base = 0 |
Starting UUID for bboxes (max_real_UUID + 1)
Definition at line 89 of file RayTracingTypes.h.
| PrimitiveTypeGeometry helios::RayTracingGeometry::bboxes |
Bounding box data (8 vertices per bbox)
Definition at line 63 of file RayTracingTypes.h.
| std::vector<helios::vec3> helios::RayTracingGeometry::disk_centers |
Disk center positions.
Definition at line 66 of file RayTracingTypes.h.
| size_t helios::RayTracingGeometry::disk_count = 0 |
Number of disks.
Definition at line 70 of file RayTracingTypes.h.
| std::vector<helios::vec3> helios::RayTracingGeometry::disk_normals |
Disk normal vectors.
Definition at line 68 of file RayTracingTypes.h.
| std::vector<float> helios::RayTracingGeometry::disk_radii |
Disk radii.
Definition at line 67 of file RayTracingTypes.h.
| std::vector<uint> helios::RayTracingGeometry::disk_UUIDs |
Disk UUIDs.
Definition at line 69 of file RayTracingTypes.h.
| UUIDPositionMapper helios::RayTracingGeometry::mapper |
Definition at line 92 of file RayTracingTypes.h.
| std::vector<bool> helios::RayTracingGeometry::mask_data |
Flattened 3D mask data [mask_id][y][x].
Definition at line 73 of file RayTracingTypes.h.
| std::vector<int> helios::RayTracingGeometry::mask_IDs |
Mask ID for each primitive (-1 if no mask)
Definition at line 75 of file RayTracingTypes.h.
| std::vector<helios::int2> helios::RayTracingGeometry::mask_sizes |
Size (width, height) for each mask.
Definition at line 74 of file RayTracingTypes.h.
| std::vector<uint> helios::RayTracingGeometry::object_IDs |
Parent object ID for each primitive.
Definition at line 47 of file RayTracingTypes.h.
| std::vector<helios::int2> helios::RayTracingGeometry::object_subdivisions |
Object subdivisions (for mapping)
Definition at line 48 of file RayTracingTypes.h.
| size_t helios::RayTracingGeometry::patch_count = 0 |
Number of patches.
Definition at line 84 of file RayTracingTypes.h.
| PrimitiveTypeGeometry helios::RayTracingGeometry::patches |
Patch data (4 vertices per patch)
Definition at line 59 of file RayTracingTypes.h.
| helios::vec2 helios::RayTracingGeometry::periodic_flag |
Periodic boundary flags (x, y directions)
Definition at line 80 of file RayTracingTypes.h.
| size_t helios::RayTracingGeometry::primitive_count = 0 |
Total number of primitives (all types)
Definition at line 83 of file RayTracingTypes.h.
| std::vector<uint> helios::RayTracingGeometry::primitive_IDs |
Primitive ID within parent object (for sub-patch calculations)
Definition at line 46 of file RayTracingTypes.h.
| std::vector<uint> helios::RayTracingGeometry::primitive_positions |
< Maps UUID to array position: primitive_positions[UUID] = array_index Size: max_UUID + 1 (sparse array, entries for non-existent UUIDs = UINT_MAX) Enables CUDA to convert UUID to array position for buffer indexing
Definition at line 56 of file RayTracingTypes.h.
| std::vector<uint> helios::RayTracingGeometry::primitive_types |
Primitive type: 0=patch, 1=triangle, 2=disk, 3=tile, 4=voxel, 5=bbox.
Definition at line 44 of file RayTracingTypes.h.
| std::vector<uint> helios::RayTracingGeometry::primitive_UUIDs |
UUID for each primitive (for result mapping)
Definition at line 45 of file RayTracingTypes.h.
| std::vector<float> helios::RayTracingGeometry::solid_fractions |
Solid fraction (0-1, for porous surfaces)
Definition at line 50 of file RayTracingTypes.h.
| size_t helios::RayTracingGeometry::tile_count = 0 |
Number of tiles.
Definition at line 86 of file RayTracingTypes.h.
| PrimitiveTypeGeometry helios::RayTracingGeometry::tiles |
Tile data (4 vertices per tile)
Definition at line 61 of file RayTracingTypes.h.
| std::vector<float> helios::RayTracingGeometry::transform_matrices |
Transform matrices (16 floats per primitive, row-major)
Definition at line 43 of file RayTracingTypes.h.
| size_t helios::RayTracingGeometry::triangle_count = 0 |
Number of triangles.
Definition at line 85 of file RayTracingTypes.h.
| PrimitiveTypeGeometry helios::RayTracingGeometry::triangles |
Triangle data (3 vertices per triangle)
Definition at line 60 of file RayTracingTypes.h.
| std::vector<char> helios::RayTracingGeometry::twosided_flags |
Two-sided flag (1=two-sided, 0=one-sided)
Definition at line 49 of file RayTracingTypes.h.
| std::vector<helios::vec2> helios::RayTracingGeometry::uv_data |
Flattened 2D UV coordinates [primitive][vertex].
Definition at line 76 of file RayTracingTypes.h.
| std::vector<int> helios::RayTracingGeometry::uv_IDs |
UV data start index for each primitive (-1 if no UVs)
Definition at line 77 of file RayTracingTypes.h.
| size_t helios::RayTracingGeometry::voxel_count = 0 |
Number of voxels.
Definition at line 87 of file RayTracingTypes.h.
| PrimitiveTypeGeometry helios::RayTracingGeometry::voxels |
Voxel data (8 vertices per voxel)
Definition at line 62 of file RayTracingTypes.h.