creating a 3d scene from gltf assets

A place for users of OGRE to discuss ideas and experiences of utilitising OGRE in their games / demos / applications.
Post Reply
HarlockOne
Gnoblar
Posts: 10
Joined: Tue May 04, 2021 4:21 pm
x 1

creating a 3d scene from gltf assets

Post by HarlockOne »

Hi,
I am using Ogre 14.1 version compiled from sources with all the necessary dependencies and plugins just like the Assimp and the Bullet physics ones.
What I am willing to do is to create a scene from gltf files which ones have been generated starting from Unity assets.
The aim is to not use any Ogre native format/script, instead I would like to go with gltf assets created in Blender.
I have seen that Ogre has chosen to go with Bullet Physics instead of the newton dynamics for what it concerns the rigid body collisions and kinetics.
Considering that I still need to fully understand if it is a good practice to create an entity node pair for the terrain from a gltf asset I would like to ask you if there is a better procedure to do it - for now I can see the terrain rendered by doing simply:

Code: Select all

Ogre::Entity* terrainEntity = sceneMgr->createEntity("terrain", "terrain.gltf");

assert(terrainEntity != nullptr && "Could not create terrain");

Ogre::SceneNode* terrainNode = sceneMgr->getRootSceneNode()->createChildSceneNode("terrainNode");
terrainNode->attachObject(terrainEntity);

I instead am having troubles by loading the scene entities/assets from the second gtlf file (scene_entities.gltf).
Here I would like to have loaded all the scene assets grouped in Ogre just like they are arranged/embedded into the gltf - here I have: bushes, decals, trees, billboards for grass and tree foliage, particles, water planes, rocks and few others.
Which is the best way to do it?

I also would like to have the bullet physics world/engine up and running by a wrapped call instead of doing it manually with some further physics world to 3d engine world manual bindings.
I also would like to have all the rigid bodies being created for the terrain and many of the scene entities like trees, rocks, etc.
There is a practical example of how doing it with OgreNewt2 - I can only imagine that I will be using a second frameListener for the bullet physics transformations.

In summary what I am looking for is a source for some examples where we can load assets from files (better if in fbx, gltf or similar format) for the terrain and all the other "statics" entities just like Unity and Godot do and how to run the bullet physics through the ogre wrapper.
For the latter I have just found some references but in any case a couple of snips more will help more.

Attached you will find the image of the scene I am trying to recreate.

Thank you all in advance and sorry for probably asking again what has been just covered.

Image

HarlockOne
Gnoblar
Posts: 10
Joined: Tue May 04, 2021 4:21 pm
x 1

Re: creating a 3d scene from gltf assets

Post by HarlockOne »

No replies, no help :)
Just given a try with the blender2ogre and the result is so bad that this tool/add-on/exporter can not even be called like that.
Tried to export/convert the gltf scene into a .scene xml file with all the mesh and material files part of it and the result is catastrophic.
For a demo scene (the one attached above) which is only a small chunk of what the finished level will be (20x/30x bigger) I left the blender2ogre exporter run and after 5 HOURS it was still running and who knows how many hours/days it could still take.
You all can come up to the conclusion.

User avatar
sercero
Bronze Sponsor
Bronze Sponsor
Posts: 450
Joined: Sun Jan 18, 2015 4:20 pm
Location: Buenos Aires, Argentina
x 156

Re: creating a 3d scene from gltf assets

Post by sercero »

I responded to the other thread before looking at this one.

I think you should take the route of using GLTF directly to load the assets.

I'm not familiar with the format, so I don't know if it supports having a "scene" or only meshes/"assets".

The integration with Bullet Physics is a bit "green" in my opinion, I made an integration a few years back and did it differently.
Probably you will have to do the integration yourself, if you prefer Newton Dynamics you can use that instead of Bullet.
OGRE is only a rendering engine, it gives you the freedom to choose the other components yourself if you are making a game.

You should not expect OGRE to hold your hand like Godot or Unity, sorry but that is not how it is.

Also this community is very small so you don't have a lot of people looking at posts.

I see that you want to start big with OGRE, that is not a good idea.

Try first to import something more simple, a simple mesh and then start adding more things as you get more proficient.

It took me years to have a modest understanding of the OGRE ecosystem.

Post Reply