1#include "ExtensionRegistry.h"
3#include "Resources/ResourceStore.h"
4#include "Serialization/EntityReader.h"
5#include "Services/Variables.h"
7#include "Components/PointDataComponent.h"
8#include "Components/DensityFieldComponent.h"
9#include "Components/PointVisualizationComponent.h"
10#include "Components/OctComponent.h"
12#include "Systems/DensityFieldSystem.h"
13#include "Systems/PointVisualizationSystem.h"
14#include "Systems/OctSystem.h"
15#include "Systems/OctDummyProviderSystem.h"
17#include "../Extensions/IsoSurfaces/IsoSurfaces.h"
19#include "Foundation/Reflection/TypeDatabase.h"
21namespace Cogs::Core::Volumetric
31 } volumetricExtension;
36 PointDataComponent::registerType();
37 PointVisualizationComponent::registerType();
38 DensityFieldComponent::registerType();
39 OctComponent::registerType();
40 VolOctDummyProviderComponent::registerType();
46 context->
resourceStore->addResourceArchive(
"Cogs.Core.Extensions.Volumetric.zip");
48 context->
resourceStore->addSearchPath(
"../Extensions/Volumetric/Data/Materials/");
49 context->
resourceStore->addSearchPath(
"../Extensions/Volumetric/Data/Shaders/");
53 context->
variables->set(
"Volumetric.IsoSurfaces.AVX2",
false);
56 readEntityDefinition(R
"(
57{ "name": "VolPointData",
59 "VolPointDataComponent",
66 readEntityDefinition(R"(
67{ "name": "VolPointVisualization",
69 "VolPointVisualizationComponent",
76 { "VolPointVisualizationComponent": { "material": "DefaultMaterial" }},
81 readEntityDefinition(R"(
82{ "name": "VolDensityField",
84 "VolDensityFieldComponent",
88 "SubMeshRenderComponent"
91 { "VolDensityFieldComponent": { "material": "DefaultMaterial" }},
96 readEntityDefinition(R"(
97{ "name": "VolOctDummy",
100 "VolOctDummyProviderComponent",
101 "TransformComponent",
A Context instance contains all the services, systems and runtime components needed to use Cogs.
void registerDynamicComponentType(const StringView &typeName)
Register a dynamic component type with the given typeName.
class EntityStore * store
Entity store.
std::unique_ptr< class Variables > variables
Variables service instance.
std::unique_ptr< class ResourceStore > resourceStore
ResourceStore service instance.
static void add(Extension *extension, StringView version)
Adds the given extension to the registry, ensuring the initialization methods are called at appropria...
Defines an extension to Cogs.Core and provides methods to override in order to initialize extension c...
@ PostView
Run after view data has been updated. Anything after this is appropriate for geometry depending on e....
@ Geometry
Run at the time geometry data is updated.
@ PreGeometry
Run before geometry updates are performed.
bool initialize(Context *context) override
Initialize extension for the given context.
bool initializeStatic() override
Initialize extension statically.
const char * getExtensionKey() const override
Get the extensions unique key, used to check for extension presence and retrieve extension specific d...