Skip to main content

Module materials

Module materials 

Source
Expand description

Material system for surface rendering.

Materials define how surfaces are shaded. Blendable materials (clay, wax, candy, flat) use 4-channel matcap textures (R/G/B/K) for color-tinted lighting. Static materials (mud, ceramic, jade, normal) use a single matcap texture for all channels.

Structs§

MatcapTextureSet
Pre-built GPU resources for a matcap material.
Material
A material definition for rendering.
MaterialRegistry
Registry for managing materials.
MaterialUniforms
GPU-compatible material uniforms.

Functions§

create_matcap_bind_group_layout
Create the matcap bind group layout (5 entries: 4 textures + 1 sampler).
create_matcap_sampler
Create a linear filtering sampler for matcap textures.
decode_matcap_image_from_file
Decode an image file from disk into float RGBA pixel data.
init_matcap_textures
Initialize all matcap textures and bind groups.
upload_matcap_texture
Upload a decoded matcap image as a GPU texture.