Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow StandardMaterial3D Proximity Fade to fade surfaces when they are far away from other solid surfaces #3021

Open
Tracked by #56333
Calinou opened this issue Jul 20, 2021 · 0 comments

Comments

@Calinou
Copy link
Member

Calinou commented Jul 20, 2021

Describe the project you are working on

The Godot editor 🙂

Describe the problem or limitation you are having in your project

Not being able to create better-looking VFX with the built-in StandardMaterial3D.

Describe the feature / enhancement and how it helps to overcome the problem or limitation

StandardMaterial3D already offers a Proximity Fade feature, which is useful for things like soft particles or light flares.

What is being proposed here is the opposite of standard proximity fade. When Proximity Fade Far Distance is set to a value greater than 0.0, it will fade the material's alpha as it gets further away a solid material.

This can be used for:

  • Fading quads used as decals if there is no surface close to them (useful to prevent "flying" blob shadows).
    • This is especially important in 3.x, as there is no built-in decal support there. Decal add-ons are often said to have blocking limitations that prevent their use in production.
  • Welding/cutting torch effects (https://simonschreibt.de/gat/alien-vs-wolfenstein-cutting-torch/).
  • Area-of-effect and explosion VFX.

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

Modify BaseMaterial3D's generated shader to add a new proximity_fade_far_distance property.

At first, I considered using the same proximity_fade_distance property with a negative value, but this tends to be more confusing and gives you less control (since you can't use both "near" and "far" proximity fade at the same time that way).

If this enhancement will not be used often, can it be worked around with a few lines of script?

This can be worked around with a custom shader, but this means you will have to deal with a less convenient interface to modify the material. This is because a StandardMaterial3D to a custom ShaderMaterial gets rid of the inspector section folding and property hints.

Is there a reason why this should be core and not an add-on in the asset library?

See above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant