public sealed class Sandbox.Terrain : Sandbox.Collider
Terrain renders heightmap based terrain.
Related Guides
Broader workflow and conceptual references connected to this API.
The fancy new way to do things in Vulkan / DX12 is bindless. This removes the limitations of the binding model allowing you to have access to far more textures and other resources within a shader and the ability to sample them from a dynamically provided identifier from buffers, vertex input, etc.
To add Terrain to your Scene, right click in the Hierarchy and select 3D Object → Terrain from the menu. The Terrain inspector will then prompt you to create, import or link an existing Terrain asset.
A Terrain Material is an Asset that defines a set of PBR textures, physics surfaces, detail meshes and other properties that the Terrain uses to render.
The Clutter System lets you quickly scatter large amounts of small objects like grass, rocks, and debris across your scene. It handles placement, streaming, and GPU-instanced rendering for models automatically.
S&box uses a scene system to create games. We feel this is the easiest system for people to pick up, while still being powerful.
Core gameplay systems — input, navigation, terrain, and more.
Constructors
Showing 1 constructors
public Terrain()
No results match this filter.
Methods
Showing 6 methods
public void Create()
Call on enable or storage change
public System.Nullable`1<Sandbox.Terrain.TerrainMaterialInfo> GetMaterialAtWorldPosition(Vector3 worldPosition)
Gets terrain material information at a world position. Returns null if the position is outside terrain bounds.
public bool RayIntersects(Ray ray, float distance, Vector3 position)
Given a world ray, finds out the LOCAL position it intersects with this terrain.
public void SyncCPUTexture(Sandbox.Terrain.SyncFlags flags, Sandbox.RectInt region)
Downloads dirty regions from the GPU texture maps onto the CPU, updating collider data and making changes saveable. This is used from the editor after modifying.
public void SyncGPUTexture()
Updates the GPU texture maps with the CPU data
public void UpdateMaterialsBuffer()
Upload the Materials buffer, this should be called when materials are added, removed or modified.
No results match this filter.
Properties
Showing 14 properties
public int Sandbox.Terrain.ClipMapLodExtentTexels { get; set; }
public int Sandbox.Terrain.ClipMapLodLevels { get; set; }
public virtual int Sandbox.Terrain.ComponentVersion { get; set; }
public bool Sandbox.Terrain.EnableCollision { get; set; }
public virtual bool Sandbox.Terrain.IsConcave { get; set; }
public Sandbox.ModelRenderer.ShadowRenderType Sandbox.Terrain.RenderType { get; set; }
public Sandbox.TerrainStorage Sandbox.Terrain.Storage { get; set; }
public int Sandbox.Terrain.SubdivisionFactor { get; set; }
public int Sandbox.Terrain.SubdivisionLodCount { get; set; }
public float Sandbox.Terrain.TerrainHeight { get; set; }
World size of the maximum height of the terrain.
public float Sandbox.Terrain.TerrainSize { get; set; }
Uniform world size of the width and length of the terrain.
No results match this filter.
Metadata
| Field | Value |
|---|---|
| Namespace | Sandbox |
| Type | class |
| Assembly | Sandbox.Engine |
| Doc ID | T:Sandbox.Terrain |