KHR_Transform

I build the model and set material to it following this shader docs
https://learn.foundry.com/modo/content/help/pages/shading_lighting/shader_items/gltf.html

everything worked smoothly and in modo was no warnings (if material has problems modo shows warning on export), I also checked the model in gestaltor, windows 3d viewer, and blender it is as expected. but in jme no material only a white object and i get following warning

Mar 01, 2023 9:42:29 AM com.jme3.scene.plugins.gltf.CustomContentManager readExtension
WARNING: Could not find loader for extension KHR_texture_transform
Mar 01, 2023 9:42:29 AM com.jme3.scene.plugins.gltf.CustomContentManager readExtension
WARNING: Could not find loader for extension KHR_texture_transform
Mar 01, 2023 9:42:30 AM com.jme3.scene.plugins.gltf.CustomContentManager readExtension
WARNING: Could not find loader for extension KHR_texture_transform
Mar 01, 2023 9:42:30 AM com.jme3.scene.plugins.gltf.CustomContentManager readExtension
WARNING: Could not find loader for extension KHR_texture_transform
Mar 01, 2023 9:42:30 AM com.jme3.scene.plugins.gltf.CustomContentManager readExtension
WARNING: Could not find loader for extension KHR_texture_transform
Mar 01, 2023 9:42:33 AM com.jme3.material.Material checkTextureParamColorSpace

NOTE: I Used adobe substance to create texture maps from a photo, ao,roughness, and metalic produced grayscale, so i changed profiles to srgb in photoshop then i used this tutorial Combine Maps into RGB texture (Better) - YouTube to combine them into one rgb clip as modo needs it, i also used normal multiply blend mode for transparent amount(alpha) in modo.
this is a state i used to attach the model “frisebee” to the scene.

@Override
    protected void onEnable() {

        app = (SimpleApplication) getApplication();
        rootNode = app.getRootNode();

        frisebee = getApplication().getAssetManager().loadModel("Models/freezbeez/gagafrise.glb");
        Node probeNode = (Node) getApplication().getAssetManager().loadModel("Scenes/defaultProbe.j3o");
        LightProbe probe = (LightProbe) probeNode.getLocalLightList().iterator().next();
        rootNode.addLight(probe);


        rootNode.attachChild(frisebee);

        CameraControl cameraControl = new CameraControl(
                getApplication().getCamera(),getApplication().getInputManager());

        cameraControl.setSpatial(frisebee);
        cameraControl.setControlDir(CameraControl.ControlDirection.SpatialToCamera);
        frisebee.addControl(cameraControl);


        Spatial torus = getApplication().getAssetManager().loadModel("Models/torus/untitled.glb");
        torus.setLocalRotation(new Quaternion().fromAngleAxis(FastMath.QUARTER_PI,Vector3f.UNIT_Y));

        rootNode.attachChild(torus);

        getApplication().getViewPort().setBackgroundColor(ColorRGBA.DarkGray);
        dl = new DirectionalLight();
        dl.setDirection(new Vector3f(-1, -1, -1).normalizeLocal());
        rootNode.addLight(dl);
        dl.setColor(ColorRGBA.White);
        getApplication().getStateManager().getState(BulletAppState.class).setDebugEnabled(true);




        Spatial sky = SkyFactory.createSky(app.getAssetManager(), "Textures/Sky/4kresovled.hdr", SkyFactory.EnvMapType.EquirectMap);
        rootNode.attachChild(sky);
    }

screens:
jme3.5.2:

looks in modo:

i also tried to check it on sdk but it was the same in sdk with following log:

