Open 3D Engine Terrain Gem API Reference
24.09
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
|
#include <TerrainClipmapManager.h>
Public Types | |
enum | ClipmapSize : uint32_t { ClipmapSize512 = 512u , ClipmapSize1024 = 1024u , ClipmapSize2048 = 2048u } |
Public Member Functions | |
AZ_CLASS_ALLOCATOR (ClipmapConfiguration, AZ::SystemAllocator) | |
AZ_RTTI (ClipmapConfiguration, "{5CC8A81E-B850-46BA-A577-E21530D9ED04}") | |
uint32_t | CalculateMacroClipmapStackSize () const |
uint32_t | CalculateDetailClipmapStackSize () const |
Public Attributes | |
bool | m_clipmapEnabled = false |
Enable clipmap feature for rendering. | |
ClipmapSize | m_clipmapSize = ClipmapSize1024 |
The size of the clipmap image in each layer. | |
float | m_macroClipmapMaxRenderRadius = 2048.0f |
float | m_detailClipmapMaxRenderRadius = 256.0f |
float | m_macroClipmapMaxResolution = 2.0f |
float | m_detailClipmapMaxResolution = 2048.0f |
float | m_macroClipmapScaleBase = 2.0f |
float | m_detailClipmapScaleBase = 2.0f |
uint32_t | m_macroClipmapMarginSize = 4 |
uint32_t | m_detailClipmapMarginSize = 4 |
uint32_t | m_extendedClipmapMarginSize = 2 |
uint32_t | m_clipmapBlendSize = 256 |
Static Public Attributes | |
static constexpr uint32_t | MacroClipmapStackSizeMax = 16 |
Max clipmap number that can have. Used to initialize fixed arrays. | |
static constexpr uint32_t | DetailClipmapStackSizeMax = 16 |
static constexpr uint32_t | SharedClipmapStackSizeMax = AZStd::max(ClipmapConfiguration::MacroClipmapStackSizeMax, ClipmapConfiguration::DetailClipmapStackSizeMax) |
Clipmap configuration to set basic properties of the clipmaps. Derived properties will be automatically calculated based on the given data, including: Precision of each clipmap level, depth of the clipmap stack.
uint32_t Terrain::ClipmapConfiguration::CalculateMacroClipmapStackSize | ( | ) | const |
Calculate how many layers of clipmap is needed. Final result must be less or equal than the MacroClipmapStackSizeMax/DetailClipmapStackSizeMax.
uint32_t Terrain::ClipmapConfiguration::m_clipmapBlendSize = 256 |
The size of the blending area between each clipmap level. Size in texels.
uint32_t Terrain::ClipmapConfiguration::m_extendedClipmapMarginSize = 2 |
In addition to the above margin size used for updating, this margin is a safety margin to avoid edge cases when blending or sampling. For example, due to toroidal addressing, 2 physical adjacent texels can locate on the opposite edges in the clipmap in logical space. They may be accidentally blended by float rounding errors. Size in texels.
uint32_t Terrain::ClipmapConfiguration::m_macroClipmapMarginSize = 4 |
The margin of the clipmap where the data won't be used, so that bigger margin results in less frequent update. But bigger margin also means it tends to use lower resolution clipmap. Size in: texels.
float Terrain::ClipmapConfiguration::m_macroClipmapMaxRenderRadius = 2048.0f |
Max render radius that the lowest resolution clipmap can cover. Radius in: meters. For example, 1000 means the clipmaps render 1000 meters at most from the view position.
float Terrain::ClipmapConfiguration::m_macroClipmapMaxResolution = 2.0f |
The resolution of the highest resolution clipmap in the stack. The actual max resolution may be higher due to matching max render radius. Resolution in: texels per meter.
float Terrain::ClipmapConfiguration::m_macroClipmapScaleBase = 2.0f |
The scale base between two adjacent clipmap layers. For example, 3 means the (n+1)th clipmap covers 3^2 = 9 times to what is covered by the nth clipmap.