3#include "ClipmapTerrainTypes.h"
5#include "Rendering/IGraphicsDevice.h"
12 glm::vec2 quadVertices[] = {
27 bool enableUpdate =
true;
28 bool enableCulling =
true;
30 bool invalidateNormals =
false;
59 float heightExaggeration = 1.0f;
61 Vector4d worldScale = Vector4d(1, 1, 1, 1);
63 bool enableNoData =
false;
70 Vector4 shallowColor = Vector4(0.15f, 0.28f, 0.35f, 0.9f);
71 Vector4 deepColor = Vector4(0.1f, 0.2f, 0.3f, 0.95f);
72 Vector4 roughColor = Vector4(0.15f, 0.35f, 0.28f, 0.95f);
74 float worldSpaceMeter = 1.f;
75 float baseTileLength = 500;
76 int baseTileSizeLog2 = 8;
77 float significantWaveHeight = 2.f;
78 float significantWavePeriod = 6.f;
79 float swellDirection = 0.f;
81 float roughness = 0.f;
82 float detailFactor = 9.13f;
84 float foamDetectionScale = 0.1f;
85 float foamErosionValue = 2.f;
86 float shoalingEffectFactor = 0.f;
88 float lodDisplaceStart = 2.f;
89 float lodDisplaceTransition = 1.f;
90 float lodNormalStart = 0.01f;
91 float lodNormalTransition = 2.5f;
93 float lodDetailStart = 25.f;
94 float lodDetailTransition = 150.f;
95 float lodFoamStart = 0.75f;
96 float lodFoamTransition = 0.3f;
98 bool enableImagery =
true;
103 bool showImagery =
true;
104 bool showBlendRegions =
false;
106 bool enableBlending =
true;
108 bool showLevelColors =
false;
110 Vector4 blendRegionColor = Vector4(0, 0, 1, 1);
111 Vector4 diffuseColor = Vector4(0.4f, 0.5f, 0.4f, 1);
113 float lodBias = 0.0f;
115 bool enableMipMapping =
false;
117 bool enableCulling =
true;
122 bool showDepthBuffer =
false;
123 bool showHeightMaps =
false;
124 bool showTextures =
false;
126 Vector2 textureOverlaySize = Vector2(256, 256);
131 enum ETerrainRenderPass
153 if (permutationDependentRenderContextData.size() <= index)
154 permutationDependentRenderContextData.resize(index + 4);
156 return permutationDependentRenderContextData[index];
165 TerrainRenderPass::ETerrainRenderPass renderPass = TerrainRenderPass::Main;
173 bool wireframe =
false;
175 size_t maxAppliedTilesPerFrame = 2;
179 Vector3 sampleCenter;
180 Vector3d sampleOrigin;
181 Vector3d sampleCameraCenter;
183 bool initialized =
false;
191 Matrix projectionMatrix;
192 Matrix viewMatrixInverse;
198 size_t permutation = 0;
207 bool reverseDepth =
false;
211 int rayPickIndex = -1;
214 std::vector<PermutationDependentRenderContextData> permutationDependentRenderContextData;
219 bool changed =
false;
221 int numActiveImagery;
222 bool precomputeNormals =
false;
Represents a graphics device used to manage graphics resources and issue drawing commands.
Contains all Cogs related functionality.
Policies for determining the center of the clipmap.
@ TerrainProjected
Find the projected center of the screen on the terrain and center the clipmap on these coordinates.
@ Projected
Project the lower center of the screen onto the XY-plane and center the clipmap on these coordinates.
@ Vertical
Project the camera coordinates onto the XY-plane and center the clipmap on these coordinates.
Represents a graphics device context which can receive rendering commands.
Part of the render context that depends on the selected permutation.