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§
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
impl Mesh3DRenderMode
Sourcepub fn parse(s: &str) -> Result<Mesh3DRenderMode, String>
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
impl Clone for Mesh3DRenderMode
impl Copy for Mesh3DRenderMode
Source§impl Debug for Mesh3DRenderMode
impl Debug for Mesh3DRenderMode
Source§impl Default for Mesh3DRenderMode
impl Default for Mesh3DRenderMode
impl Eq for Mesh3DRenderMode
Source§impl PartialEq for Mesh3DRenderMode
impl PartialEq for Mesh3DRenderMode
impl StructuralPartialEq for Mesh3DRenderMode
Auto Trait Implementations§
impl Freeze for Mesh3DRenderMode
impl RefUnwindSafe for Mesh3DRenderMode
impl Send for Mesh3DRenderMode
impl Sync for Mesh3DRenderMode
impl Unpin for Mesh3DRenderMode
impl UnsafeUnpin for Mesh3DRenderMode
impl UnwindSafe for Mesh3DRenderMode
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.