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 controlling fog intensity with traditional start/end distance and curve in Godot 4 #4619

Closed
Tracked by #69579
jcarlosrc opened this issue Jun 3, 2022 · 14 comments

Comments

@jcarlosrc
Copy link

Describe the project you are working on

A 3d game.

Describe the problem or limitation you are having in your project

I am porting a project from Godot 3 to the new Godot 4 alphas. However, it seems like Godot 4 has a new environment system. The problem is that the density of fog can not be controlled with a curve like it used to be in Godot 3. Neither "fog" nor "volumetric fog" can be adjusted to get the old Godot 3 fog behavior. Now we just have a "density" option, which can not be controlled using the distance from the camera.

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

Add back the option to control fog density from camera with a value (curve) just like Godot 3. An even greater control would be welcome.

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

It should work at least just as Godot 3.

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

It is not an easy to implement feature.

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

It is a general purpose feature.

@Calinou
Copy link
Member

Calinou commented Jun 3, 2022

Related to #3429.

@Calinou Calinou changed the title Porting Godot 3.x fog behavior to Godot 4 Allow controlling fog intensity with traditional start/end distance and curve in Godot 4 Jun 3, 2022
@HybridEidolon
Copy link

This model for fog is useful for certain legacy applications of distance fog, like faux distance lighting used in PS1-era games and Doom. Not having the same control as the godot 3 fog system means projects relying on this behavior can't easily be ported to godot 4, especially if they rely on changing the Environment used on a Camera to adjust the faux "lighting".

I would like to see this come as an option for the Environment to switch between quadratic and exponential fog, something similar to how cameras have Physical and Practical properties modes. If not, some of the examples I'm thinking of would require a custom engine build to change the standard shaders and Environment.

@Nekuromu
Copy link

I noticed this missing functionality when porting some Godot 3.x PSX Shaders to Godot 4 Beta 11. This missing functionality of depth beginning and end has significantly reduced the capability of utilizing fog in a retro-esque way. For Example this is Godot 3.x:
image and this is Godot 4 with the best attempt to recreate using the limited fog settings/levers/switches. Godot 4:
image
Note: Notice the loss of the clear circle shape where the fog is completely clear in 3.x and the fog is omnipresent in 4 beta 10.

@EzraT
Copy link

EzraT commented Feb 13, 2023

I second this. I'm experiencing the same problem described by the OP, it's pretty much impossible to get the same look with Godot 4's new fog rendering as it stands right now. (RC1)
I understand this will probably not be added before Godot 4 reaches stable, but I would be very grateful if it could at least be considered for one of the point releases afterwards.

@clayjohn
Copy link
Member

@EzraT See godotengine/godot#66030

@RichardEllicott
Copy link

RichardEllicott commented Mar 12, 2023

Godot 4 is amazing, but i am also trying to sort my fog the new fog is horrible

and i wanted to point out, i did not use the curve in Godot 3! ..... however the fadeout for the old fog was such it would fade out to a nice horrizon that looked sorta rounded..... in order to hide my popup now, the fog is really does look like fog.... it's washing stuff out so close to me

i wasn't really making my scene look actually foggy... i was making a fadeout at 8km or so the way i saw it

this new fog suffers i guess from being more like fog, prob looks fine when we see no horizon, but we need video game fog that helps us hide the draw distance

@SkellySoft
Copy link

Literally just created an account on GitHub to ask to please have this feature bought back in future releases. Distance fog is ESSENTIAL in computer/video games to hide draw distance, unless you're looking to make huge sweeping scenes which many computers can't handle rendering. There are entire genres and graphical styles that won't be possible without this feature.

Don't get me wrong - volumetric fog looks great, but it's not an essential feature like draw distance fog.

@Zireael07
Copy link

Yep, I'm personally using fog to hide draw distance too

@Calinou
Copy link
Member

Calinou commented Mar 27, 2023

The feature is already approved, but the implementation needs to be reworked to match clayjohn's comment here: godotengine/godot#66030 (comment)

@vila4480
Copy link

I'm working with volumetric fog close to the ground on a top-down game (camera angle is aprox. -67º). The fog gets cuttoff at a certain distance, which means I'm only able to render volumetric fog to half my scene, making it useless.
I don't need it to hide the draw distance, but I can't have fog in just half of my scene either.
So it is the same problem, but a different scenario.

@Calinou
Copy link
Member

Calinou commented Feb 12, 2024

The fog gets cuttoff at a certain distance

Volumetric fog only covers a finite distance for technical reasons. You can change the distance it covers by adjusting the Volumetric Fog > Length property in Environment. Increasing this will reduce detail in volumetric fog, so you may have to change the Volumetric Fog Depth project setting to compensate (at the cost of performance).

@vila4480
Copy link

vila4480 commented Feb 12, 2024

The fog gets cuttoff at a certain distance

Volumetric fog only covers a finite distance for technical reasons. You can change the distance it covers by adjusting the Volumetric Fog > Length property in Environment. Increasing this will reduce detail in volumetric fog, so you may have to change the Volumetric Fog Depth project setting to compensate (at the cost of performance).

You're right!
I had missed this last project settings option entirely, and I feel like it could be mentioned as a tooltip somewhere. Thank you, I'll explore this further. I still think this may connect with the OP, but I may be able to work around the problem for now. Thanks

Edit: I understand that volumetric fog is new in Godot, but after trying it out and fixing the biggest issue which I mentioned before, I feel that there are too many other issues with my camera angle - I think I'll have to resort to particle systems instead. Thank you anyway.

@akien-mga
Copy link
Member

Implemented by godotengine/godot#84792.

@akien-mga akien-mga added this to the 4.3 milestone Feb 18, 2024
@jcarlosrc
Copy link
Author

Thanks!

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