-
-
Notifications
You must be signed in to change notification settings - Fork 1
Resource: TraversalNode
Stores the Sparse Octree traversal data.
This is kept separate from the data payloads to reduce VRAM pressure during traversal.
uint32 packedBitfield
RO = Relative offset, 18b
OD = Depth TTL, 4b
BO = Bitfield occupancy, 8b
IF = Is far pointer?, 1b
IM = Is waiting for mipmap?, 1b[RO] [RO] [RO] [RO] [RO] [RO] [RO] [RO] [RO] [RO] [RO] [RO] [RO] [RO] [RO] [RO]
[RO] [RO] [OD] [OD] [OD] [OD] [BO] [BO] [BO] [BO] [BO] [BO] [BO] [BO] [IF] [IM]
TraversalNode.PackStruct(relativeOffset, ttl, occupancyBitmap, isFarPTR, isWaitingForMipmap)
- Packs entire bitfield
uint32 relativeOffset - Difference between this node and target reference offset
uint32 ttl - 4b, Time-To-Live value for remaining node depth
uint32 occupancyBitmap - 8b, bitmap of occupied voxels at referenced offset
uint32 isFarPTR - bool, if offset is reference to fat offset buffer
uint32 isWaitingForMipmap - bool, if node requires filtering
TraversalNode.UnPackStruct(relativeOffset, uint ttl, occupancyBitmap, isFarPTR, out uint isWaitingForMipmap)
- Unpacks entire bitfield
out uint32 relativeOffset - Difference between this node and target reference offset
out uint32 ttl - 4b, Time-To-Live value for remaining node depth
out uint32 occupancyBitmap - 8b, bitmap of occupied voxels at referenced offset
out uint32 isFarPTR - bool, if offset is reference to fat offset buffer
out uint32 isWaitingForMipmap - bool, if node requires filtering
TraversalNode.Intialize()
- Initializes node
(This is only required if instantiating a node and not writing any values before leaving the function)
TraversalNode.GetRelativeOffset()
- Gets the relative offset
TraversalNode.SetRelativeOffset(uint value)
- Sets the relative offset
TraversalNode.GetIsFarPTR()
- Returns whether node is a far pointer
TraversalNode.GetIsWaitingForMipmap()
- Returns whether node needs mipmapping
TraversalNode.SetIsWaitingForMipmap(uint value)
- Sets whether node needs mipmapping
TraversalNode.GetTTL()
- Returns TTL
TraversalNode.GetOccupancyBit(int index)
- Returns single occupancy bit
TraversalNode.GetOccupancyBit(int index, uint occupancyBitmap)
- Returns single occupancy bit
TraversalNode.SetOccupancyBitmap(uint bitmap)
- Sets occupancy bitmap
TraversalNode.GetOccupancyBitmap()
- Gets occupancy bitmap