|
@@ -1,5 +1,5 @@
|
|
/*************************************************************************/
|
|
/*************************************************************************/
|
|
-/* particles_material.cpp */
|
|
|
|
|
|
+/* particle_process_material.cpp */
|
|
/*************************************************************************/
|
|
/*************************************************************************/
|
|
/* This file is part of: */
|
|
/* This file is part of: */
|
|
/* GODOT ENGINE */
|
|
/* GODOT ENGINE */
|
|
@@ -28,17 +28,17 @@
|
|
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
|
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
|
/*************************************************************************/
|
|
/*************************************************************************/
|
|
|
|
|
|
-#include "particles_material.h"
|
|
|
|
|
|
+#include "particle_process_material.h"
|
|
|
|
|
|
#include "core/version.h"
|
|
#include "core/version.h"
|
|
|
|
|
|
-Mutex ParticlesMaterial::material_mutex;
|
|
|
|
-SelfList<ParticlesMaterial>::List *ParticlesMaterial::dirty_materials = nullptr;
|
|
|
|
-HashMap<ParticlesMaterial::MaterialKey, ParticlesMaterial::ShaderData, ParticlesMaterial::MaterialKey> ParticlesMaterial::shader_map;
|
|
|
|
-ParticlesMaterial::ShaderNames *ParticlesMaterial::shader_names = nullptr;
|
|
|
|
|
|
+Mutex ParticleProcessMaterial::material_mutex;
|
|
|
|
+SelfList<ParticleProcessMaterial>::List *ParticleProcessMaterial::dirty_materials = nullptr;
|
|
|
|
+HashMap<ParticleProcessMaterial::MaterialKey, ParticleProcessMaterial::ShaderData, ParticleProcessMaterial::MaterialKey> ParticleProcessMaterial::shader_map;
|
|
|
|
+ParticleProcessMaterial::ShaderNames *ParticleProcessMaterial::shader_names = nullptr;
|
|
|
|
|
|
-void ParticlesMaterial::init_shaders() {
|
|
|
|
- dirty_materials = memnew(SelfList<ParticlesMaterial>::List);
|
|
|
|
|
|
+void ParticleProcessMaterial::init_shaders() {
|
|
|
|
+ dirty_materials = memnew(SelfList<ParticleProcessMaterial>::List);
|
|
|
|
|
|
shader_names = memnew(ShaderNames);
|
|
shader_names = memnew(ShaderNames);
|
|
|
|
|
|
@@ -121,14 +121,14 @@ void ParticlesMaterial::init_shaders() {
|
|
shader_names->collision_bounce = "collision_bounce";
|
|
shader_names->collision_bounce = "collision_bounce";
|
|
}
|
|
}
|
|
|
|
|
|
-void ParticlesMaterial::finish_shaders() {
|
|
|
|
|
|
+void ParticleProcessMaterial::finish_shaders() {
|
|
memdelete(dirty_materials);
|
|
memdelete(dirty_materials);
|
|
dirty_materials = nullptr;
|
|
dirty_materials = nullptr;
|
|
|
|
|
|
memdelete(shader_names);
|
|
memdelete(shader_names);
|
|
}
|
|
}
|
|
|
|
|
|
-void ParticlesMaterial::_update_shader() {
|
|
|
|
|
|
+void ParticleProcessMaterial::_update_shader() {
|
|
dirty_materials->remove(&element);
|
|
dirty_materials->remove(&element);
|
|
|
|
|
|
MaterialKey mk = _compute_key();
|
|
MaterialKey mk = _compute_key();
|
|
@@ -155,7 +155,7 @@ void ParticlesMaterial::_update_shader() {
|
|
//must create a shader!
|
|
//must create a shader!
|
|
|
|
|
|
// Add a comment to describe the shader origin (useful when converting to ShaderMaterial).
|
|
// Add a comment to describe the shader origin (useful when converting to ShaderMaterial).
|
|
- String code = "// NOTE: Shader automatically converted from " VERSION_NAME " " VERSION_FULL_CONFIG "'s ParticlesMaterial.\n\n";
|
|
|
|
|
|
+ String code = "// NOTE: Shader automatically converted from " VERSION_NAME " " VERSION_FULL_CONFIG "'s ParticleProcessMaterial.\n\n";
|
|
|
|
|
|
code += "shader_type particles;\n";
|
|
code += "shader_type particles;\n";
|
|
|
|
|
|
@@ -908,7 +908,7 @@ void ParticlesMaterial::_update_shader() {
|
|
RS::get_singleton()->material_set_shader(_get_material(), shader_data.shader);
|
|
RS::get_singleton()->material_set_shader(_get_material(), shader_data.shader);
|
|
}
|
|
}
|
|
|
|
|
|
-void ParticlesMaterial::flush_changes() {
|
|
|
|
|
|
+void ParticleProcessMaterial::flush_changes() {
|
|
MutexLock lock(material_mutex);
|
|
MutexLock lock(material_mutex);
|
|
|
|
|
|
while (dirty_materials->first()) {
|
|
while (dirty_materials->first()) {
|
|
@@ -916,7 +916,7 @@ void ParticlesMaterial::flush_changes() {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
-void ParticlesMaterial::_queue_shader_change() {
|
|
|
|
|
|
+void ParticleProcessMaterial::_queue_shader_change() {
|
|
MutexLock lock(material_mutex);
|
|
MutexLock lock(material_mutex);
|
|
|
|
|
|
if (is_initialized && !element.in_list()) {
|
|
if (is_initialized && !element.in_list()) {
|
|
@@ -924,40 +924,40 @@ void ParticlesMaterial::_queue_shader_change() {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
-bool ParticlesMaterial::_is_shader_dirty() const {
|
|
|
|
|
|
+bool ParticleProcessMaterial::_is_shader_dirty() const {
|
|
MutexLock lock(material_mutex);
|
|
MutexLock lock(material_mutex);
|
|
|
|
|
|
return element.in_list();
|
|
return element.in_list();
|
|
}
|
|
}
|
|
|
|
|
|
-void ParticlesMaterial::set_direction(Vector3 p_direction) {
|
|
|
|
|
|
+void ParticleProcessMaterial::set_direction(Vector3 p_direction) {
|
|
direction = p_direction;
|
|
direction = p_direction;
|
|
RenderingServer::get_singleton()->material_set_param(_get_material(), shader_names->direction, direction);
|
|
RenderingServer::get_singleton()->material_set_param(_get_material(), shader_names->direction, direction);
|
|
}
|
|
}
|
|
|
|
|
|
-Vector3 ParticlesMaterial::get_direction() const {
|
|
|
|
|
|
+Vector3 ParticleProcessMaterial::get_direction() const {
|
|
return direction;
|
|
return direction;
|
|
}
|
|
}
|
|
|
|
|
|
-void ParticlesMaterial::set_spread(float p_spread) {
|
|
|
|
|
|
+void ParticleProcessMaterial::set_spread(float p_spread) {
|
|
spread = p_spread;
|
|
spread = p_spread;
|
|
RenderingServer::get_singleton()->material_set_param(_get_material(), shader_names->spread, p_spread);
|
|
RenderingServer::get_singleton()->material_set_param(_get_material(), shader_names->spread, p_spread);
|
|
}
|
|
}
|
|
|
|
|
|
-float ParticlesMaterial::get_spread() const {
|
|
|
|
|
|
+float ParticleProcessMaterial::get_spread() const {
|
|
return spread;
|
|
return spread;
|
|
}
|
|
}
|
|
|
|
|
|
-void ParticlesMaterial::set_flatness(float p_flatness) {
|
|
|
|
|
|
+void ParticleProcessMaterial::set_flatness(float p_flatness) {
|
|
flatness = p_flatness;
|
|
flatness = p_flatness;
|
|
RenderingServer::get_singleton()->material_set_param(_get_material(), shader_names->flatness, p_flatness);
|
|
RenderingServer::get_singleton()->material_set_param(_get_material(), shader_names->flatness, p_flatness);
|
|
}
|
|
}
|
|
|
|
|
|
-float ParticlesMaterial::get_flatness() const {
|
|
|
|
|
|
+float ParticleProcessMaterial::get_flatness() const {
|
|
return flatness;
|
|
return flatness;
|
|
}
|
|
}
|
|
|
|
|
|
-void ParticlesMaterial::set_param_min(Parameter p_param, float p_value) {
|
|
|
|
|
|
+void ParticleProcessMaterial::set_param_min(Parameter p_param, float p_value) {
|
|
ERR_FAIL_INDEX(p_param, PARAM_MAX);
|
|
ERR_FAIL_INDEX(p_param, PARAM_MAX);
|
|
|
|
|
|
params_min[p_param] = p_value;
|
|
params_min[p_param] = p_value;
|
|
@@ -1016,13 +1016,13 @@ void ParticlesMaterial::set_param_min(Parameter p_param, float p_value) {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
-float ParticlesMaterial::get_param_min(Parameter p_param) const {
|
|
|
|
|
|
+float ParticleProcessMaterial::get_param_min(Parameter p_param) const {
|
|
ERR_FAIL_INDEX_V(p_param, PARAM_MAX, 0);
|
|
ERR_FAIL_INDEX_V(p_param, PARAM_MAX, 0);
|
|
|
|
|
|
return params_min[p_param];
|
|
return params_min[p_param];
|
|
}
|
|
}
|
|
|
|
|
|
-void ParticlesMaterial::set_param_max(Parameter p_param, float p_value) {
|
|
|
|
|
|
+void ParticleProcessMaterial::set_param_max(Parameter p_param, float p_value) {
|
|
ERR_FAIL_INDEX(p_param, PARAM_MAX);
|
|
ERR_FAIL_INDEX(p_param, PARAM_MAX);
|
|
|
|
|
|
params_max[p_param] = p_value;
|
|
params_max[p_param] = p_value;
|
|
@@ -1081,7 +1081,7 @@ void ParticlesMaterial::set_param_max(Parameter p_param, float p_value) {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
-float ParticlesMaterial::get_param_max(Parameter p_param) const {
|
|
|
|
|
|
+float ParticleProcessMaterial::get_param_max(Parameter p_param) const {
|
|
ERR_FAIL_INDEX_V(p_param, PARAM_MAX, 0);
|
|
ERR_FAIL_INDEX_V(p_param, PARAM_MAX, 0);
|
|
|
|
|
|
return params_max[p_param];
|
|
return params_max[p_param];
|
|
@@ -1096,7 +1096,7 @@ static void _adjust_curve_range(const Ref<Texture2D> &p_texture, float p_min, fl
|
|
curve_tex->ensure_default_setup(p_min, p_max);
|
|
curve_tex->ensure_default_setup(p_min, p_max);
|
|
}
|
|
}
|
|
|
|
|
|
-void ParticlesMaterial::set_param_texture(Parameter p_param, const Ref<Texture2D> &p_texture) {
|
|
|
|
|
|
+void ParticleProcessMaterial::set_param_texture(Parameter p_param, const Ref<Texture2D> &p_texture) {
|
|
ERR_FAIL_INDEX(p_param, PARAM_MAX);
|
|
ERR_FAIL_INDEX(p_param, PARAM_MAX);
|
|
|
|
|
|
tex_parameters[p_param] = p_texture;
|
|
tex_parameters[p_param] = p_texture;
|
|
@@ -1167,22 +1167,22 @@ void ParticlesMaterial::set_param_texture(Parameter p_param, const Ref<Texture2D
|
|
_queue_shader_change();
|
|
_queue_shader_change();
|
|
}
|
|
}
|
|
|
|
|
|
-Ref<Texture2D> ParticlesMaterial::get_param_texture(Parameter p_param) const {
|
|
|
|
|
|
+Ref<Texture2D> ParticleProcessMaterial::get_param_texture(Parameter p_param) const {
|
|
ERR_FAIL_INDEX_V(p_param, PARAM_MAX, Ref<Texture2D>());
|
|
ERR_FAIL_INDEX_V(p_param, PARAM_MAX, Ref<Texture2D>());
|
|
|
|
|
|
return tex_parameters[p_param];
|
|
return tex_parameters[p_param];
|
|
}
|
|
}
|
|
|
|
|
|
-void ParticlesMaterial::set_color(const Color &p_color) {
|
|
|
|
|
|
+void ParticleProcessMaterial::set_color(const Color &p_color) {
|
|
RenderingServer::get_singleton()->material_set_param(_get_material(), shader_names->color, p_color);
|
|
RenderingServer::get_singleton()->material_set_param(_get_material(), shader_names->color, p_color);
|
|
color = p_color;
|
|
color = p_color;
|
|
}
|
|
}
|
|
|
|
|
|
-Color ParticlesMaterial::get_color() const {
|
|
|
|
|
|
+Color ParticleProcessMaterial::get_color() const {
|
|
return color;
|
|
return color;
|
|
}
|
|
}
|
|
|
|
|
|
-void ParticlesMaterial::set_color_ramp(const Ref<Texture2D> &p_texture) {
|
|
|
|
|
|
+void ParticleProcessMaterial::set_color_ramp(const Ref<Texture2D> &p_texture) {
|
|
color_ramp = p_texture;
|
|
color_ramp = p_texture;
|
|
RID tex_rid = p_texture.is_valid() ? p_texture->get_rid() : RID();
|
|
RID tex_rid = p_texture.is_valid() ? p_texture->get_rid() : RID();
|
|
RenderingServer::get_singleton()->material_set_param(_get_material(), shader_names->color_ramp, tex_rid);
|
|
RenderingServer::get_singleton()->material_set_param(_get_material(), shader_names->color_ramp, tex_rid);
|
|
@@ -1190,11 +1190,11 @@ void ParticlesMaterial::set_color_ramp(const Ref<Texture2D> &p_texture) {
|
|
notify_property_list_changed();
|
|
notify_property_list_changed();
|
|
}
|
|
}
|
|
|
|
|
|
-Ref<Texture2D> ParticlesMaterial::get_color_ramp() const {
|
|
|
|
|
|
+Ref<Texture2D> ParticleProcessMaterial::get_color_ramp() const {
|
|
return color_ramp;
|
|
return color_ramp;
|
|
}
|
|
}
|
|
|
|
|
|
-void ParticlesMaterial::set_color_initial_ramp(const Ref<Texture2D> &p_texture) {
|
|
|
|
|
|
+void ParticleProcessMaterial::set_color_initial_ramp(const Ref<Texture2D> &p_texture) {
|
|
color_initial_ramp = p_texture;
|
|
color_initial_ramp = p_texture;
|
|
RID tex_rid = p_texture.is_valid() ? p_texture->get_rid() : RID();
|
|
RID tex_rid = p_texture.is_valid() ? p_texture->get_rid() : RID();
|
|
RenderingServer::get_singleton()->material_set_param(_get_material(), shader_names->color_initial_ramp, tex_rid);
|
|
RenderingServer::get_singleton()->material_set_param(_get_material(), shader_names->color_initial_ramp, tex_rid);
|
|
@@ -1202,11 +1202,11 @@ void ParticlesMaterial::set_color_initial_ramp(const Ref<Texture2D> &p_texture)
|
|
notify_property_list_changed();
|
|
notify_property_list_changed();
|
|
}
|
|
}
|
|
|
|
|
|
-Ref<Texture2D> ParticlesMaterial::get_color_initial_ramp() const {
|
|
|
|
|
|
+Ref<Texture2D> ParticleProcessMaterial::get_color_initial_ramp() const {
|
|
return color_initial_ramp;
|
|
return color_initial_ramp;
|
|
}
|
|
}
|
|
|
|
|
|
-void ParticlesMaterial::set_particle_flag(ParticleFlags p_particle_flag, bool p_enable) {
|
|
|
|
|
|
+void ParticleProcessMaterial::set_particle_flag(ParticleFlags p_particle_flag, bool p_enable) {
|
|
ERR_FAIL_INDEX(p_particle_flag, PARTICLE_FLAG_MAX);
|
|
ERR_FAIL_INDEX(p_particle_flag, PARTICLE_FLAG_MAX);
|
|
particle_flags[p_particle_flag] = p_enable;
|
|
particle_flags[p_particle_flag] = p_enable;
|
|
_queue_shader_change();
|
|
_queue_shader_change();
|
|
@@ -1215,165 +1215,165 @@ void ParticlesMaterial::set_particle_flag(ParticleFlags p_particle_flag, bool p_
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
-bool ParticlesMaterial::get_particle_flag(ParticleFlags p_particle_flag) const {
|
|
|
|
|
|
+bool ParticleProcessMaterial::get_particle_flag(ParticleFlags p_particle_flag) const {
|
|
ERR_FAIL_INDEX_V(p_particle_flag, PARTICLE_FLAG_MAX, false);
|
|
ERR_FAIL_INDEX_V(p_particle_flag, PARTICLE_FLAG_MAX, false);
|
|
return particle_flags[p_particle_flag];
|
|
return particle_flags[p_particle_flag];
|
|
}
|
|
}
|
|
|
|
|
|
-void ParticlesMaterial::set_emission_shape(EmissionShape p_shape) {
|
|
|
|
|
|
+void ParticleProcessMaterial::set_emission_shape(EmissionShape p_shape) {
|
|
ERR_FAIL_INDEX(p_shape, EMISSION_SHAPE_MAX);
|
|
ERR_FAIL_INDEX(p_shape, EMISSION_SHAPE_MAX);
|
|
emission_shape = p_shape;
|
|
emission_shape = p_shape;
|
|
notify_property_list_changed();
|
|
notify_property_list_changed();
|
|
_queue_shader_change();
|
|
_queue_shader_change();
|
|
}
|
|
}
|
|
|
|
|
|
-void ParticlesMaterial::set_emission_sphere_radius(real_t p_radius) {
|
|
|
|
|
|
+void ParticleProcessMaterial::set_emission_sphere_radius(real_t p_radius) {
|
|
emission_sphere_radius = p_radius;
|
|
emission_sphere_radius = p_radius;
|
|
RenderingServer::get_singleton()->material_set_param(_get_material(), shader_names->emission_sphere_radius, p_radius);
|
|
RenderingServer::get_singleton()->material_set_param(_get_material(), shader_names->emission_sphere_radius, p_radius);
|
|
}
|
|
}
|
|
|
|
|
|
-void ParticlesMaterial::set_emission_box_extents(Vector3 p_extents) {
|
|
|
|
|
|
+void ParticleProcessMaterial::set_emission_box_extents(Vector3 p_extents) {
|
|
emission_box_extents = p_extents;
|
|
emission_box_extents = p_extents;
|
|
RenderingServer::get_singleton()->material_set_param(_get_material(), shader_names->emission_box_extents, p_extents);
|
|
RenderingServer::get_singleton()->material_set_param(_get_material(), shader_names->emission_box_extents, p_extents);
|
|
}
|
|
}
|
|
|
|
|
|
-void ParticlesMaterial::set_emission_point_texture(const Ref<Texture2D> &p_points) {
|
|
|
|
|
|
+void ParticleProcessMaterial::set_emission_point_texture(const Ref<Texture2D> &p_points) {
|
|
emission_point_texture = p_points;
|
|
emission_point_texture = p_points;
|
|
RID tex_rid = p_points.is_valid() ? p_points->get_rid() : RID();
|
|
RID tex_rid = p_points.is_valid() ? p_points->get_rid() : RID();
|
|
RenderingServer::get_singleton()->material_set_param(_get_material(), shader_names->emission_texture_points, tex_rid);
|
|
RenderingServer::get_singleton()->material_set_param(_get_material(), shader_names->emission_texture_points, tex_rid);
|
|
}
|
|
}
|
|
|
|
|
|
-void ParticlesMaterial::set_emission_normal_texture(const Ref<Texture2D> &p_normals) {
|
|
|
|
|
|
+void ParticleProcessMaterial::set_emission_normal_texture(const Ref<Texture2D> &p_normals) {
|
|
emission_normal_texture = p_normals;
|
|
emission_normal_texture = p_normals;
|
|
RID tex_rid = p_normals.is_valid() ? p_normals->get_rid() : RID();
|
|
RID tex_rid = p_normals.is_valid() ? p_normals->get_rid() : RID();
|
|
RenderingServer::get_singleton()->material_set_param(_get_material(), shader_names->emission_texture_normal, tex_rid);
|
|
RenderingServer::get_singleton()->material_set_param(_get_material(), shader_names->emission_texture_normal, tex_rid);
|
|
}
|
|
}
|
|
|
|
|
|
-void ParticlesMaterial::set_emission_color_texture(const Ref<Texture2D> &p_colors) {
|
|
|
|
|
|
+void ParticleProcessMaterial::set_emission_color_texture(const Ref<Texture2D> &p_colors) {
|
|
emission_color_texture = p_colors;
|
|
emission_color_texture = p_colors;
|
|
RID tex_rid = p_colors.is_valid() ? p_colors->get_rid() : RID();
|
|
RID tex_rid = p_colors.is_valid() ? p_colors->get_rid() : RID();
|
|
RenderingServer::get_singleton()->material_set_param(_get_material(), shader_names->emission_texture_color, tex_rid);
|
|
RenderingServer::get_singleton()->material_set_param(_get_material(), shader_names->emission_texture_color, tex_rid);
|
|
_queue_shader_change();
|
|
_queue_shader_change();
|
|
}
|
|
}
|
|
|
|
|
|
-void ParticlesMaterial::set_emission_point_count(int p_count) {
|
|
|
|
|
|
+void ParticleProcessMaterial::set_emission_point_count(int p_count) {
|
|
emission_point_count = p_count;
|
|
emission_point_count = p_count;
|
|
RenderingServer::get_singleton()->material_set_param(_get_material(), shader_names->emission_texture_point_count, p_count);
|
|
RenderingServer::get_singleton()->material_set_param(_get_material(), shader_names->emission_texture_point_count, p_count);
|
|
}
|
|
}
|
|
|
|
|
|
-void ParticlesMaterial::set_emission_ring_axis(Vector3 p_axis) {
|
|
|
|
|
|
+void ParticleProcessMaterial::set_emission_ring_axis(Vector3 p_axis) {
|
|
emission_ring_axis = p_axis;
|
|
emission_ring_axis = p_axis;
|
|
RenderingServer::get_singleton()->material_set_param(_get_material(), shader_names->emission_ring_axis, p_axis);
|
|
RenderingServer::get_singleton()->material_set_param(_get_material(), shader_names->emission_ring_axis, p_axis);
|
|
}
|
|
}
|
|
|
|
|
|
-void ParticlesMaterial::set_emission_ring_height(real_t p_height) {
|
|
|
|
|
|
+void ParticleProcessMaterial::set_emission_ring_height(real_t p_height) {
|
|
emission_ring_height = p_height;
|
|
emission_ring_height = p_height;
|
|
RenderingServer::get_singleton()->material_set_param(_get_material(), shader_names->emission_ring_height, p_height);
|
|
RenderingServer::get_singleton()->material_set_param(_get_material(), shader_names->emission_ring_height, p_height);
|
|
}
|
|
}
|
|
|
|
|
|
-void ParticlesMaterial::set_emission_ring_radius(real_t p_radius) {
|
|
|
|
|
|
+void ParticleProcessMaterial::set_emission_ring_radius(real_t p_radius) {
|
|
emission_ring_radius = p_radius;
|
|
emission_ring_radius = p_radius;
|
|
RenderingServer::get_singleton()->material_set_param(_get_material(), shader_names->emission_ring_radius, p_radius);
|
|
RenderingServer::get_singleton()->material_set_param(_get_material(), shader_names->emission_ring_radius, p_radius);
|
|
}
|
|
}
|
|
|
|
|
|
-void ParticlesMaterial::set_emission_ring_inner_radius(real_t p_radius) {
|
|
|
|
|
|
+void ParticleProcessMaterial::set_emission_ring_inner_radius(real_t p_radius) {
|
|
emission_ring_inner_radius = p_radius;
|
|
emission_ring_inner_radius = p_radius;
|
|
RenderingServer::get_singleton()->material_set_param(_get_material(), shader_names->emission_ring_inner_radius, p_radius);
|
|
RenderingServer::get_singleton()->material_set_param(_get_material(), shader_names->emission_ring_inner_radius, p_radius);
|
|
}
|
|
}
|
|
|
|
|
|
-ParticlesMaterial::EmissionShape ParticlesMaterial::get_emission_shape() const {
|
|
|
|
|
|
+ParticleProcessMaterial::EmissionShape ParticleProcessMaterial::get_emission_shape() const {
|
|
return emission_shape;
|
|
return emission_shape;
|
|
}
|
|
}
|
|
|
|
|
|
-real_t ParticlesMaterial::get_emission_sphere_radius() const {
|
|
|
|
|
|
+real_t ParticleProcessMaterial::get_emission_sphere_radius() const {
|
|
return emission_sphere_radius;
|
|
return emission_sphere_radius;
|
|
}
|
|
}
|
|
|
|
|
|
-Vector3 ParticlesMaterial::get_emission_box_extents() const {
|
|
|
|
|
|
+Vector3 ParticleProcessMaterial::get_emission_box_extents() const {
|
|
return emission_box_extents;
|
|
return emission_box_extents;
|
|
}
|
|
}
|
|
|
|
|
|
-Ref<Texture2D> ParticlesMaterial::get_emission_point_texture() const {
|
|
|
|
|
|
+Ref<Texture2D> ParticleProcessMaterial::get_emission_point_texture() const {
|
|
return emission_point_texture;
|
|
return emission_point_texture;
|
|
}
|
|
}
|
|
|
|
|
|
-Ref<Texture2D> ParticlesMaterial::get_emission_normal_texture() const {
|
|
|
|
|
|
+Ref<Texture2D> ParticleProcessMaterial::get_emission_normal_texture() const {
|
|
return emission_normal_texture;
|
|
return emission_normal_texture;
|
|
}
|
|
}
|
|
|
|
|
|
-Ref<Texture2D> ParticlesMaterial::get_emission_color_texture() const {
|
|
|
|
|
|
+Ref<Texture2D> ParticleProcessMaterial::get_emission_color_texture() const {
|
|
return emission_color_texture;
|
|
return emission_color_texture;
|
|
}
|
|
}
|
|
|
|
|
|
-int ParticlesMaterial::get_emission_point_count() const {
|
|
|
|
|
|
+int ParticleProcessMaterial::get_emission_point_count() const {
|
|
return emission_point_count;
|
|
return emission_point_count;
|
|
}
|
|
}
|
|
|
|
|
|
-Vector3 ParticlesMaterial::get_emission_ring_axis() const {
|
|
|
|
|
|
+Vector3 ParticleProcessMaterial::get_emission_ring_axis() const {
|
|
return emission_ring_axis;
|
|
return emission_ring_axis;
|
|
}
|
|
}
|
|
|
|
|
|
-real_t ParticlesMaterial::get_emission_ring_height() const {
|
|
|
|
|
|
+real_t ParticleProcessMaterial::get_emission_ring_height() const {
|
|
return emission_ring_height;
|
|
return emission_ring_height;
|
|
}
|
|
}
|
|
|
|
|
|
-real_t ParticlesMaterial::get_emission_ring_radius() const {
|
|
|
|
|
|
+real_t ParticleProcessMaterial::get_emission_ring_radius() const {
|
|
return emission_ring_radius;
|
|
return emission_ring_radius;
|
|
}
|
|
}
|
|
|
|
|
|
-real_t ParticlesMaterial::get_emission_ring_inner_radius() const {
|
|
|
|
|
|
+real_t ParticleProcessMaterial::get_emission_ring_inner_radius() const {
|
|
return emission_ring_inner_radius;
|
|
return emission_ring_inner_radius;
|
|
}
|
|
}
|
|
|
|
|
|
-void ParticlesMaterial::set_turbulence_enabled(const bool p_turbulence_enabled) {
|
|
|
|
|
|
+void ParticleProcessMaterial::set_turbulence_enabled(const bool p_turbulence_enabled) {
|
|
turbulence_enabled = p_turbulence_enabled;
|
|
turbulence_enabled = p_turbulence_enabled;
|
|
RenderingServer::get_singleton()->material_set_param(_get_material(), shader_names->turbulence_enabled, turbulence_enabled);
|
|
RenderingServer::get_singleton()->material_set_param(_get_material(), shader_names->turbulence_enabled, turbulence_enabled);
|
|
_queue_shader_change();
|
|
_queue_shader_change();
|
|
notify_property_list_changed();
|
|
notify_property_list_changed();
|
|
}
|
|
}
|
|
|
|
|
|
-bool ParticlesMaterial::get_turbulence_enabled() const {
|
|
|
|
|
|
+bool ParticleProcessMaterial::get_turbulence_enabled() const {
|
|
return turbulence_enabled;
|
|
return turbulence_enabled;
|
|
}
|
|
}
|
|
|
|
|
|
-void ParticlesMaterial::set_turbulence_noise_strength(float p_turbulence_noise_strength) {
|
|
|
|
|
|
+void ParticleProcessMaterial::set_turbulence_noise_strength(float p_turbulence_noise_strength) {
|
|
turbulence_noise_strength = p_turbulence_noise_strength;
|
|
turbulence_noise_strength = p_turbulence_noise_strength;
|
|
RenderingServer::get_singleton()->material_set_param(_get_material(), shader_names->turbulence_noise_strength, p_turbulence_noise_strength);
|
|
RenderingServer::get_singleton()->material_set_param(_get_material(), shader_names->turbulence_noise_strength, p_turbulence_noise_strength);
|
|
}
|
|
}
|
|
|
|
|
|
-float ParticlesMaterial::get_turbulence_noise_strength() const {
|
|
|
|
|
|
+float ParticleProcessMaterial::get_turbulence_noise_strength() const {
|
|
return turbulence_noise_strength;
|
|
return turbulence_noise_strength;
|
|
}
|
|
}
|
|
|
|
|
|
-void ParticlesMaterial::set_turbulence_noise_scale(float p_turbulence_noise_scale) {
|
|
|
|
|
|
+void ParticleProcessMaterial::set_turbulence_noise_scale(float p_turbulence_noise_scale) {
|
|
turbulence_noise_scale = p_turbulence_noise_scale;
|
|
turbulence_noise_scale = p_turbulence_noise_scale;
|
|
float shader_turbulence_noise_scale = (pow(p_turbulence_noise_scale, 0.25) * 5.6234 / 10.0) * 4.0 - 3.0;
|
|
float shader_turbulence_noise_scale = (pow(p_turbulence_noise_scale, 0.25) * 5.6234 / 10.0) * 4.0 - 3.0;
|
|
RenderingServer::get_singleton()->material_set_param(_get_material(), shader_names->turbulence_noise_scale, shader_turbulence_noise_scale);
|
|
RenderingServer::get_singleton()->material_set_param(_get_material(), shader_names->turbulence_noise_scale, shader_turbulence_noise_scale);
|
|
}
|
|
}
|
|
|
|
|
|
-float ParticlesMaterial::get_turbulence_noise_scale() const {
|
|
|
|
|
|
+float ParticleProcessMaterial::get_turbulence_noise_scale() const {
|
|
return turbulence_noise_scale;
|
|
return turbulence_noise_scale;
|
|
}
|
|
}
|
|
|
|
|
|
-void ParticlesMaterial::set_turbulence_noise_speed_random(float p_turbulence_noise_speed_random) {
|
|
|
|
|
|
+void ParticleProcessMaterial::set_turbulence_noise_speed_random(float p_turbulence_noise_speed_random) {
|
|
turbulence_noise_speed_random = p_turbulence_noise_speed_random;
|
|
turbulence_noise_speed_random = p_turbulence_noise_speed_random;
|
|
RenderingServer::get_singleton()->material_set_param(_get_material(), shader_names->turbulence_noise_speed_random, p_turbulence_noise_speed_random);
|
|
RenderingServer::get_singleton()->material_set_param(_get_material(), shader_names->turbulence_noise_speed_random, p_turbulence_noise_speed_random);
|
|
}
|
|
}
|
|
|
|
|
|
-float ParticlesMaterial::get_turbulence_noise_speed_random() const {
|
|
|
|
|
|
+float ParticleProcessMaterial::get_turbulence_noise_speed_random() const {
|
|
return turbulence_noise_speed_random;
|
|
return turbulence_noise_speed_random;
|
|
}
|
|
}
|
|
|
|
|
|
-void ParticlesMaterial::set_turbulence_noise_speed(const Vector3 &p_turbulence_noise_speed) {
|
|
|
|
|
|
+void ParticleProcessMaterial::set_turbulence_noise_speed(const Vector3 &p_turbulence_noise_speed) {
|
|
turbulence_noise_speed = p_turbulence_noise_speed;
|
|
turbulence_noise_speed = p_turbulence_noise_speed;
|
|
RenderingServer::get_singleton()->material_set_param(_get_material(), shader_names->turbulence_noise_speed, turbulence_noise_speed);
|
|
RenderingServer::get_singleton()->material_set_param(_get_material(), shader_names->turbulence_noise_speed, turbulence_noise_speed);
|
|
}
|
|
}
|
|
|
|
|
|
-Vector3 ParticlesMaterial::get_turbulence_noise_speed() const {
|
|
|
|
|
|
+Vector3 ParticleProcessMaterial::get_turbulence_noise_speed() const {
|
|
return turbulence_noise_speed;
|
|
return turbulence_noise_speed;
|
|
}
|
|
}
|
|
|
|
|
|
-void ParticlesMaterial::set_gravity(const Vector3 &p_gravity) {
|
|
|
|
|
|
+void ParticleProcessMaterial::set_gravity(const Vector3 &p_gravity) {
|
|
gravity = p_gravity;
|
|
gravity = p_gravity;
|
|
Vector3 gset = gravity;
|
|
Vector3 gset = gravity;
|
|
if (gset == Vector3()) {
|
|
if (gset == Vector3()) {
|
|
@@ -1382,25 +1382,25 @@ void ParticlesMaterial::set_gravity(const Vector3 &p_gravity) {
|
|
RenderingServer::get_singleton()->material_set_param(_get_material(), shader_names->gravity, gset);
|
|
RenderingServer::get_singleton()->material_set_param(_get_material(), shader_names->gravity, gset);
|
|
}
|
|
}
|
|
|
|
|
|
-Vector3 ParticlesMaterial::get_gravity() const {
|
|
|
|
|
|
+Vector3 ParticleProcessMaterial::get_gravity() const {
|
|
return gravity;
|
|
return gravity;
|
|
}
|
|
}
|
|
|
|
|
|
-void ParticlesMaterial::set_lifetime_randomness(double p_lifetime) {
|
|
|
|
|
|
+void ParticleProcessMaterial::set_lifetime_randomness(double p_lifetime) {
|
|
lifetime_randomness = p_lifetime;
|
|
lifetime_randomness = p_lifetime;
|
|
RenderingServer::get_singleton()->material_set_param(_get_material(), shader_names->lifetime_randomness, lifetime_randomness);
|
|
RenderingServer::get_singleton()->material_set_param(_get_material(), shader_names->lifetime_randomness, lifetime_randomness);
|
|
}
|
|
}
|
|
|
|
|
|
-double ParticlesMaterial::get_lifetime_randomness() const {
|
|
|
|
|
|
+double ParticleProcessMaterial::get_lifetime_randomness() const {
|
|
return lifetime_randomness;
|
|
return lifetime_randomness;
|
|
}
|
|
}
|
|
|
|
|
|
-RID ParticlesMaterial::get_shader_rid() const {
|
|
|
|
|
|
+RID ParticleProcessMaterial::get_shader_rid() const {
|
|
ERR_FAIL_COND_V(!shader_map.has(current_key), RID());
|
|
ERR_FAIL_COND_V(!shader_map.has(current_key), RID());
|
|
return shader_map[current_key].shader;
|
|
return shader_map[current_key].shader;
|
|
}
|
|
}
|
|
|
|
|
|
-void ParticlesMaterial::_validate_property(PropertyInfo &p_property) const {
|
|
|
|
|
|
+void ParticleProcessMaterial::_validate_property(PropertyInfo &p_property) const {
|
|
if (p_property.name == "emission_sphere_radius" && (emission_shape != EMISSION_SHAPE_SPHERE && emission_shape != EMISSION_SHAPE_SPHERE_SURFACE)) {
|
|
if (p_property.name == "emission_sphere_radius" && (emission_shape != EMISSION_SHAPE_SPHERE && emission_shape != EMISSION_SHAPE_SPHERE_SURFACE)) {
|
|
p_property.usage = PROPERTY_USAGE_NONE;
|
|
p_property.usage = PROPERTY_USAGE_NONE;
|
|
}
|
|
}
|
|
@@ -1460,203 +1460,203 @@ void ParticlesMaterial::_validate_property(PropertyInfo &p_property) const {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
-void ParticlesMaterial::set_sub_emitter_mode(SubEmitterMode p_sub_emitter_mode) {
|
|
|
|
|
|
+void ParticleProcessMaterial::set_sub_emitter_mode(SubEmitterMode p_sub_emitter_mode) {
|
|
sub_emitter_mode = p_sub_emitter_mode;
|
|
sub_emitter_mode = p_sub_emitter_mode;
|
|
_queue_shader_change();
|
|
_queue_shader_change();
|
|
notify_property_list_changed();
|
|
notify_property_list_changed();
|
|
}
|
|
}
|
|
|
|
|
|
-ParticlesMaterial::SubEmitterMode ParticlesMaterial::get_sub_emitter_mode() const {
|
|
|
|
|
|
+ParticleProcessMaterial::SubEmitterMode ParticleProcessMaterial::get_sub_emitter_mode() const {
|
|
return sub_emitter_mode;
|
|
return sub_emitter_mode;
|
|
}
|
|
}
|
|
|
|
|
|
-void ParticlesMaterial::set_sub_emitter_frequency(double p_frequency) {
|
|
|
|
|
|
+void ParticleProcessMaterial::set_sub_emitter_frequency(double p_frequency) {
|
|
sub_emitter_frequency = p_frequency;
|
|
sub_emitter_frequency = p_frequency;
|
|
RenderingServer::get_singleton()->material_set_param(_get_material(), shader_names->sub_emitter_frequency, 1.0 / p_frequency); //pass delta instead of frequency, since its easier to compute
|
|
RenderingServer::get_singleton()->material_set_param(_get_material(), shader_names->sub_emitter_frequency, 1.0 / p_frequency); //pass delta instead of frequency, since its easier to compute
|
|
}
|
|
}
|
|
|
|
|
|
-double ParticlesMaterial::get_sub_emitter_frequency() const {
|
|
|
|
|
|
+double ParticleProcessMaterial::get_sub_emitter_frequency() const {
|
|
return sub_emitter_frequency;
|
|
return sub_emitter_frequency;
|
|
}
|
|
}
|
|
|
|
|
|
-void ParticlesMaterial::set_sub_emitter_amount_at_end(int p_amount) {
|
|
|
|
|
|
+void ParticleProcessMaterial::set_sub_emitter_amount_at_end(int p_amount) {
|
|
sub_emitter_amount_at_end = p_amount;
|
|
sub_emitter_amount_at_end = p_amount;
|
|
RenderingServer::get_singleton()->material_set_param(_get_material(), shader_names->sub_emitter_amount_at_end, p_amount);
|
|
RenderingServer::get_singleton()->material_set_param(_get_material(), shader_names->sub_emitter_amount_at_end, p_amount);
|
|
}
|
|
}
|
|
|
|
|
|
-int ParticlesMaterial::get_sub_emitter_amount_at_end() const {
|
|
|
|
|
|
+int ParticleProcessMaterial::get_sub_emitter_amount_at_end() const {
|
|
return sub_emitter_amount_at_end;
|
|
return sub_emitter_amount_at_end;
|
|
}
|
|
}
|
|
|
|
|
|
-void ParticlesMaterial::set_sub_emitter_keep_velocity(bool p_enable) {
|
|
|
|
|
|
+void ParticleProcessMaterial::set_sub_emitter_keep_velocity(bool p_enable) {
|
|
sub_emitter_keep_velocity = p_enable;
|
|
sub_emitter_keep_velocity = p_enable;
|
|
RenderingServer::get_singleton()->material_set_param(_get_material(), shader_names->sub_emitter_keep_velocity, p_enable);
|
|
RenderingServer::get_singleton()->material_set_param(_get_material(), shader_names->sub_emitter_keep_velocity, p_enable);
|
|
}
|
|
}
|
|
-bool ParticlesMaterial::get_sub_emitter_keep_velocity() const {
|
|
|
|
|
|
+bool ParticleProcessMaterial::get_sub_emitter_keep_velocity() const {
|
|
return sub_emitter_keep_velocity;
|
|
return sub_emitter_keep_velocity;
|
|
}
|
|
}
|
|
|
|
|
|
-void ParticlesMaterial::set_attractor_interaction_enabled(bool p_enable) {
|
|
|
|
|
|
+void ParticleProcessMaterial::set_attractor_interaction_enabled(bool p_enable) {
|
|
attractor_interaction_enabled = p_enable;
|
|
attractor_interaction_enabled = p_enable;
|
|
_queue_shader_change();
|
|
_queue_shader_change();
|
|
}
|
|
}
|
|
|
|
|
|
-bool ParticlesMaterial::is_attractor_interaction_enabled() const {
|
|
|
|
|
|
+bool ParticleProcessMaterial::is_attractor_interaction_enabled() const {
|
|
return attractor_interaction_enabled;
|
|
return attractor_interaction_enabled;
|
|
}
|
|
}
|
|
|
|
|
|
-void ParticlesMaterial::set_collision_mode(CollisionMode p_collision_mode) {
|
|
|
|
|
|
+void ParticleProcessMaterial::set_collision_mode(CollisionMode p_collision_mode) {
|
|
collision_mode = p_collision_mode;
|
|
collision_mode = p_collision_mode;
|
|
_queue_shader_change();
|
|
_queue_shader_change();
|
|
notify_property_list_changed();
|
|
notify_property_list_changed();
|
|
}
|
|
}
|
|
|
|
|
|
-ParticlesMaterial::CollisionMode ParticlesMaterial::get_collision_mode() const {
|
|
|
|
|
|
+ParticleProcessMaterial::CollisionMode ParticleProcessMaterial::get_collision_mode() const {
|
|
return collision_mode;
|
|
return collision_mode;
|
|
}
|
|
}
|
|
|
|
|
|
-void ParticlesMaterial::set_collision_use_scale(bool p_scale) {
|
|
|
|
|
|
+void ParticleProcessMaterial::set_collision_use_scale(bool p_scale) {
|
|
collision_scale = p_scale;
|
|
collision_scale = p_scale;
|
|
_queue_shader_change();
|
|
_queue_shader_change();
|
|
}
|
|
}
|
|
|
|
|
|
-bool ParticlesMaterial::is_collision_using_scale() const {
|
|
|
|
|
|
+bool ParticleProcessMaterial::is_collision_using_scale() const {
|
|
return collision_scale;
|
|
return collision_scale;
|
|
}
|
|
}
|
|
|
|
|
|
-void ParticlesMaterial::set_collision_friction(float p_friction) {
|
|
|
|
|
|
+void ParticleProcessMaterial::set_collision_friction(float p_friction) {
|
|
collision_friction = p_friction;
|
|
collision_friction = p_friction;
|
|
RenderingServer::get_singleton()->material_set_param(_get_material(), shader_names->collision_friction, p_friction);
|
|
RenderingServer::get_singleton()->material_set_param(_get_material(), shader_names->collision_friction, p_friction);
|
|
}
|
|
}
|
|
|
|
|
|
-float ParticlesMaterial::get_collision_friction() const {
|
|
|
|
|
|
+float ParticleProcessMaterial::get_collision_friction() const {
|
|
return collision_friction;
|
|
return collision_friction;
|
|
}
|
|
}
|
|
|
|
|
|
-void ParticlesMaterial::set_collision_bounce(float p_bounce) {
|
|
|
|
|
|
+void ParticleProcessMaterial::set_collision_bounce(float p_bounce) {
|
|
collision_bounce = p_bounce;
|
|
collision_bounce = p_bounce;
|
|
RenderingServer::get_singleton()->material_set_param(_get_material(), shader_names->collision_bounce, p_bounce);
|
|
RenderingServer::get_singleton()->material_set_param(_get_material(), shader_names->collision_bounce, p_bounce);
|
|
}
|
|
}
|
|
|
|
|
|
-float ParticlesMaterial::get_collision_bounce() const {
|
|
|
|
|
|
+float ParticleProcessMaterial::get_collision_bounce() const {
|
|
return collision_bounce;
|
|
return collision_bounce;
|
|
}
|
|
}
|
|
|
|
|
|
-Shader::Mode ParticlesMaterial::get_shader_mode() const {
|
|
|
|
|
|
+Shader::Mode ParticleProcessMaterial::get_shader_mode() const {
|
|
return Shader::MODE_PARTICLES;
|
|
return Shader::MODE_PARTICLES;
|
|
}
|
|
}
|
|
|
|
|
|
-void ParticlesMaterial::_bind_methods() {
|
|
|
|
- ClassDB::bind_method(D_METHOD("set_direction", "degrees"), &ParticlesMaterial::set_direction);
|
|
|
|
- ClassDB::bind_method(D_METHOD("get_direction"), &ParticlesMaterial::get_direction);
|
|
|
|
|
|
+void ParticleProcessMaterial::_bind_methods() {
|
|
|
|
+ ClassDB::bind_method(D_METHOD("set_direction", "degrees"), &ParticleProcessMaterial::set_direction);
|
|
|
|
+ ClassDB::bind_method(D_METHOD("get_direction"), &ParticleProcessMaterial::get_direction);
|
|
|
|
|
|
- ClassDB::bind_method(D_METHOD("set_spread", "degrees"), &ParticlesMaterial::set_spread);
|
|
|
|
- ClassDB::bind_method(D_METHOD("get_spread"), &ParticlesMaterial::get_spread);
|
|
|
|
|
|
+ ClassDB::bind_method(D_METHOD("set_spread", "degrees"), &ParticleProcessMaterial::set_spread);
|
|
|
|
+ ClassDB::bind_method(D_METHOD("get_spread"), &ParticleProcessMaterial::get_spread);
|
|
|
|
|
|
- ClassDB::bind_method(D_METHOD("set_flatness", "amount"), &ParticlesMaterial::set_flatness);
|
|
|
|
- ClassDB::bind_method(D_METHOD("get_flatness"), &ParticlesMaterial::get_flatness);
|
|
|
|
|
|
+ ClassDB::bind_method(D_METHOD("set_flatness", "amount"), &ParticleProcessMaterial::set_flatness);
|
|
|
|
+ ClassDB::bind_method(D_METHOD("get_flatness"), &ParticleProcessMaterial::get_flatness);
|
|
|
|
|
|
- ClassDB::bind_method(D_METHOD("set_param_min", "param", "value"), &ParticlesMaterial::set_param_min);
|
|
|
|
- ClassDB::bind_method(D_METHOD("get_param_min", "param"), &ParticlesMaterial::get_param_min);
|
|
|
|
|
|
+ ClassDB::bind_method(D_METHOD("set_param_min", "param", "value"), &ParticleProcessMaterial::set_param_min);
|
|
|
|
+ ClassDB::bind_method(D_METHOD("get_param_min", "param"), &ParticleProcessMaterial::get_param_min);
|
|
|
|
|
|
- ClassDB::bind_method(D_METHOD("set_param_max", "param", "value"), &ParticlesMaterial::set_param_max);
|
|
|
|
- ClassDB::bind_method(D_METHOD("get_param_max", "param"), &ParticlesMaterial::get_param_max);
|
|
|
|
|
|
+ ClassDB::bind_method(D_METHOD("set_param_max", "param", "value"), &ParticleProcessMaterial::set_param_max);
|
|
|
|
+ ClassDB::bind_method(D_METHOD("get_param_max", "param"), &ParticleProcessMaterial::get_param_max);
|
|
|
|
|
|
- ClassDB::bind_method(D_METHOD("set_param_texture", "param", "texture"), &ParticlesMaterial::set_param_texture);
|
|
|
|
- ClassDB::bind_method(D_METHOD("get_param_texture", "param"), &ParticlesMaterial::get_param_texture);
|
|
|
|
|
|
+ ClassDB::bind_method(D_METHOD("set_param_texture", "param", "texture"), &ParticleProcessMaterial::set_param_texture);
|
|
|
|
+ ClassDB::bind_method(D_METHOD("get_param_texture", "param"), &ParticleProcessMaterial::get_param_texture);
|
|
|
|
|
|
- ClassDB::bind_method(D_METHOD("set_color", "color"), &ParticlesMaterial::set_color);
|
|
|
|
- ClassDB::bind_method(D_METHOD("get_color"), &ParticlesMaterial::get_color);
|
|
|
|
|
|
+ ClassDB::bind_method(D_METHOD("set_color", "color"), &ParticleProcessMaterial::set_color);
|
|
|
|
+ ClassDB::bind_method(D_METHOD("get_color"), &ParticleProcessMaterial::get_color);
|
|
|
|
|
|
- ClassDB::bind_method(D_METHOD("set_color_ramp", "ramp"), &ParticlesMaterial::set_color_ramp);
|
|
|
|
- ClassDB::bind_method(D_METHOD("get_color_ramp"), &ParticlesMaterial::get_color_ramp);
|
|
|
|
|
|
+ ClassDB::bind_method(D_METHOD("set_color_ramp", "ramp"), &ParticleProcessMaterial::set_color_ramp);
|
|
|
|
+ ClassDB::bind_method(D_METHOD("get_color_ramp"), &ParticleProcessMaterial::get_color_ramp);
|
|
|
|
|
|
- ClassDB::bind_method(D_METHOD("set_color_initial_ramp", "ramp"), &ParticlesMaterial::set_color_initial_ramp);
|
|
|
|
- ClassDB::bind_method(D_METHOD("get_color_initial_ramp"), &ParticlesMaterial::get_color_initial_ramp);
|
|
|
|
|
|
+ ClassDB::bind_method(D_METHOD("set_color_initial_ramp", "ramp"), &ParticleProcessMaterial::set_color_initial_ramp);
|
|
|
|
+ ClassDB::bind_method(D_METHOD("get_color_initial_ramp"), &ParticleProcessMaterial::get_color_initial_ramp);
|
|
|
|
|
|
- ClassDB::bind_method(D_METHOD("set_particle_flag", "particle_flag", "enable"), &ParticlesMaterial::set_particle_flag);
|
|
|
|
- ClassDB::bind_method(D_METHOD("get_particle_flag", "particle_flag"), &ParticlesMaterial::get_particle_flag);
|
|
|
|
|
|
+ ClassDB::bind_method(D_METHOD("set_particle_flag", "particle_flag", "enable"), &ParticleProcessMaterial::set_particle_flag);
|
|
|
|
+ ClassDB::bind_method(D_METHOD("get_particle_flag", "particle_flag"), &ParticleProcessMaterial::get_particle_flag);
|
|
|
|
|
|
- ClassDB::bind_method(D_METHOD("set_emission_shape", "shape"), &ParticlesMaterial::set_emission_shape);
|
|
|
|
- ClassDB::bind_method(D_METHOD("get_emission_shape"), &ParticlesMaterial::get_emission_shape);
|
|
|
|
|
|
+ ClassDB::bind_method(D_METHOD("set_emission_shape", "shape"), &ParticleProcessMaterial::set_emission_shape);
|
|
|
|
+ ClassDB::bind_method(D_METHOD("get_emission_shape"), &ParticleProcessMaterial::get_emission_shape);
|
|
|
|
|
|
- ClassDB::bind_method(D_METHOD("set_emission_sphere_radius", "radius"), &ParticlesMaterial::set_emission_sphere_radius);
|
|
|
|
- ClassDB::bind_method(D_METHOD("get_emission_sphere_radius"), &ParticlesMaterial::get_emission_sphere_radius);
|
|
|
|
|
|
+ ClassDB::bind_method(D_METHOD("set_emission_sphere_radius", "radius"), &ParticleProcessMaterial::set_emission_sphere_radius);
|
|
|
|
+ ClassDB::bind_method(D_METHOD("get_emission_sphere_radius"), &ParticleProcessMaterial::get_emission_sphere_radius);
|
|
|
|
|
|
- ClassDB::bind_method(D_METHOD("set_emission_box_extents", "extents"), &ParticlesMaterial::set_emission_box_extents);
|
|
|
|
- ClassDB::bind_method(D_METHOD("get_emission_box_extents"), &ParticlesMaterial::get_emission_box_extents);
|
|
|
|
|
|
+ ClassDB::bind_method(D_METHOD("set_emission_box_extents", "extents"), &ParticleProcessMaterial::set_emission_box_extents);
|
|
|
|
+ ClassDB::bind_method(D_METHOD("get_emission_box_extents"), &ParticleProcessMaterial::get_emission_box_extents);
|
|
|
|
|
|
- ClassDB::bind_method(D_METHOD("set_emission_point_texture", "texture"), &ParticlesMaterial::set_emission_point_texture);
|
|
|
|
- ClassDB::bind_method(D_METHOD("get_emission_point_texture"), &ParticlesMaterial::get_emission_point_texture);
|
|
|
|
|
|
+ ClassDB::bind_method(D_METHOD("set_emission_point_texture", "texture"), &ParticleProcessMaterial::set_emission_point_texture);
|
|
|
|
+ ClassDB::bind_method(D_METHOD("get_emission_point_texture"), &ParticleProcessMaterial::get_emission_point_texture);
|
|
|
|
|
|
- ClassDB::bind_method(D_METHOD("set_emission_normal_texture", "texture"), &ParticlesMaterial::set_emission_normal_texture);
|
|
|
|
- ClassDB::bind_method(D_METHOD("get_emission_normal_texture"), &ParticlesMaterial::get_emission_normal_texture);
|
|
|
|
|
|
+ ClassDB::bind_method(D_METHOD("set_emission_normal_texture", "texture"), &ParticleProcessMaterial::set_emission_normal_texture);
|
|
|
|
+ ClassDB::bind_method(D_METHOD("get_emission_normal_texture"), &ParticleProcessMaterial::get_emission_normal_texture);
|
|
|
|
|
|
- ClassDB::bind_method(D_METHOD("set_emission_color_texture", "texture"), &ParticlesMaterial::set_emission_color_texture);
|
|
|
|
- ClassDB::bind_method(D_METHOD("get_emission_color_texture"), &ParticlesMaterial::get_emission_color_texture);
|
|
|
|
|
|
+ ClassDB::bind_method(D_METHOD("set_emission_color_texture", "texture"), &ParticleProcessMaterial::set_emission_color_texture);
|
|
|
|
+ ClassDB::bind_method(D_METHOD("get_emission_color_texture"), &ParticleProcessMaterial::get_emission_color_texture);
|
|
|
|
|
|
- ClassDB::bind_method(D_METHOD("set_emission_point_count", "point_count"), &ParticlesMaterial::set_emission_point_count);
|
|
|
|
- ClassDB::bind_method(D_METHOD("get_emission_point_count"), &ParticlesMaterial::get_emission_point_count);
|
|
|
|
|
|
+ ClassDB::bind_method(D_METHOD("set_emission_point_count", "point_count"), &ParticleProcessMaterial::set_emission_point_count);
|
|
|
|
+ ClassDB::bind_method(D_METHOD("get_emission_point_count"), &ParticleProcessMaterial::get_emission_point_count);
|
|
|
|
|
|
- ClassDB::bind_method(D_METHOD("set_emission_ring_axis", "axis"), &ParticlesMaterial::set_emission_ring_axis);
|
|
|
|
- ClassDB::bind_method(D_METHOD("get_emission_ring_axis"), &ParticlesMaterial::get_emission_ring_axis);
|
|
|
|
|
|
+ ClassDB::bind_method(D_METHOD("set_emission_ring_axis", "axis"), &ParticleProcessMaterial::set_emission_ring_axis);
|
|
|
|
+ ClassDB::bind_method(D_METHOD("get_emission_ring_axis"), &ParticleProcessMaterial::get_emission_ring_axis);
|
|
|
|
|
|
- ClassDB::bind_method(D_METHOD("set_emission_ring_height", "height"), &ParticlesMaterial::set_emission_ring_height);
|
|
|
|
- ClassDB::bind_method(D_METHOD("get_emission_ring_height"), &ParticlesMaterial::get_emission_ring_height);
|
|
|
|
|
|
+ ClassDB::bind_method(D_METHOD("set_emission_ring_height", "height"), &ParticleProcessMaterial::set_emission_ring_height);
|
|
|
|
+ ClassDB::bind_method(D_METHOD("get_emission_ring_height"), &ParticleProcessMaterial::get_emission_ring_height);
|
|
|
|
|
|
- ClassDB::bind_method(D_METHOD("set_emission_ring_radius", "radius"), &ParticlesMaterial::set_emission_ring_radius);
|
|
|
|
- ClassDB::bind_method(D_METHOD("get_emission_ring_radius"), &ParticlesMaterial::get_emission_ring_radius);
|
|
|
|
|
|
+ ClassDB::bind_method(D_METHOD("set_emission_ring_radius", "radius"), &ParticleProcessMaterial::set_emission_ring_radius);
|
|
|
|
+ ClassDB::bind_method(D_METHOD("get_emission_ring_radius"), &ParticleProcessMaterial::get_emission_ring_radius);
|
|
|
|
|
|
- ClassDB::bind_method(D_METHOD("set_emission_ring_inner_radius", "inner_radius"), &ParticlesMaterial::set_emission_ring_inner_radius);
|
|
|
|
- ClassDB::bind_method(D_METHOD("get_emission_ring_inner_radius"), &ParticlesMaterial::get_emission_ring_inner_radius);
|
|
|
|
|
|
+ ClassDB::bind_method(D_METHOD("set_emission_ring_inner_radius", "inner_radius"), &ParticleProcessMaterial::set_emission_ring_inner_radius);
|
|
|
|
+ ClassDB::bind_method(D_METHOD("get_emission_ring_inner_radius"), &ParticleProcessMaterial::get_emission_ring_inner_radius);
|
|
|
|
|
|
- ClassDB::bind_method(D_METHOD("get_turbulence_enabled"), &ParticlesMaterial::get_turbulence_enabled);
|
|
|
|
- ClassDB::bind_method(D_METHOD("set_turbulence_enabled", "turbulence_enabled"), &ParticlesMaterial::set_turbulence_enabled);
|
|
|
|
|
|
+ ClassDB::bind_method(D_METHOD("get_turbulence_enabled"), &ParticleProcessMaterial::get_turbulence_enabled);
|
|
|
|
+ ClassDB::bind_method(D_METHOD("set_turbulence_enabled", "turbulence_enabled"), &ParticleProcessMaterial::set_turbulence_enabled);
|
|
|
|
|
|
- ClassDB::bind_method(D_METHOD("get_turbulence_noise_strength"), &ParticlesMaterial::get_turbulence_noise_strength);
|
|
|
|
- ClassDB::bind_method(D_METHOD("set_turbulence_noise_strength", "turbulence_noise_strength"), &ParticlesMaterial::set_turbulence_noise_strength);
|
|
|
|
|
|
+ ClassDB::bind_method(D_METHOD("get_turbulence_noise_strength"), &ParticleProcessMaterial::get_turbulence_noise_strength);
|
|
|
|
+ ClassDB::bind_method(D_METHOD("set_turbulence_noise_strength", "turbulence_noise_strength"), &ParticleProcessMaterial::set_turbulence_noise_strength);
|
|
|
|
|
|
- ClassDB::bind_method(D_METHOD("get_turbulence_noise_scale"), &ParticlesMaterial::get_turbulence_noise_scale);
|
|
|
|
- ClassDB::bind_method(D_METHOD("set_turbulence_noise_scale", "turbulence_noise_scale"), &ParticlesMaterial::set_turbulence_noise_scale);
|
|
|
|
|
|
+ ClassDB::bind_method(D_METHOD("get_turbulence_noise_scale"), &ParticleProcessMaterial::get_turbulence_noise_scale);
|
|
|
|
+ ClassDB::bind_method(D_METHOD("set_turbulence_noise_scale", "turbulence_noise_scale"), &ParticleProcessMaterial::set_turbulence_noise_scale);
|
|
|
|
|
|
- ClassDB::bind_method(D_METHOD("get_turbulence_noise_speed_random"), &ParticlesMaterial::get_turbulence_noise_speed_random);
|
|
|
|
- ClassDB::bind_method(D_METHOD("set_turbulence_noise_speed_random", "turbulence_noise_speed_random"), &ParticlesMaterial::set_turbulence_noise_speed_random);
|
|
|
|
|
|
+ ClassDB::bind_method(D_METHOD("get_turbulence_noise_speed_random"), &ParticleProcessMaterial::get_turbulence_noise_speed_random);
|
|
|
|
+ ClassDB::bind_method(D_METHOD("set_turbulence_noise_speed_random", "turbulence_noise_speed_random"), &ParticleProcessMaterial::set_turbulence_noise_speed_random);
|
|
|
|
|
|
- ClassDB::bind_method(D_METHOD("get_turbulence_noise_speed"), &ParticlesMaterial::get_turbulence_noise_speed);
|
|
|
|
- ClassDB::bind_method(D_METHOD("set_turbulence_noise_speed", "turbulence_noise_speed"), &ParticlesMaterial::set_turbulence_noise_speed);
|
|
|
|
|
|
+ ClassDB::bind_method(D_METHOD("get_turbulence_noise_speed"), &ParticleProcessMaterial::get_turbulence_noise_speed);
|
|
|
|
+ ClassDB::bind_method(D_METHOD("set_turbulence_noise_speed", "turbulence_noise_speed"), &ParticleProcessMaterial::set_turbulence_noise_speed);
|
|
|
|
|
|
- ClassDB::bind_method(D_METHOD("get_gravity"), &ParticlesMaterial::get_gravity);
|
|
|
|
- ClassDB::bind_method(D_METHOD("set_gravity", "accel_vec"), &ParticlesMaterial::set_gravity);
|
|
|
|
|
|
+ ClassDB::bind_method(D_METHOD("get_gravity"), &ParticleProcessMaterial::get_gravity);
|
|
|
|
+ ClassDB::bind_method(D_METHOD("set_gravity", "accel_vec"), &ParticleProcessMaterial::set_gravity);
|
|
|
|
|
|
- ClassDB::bind_method(D_METHOD("set_lifetime_randomness", "randomness"), &ParticlesMaterial::set_lifetime_randomness);
|
|
|
|
- ClassDB::bind_method(D_METHOD("get_lifetime_randomness"), &ParticlesMaterial::get_lifetime_randomness);
|
|
|
|
|
|
+ ClassDB::bind_method(D_METHOD("set_lifetime_randomness", "randomness"), &ParticleProcessMaterial::set_lifetime_randomness);
|
|
|
|
+ ClassDB::bind_method(D_METHOD("get_lifetime_randomness"), &ParticleProcessMaterial::get_lifetime_randomness);
|
|
|
|
|
|
- ClassDB::bind_method(D_METHOD("get_sub_emitter_mode"), &ParticlesMaterial::get_sub_emitter_mode);
|
|
|
|
- ClassDB::bind_method(D_METHOD("set_sub_emitter_mode", "mode"), &ParticlesMaterial::set_sub_emitter_mode);
|
|
|
|
|
|
+ ClassDB::bind_method(D_METHOD("get_sub_emitter_mode"), &ParticleProcessMaterial::get_sub_emitter_mode);
|
|
|
|
+ ClassDB::bind_method(D_METHOD("set_sub_emitter_mode", "mode"), &ParticleProcessMaterial::set_sub_emitter_mode);
|
|
|
|
|
|
- ClassDB::bind_method(D_METHOD("get_sub_emitter_frequency"), &ParticlesMaterial::get_sub_emitter_frequency);
|
|
|
|
- ClassDB::bind_method(D_METHOD("set_sub_emitter_frequency", "hz"), &ParticlesMaterial::set_sub_emitter_frequency);
|
|
|
|
|
|
+ ClassDB::bind_method(D_METHOD("get_sub_emitter_frequency"), &ParticleProcessMaterial::get_sub_emitter_frequency);
|
|
|
|
+ ClassDB::bind_method(D_METHOD("set_sub_emitter_frequency", "hz"), &ParticleProcessMaterial::set_sub_emitter_frequency);
|
|
|
|
|
|
- ClassDB::bind_method(D_METHOD("get_sub_emitter_amount_at_end"), &ParticlesMaterial::get_sub_emitter_amount_at_end);
|
|
|
|
- ClassDB::bind_method(D_METHOD("set_sub_emitter_amount_at_end", "amount"), &ParticlesMaterial::set_sub_emitter_amount_at_end);
|
|
|
|
|
|
+ ClassDB::bind_method(D_METHOD("get_sub_emitter_amount_at_end"), &ParticleProcessMaterial::get_sub_emitter_amount_at_end);
|
|
|
|
+ ClassDB::bind_method(D_METHOD("set_sub_emitter_amount_at_end", "amount"), &ParticleProcessMaterial::set_sub_emitter_amount_at_end);
|
|
|
|
|
|
- ClassDB::bind_method(D_METHOD("get_sub_emitter_keep_velocity"), &ParticlesMaterial::get_sub_emitter_keep_velocity);
|
|
|
|
- ClassDB::bind_method(D_METHOD("set_sub_emitter_keep_velocity", "enable"), &ParticlesMaterial::set_sub_emitter_keep_velocity);
|
|
|
|
|
|
+ ClassDB::bind_method(D_METHOD("get_sub_emitter_keep_velocity"), &ParticleProcessMaterial::get_sub_emitter_keep_velocity);
|
|
|
|
+ ClassDB::bind_method(D_METHOD("set_sub_emitter_keep_velocity", "enable"), &ParticleProcessMaterial::set_sub_emitter_keep_velocity);
|
|
|
|
|
|
- ClassDB::bind_method(D_METHOD("set_attractor_interaction_enabled", "enabled"), &ParticlesMaterial::set_attractor_interaction_enabled);
|
|
|
|
- ClassDB::bind_method(D_METHOD("is_attractor_interaction_enabled"), &ParticlesMaterial::is_attractor_interaction_enabled);
|
|
|
|
|
|
+ ClassDB::bind_method(D_METHOD("set_attractor_interaction_enabled", "enabled"), &ParticleProcessMaterial::set_attractor_interaction_enabled);
|
|
|
|
+ ClassDB::bind_method(D_METHOD("is_attractor_interaction_enabled"), &ParticleProcessMaterial::is_attractor_interaction_enabled);
|
|
|
|
|
|
- ClassDB::bind_method(D_METHOD("set_collision_mode", "mode"), &ParticlesMaterial::set_collision_mode);
|
|
|
|
- ClassDB::bind_method(D_METHOD("get_collision_mode"), &ParticlesMaterial::get_collision_mode);
|
|
|
|
|
|
+ ClassDB::bind_method(D_METHOD("set_collision_mode", "mode"), &ParticleProcessMaterial::set_collision_mode);
|
|
|
|
+ ClassDB::bind_method(D_METHOD("get_collision_mode"), &ParticleProcessMaterial::get_collision_mode);
|
|
|
|
|
|
- ClassDB::bind_method(D_METHOD("set_collision_use_scale", "radius"), &ParticlesMaterial::set_collision_use_scale);
|
|
|
|
- ClassDB::bind_method(D_METHOD("is_collision_using_scale"), &ParticlesMaterial::is_collision_using_scale);
|
|
|
|
|
|
+ ClassDB::bind_method(D_METHOD("set_collision_use_scale", "radius"), &ParticleProcessMaterial::set_collision_use_scale);
|
|
|
|
+ ClassDB::bind_method(D_METHOD("is_collision_using_scale"), &ParticleProcessMaterial::is_collision_using_scale);
|
|
|
|
|
|
- ClassDB::bind_method(D_METHOD("set_collision_friction", "friction"), &ParticlesMaterial::set_collision_friction);
|
|
|
|
- ClassDB::bind_method(D_METHOD("get_collision_friction"), &ParticlesMaterial::get_collision_friction);
|
|
|
|
|
|
+ ClassDB::bind_method(D_METHOD("set_collision_friction", "friction"), &ParticleProcessMaterial::set_collision_friction);
|
|
|
|
+ ClassDB::bind_method(D_METHOD("get_collision_friction"), &ParticleProcessMaterial::get_collision_friction);
|
|
|
|
|
|
- ClassDB::bind_method(D_METHOD("set_collision_bounce", "bounce"), &ParticlesMaterial::set_collision_bounce);
|
|
|
|
- ClassDB::bind_method(D_METHOD("get_collision_bounce"), &ParticlesMaterial::get_collision_bounce);
|
|
|
|
|
|
+ ClassDB::bind_method(D_METHOD("set_collision_bounce", "bounce"), &ParticleProcessMaterial::set_collision_bounce);
|
|
|
|
+ ClassDB::bind_method(D_METHOD("get_collision_bounce"), &ParticleProcessMaterial::get_collision_bounce);
|
|
|
|
|
|
ADD_GROUP("Time", "");
|
|
ADD_GROUP("Time", "");
|
|
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "lifetime_randomness", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_lifetime_randomness", "get_lifetime_randomness");
|
|
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "lifetime_randomness", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_lifetime_randomness", "get_lifetime_randomness");
|
|
@@ -1806,7 +1806,7 @@ void ParticlesMaterial::_bind_methods() {
|
|
BIND_ENUM_CONSTANT(COLLISION_MAX);
|
|
BIND_ENUM_CONSTANT(COLLISION_MAX);
|
|
}
|
|
}
|
|
|
|
|
|
-ParticlesMaterial::ParticlesMaterial() :
|
|
|
|
|
|
+ParticleProcessMaterial::ParticleProcessMaterial() :
|
|
element(this) {
|
|
element(this) {
|
|
set_direction(Vector3(1, 0, 0));
|
|
set_direction(Vector3(1, 0, 0));
|
|
set_spread(45);
|
|
set_spread(45);
|
|
@@ -1879,7 +1879,7 @@ ParticlesMaterial::ParticlesMaterial() :
|
|
_queue_shader_change();
|
|
_queue_shader_change();
|
|
}
|
|
}
|
|
|
|
|
|
-ParticlesMaterial::~ParticlesMaterial() {
|
|
|
|
|
|
+ParticleProcessMaterial::~ParticleProcessMaterial() {
|
|
MutexLock lock(material_mutex);
|
|
MutexLock lock(material_mutex);
|
|
|
|
|
|
if (shader_map.has(current_key)) {
|
|
if (shader_map.has(current_key)) {
|