public static PaintContext BeginPaintHeightmap(Terrain terrain, Rect boundsInTerrainSpace, int extraBorderPixels = 0) { RenderTexture rt = terrain.terrainData.heightmapTexture; PaintContext ctx = InitializePaintContext(terrain, rt, rt.format, boundsInTerrainSpace, extraBorderPixels); ctx.GatherHeightmap(); return(ctx); }
public static PaintContext BeginPaintHeightmap(Terrain terrain, Rect bounds) // bounds in terrain space units { RenderTexture rt = terrain.terrainData.heightmapTexture; PaintContext ctx = InitializePaintContext(terrain, bounds, rt.width, rt.height, rt.format); ctx.GatherHeightmap(terrain); return(ctx); }
public static PaintContext BeginPaintHeightmap(Terrain terrain, Rect boundsInTerrainSpace, int extraBorderPixels = 0) { int heightmapResolution = terrain.terrainData.heightmapResolution; PaintContext ctx = InitializePaintContext(terrain, heightmapResolution, heightmapResolution, Terrain.heightmapRenderTextureFormat, boundsInTerrainSpace, extraBorderPixels); ctx.GatherHeightmap(); return(ctx); }
public static PaintContext BeginPaintHeightmap(Terrain terrain, Rect boundsInTerrainSpace, int extraBorderPixels = 0) { int heightmapResolution = terrain.terrainData.heightmapResolution; PaintContext paintContext = TerrainPaintUtility.InitializePaintContext(terrain, heightmapResolution, heightmapResolution, Terrain.heightmapRenderTextureFormat, boundsInTerrainSpace, extraBorderPixels, true); paintContext.GatherHeightmap(); return(paintContext); }