sgl-3d 0.2.0

Caller-driven 3D rendering for SGL games, native and in the browser (WebGPU)
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// A light as it reaches one receiver point, as Filament's Light: the unit
// direction toward the light, the radiance it brings, the fraction of it
// that is unoccluded, and the scale of its specular lobes (Godot's
// light_specular; 1 is physical). Each light builds one for the point, and
// surface_direct_light (surface.wgsl) shades it. A sample with zero
// visibility does not reach the point. A rectangle's names its scene light,
// whose face surface_direct_light integrates, and its radiance is the face's
// luminance; any other light's is NO_RECT_LIGHT.
struct LightSample {
 direction:vec3<f32>,
 radiance:vec3<f32>,
 visibility:f32,
 specular:f32,
 rect:u32,
}
const NO_RECT_LIGHT:u32=0xffffffffu;