class

FLidarGpuTrace

The scale path for the trace. A grenade is thousands of rays in one frame, which is a dispatch, not a loop of physics queries — but it is the SAME pattern the CPU trace walks, so a shot fired here and a shot re-traced on a client that fell back to the CPU produce the same cloud.

Module
Game
Header
#include "PointCloud/LidarGpuTrace.h"
Namespace
Mowo

Output is a dense record per ray rather than an atomically appended list: the index is the ray index, so the buffer is reproducible and a hit can be matched back to the ray that found it.

Public functions

ReturnsNameDescription
boolIsSupportedTrue when the device can run the trace at all.
boolInitialize
voidShutdown
boolIsInitialized
uint32_tGetMaxRays
boolDispatchRecords the dispatch into the current command buffer.
uint32_tReadBackBlocking readback of the last dispatch.
uint32_tResolveHitsTurns raw records into hits, resolving each point's colour from the surface of the instance the ray landed on.

Function details

IsSupported

C++
static bool IsSupported()

True when the device can run the trace at all. Needs inline ray query for the traversal and 64-bit ints for the vertex fetch that resolves normals.

Initialize

C++
bool Initialize(uint32_t maxRaysPerDispatch)

Shutdown

C++
void Shutdown()

IsInitialized

C++
bool IsInitialized() const

GetMaxRays

C++
uint32_t GetMaxRays() const

Dispatch

C++
bool Dispatch(const FLidarShot& shot, Ref<AccelerationStructure> tlas, Ref<StorageBuffer> instanceData)

Records the dispatch into the current command buffer. instanceData is the renderer's per-instance record buffer for the same TLAS.

ReadBack

C++
uint32_t ReadBack(const FLidarShot& shot, std::vector<HitRecord>& outRecords)

Blocking readback of the last dispatch. The caller must have synchronized first — this does not order itself against the frame.

ResolveHits

C++
static uint32_t ResolveHits(const HitRecord* records, uint32_t count, const ESurfaceType* instanceSurfaces, uint32_t surfaceCount, const uint8_t* instanceDynamic, std::vector<FLidarHit>& outHits)

Turns raw records into hits, resolving each point's colour from the surface of the instance the ray landed on. instanceSurfaces and instanceDynamic are indexed by TLAS instance id — the renderer's GetRaySceneSurfaces / GetRaySceneDynamicFlags hand them over directly for a live-scene trace. A short table degrades to Default rather than reading out of bounds.

Generated from PointCloud/LidarGpuTrace.h via game.json · Nov 5, 2026Version 1.0.0