Today finally wraps up the advanced lighting chapter before school starts; I managed both two topics - deferred rendering and SSAO.
Deferred rendering? That is essentially saving lighting calculations and creating them in a different pass than from forward rendering. In the first pass, the calculations for positions, normals, and color are saved to a texture buffer, the G-Buffer (really, it's just a framebuffer). Afterwards, a post-processing quad is then made and lighting is applied using the information from those framebuffers. That way we can get nine fancy models with 32 lights, or perhaps even more!
How about SSAO? SSAO is similar to the deferred topic, except that the G-Buffer is used to effectively store depth values as well. Before doing the lighting pass, the geometry depth values are tested against a rotating hemisphere kernel (My mind is also slightly boggled by the details) to darken areas where there would be ambient light occluded from geometry. There is also a range to prevent occluding from faraway areas.
What's the catch? The actual product looks really strange, so we combine it with a created noise texture and blur the result to get a proper shadowing around those areas, no shadows required:
In terms of the semester, I'm still wondering what I'll be doing for my main project. Perhaps getting into some terrain again?
No comments:
Post a Comment