Skip to main content

Mesh3DRenderMode

Enum Mesh3DRenderMode 

Source
#[non_exhaustive]
pub enum Mesh3DRenderMode { Flat, Wireframe, Gouraud, Phong, NormalDebug, DepthDebug, }
Expand description

-render MODE value. Selects which surface model the 3D→raster renderer uses when the user pairs a 3D input (.stl/.obj/ .gltf/.glb/.usdz) with a raster output (.png/.jpg/ .bmp/.webp).

Default is Flat — one constant colour per primitive derived from the material’s base_color (or a fallback grey when no material is attached). Gouraud and Phong add per-vertex / per-pixel lighting using either the primitive’s stored vertex normals or face normals computed from the triangle vertices when none are provided. NormalDebug and DepthDebug are diagnostic visualisations that bypass the lighting equation entirely — useful when normals look wrong, a Z-fighting glitch shows up, or the camera framing seems off.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Flat

Flat-shaded triangles, one colour per primitive (no per-pixel lighting). Cheapest mode and the default.

§

Wireframe

Wireframe — only triangle edges are drawn, interior pixels stay at the background. Same colour-per-primitive as Flat.

§

Gouraud

Gouraud — light is evaluated at each vertex using the per-vertex normal, then the resulting RGB is bilinearly interpolated across the triangle. Requires (or computes) one normal per vertex.

§

Phong

Phong — the per-vertex normal is interpolated across the triangle and the lighting equation is evaluated per pixel. Smoother than Gouraud at the cost of one normalise + dot per fragment.

§

NormalDebug

NormalDebug — paint each pixel with the world-space interpolated normal mapped into RGB ([r,g,b] = (n + 1) / 2 * 255). Light / camera / material settings are ignored. Useful for inspecting whether per-vertex normals were loaded correctly or whether the face-normal fallback is firing.

§

DepthDebug

DepthDebug — paint each pixel a grayscale value derived from the interpolated NDC z (near = white, far = black). Light / camera orbit / material settings are ignored; useful for spotting Z-fighting and for picking sane near/far planes.

Implementations§

Source§

impl Mesh3DRenderMode

Source

pub fn parse(s: &str) -> Result<Mesh3DRenderMode, String>

Parse the value after -render. Accepts case-insensitive flat / wireframe / gouraud / phong / normal-debug / depth-debug. wire is a short alias for wireframe; shaded aliases flat; normal / normals alias normal-debug; depth / z alias depth-debug.

Trait Implementations§

Source§

impl Clone for Mesh3DRenderMode

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for Mesh3DRenderMode

Source§

impl Debug for Mesh3DRenderMode

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Mesh3DRenderMode

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Eq for Mesh3DRenderMode

Source§

impl PartialEq for Mesh3DRenderMode

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Mesh3DRenderMode

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V