Cogs.Core
PotreeComponent.h
1#pragma once
2
3#include "Components/Core/RenderComponent.h"
4#include "Resources/Resources.h"
5
6namespace Cogs::Core
7{
8
11 {
12 None = 0,
13 Ready = 1,
14 FetchingBegin = 2,
15 FetchingEnd = 3,
16 };
17
18
20 enum struct PotreeColoring : uint32_t
21 {
22 Base,
23 Color,
24 Intensity,
25 Level
26 };
27
29 enum struct PotreeShading : uint32_t
30 {
31 Flat,
32 Basic
33 };
34
36 enum struct PotreePointShape : uint32_t
37 {
38 Square,
39 Disc,
41 Sphere
42 };
43
45 enum struct PotreePointSizing : uint32_t
46 {
47 FixedSize,
50 };
51
53 enum struct PotreeDebugBoxes : uint32_t
54 {
55 None,
58 };
59
61 enum struct PotreeOriginPolicy : uint32_t
62 {
63 None,
66 };
67
75 {
76 PotreeComponent() { renderFlags = RenderFlags::DefaultNoShadows; }
77
78 std::string source;
79 std::vector<glm::vec4> clipPlanes;
83 float pointScreenSpacing = 2.f;
84 float rootNodeMinScreenSize = 10.f;
85 float pointSize = 20.f;
86 float minPointSize = 1.f;
87 float maxPointSize = 150.f;
88 float densityLevelScale = 0.7f;
89 float densityScale = 3.f;
90 float densityBias = 0.f;
91 float shadingIntensity = 1.f;
92
93 glm::vec4 baseColor = glm::vec4(0.5f, 0.5f, 0.5f, 1.0f);
94 glm::vec3 outlineColor = glm::vec3(0.f, 0.f, 0.f);
95 float outlineSize = 1.f;
96
97 float distanceCutoffScale = 5.f;
98 float distanceCutoffMinimum = -1.f;
99
106
107 bool supportPicking = true;
108 bool disableLodUpdates = false;
109 bool disableCustomCulling = false;
111
112 static void registerType();
113 };
114}
115
116template<> inline Cogs::StringView getName<Cogs::Core::PotreeNotification>() { return "PotreeNotification"; }
117
118template<> inline Cogs::StringView getName<Cogs::Core::PotreeColoring>() { return "PotreeColoring"; }
119
120template<> inline Cogs::StringView getName<Cogs::Core::PotreeShading>() { return "PotreeShading"; }
121
122template<> inline Cogs::StringView getName<Cogs::Core::PotreePointShape>() { return "PotreePointShape"; }
123
124template<> inline Cogs::StringView getName<Cogs::Core::PotreePointSizing>() { return "PotreePointSizing"; }
125
126template<> inline Cogs::StringView getName<Cogs::Core::PotreeDebugBoxes>() { return "PotreeDebugBoxes"; }
127
128template<> inline Cogs::StringView getName<Cogs::Core::PotreeOriginPolicy>() { return "PotreeOriginPolicy"; }
129
130template<> inline Cogs::StringView getName<Cogs::Core::PotreeComponent>() { return "PotreeComponent"; }
131
Base component for all rendering content.
RenderFlags renderFlags
Render flags used to control rendering behavior.
Provides a weakly referenced view over the contents of a string.
Definition: StringView.h:24
Contains the Engine, Renderer, resource managers and other systems needed to run Cogs....
@ Disc
Each point is a flat disc.
@ Square
Each point is a flat square.
@ Paraboloid
Each point is a square with depth adjusted to a parabolic shape, requires support for changing fragme...
@ DistanceAndDensityScaled
Base point size scaled by camera distance and adjusted for local point density.
@ DistanceScaled
Base point size scaled by camera distance.
@ FixedSize
Base point size with no scaling.
@ Flat
Use color directly as-is.
@ Basic
Add a falloff darkening away from center.
@ None
No debug node outlines.
@ ActiveCells
Outline all active cells.
@ ActiveLeafCells
Outline active cells that are currently leaves.
@ Sphere
Generic sphere shape.
@ FetchingBegin
Loading queue transitions from empty to non-empty, that is, instance needs data.
@ FetchingEnd
Loading queue transitions from non-empty to empty, that is, instance has all data it currently needs.
@ Ready
All 6 baselayers are fully loaded, instance will begin rendering.
@ Base
Use basecolor property of PotreeComponent, uniform color.
@ Intensity
Use intensity property from point set if present and colorize it with the gradient texture,...
@ Level
Use the octree depth as color, useful for debugging.
@ Color
Use color property from point set if present, fallback to basecolor.
@ CenterOnOrigin
Adjust offset s.t. point cloud is centered around entity origin.
@ None
Just use scale and offset as is.
@ CenterOnOriginAdjustCoordinate
Adjust offset s.t. point cloud is centered around enttiy origin and adjust transformcomponent coordin...
Component for Point Cloud Display.
float maxPointSize
Maximum point size in pixels regardless of point size strategy, gets DPI scaled.
std::vector< glm::vec4 > clipPlanes
Deprecated, use clip shapes instead.
MaterialInstanceHandle boxMaterial
Optional debug material override, material should inherit from PotreeBoxCore.material.
float shadingIntensity
Intensity of point shading effect, if enabled.
float pointSize
Base point size in pixels, gets DPI scaled.
float outlineSize
Size of point outlines, set to 0.0 to disable point outlines.
PotreeColoring coloring
Specify coloring strategy.
TextureHandle gradient
Optional gradient texture to colorize scalar values.
std::string source
URL of path where metadata.js(OLD format: cloud.js) resides.
bool disableLodUpdates
Debug trigger to disable update of lod calculations.
MaterialInstanceHandle pointMaterial
Optional point material override, material should inherit from PotreePointCore.material.
glm::vec3 outlineColor
Color of point outlines if enabled.
float rootNodeMinScreenSize
Minimal screen-space size root node can have before being eligble for distance-based culling.
PotreeShading shading
Specify optional shading.
PotreePointShape pointShape
Specify point shape.
glm::vec4 baseColor
Base color to use when Base coloring strategy is used.
float densityBias
DistanceAndDensityScaled: Offset where depth and density starts to affectg point size calc.
PotreePointSizing pointSizing
Specify point sizing strategy.
bool disableCustomClipping
Debug switch to disable clipping of points against custom clipping planes.
float distanceCutoffScale
Cut off chunks that are further away than camera elevation above pointcloud z - minimum times this sc...
float densityLevelScale
DistanceAndDensityScaled: Strength of level depth in point size calc.
bool supportPicking
If true, an extra CPU side copy of the point positions are maintained to enable CPU picking.
bool disableCustomCulling
Debug switch to disable culling of cells against custom clipping planes.
float distanceCutoffMinimum
Minimum value for distance-based cut-off, cut-off distance will never be less than this value.
float pointScreenSpacing
Maximal screen space distance between points before refining, gets adjusted by DPI scaling.
float densityScale
DistanceAndDensityScaled: Strength of local point density in point size calc.
PotreeOriginPolicy originPolicy
Specify origin policy, see enum for details.
PotreeDebugBoxes debugBoxes
Specify optional debug graphics.
float minPointSize
Minimum point size in pixels regardless of point size strategy, gets DPI scaled.