Detailed Description

A node in a texture generation graph.

Inheritance diagram for Loonim.TextureNode:
Loonim.AbsThreshold Loonim.Billow Loonim.BitmapNode Loonim.Blend Loonim.Bounce Loonim.Box Loonim.Checkerboard Loonim.ClampOutput Loonim.ClippingPath Loonim.CombineHSB Loonim.CombineHSL Loonim.CombineHSY Loonim.CombineLAB Loonim.CombineRGB Loonim.Cylinders Loonim.Edges Loonim.FastNoiseBasis Loonim.FastTurbulence Loonim.Gradient Loonim.GraphNode Loonim.HueSatLum Loonim.Levels Loonim.Linear Loonim.Lookup Loonim.NoiseCurve Loonim.NoisyGradient Loonim.Output Loonim.Perlin Loonim.Property Loonim.Refraction Loonim.Repeat Loonim.RidgedMultifractal Loonim.RotateInput Loonim.RoundedBox Loonim.ScaleInput Loonim.SelectAny Loonim.SelectFalloff Loonim.SineWave Loonim.Square Loonim.Stack Loonim.Std1InputNode Loonim.Std2InputNode Loonim.StdLogicNode Loonim.Threshold Loonim.TranslateInput Loonim.Turbulence Loonim.Voronoi Loonim.WrapClip

Public Member Functions

float[] Bake (int size)
 Bakes the x axis of this node as a 1D image. More...
 
void Bake (float[] values)
 Bakes the x axis of this node as a 1D image. More...
 
void Bake (Color[] values)
 Bakes the x axis of this node as a 1D image. Note that the red channel is the most important. More...
 
override string ToString ()
 
string ToString (int depth)
 
List< Material > CollectMaterials ()
 
void CollectMaterials (List< Material > into)
 
void AddSource (TextureNode source)
 Adds a new source to this node. More...
 
 TextureNode ()
 
 TextureNode (int sourceCount)
 Create a texture node with the given number of inputs. More...
 
void SubMaterialChanged ()
 Called when this nodes SubMaterialID has changed. More...
 
virtual void Draw (DrawInfo info)
 Allocates GPU drawing meta now. More...
 
virtual DrawStackNode Allocate (DrawInfo info, ref int stackID)
 Allocates GPU drawing meta now. More...
 
void PreAllocate (DrawInfo info)
 Allocates now. More...
 
