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.
Deferred Shading + Anisotropic Spec?
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.
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.
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).
The presentation link where Crytek talk about their fake aniso : http://advances.realtimerendering.com/s2010/Kaplanyan-CryEngine3(SIGGRAPH%202010%20Advanced%20RealTime%20Rendering%20Course).pdf
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