Effekseer Native for JME | jMonkeyEngine | Library


This is a companion discussion topic for the original entry at https://library.jmonkeyengine.org/discourse/embedEntry?userId=16283&entryId=jme-effekseerNative

Hi @RiccardoBlb
I am trying to test out this library using Maven via jitpack but I am running into some issues. I see there is a dependency on api “effekseer:effekseer-native:81957c3” in the parent pom, but this will not resolve. Not sure what that problem is.

If I remove that dependency, then I can compile the sample code, but I get an error: UnsatisfiedLinkError: The required native library ‘EffekseerNativeForJava’

Do I need to include EffekseerForMultiLanguages? I am guessing that is the missing dependency but it does not appear to be working via jitlab

Hi, the library is hosted on github package registry:

The gradle snippet included in the library page handles the authorization to github package registry automatically.

For maven you are going to need to create an access token manually, see the github documentation here or a tl;dr here.

Alternatively you can download the jars from their respective registry pages.

The problem you are having with jitpack is probably that it can’t build the native side of the library (that are the official effkseer bindings) because it is not a gradle or maven project.

1 Like

Thanks! I guess using jitlab was my mistake. I was about to try to clone/build EffekseerForMultiLanguages. Glad I did not need to do that. Got it working. Great project!

One more question. Does this work with effekseer 1.7? Seems to be unable to load effects from the 1.7 samples. Does this library support .efkpkg or will it in the future?

I am not actively following the effekseer developments, this library should work find with the editor up to 1.62 that supports only efkefc files afaik.

If you want to experiment with it, since most of the work is done by the EffekseerForMultiLanguages, anyway, it should just be a matter of updating that with the current release and adding efkpkg to the asset loader (assuming EffekseerForMultiLanguages’s jni bindings compile without issues, that wasn’t always the case in the past).

I will look into updating it as some point.

2 Likes

Hello, can it be used on Android platform?

I’m currently using jme3 to develop an Android project, but I haven’t found a good way to use the particle module.

Hello, can it be used on Android platform?

Hello, it is currently built only for windows and linux 64 bit. While it should be possible to compile it for android as well, it is not something that i have tested.
Please be aware that the jme library may be outdated in relation to the recent effekseer releases, as I haven’t had the opportunity to update it yet.

1 Like

Does it mean that I need to compile this project into an Android https://github.com/effekseer/EffekseerForMultiLanguages

Yes, but i don’t know if it will work out of the box, you can try.

1 Like

If I add the effekseer the whole thing looks extremely oversaturated, any idea why?

        this.fpp = new FilterPostProcessor(main.getAssetManager());

        EffekseerRenderer.addToViewPort(main.getStateManager(), main.getGuiViewPort(), main.getAssetManager(), main.getAppSettings().isGammaCorrection());

//        fpp = new FilterPostProcessor(main.getAssetManager());
//        var bloom = new BloomFilter(BloomFilter.GlowMode.Objects);
//        bloom.setBloomIntensity(.5f);
//        fpp.addFilter(bloom);

        blurFilter = new DepthOfFieldFilter();
        blurFilter.setBlurScale(2);
        blurFilter.setEnabled(false);
        fpp.addFilter(blurFilter);

        FXAAFilter fxaa = new FXAAFilter();
        fpp.addFilter(fxaa);

This is an error I see in the logs

Create render target 1920x1080
Enable sRGB
Dec 01, 2023 6:16:53 PM com.jme3.renderer.opengl.TextureUtil getImageFormatWithError
WARNING: No sRGB format available for 'RGB16F'. Falling back to linear.
1 Like

That’s your problem - either a limitation or bug in your graphics driver or a bug in jME are resulting in jME trying to create an sRGB-encoded texture in a 16-bit floating point memory format, which isn’t available. sRGB encodes color values differently (specifically with respect to brightness), so sampling sRGB-encoded colors assuming a linear encoding (or vise-versa) will screw up the brightness & saturation. My guess is the rest of your graphics pipeline is assuming sRGB where linear sampling is actually being used there.

It seems you want to use effekseer as a filter in your code (that is also the suggested way), in that case, i think you forgot to add the FilterPostProcessor to the viewport.
You can try to add this line
viewPort.addProcessor(fpp);
and see if it fixes the issue.

Since you didn’t add the filter post processor, the library uses a custom scene processor as fallback, and indeed i confirm it has an issue with sRGB handling, for which i’ve just deployed a patch.

2 Likes

Not a clue what you are telling me, but yeah ofc it’s my problem :joy:

I did that as you can see I add more filters :sweat_smile:

I can see that you are using the FilterPostProcessor in your code, but is it attached to the viewport in which you are loading effekseer? In your case it is main.getGuiViewPort().
Either way, you can upgrade to jme3-effekseerNative 0.4.3 that contains the patch for the fallback mode.

2 Likes

Thank you for the new version.

Ok this is how I set it up

        Camera camera = main.getViewPort().getCamera();
        camera.setViewPort(0f, 1f, 0, 1);

        this.fpp = new FilterPostProcessor(main.getAssetManager());

        EffekseerRenderer.addToViewPort(main.getStateManager(), main.getGuiViewPort(), main.getAssetManager(), main.getAppSettings().isGammaCorrection());

//        fpp = new FilterPostProcessor(main.getAssetManager());
//        var bloom = new BloomFilter(BloomFilter.GlowMode.Objects);
//        bloom.setBloomIntensity(.5f);
//        fpp.addFilter(bloom);

        blurFilter = new DepthOfFieldFilter();
        blurFilter.setBlurScale(2);
        blurFilter.setEnabled(false);
        fpp.addFilter(blurFilter);

        FXAAFilter fxaa = new FXAAFilter();
        fpp.addFilter(fxaa);

        depthFilter = new DepthOfFieldFilter();
        depthFilter.setFocusRange(30);
        depthFilter.setBlurScale(1.5f);
        depthFilter.setBlurThreshold(0.9f);
        fpp.addFilter(depthFilter);

        BarrelDistortionFilter barrelDistortion = new BarrelDistortionFilter();
        fpp.addFilter(barrelDistortion);

        fadeFilter = new FadeFilter();
        fadeFilter.setDuration(0.5f);
        fpp.addFilter(fadeFilter);

        main.getViewPort().addProcessor(fpp);

Just wondered why should be the effekseer on the GuiViewPort? But I can try that ofc.