1/**************************************************************************/
2/* register_types.cpp */
3/**************************************************************************/
4/* This file is part of: */
5/* GODOT ENGINE */
6/* https://godotengine.org */
7/**************************************************************************/
8/* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */
9/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */
10/* */
11/* Permission is hereby granted, free of charge, to any person obtaining */
12/* a copy of this software and associated documentation files (the */
13/* "Software"), to deal in the Software without restriction, including */
14/* without limitation the rights to use, copy, modify, merge, publish, */
15/* distribute, sublicense, and/or sell copies of the Software, and to */
16/* permit persons to whom the Software is furnished to do so, subject to */
17/* the following conditions: */
18/* */
19/* The above copyright notice and this permission notice shall be */
20/* included in all copies or substantial portions of the Software. */
21/* */
22/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
23/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
24/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */
25/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
26/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
27/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
28/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
29/**************************************************************************/
30
31#include "register_types.h"
32
33#include "lightmapper_rd.h"
34
35#include "core/config/project_settings.h"
36#include "scene/3d/lightmapper.h"
37
38#ifndef _3D_DISABLED
39static Lightmapper *create_lightmapper_rd() {
40 return memnew(LightmapperRD);
41}
42#endif
43
44void initialize_lightmapper_rd_module(ModuleInitializationLevel p_level) {
45 if (p_level != MODULE_INITIALIZATION_LEVEL_SCENE) {
46 return;
47 }
48
49 GLOBAL_DEF("rendering/lightmapping/bake_quality/low_quality_ray_count", 16);
50 GLOBAL_DEF("rendering/lightmapping/bake_quality/medium_quality_ray_count", 64);
51 GLOBAL_DEF("rendering/lightmapping/bake_quality/high_quality_ray_count", 256);
52 GLOBAL_DEF("rendering/lightmapping/bake_quality/ultra_quality_ray_count", 1024);
53 GLOBAL_DEF("rendering/lightmapping/bake_performance/max_rays_per_pass", 32);
54 GLOBAL_DEF("rendering/lightmapping/bake_performance/region_size", 512);
55
56 GLOBAL_DEF("rendering/lightmapping/bake_quality/low_quality_probe_ray_count", 64);
57 GLOBAL_DEF("rendering/lightmapping/bake_quality/medium_quality_probe_ray_count", 256);
58 GLOBAL_DEF("rendering/lightmapping/bake_quality/high_quality_probe_ray_count", 512);
59 GLOBAL_DEF("rendering/lightmapping/bake_quality/ultra_quality_probe_ray_count", 2048);
60 GLOBAL_DEF("rendering/lightmapping/bake_performance/max_rays_per_probe_pass", 64);
61 GLOBAL_DEF("rendering/lightmapping/primitive_meshes/texel_size", 0.2);
62#ifndef _3D_DISABLED
63 GDREGISTER_CLASS(LightmapperRD);
64 Lightmapper::create_gpu = create_lightmapper_rd;
65#endif
66}
67
68void uninitialize_lightmapper_rd_module(ModuleInitializationLevel p_level) {
69 if (p_level != MODULE_INITIALIZATION_LEVEL_SCENE) {
70 return;
71 }
72}
73