Jump to content
  • Advertisement
Sign in to follow this  
lpcstr

Deferred Shading + Anisotropic Spec?

This topic is 2058 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 was thinking about the feasibility of using a flexible anisotropic specular as the primary BRDF in a deferred shading setup. You'd obviously have to store two roughness parameters in the gbuffer instead of one. My question is, wouldn't you also have to store the tangent and bitangent vectors, since those are needed by the BRDF? That would require a lot of space in the gbuffer.  wacko.png

Edited by lpcstr

Share this post


Link to post
Share on other sites
Advertisement

I was thinking about the feasibility of using a flexible anisotropic specular as the primary BRDF in a deferred shading setup. You'd obviously have to store two roughness parameters in the gbuffer instead of one. My question is, wouldn't you also have to store the tangent and bitangent vectors, since those are needed by the BRDF? That would require a lot of space in the gbuffer.  wacko.png

 

Note you can calculate any one of the bitangent, tangent and normal vectors with the other two via a cross product.

Share this post


Link to post
Share on other sites

I'm experimenting with this at the moment, and my configuration is to store the normal and tangent in 16-bits each (using schemes from this page), two roughness parameters in 8 bits each, and the sign of the binormal (whether it's cross(N,T) or -cross(N,T)) in one bit.

This requires 49 bits of G-buffer space, rather than 24 bits for isotropic specular...

 

I also tried storing the T/B/N basis as a quaternion, but to get decent quality I needed to use 16-bits for each of the 4 components. I was able to drop one component and reconstruct it (due to quaternion rotations being normalized), bringing it down to 16-bits * 3, but this was still way more space and conversion math than the above configuration.

 

Crytek mention in one of their presentations (forget which one, sorry) that they faked anisotropic specular by simply adjusting the normal when writing to the g-buffer.

Edited by Hodgman

Share this post


Link to post
Share on other sites

I was thinking about the feasibility of using a flexible anisotropic specular as the primary BRDF in a deferred shading setup. You'd obviously have to store two roughness parameters in the gbuffer instead of one. My question is, wouldn't you also have to store the tangent and bitangent vectors, since those are needed by the BRDF? That would require a lot of space in the gbuffer.  wacko.png

 

Yes, you need the full tangent frame. One possible option is to to store the entire tangent frame as a quaternion, however you can run into trouble with this if you need to blend into your G-Buffer normals (like you would with decals, for instance).

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!