Skip to content

Commit

Permalink
Fix docs markdown (#4091)
Browse files Browse the repository at this point in the history
* Fix docs markdown

* lint
  • Loading branch information
birkskyum authored May 8, 2024
1 parent d885fbe commit 82af128
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 27 deletions.
50 changes: 28 additions & 22 deletions src/render/terrain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,29 +49,35 @@ export type TerrainMesh = {
/**
* @internal
* This is the main class which handles most of the 3D Terrain logic. It has the following topics:
* 1) loads raster-dem tiles via the internal sourceCache this.sourceCache
* 2) creates a depth-framebuffer, which is used to calculate the visibility of coordinates
* 3) creates a coords-framebuffer, which is used the get to tile-coordinate for a screen-pixel
* 4) stores all render-to-texture tiles in the this.sourceCache._tiles
* 5) calculates the elevation for a specific tile-coordinate
* 6) creates a terrain-mesh
*
* A note about the GPU resource-usage:
* Framebuffers:
* - one for the depth & coords framebuffer with the size of the map-div.
* - one for rendering a tile to texture with the size of tileSize (= 512x512).
* Textures:
* - one texture for an empty raster-dem tile with size 1x1
* - one texture for an empty depth-buffer, when terrain is disabled with size 1x1
* - one texture for an each loaded raster-dem with size of the source.tileSize
* - one texture for the coords-framebuffer with the size of the map-div.
* - one texture for the depth-framebuffer with the size of the map-div.
* - one texture for the encoded tile-coords with the size 2*tileSize (=1024x1024)
* - finally for each render-to-texture tile (= this._tiles) a set of textures
* for each render stack (The stack-concept is documented in painter.ts).
* Normally there exists 1-3 Textures per tile, depending on the stylesheet.
* Each Textures has the size 2*tileSize (= 1024x1024). Also there exists a
* cache of the last 150 newest rendered tiles.
* 1. loads raster-dem tiles via the internal sourceCache this.sourceCache
* 2. creates a depth-framebuffer, which is used to calculate the visibility of coordinates
* 3. creates a coords-framebuffer, which is used the get to tile-coordinate for a screen-pixel
* 4. stores all render-to-texture tiles in the this.sourceCache._tiles
* 5. calculates the elevation for a specific tile-coordinate
* 6. creates a terrain-mesh
*
* A note about the GPU resource-usage:
*
* Framebuffers:
*
* - one for the depth & coords framebuffer with the size of the map-div.
* - one for rendering a tile to texture with the size of tileSize (= 512x512).
*
* Textures:
*
* - one texture for an empty raster-dem tile with size 1x1
* - one texture for an empty depth-buffer, when terrain is disabled with size 1x1
* - one texture for an each loaded raster-dem with size of the source.tileSize
* - one texture for the coords-framebuffer with the size of the map-div.
* - one texture for the depth-framebuffer with the size of the map-div.
* - one texture for the encoded tile-coords with the size 2*tileSize (=1024x1024)
* - finally for each render-to-texture tile (= this._tiles) a set of textures
* for each render stack (The stack-concept is documented in painter.ts).
*
* Normally there exists 1-3 Textures per tile, depending on the stylesheet.
* Each Textures has the size 2*tileSize (= 1024x1024). Also there exists a
* cache of the last 150 newest rendered tiles.
*
*/
export class Terrain {
Expand Down
11 changes: 6 additions & 5 deletions src/source/terrain_source_cache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@ import {Terrain} from '../render/terrain';
/**
* @internal
* This class is a helper for the Terrain-class, it:
* - loads raster-dem tiles
* - manages all renderToTexture tiles.
* - caches previous rendered tiles.
* - finds all necessary renderToTexture tiles for a OverscaledTileID area
* - finds the corresponding raster-dem tile for OverscaledTileID
*
* - loads raster-dem tiles
* - manages all renderToTexture tiles.
* - caches previous rendered tiles.
* - finds all necessary renderToTexture tiles for a OverscaledTileID area
* - finds the corresponding raster-dem tile for OverscaledTileID
*/
export class TerrainSourceCache extends Evented {
/**
Expand Down

0 comments on commit 82af128

Please sign in to comment.