mirror of
https://gitlab.bixilon.de/bixilon/minosoft.git
synced 2025-09-17 11:24:56 -04:00
textures: option to disable mipmap generation
This commit is contained in:
parent
ea45a04b9b
commit
547e754245
@ -155,15 +155,12 @@ class OpenGLTextureArray(
|
||||
|
||||
val renderData = texture.renderData as OpenGLTextureData
|
||||
for ((level, data) in mipMaps.withIndex()) {
|
||||
if (texture.generateMipMaps) {
|
||||
val size = texture.size shr level
|
||||
|
||||
glTexSubImage3D(GL_TEXTURE_2D_ARRAY, level, 0, 0, renderData.index, size.x, size.y, level + 1, GL_RGBA, GL_UNSIGNED_BYTE, data)
|
||||
} else {
|
||||
val size = texture.size
|
||||
|
||||
glTexSubImage3D(GL_TEXTURE_2D_ARRAY, level, 0, 0, renderData.index, size.x, size.y, level + 1, GL_RGBA, GL_UNSIGNED_BYTE, mipMaps[0])
|
||||
if (level > 0 && !texture.generateMipMaps) {
|
||||
break
|
||||
}
|
||||
val size = texture.size shr level
|
||||
|
||||
glTexSubImage3D(GL_TEXTURE_2D_ARRAY, level, 0, 0, renderData.index, size.x, size.y, level + 1, GL_RGBA, GL_UNSIGNED_BYTE, data)
|
||||
}
|
||||
|
||||
texture.data = null
|
||||
|
Loading…
x
Reference in New Issue
Block a user