diff options
author | clayjohn <claynjohn@gmail.com> | 2023-04-12 11:35:25 -0700 |
---|---|---|
committer | Yuri Sizov <yuris@humnom.net> | 2023-04-24 17:01:37 +0200 |
commit | 2c773e12b8122edd58a32c67febeb470434f89dd (patch) | |
tree | 7efc842615d0a020f15cbd69b608a5f050db0093 /scene/resources | |
parent | d31002cfbee5f33c335c329d24be8d82fb04bcc5 (diff) |
Use angle_rand to calculate base_angle in particles process material
(cherry picked from commit 821917ba9f30b036ef7f43664db3f09d33f59109)
Diffstat (limited to 'scene/resources')
-rw-r--r-- | scene/resources/particle_process_material.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/scene/resources/particle_process_material.cpp b/scene/resources/particle_process_material.cpp index 7ae154ea1d..41edbcb726 100644 --- a/scene/resources/particle_process_material.cpp +++ b/scene/resources/particle_process_material.cpp @@ -419,7 +419,7 @@ void ParticleProcessMaterial::_update_shader() { if (tex_parameters[PARAM_ANGLE].is_valid()) { code += " float tex_angle = textureLod(angle_texture, vec2(0.0, 0.0), 0.0).r;\n"; } else { - code += " float tex_angle = 0.0;\n"; + code += " float tex_angle = 1.0;\n"; } if (tex_parameters[PARAM_ANIM_OFFSET].is_valid()) { @@ -737,7 +737,7 @@ void ParticleProcessMaterial::_update_shader() { code += " VELOCITY = normalize(VELOCITY) * v;\n"; code += " }\n"; code += " }\n"; - code += " float base_angle = (tex_angle) * mix(initial_angle_min, initial_angle_max, rand_from_seed(alt_seed));\n"; + code += " float base_angle = (tex_angle) * mix(initial_angle_min, initial_angle_max, angle_rand);\n"; code += " base_angle += CUSTOM.y * LIFETIME * (tex_angular_velocity) * mix(angular_velocity_min,angular_velocity_max, rand_from_seed(alt_seed));\n"; code += " CUSTOM.x = base_angle * degree_to_rad;\n"; // angle code += " CUSTOM.z = (tex_anim_offset) * mix(anim_offset_min, anim_offset_max, rand_from_seed(alt_seed)) + tv * tex_anim_speed * mix(anim_speed_min, anim_speed_max, rand_from_seed(alt_seed));\n"; // angle |