godotengine / godot-proposals

Godot Improvement Proposals (GIPs)
MIT License
1.17k stars 98 forks source link

Transparency via AlphaColorCurve, but disabled "Set as Albedo" should give warning #10926

Open TheYellowArchitect opened 1 month ago

TheYellowArchitect commented 1 month ago

Describe the project you are working on

Topdown 3D Shooter, requiring smoke grenade.

Describe the problem or limitation you are having in your project

https://github.com/godotengine/godot/issues/97783

Synopsis: I create a GPUParticles3D with a quad mesh. Its material has transparency alpha, and its ParticleProcessMaterial has an alpha color curve. Transparency in Geometry Instance is set to 0 (opaque) but alpha color curve offers the transparency.

The problem is that I went through many choices, and the AlphaColorCurve's transparency didn't work at all, until I clicked the boolean flag choice in inspector: Vertex Color -> Use as Albedo (which doesn't hint to transparency at all)

Without the aid of that user, I would think it's an engine bug, and be unable to have transparency via alpha color curve.

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

There should be an editor warning if there is a scene running (or in the editor?) which has a GPUParticles3D with an alpha color curve at its ProcessMaterial + its material has transparency (Transparency -> Transparency -> Alpha), but has the DEFAULT value (false) at Vertex Color -> use as albedo

Could even automatically enable the flag use as albedo if it detects the above 2 transparent conditions (process material with alpha color curve, and material with transparency)

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

yes, knowledge of how gpu particles' transparency works. Or lucky to hit that flag under the folded menus.

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

It's an editor warning to aid users.

Calinou commented 1 month ago

This should also apply to the color and emission curve properties. Likewise, the scale properties should also check if the material has Billboard Keep Scale enabled (if billboarding is enabled on the material).

Last time I checked, it's difficult to base node configuration warnings on a subresource's property, since the subresource doesn't emit a signal when one of its properties is changed. This may have changed since I checked though.

cc @KoBeWi

KoBeWi commented 1 month ago

All Resources should emit changed signal when they change, so it's possible to connect to it and display warning. Alternatively, https://github.com/godotengine/godot/pull/90049 will allow Resource configuration warnings, so it will be possible without signals.