Notch Notch
Manual 1.0 Manual 0.9.23
 Light | Dark
Editable Code

Editable Code

Updated: 11 Jul 2024

Generates a shape for a procedural system from custom code.

image

image

Method #

This node allows a custom piece of HLSL code to be written to produce a distance value from which a procedural shape will be created. For best results with this node you should have a working knowledge of the HLSL shading language, and signed distance fields.

IMPORTANT: The custom code is inserted into a larger HLSL function, and therefore creating functions is not supported.

Example #

localPos.y += param2 * sin( 1.0 * localPos.x + param1 * 2.4 ) * param0;
localPos.x += param2 * sin( 1.0 * localPos.z + param1 * 2.4 ) * param0;

sdfValue = length(max(abs(localPos) - 1.0, 0.0 ));

Nodes connected to this node will generally follow the parent child hierarchy. Other Procedural Generator nodes can be configured to combine with this shape using their CSG modes, and displacement nodes will only apply to this shape.

Parameters

These properties control the 3D transforms of the node. Transforms will generally be inherited by child nodes, although they can be ignored through the Inherit Transform Channels attributes.

ParameterDetails
Position XThe objects position along the local x-axis.
Position YThe objects position along the local y-axis.
Position ZThe objects position along the local z-axis.
Rotation HeadingThe objects rotation around the local y-axis.
Rotation PitchThe objects rotation around the local x-axis.
Rotation BankThe objects rotation around the local z-axis.
Scale XThe objects scale along the local x-axis.
Scale YThe objects scale along the local y-axis.
Scale ZThe objects scale along the local z-axis.

Control the inheritance of the transforms from the parent.

ParameterDetails
PositionToggle inheritance of the Position from the parent.
RotationToggle inheritance of the Rotation from the parent.
ScaleToggle inheritance of the Scale from the parent.
World Position OnlyInherit the world position from the parent only, rotation and scale will be ignored. Overrides above properties.
Inherit TimeToggle inheritance of time from the parent.

These properties control the core behaviours of the node.

ParameterDetails
CodeType your code here
Param 0Variable that can be used in the code
Param 1Variable that can be used in the code
Param 2Variable that can be used in the code
CSG ModeThese options change how a this procedural node combines with the existing of the procedural system.
  • Replace : Replaces the previous procedural system with a new procedural shape.
  • Union : Simply combines both the new procedural shape and the existing procedural system.
  • Intersection : Interesects the new shape with the shape before.
  • Subtract : Subtracts the new procedural shape from the existing procedural system.
  • Blend : Blends between both the new procedural shape and the existing procedural system, driven by the CSG Blend Weight.
  • Union Blend : A combination of union and blend which tries to preserve both objects more, with the blending being driven by the CSG Blend Weight.
  • Smooth Union : The new procedural is added to the old, and smoothing (driven by the CSG Blend Weight) is applied to the outcome.
  • Smooth Subtract : The new procedural shape is subtracted from the existing procedural system, and smoothing (driven by the CSG Blend Weight) is applied to the outcome.
  • Offset : Blends one procedural ontop of the other another withing the area of the original procedural system.
  • Custom Code : Allows you to enter your own expression code.
CSG Blend WeightHow much the new procedural blends with the old procedurals, depending on the CSG Blend Weight.
Affect ColourAffect the colour of the generated procedural system. only functions with ‘Generate Colours’ enabled in some Procedural Render nodes.
Always EnabledWhen enabled, this node will run regardless of time bar enable/disable. Due to how Notch handles shader generation with procedurals, with this enabled the node runs more efficiently.
Material ColourModify the colour for the procedural material.
Custom CSG CodeType your Custom code here, using the HLSL language. Read more on Editable Code.

Inputs

NameDescriptionTypical Input
Transform ModifiersApply the transforms of another node to this node.Null
Target NodeModifiy the rotations of the node to always direct the z axis towards the input.Null
Local Transform OverrideApply the transforms of another node to this node, relative to its parent.Null