Jan 13th, 2009 by admin
In between other projects (new non-Blender book, editing a Blender book for APress), I’m working in a code-monkey capacity with the Blender 2.5 project. So far I’ve wrapped a bit of RNA (the Action code was/is weird), and read up on writing Operators. I’ll be helping to migrate the animation tools to the new event system next.
I’ve also been working on some image processing projects in the node compositor, namely the previously-mentioned Soft Light and Linear Light nodes, and something new: Screen Space Global Illumination. It’s not even “real” SSGI (isn’t even real to begin with), but it adds a little bit more believability to rendered images with very little time cost. It functions simply: each pixel of an image evaluates the colors around it and absorbs them to a greater or lesser degree based on their relative normals and Z values.
The code isn’t complete, as I’ve not yet had time to extract Z range from the active camera. Instead, it’s hard coded, which sucks. Ideally, I’ll include a button that lets you either use the current camera Z range or displays controls for setting it manually. The sample image, a Cornell box, shows the effect and limitations. It’s not a true GI scheme — it only works in image space, and can’t project light from faces not shown. The results are subtle, but nice. Since it functions in the node pipeline, it works in HDR. This means that you could really overload a section of the image with light and have that light propagate by “bounce.”
The other thing is that the node works with any RGB input, and generates only the result, an “SSGI Pass”. How you mix it back into the pipeline is up to you. You can enhance color bleeding by cranking the saturation of the result, smooth it with the bilinear blur filter, run the SSGI node on it a second time to produce a second “bounce.” Whatever. You can also use the full rendered image for input, or the color pass, or the shaded pass, each of which will produce different effects.
For the samples, the effect isn’t drastic, but I think it adds some nice subtlety to the shading. Here’s the sample:
SSGI node (processing time about 20 seconds):