diff options
Diffstat (limited to 'scene/resources/shader.h')
-rw-r--r-- | scene/resources/shader.h | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/scene/resources/shader.h b/scene/resources/shader.h index 67ae436a4c..7dcec7811a 100644 --- a/scene/resources/shader.h +++ b/scene/resources/shader.h @@ -37,7 +37,6 @@ #include "scene/resources/texture.h" class Shader : public Resource { - GDCLASS(Shader, Resource); OBJ_SAVE_TYPE(Shader); @@ -47,6 +46,7 @@ public: MODE_SPATIAL, MODE_CANVAS_ITEM, MODE_PARTICLES, + MODE_SKY, MODE_MAX }; @@ -55,11 +55,11 @@ private: Mode mode; // hack the name of performance - // shaders keep a list of ShaderMaterial -> VisualServer name translations, to make + // shaders keep a list of ShaderMaterial -> RenderingServer name translations, to make // conversion fast and save memory. mutable bool params_cache_dirty; mutable Map<StringName, StringName> params_cache; //map a shader param to a material param.. - Map<StringName, Ref<Texture> > default_textures; + Map<StringName, Ref<Texture2D>> default_textures; virtual void _update_shader() const; //used for visual shader protected: @@ -75,23 +75,25 @@ public: void get_param_list(List<PropertyInfo> *p_params) const; bool has_param(const StringName &p_param) const; - void set_default_texture_param(const StringName &p_param, const Ref<Texture> &p_texture); - Ref<Texture> get_default_texture_param(const StringName &p_param) const; + void set_default_texture_param(const StringName &p_param, const Ref<Texture2D> &p_texture); + Ref<Texture2D> get_default_texture_param(const StringName &p_param) const; void get_default_texture_param_list(List<StringName> *r_textures) const; virtual bool is_text_shader() const; _FORCE_INLINE_ StringName remap_param(const StringName &p_param) const { - if (params_cache_dirty) - get_param_list(NULL); + if (params_cache_dirty) { + get_param_list(nullptr); + } const Map<StringName, StringName>::Element *E = params_cache.find(p_param); - if (E) + if (E) { return E->get(); + } return StringName(); } - virtual RID get_rid() const; + virtual RID get_rid() const override; Shader(); ~Shader(); @@ -101,7 +103,7 @@ VARIANT_ENUM_CAST(Shader::Mode); class ResourceFormatLoaderShader : public ResourceFormatLoader { public: - virtual RES load(const String &p_path, const String &p_original_path = "", Error *r_error = NULL); + virtual RES load(const String &p_path, const String &p_original_path = "", Error *r_error = nullptr, bool p_use_sub_threads = false, float *r_progress = nullptr, bool p_no_cache = false); virtual void get_recognized_extensions(List<String> *p_extensions) const; virtual bool handles_type(const String &p_type) const; virtual String get_resource_type(const String &p_path) const; |