BSP BVH ray tracing for sky occlusion and entity picking #31
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Build a BVH (Bounding Volume Hierarchy) from BSP face triangles for accelerated ray tracing. This serves two purposes:
Current state
Implementation
BVH construction (BSP only)
__skyfaces)Ray-triangle intersection
Sky visibility trace
__skytriangle → entity is in sunlight (return true)Entity picker trace (future, layered approach)
The entity picker does NOT use the BVH for entities. Instead it uses a layered approach:
This avoids putting entities in the BVH (which would require rebuilds on movement) while still giving accurate picking. The AABB filter is cheap enough to run against all entities each frame.
Context
client/src/bsp/loader.js(mapGroup, sky3DGroup)client/src/bsp/leaf-lighting.js(leafHasSkyVisibility)