Skip to content

Commit

Permalink
Merge pull request #55676 from RandomShaper/fix_layered_lightmap_3.x
Browse files Browse the repository at this point in the history
[3.x] Fix atlassed lightmaps not visible on GL ES 3
  • Loading branch information
akien-mga authored Dec 6, 2021
2 parents 4405daa + c026c86 commit 71d8ccb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/gles3/rasterizer_scene_gles3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1850,10 +1850,11 @@ void RasterizerSceneGLES3::_setup_light(RenderList::Element *e, const Transform
RasterizerStorageGLES3::LightmapCapture *capture = storage->lightmap_capture_data_owner.getornull(e->instance->lightmap_capture->base);

if (lightmap && capture) {
glActiveTexture(GL_TEXTURE0 + storage->config.max_texture_image_units - 10);
if (e->instance->lightmap_slice == -1) {
glActiveTexture(GL_TEXTURE0 + storage->config.max_texture_image_units - 10);
glBindTexture(GL_TEXTURE_2D, lightmap->tex_id);
} else {
glActiveTexture(GL_TEXTURE0 + storage->config.max_texture_image_units - 11);
glBindTexture(GL_TEXTURE_2D_ARRAY, lightmap->tex_id);
state.scene_shader.set_uniform(SceneShaderGLES3::LIGHTMAP_LAYER, e->instance->lightmap_slice);
}
Expand Down

0 comments on commit 71d8ccb

Please sign in to comment.