From 31136b36696d9837e9bc68d1a71c71cc45b03579 Mon Sep 17 00:00:00 2001 From: Relintai Date: Fri, 29 Jul 2022 22:11:41 +0200 Subject: [PATCH] Ported: Document support limitations for OmniLight cubemap shadows in GLES2 - Calinou https://github.com/godotengine/godot/commit/b03ceaba2fd917d3b6f693ec8a3b7625d7a909df --- doc/classes/OmniLight.xml | 4 +++- drivers/gles2/rasterizer_storage_gles2.cpp | 4 ++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/doc/classes/OmniLight.xml b/doc/classes/OmniLight.xml index 6722b7543..658039227 100644 --- a/doc/classes/OmniLight.xml +++ b/doc/classes/OmniLight.xml @@ -23,7 +23,9 @@ See [enum ShadowDetail]. - See [enum ShadowMode]. + The shadow rendering mode to use for this [OmniLight]. See [enum ShadowMode]. + [b]Note:[/b] In GLES2, [constant SHADOW_CUBE] is only supported on GPUs that feature support for depth cubemaps. Old GPUs such as the Radeon HD 4000 series don't support cubemap shadows and will fall back to dual paraboloid shadows as a result. + diff --git a/drivers/gles2/rasterizer_storage_gles2.cpp b/drivers/gles2/rasterizer_storage_gles2.cpp index ef3d9f0e1..ca67648b2 100644 --- a/drivers/gles2/rasterizer_storage_gles2.cpp +++ b/drivers/gles2/rasterizer_storage_gles2.cpp @@ -6032,6 +6032,10 @@ void RasterizerStorageGLES2::initialize() { //picky requirements for these config.support_shadow_cubemaps = config.support_depth_texture && config.support_write_depth && config.support_depth_cubemaps; + if (!config.support_shadow_cubemaps) { + print_verbose("OmniLight cubemap shadows are not supported by this GPU. Falling back to dual paraboloid shadows for all omni lights (faster but less precise)."); + } + frame.count = 0; frame.delta = 0; frame.current_rt = nullptr;