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

Add a volumetric cull mask to lights for volumetric fog (and implement an "additive fog" option for volumetric lighting) #1374

Closed
Calinou opened this issue Aug 15, 2020 · 2 comments · Fixed by godotengine/godot#63413

Comments

@Calinou
Copy link
Member

Calinou commented Aug 15, 2020

Note: This feature was discussed with reduz. It's probably good to implement if someone finds a way to do it.

Describe the project you are working on:

The Godot editor 🙂

Describe the problem or limitation you are having in your project:

With the newly-added volumetric fog effect, it's not possible to prevent individual lights from contributing to the volumetric fog's color.

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

A volumetric cull mask property could be added to prevent individual lights from contributing to the volumetric fog's color.

Alternatively, this can be done by adding a Volumetric Fog Energy property to Light3D. (It's probably better as it gives more control to the user, rather than an all-or-nothing solution.)

In addition, there should probably be a way to disable fog completely in areas not lit by anything (instead of having a black fog). This way, it can be used purely as a volumetric lighting solution, not adding any fog unless desired by the artist.

Describe how your proposal will work, with code, pseudocode, mockups, and/or diagrams:

There could be a Volumetric Cull Mask property mimicking Light's Cull Mask property. It would only affect volumetric fog. Direct and indirect lighting would be left unaffected by this mask.

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

No, as this is core renderer functionality.

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

This is core renderer functionality.

@SIsilicon
Copy link

SIsilicon commented Aug 15, 2020

Volumetrics has been added to 4.0? That's pretty neat! Now I don't have to worry about porting my volumetrics plugin. 😄

On a more related note, how will this work? Like have a cull mask in the volumetric fog settings? Then the mask will just cull away lights that aren't in the same layer.

@godotengine godotengine deleted a comment from Darkinggq Aug 16, 2020
@godotengine godotengine deleted a comment from Darkinggq Aug 16, 2020
@Calinou
Copy link
Member Author

Calinou commented Jul 9, 2021

I started work on this here: https://github.com/Calinou/godot/tree/volumetric-fog-add-per-light-energy

The "additive fog" part works great, but it needs per-light fog energy to be really useful. Unfortunately, I haven't got that part to work yet due to clustering artifacts being present ever since I added the volumetric_fog_energy property to Light3D.

For DirectionalLight3D, the default volumetric fog energy is too strong when used with additive fog. Make sure to set volumetric_fog_energy to a value between 0.01 and 0.05 to get a subtle "godrays" effect.

@YuriSizov YuriSizov moved this to In Discussion in Godot Proposal Metaverse Jun 29, 2022
@YuriSizov YuriSizov moved this from In Discussion to Ready for Implementation in Godot Proposal Metaverse Jun 29, 2022
@Calinou Calinou changed the title Add a volumetric cull mask to lights for volumetric fog Add a volumetric cull mask to lights for volumetric fog (and implement an "additive fog" option for volumetric lighting) Jul 16, 2022
Repository owner moved this from Ready for Implementation to Implemented in Godot Proposal Metaverse Aug 31, 2022
@akien-mga akien-mga added this to the 4.0 milestone Aug 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Implemented
Development

Successfully merging a pull request may close this issue.

4 participants