INFO [com.jme3.gde.modelimporter.UberAssetLocator]: Clearing asset List
INFO [null]: Last record repeated again.
INFO [com.jme3.gde.modelimporter.ModelImporterVisualPanel3]: Start offview panel
WARNING [com.jme3.scene.plugins.gltf.CustomContentManager]: Extension KHR_texture_transform is not supported, please provide your own implementation in the GltfModelKey
WARNING [com.jme3.scene.plugins.gltf.CustomContentManager]: Could not find loader for extension KHR_texture_transform
WARNING [null]: Last record repeated 4 more times.
INFO [com.jme3.gde.core.assets.AssetDataObject]: Loaded asset gagafrise
INFO [com.jme3.gde.core.assets.AssetDataObject]: Removing asset gagafrise.glb, from cache via main asset gagafrise.
INFO [com.jme3.gde.modelimporter.ModelImporterVisualPanel3]: Attaching model gagafrise.glb (Node)
INFO [com.jme3.gde.modelimporter.ModelImporterVisualPanel3]: Stop offview panel
INFO [null]: Last record repeated again.
INFO [com.jme3.gde.modelimporter.UberAssetLocator]: Looking in empty list for gagafrise.glb
INFO [org.netbeans.ui.indexing]: Indexing started, time from last indexing 95,218 ms.
INFO [com.jme3.gde.modelimporter.ImportModel]: Copied file C:/Users/Moh/Documents/gagafrise.glb to Models/gagafrise/gagafrise.glb
INFO [com.jme3.gde.modelimporter.ImportModel]: Add file Models/gagafrise/gagafrise.glb to delete list
INFO [com.jme3.gde.modelimporter.ImportModel]: Using real ProjectAssetManager for import instatiation.
WARNING [com.jme3.scene.plugins.gltf.CustomContentManager]: Extension KHR_texture_transform is not supported, please provide your own implementation in the GltfModelKey
INFO [org.netbeans.ui.indexing]: Indexing finished, indexing took 316 ms.
INFO [org.netbeans.ui.indexing]: Indexing started, time from last indexing 0 ms.
INFO [org.netbeans.ui.indexing]: Indexing finished, indexing took 37 ms.
INFO [org.netbeans.ui.indexing]: Indexing started, time from last indexing 0 ms.
WARNING [com.jme3.scene.plugins.gltf.CustomContentManager]: Could not find loader for extension KHR_texture_transform
INFO [org.netbeans.ui.indexing]: Indexing finished, indexing took 132 ms.
INFO [org.netbeans.ui.indexing]: Indexing started, time from last indexing 0 ms.
INFO [org.netbeans.ui.indexing]: Indexing finished, indexing took 101 ms.
WARNING [com.jme3.scene.plugins.gltf.CustomContentManager]: Could not find loader for extension KHR_texture_transform
WARNING [null]: Last record repeated again.
WARNING [null]: Last record repeated 2 more times.
INFO [com.jme3.gde.core.assets.AssetDataObject]: Loaded asset gagafrise
SEVERE [org.openide.util.Exceptions]
java.lang.NullPointerException
	at com.jme3.gde.modelimporter.UberAssetLocator.getInfo(UberAssetLocator.java:97)
[catch] at com.jme3.gde.modelimporter.ImportModel$2.visit(ImportModel.java:265)
	at com.jme3.scene.SceneGraphVisitorAdapter.visit(SceneGraphVisitorAdapter.java:61)
	at com.jme3.scene.Geometry.depthFirstTraversal(Geometry.java:483)
	at com.jme3.scene.Node.depthFirstTraversal(Node.java:801)
	at com.jme3.scene.Spatial.depthFirstTraversal(Spatial.java:1799)
	at com.jme3.gde.modelimporter.ImportModel.replaceLocatedTextures(ImportModel.java:247)
	at com.jme3.gde.modelimporter.ImportModel.copyModel(ImportModel.java:213)
	at com.jme3.gde.modelimporter.ImportModel$1.run(ImportModel.java:104)
	at java.base/java.lang.Thread.run(Thread.java:829)
