Jump to content
  • Advertisement
Sign in to follow this  
Quat

Deferred Shading Different Light Models

This topic is 2131 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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?

Share this post


Link to post
Share on other sites
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.

Edited by Hodgman

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!