guycalledfrank / bakery-issues

Bug tracker for Bakery
4 stars 0 forks source link

Bicubic filtering uses wrong texel size for the main lightmap when using SH #129

Closed z3y closed 2 years ago

z3y commented 2 years ago

Bakery allows you to set different lightmap size for directional lightmaps image

Bicubic filtering is using _RNM0_TexelSize for all 4 textures when using SH mode

If the directional lightmaps have a lower resolution, the main lightmap(L0) is sampling bicubic with wrong texel size

guycalledfrank commented 2 years ago

Hmm makes sense, sounds problematic. Actually BakerySH() doesn't even have to sample the main lightmap, as it's already sampled by the built-in code, and if Shader Tweaks's bicubic filtering is also enabled, it should all work (Tweaks use tex.GetDimensions to get texel size).

So hopefully it's all what's needed: https://github.com/guycalledfrank/bakery-csharp/commit/682c0a4a60b862d225ec7c1a000abe68773aca1d