C# Class GPUGraph.GraphEditorUtils

Mostrar archivo Open project: heyx3/GPUNoiseForUnity Class Usage Examples

Public Properties

Property Type Description
Extension string

Public Methods

Method Description
GenerateToArray ( Graph g, GraphParamCollection c, int width, int height ) : ].float[

Generates a 2D grid of noise from the given graph. If an error occurred, outputs to the Unity debug console and returns "null".

GenerateToTexture ( Graph g, GraphParamCollection c, int width, int height, Gradient gradientRamp, TextureFormat format = TextureFormat.RGBAFloat ) : Texture2D

Generates a texture containing the given graph's noise output. If this is being called very often, create a permanent render target and material and use the other version of this method instead for much better performance. If an error occurred, outputs to the Unity debug console and returns "null".

GenerateToTexture ( Graph g, GraphParamCollection c, int width, int height, string outputComponents, float defaultColor, TextureFormat format = TextureFormat.RGBAFloat ) : Texture2D

Generates a texture containing the given graph's noise output. If this is being called very often, create a permanent render target and material and use the other version of this method instead for much better performance. If an error occurred, outputs to the Unity debug console and returns "null".

GetAllGraphsInProject ( string excludeGraph = null, bool makeRelativeToAssets = false ) : List

Gets the full paths for all graphs in this Unity project.

SaveShader ( Graph g, string filePath, string shaderName, string gradientRampName ) : Shader

Saves the shader for the given graph to the given file with the given name. Also forces Unity to immediately recognize and compile the shader so that it can be immediately used after calling this function. If the shader fails to load for some reason, an error is output to the Unity console and "null" is returned.

SaveShader ( Graph g, string filePath, string shaderName, string outputComponents, float defaultColor ) : Shader

Saves the shader for the given graph to the given file with the given name. Also forces Unity to immediately recognize and compile the shader so that it can be immediately used after calling this function. If the shader fails to load for some reason, an error is output to the Unity console and "null" is returned.

Method Details

GenerateToArray() public static method

Generates a 2D grid of noise from the given graph. If an error occurred, outputs to the Unity debug console and returns "null".
public static GenerateToArray ( Graph g, GraphParamCollection c, int width, int height ) : ].float[
g Graph
c GraphParamCollection
width int
height int
return ].float[

GenerateToTexture() public static method

Generates a texture containing the given graph's noise output. If this is being called very often, create a permanent render target and material and use the other version of this method instead for much better performance. If an error occurred, outputs to the Unity debug console and returns "null".
public static GenerateToTexture ( Graph g, GraphParamCollection c, int width, int height, Gradient gradientRamp, TextureFormat format = TextureFormat.RGBAFloat ) : Texture2D
g Graph
c GraphParamCollection
width int
height int
gradientRamp UnityEngine.Gradient
format TextureFormat
return UnityEngine.Texture2D

GenerateToTexture() public static method

Generates a texture containing the given graph's noise output. If this is being called very often, create a permanent render target and material and use the other version of this method instead for much better performance. If an error occurred, outputs to the Unity debug console and returns "null".
public static GenerateToTexture ( Graph g, GraphParamCollection c, int width, int height, string outputComponents, float defaultColor, TextureFormat format = TextureFormat.RGBAFloat ) : Texture2D
g Graph
c GraphParamCollection
width int
height int
outputComponents string /// The texture output. /// For example, pass "rgb" or "xyz" to output the noise into the red, green, and blue channels /// but not the alpha channel. ///
defaultColor float /// The color (generally 0-1) of the color components which aren't set by the noise. ///
format TextureFormat
return UnityEngine.Texture2D

GetAllGraphsInProject() public static method

Gets the full paths for all graphs in this Unity project.
public static GetAllGraphsInProject ( string excludeGraph = null, bool makeRelativeToAssets = false ) : List
excludeGraph string
makeRelativeToAssets bool
return List

SaveShader() public static method

Saves the shader for the given graph to the given file with the given name. Also forces Unity to immediately recognize and compile the shader so that it can be immediately used after calling this function. If the shader fails to load for some reason, an error is output to the Unity console and "null" is returned.
public static SaveShader ( Graph g, string filePath, string shaderName, string gradientRampName ) : Shader
g Graph
filePath string
shaderName string
gradientRampName string The name of the gradient ramp texture param.
return UnityEngine.Shader

SaveShader() public static method

Saves the shader for the given graph to the given file with the given name. Also forces Unity to immediately recognize and compile the shader so that it can be immediately used after calling this function. If the shader fails to load for some reason, an error is output to the Unity console and "null" is returned.
public static SaveShader ( Graph g, string filePath, string shaderName, string outputComponents, float defaultColor ) : Shader
g Graph
filePath string
shaderName string
outputComponents string /// The texture output. /// For example, pass "rgb" or "xyz" to output the noise into the red, green, and blue channels /// but not the alpha channel. ///
defaultColor float /// The color (generally 0-1) of the color components which aren't set by the noise. ///
return UnityEngine.Shader

Property Details

Extension public_oe static_oe property

The standard file extension for Graphs.
public static string Extension
return string