Skip to content

Depreciation of Ogre Loader#2713

Open
NwosuTy wants to merge 3 commits intojMonkeyEngine:masterfrom
NwosuTy:Dev_Conceited-Ogre-Depreciation
Open

Depreciation of Ogre Loader#2713
NwosuTy wants to merge 3 commits intojMonkeyEngine:masterfrom
NwosuTy:Dev_Conceited-Ogre-Depreciation

Conversation

@NwosuTy
Copy link
Copy Markdown

@NwosuTy NwosuTy commented Apr 18, 2026

Marked Ogre Loader as decprcated

Used Assimp CLI for batch conversion of example models to Gltf from.mesh.xml(ogre)

Then switched examples to make use of new gltf models excluding the ones that explicitly showcase the ogre loader

Marked Ogre Loader as decprcated

Used Assimp CLI for batch conversion of example models to Gltf from.mesh.xml(ogre)

Then switched examples to make use of new gltf models excluding the ones that explicitly showcase the ogre loader
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request migrates numerous examples and test cases from the deprecated Ogre model format to glTF and officially marks the Ogre loader classes as deprecated. Feedback indicates that several updated examples (such as TestLightScattering, TestSSAO2, and the stress tests) use fragile manual child access and explicit casts to Geometry that will likely result in ClassCastException due to the structural differences in glTF models. Furthermore, the Ninja.gltf asset is missing from the contribution, and certain models like Oto and Sinbad were overlooked in the conversion process.

Comment thread jme3-examples/src/main/java/jme3test/post/TestLightScattering.java Outdated
Comment thread jme3-examples/src/main/java/jme3test/post/TestSSAO2.java Outdated
Comment thread jme3-examples/src/main/java/jme3test/stress/TestBatchLod.java Outdated
Comment thread jme3-examples/src/main/java/jme3test/stress/TestLodStress.java
Comment thread jme3-examples/src/main/java/jme3test/tools/TestTextureAtlas.java Outdated
Comment thread jme3-examples/src/main/java/jme3test/helloworld/HelloAssets.java
@riccardobl
Copy link
Copy Markdown
Member

riccardobl commented Apr 18, 2026

Thanks! Can you look into the problems reported by gemini and make sure every modified example is rendered properly?
Also, please remove the old ogre files if they are not used by any test or example

@NwosuTy
Copy link
Copy Markdown
Author

NwosuTy commented Apr 18, 2026

Yh sure would do that now

NwosuTy added 2 commits April 18, 2026 22:37
Fixed casting isues in class that still used older structure of ogre models as opposed to newer GLTF geometry
@NwosuTy
Copy link
Copy Markdown
Author

NwosuTy commented Apr 18, 2026

alright i have resolved all gemini problems, removed all unused ogre files and confirmed that the examples are rendered properly

@NwosuTy
Copy link
Copy Markdown
Author

NwosuTy commented Apr 18, 2026

@riccardobl

@yaRnMcDonuts yaRnMcDonuts added this to the v3.10.0 milestone Apr 18, 2026
@riccardobl
Copy link
Copy Markdown
Member

@gemini-code-assist do another review

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request migrates jMonkeyEngine examples from the deprecated Ogre XML format to glTF and marks Ogre asset loaders as deprecated. Feedback indicates that the new glTF node hierarchy will cause ClassCastExceptions in TestLodStress and TestHoverTank where Geometry casts are performed on child nodes. Furthermore, replacing the Sinbad character with a sword in TestTextureAtlas reduces test coverage, and the findFirstGeometry helper method should be moved to a common utility to avoid duplication across test files.

rootNode.addLight(dl);

Node teapotNode = (Node) assetManager.loadModel("Models/Teapot/Teapot.mesh.xml");
Node teapotNode = (Node) assetManager.loadModel("Models/Teapot/Teapot.gltf");
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Switching to the glTF format for the teapot model will cause a ClassCastException on line 60. The glTF loader introduces a wrapper node hierarchy, meaning teapotNode.getChild(0) will return a Node instead of a Geometry. This test should be updated to use a recursive search for the geometry, similar to the findFirstGeometry() helper method implemented in TestSSAO2.java or TestBatchLod.java.

References
  1. Issues found in test code should be reported with a reduced priority, at most medium.

@Override
public void simpleInitApp() {
Node tank = (Node) assetManager.loadModel("Models/HoverTank/Tank2.mesh.xml");
Node tank = (Node) assetManager.loadModel("Models/HoverTank/Tank2.gltf");
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Switching to the glTF format for the tank model will cause a ClassCastException on line 69: Geometry tankGeom = (Geometry) tank.getChild(0);. Due to the glTF loader's node structure, tank.getChild(0) is now a Node. You should update line 69 to correctly locate the geometry within the new hierarchy, perhaps by using a recursive search.

References
  1. Issues found in test code should be reported with a reduced priority, at most medium.

Spatial obj3 = assetManager.loadModel("Models/Ninja/Ninja.gltf");
obj3.setLocalTranslation(-0, 0, 0);
Spatial obj4 = assetManager.loadModel("Models/Sinbad/Sinbad.mesh.xml");
Spatial obj4 = assetManager.loadModel("Models/Sinbad/Sword.gltf");
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Replacing the Sinbad character model with just his sword significantly reduces the complexity of this texture atlas test. If the full Sinbad character model is not available in glTF, consider using another character model (like Elephant.gltf or Ninja.gltf) to maintain the test's original intent of batching multiple complex models with distinct textures.

* Recursively finds the first Geometry in a spatial hierarchy.
* Handles both simple flat structures and complex nested node trees.
*/
private Geometry findFirstGeometry(com.jme3.scene.Spatial spatial) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This helper method is duplicated in TestBatchLod.java. Consider moving it to a common utility class to improve maintainability. Additionally, the fully qualified class name com.jme3.scene.Spatial is redundant here as Spatial is already imported.

@riccardobl
Copy link
Copy Markdown
Member

riccardobl commented Apr 19, 2026

confirmed that the examples are rendered properly

Sorry, but how can you confirm that, when in some examples the model was changed entirely instead of being properly ported? For example, Oto was replaced with Elephant. And some others just break because the converted glTF has a different scene graph, while the code still assumes the old one.

This bounty is medium difficulty because it requires manual testing to make sure all examples (a very important part of the engine) are still working, sane, and ported correctly. From this PR, it does not look like that manual testing was done, because otherwise it would have been obvious that parts of it are broken.

Anyone can run a batch conversion with Copilot. What is needed here is actual human testing.

@NwosuTy
Copy link
Copy Markdown
Author

NwosuTy commented Apr 19, 2026

I'd have a look, cause I viewed them using Blender and running the engine to confirm they did render properly albeit not all models, I'd cross-check and fix any problems and commit, sorry

@NwosuTy
Copy link
Copy Markdown
Author

NwosuTy commented Apr 19, 2026

@riccardobl want to confirm one last thing before push, cause i am using blender to export and import each mesh, when exporting the ogre mesh there are no textures needed to confirm if thats okay or if i should include their textures

i would also love to know, during conversion from ogre file to gltf i noticed that LOD data in for example the Teapot and SignTracker got lost, i wanted to inquire if i should create a new LOD Data, modify the LOD code to check if LOD Levels is greater than zero before creating LOD group or maintain ogre files for LOD testing in examples like TestBatchLOD, please if you could answer urgently would be nice

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

Successfully merging this pull request may close these issues.

3 participants