feat: Good bvh traversal
This commit is contained in:
@@ -142,6 +142,8 @@ public struct VoxelCacheTracer<let N : int, H : IVoxelHit<N>> : IVoxelCache
|
||||
|
||||
public bool trace<L : ILodPolicy>(uint32_t root, uint32_t thread_id, Ray r, L lod, float offset_t, out Hit v)
|
||||
{
|
||||
v.t = 0.;
|
||||
|
||||
// Ray mirroring
|
||||
r.origin += float3(1.);
|
||||
r.origin = clamp(r.origin, float(1.), asfloat(0x3fffffff));
|
||||
@@ -216,6 +218,7 @@ public struct VoxelCacheTracer<let N : int, H : IVoxelHit<N>> : IVoxelCache
|
||||
asfloat(asuint(pos) ^ 0x007fffff),
|
||||
pos) -
|
||||
float3(1.);
|
||||
v.t = offset_t + t;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user