pub enum MaterialOp {
Show 23 variants
InputColor,
ConstantColor {
r: f32,
g: f32,
b: f32,
a: f32,
},
SampleTexture {
tex_index: u32,
},
PremultipliedBlend,
SDFRoundRect,
SDFEllipse,
LinearGradient {
start: [f32; 4],
end: [f32; 4],
},
RadialGradient {
start: [f32; 4],
end: [f32; 4],
},
LinearGradientMulti {
stops: Vec<[f32; 4]>,
angle: f32,
},
RadialGradientMulti {
stops: Vec<[f32; 4]>,
center: [f32; 2],
},
NeonGlow {
radius: f32,
intensity: f32,
},
GlassBlur,
LayerBlend {
mode: BlendMode,
},
PBRLighting,
DropShadow,
NineSlice,
Heatmap,
Raymarch {
shape: RaymarchShape,
},
Lightning,
RuneGlow,
RaymarchReflections,
Stroke,
DashedStroke,
}Expand description
An operation node in the material graph.
Variants§
InputColor
Input: base color from vertex. Output: Color
ConstantColor
Output: constant color from uniform. Parameters: rgba Output: Color
SampleTexture
Input: UV from vertex. Output: sample result Color
PremultipliedBlend
Premultiplied alpha blend (for font atlas). Inputs: color (Color), alpha (Float from texture) Output: Color
SDFRoundRect
SDF rounded rectangle mask. Inputs: none (reads vertex logical, size, radius) Output: Mask
SDFEllipse
SDF ellipse mask. Output: Mask
LinearGradient
Linear gradient between two colors. Input: t (Float, typically UV-based) Output: Color
RadialGradient
Radial gradient. Input: dist (Float) Output: Color
LinearGradientMulti
Multi-stop linear gradient. Uploads stops as a texture, interpolates per-pixel in the shader. stops: Vec of [r, g, b, a] where a encodes the stop position (0.0-1.0). angle: gradient direction in radians.
RadialGradientMulti
Multi-stop radial gradient. stops: Vec of [r, g, b, a] where a encodes the stop position (0.0-1.0). center: normalized center point [x, y] in [0.0, 1.0].
NeonGlow
Neon glow effect. Input: dist (Float), color (Color) Output: Color
GlassBlur
Glass fresnel refraction. Inputs: uv (Vec2), blur_mip (Float) Output: Color
LayerBlend
Layer two inputs with a blend mode. Inputs: bottom (Color), top (Color), opacity (Float) Output: Color
Fields
mode: BlendModePBRLighting
PBR lighting. Input: normal (Vec3), metallic (Float), roughness (Float), opacity (Float) Output: Color
DropShadow
Drop shadow. Inputs: uv (Vec2), size (Vec2), radius (Float) Output: Mask
NineSlice
9-slice UV remapping. Input: uv (Vec2) Output: Vec2
Heatmap
Heatmap palette lookup. Input: value (Float) Output: Color
Raymarch
Raymarched SDF shape. Output: Color
Fields
shape: RaymarchShapeLightning
RuneGlow
RaymarchReflections
Stroke
DashedStroke
Trait Implementations§
Source§impl Clone for MaterialOp
impl Clone for MaterialOp
Source§fn clone(&self) -> MaterialOp
fn clone(&self) -> MaterialOp
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for MaterialOp
impl RefUnwindSafe for MaterialOp
impl Send for MaterialOp
impl Sync for MaterialOp
impl Unpin for MaterialOp
impl UnsafeUnpin for MaterialOp
impl UnwindSafe for MaterialOp
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<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more