feat: modules moved and engine moved to submodule
This commit is contained in:
parent
dfb5e645cd
commit
c33d2130cc
5136 changed files with 225275 additions and 64485 deletions
|
|
@ -172,7 +172,7 @@ void ParticleProcessMaterial::_update_shader() {
|
|||
// No pre-existing shader, create one.
|
||||
|
||||
// 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 ParticleProcessMaterial.\n\n";
|
||||
String code = "// NOTE: Shader automatically converted from " GODOT_VERSION_NAME " " GODOT_VERSION_FULL_CONFIG "'s ParticleProcessMaterial.\n\n";
|
||||
|
||||
code += "shader_type particles;\n";
|
||||
code += "render_mode disable_velocity;\n";
|
||||
|
|
@ -1034,7 +1034,7 @@ void ParticleProcessMaterial::_update_shader() {
|
|||
code += " {\n";
|
||||
}
|
||||
code += " float vel_mag = length(VELOCITY);\n";
|
||||
code += " float vel_infl = clamp(dynamic_params.turb_influence * turbulence_influence, 0.0, 1.0);\n";
|
||||
code += " float vel_infl = clamp(dynamic_params.turb_influence * turbulence_influence, 0.0, 1.0) * (DELTA <= 0.0 ? 0.0 : 1.0);\n";
|
||||
code += " VELOCITY = mix(VELOCITY, normalize(noise_direction) * vel_mag * (1.0 + (1.0 - vel_infl) * 0.2), vel_infl);\n";
|
||||
code += " vel_mag = length(controlled_displacement);\n";
|
||||
code += " controlled_displacement = mix(controlled_displacement, normalize(noise_direction) * vel_mag * (1.0 + (1.0 - vel_infl) * 0.2), vel_infl);\n";
|
||||
|
|
@ -1121,9 +1121,16 @@ void ParticleProcessMaterial::_update_shader() {
|
|||
code += " params.scale *= texture(scale_over_velocity_curve, vec2(0.0)).rgb;\n";
|
||||
code += " }\n";
|
||||
}
|
||||
code += " TRANSFORM[0].xyz *= sign(params.scale.x) * max(abs(params.scale.x), 0.001);\n";
|
||||
code += " TRANSFORM[1].xyz *= sign(params.scale.y) * max(abs(params.scale.y), 0.001);\n";
|
||||
code += " TRANSFORM[2].xyz *= sign(params.scale.z) * max(abs(params.scale.z), 0.001);\n";
|
||||
// A scale of 0 results in no emission at some emission amounts (including 3 and 6).
|
||||
// `sign(scale)` is unsuitable, because sign(0) returns 0, nullifying the minimum value.
|
||||
// The following evaluates to 1 when scale is 0, falling back to a positive minimum value.
|
||||
code += " float scale_sign_x = params.scale.x < 0.0 ? -1.0 : 1.0;\n";
|
||||
code += " float scale_sign_y = params.scale.y < 0.0 ? -1.0 : 1.0;\n";
|
||||
code += " float scale_sign_z = params.scale.z < 0.0 ? -1.0 : 1.0;\n";
|
||||
code += " float scale_minimum = 0.001;\n";
|
||||
code += " TRANSFORM[0].xyz *= scale_sign_x * max(abs(params.scale.x), scale_minimum);\n";
|
||||
code += " TRANSFORM[1].xyz *= scale_sign_y * max(abs(params.scale.y), scale_minimum);\n";
|
||||
code += " TRANSFORM[2].xyz *= scale_sign_z * max(abs(params.scale.z), scale_minimum);\n";
|
||||
code += "\n";
|
||||
code += " CUSTOM.z = params.animation_offset + lifetime_percent * params.animation_speed;\n\n";
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue