Here's a few screenshots showing some work from the current refactor of the FireStorm Renderer.
The first two images just show per-pixel (phong) lighting being applied to a 3D textured cube, and rendered courtesy of a regular forwards-rendering setup, with support for a single pass per light.
Here's another view
The third image shows work on the Deferred Lighting pipeline, and is far more interesting to me.
Tex 1 is an input texture being applied to the geometry. The ''geompass' shader writes to three output color textures (2,3 and 4) and also writes to one depth texture (5 - it's quite faint, but it's there)
Tex 2 holds the WorldSpace Position of the 3D surfaces as determined at each pixel.
If
we had a software raycaster that was casting 3D rays from each pixel on
the near plane of the camera's view frustum until they hit some surface
in the world, the position of each intersection point of a cast ray
with the world surfaces is what we're recording per pixel, and doing so
with no raycasting. The operation is laughably cheap in the geompass
fragment shader.
Tex 3 is our regular diffuse texture output, that we'd get from forward-rendering with no lighting.
It carries the texture detail for all the objects in our scene for the current frame.
Tex 4 is similar to Tex2 - but it holds per-pixel WorldSpace Surface Normals, instead of Surface Position.
Tex 5 is a Depth Texture - it's capturing depth info just like the regular depthmap, but in the form of a texture, so it can be read back in another shader pass, where the data from these textures is read back in and the final lighting calculation is performed per pixel.
Tex 6 is waiting to capture the final results of the per-pixel lighting (baking) pass.
No comments:
Post a Comment