For a while now I’ve been wanting to experiment with volumetric lighting techniques in Papervision and the other day I came across a post processing technique that gives great results for very modest overhead.
With my 11bit depth buffer technique in PV3D the primary goal was enabling post processing effects that are only achievable with a depth buffer however at the back of my mind I wondered if depth testing was in some way feasible.
As you can probably tell from the experiments on this site I have something of a love affair with 3D in Flash. Recently I was invited to join the Papervision3D team as a contributing member to help out with the latest iteration of the engine, PV3D 3.0…
Using the same Pixel Bender kernel as my previous depth of field experiment it is possible to achieve depth based fog. Source code for this example included!
The biggest issue with my past DOF experiments was the lack of depth buffer precision. With my latest PV3D depth buffer implementation providing 11bit precision at the pixel level the past DOF limitations are no longer an issue.
Screen Space Ambient Occlusion is a post processing technique for approximating the shading achieved by ambient occlusion. In this example I implement SSAO for Papervision using a custom depth buffer material and Pixel Bender.
An early preview of my Screen Space Ambient Occlusion implementation in Papervision. Utilizing an 11bit depth buffer and Pixel Bender kernel.
One of the features that most modern graphics accelerators support is a ZBuffer (also known as a depth buffer). This can be thought of as an image that provides per pixel depth information. In this experiment I emulate a ZBuffer in Papervision and use it to create a realtime volumetric Depth of Field effect.
Before the advent of per pixel shaders, developers were creating faux-3D textures for things such as grass and fur by giving the target object several layers. If the layers are close enough together and the object is far enough away from the camera a texel will have the illusion of being a 3D strand.