diff options
author | Juan Linietsky <reduzio@gmail.com> | 2019-08-18 19:40:52 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2020-02-11 11:59:25 +0100 |
commit | 449df8f688080c02bfbbfafc45421875b77deb1b (patch) | |
tree | ac9818b892c5d85fdcf4e4e89e383bc4dc46b7f8 /scene/main | |
parent | 7fa978517077333fba215e17181e1600d485fa43 (diff) |
Base 3D engine done, still untested, though.
Diffstat (limited to 'scene/main')
-rw-r--r-- | scene/main/scene_tree.cpp | 6 | ||||
-rw-r--r-- | scene/main/viewport.cpp | 86 | ||||
-rw-r--r-- | scene/main/viewport.h | 30 |
3 files changed, 0 insertions, 122 deletions
diff --git a/scene/main/scene_tree.cpp b/scene/main/scene_tree.cpp index 15d21859ea..67a39a6b22 100644 --- a/scene/main/scene_tree.cpp +++ b/scene/main/scene_tree.cpp @@ -2081,12 +2081,6 @@ SceneTree::SceneTree() { ProjectSettings::get_singleton()->set_custom_property_info("rendering/quality/filters/msaa", PropertyInfo(Variant::INT, "rendering/quality/filters/msaa", PROPERTY_HINT_ENUM, "Disabled,2x,4x,8x,16x,AndroidVR 2x,AndroidVR 4x")); root->set_msaa(Viewport::MSAA(msaa_mode)); - GLOBAL_DEF("rendering/quality/depth/hdr", true); - GLOBAL_DEF("rendering/quality/depth/hdr.mobile", false); - - bool hdr = GLOBAL_GET("rendering/quality/depth/hdr"); - root->set_hdr(hdr); - VS::get_singleton()->scenario_set_reflection_atlas_size(root->get_world()->get_scenario(), ref_atlas_size, ref_atlas_subdiv); { //load default fallback environment diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp index e4343d3982..976c66ad0c 100644 --- a/scene/main/viewport.cpp +++ b/scene/main/viewport.cpp @@ -1330,17 +1330,6 @@ Ref<ViewportTexture> Viewport::get_texture() const { return default_texture; } -void Viewport::set_vflip(bool p_enable) { - - vflip = p_enable; - VisualServer::get_singleton()->viewport_set_vflip(viewport, p_enable); -} - -bool Viewport::get_vflip() const { - - return vflip; -} - void Viewport::set_clear_mode(ClearMode p_mode) { clear_mode = p_mode; @@ -2948,26 +2937,6 @@ bool Viewport::is_input_disabled() const { return disable_input; } -void Viewport::set_disable_3d(bool p_disable) { - disable_3d = p_disable; - VS::get_singleton()->viewport_set_disable_3d(viewport, p_disable); -} - -bool Viewport::is_3d_disabled() const { - - return disable_3d; -} - -void Viewport::set_keep_3d_linear(bool p_keep_3d_linear) { - keep_3d_linear = p_keep_3d_linear; - VS::get_singleton()->viewport_set_keep_3d_linear(viewport, keep_3d_linear); -} - -bool Viewport::get_keep_3d_linear() const { - - return keep_3d_linear; -} - Variant Viewport::gui_get_drag_data() const { return gui.drag_data; } @@ -3008,30 +2977,6 @@ Viewport::MSAA Viewport::get_msaa() const { return msaa; } -void Viewport::set_hdr(bool p_hdr) { - - if (hdr == p_hdr) - return; - - hdr = p_hdr; - VS::get_singleton()->viewport_set_hdr(viewport, p_hdr); -} - -bool Viewport::get_hdr() const { - - return hdr; -} - -void Viewport::set_usage(Usage p_usage) { - - usage = p_usage; - VS::get_singleton()->viewport_set_usage(viewport, VS::ViewportUsage(p_usage)); -} - -Viewport::Usage Viewport::get_usage() const { - return usage; -} - void Viewport::set_debug_draw(DebugDraw p_debug_draw) { debug_draw = p_debug_draw; @@ -3090,10 +3035,6 @@ bool Viewport::is_handling_input_locally() const { } void Viewport::_validate_property(PropertyInfo &property) const { - - if (VisualServer::get_singleton()->is_low_end() && property.name == "hdr") { - property.usage = PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_INTERNAL; - } } void Viewport::set_default_canvas_item_texture_filter(DefaultCanvasItemTextureFilter p_filter) { @@ -3176,9 +3117,6 @@ void Viewport::_bind_methods() { ClassDB::bind_method(D_METHOD("set_size_override_stretch", "enabled"), &Viewport::set_size_override_stretch); ClassDB::bind_method(D_METHOD("is_size_override_stretch_enabled"), &Viewport::is_size_override_stretch_enabled); - ClassDB::bind_method(D_METHOD("set_vflip", "enable"), &Viewport::set_vflip); - ClassDB::bind_method(D_METHOD("get_vflip"), &Viewport::get_vflip); - ClassDB::bind_method(D_METHOD("set_clear_mode", "mode"), &Viewport::set_clear_mode); ClassDB::bind_method(D_METHOD("get_clear_mode"), &Viewport::get_clear_mode); @@ -3188,12 +3126,6 @@ void Viewport::_bind_methods() { ClassDB::bind_method(D_METHOD("set_msaa", "msaa"), &Viewport::set_msaa); ClassDB::bind_method(D_METHOD("get_msaa"), &Viewport::get_msaa); - ClassDB::bind_method(D_METHOD("set_hdr", "enable"), &Viewport::set_hdr); - ClassDB::bind_method(D_METHOD("get_hdr"), &Viewport::get_hdr); - - ClassDB::bind_method(D_METHOD("set_usage", "usage"), &Viewport::set_usage); - ClassDB::bind_method(D_METHOD("get_usage"), &Viewport::get_usage); - ClassDB::bind_method(D_METHOD("set_debug_draw", "debug_draw"), &Viewport::set_debug_draw); ClassDB::bind_method(D_METHOD("get_debug_draw"), &Viewport::get_debug_draw); @@ -3236,12 +3168,6 @@ void Viewport::_bind_methods() { ClassDB::bind_method(D_METHOD("set_disable_input", "disable"), &Viewport::set_disable_input); ClassDB::bind_method(D_METHOD("is_input_disabled"), &Viewport::is_input_disabled); - ClassDB::bind_method(D_METHOD("set_disable_3d", "disable"), &Viewport::set_disable_3d); - ClassDB::bind_method(D_METHOD("is_3d_disabled"), &Viewport::is_3d_disabled); - - ClassDB::bind_method(D_METHOD("set_keep_3d_linear", "keep_3d_linear"), &Viewport::set_keep_3d_linear); - ClassDB::bind_method(D_METHOD("get_keep_3d_linear"), &Viewport::get_keep_3d_linear); - ClassDB::bind_method(D_METHOD("_gui_show_tooltip"), &Viewport::_gui_show_tooltip); ClassDB::bind_method(D_METHOD("_gui_remove_focus"), &Viewport::_gui_remove_focus); ClassDB::bind_method(D_METHOD("_post_gui_grab_click_focus"), &Viewport::_post_gui_grab_click_focus); @@ -3289,7 +3215,6 @@ void Viewport::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::BOOL, "render_direct_to_screen"), "set_use_render_direct_to_screen", "is_using_render_direct_to_screen"); ADD_PROPERTY(PropertyInfo(Variant::INT, "debug_draw", PROPERTY_HINT_ENUM, "Disabled,Unshaded,Overdraw,Wireframe"), "set_debug_draw", "get_debug_draw"); ADD_GROUP("Render Target", "render_target_"); - ADD_PROPERTY(PropertyInfo(Variant::BOOL, "render_target_v_flip"), "set_vflip", "get_vflip"); ADD_PROPERTY(PropertyInfo(Variant::INT, "render_target_clear_mode", PROPERTY_HINT_ENUM, "Always,Never,Next Frame"), "set_clear_mode", "get_clear_mode"); ADD_PROPERTY(PropertyInfo(Variant::INT, "render_target_update_mode", PROPERTY_HINT_ENUM, "Disabled,Once,When Visible,Always"), "set_update_mode", "get_update_mode"); ADD_GROUP("Canvas Items", "canvas_item_"); @@ -3348,11 +3273,6 @@ void Viewport::_bind_methods() { BIND_ENUM_CONSTANT(MSAA_8X); BIND_ENUM_CONSTANT(MSAA_16X); - BIND_ENUM_CONSTANT(USAGE_2D); - BIND_ENUM_CONSTANT(USAGE_2D_NO_SAMPLING); - BIND_ENUM_CONSTANT(USAGE_3D); - BIND_ENUM_CONSTANT(USAGE_3D_NO_EFFECTS); - BIND_ENUM_CONSTANT(CLEAR_MODE_ALWAYS); BIND_ENUM_CONSTANT(CLEAR_MODE_NEVER); BIND_ENUM_CONSTANT(CLEAR_MODE_ONLY_NEXT_FRAME); @@ -3406,8 +3326,6 @@ Viewport::Viewport() { size_override_size = Size2(1, 1); gen_mipmaps = false; - vflip = false; - //clear=true; update_mode = UPDATE_WHEN_VISIBLE; @@ -3433,8 +3351,6 @@ Viewport::Viewport() { unhandled_key_input_group = "_vp_unhandled_key_input" + id; disable_input = false; - disable_3d = false; - keep_3d_linear = false; //window tooltip gui.tooltip_timer = -1; @@ -3453,9 +3369,7 @@ Viewport::Viewport() { gui.last_mouse_focus = NULL; msaa = MSAA_DISABLED; - hdr = true; - usage = USAGE_3D; debug_draw = DEBUG_DRAW_DISABLED; clear_mode = CLEAR_MODE_ALWAYS; diff --git a/scene/main/viewport.h b/scene/main/viewport.h index a70d812eda..469665676c 100644 --- a/scene/main/viewport.h +++ b/scene/main/viewport.h @@ -115,13 +115,6 @@ public: MSAA_16X, }; - enum Usage { - USAGE_2D, - USAGE_2D_NO_SAMPLING, - USAGE_3D, - USAGE_3D_NO_EFFECTS, - }; - enum RenderInfo { RENDER_INFO_OBJECTS_IN_FRAME, @@ -226,7 +219,6 @@ private: Rect2 last_vp_rect; bool transparent_bg; - bool vflip; ClearMode clear_mode; bool filter; bool gen_mipmaps; @@ -278,21 +270,15 @@ private: void _update_stretch_transform(); void _update_global_transform(); - bool disable_3d; - bool keep_3d_linear; UpdateMode update_mode; RID texture_rid; DebugDraw debug_draw; - Usage usage; - int shadow_atlas_size; ShadowAtlasQuadrantSubdiv shadow_atlas_quadrant_subdiv[4]; MSAA msaa; - bool hdr; - Ref<ViewportTexture> default_texture; Set<ViewportTexture *> viewport_textures; @@ -491,9 +477,6 @@ public: void set_size_override_stretch(bool p_enable); bool is_size_override_stretch_enabled() const; - void set_vflip(bool p_enable); - bool get_vflip() const; - void set_clear_mode(ClearMode p_mode); ClearMode get_clear_mode() const; @@ -510,9 +493,6 @@ public: void set_msaa(MSAA p_msaa); MSAA get_msaa() const; - void set_hdr(bool p_hdr); - bool get_hdr() const; - Vector2 get_camera_coords(const Vector2 &p_viewport_coords) const; Vector2 get_camera_rect_size() const; @@ -525,12 +505,6 @@ public: void set_disable_input(bool p_disable); bool is_input_disabled() const; - void set_disable_3d(bool p_disable); - bool is_3d_disabled() const; - - void set_keep_3d_linear(bool p_keep_3d_linear); - bool get_keep_3d_linear() const; - void set_attach_to_screen_rect(const Rect2 &p_rect); Rect2 get_attach_to_screen_rect() const; @@ -553,9 +527,6 @@ public: virtual String get_configuration_warning() const; - void set_usage(Usage p_usage); - Usage get_usage() const; - void set_debug_draw(DebugDraw p_debug_draw); DebugDraw get_debug_draw() const; @@ -587,7 +558,6 @@ public: VARIANT_ENUM_CAST(Viewport::UpdateMode); VARIANT_ENUM_CAST(Viewport::ShadowAtlasQuadrantSubdiv); VARIANT_ENUM_CAST(Viewport::MSAA); -VARIANT_ENUM_CAST(Viewport::Usage); VARIANT_ENUM_CAST(Viewport::DebugDraw); VARIANT_ENUM_CAST(Viewport::ClearMode); VARIANT_ENUM_CAST(Viewport::RenderInfo); |