Skip to main content

Crate wgame_gfx_3d

Crate wgame_gfx_3d 

Source
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§

LightParameters
World-space light and viewer. RGB intensities use linear light units.
Lighting
Reusable lighting pipelines, shared normal-map fallback and light uniforms.
LightingError
Invalid light or surface parameters. Values must be finite; intensities and normal strength nonnegative, and shininess at least one.
MaterialSettings
Blinn–Phong surface parameters. Vertex/instance colors are linear RGB.

Enums§

AlbedoMode
How linear vertex/instance RGB combines with the base color texture.
NormalError
Invalid triangle mesh supplied to recalculate_normals.
NormalSpace
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.

Type Aliases§

LitMaterial
LitMesh