I’m not sure what’s going on here, is it mipmaps, some bilinear/trilinear/anisotropic thing or is it not using GL_NEAREST?
I’d like something more like this (hand-drawn) picture, where each texel is a distinct square:
I’m using moderngl and moderngl-window as well as pygame for loading textures.
import pygame as pg
import moderngl as mgl
texture = pg.image.load(f'textures/{filename}')
texture = pg.transform.flip(texture, flip_x=True, flip_y=False)
num_layers = 8
texture = self.app.ctx.texture_array(
size=(texture.get_width(), texture.get_height() // num_layers, num_layers),
components=4,
data=pg.image.tostring(texture, 'RGBA')
)
texture.anisotropy = 0.0
texture.mipmap = False
texture.mipmap_levels = 0
texture.min_lod = 0
texture.max_lod = 0
# texture.build_mipmaps()
texture.filter = (mgl.NEAREST, mgl.NEAREST)
Setting the filter to NEAREST doesn’t seem to help, nor does dropping the build_mipmaps call, nor anything else I’ve tried. What to do?