Plugin Help: Custom Shader 3D

Controls Tab:

  • .ShaderTextLabel: Shows or hides the shader text editing inputs. Useful when you are no longer editing the shader and want the screen real estate back.
    • .ShaderTextInputs: Read only listing of the inputs provided by this shader.  Formatted to allow easy copy/paste into ShaderTextBody.
    • .CompileButton: Compiles the Cg shader including Cg inputs.  Each shader is cached with a hash that allows you to store multiple compiled versions of a shader in memory.  With very complex shaders or shader trees, the compiling process may be slow and will temporarily lock up the GUI, but once compiled, the shaders will execute as fast as your GPU will allow.
    • .ExpandText: Momentary buttons to increase or decrease the number of lines available in ShaderTextBody.  Useful for reducing scrolling and optimizing screen real estate.  Not saved with .setting/.comp.
    • .ShaderTextBody: Editable shader text.  This text area does not have syntax highlighting, and in Fusion 7 does not have tab indenting, so for very complex shaders, it may be easier to use an IDE or even just a larger text editor and copy/paste into this.  You can use includes to keep shader code in external files as well. In Fusion 7, you can use the mouse wheel to adjust the font size.
  • UserControls area:  Inputs are displayed here as UserControls, which allow for very easy customization with the UserControls script or with a text editor.
3CuS Controls tab

Config Tab:

  • .RCGroup: Shows or hides the predefined render context inputs.
    • .UseLights: Gets the scene lighting array.  Only needed for material shaders that interact with Fusion’s built in lights.
    • .RCMatrices: Gets several standard render context matrices.  Useful when the shader needs to operate in a space other than eye space, which is the default for the standard fragment interpolants like f.Normal or f.Position.
  • .MaterialGroup: Shows or hides the material creation inputs.
    • .AddMaterialName: Entry for the name of the material to be added.  Names cannot begin with a number, must be unique, and certain keywords are reserved.
    • .AddMaterialInput: Pressing this button validates and creates the named FuFloat4 and adds the corresponding inputs.  A MainInput and an ImageControl are both created and can be used interchangeably.  The input, by default, accepts MtlGraph3D, Image, and Mask types.  This can be modified using the UserControls.
  • .FloatGroup: Shows or hides the float creation inputs.
    • .AddFloatName: Entry for the name of the float to be added.  Names cannot begin with a number, must be unique, and certain keywords are reserved.
    • .AddFloatButton: Pressing this button validates and creates the named float and adds the corresponding inputs.  A SliderControl is created by default.  Any Number control can be substituted and the min, max, default, etc. can also be customized with UserControls.
  • .ColorGroup: Shows or hides the color creation inputs.
    • .AddColorName: Entry for the name of the float to be added.  Names cannot begin with a number, must be unique, and certain keywords are reserved.
    • .AddColorButton: Pressing this button validates and creates the named float4 and adds the corresponding inputs.  A ColorControl is created by default.  This can be customized with UserControls.
  • .BoolGroup: Shows or hides the boolean creation inputs.
    • .AddBoolName: Entry for the name of the float to be added.  Names cannot begin with a number, must be unique, and certain keywords are reserved.
    • .AddBoolButton: Pressing this button validates and creates the named bool and adds the corresponding inputs.  A CheckboxControl is created by default.   This can be customized with UserControls, but the input will be evaluated as True if the Number is > 0.5.
  • .MatrixGroup: Shows or hides the transform matrix creation inputs.
    • .AddMatrixName: Entry for the name of the float to be added.  Names cannot begin with a number, must be unique, and certain keywords are reserved.
    • .AddMatrixButton: Pressing this button validates and creates the named float4x4 and adds the corresponding inputs to a named ControlPage tab.  Each transform matrix added creates a new tab.
  • .MaterialIDNest: Shows or hides the material ID input.
    • .MaterialID: Sets the material ID for this shader. Default 1.
  • .YourCustomInputNameLabel: Created when an input is successfully made.  Read only.
  • .YourCustomInputNameDeleteButton:  Pressing this button will remove the corresponding input.
3CuS Config tab