From a28a4ef98af9f2a8b154ca7754918aebcfd9bb0d Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Sun, 4 Jul 2021 00:23:06 +0200 Subject: [PATCH] Decrease opacity of the overdraw debug draw mode This allows distinguishing higher amounts of overlapping objects. --- drivers/gles2/rasterizer_scene_gles2.cpp | 3 ++- drivers/gles3/rasterizer_scene_gles3.cpp | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/gles2/rasterizer_scene_gles2.cpp b/drivers/gles2/rasterizer_scene_gles2.cpp index 026ff5325b7..09ae5243695 100644 --- a/drivers/gles2/rasterizer_scene_gles2.cpp +++ b/drivers/gles2/rasterizer_scene_gles2.cpp @@ -4129,7 +4129,8 @@ void RasterizerSceneGLES2::initialize() { //default material and shader default_overdraw_shader = storage->shader_create(); - storage->shader_set_code(default_overdraw_shader, "shader_type spatial;\nrender_mode blend_add,unshaded;\n void fragment() { ALBEDO=vec3(0.4,0.8,0.8); ALPHA=0.2; }"); + // Use relatively low opacity so that more "layers" of overlapping objects can be distinguished. + storage->shader_set_code(default_overdraw_shader, "shader_type spatial;\nrender_mode blend_add,unshaded;\n void fragment() { ALBEDO=vec3(0.4,0.8,0.8); ALPHA=0.1; }"); default_overdraw_material = storage->material_create(); storage->material_set_shader(default_overdraw_material, default_overdraw_shader); } diff --git a/drivers/gles3/rasterizer_scene_gles3.cpp b/drivers/gles3/rasterizer_scene_gles3.cpp index d73f04f5eee..e193d6d58d5 100644 --- a/drivers/gles3/rasterizer_scene_gles3.cpp +++ b/drivers/gles3/rasterizer_scene_gles3.cpp @@ -4924,7 +4924,8 @@ void RasterizerSceneGLES3::initialize() { //default material and shader default_overdraw_shader = storage->shader_create(); - storage->shader_set_code(default_overdraw_shader, "shader_type spatial;\nrender_mode blend_add,unshaded;\n void fragment() { ALBEDO=vec3(0.4,0.8,0.8); ALPHA=0.2; }"); + // Use relatively low opacity so that more "layers" of overlapping objects can be distinguished. + storage->shader_set_code(default_overdraw_shader, "shader_type spatial;\nrender_mode blend_add,unshaded;\n void fragment() { ALBEDO=vec3(0.4,0.8,0.8); ALPHA=0.1; }"); default_overdraw_material = storage->material_create(); storage->material_set_shader(default_overdraw_material, default_overdraw_shader); }