The X and Y input for Anisotropic GGX

I found a Anisotropic GGX function in Engine/Shaders/Private/BRDF.ush,line 102

float D_GGXaniso( float RoughnessX, float RoughnessY, float NoH, float3 H, float3 X, float3 Y )
{
	float ax = RoughnessX * RoughnessX;
	float ay = RoughnessY * RoughnessY;
	float XoH = dot( X, H );
	float YoH = dot( Y, H );
	float d = XoH*XoH / (ax*ax) + YoH*YoH / (ay*ay) + NoH*NoH;
	return 1 / ( PI * ax*ay * d*d );
}
  1. What is the meaning of the X and Y(and RoughnessX and Y ) input of this function?
  2. Is there any use case by default for this function in the engine?
  3. It is possible to generate XY through L,V,N?

Thank you!

  1. If I remember correctly, X and Y would be tangent and bi-normal vectors, and Roughness X Roughness Y would be roughness of the surface in tangent direction and roughness of the surface in bi-normal direction respectively.

  2. There is,but not by default. You’d need to change the engine code and implemented everything, that is needed for the shading model. Judging from You asking the question, it might be a bit overwhelming undertaking for You.

  3. Nope. You can generate X if you have N and Y. You can generate Y if You have N and X. You can generate N if you have X and Y.

Probably the main reason, why this had not been implemented in the engine, is a requirement to store additional roughness and at least two vectors of a tangent space in gBuffer, along with few other complications, like reflections.

Thank you!
I think there is no tangent inside GBuffer,and considering that in fact I do not need a mathematically correct effect.I tried this in my shading model.
float3 Lp = cross(L,N);
float3 Vp = cross(V,N);
D_GGXaniso(LobeRoughness[1]*NoL,LobeRoughness[1]*NoV, NoH,H,Lp,Vp)

Looks okay.

Hello IOChair,
i am currently looking into the BRDF.ush file in search of an anisotropic shadermodel. can you tell me, what your workflow was in order to get it working?
it would be awesome, if you could give me a hint. would that be possible?
thank you!
sascha@giantgungames.com