1 /*
2 * Copyright (c) 2022 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16 #include <3d/ecs/components/animation_component.h>
17 #include <3d/ecs/components/animation_input_component.h>
18 #include <3d/ecs/components/animation_output_component.h>
19 #include <3d/ecs/components/animation_state_component.h>
20 #include <3d/ecs/components/animation_track_component.h>
21 #include <3d/ecs/components/camera_component.h>
22 #include <3d/ecs/components/dynamic_environment_blender_component.h>
23 #include <3d/ecs/components/environment_component.h>
24 #include <3d/ecs/components/fog_component.h>
25 #include <3d/ecs/components/graphics_state_component.h>
26 #include <3d/ecs/components/joint_matrices_component.h>
27 #include <3d/ecs/components/layer_component.h>
28 #include <3d/ecs/components/light_component.h>
29 #include <3d/ecs/components/local_matrix_component.h>
30 #include <3d/ecs/components/material_component.h>
31 #include <3d/ecs/components/mesh_component.h>
32 #include <3d/ecs/components/morph_component.h>
33 #include <3d/ecs/components/name_component.h>
34 #include <3d/ecs/components/node_component.h>
35 #include <3d/ecs/components/physical_camera_component.h>
36 #include <3d/ecs/components/planar_reflection_component.h>
37 #include <3d/ecs/components/post_process_component.h>
38 #include <3d/ecs/components/post_process_configuration_component.h>
39 #include <3d/ecs/components/reflection_probe_component.h>
40 #include <3d/ecs/components/render_configuration_component.h>
41 #include <3d/ecs/components/render_handle_component.h>
42 #include <3d/ecs/components/render_mesh_batch_component.h>
43 #include <3d/ecs/components/render_mesh_component.h>
44 #include <3d/ecs/components/rsdz_model_id_component.h>
45 #include <3d/ecs/components/skin_component.h>
46 #include <3d/ecs/components/skin_ibm_component.h>
47 #include <3d/ecs/components/skin_joints_component.h>
48 #include <3d/ecs/components/transform_component.h>
49 #include <3d/ecs/components/uri_component.h>
50 #include <3d/ecs/components/water_ripple_component.h>
51 #include <3d/ecs/components/weather_component.h>
52 #include <3d/ecs/components/world_matrix_component.h>
53 #include <3d/ecs/systems/intf_morphing_system.h>
54 #include <3d/ecs/systems/intf_node_system.h>
55 #include <3d/ecs/systems/intf_render_preprocessor_system.h>
56 #include <3d/ecs/systems/intf_render_system.h>
57 #include <3d/ecs/systems/intf_skinning_system.h>
58 #include <3d/ecs/systems/intf_weather_system.h>
59 #include <core/log.h>
60 #include <core/namespace.h>
61 #include <render/datastore/intf_render_data_store_manager.h>
62 #include <render/intf_plugin.h>
63
64 #include "ecs/components/initial_transform_component.h"
65 #include "ecs/components/previous_joint_matrices_component.h"
66 #include "ecs/systems/animation_system.h"
67 #include "ecs/systems/local_matrix_system.h"
68 #include "render/datastore/render_data_store_default_camera.h"
69 #include "render/datastore/render_data_store_default_light.h"
70 #include "render/datastore/render_data_store_default_material.h"
71 #include "render/datastore/render_data_store_default_scene.h"
72 #include "render/datastore/render_data_store_morph.h"
73 #include "render/datastore/render_data_store_weather.h"
74 #include "render/node/render_node_camera_single_post_process.h"
75 #include "render/node/render_node_camera_weather.h"
76 #include "render/node/render_node_create_default_camera_gpu_images.h"
77 #include "render/node/render_node_default_camera_controller.h"
78 #include "render/node/render_node_default_camera_post_process_controller.h"
79 #include "render/node/render_node_default_cameras.h"
80 #include "render/node/render_node_default_depth_render_slot.h"
81 #include "render/node/render_node_default_env.h"
82 #include "render/node/render_node_default_environment_blender.h"
83 #include "render/node/render_node_default_lights.h"
84 #include "render/node/render_node_default_material_deferred_shading.h"
85 #include "render/node/render_node_default_material_objects.h"
86 #include "render/node/render_node_default_material_render_slot.h"
87 #include "render/node/render_node_default_shadow_render_slot.h"
88 #include "render/node/render_node_default_shadows_blur.h"
89 #include "render/node/render_node_morph.h"
90 #include "render/node/render_node_weather_simulation.h"
91
92 // Include the declarations directly from engine.
93 // NOTE: macro defined by cmake as CORE_STATIC_PLUGIN_HEADER="${CORE_ROOT_DIRECTORY}/src/static_plugin_decl.h"
94 // this is so that the core include directories are not leaked here, but we want this one header in this case.
95 #ifndef __APPLE__
96 #include CORE_STATIC_PLUGIN_HEADER
97 #include "registry_data.cpp"
98 #endif
99
100 #define SYSTEM_FACTORY(type) type##Instance, type##Destroy
101 #define MANAGER_FACTORY(type) type##Instance, type##Destroy
102
103 #define MANAGER(name, type) \
104 extern IComponentManager* type##Instance(IEcs&); \
105 extern void type##Destroy(IComponentManager*); \
106 namespace { \
107 static constexpr auto name = ComponentManagerTypeInfo { { ComponentManagerTypeInfo::UID }, type::UID, \
108 CORE_NS::GetName<type>().data(), MANAGER_FACTORY(type) }; \
109 }
110
111 #define SYSTEM(name, type, deps, readOnlyDeps, afterSystem, beforeSystem) \
112 extern ISystem* type##Instance(IEcs&); \
113 extern void type##Destroy(ISystem*); \
114 namespace { \
115 static constexpr auto name = SystemTypeInfo { { SystemTypeInfo::UID }, type::UID, CORE_NS::GetName<type>().data(), \
116 SYSTEM_FACTORY(type), deps, readOnlyDeps, afterSystem, beforeSystem }; \
117 }
118
119 CORE3D_BEGIN_NAMESPACE()
120 using namespace BASE_NS;
121 using namespace CORE_NS;
122 using namespace RENDER_NS;
123
124 // ECS components
125 MANAGER(CAMERA_COMPONENT_TYPE_INFO, ICameraComponentManager);
126 MANAGER(PHYSICAL_CAMERA_COMPONENT_TYPE_INFO, IPhysicalCameraComponentManager);
127 MANAGER(LIGHT_COMPONENT_TYPE_INFO, ILightComponentManager);
128 MANAGER(LOCAL_MATRIX_COMPONENT_TYPE_INFO, ILocalMatrixComponentManager);
129 MANAGER(NODE_COMPONENT_TYPE_INFO, INodeComponentManager);
130 MANAGER(RENDER_MESH_COMPONENT_TYPE_INFO, IRenderMeshComponentManager);
131 MANAGER(WORLD_MATRIX_COMPONENT_TYPE_INFO, IWorldMatrixComponentManager);
132 MANAGER(TRANSFORM_COMPONENT_TYPE_INFO, ITransformComponentManager);
133 MANAGER(INITIAL_TRANSFORM_COMPONENT_TYPE_INFO, IInitialTransformComponentManager);
134 MANAGER(RENDER_CONFIGURATION_COMPONENT_TYPE_INFO, IRenderConfigurationComponentManager);
135 MANAGER(SKIN_COMPONENT_TYPE_INFO, ISkinComponentManager);
136 MANAGER(SKIN_IBM_COMPONENT_TYPE_INFO, ISkinIbmComponentManager);
137 MANAGER(SKIN_JOINTS_COMPONENT_TYPE_INFO, ISkinJointsComponentManager);
138 MANAGER(JOINT_MATRICES_COMPONENT_TYPE_INFO, IJointMatricesComponentManager);
139 MANAGER(MORPH_COMPONENT_TYPE_INFO, IMorphComponentManager);
140 MANAGER(PLANAR_REFLECTION_COMPONENT_TYPE_INFO, IPlanarReflectionComponentManager);
141 MANAGER(RSDZ_MODEL_ID_COMPONENT_TYPE_INFO, IRSDZModelIdComponentManager);
142 MANAGER(MATERIAL_COMPONENT_TYPE_INFO, IMaterialComponentManager);
143 MANAGER(NAME_COMPONENT_TYPE_INFO, INameComponentManager);
144 MANAGER(MESH_COMPONENT_TYPE_INFO, IMeshComponentManager);
145 MANAGER(URI_COMPONENT_TYPE_INFO, IUriComponentManager);
146 MANAGER(ANIMATION_COMPONENT_TYPE_INFO, IAnimationComponentManager);
147 MANAGER(ANIMATION_INPUT_COMPONENT_TYPE_INFO, IAnimationInputComponentManager);
148 MANAGER(ANIMATION_OUTPUT_COMPONENT_TYPE_INFO, IAnimationOutputComponentManager);
149 MANAGER(ANIMATION_STATE_COMPONENT_TYPE_INFO, IAnimationStateComponentManager);
150 MANAGER(ANIMATION_TRACK_COMPONENT_TYPE_INFO, IAnimationTrackComponentManager);
151 MANAGER(ENVIRONMENT_COMPONENT_TYPE_INFO, IEnvironmentComponentManager);
152 MANAGER(FOG_COMPONENT_TYPE_INFO, IFogComponentManager);
153 MANAGER(RENDER_HANDLE_COMPONENT_TYPE_INFO, IRenderHandleComponentManager);
154 MANAGER(POST_PROCESS_COMPONENT_TYPE_INFO, IPostProcessComponentManager);
155 MANAGER(POST_PROCESS_CONFIGURATION_COMPONENT_TYPE_INFO, IPostProcessConfigurationComponentManager);
156 MANAGER(LAYER_COMPONENT_TYPE_INFO, ILayerComponentManager);
157 MANAGER(RENDER_MESH_BATCH_COMPONENT_TYPE_INFO, IRenderMeshBatchComponentManager);
158 MANAGER(PREV_JOINT_MATRICES_COMPONENT_TYPE_INFO, IPreviousJointMatricesComponentManager);
159 MANAGER(REFLECTION_PROBE_COMPONENT_TYPE_INFO, IReflectionProbeComponentManager);
160 MANAGER(DYNAMIC_ENVIRONMENT_BLENDER_COMPONENT_TYPE_INFO, IDynamicEnvironmentBlenderComponentManager);
161 MANAGER(GRAPHICS_STATE_COMPONENT_TYPE_INFO, IGraphicsStateComponentManager)
162 MANAGER(WATER_RIPPLE_COMPONENT_TYPE_INFO, IWaterRippleComponentManager)
163 MANAGER(WEATHER_COMPONENT_TYPE_INFO, IWeatherComponentManager)
164
165 namespace {
166 // Local matrix system dependencies.
167 constexpr Uid LOCAL_MATRIX_SYSTEM_RW_DEPS[] = { LOCAL_MATRIX_COMPONENT_TYPE_INFO.uid };
168 constexpr Uid LOCAL_MATRIX_SYSTEM_R_DEPS[] = { TRANSFORM_COMPONENT_TYPE_INFO.uid };
169
170 // Node system dependencies.
171 constexpr Uid NODE_SYSTEM_RW_DEPS[] = { WORLD_MATRIX_COMPONENT_TYPE_INFO.uid, NODE_COMPONENT_TYPE_INFO.uid };
172 constexpr Uid NODE_SYSTEM_R_DEPS[] = { NAME_COMPONENT_TYPE_INFO.uid, TRANSFORM_COMPONENT_TYPE_INFO.uid,
173 LOCAL_MATRIX_COMPONENT_TYPE_INFO.uid, RSDZ_MODEL_ID_COMPONENT_TYPE_INFO.uid };
174
175 // Render preprocessor system dependencies.
176 constexpr Uid RENDER_PREPROCESSOR_SYSTEM_RW_DEPS[] = { RENDER_HANDLE_COMPONENT_TYPE_INFO.uid };
177 constexpr Uid RENDER_PREPROCESSOR_SYSTEM_R_DEPS[] = {
178 JOINT_MATRICES_COMPONENT_TYPE_INFO.uid,
179 LAYER_COMPONENT_TYPE_INFO.uid,
180 MATERIAL_COMPONENT_TYPE_INFO.uid,
181 MESH_COMPONENT_TYPE_INFO.uid,
182 NODE_COMPONENT_TYPE_INFO.uid,
183 RENDER_MESH_COMPONENT_TYPE_INFO.uid,
184 SKIN_COMPONENT_TYPE_INFO.uid,
185 WORLD_MATRIX_COMPONENT_TYPE_INFO.uid,
186 GRAPHICS_STATE_COMPONENT_TYPE_INFO.uid,
187 };
188
189 // Render system dependencies.
190 constexpr Uid RENDER_SYSTEM_RW_DEPS[] = {
191 PLANAR_REFLECTION_COMPONENT_TYPE_INFO.uid,
192 MATERIAL_COMPONENT_TYPE_INFO.uid,
193 };
194 constexpr Uid RENDER_SYSTEM_R_DEPS[] = {
195 NODE_COMPONENT_TYPE_INFO.uid,
196 RENDER_MESH_COMPONENT_TYPE_INFO.uid,
197 WORLD_MATRIX_COMPONENT_TYPE_INFO.uid,
198 RENDER_CONFIGURATION_COMPONENT_TYPE_INFO.uid,
199 CAMERA_COMPONENT_TYPE_INFO.uid,
200 LIGHT_COMPONENT_TYPE_INFO.uid,
201 MESH_COMPONENT_TYPE_INFO.uid,
202 URI_COMPONENT_TYPE_INFO.uid,
203 NAME_COMPONENT_TYPE_INFO.uid,
204 ENVIRONMENT_COMPONENT_TYPE_INFO.uid,
205 FOG_COMPONENT_TYPE_INFO.uid,
206 RENDER_HANDLE_COMPONENT_TYPE_INFO.uid,
207 JOINT_MATRICES_COMPONENT_TYPE_INFO.uid,
208 POST_PROCESS_COMPONENT_TYPE_INFO.uid,
209 POST_PROCESS_CONFIGURATION_COMPONENT_TYPE_INFO.uid,
210 LAYER_COMPONENT_TYPE_INFO.uid,
211 RENDER_MESH_BATCH_COMPONENT_TYPE_INFO.uid,
212 PREV_JOINT_MATRICES_COMPONENT_TYPE_INFO.uid,
213 REFLECTION_PROBE_COMPONENT_TYPE_INFO.uid,
214 DYNAMIC_ENVIRONMENT_BLENDER_COMPONENT_TYPE_INFO.uid,
215 };
216
217 // Animation system dependencies.
218 constexpr Uid ANIMATION_SYSTEM_RW_DEPS[] = {
219 INITIAL_TRANSFORM_COMPONENT_TYPE_INFO.uid,
220 ANIMATION_COMPONENT_TYPE_INFO.uid,
221 ANIMATION_STATE_COMPONENT_TYPE_INFO.uid,
222 };
223 constexpr Uid ANIMATION_SYSTEM_R_DEPS[] = {
224 ANIMATION_INPUT_COMPONENT_TYPE_INFO.uid,
225 ANIMATION_OUTPUT_COMPONENT_TYPE_INFO.uid,
226 ANIMATION_TRACK_COMPONENT_TYPE_INFO.uid,
227 NAME_COMPONENT_TYPE_INFO.uid,
228 Uid {},
229 };
230
231 // Skinning system dependencies.
232 constexpr Uid SKINNING_SYSTEM_RW_DEPS[] = {
233 JOINT_MATRICES_COMPONENT_TYPE_INFO.uid,
234 };
235 constexpr Uid SKINNING_SYSTEM_R_DEPS[] = {
236 SKIN_COMPONENT_TYPE_INFO.uid,
237 SKIN_IBM_COMPONENT_TYPE_INFO.uid,
238 SKIN_JOINTS_COMPONENT_TYPE_INFO.uid,
239 WORLD_MATRIX_COMPONENT_TYPE_INFO.uid,
240 NODE_COMPONENT_TYPE_INFO.uid,
241 RENDER_MESH_COMPONENT_TYPE_INFO.uid,
242 MESH_COMPONENT_TYPE_INFO.uid,
243 PREV_JOINT_MATRICES_COMPONENT_TYPE_INFO.uid,
244 };
245
246 // Morph system dependencies.
247 constexpr Uid MORPHING_SYSTEM_R_DEPS[] = {
248 NODE_COMPONENT_TYPE_INFO.uid,
249 MESH_COMPONENT_TYPE_INFO.uid,
250 MORPH_COMPONENT_TYPE_INFO.uid,
251 RENDER_MESH_COMPONENT_TYPE_INFO.uid,
252 RENDER_HANDLE_COMPONENT_TYPE_INFO.uid,
253 };
254
255 // Weather system dependencies.
256 constexpr Uid WEATHER_SYSTEM_RW_DEPS[] = {
257 RENDER_HANDLE_COMPONENT_TYPE_INFO.uid,
258 MESH_COMPONENT_TYPE_INFO.uid,
259 RENDER_MESH_COMPONENT_TYPE_INFO.uid,
260 MATERIAL_COMPONENT_TYPE_INFO.uid,
261 TRANSFORM_COMPONENT_TYPE_INFO.uid,
262 RENDER_CONFIGURATION_COMPONENT_TYPE_INFO.uid,
263 CAMERA_COMPONENT_TYPE_INFO.uid,
264 ENVIRONMENT_COMPONENT_TYPE_INFO.uid,
265 WATER_RIPPLE_COMPONENT_TYPE_INFO.uid,
266 WEATHER_COMPONENT_TYPE_INFO.uid,
267 };
268
269 constexpr Uid WEATHER_SYSTEM_R_DEPS[] = {
270 WATER_RIPPLE_COMPONENT_TYPE_INFO.uid,
271 WEATHER_COMPONENT_TYPE_INFO.uid,
272 TRANSFORM_COMPONENT_TYPE_INFO.uid,
273 };
274
275 constexpr ComponentManagerTypeInfo CORE_COMPONENT_TYPE_INFOS[] = { CAMERA_COMPONENT_TYPE_INFO,
276 INITIAL_TRANSFORM_COMPONENT_TYPE_INFO, PHYSICAL_CAMERA_COMPONENT_TYPE_INFO, LIGHT_COMPONENT_TYPE_INFO,
277 LOCAL_MATRIX_COMPONENT_TYPE_INFO, NODE_COMPONENT_TYPE_INFO, WORLD_MATRIX_COMPONENT_TYPE_INFO,
278 RENDER_MESH_COMPONENT_TYPE_INFO, TRANSFORM_COMPONENT_TYPE_INFO, RENDER_CONFIGURATION_COMPONENT_TYPE_INFO,
279 SKIN_COMPONENT_TYPE_INFO, SKIN_JOINTS_COMPONENT_TYPE_INFO, JOINT_MATRICES_COMPONENT_TYPE_INFO,
280 MORPH_COMPONENT_TYPE_INFO, PLANAR_REFLECTION_COMPONENT_TYPE_INFO, RSDZ_MODEL_ID_COMPONENT_TYPE_INFO,
281 MATERIAL_COMPONENT_TYPE_INFO, NAME_COMPONENT_TYPE_INFO, MESH_COMPONENT_TYPE_INFO, URI_COMPONENT_TYPE_INFO,
282 SKIN_IBM_COMPONENT_TYPE_INFO, ANIMATION_COMPONENT_TYPE_INFO, ANIMATION_INPUT_COMPONENT_TYPE_INFO,
283 ANIMATION_OUTPUT_COMPONENT_TYPE_INFO, ANIMATION_STATE_COMPONENT_TYPE_INFO, ANIMATION_TRACK_COMPONENT_TYPE_INFO,
284 ENVIRONMENT_COMPONENT_TYPE_INFO, FOG_COMPONENT_TYPE_INFO, RENDER_HANDLE_COMPONENT_TYPE_INFO,
285 POST_PROCESS_COMPONENT_TYPE_INFO, POST_PROCESS_CONFIGURATION_COMPONENT_TYPE_INFO, LAYER_COMPONENT_TYPE_INFO,
286 RENDER_MESH_BATCH_COMPONENT_TYPE_INFO, PREV_JOINT_MATRICES_COMPONENT_TYPE_INFO,
287 REFLECTION_PROBE_COMPONENT_TYPE_INFO, DYNAMIC_ENVIRONMENT_BLENDER_COMPONENT_TYPE_INFO,
288 GRAPHICS_STATE_COMPONENT_TYPE_INFO, WATER_RIPPLE_COMPONENT_TYPE_INFO, WEATHER_COMPONENT_TYPE_INFO };
289 } // namespace
290
291 SYSTEM(ANIMATION_SYSTEM_TYPE_INFO, IAnimationSystem, ANIMATION_SYSTEM_RW_DEPS, ANIMATION_SYSTEM_R_DEPS, {},
292 LocalMatrixSystem::UID);
293 SYSTEM(LOCAL_MATRIX_SYSTEM_TYPE_INFO, LocalMatrixSystem, LOCAL_MATRIX_SYSTEM_RW_DEPS, LOCAL_MATRIX_SYSTEM_R_DEPS,
294 IAnimationSystem::UID, INodeSystem::UID);
295 SYSTEM(NODE_SYSTEM_TYPE_INFO, INodeSystem, NODE_SYSTEM_RW_DEPS, NODE_SYSTEM_R_DEPS, LocalMatrixSystem::UID,
296 IRenderPreprocessorSystem::UID);
297 SYSTEM(SKINNING_SYSTEM_TYPE_INFO, ISkinningSystem, SKINNING_SYSTEM_RW_DEPS, SKINNING_SYSTEM_R_DEPS, INodeSystem::UID,
298 IRenderPreprocessorSystem::UID);
299 SYSTEM(RENDER_PREPROCESSOR_SYSTEM_TYPE_INFO, IRenderPreprocessorSystem, RENDER_PREPROCESSOR_SYSTEM_RW_DEPS,
300 RENDER_PREPROCESSOR_SYSTEM_R_DEPS, INodeSystem::UID, {});
301 SYSTEM(MORPHING_SYSTEM_TYPE_INFO, IMorphingSystem, {}, MORPHING_SYSTEM_R_DEPS, INodeSystem::UID, IRenderSystem::UID);
302 SYSTEM(WEATHER_SYSTEM_TYPE_INFO, IWeatherSystem, WEATHER_SYSTEM_RW_DEPS, WEATHER_SYSTEM_R_DEPS, INodeSystem::UID,
303 IRenderSystem::UID);
304 SYSTEM(RENDER_SYSTEM_TYPE_INFO, IRenderSystem, RENDER_SYSTEM_RW_DEPS, RENDER_SYSTEM_R_DEPS,
305 IRenderPreprocessorSystem::UID, {});
306
307 namespace {
308 constexpr SystemTypeInfo CORE_SYSTEM_TYPE_INFOS[] = {
309 LOCAL_MATRIX_SYSTEM_TYPE_INFO,
310 NODE_SYSTEM_TYPE_INFO,
311 RENDER_PREPROCESSOR_SYSTEM_TYPE_INFO,
312 RENDER_SYSTEM_TYPE_INFO,
313 ANIMATION_SYSTEM_TYPE_INFO,
314 SKINNING_SYSTEM_TYPE_INFO,
315 MORPHING_SYSTEM_TYPE_INFO,
316 WEATHER_SYSTEM_TYPE_INFO,
317 };
318
319 template<typename RenderType>
FillRenderDataStoreTypeInfo()320 constexpr auto FillRenderDataStoreTypeInfo()
321 {
322 return RenderDataStoreTypeInfo { { RenderDataStoreTypeInfo::UID }, RenderType::UID, RenderType::TYPE_NAME,
323 RenderType::Create };
324 }
325
326 template<typename RenderType>
FillRenderNodeTypeInfo()327 constexpr auto FillRenderNodeTypeInfo()
328 {
329 return RenderNodeTypeInfo { { RenderNodeTypeInfo::UID }, RenderType::UID, RenderType::TYPE_NAME, RenderType::Create,
330 RenderType::Destroy, IRenderNode::BackendFlagBits::BACKEND_FLAG_BITS_DEFAULT,
331 IRenderNode::ClassType::CLASS_TYPE_NODE, {}, {} };
332 }
333
334 constexpr RenderDataStoreTypeInfo CORE_RENDER_DATA_STORE_INFOS[] = {
335 FillRenderDataStoreTypeInfo<RenderDataStoreDefaultCamera>(),
336 FillRenderDataStoreTypeInfo<RenderDataStoreDefaultLight>(),
337 FillRenderDataStoreTypeInfo<RenderDataStoreDefaultMaterial>(),
338 FillRenderDataStoreTypeInfo<RenderDataStoreDefaultScene>(),
339 FillRenderDataStoreTypeInfo<RenderDataStoreMorph>(),
340 FillRenderDataStoreTypeInfo<RenderDataStoreWeather>(),
341 };
342
343 constexpr RenderNodeTypeInfo CORE_RENDER_NODE_TYPE_INFOS[] = {
344 FillRenderNodeTypeInfo<RenderNodeCreateDefaultCameraGpuImages>(),
345 FillRenderNodeTypeInfo<RenderNodeDefaultCameraController>(),
346 FillRenderNodeTypeInfo<RenderNodeDefaultCameraPostProcessController>(),
347 FillRenderNodeTypeInfo<RenderNodeDefaultCameras>(),
348 FillRenderNodeTypeInfo<RenderNodeDefaultDepthRenderSlot>(),
349 FillRenderNodeTypeInfo<RenderNodeDefaultEnv>(),
350 FillRenderNodeTypeInfo<RenderNodeDefaultLights>(),
351 FillRenderNodeTypeInfo<RenderNodeDefaultMaterialDeferredShading>(),
352 FillRenderNodeTypeInfo<RenderNodeDefaultMaterialObjects>(),
353 FillRenderNodeTypeInfo<RenderNodeDefaultMaterialRenderSlot>(),
354 FillRenderNodeTypeInfo<RenderNodeDefaultShadowRenderSlot>(),
355 FillRenderNodeTypeInfo<RenderNodeDefaultShadowsBlur>(),
356 FillRenderNodeTypeInfo<RenderNodeMorph>(),
357 FillRenderNodeTypeInfo<RenderNodeCameraSinglePostProcess>(),
358 FillRenderNodeTypeInfo<RenderNodeDefaultEnvironmentBlender>(),
359 FillRenderNodeTypeInfo<RenderNodeCameraWeather>(),
360 FillRenderNodeTypeInfo<RenderNodeWeatherSimulation>(),
361 };
362 } // namespace
363
RegisterTypes(IPluginRegister & pluginRegistry)364 void RegisterTypes(IPluginRegister& pluginRegistry)
365 {
366 for (const auto& info : CORE_RENDER_DATA_STORE_INFOS) {
367 pluginRegistry.RegisterTypeInfo(info);
368 }
369 for (const auto& info : CORE_RENDER_NODE_TYPE_INFOS) {
370 pluginRegistry.RegisterTypeInfo(info);
371 }
372 for (const auto& info : CORE_COMPONENT_TYPE_INFOS) {
373 pluginRegistry.RegisterTypeInfo(info);
374 }
375 for (const auto& info : CORE_SYSTEM_TYPE_INFOS) {
376 pluginRegistry.RegisterTypeInfo(info);
377 }
378 }
379
UnregisterTypes(IPluginRegister & pluginRegistry)380 void UnregisterTypes(IPluginRegister& pluginRegistry)
381 {
382 for (const auto& info : CORE_SYSTEM_TYPE_INFOS) {
383 pluginRegistry.UnregisterTypeInfo(info);
384 }
385 for (const auto& info : CORE_COMPONENT_TYPE_INFOS) {
386 pluginRegistry.UnregisterTypeInfo(info);
387 }
388 for (const auto& info : CORE_RENDER_NODE_TYPE_INFOS) {
389 pluginRegistry.UnregisterTypeInfo(info);
390 }
391 for (const auto& info : CORE_RENDER_DATA_STORE_INFOS) {
392 pluginRegistry.UnregisterTypeInfo(info);
393 }
394 }
395 CORE3D_END_NAMESPACE()
396