diff options
author | Rémi Verschelde <remi@verschelde.fr> | 2021-11-10 19:55:25 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-10 19:55:25 +0100 |
commit | a6412e132a7fa1a80f32a44e97a2a8dcb1111658 (patch) | |
tree | b8f73abd4ff3d16dfb38f2ce395903cb2e86ec2e /scene/resources/visual_shader_particle_nodes.h | |
parent | b46a42b689ac3c7396216153799f1324ca7b6356 (diff) | |
parent | 80b563672b075fb4b0eff691177f84d44e36bc39 (diff) |
Merge pull request #54660 from Chaosus/vs_particles_mesh_emitter
Diffstat (limited to 'scene/resources/visual_shader_particle_nodes.h')
-rw-r--r-- | scene/resources/visual_shader_particle_nodes.h | 47 |
1 files changed, 46 insertions, 1 deletions
diff --git a/scene/resources/visual_shader_particle_nodes.h b/scene/resources/visual_shader_particle_nodes.h index 0b1fa277de..0d0f21e4bf 100644 --- a/scene/resources/visual_shader_particle_nodes.h +++ b/scene/resources/visual_shader_particle_nodes.h @@ -52,7 +52,7 @@ public: bool is_mode_2d() const; Vector<StringName> get_editable_properties() const override; - Map<StringName, String> get_editable_properties_names() const override; + virtual Map<StringName, String> get_editable_properties_names() const override; bool is_show_prop_names() const override; VisualShaderNodeParticleEmitter(); @@ -106,6 +106,51 @@ public: VisualShaderNodeParticleRingEmitter(); }; +class VisualShaderNodeParticleMeshEmitter : public VisualShaderNodeParticleEmitter { + GDCLASS(VisualShaderNodeParticleMeshEmitter, VisualShaderNodeParticleEmitter); + Ref<Mesh> mesh; + bool use_all_surfaces = true; + int surface_index = 0; + int max_surface_index = 0; + + Ref<ImageTexture> position_texture; + Ref<ImageTexture> normal_texture; + +protected: + static void _bind_methods(); + +public: + virtual String get_caption() const override; + + virtual int get_output_port_count() const override; + virtual PortType get_output_port_type(int p_port) const override; + virtual String get_output_port_name(int p_port) const override; + + virtual int get_input_port_count() const override; + virtual PortType get_input_port_type(int p_port) const override; + virtual String get_input_port_name(int p_port) const override; + + virtual String generate_global_per_node(Shader::Mode p_mode, VisualShader::Type p_type, int p_id) const override; + virtual String generate_code(Shader::Mode p_mode, VisualShader::Type p_type, int p_id, const String *p_input_vars, const String *p_output_vars, bool p_for_preview = false) const override; + + void update_texture(); + + void set_mesh(Ref<Mesh> p_mesh); + Ref<Mesh> get_mesh() const; + + void set_use_all_surfaces(bool p_enabled); + bool is_use_all_surfaces() const; + + void set_surface_index(int p_surface_index); + int get_surface_index() const; + + Vector<StringName> get_editable_properties() const override; + Map<StringName, String> get_editable_properties_names() const override; + Vector<VisualShader::DefaultTextureParam> get_default_texture_parameters(VisualShader::Type p_type, int p_id) const override; + + VisualShaderNodeParticleMeshEmitter(); +}; + class VisualShaderNodeParticleMultiplyByAxisAngle : public VisualShaderNode { GDCLASS(VisualShaderNodeParticleMultiplyByAxisAngle, VisualShaderNode); bool degrees_mode = true; |