pub struct DrawOrder {
pub layer: DrawLayer,
pub queue: i32,
pub depth_write: bool,
}Expand description
core.draw_order: where a material’s surfaces come in the source’s draw sequence. queue is that sequence across
every layer, lower first, on core’s own scale: DrawOrder::OPAQUE 2000, DrawOrder::CUTOUT 2450,
DrawOrder::SKY 2900 and DrawOrder::TRANSPARENT 3000 are where a layer’s surfaces come by default (the sky
has no alpha mode that implies it: a source states it), and a lowering places a source’s
own sequence on this scale (a source whose numbers are already on it keeps them). One scale for every layer, so a
source can order a surface of one layer among another’s. Within one queue, surfaces draw in entity order, then
primitive order: the source order readers keep.
depth_write: whether the source draws the surface writing depth (a blended surface may, where the source draws it
among opaque ones), so a consumer orders and composites it as the source does.
A material without it draws by its alpha mode (DrawOrder::of), and is never a decal: that is a fact the
source states.
Fields§
§layer: DrawLayer§queue: i32§depth_write: boolImplementations§
Source§impl DrawOrder
impl DrawOrder
Sourcepub const OPAQUE: i32 = 2000
pub const OPAQUE: i32 = 2000
Core’s default queues of the layers, which a material’s alpha mode implies where the source states no order.
pub const CUTOUT: i32 = 2450
Sourcepub const SKY: i32 = 2900
pub const SKY: i32 = 2900
The sky’s default queue: after every opaque, alpha-tested and decal surface, before the blended ones.
pub const TRANSPARENT: i32 = 3000
Sourcepub fn conventional(layer: DrawLayer, queue: i32) -> DrawOrder
pub fn conventional(layer: DrawLayer, queue: i32) -> DrawOrder
A draw order with the conventional depth write of its layer (glTF’s): opaque and alpha-tested surfaces write depth, decals and blended ones do not. For a source that states the layer and queue but not the depth write.
Trait Implementations§
Source§impl Component for DrawOrder
impl Component for DrawOrder
const NAME: &'static str = "core.draw_order"
Source§const GEOMETRY: Geometry = crate::Geometry::None
const GEOMETRY: Geometry = crate::Geometry::None
Geometry). Stated by every component,
with no default, so data that describes a mesh can’t be left behind by an edit of it unawares: the World’s edit
paths take it from there.Source§fn to_json(&self) -> Result<Option<Value>, JsonError>
fn to_json(&self) -> Result<Option<Value>, JsonError>
Ok(None) for components
that are not shown (bulk data, handles). The view must never lose a value: components that can be shown
derive serde::Serialize and return crate::json::to_value(self).map(Some), which refuses non-finite
floats instead of writing them as null.Source§fn verify(&self, _e: Entity, _w: &World) -> Result<(), String>
fn verify(&self, _e: Entity, _w: &World) -> Result<(), String>
e (indices in range, stream lengths equal, …). The pass manager
runs it on every component after the reader, after every pass and before the writer, together with the
world’s own check that every entity of Component::references is alive. World-wide rules (one name -> one
payload) are pass::Validators instead.Source§fn references(&self, _out: &mut Vec<Entity>)
fn references(&self, _out: &mut Vec<Entity>)
out: the edges
World::closure follows. A component holding entity references must declare every one of them.Source§fn payload_bytes(&self) -> u64
fn payload_bytes(&self) -> u64
Source§fn remap_primitives(&self, _from: &[usize]) -> Option<Result<Self, String>>
fn remap_primitives(&self, _from: &[usize]) -> Option<Result<Self, String>>
Geometry::PerPrimitive, Geometry::PerVertex): new primitive i comes from old primitive
from[i] (a source may repeat, when a primitive is split, or be absent, when one is dropped). Such a component
always answers (a value holding nothing per primitive answers with itself); None, the default, is for
components of Geometry::None, and World::remap_primitives refuses a dependent component that gives it.
An index the component does not have is an error. remap_list does the work for a list with one entry per
primitive.Source§fn remap_vertices(
&self,
_primitive: usize,
_from: &[u32],
) -> Option<Result<Self, String>>
fn remap_vertices( &self, _primitive: usize, _from: &[u32], ) -> Option<Result<Self, String>>
primitive were compacted or reordered, for a
component that holds something per vertex (Geometry::PerVertex): new vertex i of that primitive is old
vertex from[i] (a source may repeat or be absent). Such a component always answers (with itself when it holds
nothing for that primitive); None, the default, is for the others, and World::remap_vertices refuses a
per-vertex component that gives it. An index the component does not have is an error. Every pass that compacts
or reorders a primitive’s vertices calls World::remap_vertices. After a rebuild of the primitive list
(World::rebuild_primitives, Component::remap_primitives) a primitive’s per-vertex data is its source
primitive’s, and the vertex map is relative to that source.Source§fn blend_vertices(
&self,
_primitive: usize,
_from: &[VertexBlend],
) -> Option<Result<Self, String>>
fn blend_vertices( &self, _primitive: usize, _from: &[VertexBlend], ) -> Option<Result<Self, String>>
primitive were rebuilt as blends of old ones
(VertexBlend), for a component that holds something per vertex (Geometry::PerVertex): new vertex i
is the combination from[i] of old vertices, in whatever way the component’s data combines (a morph target’s
delta is interpolated, the way the surface it moves is). It answers as Component::remap_vertices does: with
itself when it holds nothing for that primitive; None, the default, is for a component that does not know how
to combine its data, and World::blend_vertices refuses a per-vertex component that gives it. An index the
component does not have is an error. A vertex that is a copy of one old vertex (VertexBlend::copy) is the
case Component::remap_vertices states, and a component answering one answers the other alike.Source§fn apply_linear(&self, _l: &Linear) -> Linearity<Self>
fn apply_linear(&self, _l: &Linear) -> Linearity<Self>
l (a pass that bakes a placement’s mirror or
shear into a copy of its geometry, so transforms stay rigid). World::apply_linear calls it for every
component of the entity. The default is Linearity::Unsupported: a component that holds local-space
geometry and does not say how it follows is never silently left behind; one without geometry says
Linearity::Invariant.Source§fn restate(&self, _resolved: &Resolved<'_>) -> Restated<Self>
fn restate(&self, _resolved: &Resolved<'_>) -> Restated<Self>
resolve-state (crate::state::ResolveState) gave the axes in resolved their values: a
component that holds crate::state::Clauses of its own (a record of parts each present in some states) reduces
them as core.condition is reduced (crate::state::Resolved::reduce: a clause that fails is dropped, a clause
left with no literal holds whatever the other axes are). Restated::Absent says the entity is not present in
this state (every clause failed): it is despawned as one whose core.condition fails is. The default holds no
clause: Restated::Unchanged.impl Copy for DrawOrder
impl Eq for DrawOrder
impl StructuralPartialEq for DrawOrder
Auto Trait Implementations§
impl Forget for DrawOrder
impl Freeze for DrawOrder
impl RefUnwindSafe for DrawOrder
impl Send for DrawOrder
impl Sync for DrawOrder
impl Unpin for DrawOrder
impl UnsafeUnpin for DrawOrder
impl UnwindSafe for DrawOrder
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.