Class GShading
Sub asset type containing terrain material and textures. This should not be used alone without a parent terrain data object. In most case you dont instantiate this with ScriptableObject.Create. The correct way to access this is terrain.TerrainData.Shading
public class GShading : ScriptableObject
- Inheritance
-
ObjectScriptableObjectGShading
- Inherited Members
-
ScriptableObject.SetDirty()ScriptableObject.CreateInstance<T>()Object.GetInstanceID()Object.GetHashCode()Object.Instantiate(Object, Vector3, Quaternion)Object.Instantiate(Object, Vector3, Quaternion, Transform)Object.Instantiate(Object)Object.Instantiate(Object, Transform)Object.Instantiate<T>(T)Object.Instantiate<T>(T, Vector3, Quaternion)Object.Instantiate<T>(T, Vector3, Quaternion, Transform)Object.Instantiate<T>(T, Transform)Object.Destroy(Object)Object.DestroyImmediate(Object)Object.DontDestroyOnLoad(Object)Object.DestroyObject(Object)Object.FindObjectsOfType<T>()Object.FindObjectsByType<T>(FindObjectsSortMode)Object.FindObjectsByType<T>(FindObjectsInactive, FindObjectsSortMode)Object.FindObjectOfType<T>()Object.FindFirstObjectByType<T>()Object.FindAnyObjectByType<T>()Object.FindFirstObjectByType<T>(FindObjectsInactive)Object.FindAnyObjectByType<T>(FindObjectsInactive)Object.ToString()Object.nameObject.hideFlags
Properties
- AlbedoMap
Direct reference to the albedo map.
- AlbedoMapOrDefault
Get a texture for reading albedo color. If the albedo map has not been allocated, a default texture will be returned. Read this texture with bilinear filter.
- AlbedoMapPropertyName
Reference name of the albedo map in terrain shader.
- AlbedoMapResolution
Size of the albedo map in pixels. If this value changed, the albedo map will be resized and resampled.
- ColorBlendCurve
A curve to blend between color by height and color by normal, using terrain normalized height [0-1]. Used in Gradient Lookup mode.
- ColorBlendMap
The texture generated from color blend curve. This will allocate new texture if needed.
- ColorBlendMapOrDefault
A texture for reading color blend value. If color blend texture was not allocated, it will return a default one. Read this texture with bilinear filter.
- ColorBlendPropertyName
Reference name of the color blend curve texture in terrain shader.
- ColorByHeight
A gradient to map terrain normalized height [0,1] to color. Used in Gradient Lookup mode.
- ColorByHeightMap
The texture generated from color by height gradient. This will allocate new texture if needed.
- ColorByHeightMapOrDefault
A texture for reading color by height value. If color by height texture was not allocated, it will return a default one. Read this texture with bilinear filter.
- ColorByHeightPropertyName
Reference name of the color by height gradient texture in terrain shader.
- ColorByNormal
A gradient to map terrain normal vector to color. Used in Gradient Lookup mode.
- ColorByNormalMap
The texture generated from color by normal gradient. This will allocate new texture if needed.
- ColorByNormalMapOrDefault
A texture for reading color by normal value. If color by normal texture was not allocated, it will return a default one. Read this texture with bilinear filter.
- ColorByNormalPropertyName
Reference name of the color by normal gradient texture in terrain shader.
- CustomMaterial
The terrain material in used. Same as MaterialToRender.
- DimensionPropertyName
Reference name for terrain world size in shader.
- HasAlbedoMap
True if the albedo map was allocated.
- HasMetallicMap
True if the metallic map was allocated.
- MaterialToRender
The terrain material in used.
- MetallicMap
Direct reference to the metallic map.
- MetallicMapOrDefault
Get a texture for reading metallic color. If the metallic map has not been allocated, a default texture will be returned. Read this texture with bilinear filter.
- MetallicMapPropertyName
Reference name of the metallic map in terrain shader.
- MetallicMapResolution
Size of the Metallic map in pixels. If this value changed, the Metallic map will be resized and resampled.
- ShadingSystem
The shading system to use. If set to Polaris, the terrain will handle material refreshing at some occasion to ensure it look correct. If not, you have to manage your material with other system.
- SplatControlMapCount
Get the number of control map count needed to render all splat layers.
- SplatControlMapPropertyName
Reference name of the splat control map in terrain shader. This name will be appended with the index of the map, e.g: _Control0
- SplatControlResolution
Size of splat control maps in pixels. If this value changed, all control maps will be resized and resampled.
- SplatControls
Direct reference to the splat control maps array. It is recommended to use GShading.GetSplatControl(i) or Polaris.GetControlMap(i) instead.
- SplatMapPropertyName
Reference name of the splat map in terrain shader. This name will be appended with the index of the map, e.g: _Splat0
- SplatMetallicPropertyName
Reference name of the splat metallic value in terrain shader. This name will be appended with the index of the map, e.g: _Metallic0
- SplatNormalPropertyName
Reference name of the splat normal map in terrain shader. This name will be appended with the index of the map, e.g: _Normal0
- SplatSmoothnessPropertyName
Reference name of the splat smoothness value in terrain shader. This name will be appended with the index of the map, e.g: _Smoothness0
- Splats
The splat prototype group asset containing splat textures for this terrain. Used in Splat shading mode.
- TerrainData
The parent terrain data object.
Methods
- ConvertSplatsToAlbedo()
Bake splat textures into the albedo map.
- CopyTo(GShading)
Copy numeric settings to other object. This does not copy textures.
- GetSplatControl(int)
Get direct reference to the splat control map at index. This will allocate new texture if needed.
- GetSplatControlOrDefault(int)
Get the splat control map at index for reading. If the control map has not been allocated, it will return a default texture. Read this texture with bilinear filter.
- UpdateLookupTextures()
Generate gradient and curve textures for Gradient Lookup shader.
- UpdateMaterials()
Refresh all material properties and bind textures.