summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drivers/gles3/rasterizer_scene_gles3.cpp14
-rw-r--r--main/main.cpp20
-rw-r--r--scene/gui/text_edit.cpp4
3 files changed, 35 insertions, 3 deletions
diff --git a/drivers/gles3/rasterizer_scene_gles3.cpp b/drivers/gles3/rasterizer_scene_gles3.cpp
index 30ca07aa28..048f3c114e 100644
--- a/drivers/gles3/rasterizer_scene_gles3.cpp
+++ b/drivers/gles3/rasterizer_scene_gles3.cpp
@@ -1121,13 +1121,23 @@ bool RasterizerSceneGLES3::_setup_material(RasterizerStorageGLES3::Material *p_m
if (state.current_depth_draw != p_material->shader->spatial.depth_draw_mode) {
switch (p_material->shader->spatial.depth_draw_mode) {
- case RasterizerStorageGLES3::Shader::Spatial::DEPTH_DRAW_ALPHA_PREPASS:
+ case RasterizerStorageGLES3::Shader::Spatial::DEPTH_DRAW_ALPHA_PREPASS: {
+ glDepthMask(GL_TRUE);
+ // If some transparent objects write to depth, we need to re-copy depth texture when we need it
+ if (p_alpha_pass && !state.used_depth_prepass) {
+ state.prepared_depth_texture = false;
+ }
+ } break;
case RasterizerStorageGLES3::Shader::Spatial::DEPTH_DRAW_OPAQUE: {
glDepthMask(!p_alpha_pass);
} break;
case RasterizerStorageGLES3::Shader::Spatial::DEPTH_DRAW_ALWAYS: {
glDepthMask(GL_TRUE);
+ // If some transparent objects write to depth, we need to re-copy depth texture when we need it
+ if (p_alpha_pass) {
+ state.prepared_depth_texture = false;
+ }
} break;
case RasterizerStorageGLES3::Shader::Spatial::DEPTH_DRAW_NEVER: {
glDepthMask(GL_FALSE);
@@ -4616,6 +4626,8 @@ void RasterizerSceneGLES3::render_scene(const Transform &p_cam_transform, const
return;
}
+ if (env && (env->dof_blur_far_enabled || env->dof_blur_near_enabled) && storage->frame.current_rt && storage->frame.current_rt->buffers.active)
+ _prepare_depth_texture();
_post_process(env, p_cam_projection);
// Needed only for debugging
/* if (shadow_atlas && storage->frame.current_rt) {
diff --git a/main/main.cpp b/main/main.cpp
index 027273c4f4..8e279f2f92 100644
--- a/main/main.cpp
+++ b/main/main.cpp
@@ -902,6 +902,14 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
ProjectSettings::get_singleton()->set_custom_property_info("display/window/size/width", PropertyInfo(Variant::INT, "display/window/size/width", PROPERTY_HINT_RANGE, "0,7680,or_greater")); // 8K resolution
GLOBAL_DEF("display/window/size/height", 600);
ProjectSettings::get_singleton()->set_custom_property_info("display/window/size/height", PropertyInfo(Variant::INT, "display/window/size/height", PROPERTY_HINT_RANGE, "0,4320,or_greater")); // 8K resolution
+ GLOBAL_DEF("display/window/size/min_width", 0);
+ ProjectSettings::get_singleton()->set_custom_property_info("display/window/size/min_width", PropertyInfo(Variant::INT, "display/window/size/min_width", PROPERTY_HINT_RANGE, "0,7680,or_greater")); // 8K resolution
+ GLOBAL_DEF("display/window/size/min_height", 0);
+ ProjectSettings::get_singleton()->set_custom_property_info("display/window/size/min_height", PropertyInfo(Variant::INT, "display/window/size/min_height", PROPERTY_HINT_RANGE, "0,4320,or_greater")); // 8K resolution
+ GLOBAL_DEF("display/window/size/max_width", 0);
+ ProjectSettings::get_singleton()->set_custom_property_info("display/window/size/max_width", PropertyInfo(Variant::INT, "display/window/size/max_width", PROPERTY_HINT_RANGE, "0,7680,or_greater")); // 8K resolution
+ GLOBAL_DEF("display/window/size/max_height", 0);
+ ProjectSettings::get_singleton()->set_custom_property_info("display/window/size/max_height", PropertyInfo(Variant::INT, "display/window/size/max_height", PROPERTY_HINT_RANGE, "0,4320,or_greater")); // 8K resolution
GLOBAL_DEF("display/window/size/resizable", true);
GLOBAL_DEF("display/window/size/borderless", false);
GLOBAL_DEF("display/window/size/fullscreen", false);
@@ -927,6 +935,18 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
}
}
+ int mw = GLOBAL_GET("display/window/size/min_width");
+ int mh = GLOBAL_GET("display/window/size/min_height");
+ OS::get_singleton()->set_min_window_size(Size2(mw, mh));
+
+ mw = GLOBAL_GET("display/window/size/max_width");
+ if (mw <= 0)
+ mw = 7680;
+ mh = GLOBAL_GET("display/window/size/max_height");
+ if (mh <= 0)
+ mh = 4320;
+ OS::get_singleton()->set_max_window_size(Size2(mw, mh));
+
video_mode.resizable = GLOBAL_GET("display/window/size/resizable");
video_mode.borderless_window = GLOBAL_GET("display/window/size/borderless");
video_mode.fullscreen = GLOBAL_GET("display/window/size/fullscreen");
diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp
index 6e5f8de3b5..c0eaf21215 100644
--- a/scene/gui/text_edit.cpp
+++ b/scene/gui/text_edit.cpp
@@ -1403,7 +1403,7 @@ void TextEdit::_notification(int p_what) {
}
int line_from = CLAMP(completion_index - lines / 2, 0, completion_options.size() - lines);
VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(Point2(completion_rect.position.x, completion_rect.position.y + (completion_index - line_from) * get_row_height()), Size2(completion_rect.size.width, get_row_height())), cache.completion_selected_color);
- draw_rect(Rect2(completion_rect.position + Vector2(icon_area_size.x + icon_hsep, 0), Size2(nofs, completion_rect.size.height)), cache.completion_existing_color);
+ draw_rect(Rect2(completion_rect.position + Vector2(icon_area_size.x + icon_hsep, 0), Size2(MIN(nofs, completion_rect.size.width - (icon_area_size.x + icon_hsep)), completion_rect.size.height)), cache.completion_existing_color);
for (int i = 0; i < lines; i++) {
@@ -1430,7 +1430,7 @@ void TextEdit::_notification(int p_what) {
}
title_pos.x = icon_area.position.x + icon_area.size.width + icon_hsep;
- draw_string(cache.font, title_pos, completion_options[l].display, text_color, completion_rect.size.width);
+ draw_string(cache.font, title_pos, completion_options[l].display, text_color, completion_rect.size.width - (icon_area_size.x + icon_hsep));
}
if (scrollw) {