기술 자료

Unity Engine

Unity Engine

CopyActiveRenderTextureToHeightmap(RectInt, Vector2Int, TerrainHeightmapSyncControl)

Copies the specified part of the active RenderTexture to the Terrain heightmap texture.
읽는 시간 1분최근 업데이트: 한 달 전

Definition

  • Type: Method
  • Namespace: UnityEngine
  • Assembly: UnityEngine.TerrainModule
public void CopyActiveRenderTextureToHeightmap(RectInt sourceRect, Vector2Int dest, TerrainHeightmapSyncControl syncControl)

Parameters

sourceRect

The part of the active Render Texture to copy.

The X and Y coordinates of the heightmap texture to copy into.

Controls how CPU synchronization is performed.

Remarks

This functions calls TerrainData.DirtyHeightmapRegion internally and sends out the OnTerrainChanged message accordingly.
The range of expected height values for the active RenderTexture is between
0
and
0.5
. This is unlike TerrainData.SetHeights, which expects height values between
0
and
1
. Additional Resources: TerrainHeightmapSyncControl, TerrainData.DirtyHeightmapRegion, TerrainData.SyncHeightmap.