mirror of
https://github.com/godotengine/godot.git
synced 2025-12-08 06:09:55 +00:00
Make all unsupported renderer message features consistently warnings
Previously, some messages indicating a lack of support were errors instead of warnings. Some messages were also not shown when running a release export template. - Use "renderer" terminology consistently instead of "rendering method".
This commit is contained in:
parent
f5918a9d35
commit
2cf7af9149
12 changed files with 47 additions and 31 deletions
|
|
@ -987,15 +987,23 @@ void RendererViewport::viewport_set_use_xr(RID p_viewport, bool p_use_xr) {
|
|||
void RendererViewport::viewport_set_scaling_3d_mode(RID p_viewport, RS::ViewportScaling3DMode p_mode) {
|
||||
Viewport *viewport = viewport_owner.get_or_null(p_viewport);
|
||||
ERR_FAIL_NULL(viewport);
|
||||
#ifdef DEBUG_ENABLED
|
||||
const String rendering_method = OS::get_singleton()->get_current_rendering_method();
|
||||
if (rendering_method != "forward_plus") {
|
||||
ERR_FAIL_COND_EDMSG(p_mode == RS::VIEWPORT_SCALING_3D_MODE_FSR, "FSR1 is only available when using the Forward+ renderer.");
|
||||
ERR_FAIL_COND_EDMSG(p_mode == RS::VIEWPORT_SCALING_3D_MODE_FSR2, "FSR2 is only available when using the Forward+ renderer.");
|
||||
ERR_FAIL_COND_EDMSG(p_mode == RS::VIEWPORT_SCALING_3D_MODE_METALFX_TEMPORAL, "MetalFX Temporal is only available when using the Forward+ renderer.");
|
||||
if (p_mode == RS::VIEWPORT_SCALING_3D_MODE_FSR) {
|
||||
WARN_PRINT_ONCE_ED("FSR1 3D scaling is only available when using the Forward+ renderer.");
|
||||
}
|
||||
if (p_mode == RS::VIEWPORT_SCALING_3D_MODE_FSR2) {
|
||||
WARN_PRINT_ONCE_ED("FSR2 3D scaling is only available when using the Forward+ renderer.");
|
||||
}
|
||||
if (p_mode == RS::VIEWPORT_SCALING_3D_MODE_METALFX_TEMPORAL) {
|
||||
WARN_PRINT_ONCE_ED("MetalFX Temporal 3D scaling is only available when using the Forward+ renderer.");
|
||||
}
|
||||
}
|
||||
if (rendering_method == "gl_compatibility") {
|
||||
ERR_FAIL_COND_EDMSG(p_mode == RS::VIEWPORT_SCALING_3D_MODE_METALFX_SPATIAL, "MetalFX Spatial is only available when using the Forward+ and Mobile renderers.");
|
||||
if (rendering_method == "gl_compatibility" && p_mode == RS::VIEWPORT_SCALING_3D_MODE_METALFX_SPATIAL) {
|
||||
WARN_PRINT_ONCE_ED("MetalFX Spatial 3D scaling is only available when using the Forward+ or Mobile renderer.");
|
||||
}
|
||||
#endif
|
||||
|
||||
if (viewport->scaling_3d_mode == p_mode) {
|
||||
return;
|
||||
|
|
@ -1387,7 +1395,11 @@ bool RendererViewport::viewport_is_using_hdr_2d(RID p_viewport) const {
|
|||
void RendererViewport::viewport_set_screen_space_aa(RID p_viewport, RS::ViewportScreenSpaceAA p_mode) {
|
||||
Viewport *viewport = viewport_owner.get_or_null(p_viewport);
|
||||
ERR_FAIL_NULL(viewport);
|
||||
ERR_FAIL_COND_EDMSG(p_mode != RS::VIEWPORT_SCREEN_SPACE_AA_DISABLED && OS::get_singleton()->get_current_rendering_method() == "gl_compatibility", "Screen space AA is currently unavailable on the Compatibility renderer.");
|
||||
#ifdef DEBUG_ENABLED
|
||||
if (OS::get_singleton()->get_current_rendering_method() == "gl_compatibility" && p_mode != RS::VIEWPORT_SCREEN_SPACE_AA_DISABLED) {
|
||||
WARN_PRINT_ONCE_ED("Screen-space AA is only available when using the Forward+ or Mobile renderer.");
|
||||
}
|
||||
#endif
|
||||
|
||||
if (viewport->screen_space_aa == p_mode) {
|
||||
return;
|
||||
|
|
@ -1399,7 +1411,11 @@ void RendererViewport::viewport_set_screen_space_aa(RID p_viewport, RS::Viewport
|
|||
void RendererViewport::viewport_set_use_taa(RID p_viewport, bool p_use_taa) {
|
||||
Viewport *viewport = viewport_owner.get_or_null(p_viewport);
|
||||
ERR_FAIL_NULL(viewport);
|
||||
ERR_FAIL_COND_EDMSG(OS::get_singleton()->get_current_rendering_method() != "forward_plus", "TAA is only available when using the Forward+ renderer.");
|
||||
#ifdef DEBUG_ENABLED
|
||||
if (OS::get_singleton()->get_current_rendering_method() != "forward_plus") {
|
||||
WARN_PRINT_ONCE_ED("TAA is only available when using the Forward+ renderer.");
|
||||
}
|
||||
#endif
|
||||
|
||||
if (viewport->use_taa == p_use_taa) {
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ void RendererCameraAttributes::camera_attributes_set_dof_blur(RID p_camera_attri
|
|||
ERR_FAIL_NULL(cam_attributes);
|
||||
#ifdef DEBUG_ENABLED
|
||||
if (OS::get_singleton()->get_current_rendering_method() == "gl_compatibility" && (p_far_enable || p_near_enable)) {
|
||||
WARN_PRINT_ONCE_ED("DoF blur is only available when using the Forward+ or Mobile renderers.");
|
||||
WARN_PRINT_ONCE_ED("Depth of field blur is only available when using the Forward+ or Mobile renderer.");
|
||||
}
|
||||
#endif
|
||||
cam_attributes->dof_blur_far_enabled = p_far_enable;
|
||||
|
|
@ -145,7 +145,7 @@ void RendererCameraAttributes::camera_attributes_set_auto_exposure(RID p_camera_
|
|||
}
|
||||
#ifdef DEBUG_ENABLED
|
||||
if (OS::get_singleton()->get_current_rendering_method() == "gl_compatibility" && p_enable) {
|
||||
WARN_PRINT_ONCE_ED("Auto exposure is only available when using the Forward+ or Mobile renderers.");
|
||||
WARN_PRINT_ONCE_ED("Auto-exposure is only available when using the Forward+ or Mobile renderer.");
|
||||
}
|
||||
#endif
|
||||
cam_attributes->use_auto_exposure = p_enable;
|
||||
|
|
|
|||
|
|
@ -347,7 +347,7 @@ void RendererEnvironmentStorage::environment_set_volumetric_fog(RID p_env, bool
|
|||
ERR_FAIL_NULL(env);
|
||||
#ifdef DEBUG_ENABLED
|
||||
if (OS::get_singleton()->get_current_rendering_method() != "forward_plus" && p_enable) {
|
||||
WARN_PRINT_ONCE_ED("Volumetric fog can only be enabled when using the Forward+ renderer.");
|
||||
WARN_PRINT_ONCE_ED("Volumetric fog is only available when using the Forward+ renderer.");
|
||||
}
|
||||
#endif
|
||||
env->volumetric_fog_enabled = p_enable;
|
||||
|
|
@ -542,7 +542,7 @@ void RendererEnvironmentStorage::environment_set_ssr(RID p_env, bool p_enable, i
|
|||
ERR_FAIL_NULL(env);
|
||||
#ifdef DEBUG_ENABLED
|
||||
if (OS::get_singleton()->get_current_rendering_method() != "forward_plus" && p_enable) {
|
||||
WARN_PRINT_ONCE_ED("Screen-space reflections (SSR) can only be enabled when using the Forward+ renderer.");
|
||||
WARN_PRINT_ONCE_ED("Screen-space reflections (SSR) are only available when using the Forward+ renderer.");
|
||||
}
|
||||
#endif
|
||||
env->ssr_enabled = p_enable;
|
||||
|
|
@ -589,7 +589,7 @@ void RendererEnvironmentStorage::environment_set_ssao(RID p_env, bool p_enable,
|
|||
ERR_FAIL_NULL(env);
|
||||
#ifdef DEBUG_ENABLED
|
||||
if (OS::get_singleton()->get_current_rendering_method() == "mobile" && p_enable) {
|
||||
WARN_PRINT_ONCE_ED("Screen-space ambient occlusion (SSAO) can only be enabled when using the Forward+ or Compatibility renderers.");
|
||||
WARN_PRINT_ONCE_ED("Screen-space ambient occlusion (SSAO) is only available when using the Forward+ or Compatibility renderers.");
|
||||
}
|
||||
#endif
|
||||
env->ssao_enabled = p_enable;
|
||||
|
|
@ -664,7 +664,7 @@ void RendererEnvironmentStorage::environment_set_ssil(RID p_env, bool p_enable,
|
|||
ERR_FAIL_NULL(env);
|
||||
#ifdef DEBUG_ENABLED
|
||||
if (OS::get_singleton()->get_current_rendering_method() != "forward_plus" && p_enable) {
|
||||
WARN_PRINT_ONCE_ED("Screen-space indirect lighting (SSIL) can only be enabled when using the Forward+ renderer.");
|
||||
WARN_PRINT_ONCE_ED("Screen-space indirect lighting (SSIL) is only available when using the Forward+ renderer.");
|
||||
}
|
||||
#endif
|
||||
env->ssil_enabled = p_enable;
|
||||
|
|
@ -711,7 +711,7 @@ void RendererEnvironmentStorage::environment_set_sdfgi(RID p_env, bool p_enable,
|
|||
ERR_FAIL_NULL(env);
|
||||
#ifdef DEBUG_ENABLED
|
||||
if (OS::get_singleton()->get_current_rendering_method() != "forward_plus" && p_enable) {
|
||||
WARN_PRINT_ONCE_ED("SDFGI can only be enabled when using the Forward+ renderer.");
|
||||
WARN_PRINT_ONCE_ED("SDFGI is only available when using the Forward+ renderer.");
|
||||
}
|
||||
#endif
|
||||
env->sdfgi_enabled = p_enable;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue