Expand description
Complete BRDF (Bidirectional Reflectance Distribution Function) library.
Pure CPU math — no GPU types. All functions use glam::{Vec2, Vec3} and
bare f32. Organised into:
distribution— microfacet normal-distribution functions (D)geometry— masking/shadowing functions (G)fresnel— Fresnel reflectance functions (F)vec3— Vec3 helpers used throughout- [
brdf] — full BRDF evaluators (Cook-Torrance, Lambertian, …) ibl— image-based lighting helpers- [
lights] — light types and shading loop tonemap— tone-mapping operators- [
glsl] — GLSL source generation
Re-exports§
pub use tonemap::ToneMapOp;
Modules§
- distribution
- Microfacet normal-distribution functions.
- fresnel
- Fresnel reflectance functions.
- geometry
- Microfacet masking-shadowing functions.
- ibl
- Image-based lighting helpers.
- tonemap
- Tone-mapping operators for converting HDR radiance to display-ready LDR.
- vec3
- Lightweight Vec3 helper functions used throughout the BRDF library.
Structs§
- Anisotropic
Brdf - Anisotropic GGX BRDF.
- Area
Light - Rectangular area light using the Linearly Transformed Cosines (LTC) approach.
- Brdf
Glsl - Generates GLSL source strings for the BRDF functions in this module.
- Clearcoat
Brdf - Clearcoat BRDF layer — a thin dielectric coat on top of the base material.
- Cook
Torrance Brdf - Cook-Torrance specular BRDF combined with Lambertian diffuse.
- Directional
Light - Directional (sun-like) light — no position, infinite distance.
- Lambertian
Brdf - Lambertian (perfectly diffuse) BRDF.
- Oren
Nayar Brdf - Oren-Nayar BRDF for rough diffuse surfaces.
- Point
Light - Omnidirectional point light.
- Shade
Material - Combined material description used by
shade_point. - Simple
Rng - Simple xorshift32 PRNG used for Monte Carlo BRDF sampling. Not suitable for cryptography — only for rendering randomness.
- Spot
Light - Spot light — cone-shaped.
Enums§
- Light
- Light enum for the shading loop.
Functions§
- shade_
point - Full shading of a surface point given material, lights, geometry, and an optional IBL environment.