pub struct GpuImageQuad {
pub corners: [[f32; 3]; 4],
pub image: usize,
pub tint: [f32; 4],
pub depth_test: bool,
pub alpha_cutoff: f32,
}Expand description
A world-space 2D image-sprite quad for GpuRenderer::draw_images_deferred.
corners are the four world points TL, TR, BL, BR (UVs (0,0) (1,0) (0,1) (1,1)); image indexes a texture uploaded via
GpuRenderer::upload_image; tint is straight RGBA in 0..=1
(multiplied into every texel); depth_test occludes the quad behind
nearer marched geometry. The facade resolves orientation + back-face
culling, so this is pure geometry.
Fields§
§corners: [[f32; 3]; 4]The four world-space corner points in TL, TR, BL, BR order
(voxel units), mapping to UVs (0,0) (1,0) (0,1) (1,1). Need
not be planar-axis-aligned; the quad is split into two
perspective-correct triangles.
image: usizeTexture handle returned by GpuRenderer::upload_image.
Quads referencing an id that was never uploaded are skipped.
tint: [f32; 4]Straight RGBA multiplier 0..=1 applied to every texel
([1.0; 4] = untinted); the combined alpha drives the
over-blend.
depth_test: booltrue ⇒ fragments behind nearer marched scene geometry are
discarded; false ⇒ always drawn on top.
alpha_cutoff: f32Texels with alpha below this (0..=1) are discarded in the FS.
0.0 keeps the plain over-blend.
Trait Implementations§
Source§impl Clone for GpuImageQuad
impl Clone for GpuImageQuad
Source§fn clone(&self) -> GpuImageQuad
fn clone(&self) -> GpuImageQuad
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more