# 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.

## 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.

Edited by lpcstr

##### 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.

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

##### 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 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.

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 on other sites

One solution could be using forward rendering rather than deferred (that's one direction im currently looking for my work), check Forward+ demo from AMD

1. 1
2. 2
Rutin
20
3. 3
khawk
16
4. 4
A4L
14
5. 5

• 12
• 16
• 26
• 10
• 11
• ### Forum Statistics

• Total Topics
633756
• Total Posts
3013709
×