Skip to main content

Module texture3d

Module texture3d 

Source
Expand description

Texture resources, sampler state, and per-triangle sampling for the 3D path.

The 3D rasterizer previously had no way to represent an image on a mesh, so tile imagery could not be drawn at all. This module provides the minimum a renderer needs: an RGBA texture store with stable handles, sampler state (filter and address mode), and a UV transform that maps a tile’s sub-rect of a loaded ancestor texture onto a unit quad.

Sampling is perspective correct: callers interpolate u/w and v/w alongside 1/w, then divide. See crate::rasterizer3d.

Structs§

SamplerDesc
Sampler state for one texture.
Texture
A stored texture: payload plus sampler state.
TextureData
A described texture payload.
TextureDesc
Immutable texture description.
TextureId
Opaque handle to a texture in a TextureStore.
TextureStore
Registry of textures addressable by TextureId.
UvTransform
An affine transform applied to texture coordinates before sampling.

Enums§

AddressMode
Out-of-range behaviour for texture coordinates.
FilterMode
Minification and magnification filtering.
TextureFormat
Pixel layout of a texture.

Functions§

sample_bilinear_clamped
Bilinear sample with clamped addressing, the tile path.
sample_texture
Samples one texture. Pure function so the rasterizer can call it per pixel without touching the store’s hash map.