Disable mipmap creation for .j3m materials (PNG)?

Hi,

it seems as if jMonkey always creates mipmaps when loading textures from .j3m files (at least if PNG files are referenced as ColorMap.)

Is there a way to prevent jMonkey from creating mipmaps? I don’t need them in my usecase, and they cause some texture bleeding.

What I have: A scene with several objects that all reference the same material (file). I reference an external material file to be able to change the material only once and affect all objects.

I don’t want to alter the TextureKeys after loading, if this is even possible.

Thanks

This will be fixed once this PR is merged:

1 Like

Ah, very cool. Thank you!

Will this also be useful for my usecase (texture spritesheet drawn 1:1, so with no scaling at all)?

Turning off mipmaps will save you some RAM in that case.

1 Like

Sorry about this, I said I would take care of it but didn’t.
I’ll try asap.

1 Like

This is music to my ears :smile:

Should be possible in code, before loading.
This is a snippet of code from the BitmapFontLoader.java:

TextureKey key = new TextureKey(folder + file, true);
key.setGenerateMips(false);
tex = assetManager.loadTexture(key);
tex.setMagFilter(Texture.MagFilter.Bilinear);
tex.setMinFilter(Texture.MinFilter.BilinearNoMipMaps);

I don’t know if this really works, never tested it actually, but this snippet has been around for 4 or 5 years now, so it should work in theory. Hope that this helps you.

And … I will need this “disable mipmapping” feature too, for two of my projects - one of which I’m currently working on:

  1. First project: I have designed a special image channel mode 8x1 bit per channel - this will be used to render the UniFont which has support for almost all unicode glyphs as pure black/white with 32x32 pixels. I call this font “the ugly font” in my code comments, because … well … it’s 1 bit @ 32x32 pixels… :chimpanzee_amused:

  2. Second project: I’m planning to implement a real palette-shader which will heavily rely on the ability of the game engine to not have compressed images and to not have mipmaps for the loaded textures.

Have fun! :chimpanzee_amused:

Yes, but they are specifically talking about loading from a j3m and there is a patch that allows turning off mipmaps when loading from a j3m.

That’s what the op wrote.
I’ve read the rest too.
And I’m not working with jME 3.1 because I only want to use proven software and because I’m a bit lazy.
And nice that Nehon will merge in the patch. I’m really eager to use the first polished jME 3.1
Maybe my hint will help other people.
:chimpanzee_smile:

Meaning, he doesn’t want to alter the TextureKeys after loading the j3m… from the title of this thread.

I see … at last. :chimpanzee_grin: Nevermind then. Did just waste some of my time. :chimpanzee_facepalm:

1 Like