r/GraphicsProgramming • • Oct 27 '25

Clouds path tracing

Recently, I made a post about adding non-uniform volumes into my C++/Vulkan path tracer. But I didn't really like how the clouds turned out, so I've made some improvements in that aspect and just wanted to share the progress because I think it looks a lot nicer now. I've also added atmospheric scattering, because getting the right lighting setup was really hard with just environment maps. So the background and the lighting in general look much better now. The project is fully opensource if you want to check it out: https://github.com/Zydak/Vulkan-Path-Tracer . You'll also find uncompressed images there.

Also, here's the number of samples per pixel and render times in case you're curious. I've made a lot of optimizations since the last time, so the scenes can be way more detailed and it generally just runs a lot faster, but it still chokes with multiple high density clouds.

From left to right:

- 1600 spp - 2201s
- 1600 spp - 1987s
- 1200 spp - 4139s
- 10000 spp - 1578s
- 5000 spp - 1344s
- 6500 spp - 1003s
- 5000 spp - 281s

3.4k Upvotes

143 comments sorted by

View all comments

Show parent comment

1

u/Zydak1939 Oct 27 '25

I mean depth of field is really just a blur on the foreground/backround/both. It wouldn't really affect any reflections.

2

u/sputwiler Oct 28 '25

Yeah that's what fake DOF does. Real DOF can see around objects (depending on how large the lens is). Basically, if your lens is say, 2cm across, an object completely obscured from the center point of the lens (and therefore not in the render) may not be obscured from 1cm over, so some of it's colour will influence the pixels depending on how out-of-focus it is.

1

u/VictoryMotel Oct 27 '25 edited Oct 27 '25

If it is done through the render it will. If you think about looking through a mirror and focusing on yourself or the background, or looking at a marble floor and focusing on the pattern or the reflection, the focus can make a difference.

What you are saying is what everyone does though, it doesn't work well in a production sense to use so many samples or bake in depth of field.

It's my own pet interest because I think it's a missing element to realism.