summaryrefslogtreecommitdiffstats
path: root/drivers/gles3/effects/copy_effects.cpp
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2024-01-26 11:44:37 +0100
committerRémi Verschelde <rverschelde@gmail.com>2024-01-26 11:44:37 +0100
commit1ce40ebb44c2e40f2f8e4a9a402fd6cbbad51d4d (patch)
treedd983bdf62fb347cf7e7863c632433c7546977ec /drivers/gles3/effects/copy_effects.cpp
parentc26a338430c7343399158edc6842e4eb4d55a9d3 (diff)
parentefb1cbaad40b910dbb39d35c896bbe27cb782e49 (diff)
downloadredot-engine-1ce40ebb44c2e40f2f8e4a9a402fd6cbbad51d4d.tar.gz
Merge pull request #87386 from clayjohn/GLES3-lightmap-bake
Add GLES3 infrastructure for lightmap baking in the compatibility backend
Diffstat (limited to 'drivers/gles3/effects/copy_effects.cpp')
-rw-r--r--drivers/gles3/effects/copy_effects.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/drivers/gles3/effects/copy_effects.cpp b/drivers/gles3/effects/copy_effects.cpp
index c6fb6ca70b..7b350d8da6 100644
--- a/drivers/gles3/effects/copy_effects.cpp
+++ b/drivers/gles3/effects/copy_effects.cpp
@@ -152,7 +152,17 @@ void CopyEffects::copy_cube_to_rect(const Rect2 &p_rect) {
return;
}
- copy.shader.version_set_uniform(CopyShaderGLES3::COPY_SECTION, p_rect.position.x, p_rect.position.y, p_rect.size.x, p_rect.size.y, copy.shader_version, CopyShaderGLES3::MODE_COPY_SECTION);
+ copy.shader.version_set_uniform(CopyShaderGLES3::COPY_SECTION, p_rect.position.x, p_rect.position.y, p_rect.size.x, p_rect.size.y, copy.shader_version, CopyShaderGLES3::MODE_CUBE_TO_OCTAHEDRAL);
+ draw_screen_quad();
+}
+
+void CopyEffects::copy_cube_to_panorama(float p_mip_level) {
+ bool success = copy.shader.version_bind_shader(copy.shader_version, CopyShaderGLES3::MODE_CUBE_TO_PANORAMA);
+ if (!success) {
+ return;
+ }
+
+ copy.shader.version_set_uniform(CopyShaderGLES3::MIP_LEVEL, p_mip_level, copy.shader_version, CopyShaderGLES3::MODE_CUBE_TO_PANORAMA);
draw_screen_quad();
}