Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can a texture default filtering option parameter be added? #4

Open
JohnLKkk opened this issue Oct 25, 2023 · 2 comments
Open

Can a texture default filtering option parameter be added? #4

JohnLKkk opened this issue Oct 25, 2023 · 2 comments

Comments

@JohnLKkk
Copy link

I noticed that after many glTF models are converted to j3o, they seem to all use nearest filtering, which looks terrible visually (severe flickering when the camera moves...) and is very costly for texture bandwidth. Could a parameter be added during conversion for setting textureMin/MagFilter?

@pspeed42
Copy link
Contributor

That's because JME does that. JmeConvert is just calling JME code.

It would be a really simple groovy script that you could write to add to the JmeConvert command line to set all filtering. Probably just 4-5 lines of groovy code.

@oxplay2
Copy link

oxplay2 commented Oct 26, 2023

Its not really JMEC issue.

I think the issue wasnt about Texture Filtering param, but about mipmaps where Trilinear/Bilinear require mipmaps that are most probably just not generated.

Reason: Texture.java
texture.setMinFilter() have glued code:

        if (minificationFilter.usesMipMapLevels() && image != null && !image.isGeneratedMipmapsRequired() && !image.hasMipmaps()) {
            image.setNeedGeneratedMipmaps();
        }

But its executed 2 times for GLTFLoader, first time before setting proper Filterings, and second time when set proper Filterings via this method.

While JME .j3o loader is using this only first time, because second time it setup filterings by texture.read() instead texture.setMinFilter();

so for texture.read() just need add glued code, or call texture.setMinFilter() second time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants