diff options
author | clayjohn <claynjohn@gmail.com> | 2024-01-19 12:39:26 -0800 |
---|---|---|
committer | clayjohn <claynjohn@gmail.com> | 2024-01-24 17:13:30 -0800 |
commit | efb1cbaad40b910dbb39d35c896bbe27cb782e49 (patch) | |
tree | e20213da3cb0cd88ef520b24801fc89e7f526bdc /drivers/gles3/effects/copy_effects.cpp | |
parent | 4b6ad349886288405890b07d4a8da425eb3c97ec (diff) | |
download | redot-engine-efb1cbaad40b910dbb39d35c896bbe27cb782e49.tar.gz |
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.cpp | 12 |
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(); } |