Is there a way to limit the number of mipmap levels, or another relatively easy way to deal with this? My texture map is pretty crammed, but I’ve tried increasing the texture “padding” without much luck. Increasing antroscopic filtering makes it thin green bands instead of a “haze”, which is an improvement… but not ideal.
either make the boarders of the atlas textues x times replicated, like have 3 times the boarder repeated, this reduces the effect.
The other solution would be to use a ArrayTexture instead of a TextureAtlas, depending on what you need as minimum requirements this might be unsuitable however.
I found all these parameters; this one was described as:
GL_TEXTURE_MAX_LOD
Sets the maximum level-of-detail parameter. This floating-point value limits the selection of the lowest resolution mipmap (highest mipmap level). The initial value is 1000.
… which is exactly what I want. Unfortunately, these functions seem to do nothing, and I’m not sure why… anyone use these before, or have any ideas on how to use them correctly?
@Momoko_Fan said:
These settings are applied per texture. You have to bind the ID first.
Is this feature useful enough that perhaps it should be added to core? What do you think?
How do I "bind the ID"?
I haven't gotten this to work to see how useful it would be... maybe if it was part of the core, I'd know :P I'd like to try this again!
Probably what you want is to have a single pixel per texture on the texture atlas. So if your texture atlas has 4x4 textures then the lowest mipmap level allowed should have a resolution of 4x4. However this still doesn’t fix the issue of the mipmap generator, which is blending adjacent textures together. You need a specialized mipmap generator that takes into account your texture atlas. In general I feel that getting texture atlases to work is quite difficult …
Btw if you only need a few textures, you might simulate a textureatlas, by just using multiple textures in the same material (always the same ones so the batching can take place) and use a additional texturecoordinate to select wich one it should be. Then you might reach the uniform limit (13) for a single material very quickly however.
… but it doesn’t seem to do anything So how does array textures work? I’ve got about 64 textures for my terrain, but if you count the baked-in lighting system, it is 64*16 = 1024 textures :o
EDIT: I realized at this point, TerrainTex.getImage().getId() returns -1, which must mean it hasn’t been actually loaded yet(?). Later in my program, I assume after it has been rendered/loaded, it returns 10 – which then I assume these functions would work. Do I actually have to wait until it is rendered before setting these variables? Is there a way to load it ahead of time?
EDIT2: I just monitor the getId() result, and when it isn’t -1, I do the glTexParamter calls (then set a flag that this was already taken care of). The end result is, this really helps!