xsquawkbox / libxplanemp

Legacy X-Plane Multiplayer Library used by XSquawkBox 2.x and earlier.
18 stars 7 forks source link

Limit mipmap generation depth for LegacyCSL #5

Open kuroneko opened 7 years ago

kuroneko commented 7 years ago

By default, GL will create up to 100 levels of mipmap until the texture is only 1x1px unless otherwise limited, and the current rendering code makes no efforts to limit this.

Given that the typical LegacyCSL texture is practically useless at 1x1, we should limit mipmapping to something more reasonable.

kuroneko commented 7 years ago

with the standard 1024x1024 textures I'm seeing in X-CSL, there should be no more than 10 passes, but even that's too many.

Main consideration is that as the texture is an unwrapped single texture, by the time we get below about 64x64 pixels, there's no/little single-surface detail left in the texture anyway and we're likely to suffer from bleed from adjacent areas of the texture that aren't uv mapped near each other.

I'll limit to 6 passes, and revise after some visual checks that this is a sane limit.

kuroneko commented 7 years ago

6 looks good in my testing branch, but there needs to be some adjustment of that counterpoint to derez - derezing the texture reduces the number of useful mips available. Fortunately this is 1:1, so it should be trivial to fix.

Screenshots show results with X-CSL with anisotropy enabled and the reduced mipmap levels. far view mid view