mirror of
https://github.com/godotengine/godot.git
synced 2025-12-08 06:09:55 +00:00
Implement 2D instance shader parameters
Co-authored-by: kobewi <kobewi4e@gmail.com> Co-authored-by: yesfish <huwpascoe@users.noreply.github.com> Co-authored-by: Álex Román Núñez <eirexe123@gmail.com>
This commit is contained in:
parent
b9437c3938
commit
ceefc0d38a
24 changed files with 626 additions and 168 deletions
|
|
@ -116,6 +116,8 @@ private:
|
|||
TextureRepeat texture_repeat = TEXTURE_REPEAT_PARENT_NODE;
|
||||
|
||||
Ref<Material> material;
|
||||
mutable HashMap<StringName, Variant> instance_shader_parameters;
|
||||
mutable HashMap<StringName, StringName> instance_shader_parameter_property_remap;
|
||||
|
||||
mutable Transform2D global_transform;
|
||||
mutable MTFlag global_invalid;
|
||||
|
|
@ -150,8 +152,13 @@ private:
|
|||
void _update_texture_filter_changed(bool p_propagate);
|
||||
|
||||
void _notify_transform_deferred();
|
||||
const StringName *_instance_shader_parameter_get_remap(const StringName &p_name) const;
|
||||
|
||||
protected:
|
||||
bool _set(const StringName &p_name, const Variant &p_value);
|
||||
bool _get(const StringName &p_name, Variant &r_ret) const;
|
||||
void _get_property_list(List<PropertyInfo> *p_list) const;
|
||||
|
||||
virtual void _update_self_texture_repeat(RS::CanvasItemTextureRepeat p_texture_repeat);
|
||||
virtual void _update_self_texture_filter(RS::CanvasItemTextureFilter p_texture_filter);
|
||||
|
||||
|
|
@ -355,6 +362,9 @@ public:
|
|||
virtual void set_material(const Ref<Material> &p_material);
|
||||
Ref<Material> get_material() const;
|
||||
|
||||
void set_instance_shader_parameter(const StringName &p_name, const Variant &p_value);
|
||||
Variant get_instance_shader_parameter(const StringName &p_name) const;
|
||||
|
||||
virtual void set_use_parent_material(bool p_use_parent_material);
|
||||
bool get_use_parent_material() const;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue