patriciogonzalezvivo / lygia

LYGIA, it's a granular and multi-language (GLSL, HLSL, WGSL, MSL and CUDA) shader library designed for performance and flexibility
https://lygia.xyz
Other
2.53k stars 163 forks source link

PBR: fallback to environment sampling if Spherical Harmonics are not present. #182

Closed shadielhajj closed 1 month ago

shadielhajj commented 1 month ago

Currently, the PBR shader expects SCENE_SH_ARRAY (the spherical harmonics array) to be defined and will fail if not (the indirect diffuse component is broken). An elegant fallback is to sample the environment at a high LOD level.

patriciogonzalezvivo commented 1 month ago

Smart improvement! Thank you