> For the complete documentation index, see [llms.txt](https://tfg-bravoperezrubio.gitbook.io/cosmicarchitectdocumentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://tfg-bravoperezrubio.gitbook.io/cosmicarchitectdocumentation/explanation-of-classes-and-components/clipmap.md).

# Clipmap

Manages the planet mesh and the LOD (Level of Detail) system using concentric rings. It consists of a hemisphere formed by different mesh layers that follows the camera viewport.

![ClipmapSphere](/files/HsNuO39J89JhmB72OmzZ)

When you move far enough away from the planet, the semi-sphere not require as much resolution to maintain visible detail, so it transitions into a static sphere mesh. By combining a semi-sphere that always follows the camera when close with a spherical mesh that is visible from a distance, it always maintains the appearance of a planet while significantly improving performance.

![ClipmapFar](/files/qI4MuEQDiKcQ5mJXPLzS)

* **Base Resolution:** Triangle density in the mesh (must be a multiple of 4). Higher resolution results in more planet detail but at a higher performance cost. If performance is poor during execution, this parameter can be lowered to improve it.
* **Num Levels:** Number of grid rings that serve as the levels of detail making up the planet. This parameter also directly affects performance, as each inner concentric ring has twice the resolution of its adjacent outer ring.
* **Min Triangle Size:** Minimum triangle size that the highest level of detail can reach.
* **Height Visibility:** Altitude at which the rings are simplified into a single level of detail. This parameter is based on the planet radius (if(Distance) > HeightVisibility \* Planet Radius).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://tfg-bravoperezrubio.gitbook.io/cosmicarchitectdocumentation/explanation-of-classes-and-components/clipmap.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
