125 this->settings.biomeParameters =
settings;
172 n_assert_msg(this->bits &
AllBits,
"BiomeSettinsBuilder: All fields must be set before calling finish");
223 bool enableRayTracing);
Definition graphicscontext.h:165
An ID allocator associates an id with a slice in an N number of arrays.
Definition idallocator.h:39
Nebula's smart pointer class which manages the life time of RefCounted objects.
Definition ptr.h:38
Definition terraincontext.h:204
static void SetupTerrain(const Graphics::GraphicsEntityId entity, const Resources::ResourceName &heightMap, const Resources::ResourceName &decisionMap, bool enableRayTracing)
setup new terrain surface from texture and settings
Definition terraincontext.cc:1178
static void Dealloc(Graphics::ContextEntityId id)
deallocate a slice
Definition terraincontext.cc:2570
static Graphics::ContextEntityId Alloc()
allocate a new slice for this context
Definition terraincontext.cc:2561
static void CullPatches(const Ptr< Graphics::View > &view, const Graphics::FrameContext &ctx)
cull terrain patches
Definition terraincontext.cc:1668
static void Discard()
destroy terrain context
Definition terraincontext.cc:1165
static void SetBiomeHeightThreshold(TerrainBiomeId id, float threshold)
set biome height threshold
Definition terraincontext.cc:1650
static void SetBiomeSlopeThreshold(TerrainBiomeId id, float threshold)
set biome slope threshold
Definition terraincontext.cc:1641
TerrainContext()
constructor
Definition terraincontext.cc:261
@ TerrainBiome_MaskTexture
Definition terraincontext.h:313
@ TerrainBiome_Index
Definition terraincontext.h:312
@ TerrainBiome_Settings
Definition terraincontext.h:311
static TerrainAllocator terrainAllocator
Definition terraincontext.h:307
static void SetVisible(bool visible)
Definition terraincontext.cc:2422
static void SetSun(const Graphics::GraphicsEntityId sun)
Set the sun entity for terrain shadows.
Definition terraincontext.cc:1659
static void OnRenderDebug(uint32_t flags)
debug rendering
Definition terraincontext.cc:2541
Ids::IdAllocator< TerrainLoadInfo, TerrainRuntimeInfo > TerrainAllocator
Definition terraincontext.h:306
static bool GetVisible()
Definition terraincontext.cc:2413
virtual ~TerrainContext()
destructor
Definition terraincontext.cc:268
@ Terrain_RuntimeInfo
Definition terraincontext.h:300
@ Terrain_LoadInfo
Definition terraincontext.h:299
static TerrainBiomeAllocator terrainBiomeAllocator
Definition terraincontext.h:320
static void RenderUI(const Graphics::FrameContext &ctx)
render IMGUI
Definition terraincontext.cc:2431
static void UpdateLOD(const Ptr< Graphics::View > &view, const Graphics::FrameContext &ctx)
update sparse texture mips
Definition terraincontext.cc:2104
Ids::IdAllocator< BiomeSettings, uint32_t > TerrainBiomeAllocator
Definition terraincontext.h:319
static void Create(const TerrainSetupSettings &settings)
create terrain context
Definition terraincontext.cc:276
static TerrainBiomeId CreateBiome(const BiomeSettings &settings)
setup a new biome
Definition terraincontext.cc:1548
static void ClearCache()
clear the tile cache (use when we need to force update the terrain)
Definition terraincontext.cc:2532
Nebula's dynamic array class.
Definition array.h:60
Implements a fixed size one-dimensional array.
Definition fixedarray.h:20
A StringAtom.
Definition stringatom.h:22
bool IsValid() const
return true if valid (contains a non-empty string)
Definition stringatom.h:353
#define n_assert_msg(exp, msg)
Definition debug.h:52
#define ID_32_TYPE(x)
Definition id.h:16
The occupancy quad tree implements a tree which allows for a quick search.
Definition occupancyquadtree.h:15
Graphics::GraphicsEntityId sun
Definition terraincontext.cc:89
TerrainSetupSettings settings
Definition terraincontext.cc:70
SubTextureUpdateState
Definition terraincontext.h:185
A resource table declares a list of resources (ResourceTable in DX12, DescriptorSet in Vulkan)
Definition graphicscontext.h:133
Definition graphicsserver.h:31
The graphics entity is only an Id, to which we can attach GraphicsContexts.
Definition graphicsentity.h:16
Definition terraincontext.h:53
BiomeMaterial Finish()
Finish.
Definition terraincontext.h:76
BiomeMaterialBuilder & Albedo(const Resources::ResourceName &name)
Set albedo.
Definition terraincontext.h:55
BiomeMaterialBuilder & Normal(const Resources::ResourceName &name)
Set normal.
Definition terraincontext.h:62
BiomeMaterial material
Definition terraincontext.h:81
BiomeMaterialBuilder & Material(const Resources::ResourceName &name)
Set material.
Definition terraincontext.h:69
Definition terraincontext.h:46
Resources::ResourceName albedo
Definition terraincontext.h:47
Resources::ResourceName material
Definition terraincontext.h:49
Resources::ResourceName normal
Definition terraincontext.h:48
Definition terraincontext.h:37
float slopeThreshold
Definition terraincontext.h:38
bool useMaterialWeights
Definition terraincontext.h:41
float uvScaleFactor
Definition terraincontext.h:40
Resources::ResourceName weights
Definition terraincontext.h:42
float heightThreshold
Definition terraincontext.h:39
Definition terraincontext.h:101
BiomeSettings settings
Definition terraincontext.h:117
BiomeSettings Finish()
Finish.
Definition terraincontext.h:170
BiomeSettingsBuilder & Mask(const Resources::ResourceName &mask)
Builder for biome mask.
Definition terraincontext.h:162
BiomeSettingsBuilder & HeightSlopeMaterial(const BiomeMaterial &material)
Builder for height slope material.
Definition terraincontext.h:154
BuilderBits
Definition terraincontext.h:104
@ HeightSlopeMaterialBit
Definition terraincontext.h:110
@ HeightMaterialBit
Definition terraincontext.h:109
@ SlopeMaterialBit
Definition terraincontext.h:108
@ AllBits
Definition terraincontext.h:113
@ SettingsBit
Definition terraincontext.h:106
@ FlatMaterialBit
Definition terraincontext.h:107
@ BiomeMask
Definition terraincontext.h:111
@ NoBits
Definition terraincontext.h:105
BiomeSettingsBuilder & FlatMaterial(const BiomeMaterial &material)
Builder for flat material.
Definition terraincontext.h:130
BiomeSettingsBuilder & HeightMaterial(const BiomeMaterial &material)
Builder for height material.
Definition terraincontext.h:146
uint8 bits
Definition terraincontext.h:116
BiomeSettingsBuilder & Parameters(const BiomeParameters &settings)
Builder for settings.
Definition terraincontext.h:122
BiomeSettingsBuilder & SlopeMaterial(const BiomeMaterial &material)
Builder for slope material.
Definition terraincontext.h:138
Definition terraincontext.h:85
Resources::ResourceName biomeMask
Definition terraincontext.h:97
BiomeParameters biomeParameters
Definition terraincontext.h:95
BiomeMaterial materials[BiomeMaterialLayer::NumLayers]
Definition terraincontext.h:96
BiomeMaterialLayer
Definition terraincontext.h:87
@ Height
Definition terraincontext.h:90
@ Flat
Definition terraincontext.h:88
@ Slope
Definition terraincontext.h:89
@ NumLayers
Definition terraincontext.h:93
@ HeightSlope
Definition terraincontext.h:91
Definition terraincontext.h:194
SubTextureUpdateState updateState
Definition terraincontext.h:200
Math::uint2 oldCoord
Definition terraincontext.h:199
uint oldMaxMip
Definition terraincontext.h:197
IndexT index
Definition terraincontext.h:195
uint oldTiles
Definition terraincontext.h:196
float mipBias
Definition terraincontext.h:198
uint newMaxMip
Definition terraincontext.h:197
uint newTiles
Definition terraincontext.h:196
Definition terraincontext.h:178
uint maxMip
Definition terraincontext.h:180
uint physicalTileSize
Definition terraincontext.h:181
uint subTextureWorldSize
Definition terraincontext.h:179
Definition terraincontext.h:26
Definition terraincontext.h:258
float minHeight
Definition terraincontext.h:260
float maxHeight
Definition terraincontext.h:260
Resources::ResourceName texture
Definition terraincontext.h:259
Definition terraincontext.h:264
uint loadBits
Definition terraincontext.h:287
Util::Array< CoreGraphics::PrimitiveGroup > sectorPrimGroups
Definition terraincontext.h:266
Resources::ResourceId heightMap
Definition terraincontext.h:280
Util::FixedArray< CoreGraphics::ResourceTableId > patchTables
Definition terraincontext.h:291
Resources::ResourceId decisionMap
Definition terraincontext.h:281
Util::Array< Math::bbox > sectionBoxes
Definition terraincontext.h:265
bool enableRayTracing
Definition terraincontext.h:289
CoreGraphics::BufferId ibo
Definition terraincontext.h:294
Util::Array< Util::FixedArray< uint > > sectorTileOffsets
Definition terraincontext.h:269
CoreGraphics::BufferId vbo
Definition terraincontext.h:293
uint numTilesX
Definition terraincontext.h:278
Util::Array< Math::float2 > sectorUv
Definition terraincontext.h:271
Util::Array< bool > sectorVisible
Definition terraincontext.h:267
uint tileHeight
Definition terraincontext.h:279
Util::Array< bool > sectorUpdateTextureTile
Definition terraincontext.h:273
Util::Array< Math::uint3 > sectorAllocatedTile
Definition terraincontext.h:274
Util::Array< Util::FixedArray< uint > > sectorUniformOffsets
Definition terraincontext.h:268
Util::Array< float > sectorLod
Definition terraincontext.h:272
float worldWidth
Definition terraincontext.h:276
float maxHeight
Definition terraincontext.h:277
float worldHeight
Definition terraincontext.h:276
uint tileWidth
Definition terraincontext.h:279
float minHeight
Definition terraincontext.h:277
TextureLoadBits
Definition terraincontext.h:283
@ DecisionMapLoaded
Definition terraincontext.h:285
@ HeightMapLoaded
Definition terraincontext.h:284
uint lowresGenerated
Definition terraincontext.h:288
uint numTilesY
Definition terraincontext.h:278
Util::Array< Math::uint2 > sectorTextureTileSize
Definition terraincontext.h:270
Definition terraincontext.h:29
float tileHeight
Definition terraincontext.h:32
float quadsPerTileY
Definition terraincontext.h:33
float worldSizeX
Definition terraincontext.h:31
float worldSizeZ
Definition terraincontext.h:31
float quadsPerTileX
Definition terraincontext.h:33
float minHeight
Definition terraincontext.h:30
float tileWidth
Definition terraincontext.h:32
float maxHeight
Definition terraincontext.h:30
uint8_t uint8
Definition types.h:42
unsigned int uint
Definition types.h:31
int IndexT
Definition types.h:48