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

Added volumetric fog effect. #41213

Merged
merged 1 commit into from
Aug 13, 2020
Merged

Added volumetric fog effect. #41213

merged 1 commit into from
Aug 13, 2020

Conversation

reduz
Copy link
Member

@reduz reduz commented Aug 13, 2020

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.

image
image
image

Copy link
Member

@clayjohn clayjohn left a 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];
Copy link
Member

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

@@ -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;
Copy link
Member

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

Copy link
Contributor

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

Copy link

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

@reduz reduz merged commit d84b28b into godotengine:master Aug 13, 2020
@Zireael07
Copy link
Contributor

Vulkan only or GLES3 too?

@LinuxUserGD
Copy link
Contributor

The GLES2/GLES3 code doesn't exist anymore after #41219 , so I guess Vulkan only for now? @Zireael07

@Zireael07
Copy link
Contributor

@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)

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

Successfully merging this pull request may close these issues.

6 participants