turanszkij / WickedEngine

3D engine with modern graphics
https://wickedengine.net
Other
5.69k stars 602 forks source link

[Feature request] Localized volumetric fog #924

Open Cop46 opened 4 weeks ago

Cop46 commented 4 weeks ago

I don't know if this is planned or not but that would be awesome to add localized volumetric fog. If this is possible in rasteriser and pathtracer too ?

Maybe with a function in renderPath like SetLocalizedVolumetricFogEnabled( bool enable); And in "weathers ?" or new "component ?" something like AddLocalizedVolumetricFog(XMFLOAT3 centerOfBox, XMFLOAT3 sizeOfBox)

turanszkij commented 4 weeks ago

I think the simplest solution would be to have a fog boost slider for the lights, so you can place a spotlight with volumetric enabled and boost the fog amount for just that spotlight. Or do you need something different?

Cop46 commented 3 weeks ago

The idea is to use the "localized" fog to simulate dust with window or other effect. Maybe a boost value for light can be the best solution, I haven't thinked about that before.

Do you think with boost this is possible to reproduce something similir to this image ? VolumFog

turanszkij commented 3 weeks ago

Yes, this is how I imagined it too.

turanszkij commented 3 weeks ago

Check out the commit above, it adds a slider for each light, this can add fog to the volumetric light independently from the weather fog settings.

Cop46 commented 3 weeks ago

That appear to be working well with a small amount of fog density and boost, this is perfect ! And for the path tracer this is possible or too complicated for the moment ? Thank.

turanszkij commented 3 weeks ago

Real volumetric fog for the path tracing is too complicated, for now I don't want to spend time on it. But maybe adding the existing volumetric fog on top of the path tracing result can be more easily added, but that will only appear for primary ray, not reflections and other things.

Cop46 commented 3 weeks ago

Yes only in the first ray this is better than nothing :)

turanszkij commented 3 weeks ago

Check out the commit above, adds the volumetric lights for path tracing as described above. They are not path traced, but rasterized, they use the shadow maps with ray marching. They are not visible in reflections, light bounces or path traced depth of field.

Cop46 commented 3 weeks ago

Excellent, that work like a charm ! Thank for your great work :)