public static PaintContext CollectNormals(Terrain terrain, Rect boundsInTerrainSpace, int extraBorderPixels = 0) { RenderTexture rt = terrain.normalmapTexture; PaintContext ctx = InitializePaintContext(terrain, rt, rt.format, boundsInTerrainSpace, extraBorderPixels); ctx.GatherNormals(); return(ctx); }
public static PaintContext CollectNormals(Terrain terrain, Rect bounds) { RenderTexture rt = terrain.normalmapTexture; PaintContext ctx = InitializePaintContext(terrain, bounds, rt.width, rt.height, rt.format); ctx.GatherNormals(terrain); return(ctx); }
public static PaintContext CollectNormals(Terrain terrain, Rect boundsInTerrainSpace, int extraBorderPixels = 0) { int heightmapResolution = terrain.terrainData.heightmapResolution; PaintContext ctx = InitializePaintContext(terrain, heightmapResolution, heightmapResolution, Terrain.normalmapRenderTextureFormat, boundsInTerrainSpace, extraBorderPixels); ctx.GatherNormals(); return(ctx); }
public static PaintContext CollectNormals(Terrain terrain, Rect boundsInTerrainSpace, int extraBorderPixels = 0) { int heightmapResolution = terrain.terrainData.heightmapResolution; PaintContext paintContext = TerrainPaintUtility.InitializePaintContext(terrain, heightmapResolution, heightmapResolution, Terrain.normalmapRenderTextureFormat, boundsInTerrainSpace, extraBorderPixels, true); paintContext.GatherNormals(); return(paintContext); }