You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-11 13:10:58 +00:00
Merge pull request #85189 from QbieShay/qbe/fix-emission-at-end
Correctly emit sub-emitter's emission at the end
This commit is contained in:
@@ -1136,9 +1136,9 @@ void ParticleProcessMaterial::_update_shader() {
|
|||||||
code += " if (COLLIDED) emit_count = sub_emitter_amount_at_collision;\n";
|
code += " if (COLLIDED) emit_count = sub_emitter_amount_at_collision;\n";
|
||||||
} break;
|
} break;
|
||||||
case SUB_EMITTER_AT_END: {
|
case SUB_EMITTER_AT_END: {
|
||||||
code += " float unit_delta = DELTA/LIFETIME;\n";
|
code += " if ((CUSTOM.y / CUSTOM.w * LIFETIME) > (LIFETIME - DELTA)) {\n";
|
||||||
code += " float end_time = CUSTOM.w * 0.95;\n"; // if we do at the end we might miss it, as it can just get deactivated by emitter
|
code += " emit_count = sub_emitter_amount_at_end;\n";
|
||||||
code += " if (CUSTOM.y < end_time && (CUSTOM.y + unit_delta) >= end_time) emit_count = sub_emitter_amount_at_end;\n";
|
code += " }\n";
|
||||||
} break;
|
} break;
|
||||||
default: {
|
default: {
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user