Skip to content

Commit 9f8a331

Browse files
committed
LightmapGI: Save directional lightmaps as ldr textures
1 parent 235a32a commit 9f8a331

File tree

24 files changed

+601
-145
lines changed

24 files changed

+601
-145
lines changed

doc/classes/LightmapGIData.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@
5454
</method>
5555
</methods>
5656
<members>
57+
<member name="directional_textures" type="TextureLayered[]" setter="set_directional_textures" getter="get_directional_textures" default="[]">
58+
The directional atlas textures generated by the lightmapper.
59+
</member>
5760
<member name="light_texture" type="TextureLayered" setter="set_light_texture" getter="get_light_texture" deprecated="The lightmap atlas can now contain multiple textures. See [member lightmap_textures].">
5861
The lightmap atlas texture generated by the lightmapper.
5962
</member>

drivers/gles3/rasterizer_scene_gles3.cpp

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2758,14 +2758,14 @@ void RasterizerSceneGLES3::render_scene(const Ref<RenderSceneBuffers> &p_render_
27582758
glBlitFramebuffer(0, 0, size.x, size.y,
27592759
0, 0, size.x, size.y,
27602760
GL_COLOR_BUFFER_BIT, GL_NEAREST);
2761-
glActiveTexture(GL_TEXTURE0 + config->max_texture_image_units - 6);
2761+
glActiveTexture(GL_TEXTURE0 + config->max_texture_image_units - 7);
27622762
glBindTexture(GL_TEXTURE_2D, backbuffer);
27632763
}
27642764
if (scene_state.used_depth_texture) {
27652765
glBlitFramebuffer(0, 0, size.x, size.y,
27662766
0, 0, size.x, size.y,
27672767
GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT, GL_NEAREST);
2768-
glActiveTexture(GL_TEXTURE0 + config->max_texture_image_units - 7);
2768+
glActiveTexture(GL_TEXTURE0 + config->max_texture_image_units - 8);
27692769
glBindTexture(GL_TEXTURE_2D, backbuffer_depth);
27702770
}
27712771
}
@@ -3562,6 +3562,7 @@ void RasterizerSceneGLES3::_render_list_template(RenderListParameters *p_params,
35623562
material_storage->shaders.scene_shader.version_set_uniform(SceneShaderGLES3::LIGHTMAP_TEXTURE_SIZE, light_texture_size, shader->version, instance_variant, spec_constants);
35633563
}
35643564

3565+
// Shadowmasks
35653566
material_storage->shaders.scene_shader.version_set_uniform(SceneShaderGLES3::LIGHTMAP_SHADOWMASK_MODE, (uint32_t)lm->shadowmask_mode, shader->version, instance_variant, spec_constants);
35663567

