You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When generating mipmaps I ran into a problem where sampling the original texture was always coming up [0.0, 0.0 0.0, 0.0]. It turns out that the sampler was trying to read from the mipmap at level 1, and of course it didn't exist yet as that was the one I was trying to generate. The fix was to sample a different texture - one without slots for the mipmaps, then throw away that texture.
6
+
7
+
I have to generate mipmaps to smooth out the irradiance and prefiltered cubemaps that we use for pbr shading.
8
+
9
+
## Thur Aug 3, 2023
10
+
11
+
I greatly reduced the artifacts in the prefiltered environment cube used for specular highlights.
12
+
I did this by using a simplified `calc_lod` and also by generating enough mipmaps.
13
+
Previously I was only making 5 mip levels but the `calc_lod` was often requiring 21+!
14
+
Of course the environment cubemap's face size is only 512, which leads to 9 mip levels total - so now I'm providing 9 mips.
15
+
16
+
I also noticed that the IBL diffuse irradiance samples were not aligned! Now the normal's Y is flipped in the irradiance convolution.
* When generating mipmaps I ran into a problem where sampling the original texture was always coming up [0.0, 0.0 0.0, 0.0]. It turns out that the sampler was trying to read from the mipmap at level 1, and of course it didn't exist yet as that was the one I was trying to generate. The fix was to sample a different texture - one without slots for the mipmaps, then throw away that texture.
0 commit comments