Skip to main content

Module ray_tracing_gpu

Module ray_tracing_gpu 

Source
Expand description

GPU ray tracing with f32 precision (CPU mock).

Provides BVH nodes, triangle/sphere/AABB intersection tests, full scene traversal, ambient occlusion sampling, and a simple orthographic renderer — all running on the CPU as a mock GPU backend.

Structs§

BvhNode
A BVH (bounding-volume hierarchy) node.
GpuTriangle
A triangle in GPU-friendly format.
HitRecord
Information about a ray–surface intersection.
Ray
A ray defined by an origin and a direction (f32 precision).

Functions§

ambient_occlusion_sample
Estimate ambient occlusion at a hit point by sampling hemisphere directions.
gpu_render_pixels
Render a scene with orthographic projection, returning one RGB pixel per sample.
ray_aabb_intersect
Test ray–AABB intersection using the slab method.
ray_sphere_intersect
Test ray–sphere intersection.
ray_triangle_intersect
Test ray–triangle intersection using the Möller–Trumbore algorithm.
trace_ray
Find the closest triangle hit by ray in triangles.