35673568
if (lm->shadow_texture.is_valid()) {
@@ -3594,6 +3595,7 @@ void RasterizerSceneGLES3::_render_list_template(RenderListParameters *p_params,
35943595
GLES3::LightmapInstance *li = GLES3::LightStorage::get_singleton()->get_lightmap_instance(inst->lightmap_instance);
35953596
GLES3::Lightmap *lm = GLES3::LightStorage::get_singleton()->get_lightmap(li->lightmap);
35963597

3598+
// Base lightmap
35973599
GLuint tex = GLES3::TextureStorage::get_singleton()->texture_get_texid(lm->light_texture);
35983600
glActiveTexture(GL_TEXTURE0 + config->max_texture_image_units - 4);
35993601
glBindTexture(GL_TEXTURE_2D_ARRAY, tex);
@@ -3616,6 +3618,16 @@ void RasterizerSceneGLES3::_render_list_template(RenderListParameters *p_params,
36163618
material_storage->shaders.scene_shader.version_set_uniform(SceneShaderGLES3::LIGHTMAP_EXPOSURE_NORMALIZATION, exposure_normalization, shader->version, instance_variant, spec_constants);
36173619

36183620
if (lm->uses_spherical_harmonics) {
3621+
// Directional
3622+
if (lm->directional_texture.is_valid()) {
3623+
tex = GLES3::TextureStorage::get_singleton()->texture_get_texid(lm->directional_texture);
3624+
} else {
3625+
tex = GLES3::TextureStorage::get_singleton()->texture_get_texid(GLES3::TextureStorage::get_singleton()->texture_gl_get_default(GLES3::DEFAULT_GL_TEXTURE_2D_ARRAY_WHITE));
3626+
}
3627+
3628+
glActiveTexture(GL_TEXTURE0 + config->max_texture_image_units - 6);
3629+
glBindTexture(GL_TEXTURE_2D_ARRAY, tex);
3630+
36193631
Basis to_lm = li->transform.basis.inverse() * p_render_data->cam_transform.basis;
36203632
to_lm = to_lm.inverse().transposed();
36213633
GLfloat matrix[9] = {
@@ -3664,7 +3676,7 @@ void RasterizerSceneGLES3::_render_list_template(RenderListParameters *p_params,
36643676
material_storage->shaders.scene_shader.version_set_uniform(SceneShaderGLES3::REFPROBE1_LOCAL_MATRIX, inst->reflection_probes_local_transform_cache[0], shader->version, instance_variant, spec_constants);
36653677
material_storage->shaders.scene_shader.version_set_uniform(SceneShaderGLES3::REFPROBE1_BLEND_DISTANCE, probe->blend_distance, shader->version, instance_variant, spec_constants);
36663678

3667-
glActiveTexture(GL_TEXTURE0 + config->max_texture_image_units - 8);
3679+
glActiveTexture(GL_TEXTURE0 + config->max_texture_image_units - 9);
36683680
glBindTexture(GL_TEXTURE_CUBE_MAP, light_storage->reflection_probe_instance_get_texture(inst->reflection_probe_rid_cache[0]));
36693681
}
36703682

@@ -3683,7 +3695,7 @@ void RasterizerSceneGLES3::_render_list_template(RenderListParameters *p_params,
36833695
material_storage->shaders.scene_shader.version_set_uniform(SceneShaderGLES3::REFPROBE2_LOCAL_MATRIX, inst->reflection_probes_local_transform_cache[1], shader->version, instance_variant, spec_constants);
36843696
material_storage->shaders.scene_shader.version_set_uniform(SceneShaderGLES3::REFPROBE2_BLEND_DISTANCE, probe->blend_distance, shader->version, instance_variant, spec_constants);
36853697

3686-
glActiveTexture(GL_TEXTURE0 + config->max_texture_image_units - 9);
3698+
glActiveTexture(GL_TEXTURE0 + config->max_texture_image_units - 10);
36873699
glBindTexture(GL_TEXTURE_CUBE_MAP, light_storage->reflection_probe_instance_get_texture(inst->reflection_probe_rid_cache[1]));
36883700

36893701
spec_constants |= SceneShaderGLES3::SECOND_REFLECTION_PROBE;

drivers/gles3/shaders/scene.glsl

Lines changed: 21 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -994,10 +994,11 @@ void main() {
994994
3-shadow
995995
4-lightmap textures
996996
5-shadowmask textures
997-
6-screen
998-
7-depth
999-
8-reflection probe 1
1000-
9-reflection probe 2
997+
6-directional textures
998+
7-screen
999+
8-depth
1000+
9-reflection probe 1
1001+
10-reflection probe 2
10011002
10021003
*/
10031004

@@ -1085,7 +1086,7 @@ uniform float refprobe1_blend_distance;
10851086
uniform int refprobe1_ambient_mode;
10861087
uniform vec4 refprobe1_ambient_color;
10871088

1088-
uniform samplerCube refprobe1_texture; // texunit:-8
1089+
uniform samplerCube refprobe1_texture; // texunit:-9
10891090

10901091
#ifdef SECOND_REFLECTION_PROBE
10911092

@@ -1099,7 +1100,7 @@ uniform float refprobe2_blend_distance;
10991100
uniform int refprobe2_ambient_mode;
11001101
uniform vec4 refprobe2_ambient_color;
11011102

1102-
uniform samplerCube refprobe2_texture; // texunit:-9
1103+
uniform samplerCube refprobe2_texture; // texunit:-10
11031104

11041105
#endif // SECOND_REFLECTION_PROBE
11051106

@@ -1379,6 +1380,7 @@ float sample_shadow(highp sampler2DShadow shadow, float shadow_pixel_size, vec4
13791380
#ifdef USE_LIGHTMAP
13801381
uniform mediump sampler2DArray lightmap_textures; //texunit:-4
13811382
uniform lowp sampler2DArray shadowmask_textures; //texunit:-5
1383+
uniform mediump sampler2DArray directional_textures; //texunit:-6
13821384
uniform lowp uint lightmap_slice;
13831385
uniform highp vec4 lightmap_uv_scale;
13841386
uniform float lightmap_exposure_normalization;
@@ -1404,17 +1406,17 @@ uniform mediump vec4[9] lightmap_captures;
14041406
#endif // !DISABLE_LIGHTMAP
14051407

14061408
#ifdef USE_MULTIVIEW
1407-
uniform highp sampler2DArray depth_buffer; // texunit:-7
1408-
uniform highp sampler2DArray color_buffer; // texunit:-6
1409+
uniform highp sampler2DArray depth_buffer; // texunit:-8
1410+
uniform highp sampler2DArray color_buffer; // texunit:-7
14091411
vec3 multiview_uv(vec2 uv) {
14101412
return vec3(uv, ViewIndex);
14111413
}
14121414
ivec3 multiview_uv(ivec2 uv) {
14131415
return ivec3(uv, int(ViewIndex));
14141416
}
14151417
#else
1416-
uniform highp sampler2D depth_buffer; // texunit:-7
1417-
uniform highp sampler2D color_buffer; // texunit:-6
1418+
uniform highp sampler2D depth_buffer; // texunit:-8
1419+
uniform highp sampler2D color_buffer; // texunit:-7
14181420
vec2 multiview_uv(vec2 uv) {
14191421
return uv;
14201422
}
@@ -2296,23 +2298,19 @@ void main() {
22962298
#else
22972299
#ifdef USE_LIGHTMAP
22982300
{
2299-
vec3 uvw;
2300-
uvw.xy = uv2 * lightmap_uv_scale.zw + lightmap_uv_scale.xy;
2301-
uvw.z = float(lightmap_slice);
2301+
vec3 uvw = vec3(uv2 * lightmap_uv_scale.zw + lightmap_uv_scale.xy, float(lightmap_slice));
23022302

23032303
#ifdef USE_SH_LIGHTMAP
2304-
uvw.z *= 4.0; // SH textures use 4 times more data.
2305-
23062304
#ifdef LIGHTMAP_BICUBIC_FILTER
2307-
vec3 lm_light_l0 = textureArray_bicubic(lightmap_textures, uvw + vec3(0.0, 0.0, 0.0), lightmap_texture_size).rgb;
2308-
vec3 lm_light_l1n1 = (textureArray_bicubic(lightmap_textures, uvw + vec3(0.0, 0.0, 1.0), lightmap_texture_size).rgb - vec3(0.5)) * 2.0;
2309-
vec3 lm_light_l1_0 = (textureArray_bicubic(lightmap_textures, uvw + vec3(0.0, 0.0, 2.0), lightmap_texture_size).rgb - vec3(0.5)) * 2.0;
2310-
vec3 lm_light_l1p1 = (textureArray_bicubic(lightmap_textures, uvw + vec3(0.0, 0.0, 3.0), lightmap_texture_size).rgb - vec3(0.5)) * 2.0;
2305+
vec3 lm_light_l0 = textureArray_bicubic(lightmap_textures, uvw, lightmap_texture_size).rgb;
2306+
vec3 lm_light_l1n1 = (textureArray_bicubic(directional_textures, vec3(uvw.xy, uvw.z * 3 + 0.0), lightmap_texture_size).rgb - vec3(0.5)) * 2.0;
2307+
vec3 lm_light_l1_0 = (textureArray_bicubic(directional_textures, vec3(uvw.xy, uvw.z * 3 + 1.0), lightmap_texture_size).rgb - vec3(0.5)) * 2.0;
2308+
vec3 lm_light_l1p1 = (textureArray_bicubic(directional_textures, vec3(uvw.xy, uvw.z * 3 + 2.0), lightmap_texture_size).rgb - vec3(0.5)) * 2.0;
23112309
#else
2312-
vec3 lm_light_l0 = textureLod(lightmap_textures, uvw + vec3(0.0, 0.0, 0.0), 0.0).rgb;
2313-
vec3 lm_light_l1n1 = (textureLod(lightmap_textures, uvw + vec3(0.0, 0.0, 1.0), 0.0).rgb - vec3(0.5)) * 2.0;
2314-
vec3 lm_light_l1_0 = (textureLod(lightmap_textures, uvw + vec3(0.0, 0.0, 2.0), 0.0).rgb - vec3(0.5)) * 2.0;
2315-
vec3 lm_light_l1p1 = (textureLod(lightmap_textures, uvw + vec3(0.0, 0.0, 3.0), 0.0).rgb - vec3(0.5)) * 2.0;
2310+
vec3 lm_light_l0 = textureLod(lightmap_textures, uvw, 0.0).rgb;
2311+
vec3 lm_light_l1n1 = (textureLod(directional_textures, vec3(uvw.xy, uvw.z * 3 + 0.0), 0.0).rgb - vec3(0.5)) * 2.0;
2312+
vec3 lm_light_l1_0 = (textureLod(directional_textures, vec3(uvw.xy, uvw.z * 3 + 1.0), 0.0).rgb - vec3(0.5)) * 2.0;
2313+
vec3 lm_light_l1p1 = (textureLod(directional_textures, vec3(uvw.xy, uvw.z * 3 + 2.0), 0.0).rgb - vec3(0.5)) * 2.0;
23162314
#endif
23172315

23182316
vec3 n = normalize(lightmap_normal_xform * normal);

drivers/gles3/storage/light_storage.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1247,6 +1247,20 @@ void LightStorage::lightmap_set_shadowmask_mode(RID p_lightmap, RS::ShadowmaskMo
12471247
lightmap->shadowmask_mode = p_mode;
12481248
}
12491249

1250+
void LightStorage::lightmap_set_directional_textures(RID p_lightmap, RID p_directional) {
1251+
Lightmap *lightmap = lightmap_owner.get_or_null(p_lightmap);
1252+
ERR_FAIL_NULL(lightmap);
1253+
lightmap->directional_texture = p_directional;
1254+
1255+
GLuint tex = GLES3::TextureStorage::get_singleton()->texture_get_texid(lightmap->directional_texture);
1256+
glBindTexture(GL_TEXTURE_2D_ARRAY, tex);
1257+
glTexParameteri(GL_TEXTURE_2D_ARRAY, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
1258+
glTexParameteri(GL_TEXTURE_2D_ARRAY, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
1259+
glTexParameteri(GL_TEXTURE_2D_ARRAY, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
1260+
glTexParameteri(GL_TEXTURE_2D_ARRAY, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
1261+
glBindTexture(GL_TEXTURE_2D_ARRAY, 0);
1262+
}
1263+
12501264
/* LIGHTMAP INSTANCE */
12511265

12521266
RID LightStorage::lightmap_instance_create(RID p_lightmap) {

drivers/gles3/storage/light_storage.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@ struct ReflectionProbeInstance {
175175
struct Lightmap {
176176
RID light_texture;
177177
RID shadow_texture;
178+
RID directional_texture;
178179
bool uses_spherical_harmonics = false;
179180
bool interior = false;
180181
AABB bounds = AABB(Vector3(), Vector3(1, 1, 1));
@@ -739,6 +740,8 @@ class LightStorage : public RendererLightStorage {
739740
virtual RS::ShadowmaskMode lightmap_get_shadowmask_mode(RID p_lightmap) override;
740741
virtual void lightmap_set_shadowmask_mode(RID p_lightmap, RS::ShadowmaskMode p_mode) override;
741742

743+
virtual void lightmap_set_directional_textures(RID p_lightmap, RID p_directional) override;
744+
742745
/* LIGHTMAP INSTANCE */
743746

744747
LightmapInstance *get_lightmap_instance(RID p_rid) { return lightmap_instance_owner.get_or_null(p_rid); }

editor/scene/3d/lightmap_gi_editor_plugin.cpp

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,21 @@ void LightmapGIEditorPlugin::_bake() {
129129
_bake_select_file("");
130130
}
131131

132+
void LightmapGIEditorPlugin::_upgrade() {
133+
if (lightmap) {
134+
Ref<LightmapGIData> gi_data = lightmap->get_light_data();
135+
if (gi_data.is_valid() && gi_data->is_using_spherical_harmonics() && gi_data->_get_directional_version() < LightmapGIData::DIRECTIONAL_VERSION) {
136+
gi_data->_upgrade_directional_version();
137+
ResourceSaver::save(gi_data);
138+
139+
lightmap->set_light_data(gi_data);
140+
lightmap->update_configuration_warnings();
141+
142+
upgrade->hide();
143+
}
144+
}
145+
}
146+
132147
void LightmapGIEditorPlugin::edit(Object *p_object) {
133148
LightmapGI *s = Object::cast_to<LightmapGI>(p_object);
134149
if (!s) {
@@ -145,8 +160,16 @@ bool LightmapGIEditorPlugin::handles(Object *p_object) const {
145160
void LightmapGIEditorPlugin::make_visible(bool p_visible) {
146161
if (p_visible) {
147162
bake->show();
163+
164+
if (lightmap) {
165+
Ref<LightmapGIData> gi_data = lightmap->get_light_data();
166+
if (gi_data.is_valid() && gi_data->is_using_spherical_harmonics() && gi_data->_get_directional_version() < LightmapGIData::DIRECTIONAL_VERSION) {
167+
upgrade->show();
168+
}
169+
}
148170
} else {
149171
bake->hide();
172+
upgrade->hide();
150173
}
151174
}
152175

@@ -176,6 +199,7 @@ void LightmapGIEditorPlugin::bake_func_end(uint64_t p_time_started) {
176199

177200
void LightmapGIEditorPlugin::_bind_methods() {
178201
ClassDB::bind_method("_bake", &LightmapGIEditorPlugin::_bake);
202+
ClassDB::bind_method("_upgrade", &LightmapGIEditorPlugin::_upgrade);
179203
}
180204

181205
LightmapGIEditorPlugin::LightmapGIEditorPlugin() {
@@ -186,6 +210,10 @@ LightmapGIEditorPlugin::LightmapGIEditorPlugin() {
186210
bake->set_button_icon(EditorNode::get_singleton()->get_editor_theme()->get_icon(SNAME("Bake"), EditorStringName(EditorIcons)));
187211
bake->set_text(TTR("Bake Lightmaps"));
188212

213+
upgrade = memnew(Button);
214+
upgrade->set_theme_type_variation(SceneStringName(FlatButton));
215+
upgrade->set_text(TTR("Upgrade Lightmaps"));
216+
189217
#ifdef MODULE_LIGHTMAPPER_RD_ENABLED
190218
// Disable lightmap baking if not supported on the current GPU.
191219
if (!DisplayServer::get_singleton()->can_create_rendering_device()) {
@@ -205,6 +233,11 @@ LightmapGIEditorPlugin::LightmapGIEditorPlugin() {
205233
bake->hide();
206234
bake->connect(SceneStringName(pressed), Callable(this, "_bake"));
207235
add_control_to_container(CONTAINER_SPATIAL_EDITOR_MENU, bake);
236+
237+
upgrade->hide();
238+
upgrade->connect(SceneStringName(pressed), Callable(this, "_upgrade"));
239+
add_control_to_container(CONTAINER_SPATIAL_EDITOR_MENU, upgrade);
240+
208241
lightmap = nullptr;
209242

210243
file_dialog = memnew(EditorFileDialog);

editor/scene/3d/lightmap_gi_editor_plugin.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ class LightmapGIEditorPlugin : public EditorPlugin {
4343
LightmapGI *lightmap = nullptr;
4444

4545
Button *bake = nullptr;
46+
Button *upgrade = nullptr;
4647

4748
EditorFileDialog *file_dialog = nullptr;
4849
static EditorProgress *tmp_progress;
@@ -51,6 +52,7 @@ class LightmapGIEditorPlugin : public EditorPlugin {
5152

5253
void _bake_select_file(const String &p_file);
5354
void _bake();
55+
void _upgrade();
5456

5557
protected:
5658
static void _bind_methods();

modules/lightmapper_rd/lightmapper_rd.cpp

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1081,6 +1081,7 @@ LightmapperRD::BakeError LightmapperRD::bake(BakeQuality p_quality, bool p_use_d
10811081
}
10821082
lightmap_textures.clear();
10831083
shadowmask_textures.clear();
1084+
directional_textures.clear();
10841085
int grid_size = 128;
10851086

10861087
/* STEP 1: Fetch material textures and compute the bounds */
@@ -2312,14 +2313,16 @@ LightmapperRD::BakeError LightmapperRD::bake(BakeQuality p_quality, bool p_use_d
23122313
p_step_function(0.9, RTR("Retrieving textures"), p_bake_userdata, true);
23132314
}
23142315

2315-
for (int i = 0; i < atlas_slices * (p_bake_sh ? 4 : 1); i++) {
2316-
Vector<uint8_t> s = rd->texture_get_data(light_accum_tex, i);
2316+
// Retrieve lightmaps.
2317+
for (int i = 0; i < atlas_slices; i++) {
2318+
Vector<uint8_t> s = rd->texture_get_data(light_accum_tex, p_bake_sh ? i * 4 : i);
23172319
Ref<Image> img = Image::create_from_data(atlas_size.width, atlas_size.height, false, Image::FORMAT_RGBAH, s);
2318-
img->convert(Image::FORMAT_RGBH); //remove alpha
2320+
img->convert(Image::FORMAT_RGBH); // Remove alpha.
23192321
lightmap_textures.push_back(img);
23202322
}
23212323

23222324
if (p_bake_shadowmask) {
2325+
// Retrieve shadowmasks.
23232326
for (int i = 0; i < atlas_slices; i++) {
23242327
Vector<uint8_t> s = rd->texture_get_data(shadowmask_tex, i);
23252328
Ref<Image> img = Image::create_from_data(atlas_size.width, atlas_size.height, false, Image::FORMAT_RGBA8, s);
@@ -2328,6 +2331,18 @@ LightmapperRD::BakeError LightmapperRD::bake(BakeQuality p_quality, bool p_use_d
23282331
}
23292332
}
23302333

2334+
if (p_bake_sh) {
2335+
// Retrieve directional.
2336+
for (int i = 0; i < atlas_slices; i++) {
2337+
for (int j = 1; j < 4; j++) {
2338+
Vector<uint8_t> s = rd->texture_get_data(light_accum_tex, i * 4 + j);
2339+
Ref<Image> img = Image::create_from_data(atlas_size.width, atlas_size.height, false, Image::FORMAT_RGBAH, s);
2340+
img->convert(Image::FORMAT_RGB8);
2341+
directional_textures.push_back(img);
2342+
}
2343+
}
2344+
}
2345+
23312346
if (probe_positions.size() > 0) {
23322347
probe_values.resize(probe_positions.size() * 9);
23332348
Vector<uint8_t> probe_data = rd->buffer_get_data(light_probe_buffer);
@@ -2375,6 +2390,15 @@ Ref<Image> LightmapperRD::get_shadowmask_texture(int p_index) const {
23752390
return shadowmask_textures[p_index];
23762391
}
23772392

2393+
int LightmapperRD::get_directional_texture_count() const {
2394+
return directional_textures.size();
2395+
}
2396+
2397+
Ref<Image> LightmapperRD::get_directional_texture(int p_index) const {
2398+
ERR_FAIL_INDEX_V(p_index, directional_textures.size(), Ref<Image>());
2399+
return directional_textures[p_index];
2400+
}
2401+
23782402
int LightmapperRD::get_bake_mesh_count() const {
23792403
return mesh_instances.size();
23802404
}

modules/lightmapper_rd/lightmapper_rd.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,7 @@ class LightmapperRD : public Lightmapper {
266266

267267
Vector<Ref<Image>> lightmap_textures;
268268
Vector<Ref<Image>> shadowmask_textures;
269+
Vector<Ref<Image>> directional_textures;
269270
Vector<Color> probe_values;
270271

271272
struct DilateParams {
@@ -309,6 +310,9 @@ class LightmapperRD : public Lightmapper {
309310
Ref<Image> get_bake_texture(int p_index) const override;
310311
int get_shadowmask_texture_count() const override;
311312
Ref<Image> get_shadowmask_texture(int p_index) const override;
313+
int get_directional_texture_count() const override;
314+
Ref<Image> get_directional_texture(int p_index) const override;
315+
312316
int get_bake_mesh_count() const override;
313317
Variant get_bake_mesh_userdata(int p_index) const override;
314318
Rect2 get_bake_mesh_uv_scale(int p_index) const override;

0 commit comments

Comments
 (0)