pub enum NodeType {
Show 62 variants
Color,
Texture,
VertexPosition,
VertexNormal,
Time,
CameraPos,
GameStateVar,
Translate,
Rotate,
Scale,
WorldToLocal,
LocalToWorld,
Add,
Sub,
Mul,
Div,
Dot,
Cross,
Normalize,
Length,
Abs,
Floor,
Ceil,
Fract,
Mod,
Pow,
Sqrt,
Sin,
Cos,
Tan,
Atan2,
Lerp,
Clamp,
Smoothstep,
Remap,
Step,
Fresnel,
Dissolve,
Distortion,
Blur,
Sharpen,
EdgeDetect,
Outline,
Bloom,
ChromaticAberration,
HSVToRGB,
RGBToHSV,
Contrast,
Saturation,
Hue,
Invert,
Posterize,
GradientMap,
Perlin,
Simplex,
Voronoi,
FBM,
Turbulence,
MainColor,
EmissionBuffer,
BloomBuffer,
NormalOutput,
}Expand description
All supported shader node types.
Variants§
Color
Texture
VertexPosition
VertexNormal
Time
CameraPos
GameStateVar
Translate
Rotate
Scale
WorldToLocal
LocalToWorld
Add
Sub
Mul
Div
Dot
Cross
Normalize
Length
Abs
Floor
Ceil
Fract
Mod
Pow
Sqrt
Sin
Cos
Tan
Atan2
Lerp
Clamp
Smoothstep
Remap
Step
Fresnel
Dissolve
Distortion
Blur
Sharpen
EdgeDetect
Outline
Bloom
ChromaticAberration
HSVToRGB
RGBToHSV
Contrast
Saturation
Hue
Invert
Posterize
GradientMap
Perlin
Simplex
Voronoi
FBM
Turbulence
MainColor
EmissionBuffer
BloomBuffer
NormalOutput
Implementations§
Source§impl NodeType
impl NodeType
Sourcepub fn display_name(&self) -> &'static str
pub fn display_name(&self) -> &'static str
Human-readable display name.
Sourcepub fn is_pure_math(&self) -> bool
pub fn is_pure_math(&self) -> bool
Whether this node is a pure math operation (eligible for constant folding).
Sourcepub fn is_source(&self) -> bool
pub fn is_source(&self) -> bool
Whether this node is a source that requires no inputs from other nodes.
Sourcepub fn instruction_cost(&self) -> u32
pub fn instruction_cost(&self) -> u32
Estimated GPU instruction cost of this node (for budgeting).
Sourcepub fn default_inputs(&self) -> Vec<Socket>
pub fn default_inputs(&self) -> Vec<Socket>
Build the default input sockets for this node type.
Sourcepub fn default_outputs(&self) -> Vec<Socket>
pub fn default_outputs(&self) -> Vec<Socket>
Build the default output sockets for this node type.
Sourcepub fn generate_glsl(
&self,
var_prefix: &str,
input_vars: &[String],
) -> GlslSnippet
pub fn generate_glsl( &self, var_prefix: &str, input_vars: &[String], ) -> GlslSnippet
Generate the GLSL code snippet for this node.
var_prefix is the unique variable name prefix for this node instance (e.g., “n42”).
input_vars maps input socket index to the GLSL expression feeding it.
Returns a vector of (line_of_code, output_socket_index).
Trait Implementations§
impl StructuralPartialEq for NodeType
Auto Trait Implementations§
impl Freeze for NodeType
impl RefUnwindSafe for NodeType
impl Send for NodeType
impl Sync for NodeType
impl Unpin for NodeType
impl UnsafeUnpin for NodeType
impl UnwindSafe for NodeType
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
Mutably borrows from an owned value. Read more
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>
Convert
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>
Convert
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)
Convert
&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)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.