Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Tech Update: OpenGL 4 Deferred Renderer


Josh

4,611 views

The OpenGL 4 renderer for Leadwerks 3.1 is well underway. I began implementing deferred lighting in earnest last Friday. Previous work included setting up MSAA on deferred buffers, as well as implementation of the Leadwerks Buffer class, which functions as a thin wrapper around OpenGL FBOs (frame buffer objects). The engine already tracks relationships between objects and lights, and this system was able to be used to provide a list of shadow-casting objects for each point and spot light.

 

Because I've been working with deferred rendering since 2008, I've had time to study the bottlenecks and invented my own optimizations to improve performance with this type of renderer. Leadwerks uses special proprietary techniques to make shadow map rendering extremely fast.

 

I began with the simplest light type, a spot light. These use a perspective projection onto a single shadowmap. This took about two days to implement.

blogentry-1-0-01806800-1380325744_thumb.jpg

 

Point lights work by projecting six images onto a cubemap shadowmap. This was a little trickier but I got it done after another two days:

blogentry-1-0-79592100-1380325855_thumb.jpg

 

The hardest to implement was directional light shadows. We began using cascaded shadowmaps back in 2008, and the industry has since concluded they are in fact the best choice for performance and quality. It took a few extra days to get this one working, but now it's done:

blogentry-1-0-26893900-1380326030_thumb.jpg

 

This video is a very nice illustration of the technique:

 

And here is my implementation in action. With just a little more adjustment, it will be perfect:

 

The Leadwerks 3.1 deferred renderer has a number of advantages over the Leadwerks 2 renderer:

  • Deferred renderer can now use 32x hardware MSAA instead of "fake" antialias techniques.
  • Shadow edge filtering is much softer, less "grainy".
  • Cubemap shadow maps are used to render point lights in a single pass.
  • Higher default resolutions and settings to take advantage of modern hardware.

 

These factors combine to provide an extremely clean and beautiful rendered image. When I'm done, I think the Leadwerks 3.1 renderer will look more like high-quality cg than what we think of as real-time renders.

  • Upvote 11

0 Comments


Recommended Comments

There are no comments to display.

Guest
Add a comment...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...