Class NoiseLib
Class responsible for loading all the NoiseType and FractalType implementations and generating the associated shaders
Inheritance
Namespace: UnityEditor.Experimental.TerrainAPI
Syntax
public static class NoiseLib
Methods
FractalTypePopup(GUIContent, String)
Renders a Popup using EditorGUILayout.Popup for all loaded FractalType implementations
Declaration
public static string FractalTypePopup(GUIContent label, string selectedName)
Parameters
Type | Name | Description |
---|---|---|
GUIContent | label | Label prefix for the Popup |
System.String | selectedName | The currently selected FractalType name |
Returns
Type | Description |
---|---|
System.String |
GenerateHeaderFiles()
Forces generation of the NoiseType and FractalType variant HLSL header files
Declaration
public static void GenerateHeaderFiles()
GenerateShaders()
Forces the generation of any shaders that make use of generated noise header files. Gathers all the NoiseShaderGenerators and generates shaders based on the ".noisehlsltemplate" file provided by that particular NoiseShaderGenerator implementation
Declaration
public static void GenerateShaders()
GetFractalIndex(String)
Returns the global index for the specified FractalType
Declaration
public static int GetFractalIndex(string fractalName)
Parameters
Type | Name | Description |
---|---|---|
System.String | fractalName | The name of the FractalType |
Returns
Type | Description |
---|---|
System.Int32 |
GetFractalIndex(NoiseSettings)
Returns the global FractalType index associated with provided NoiseSettings instance
Declaration
public static int GetFractalIndex(NoiseSettings noise)
Parameters
Type | Name | Description |
---|---|---|
NoiseSettings | noise | The NoiseSettings instance |
Returns
Type | Description |
---|---|
System.Int32 |
GetFractalTypeInstance(String)
Returns the Singleton instance for the specified FractalType implementation
Declaration
public static IFractalType GetFractalTypeInstance(string fractalName)
Parameters
Type | Name | Description |
---|---|---|
System.String | fractalName |
Returns
Type | Description |
---|---|
IFractalType |
GetFractalTypeInstance(Type)
Returns the Singleton instance for the specified FractalType
Declaration
public static IFractalType GetFractalTypeInstance(Type t)
Parameters
Type | Name | Description |
---|---|---|
System.Type | t | The Type for the FractalType implementation |
Returns
Type | Description |
---|---|
IFractalType |
GetGeneratedMaterial(Type, Type)
Returns a Material associated with the provided Type of NoiseShaderGenerator and Type of FractalType
Declaration
public static Material GetGeneratedMaterial(Type generatorType, Type fractalType)
Parameters
Type | Name | Description |
---|---|---|
System.Type | generatorType | The Type of a NoiseShaderGenerator |
System.Type | fractalType | The Type of a FractalType |
Returns
Type | Description |
---|---|
Material |
GetNoiseIndex(String)
Returns the global index for the specified NoiseType
Declaration
public static int GetNoiseIndex(string noiseName)
Parameters
Type | Name | Description |
---|---|---|
System.String | noiseName | The name of the NoiseType |
Returns
Type | Description |
---|---|
System.Int32 |
GetNoiseIndex(NoiseSettings)
Returns the global NoiseType index associated with provided NoiseSettings instance
Declaration
public static int GetNoiseIndex(NoiseSettings noise)
Parameters
Type | Name | Description |
---|---|---|
NoiseSettings | noise | The NoiseSettings instance |
Returns
Type | Description |
---|---|
System.Int32 |
GetNoiseTypeInstance(String)
Returns the Singleton instance for the specified NoiseType
Declaration
public static INoiseType GetNoiseTypeInstance(string noiseName)
Parameters
Type | Name | Description |
---|---|---|
System.String | noiseName | The name of the NoiseType |
Returns
Type | Description |
---|---|
INoiseType |
GetNoiseTypeInstance(Type)
Returns the Singleton instance for the specified NoiseType
Declaration
public static INoiseType GetNoiseTypeInstance(Type t)
Parameters
Type | Name | Description |
---|---|---|
System.Type | t | The Type for the NoiseType implementation |
Returns
Type | Description |
---|---|
INoiseType |
NoiseTypePopup(GUIContent, String)
Renders a Popup using EditorGUILayout.Popup for all loaded NoiseType implementations
Declaration
public static string NoiseTypePopup(GUIContent label, string selectedName)
Parameters
Type | Name | Description |
---|---|---|
GUIContent | label | Label prefix for the Popup |
System.String | selectedName | The currently selected NoiseType name |
Returns
Type | Description |
---|---|
System.String |