Expand description
3D primitives and lighting using the shared mesh renderer.
Geometry, materials, scenes, cameras, textures, transforms and depth remain
shared with 2D. This crate supplies surface-lighting equations and 3D geometry.
Lighting adds ambient and directional diffuse/specular lighting, with
optional tangent-space or object-space normal maps and masked paint.
Unlit shapes can share the same scene.
Structs§
- Light
Parameters - World-space light and viewer. RGB intensities use linear light units.
- Lighting
- Reusable lighting pipelines, shared normal-map fallback and light uniforms.
- Lighting
Error - Invalid light or surface parameters. Values must be finite; intensities and normal strength nonnegative, and shininess at least one.
- Material
Settings - Blinn–Phong surface parameters. Vertex/instance colors are linear RGB.
Enums§
- Albedo
Mode - How linear vertex/instance RGB combines with the base color texture.
- Normal
Error - Invalid triangle mesh supplied to
recalculate_normals. - Normal
Space - Coordinate frame used by the RGB normal map.
- NormalY
- Green-channel convention in a tangent-space normal map.
Traits§
- Shapes3d
- Solid primitives using shared meshes, fills, transforms and depth policies.
Functions§
- cylinder_
mesh - CPU geometry for a closed unit-radius cylinder, Z from -0.5 to 0.5.
- recalculate_
normals - Area-weighted normals, smoothing only vertices that share an index.