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

Density / Fog Integration #88

Open
markusmoenig opened this issue Aug 1, 2023 · 4 comments
Open

Density / Fog Integration #88

markusmoenig opened this issue Aug 1, 2023 · 4 comments

Comments

@markusmoenig
Copy link

Hi,

any plans to integrate volumetric fog / general density support in the tracer ? The new Aerolod beta from ephtracy has great looking terrain fog, would love to achieve something similar.

@knightcrawler25
Copy link
Owner

Hey,

Adding fog should be relatively straightforward as its just a homogeneous volume with some special handling for distant lights and maybe a better sampling technique to reduce noise.

I'll have a go at adding it once I get some free time :)

@markusmoenig
Copy link
Author

Great! But the fog would not be uniform but could be defined via a bounding box or something right ? That's how it looks with Aerolod (see the screenshots of ephtracies Twitter).

Raymarched varying densities would be fantastic 😅

@knightcrawler25
Copy link
Owner

I had a look at this demo of Aerialod: https://twitter.com/ephtracy/status/1663836379078356998 and it looks like a constant/uniform fog bound by the extents of the map and with a height decay control.

This looks similar to how other renderers handle global fog:

In the video, Aerialod doesn't appear to have any options to assign a texture to the fog (which would allow for varying densities and requires raymarching). This V-Ray example shows ray marched fog volume confined to geometry, but for global fog, a simple bounding box would make sense. Right now, I'm not quite sure how this would be implemented but would be a fun thing to work on :)

image

@markusmoenig
Copy link
Author

Do you have function pointers on GLSL ? I am on Metal or Rust / CPU and have them on both. So could create a callback to either read fog from a texture or calculate from height or ray march a texture or procedural noise.

If varying density is supported one could also create clouds with it like in https://www.shadertoy.com/view/MdGfzh. Then it would be a full featured terrain renderer with fog / atmosphere and clouds.

But of course course constant fog with a height decay is also already great :)

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

No branches or pull requests

2 participants