C# Класс GPUGraph.GraphEditorUtils

Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
Extension string

Открытые методы

Метод Описание
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.

Описание методов

GenerateToArray() публичный статический Метод

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
Результат ].float[

GenerateToTexture() публичный статический Метод

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
Результат UnityEngine.Texture2D

GenerateToTexture() публичный статический Метод

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
Результат UnityEngine.Texture2D

GetAllGraphsInProject() публичный статический Метод

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
Результат List

SaveShader() публичный статический Метод

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.
Результат UnityEngine.Shader

SaveShader() публичный статический Метод

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. ///
Результат UnityEngine.Shader

Описание свойств

Extension публичное статическое свойство

The standard file extension for Graphs.
public static string Extension
Результат string