SEVERE [null]: Last record repeated 4 more times.
INFO [org.netbeans.ui.indexing]: Indexing started, time from last indexing 1,500 ms.
INFO [com.jme3.gde.core.assets.AssetDataObject]: File gagafrise.glb saved successfully
INFO [com.jme3.gde.core.assets.ExternalChangeScanner]: Notified about change in AssetData properties for gagafrise
INFO [com.jme3.gde.core.assets.ExternalChangeScanner]: gagafrise listening for external changes on C:\java\JME\GradleGame\assets\Models\gagafrise\gagafrise.glb@986beb4d:2a368265[invalid]
INFO [com.jme3.gde.core.assets.AssetDataObject]: Set original path for gagafrise to Models/gagafrise/gagafrise.glb
INFO [com.jme3.gde.core.assets.AssetDataObject]: Removing asset Models/gagafrise/gagafrise.glb, from cache via main asset gagafrise.
INFO [com.jme3.gde.core.assets.ExternalChangeScanner]: External file C:\java\JME\GradleGame\assets\Models\gagafrise\gagafrise.glb@986beb4d:2a368265[invalid] for gagafrise deleted!
INFO [com.jme3.gde.core.assets.ExternalChangeScanner]: Remove file change listener for deleted object on gagafrise
INFO [org.netbeans.ui.indexing]: Indexing finished, indexing took 1,098 ms.
INFO [org.netbeans.ui.indexing]: Indexing started, time from last indexing 0 ms.
INFO [org.netbeans.ui.indexing]: Indexing finished, indexing took 91 ms.
INFO [org.netbeans.ui.indexing]: Indexing started, time from last indexing 0 ms.
INFO [org.netbeans.ui.indexing]: Indexing finished, indexing took 68 ms.

KHR_texture_transform is added in JME 3.6. Try with JME 3.6.0-beta2.

2 Likes

thank you

1 Like

can you please give me the link to the implemention of the khr_transform in jme source github?

I just test it with the new beta version still the same result!

this is the only warning i get

JmeDialogsFactory implementation not found.

I just changed jmonkeyengineVersion in game, app, desktop gradle build files
this is the full log i get

Mar 01, 2023 12:57:19 PM com.jme3.system.JmeSystemDelegate lambda$new$1
WARNING: JmeDialogsFactory implementation not found.
Mar 01, 2023 12:57:19 PM com.jme3.system.JmeDesktopSystem initialize
INFO: Running on jMonkeyEngine 3.6.0-beta2
 * Branch: HEAD
 * Git Hash: e71f506
 * Build Date: 2023-02-13
Mar 01, 2023 12:57:19 PM com.jme3.system.lwjgl.LwjglContext printContextInitInfo
INFO: LWJGL 3.3.1 build 7 context running on thread jME3 Main
 * Graphics Adapter: GLFW 3.4.0 Win32 WGL Null EGL OSMesa VisualC DLL
Mar 01, 2023 12:57:19 PM com.jme3.renderer.opengl.GLRenderer loadCapabilitiesCommon
INFO: OpenGL Renderer Information
 * Vendor: Intel
 * Renderer: Intel(R) HD Graphics 530
 * OpenGL Version: 3.2.0 - Build 30.0.101.1692
 * GLSL Version: 1.50 - Build 30.0.101.1692
 * Profile: Core
Mar 01, 2023 12:57:19 PM com.jme3.audio.openal.ALAudioRenderer initOpenAL
INFO: Audio Renderer Information
 * Device: OpenAL Soft
 * Vendor: OpenAL Community
 * Renderer: OpenAL Soft
 * Version: 1.1 ALSOFT 1.21.1
 * Supported channels: 64
 * ALC extensions: ALC_ENUMERATE_ALL_EXT ALC_ENUMERATION_EXT ALC_EXT_CAPTURE ALC_EXT_DEDICATED ALC_EXT_disconnect ALC_EXT_EFX ALC_EXT_thread_local_context ALC_SOFT_device_clock ALC_SOFT_HRTF ALC_SOFT_loopback ALC_SOFT_loopback_bformat ALC_SOFT_output_limiter ALC_SOFT_pause_device
 * AL extensions: AL_EXT_ALAW AL_EXT_BFORMAT AL_EXT_DOUBLE AL_EXT_EXPONENT_DISTANCE AL_EXT_FLOAT32 AL_EXT_IMA4 AL_EXT_LINEAR_DISTANCE AL_EXT_MCFORMATS AL_EXT_MULAW AL_EXT_MULAW_BFORMAT AL_EXT_MULAW_MCFORMATS AL_EXT_OFFSET AL_EXT_source_distance_model AL_EXT_SOURCE_RADIUS AL_EXT_STEREO_ANGLES AL_LOKI_quadriphonic AL_SOFT_bformat_ex AL_SOFTX_bformat_hoa AL_SOFT_block_alignment AL_SOFTX_callback_buffer AL_SOFTX_convolution_reverb AL_SOFT_deferred_updates AL_SOFT_direct_channels AL_SOFT_direct_channels_remix AL_SOFT_effect_target AL_SOFT_events AL_SOFTX_filter_gain_ex AL_SOFT_gain_clamp_ex AL_SOFT_loop_points AL_SOFTX_map_buffer AL_SOFT_MSADPCM AL_SOFT_source_latency AL_SOFT_source_length AL_SOFT_source_resampler AL_SOFT_source_spatialize
