Deferred Shading Different Light Models

Started by
3 comments, last by David Neubelt 10 years, 7 months ago

I have a deferred renderer which has so far not given me any problems. However, I want to add anisotropic lighting support per this paper:

http://developer.amd.com/wordpress/media/2012/10/ShaderX_PerPixelAniso.pdf

I can store the necessary date in the gbuffers, but it basically means I have two different lighting methods in my lighting shader. I'm probably going to just do a dynamic branching statement to determine if I should use the anisotropic lighting or not. The dynamic flow control should have good spatial coherency, but I'm wondering if there is another good approach besides branching?

-----Quat
Advertisement

You can just use the anisotropic model on everything to avoid the branch.

If your isotropic and anisotropic models both happen to produce the exact same result when given isotropic input parameters, then you can move the branch to be more coarse grained. e.g. instead of branching per-pixel checking if that pixel contains anisotropic parameters, you could instead branch on 8x8 tiles, and run the aniso code for a whole tile if any pixel in that tile contains aniso parameters.

Yeah I was looking at the paper again, and it is just phong with a modified normal (although this paper is a bit old so might not be the modern way to do anisotopic lighting). Instead of doing their precomputed lookup texture, I'll just write the modified normal during the deferred pass, then the lighting will be the same.

However, soon I will want to upgrade my lighting model from phong to something more modern. What is a popular modern anisotropic model I can look into?

-----Quat

Ward?

http://www.cs.utah.edu/~premoze/brdf/

http://content.gpwiki.org/index.php/D3DBook:(Lighting)_Ward

I don't know about "popular" or "modern" but it looks nice imo.

We use GGX for iso/anisotropic materials at Ready At Dawn.

You can see the details in the section Core Shading Model http://blog.selfshadow.com/publications/s2013-shading-course/rad/s2013_pbs_rad_notes.pdf

-= Dave

Graphics Programmer - Ready At Dawn Studios

This topic is closed to new replies.

Advertisement