EEVEE: Update LUT GGX generation shader

This modifies the principled BSDF and the Glass BSDF which now
have better fit to multiscatter GGX.

Code to generate the LUT have been updated and can run at runtime.

The refraction LUT has been changed to have the critical angle always
centered around one pixel so that interpolation can be mitigated.

Offline LUT data will be updated in another commit

This simplify the BTDF retreival removing the manual clean cut at
low roughness. This maximize the precision of the LUT by scalling
the sides by the critical angle.
I also touched the ior > 1.0 approximation to be smoother.

Also incluse some cleanup of bsdf_sampling.glsl
This commit is contained in:
2021-02-13 18:50:09 +01:00
parent 06492fd619
commit 83ac8628c4
15 changed files with 307 additions and 286 deletions

View File

@@ -567,11 +567,8 @@ GPUShader *EEVEE_shaders_effect_maxz_copydepth_sh_get(void)
GPUShader *EEVEE_shaders_ggx_lut_sh_get(void)
{
if (e_data.ggx_lut_sh == NULL) {
e_data.ggx_lut_sh = DRW_shader_create_with_shaderlib(datatoc_lightprobe_vert_glsl,
datatoc_lightprobe_geom_glsl,
datatoc_bsdf_lut_frag_glsl,
e_data.lib,
"#define HAMMERSLEY_SIZE 8192\n");
e_data.ggx_lut_sh = DRW_shader_create_fullscreen_with_shaderlib(
datatoc_bsdf_lut_frag_glsl, e_data.lib, NULL);
}
return e_data.ggx_lut_sh;
}