Repository navigation
Added
- (pathtrace) expose GPU-port hooks — Sobol' direction numbers, sheen LUT, emissive light table, env-map CDFs, radiance_key, TraceScene::bvh
- (pathtrace) Arvo 1995 spherical-triangle light sampling
- (pathtrace) unbiased Monte Carlo path tracer backend (RenderBackend::PathTrace)
- (raycast) trace the prepared scene; native glTF Pbr with ray-traced shadows, reflection, refraction, MASK/BLEND
- (trace) ray-differential LOD, shadow transmittance, direct lighting, Snell/Fresnel helpers; share scanline Frame
- (trace) shared ray-tracing layer over PreparedScene
- camera target offset (pan), orthographic orbit zoom, Renderer::set_texture_resolver
- (scanline) port onto the prep layer — clipping, perspective-correct visibility buffer, glTF PBR, alpha modes, shadow maps, band-parallel
- public backend-agnostic scene preparation layer + public camera
- texture resolution + CPU sampler, HDR image + tone mapping
- Error::Backend for runtime backend failures (GPU adapter/device/readback)
Fixed
- (pathtrace) glTF back-face normal-map orientation on double-sided materials
- (scanline) crack-free shared edges + parallel display transform
Other
- (pathtrace) parallel display resolve (1080p image() in 7.8 ms)
- path tracer in README / CHANGELOG / BENCHMARKS; criterion pathtrace group
- raycast Pbr (shadows, reflection, refraction, MASK/BLEND), trace layer additions, raycast benchmarks
- (raycast) adaptive BVH builder, all-core tile workers; raycast PBR benches
- crate overview of the shared layers; BENCHMARKS for the prep-layer scanline
- README/CHANGELOG for the prep layer, textures, HDR, Pbr scanline; PBR bench rows
- shared procedural test scenes, image metrics, PBR property suite + raw goldens
- traverse via mesh3d's SAH Bvh::closest_hit / occluded
Added
-
RenderBackend::PathTrace(pathtrace, registry name
"pathtrace"): unbiased unidirectional Monte Carlo path tracer
(Kajiya 1986). Next-event estimation to everyKHR_lights_punctual
light and to one power-sampled emissive triangle (spherical-triangle
sampling, Arvo 1995, with a uniform-area fallback for tiny solid
angles) or environment texel per vertex, power-heuristic MIS against BSDF
sampling (Veach 1997), Russian roulette, optional firefly clamp.
BSDF: glTF metallic-roughness with GGX visible-normal sampling
(Heitz 2018), cosine diffuse and Fresnel-weighted lobe selection
(mixture pdfs),KHR_materials_transmission(thin-walled and
Walter 2007 rough refraction),_volume(Beer-Lambert),_ior,
_specular,_clearcoat,_sheen(Charlie), emissive. MASK any-hit,
BLEND stochastic transparency, normal maps, double-sided surfaces.
Owen-scrambled Sobol' sequences (Burley 2020) with PCG-hash seeding
and a documented dimension layout; deterministic output.
RenderOptions::path_trace: PathTraceOptions(samples per pixel,
max bounces, roulette start, clamp, seed,LightStrategy). -
Progressive
PathTracer:sync/refine/image/hdr
with radiance-aware reset;EnvironmentMap(equirectangular
HdrImage, 2-D luminance CDF importance sampling);
PathTraceRenderer. -
trace: shared ray-tracing layer (TraceSceneworld-space BVH
with filtered closest / any-hit queries, surface interpolation,
material evaluation at a hit, ray-cone texture LOD, Wächter-Binder
ray offsets). -
dump_testscenesexample takes an optional backend + spp. -
Public scene-preparation layer (
prepare):PreparedScene—
world-space de-indexedDrawItems (triangles / lines / points) with
animation sampled at a time, morph weights, CPU skinning, generated
flat normals / tangents, CCW-front winding; resolved material and
texture tables; world-spaceKHR_lights_punctuallights
(PreparedLight::sample= spec attenuation) with the options light as
fallback; scene camera instances. Shared by every backend and the GPU
backend. -
Public camera (
camera::Camera):resolve(scene camera or
auto-frame / orbit),from_scene_camera,projection_matrix/
view_projectionwithDepthRange::{NegOneToOne, ZeroToOne}. -
Textures (
texture):TextureResolvertrait,TextureCache,
RegistryTextureResolver(registry feature; decodes via an
oxideav_core::RuntimeContext+oxideav-pixfmt), built-in raw RGBA8
container, sRGB / linear mip chains, glTF-sampler CPU sampling
(wrap modes, nearest / bilinear / trilinear, derivative LOD). -
HDR (
hdr):HdrImage,Renderer::render_hdr,ToneMap::{Clamp, Reinhard, AcesFitted},exposure. -
ShadingMode::Pbrin the scanline backend: glTF 2.0 Appendix B
metallic-roughness BRDF (publicbrdfmodule), base colour /
metallic-roughness / normal / occlusion / emissive textures, vertex
colours,KHR_materials_unlit/_emissive_strength/_ior,
multiple punctual lights + ambient, OPAQUE / MASK / BLEND (sorted,
over-composited), double-sided vs back-face culling, optional shadow
maps for directional / spot lights with PCF. -
RenderOptions:tone_map,exposure,time,animation,
scene_camera,use_scene_lights,ambient,shadows,
shadow_map_size,material_variant. -
RenderOptions::camera_target_offsetpans the auto-frame / orbit
camera; an orbitCameraSpec::distancenow zooms orthographic
views;Renderer::set_texture_resolver(default no-op, implemented
by the scanline backend) gives any backend a texture decoder. -
Raycast
ShadingMode::Pbr: the Whitted ray tracer now renders the
sharedPreparedScene(animation, morphs, skinning) through
Camera::resolveand the newtracelayer, evaluating the scanline
glTF formulas at every hit (all texture slots, vertex colours, normal
maps,KHR_texture_transform, unlit, emissive, double-sided /
culled back faces) — pixel-identical to scanline without secondary
rays — plus ray-traced hard shadows for every light type (MASK /
BLEND / transmission aware), MASK any-hit filtering, BLEND by
continued rays composited in linear space, Fresnel-weighted mirror
reflection with a roughness cut-off, and refraction through
KHR_materials_transmission(thin-walled) /KHR_materials_volume
(Snell, total internal reflection, Beer–Lambert absorption).
Texture LOD from ray differentials on camera rays, ray cones after
bounces. -
RaycastRenderer: nativerender_hdr,set_texture_resolver,
with_texture_resolver,texture_cache_mut. -
RenderOptions::max_ray_depth(default 4) and
RenderOptions::reflection_roughness_cutoff(default 0.5). -
traceadditions:TexLod::Grad+TraceScene::barycentric_differentials
(ray differentials),material_oriented,shadow_transmittance,
direct_light,with_build_options,reflect/refract/
schlick/barycentric_of/pixel_spread. -
tests/raycast_pbr.rs: scanline parity on eight test scenes,
shadow, reflection, refraction, MASK / BLEND, HDR and resolver tests. -
testscenes: procedural reference scenes + image metrics for
cross-backend tests;tests/scanline_pbr.rsproperty suite with raw
goldens;examples/dump_testscenes.
Changed
- Raycast backend rebuilt on the prep + trace layers: framing, posing
and lighting match scanline / GPU; every mode resolves through the
scanline frame contract (linear SSAA, tone map, verbatim
background); 16×16 tiles onstd::thread::scopeworkers with an
atomic queue (deterministic); object-median BVH when few rays per
triangle are traced, binned SAH otherwise. Legacy modes keep their
output (Phongkeeps its Whitted rays). Lines / points stay
invisible to rays. - Scanline backend rebuilt on the prep layer: homogeneous frustum
clipping (triangles crossing the near plane are clipped instead of
dropped), perspective-correct interpolation, top-left fill rule
(crack-free shared edges), visibility buffer with one shade per
pixel in linearf32, premultiplied SSAA resolve, band-parallel
std::thread::scopeworkers with deterministic output.
ScanlineRenderernow owns aTextureCache
(with_texture_resolver). Legacy shading modes keep their output.