diff options
author | Juan Linietsky <reduzio@gmail.com> | 2019-06-11 15:43:37 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2020-02-11 11:53:26 +0100 |
commit | 3f335ce3d446372eeb9ed87f7e117099c4d2dd6a (patch) | |
tree | 669db7ddb21f328215a9c26e9bdaf2565db8c853 /scene/main | |
parent | 9ffe57a10eecf79ab8df2f0497d0387383755df3 (diff) |
Texture refactor
-Texture renamed to Texture2D
-TextureLayered as base now inherits 2Darray, cubemap and cubemap array
-Removed all references to flags in textures (they will go in the shader)
-Texture3D gone for now (will come back later done properly)
-Create base rasterizer for RenderDevice, RasterizerRD
Diffstat (limited to 'scene/main')
-rw-r--r-- | scene/main/viewport.cpp | 23 | ||||
-rw-r--r-- | scene/main/viewport.h | 9 |
2 files changed, 4 insertions, 28 deletions
diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp index 72ab817e98..412632acfc 100644 --- a/scene/main/viewport.cpp +++ b/scene/main/viewport.cpp @@ -75,9 +75,6 @@ void ViewportTexture::setup_local_to_scene() { vp->viewport_textures.insert(this); VS::get_singleton()->texture_set_proxy(proxy, vp->texture_rid); - - vp->texture_flags = flags; - VS::get_singleton()->texture_set_flags(vp->texture_rid, flags); } void ViewportTexture::set_viewport_path_in_scene(const NodePath &p_path) { @@ -125,21 +122,7 @@ bool ViewportTexture::has_alpha() const { Ref<Image> ViewportTexture::get_data() const { ERR_FAIL_COND_V_MSG(!vp, Ref<Image>(), "Viewport Texture must be set to use it."); - return VS::get_singleton()->texture_get_data(vp->texture_rid); -} -void ViewportTexture::set_flags(uint32_t p_flags) { - flags = p_flags; - - if (!vp) - return; - - vp->texture_flags = flags; - VS::get_singleton()->texture_set_flags(vp->texture_rid, flags); -} - -uint32_t ViewportTexture::get_flags() const { - - return flags; + return VS::get_singleton()->texture_2d_get(vp->texture_rid); } void ViewportTexture::_bind_methods() { @@ -153,9 +136,8 @@ void ViewportTexture::_bind_methods() { ViewportTexture::ViewportTexture() { vp = NULL; - flags = 0; set_local_to_scene(true); - proxy = VS::get_singleton()->texture_create(); + proxy = VS::get_singleton()->texture_2d_placeholder_create(); } ViewportTexture::~ViewportTexture() { @@ -3321,7 +3303,6 @@ Viewport::Viewport() { viewport = VisualServer::get_singleton()->viewport_create(); texture_rid = VisualServer::get_singleton()->viewport_get_texture(viewport); - texture_flags = 0; render_direct_to_screen = false; diff --git a/scene/main/viewport.h b/scene/main/viewport.h index 79b606cda3..af7c8f1356 100644 --- a/scene/main/viewport.h +++ b/scene/main/viewport.h @@ -49,15 +49,14 @@ class Timer; class Viewport; class CollisionObject; -class ViewportTexture : public Texture { +class ViewportTexture : public Texture2D { - GDCLASS(ViewportTexture, Texture); + GDCLASS(ViewportTexture, Texture2D); NodePath path; friend class Viewport; Viewport *vp; - uint32_t flags; RID proxy; @@ -77,9 +76,6 @@ public: virtual bool has_alpha() const; - virtual void set_flags(uint32_t p_flags); - virtual uint32_t get_flags() const; - virtual Ref<Image> get_data() const; ViewportTexture(); @@ -270,7 +266,6 @@ private: bool keep_3d_linear; UpdateMode update_mode; RID texture_rid; - uint32_t texture_flags; DebugDraw debug_draw; |