void DrawGPU (DrawInfo info)
 Draws this node now (but doesn't transfer it into a texture). More...
 
void Draw (DrawInfo info, Texture2D image, ref Color[] pixels)
 Draws this node into the given texture and pixel buffer now. Note that the pixels buffer might not get used, so initially pass in null and cache the resulting one if you wish. More...
 
void DrawCPU (DrawInfo info, Color[] pixels)
 Draws this node using the CPU. More...
 
TextureNode GetLayer (int id, int count)
 Gets the node with the given ID. More...
 
virtual void Prepare (DrawInfo info)
 Gets the node ready to draw. More...
 
virtual void Read (TextureReader reader)
 Reads sources from the given reader into this node. More...
 
virtual double GetWrapped (double x, double y, int wrap)
 Gets a wrapped value from this node. Range of +/- 1. More...
 
virtual double GetValue (double x, double y, double z)
 Gets the value from this node. This is required at a minimum. Range of +/- 1. More...
 
virtual double GetValue (double x, double y)
 Gets the value from this node. This is required at a minimum. Range of +/- 1. More...
 
virtual double GetValue (double t)
 Gets the 1D value from this node. Equiv to GetValue(t,0). Required for all graph nodes. More...
 
virtual UnityEngine.Color GetColour (double x, double y)
 Gets this nodes colour output. More...
 

Public Attributes

int InstanceID
 Unique ID for this node in its parent tree. More...
 
TextureNode[] Sources
 Inputs to this node. May be null. More...
 
bool AllocateRequired =true
 True when this node changes. Note that it does not get set to true if the image draw size changes. More...
 
DrawStackNode DrawStore
 

Protected Member Functions

void AllocateSources (Material material, DrawInfo info, int targetStack, int count)
 

Static Protected Member Functions

static Shader GetShader (int type, int subType)
 Gets a shader of the given node ID and it's sub-type. More...
 
static Material GetMaterial (int type, int subType)
 Gets a sub-material of the given node ID. More...
 

Properties

TextureNode SourceModule [get, set]
 First input to this node. Errors if it doesn't exist. More...
 
TextureNode SourceModule1 [get, set]
 First input to this node. Errors if it doesn't exist. More...
 
TextureNode SourceModule2 [get, set]
 Second input to this node. Errors if it doesn't exist. More...
 
TextureNode SourceModule3 [get, set]
 Third input to this node. Errors if it doesn't exist. More...
 
virtual int SubMaterialID [get]
 By default, materials are named Loonim/Texture_node_id, however some nodes have "sub-materials" where they essentially have a bunch of different shaders. An example is the Blend node. More...
 
virtual int MaterialID [get]
 By default, materials are named Loonim/Texture_node_id. This allows nodes to essentially share shaders. More...
 
virtual int OutputDimensions [get]
 The dimensions of the image that gets output from this node. A constant has 0 dimensions, a graph has 1 dimension and your ordinary image node has 2. Note that they vary based on inputs; for example an ADD node could add two graphs together (resulting in a 1D output) or it could add two images together (2D output). More...
 
virtual int TypeID [get]
 A globally constant ID for a given type of module. More...
 

Constructor & Destructor Documentation

Loonim.TextureNode.TextureNode ( )
inline
Loonim.TextureNode.TextureNode ( int  sourceCount)
inline

Create a texture node with the given number of inputs.

Member Function Documentation

void Loonim.TextureNode.AddSource ( TextureNode  source)
inline

Adds a new source to this node.

virtual DrawStackNode Loonim.TextureNode.Allocate ( DrawInfo  info,
ref int  stackID 
)
inlinevirtual

Allocates GPU drawing meta now.

Reimplemented in Loonim.ClippingPath, Loonim.Voronoi, Loonim.Occlusion, Loonim.Perlin, Loonim.Property, and Loonim.Stack.

void Loonim.TextureNode.AllocateSources ( Material  material,
DrawInfo  info,
int  targetStack,
int  count 
)
inlineprotected
float [] Loonim.TextureNode.Bake ( int  size)
inline

Bakes the x axis of this node as a 1D image.

void Loonim.TextureNode.Bake ( float[]  values)
inline

Bakes the x axis of this node as a 1D image.

void Loonim.TextureNode.Bake ( Color[]  values)
inline

Bakes the x axis of this node as a 1D image. Note that the red channel is the most important.

List<Material> Loonim.TextureNode.CollectMaterials ( )
inline
void Loonim.TextureNode.CollectMaterials ( List< Material >  into)
inline
virtual void Loonim.TextureNode.Draw ( DrawInfo  info)
inlinevirtual

Allocates GPU drawing meta now.

Reimplemented in Loonim.Voronoi, Loonim.Property, Loonim.Blur, and Loonim.Blend.

void Loonim.TextureNode.Draw ( DrawInfo  info,
Texture2D  image,
ref Color[]  pixels 
)
inline

Draws this node into the given texture and pixel buffer now. Note that the pixels buffer might not get used, so initially pass in null and cache the resulting one if you wish.

void Loonim.TextureNode.DrawCPU ( DrawInfo  info,
Color[]  pixels 
)
inline

Draws this node using the CPU.

void Loonim.TextureNode.DrawGPU ( DrawInfo  info)
inline

Draws this node now (but doesn't transfer it into a texture).

virtual UnityEngine.Color Loonim.TextureNode.GetColour ( double  x,
double  y 
)
inlinevirtual

Gets this nodes colour output.

Reimplemented in Loonim.Property, Loonim.NoisyGradient, Loonim.Blend, Loonim.Box, Loonim.RoundedBox, Loonim.Edges, Loonim.ScaleInput, Loonim.BitmapNode, Loonim.WrapClip, Loonim.Threshold, Loonim.Lookup, Loonim.SelectFalloff, Loonim.Refraction, Loonim.ToneMap, Loonim.HueSatLum, Loonim.Normals, Loonim.AbsThreshold, Loonim.RotateInput, Loonim.Spectrum, Loonim.CombineRGB, Loonim.CombineHSL, Loonim.CombineHSB, Loonim.CombineHSY, Loonim.CombineLAB, Loonim.TranslateInput, Loonim.Levels, Loonim.Repeat, Loonim.ContrastOrigin, Loonim.ClampOutput, Loonim.Desaturate, Loonim.Smudge, Loonim.Gradient, Loonim.Modulus, Loonim.Power, Loonim.GraphNode, Loonim.Hue, Loonim.CombineAlpha, Loonim.SelectAny, Loonim.DirectionalDerivative, Loonim.Round, Loonim.Floor, Loonim.Subtract, Loonim.Root, Loonim.Ceiling, Loonim.GammaCorrect, Loonim.RotateInputAngle, Loonim.Brightness, Loonim.Contrast, Loonim.Saturation, Loonim.Luminance, Loonim.Log, Loonim.Divide, Loonim.Multiply, Loonim.Sepia, Loonim.AbsoluteOutput, Loonim.Add, Loonim.Average, Loonim.ArcTangent, Loonim.InvertColourInput, Loonim.InvertOutput, Loonim.LessThanA, Loonim.GreaterThanA, Loonim.LessOrEqualA, Loonim.GreaterOrEqualA, Loonim.EqualA, Loonim.NotEqualA, Loonim.InvertColour, Loonim.SplitRed, Loonim.SplitGreen, Loonim.SplitBlue, Loonim.SplitHue, Loonim.SplitSaturation, Loonim.SplitLuminosityL, Loonim.SplitLuminosityY, Loonim.SplitLuminosityB, Loonim.SplitAlpha, Loonim.SplitLabL, Loonim.SplitLabA, Loonim.SplitLabB, Loonim.InvertInput, Loonim.LargerOutput, Loonim.SmallerOutput, Loonim.ArcCosine, Loonim.ArcSine, Loonim.ArcTangent2, Loonim.Cosine, Loonim.Sine, and Loonim.Tangent.

TextureNode Loonim.TextureNode.GetLayer ( int  id,
int  count 
)
inline

Gets the node with the given ID.

static Material Loonim.TextureNode.GetMaterial ( int  type,
int  subType 
)
inlinestaticprotected

Gets a sub-material of the given node ID.

static Shader Loonim.TextureNode.GetShader ( int  type,
int  subType 
)
inlinestaticprotected

Gets a shader of the given node ID and it's sub-type.

virtual double Loonim.TextureNode.GetValue ( double  x,
double  y,
double  z 
)
inlinevirtual

Gets the value from this node. This is required at a minimum. Range of +/- 1.

Reimplemented in Loonim.Blend, Loonim.Voronoi, Loonim.Property, Loonim.SelectFalloff, Loonim.Perlin, Loonim.Occlusion, Loonim.RidgedMultifractal, Loonim.SelectAny, Loonim.Box, Loonim.FastRidgedMultifractal, Loonim.Billow, Loonim.ToneMap, Loonim.Repeat, Loonim.Threshold, Loonim.FastTurbulence, Loonim.BitmapNode, Loonim.HueSatLum, Loonim.Refraction, Loonim.WrapClip, Loonim.AbsThreshold, Loonim.Normals, Loonim.FastBillow, Loonim.RoundedBox, Loonim.RotateInput, Loonim.Desaturate, Loonim.FastPerlin, Loonim.ClampOutput, Loonim.ScaleInput, Loonim.Levels, Loonim.Lookup, Loonim.Edges, Loonim.LessThanA, Loonim.GreaterThanA, Loonim.LessOrEqualA, Loonim.GreaterOrEqualA, Loonim.EqualA, Loonim.NotEqualA, Loonim.RotateInputAngle, Loonim.CombineRGB, Loonim.CombineHSL, Loonim.CombineHSB, Loonim.CombineHSY, Loonim.CombineLAB, Loonim.Hue, Loonim.DirectionalDerivative, Loonim.ContrastOrigin, Loonim.Brightness, Loonim.Saturation, Loonim.Spectrum, Loonim.TranslateInput, Loonim.Root, Loonim.Divide, Loonim.GammaCorrect, Loonim.Modulus, Loonim.Gradient, Loonim.GraphNode, Loonim.Power, Loonim.Round, Loonim.Floor, Loonim.SmallerOutput, Loonim.Ceiling, Loonim.LargerOutput, Loonim.Contrast, Loonim.Luminance, Loonim.Smudge, Loonim.Cylinders, Loonim.Add, Loonim.Subtract, Loonim.CombineAlpha, Loonim.Spheres, Loonim.Sepia, Loonim.AbsoluteOutput, Loonim.Average, Loonim.Multiply, Loonim.Log, Loonim.Checkerboard, Loonim.SplitHue, Loonim.SplitSaturation, Loonim.SplitLuminosityL, Loonim.SplitLuminosityY, Loonim.SplitLuminosityB, Loonim.SplitLabL, Loonim.SplitLabA, Loonim.SplitLabB, Loonim.ArcTangent2, Loonim.InvertOutput, Loonim.ArcTangent, Loonim.InvertColour, Loonim.ArcCosine, Loonim.ArcSine, Loonim.Cosine, Loonim.Sine, Loonim.Tangent, Loonim.SplitAlpha, Loonim.SplitRed, Loonim.SplitGreen, Loonim.SplitBlue, Loonim.Linear, Loonim.SineWave, Loonim.InvertColourInput, and Loonim.InvertInput.

virtual double Loonim.TextureNode.GetValue ( double  x,
double  y 
)
inlinevirtual

Gets the value from this node. This is required at a minimum. Range of +/- 1.

Reimplemented in Loonim.Blend, Loonim.Voronoi, Loonim.SelectFalloff, Loonim.Property, Loonim.SelectAny, Loonim.RidgedMultifractal, Loonim.Perlin, Loonim.Box, Loonim.FastRidgedMultifractal, Loonim.NoisyGradient, Loonim.Occlusion, Loonim.Repeat, Loonim.Billow, Loonim.ToneMap, Loonim.FastTurbulence, Loonim.Threshold, Loonim.FastBillow, Loonim.FastPerlin, Loonim.Turbulence, Loonim.HueSatLum, Loonim.WrapClip, Loonim.BitmapNode, Loonim.Refraction, Loonim.Levels, Loonim.AbsThreshold, Loonim.ClampOutput, Loonim.Normals, Loonim.RotateInputAngle, Loonim.Lookup, Loonim.Desaturate, Loonim.ScaleInput, Loonim.RoundedBox, Loonim.RotateInput, Loonim.Edges, Loonim.LessThanA, Loonim.GreaterThanA, Loonim.LessOrEqualA, Loonim.GreaterOrEqualA, Loonim.EqualA, Loonim.NotEqualA, Loonim.Hue, Loonim.CombineRGB, Loonim.ContrastOrigin, Loonim.CombineHSL, Loonim.CombineHSB, Loonim.CombineHSY, Loonim.CombineLAB, Loonim.DirectionalDerivative, Loonim.Brightness, Loonim.Saturation, Loonim.NoiseCurve, Loonim.TranslateInput, Loonim.Root, Loonim.Spectrum, Loonim.GammaCorrect, Loonim.Round, Loonim.Floor, Loonim.Cylinders, Loonim.Contrast, Loonim.Luminance, Loonim.Ceiling, Loonim.Gradient, Loonim.Divide, Loonim.SmallerOutput, Loonim.Spheres, Loonim.LargerOutput, Loonim.Modulus, Loonim.Power, Loonim.Average, Loonim.Checkerboard, Loonim.Add, Loonim.CombineAlpha, Loonim.Smudge, Loonim.Sepia, Loonim.SplitHue, Loonim.SplitSaturation, Loonim.SplitLuminosityL, Loonim.SplitLuminosityY, Loonim.SplitLuminosityB, Loonim.SplitLabL, Loonim.SplitLabA, Loonim.SplitLabB, Loonim.AbsoluteOutput, Loonim.Subtract, Loonim.Multiply, Loonim.Log, Loonim.GraphNode, Loonim.ArcTangent2, Loonim.SplitAlpha, Loonim.InvertOutput, Loonim.ArcTangent, Loonim.InvertColour, Loonim.SplitRed, Loonim.SplitGreen, Loonim.SplitBlue, Loonim.ArcCosine, Loonim.ArcSine, Loonim.Cosine, Loonim.Sine, Loonim.Tangent, Loonim.Linear, Loonim.SineWave, Loonim.InvertColourInput, Loonim.InvertInput, Loonim.Staircase, Loonim.GainCurve, Loonim.Gaussian, Loonim.Arc, Loonim.Gamma, Loonim.BiasCurve, Loonim.Bounce, and Loonim.Square.

virtual double Loonim.TextureNode.GetWrapped ( double  x,
double  y,
int  wrap 
)
inlinevirtual

Gets a wrapped value from this node. Range of +/- 1.

Reimplemented in Loonim.Blend, Loonim.Voronoi, Loonim.Property, Loonim.Occlusion, Loonim.Perlin, Loonim.SelectFalloff, Loonim.Threshold, Loonim.Box, Loonim.RidgedMultifractal, Loonim.ToneMap, Loonim.FastTurbulence, Loonim.SelectAny, Loonim.BitmapNode, Loonim.Billow, Loonim.Turbulence, Loonim.Refraction, Loonim.Normals, Loonim.AbsThreshold, Loonim.RoundedBox, Loonim.HueSatLum, Loonim.Repeat, Loonim.RotateInput, Loonim.Desaturate, Loonim.WrapClip, Loonim.ScaleInput, Loonim.Edges, Loonim.ClampOutput, Loonim.Lookup, Loonim.FastRidgedMultifractal, Loonim.Levels, Loonim.CombineHSL, Loonim.CombineHSB, Loonim.CombineHSY, Loonim.CombineLAB, Loonim.LessThanA, Loonim.GreaterThanA, Loonim.LessOrEqualA, Loonim.GreaterOrEqualA, Loonim.EqualA, Loonim.NotEqualA, Loonim.CombineRGB, Loonim.DirectionalDerivative, Loonim.Spectrum, Loonim.Hue, Loonim.FastBillow, Loonim.FastPerlin, Loonim.Divide, Loonim.TranslateInput, Loonim.ContrastOrigin, Loonim.Brightness, Loonim.Saturation, Loonim.Modulus, Loonim.Power, Loonim.Root, Loonim.RotateInputAngle, Loonim.Gradient, Loonim.GammaCorrect, Loonim.Smudge, Loonim.Add, Loonim.Subtract, Loonim.CombineAlpha, Loonim.SmallerOutput, Loonim.Round, Loonim.Floor, Loonim.GraphNode, Loonim.LargerOutput, Loonim.Ceiling, Loonim.AbsoluteOutput, Loonim.Multiply, Loonim.Log, Loonim.Contrast, Loonim.Luminance, Loonim.Average, Loonim.Sepia, Loonim.Cylinders, Loonim.Spheres, Loonim.Checkerboard, Loonim.ArcTangent2, Loonim.InvertOutput, Loonim.ArcTangent, Loonim.InvertColour, Loonim.ArcCosine, Loonim.ArcSine, Loonim.Cosine, Loonim.Sine, Loonim.Tangent, Loonim.SplitHue, Loonim.SplitSaturation, Loonim.SplitLuminosityL, Loonim.SplitLuminosityY, Loonim.SplitLuminosityB, Loonim.SplitLabL, Loonim.SplitLabA, Loonim.SplitLabB, Loonim.Linear, Loonim.SineWave, Loonim.SplitRed, Loonim.SplitGreen, Loonim.SplitBlue, Loonim.SplitAlpha, Loonim.InvertColourInput, and Loonim.InvertInput.

void Loonim.TextureNode.PreAllocate ( DrawInfo  info)
inline

Allocates now.

virtual void Loonim.TextureNode.Prepare ( DrawInfo  info)
inlinevirtual
virtual void Loonim.TextureNode.Read ( TextureReader  reader)
inlinevirtual

Reads sources from the given reader into this node.

Reimplemented in Loonim.Property.

void Loonim.TextureNode.SubMaterialChanged ( )
inline

Called when this nodes SubMaterialID has changed.

override string Loonim.TextureNode.ToString ( )
inline
string Loonim.TextureNode.ToString ( int  depth)
inline

Member Data Documentation

bool Loonim.TextureNode.AllocateRequired =true

True when this node changes. Note that it does not get set to true if the image draw size changes.

DrawStackNode Loonim.TextureNode.DrawStore
int Loonim.TextureNode.InstanceID

Unique ID for this node in its parent tree.

TextureNode [] Loonim.TextureNode.Sources

Inputs to this node. May be null.

Property Documentation

virtual int Loonim.TextureNode.MaterialID
get

By default, materials are named Loonim/Texture_node_id. This allows nodes to essentially share shaders.

virtual int Loonim.TextureNode.OutputDimensions
getpackage

The dimensions of the image that gets output from this node. A constant has 0 dimensions, a graph has 1 dimension and your ordinary image node has 2. Note that they vary based on inputs; for example an ADD node could add two graphs together (resulting in a 1D output) or it could add two images together (2D output).

TextureNode Loonim.TextureNode.SourceModule
getset

First input to this node. Errors if it doesn't exist.

TextureNode Loonim.TextureNode.SourceModule1
getset

First input to this node. Errors if it doesn't exist.

TextureNode Loonim.TextureNode.SourceModule2
getset

Second input to this node. Errors if it doesn't exist.

TextureNode Loonim.TextureNode.SourceModule3
getset

Third input to this node. Errors if it doesn't exist.

virtual int Loonim.TextureNode.SubMaterialID
get

By default, materials are named Loonim/Texture_node_id, however some nodes have "sub-materials" where they essentially have a bunch of different shaders. An example is the Blend node.

virtual int Loonim.TextureNode.TypeID
get

A globally constant ID for a given type of module.