Mar 01, 2023 12:57:19 PM com.jme3.audio.openal.ALAudioRenderer initOpenAL
INFO: Audio effect extension version: 1.0
Mar 01, 2023 12:57:19 PM com.jme3.audio.openal.ALAudioRenderer initOpenAL
INFO: Audio max auxiliary sends: 2

Here it is

See, for the above warning

1 Like

well what about unchanged result of the 3d model whit no warning how i debug it now?

Can you upload the model so I can try it?

i just tried it with libgdx importer it working as expected!

yes i can upload wait please i will send the link in private message to you
EDIT: i sent it here

here is the link please use it

I do not understand this. Do you mean you can view the model fine in LibGdx but not in JME?

no bro don’t get me wrong, i thought since that is in java maybe be helpful. I like both jme and libgdx i have several 2d games done in libgdx many times i inspired by codes there.

and yes it is fine in libgdx if it is helpful to you

1 Like

I see, I will try it and let you know the result.

1 Like

It loads fine for me

Tried in TestGltfLoading

and replaced

loadModel("Models/gltf/duck/Duck.gltf", new Vector3f(0, -1, 0), 1);

with

loadModel("Models/gagafrise.glb", new Vector3f(0, 0, 0), 1);

I don’t get what makes the this code diffrent with my code,
so for loading glb files, Spatial s = assetManager.loadModel(“model”);
is not enough? i think i need to have GltfModelKey too right?
would you please retest in like you just made a new project in one class extends simpleapplication and with just minimum essentials?

I think you need to add a lighprobe to your scene.

Searching for “how to add a lightprobe” in the forum you will get a plenty of result I belive.

I already have it, I mean it doesn’t work with light probe @Ali_RS

1 Like

Hmm, then I do not know what is the issue. You may need to create a minimal test case so we can try it.

1 Like

hey @Ali_RS today i found out with this code

        FilterPostProcessor fpp = new FilterPostProcessor(assetManager);
        int numSamples = context.getSettings().getSamples();
        if (numSamples > 0) {
            fpp.setNumSamples(numSamples);
        }

//        fpp.addFilter(new FXAAFilter());
        fpp.addFilter(new ToneMapFilter(Vector3f.UNIT_XYZ.mult(4.0f)));
//        fpp.addFilter(new SSAOFilter(0.5f, 3, 0.2f, 0.2f));
        viewPort.addProcessor(fpp);

material of the frisebee get semi visible (not fully as expected) also i tried to subtract alpha in modo, and also to make transparent amount opacity to 0 but nothing took affect except that filter but also game get lots of lags. despite the fps keep at 60 still lags.

I also may find something even more interesting, i used babylon.js to inspect the model, i found if i choose to display vertex colors i get something similar to jme, so how can i check to see if the model has vertexcolors true or false in jme? I cannot cast spatial to geo i get cast exception in jme as unamed module

doubts.

Please never ever ever mention an exception without the stack trace. Completely useless. Like “I did it and got an error”. That’s nice.

But anyway, 99.99999999% of models loaded will be a Node… which will have Geometry underneath them that you can trivially find with a scene graph visitor.

Edit: added bold on the part that I doubt.

1 Like