From b03ceaba2fd917d3b6f693ec8a3b7625d7a909df Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Mon, 18 Jul 2022 22:17:19 +0200 Subject: [PATCH] Document support limitations for OmniLight cubemap shadows in GLES2 --- doc/classes/OmniLight.xml | 5 +++-- drivers/gles2/rasterizer_storage_gles2.cpp | 3 +++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/doc/classes/OmniLight.xml b/doc/classes/OmniLight.xml index 6737b4e7057..376d0a09f4b 100644 --- a/doc/classes/OmniLight.xml +++ b/doc/classes/OmniLight.xml @@ -23,7 +23,8 @@ 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. @@ -31,7 +32,7 @@ Shadows are rendered to a dual-paraboloid texture. Faster than [constant SHADOW_CUBE], but lower-quality. - Shadows are rendered to a cubemap. Slower than [constant SHADOW_DUAL_PARABOLOID], but higher-quality. + Shadows are rendered to a cubemap. Slower than [constant SHADOW_DUAL_PARABOLOID], but higher-quality. Only supported on GPUs that feature support for depth cubemaps. Use more detail vertically when computing the shadow. diff --git a/drivers/gles2/rasterizer_storage_gles2.cpp b/drivers/gles2/rasterizer_storage_gles2.cpp index 13777ea38e4..4d7a68c8301 100644 --- a/drivers/gles2/rasterizer_storage_gles2.cpp +++ b/drivers/gles2/rasterizer_storage_gles2.cpp @@ -6393,6 +6393,9 @@ 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;