ericwa / ericw-tools

Quake/Hexen 2 Map compiling tools - branch of http://disenchant.net/utils
http://ericwa.github.io/ericw-tools
GNU General Public License v2.0
309 stars 56 forks source link

lightpreview: fix texture mips not being generated #385

Closed Slartibarty closed 9 months ago

Slartibarty commented 9 months ago

This was happening because allocateStorage allocates space for the texture and its mips up-front, the user of QOpenGLTexture is required to determine the number of mips required for a texture beforehand. allocateStorage was allocating space for mip 0 and no others, leading to no additional mips being generated.

This also adds explicit format and type to allocateStorage for only this instance, although it still remains optional.

ericwa commented 9 months ago

Thanks! Confirmed this fixes our previous lack of mipmapping.

I was going to ask if we need QOpenGLTexture::setAutoMipMapGenerationEnabled but according to https://doc.qt.io/qt-6/qopengltexture.html#setAutoMipMapGenerationEnabled it's enabled by default