mirror of
https://github.com/godotengine/godot.git
synced 2025-12-08 06:09:55 +00:00
Optimized GGX G function for GLES2.
Also changed the mapping of anisotropy to match the common definition.
This commit is contained in:
parent
e94f6aacee
commit
9f4e9fcb81
2 changed files with 56 additions and 26 deletions
|
|
@ -1070,11 +1070,10 @@ LIGHT_SHADER_CODE
|
|||
|
||||
#if defined(LIGHT_USE_ANISOTROPY)
|
||||
|
||||
float alpha = roughness * roughness;
|
||||
float aspect = sqrt(1.0 - anisotropy * 0.9);
|
||||
float rx = roughness / aspect;
|
||||
float ry = roughness * aspect;
|
||||
float ax = rx * rx;
|
||||
float ay = ry * ry;
|
||||
float ax = alpha / aspect;
|
||||
float ay = alpha * aspect;
|
||||
float XdotH = dot(T, H);
|
||||
float YdotH = dot(B, H);
|
||||
float D = D_GGX_anisotropic(cNdotH, ax, ay, XdotH, YdotH);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue