Today I want to show you a really stupid and cumbersome way I found to generate some halo/lens flare-effects!
I found this piece of free software, HaloSim3, which is a raytracing engine for making mathematically accurate halos, according to an academic paper from 1994. The software itself isn’t exactly new either, so you can run it on Windows 95 if you want to(!)
That in itself is pretty cool, as halos and other light refraction effects are notoriously hard to render nicely, and it takes massive amount of time to render such things. With this software you can, in theory, render a correct halo very swiftly, and then composit it with the rest of your scene later.
Click “keep reading” to see how to do it!
There are a couple of obstacles though. Firstly, the engine doesn’t actually render out any images - to get anything other than simulation data out of it you need to screencap what you see... (To get a higher resolution than your physical screen, you can tell Windows to display at different resolution than the native one)
Another issue is the lack of transparency. For our halos to be useful, we need a way to separate them from the background. This is solved quite easily by making the background completely black, because none of the light contains black. To achieve this, there’s a couple of settings we have to change.
Turn off the visibility of ‘Horizon’, ‘Simulation edge’ and ‘Sun’ in the Appearance dropdown menu. Then change the background colour to black in the same menu (under ‘Colors’).
After that, we need to open the Sky Tuner window by clicking the button beneath ‘Colors’. Here we set the ‘Tonal variation’ to ‘None’ and click ‘Adjust’ to select black. The preview circle should now be compeltely blacked out and we’re ready to run the render.
Yet another issue is that HaloSim is a pure and basic raytracer. It only outputs loads of tiny dots, with no interpolation what so ever, so the image looks very noisy. This was made by scientists, who were seemingly more interested in cold facts than beauty. But with modern “deep learning” algorithms we can still salvage the images!
Several companies have been putting out denoising algorithms based on deep learning routines run on raytracing noise. A kind fellow, Declan Russell, has made a standalone executable command line tool for Nvidia’s OptiX, but sadly I couldn’t get it to work. Luckily, the same guy had also made one for Intel’s solution, and that worked (and it’s really fast, despite being CPU-bound!).
Now that we have a denoised screencap of the simulated halo, we can open it in Gimp (sticking to free software). Here we can turn the black colour into alpha value for trnasparency.
By default, the bottom layer has no alpha channel, so we go to Layer -> Transparency and click ‘Add Alpha Channel’.
Now we can click ‘Color to Alpha’ under the same menu.
We want to set the ‘Color’ input to perfect black and also increase the ‘Transparency threshold’ a bit. This will make the noise in the black areas go completely transparent and remove some edge artifacts. A value of around 0.1 seems to be fine usually.
We finally have a transparent image we can layer on top of whatever we want!
Note that HaloSim’s output is completely symmetrical and without imperfections. To make the effect seem more realistic, we can take a soft eraser brush and remove parts here and there.
I also recommend rendering at a high resolution and then scaling the halo layer down in Gimp afterwards, as this also helps smooth the image out and crush artifacts.
Now, is this all worth it, for what is essentially a glorified lens flare generator? Probably not, since the output is basically just radial gradients, but I still had fun with it. Perhaps you can find some more hacky solutions to make it more useful? If you do, please let me know!
Anya is live and ready to show you everything. Watch her strip, dance, and perform exclusive shows just for you. Interact in real-time and make your fantasies come true.
✓ Live Streaming✓ Interactive Chat✓ Private Shows✓ HD Quality
Anya is LIVE right now
FREE
Free to watch • No registration required • HD streaming