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 block volumetric fog #1755

Closed
Darkinggq opened this issue Nov 1, 2020 · 19 comments
Closed

Add block volumetric fog #1755

Darkinggq opened this issue Nov 1, 2020 · 19 comments

Comments

@Darkinggq
Copy link

Describe the project you are working on:
Godot 4 experiment for demo

Describe the problem or limitation you are having in your project:
i only do grid modeling the result looks sad and not good volumetric fog

video -> https://youtu.be/UctZ4BThrqQ

image
the problem of grid modeling is still visible it is impossible to block the fog and it is not convenient through Add Node -> MeshInstance3D -> PlaneMesh

image

down without MeshInstance 3D looks awful still visible
image

only need to block volumetric fog without shadow , UE4 is already there too

Is there a reason why this should be core and not an add-on in the asset library?:
i thought that @reduz seems to have forgotten not added block volumetric fog :)

@SIsilicon
Copy link

SIsilicon commented Nov 2, 2020

This is most likely caused by a low, or lack of shadow bias. My Volumetrics plugin has the same problem.
It should be fixable by adding a volume shadow bias control or something; I don't know. I've never used Godot 4.0 before, let alone its volumetric feature. Although my plugin does work similar to what they have from what I can see.

@Calinou
Copy link
Member

Calinou commented Nov 2, 2020

As a workaround, try making your walls thicker when possible (and make sure they're always solid, with an opaque material on both sides).

@Darkinggq
Copy link
Author

As a workaround, try making your walls thicker when possible (and make sure they're always solid, with an opaque material on both sides).

I'm not sure now checking UE4 volumetric fog test result
video -> https://youtu.be/qrAJDvhInZU the walls is all right

volumetric fog the result is not clear I'm experimenting now others demo for godot 4 👍

@reduz
Copy link
Member

reduz commented Nov 3, 2020

The one in Unreal is a different type of algorithm (extrusion based), which has different kinds of tradeoffs to the one in Godot. IMO the one in Godot looks more realistic, can read from GI, supports all light types and is more physically correct, but has less resolution (which is also technically more correct because of scattering). I want to add temporal supersampling to it to increase the quality, but you will always have the problem of leaks if you specify too much fog fade in the light settings. You need to reduce this value to eliminate the leaks and ensure walls have some thickness.

In any case, the fog effect is not complete yet, so wait closer to the 4.0 release.

@reduz
Copy link
Member

reduz commented Nov 3, 2020

In any case, you will have to wait until there is some documentation written to understand how to use it and work around those use cases.

@reduz
Copy link
Member

reduz commented Nov 3, 2020

Let me clarify a bit more so its more obvious. The one you are using in Unreal may look nice but its physically (and geometrically) incorrect. Look at this frame as an example:

image

The volumetric should follow the path of the light, and here they are incorrect, it should look like this:

image

@SIsilicon
Copy link

SIsilicon commented Nov 3, 2020

I'm not sure now checking UE4 volumetric fog test result
video -> https://youtu.be/qrAJDvhInZU the walls is all right

volumetric fog the result is not clear I'm experimenting now others demo for godot 4 👍

I just watched the video. Is that really volumetric fog? It looks more like a god rays post processing effect.

@reduz
Copy link
Member

reduz commented Nov 3, 2020

@SIsilicon it looks like either extrusion based fog, or screen space volumetric fog, neither of which are physically conserving. But it also seems kinda broken so it might be screen space.

@SIsilicon
Copy link

@reduz Huh. I never heard of extrusion based fog before; when I look it up, I don't get any meaningful results either. :/

@Darkinggq
Copy link
Author

Darkinggq commented Nov 3, 2020

@reduz @Calinou I have already done a demo project took an asset from UE4 the wall size is 0.125m result below screenshot

2020-11-03_09-59
2020-11-03_22-08
2020-11-03_22-13

wall size ok reason volumetric fog visible wall bypasses sad :)

project file download 3.5gb

@Darkinggq
Copy link
Author

wall 0.125m not enough we think how big the size of the wall is not comfortable

if this topic closes but users will be in trouble 4.0 alpha/beta will be released soon there will be problems the wall thinks that the problem is volumetric fog

@SIsilicon
Copy link

SIsilicon commented Nov 3, 2020

I still think a sort of shadow bias could be implemented to reduce this artifact.
Like push the shadow samples one froxel (frustum voxel) away from, or towards the camera; even have it configurable.

@reduz
Copy link
Member

reduz commented Nov 4, 2020

@Madaraz1024 check the fog fade property in the directional light, you can change it to adjust this biasing. The problem is that if you make it too small you will get banding. This is what I need to work on next by implementing temporal reprojection to eliminate it. You can compensate this banding now by changing the shadow filter or by adding fog filtering in the project settings, but it wont be truly solved until I get TR.

@Darkinggq
Copy link
Author

one modeling sponza is good volumetric fog the only problem is grid models the ceilings is still bypassed. https://youtu.be/4NBHcEhit34

@reduz
Copy link
Member

reduz commented Nov 4, 2020

@Madaraz1024 check my message above on how to adjust bias (fog fade per light). For grid interiors you always need some form of thickness if you use directional lights, else shadowmapping, or even SDFGI will leak light. Its the same with most engines because these techniques are approximate. Only pure raytracing lets you avoid leaks.

@Darkinggq
Copy link
Author

two copy meshs copes well with volumetric fog

2020-11-04_20-35
2020-11-04_20-36

result great 👍 but not convenient copy meshs wall need thickness not all assets designer modeling the standard always short size accurate, users will submit issues volumetric fog on github alpha 1+ further, etc.
unknown

@reduz
Copy link
Member

reduz commented Feb 6, 2021

I think most problems in this issue are solved by #45765 so please test again after merged.

@Darkinggq
Copy link
Author

@reduz
godot df9c98e, the wall is ok but the problem is the ceiling https://youtu.be/Vw8v_x2EtNo

I added meshinstance the name block_vfog is good but nevertheless the mesh material is visible white needs invisibility example similar MeshInstance > Geometry > Cast Shadow > Shadow Only

can add MeshInstance > Geometry > Cast Shadow > Volumetric Fog Only

out

I think enough volumetric fog is great :)

@Calinou
Copy link
Member

Calinou commented Dec 25, 2021

Closing, as the new FogVolume nodes in master allow you to constrain fog to specific areas (by using a positive density value) and exclude fog in specific areas (by using a negative density value). You can use either an additive or subtractive approach, or a mix of both depending on your level design.

@Calinou Calinou closed this as completed Dec 25, 2021
@Calinou Calinou added this to the 4.0 milestone Dec 25, 2021
@Calinou Calinou removed the archived label Dec 25, 2021
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

4 participants