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

implement the KHR_mesh_quantization extension #2222

Open
stephengold opened this issue Mar 14, 2024 · 0 comments
Open

implement the KHR_mesh_quantization extension #2222

stephengold opened this issue Mar 14, 2024 · 0 comments

Comments

@stephengold
Copy link
Member

Khronos has specified an extension to glTF for loading meshes with byte and/or short coordinates.

Currently, attempting to load such a model results in an exception:

com.jme3.asset.AssetLoadException: An error occurred loading AnimatedMorphCube/glTF-Quantized/AnimatedMorphCube.gltf
	at com.jme3.scene.plugins.gltf.GltfLoader.loadFromStream(GltfLoader.java:181)
	at com.jme3.scene.plugins.gltf.GltfLoader.load(GltfLoader.java:107)
	at com.jme3.asset.DesktopAssetManager.loadLocatedAsset(DesktopAssetManager.java:274)
	at com.jme3.asset.DesktopAssetManager.loadAsset(DesktopAssetManager.java:390)
	at com.jme3.asset.DesktopAssetManager.loadModel(DesktopAssetManager.java:441)
	at com.github.stephengold.wrench.test.CompareLoaders.loadModel(CompareLoaders.java:886)
	at com.github.stephengold.wrench.test.CompareLoaders.loadModel(CompareLoaders.java:841)
	at com.github.stephengold.wrench.test.CompareLoaders.onAction(CompareLoaders.java:496)
	at jme3utilities.ui.DefaultInputMode.onAction(DefaultInputMode.java:186)
	at com.jme3.input.InputManager.invokeActions(InputManager.java:174)
	at com.jme3.input.InputManager.onKeyEventQueued(InputManager.java:474)
	at com.jme3.input.InputManager.processQueue(InputManager.java:871)
	at com.jme3.input.InputManager.update(InputManager.java:923)
	at com.jme3.app.LegacyApplication.update(LegacyApplication.java:805)
	at com.jme3.app.SimpleApplication.update(SimpleApplication.java:249)
	at com.jme3.system.lwjgl.LwjglWindow.runLoop(LwjglWindow.java:631)
	at com.jme3.system.lwjgl.LwjglWindow.run(LwjglWindow.java:721)
	at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: java.lang.ClassCastException: class java.nio.DirectShortBufferU cannot be cast to class java.nio.FloatBuffer (java.nio.DirectShortBufferU and java.nio.FloatBuffer are in module java.base of loader 'bootstrap')
	at com.jme3.scene.plugins.gltf.GltfLoader.readMeshPrimitives(GltfLoader.java:457)
	at com.jme3.scene.plugins.gltf.GltfLoader.readNode(GltfLoader.java:252)
	at com.jme3.scene.plugins.gltf.GltfLoader.readChild(GltfLoader.java:301)
	at com.jme3.scene.plugins.gltf.GltfLoader.readChild(GltfLoader.java:309)
	at com.jme3.scene.plugins.gltf.GltfLoader.readScenes(GltfLoader.java:218)
	at com.jme3.scene.plugins.gltf.GltfLoader.loadFromStream(GltfLoader.java:155)
	... 17 more

Since the extension may be widely used in the future, it would be nice if jme3-plugins could handle it. I haven't scoped out the changes and don't know whether the core engine supports such meshes.

For examples, see the glTF-Sample-Assets repo at GitHub.

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

No branches or pull requests

1 participant