#[repr(C)]pub struct LineVertex {
pub position: [f32; 3],
pub color: [f32; 4],
pub line_normal: [f32; 2],
pub line_distance: f32,
pub cap_join: f32,
}Expand description
A vertex for the dedicated line GPU pipeline.
Extends the basic vector vertex with per-vertex distance along the polyline centreline, an extrusion normal, and a cap/join flag. The fragment shader uses the distance for dash-pattern evaluation and the cap/join flag to switch between linear edge AA (ribbon body) and SDF circle-based AA (round caps/joins).
Fields§
§position: [f32; 3]Position [x, y, z] in camera-relative meters.
color: [f32; 4]Per-vertex RGBA color.
line_normal: [f32; 2]Extrusion normal [nx, ny] perpendicular to the line centreline.
For ribbon body vertices the magnitude is 1.0. For round cap/join fan vertices the magnitude is slightly > 1.0 (circumscribed) so that the SDF clip at magnitude 1.0 traces a perfect circle.
line_distance: f32Distance along the polyline centreline (world-space meters).
cap_join: f32Cap/join flag: 1.0 for round cap/join fan vertices, 0.0 for
ribbon body. When > 0.5, the fragment shader uses SDF circle AA
instead of linear edge AA and discards fragments beyond the
ideal circle boundary.
Implementations§
Source§impl LineVertex
impl LineVertex
Sourcepub fn layout() -> VertexBufferLayout<'static>
pub fn layout() -> VertexBufferLayout<'static>
Vertex buffer layout for the line pipeline.
Trait Implementations§
Source§impl Clone for LineVertex
impl Clone for LineVertex
Source§fn clone(&self) -> LineVertex
fn clone(&self) -> LineVertex
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for LineVertex
impl Debug for LineVertex
impl Copy for LineVertex
impl Pod for LineVertex
Auto Trait Implementations§
impl Freeze for LineVertex
impl RefUnwindSafe for LineVertex
impl Send for LineVertex
impl Sync for LineVertex
impl Unpin for LineVertex
impl UnsafeUnpin for LineVertex
impl UnwindSafe for LineVertex
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
Source§type Bits = T
type Bits = T
Self must have the same layout as the specified Bits except for
the possible invalid bit patterns being checked during
is_valid_bit_pattern.Source§fn is_valid_bit_pattern(_bits: &T) -> bool
fn is_valid_bit_pattern(_bits: &T) -> bool
bits
as &Self.