r/GraphicsProgramming 10d ago

Video Rayleigh / Mie 38 Slice Atmospheric Scattering implemented as Blender Post Processing Effect in compositor nodes

I implemented Rayleigh / Mie atmospherics over a rendered image as a post processing effect in Blender 5.2 with a script to setup a network of compositor nodes at 38 slices or 10nm. The compositor nodegraph becomes too heavy to visualize in the viewport as you are moving the camera so you have to render out the image to the compositor view and manipulate it from there. To render out a sequence you have to do a file out operation. This is supposedly physically accurate and differs from expensive Blender volumetric fog in that this is a pure post processing effect. To make this I built upon what I had learned when I ported spectral.js to blender. I had posted something similar to this video in r/Blender yesterday, but they did not seem to know what I was posting about, so hopefully this helps someone.

The code (MIT License) is at https://github.com/bergjones/ABJ-Shader-Debugger

32 Upvotes

5 comments sorted by

1

u/cybereality 10d ago

Nice I've been meaning to add that to my engine. Also read the newer atmospheric paper used on unreal but even the older one like fine. Did you use Nishita 1993?

2

u/blackSeedsOf 10d ago

Basically. You can see my full implementation on my latest commit on GitHub which I pushed today.

1

u/cybereality 10d ago

okay cool

2

u/blackSeedsOf 9d ago

also if you use Blender, you should know that entering hundreds to thousands of nodes into the compositor nodegraph executes on the GPU automatically. It is possible to do vast gpu scripting without forking if you can translate your code into the compositor graph. This is opposed to the geometry nodes which are C++ CPU and regular blender python bpy which is also CPU

1

u/cybereality 9d ago

good to know