-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
Added volumetric fog effect. #41213
Added volumetric fog effect. #41213
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I only had time for a brief review tonight, but it looks good so far! I noticed that fog isn't being applied over the sky, is there a setting for that that I missed, or did you forget to add it?
Its a lot of fun playing around with and the sdfgi!
Probably also a good time to review #36989
@@ -1077,6 +1109,9 @@ class RasterizerSceneRD : public RasterizerScene { | |||
|
|||
float sky_color[3]; | |||
float y_mult; | |||
|
|||
uint32_t store_ambient_texture; | |||
uint pad[3]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be uint32_t
, this breaks a few of the builds
servers/rendering/rasterizer.h
Outdated
@@ -88,6 +88,13 @@ class RasterizerScene { | |||
virtual void environment_glow_set_use_bicubic_upscale(bool p_enable) = 0; | |||
virtual void environment_set_fog(RID p_env, bool p_enable, float p_begin, float p_end, RID p_gradient_texture) = 0; | |||
|
|||
virtual void environment_set_volumetric_fog(RID p_env, bool p_enable, float p_density, const Color &p_light, float p_light_energy, float p_lenght, float p_detail_spread, float p_gi_inject, RS::EnvVolumetricFogShadowFilter p_shadow_filter) = 0; | |||
|
|||
virtual void environment_set_volumetric_fog_volume_size(int, int) = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess add names to the parameters
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small typo:
p_lenght instead of p_length
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be p_length instead of p_lenght
Vulkan only or GLES3 too? |
The GLES2/GLES3 code doesn't exist anymore after #41219 , so I guess Vulkan only for now? @Zireael07 |
@LinuxUserGD: I know GLES2 doesn't exist currently, I was asking about whether the effect can be backported later to GLES3 as some of the graphical improvements are Vulkan only (and a lower-end backend will eventually be needed since not everyone has Vulkan, especially on mobile devices) |
Add a customizable volumetric fog based on:
https://bartwronski.files.wordpress.com/2014/08/bwronski_volumetric_fog_siggraph2014.pdf
Lights can get added to the fog volume to create shafts, godrays, etc. The effect is more or less subtle (its worth investigating temporal reprojection of fog volumes to increase sharpness).
Additionally, both GI systems in Godot (SDFGI and GIProbe) can inject their light into the fog volume, for pretty volumetric GI.