Class ShaderNode

java.lang.Object
com.jme3.shader.ShaderNode
All Implemented Interfaces:
Savable, Cloneable

public class ShaderNode extends Object implements Savable, Cloneable
A ShaderNode is the unit brick part of a shader program. A shader can be described by several shader nodes that are plugged together through inputs and outputs. A ShaderNode is based on a definition that has a shader code, inputs and output variables. This node can be activated based on a condition, and has input and output mapping. This class is not intended to be used by JME users directly. It's the structure for loading shader nodes from a J3md material definition file
  • Constructor Details

    • ShaderNode

      public ShaderNode(String name, ShaderNodeDefinition definition, String condition)
      Creates a shader node.
      Parameters:
      name - the name.
      definition - the shader node definition.
      condition - the condition to activate this node.
    • ShaderNode

      public ShaderNode()
      Creates a shader node.
  • Method Details

    • getName

      public String getName()
      Gets the name of the node.
      Returns:
      the name of the node
    • setName

      public void setName(String name)
      Sets the name of the node.
      Parameters:
      name - the name of the node.
    • getDefinition

      public ShaderNodeDefinition getDefinition()
      Returns the shader node definition.
      Returns:
      the shader node definition.
    • setDefinition

      public void setDefinition(ShaderNodeDefinition definition)
      Sets the shader node definition.
      Parameters:
      definition - the shader node definition.
    • getCondition

      public String getCondition()
      Gets the condition.
      Returns:
      the condition.
    • setCondition

      public void setCondition(String condition)
      Sets the condition.
      Parameters:
      condition - the condition.
    • getInputMapping

      public List<VariableMapping> getInputMapping()
      Returns a list of variable mapping representing the input mappings of this node.
      Returns:
      the input mappings.
    • setInputMapping

      public void setInputMapping(List<VariableMapping> inputMapping)
      Sets the input mappings.
      Parameters:
      inputMapping - the input mappings.
    • getOutputMapping

      public List<VariableMapping> getOutputMapping()
      Returns a list of variable mapping representing the output mappings of this node.
      Returns:
      the output mappings.
    • setOutputMapping

      public void setOutputMapping(List<VariableMapping> outputMapping)
      Sets the output mappings.
      Parameters:
      outputMapping - the output mappings.
    • write

      public void write(JmeExporter ex) throws IOException
      jme serialization
      Specified by:
      write in interface Savable
      Parameters:
      ex - the exporter
      Throws:
      IOException - from the exporter
    • read

      public void read(JmeImporter im) throws IOException
      jme serialization
      Specified by:
      read in interface Savable
      Parameters:
      im - the importer
      Throws:
      IOException - from the importer
    • toString

      public String toString()
      convenience toString
      Overrides:
      toString in class Object
      Returns:
      a string
    • clone

      public ShaderNode clone() throws CloneNotSupportedException
      Overrides:
      clone in class Object
      Throws:
      CloneNotSupportedException