PrismarineJS/prismarine-viewer


Terrain mipmapping #172
Karang posted onGitHub
Add mipmapping to remove moiré patterns, especially visible in VR but also when moving the camera.
This is not a trivial issue. Setting the minFilter of the texture to THREE.NearestMipmapNearestFilter
solve the moiré issue but handle very badly transparent blocks and cause issue with the alpha testing.
A correct solution would be to generate the mipmaps manually and use a better algorithm to interpolate the alpha (max neighbor?). I tried to do that but it wasn't very concluant, may revisit this solution in the future.
An other solution could be to generate a binary alphaMap that doesnt have the mipmap and use the mipmap on the texture.