Table of Contents

Class GGeometry

Namespace
Pinwheel.Griffin
Assembly
Pinwheel.Polaris.Runtime.dll

An object containing terrain size, mesh density, height map and other settings related to mesh generation. This should not be used alone without a parent terrain data. In most case you don't instantiate it with ScriptableObject.Create(). The correct way is to accessing it with GTerrainData.Geometry.

public class GGeometry : ScriptableObject
Inheritance
Object
ScriptableObject
GGeometry
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.name
Object.hideFlags

Properties

AlbedoToVertexColorMode

Determine if it should convert albedo map color to vertex color. Only needed when using Vertex Color shading mode, otherwise set to None.

AllowTimeSlicedGeneration

If on, the terrain will split it mesh generation into several frames.

ChunkGridSize

Size of the chunk grid. The terrain will divide it surface into several chunks (meshes) to get around 65K vertex limit. Total number of chunks is ChunkGridSize^2

DisplacementSeed

Random seed for XZ displacement.

DisplacementStrength

Intensity of vertex XZ displacement.

Height

Size of the terrain in Y axis in meters.

HeightMap

Direct reference to the height map texture. It embeds 3 values in 4 color channels as follow:

  • RG: Encoded height value.
  • B: Additional subdivision. This value will add more polygon upon default subdivision based on height map detailness.
  • A: Holes. polygons where this value is >=0.5 will be removed and become holes. See Polaris.EncodeHeightMapSample() and Polaris.DecodeHeightMapSample().
HeightMapResolution

Size of the height map texture in pixels. When this value changed, the height map will be resized and resampled.

LODCount

Number of LOD for each chunk.

Length

Size of the terrain in Z axis in meters.

MergeUv

If on, the terrain will merge the UV coordinate of 3 triangle vertices to the median point. This will enable sharp look from texture color, similar to Vertex Color material mode without using vertex colors.

MeshBaseResolution

Base polygon density of surface mesh. Each increament value indicate that a triangle at that point will be subdivided for another time. This is the resolution of region where it has least polygon count.

MeshResolution

Max polygon density of surface mesh. Each increament value indicate that a triangle at that point will be subdivided for another time. This is the resolution of region where it has the highest polygon count.

Size

Size of the terrain is XYZ-axes in meters.

SmoothNormal

Generate a smooth normal look for terrain surface. This only modify the normal vector direction for each vertex, vertex count stays the same.

StorageMode

Should it store generated mesh in asset?

TerrainData

The parent terrain data object.

UseSmoothNormalMask

If on, it will use the terrain mask G channel to blend between sharp and smooth normal. Access the terrain mask at GTerrainData.Mask.MaskMap

Width

Size of the terrain along X axis in meters.

Methods

ClearDirtyRegions()

Clear all dirty regions. Call this when you've regenerated the meshes.

CopyTo(GGeometry)

Copy numeric value to other object. This doesn't copy textures.

GetDirtyRegions()

Retrieve all dirty regions of surface where mesh should be regenerated.

SetRegionDirty(Rect)

Set a region of terrain surface as dirty for mesh regeneration.