Bypassing GPU for mesh loading and reading

Problems building or running the engine, queries about how to use features etc.
slapin
Bronze Sponsor
Bronze Sponsor
Posts: 362
Joined: Fri May 23, 2025 5:04 pm
x 26

Bypassing GPU for mesh loading and reading

Post by slapin »

Hi, all!
For several purposes (physics, procedural generation) I need to load some Ogre's .mesh and .gltf files directly bypassing uploading them to GPU
as it is useless clutter there and might become a problem later, as this is information being interesting on CPU side, but also I'd like to benefit from format support and not reinvent wheel writing my own custom mesh format/loader. Any ideas? As special note because of need of some auto batch processing that would be important to be able to run in total GPU-less headless environment totally in software.

paroj
OGRE Team Member
OGRE Team Member
Posts: 2278
Joined: Sun Mar 30, 2014 2:51 pm
x 1241

Re: Bypassing GPU for mesh loading and reading

Post by paroj »

slapin
Bronze Sponsor
Bronze Sponsor
Posts: 362
Joined: Fri May 23, 2025 5:04 pm
x 26

Re: Bypassing GPU for mesh loading and reading

Post by slapin »

Will try that, thanks!

slapin
Bronze Sponsor
Bronze Sponsor
Posts: 362
Joined: Fri May 23, 2025 5:04 pm
x 26

Re: Bypassing GPU for mesh loading and reading

Post by slapin »

@paroj
Well, I found no way to use it when loading mesh from file.
I'd appreciate an example.

paroj
OGRE Team Member
OGRE Team Member
Posts: 2278
Joined: Sun Mar 30, 2014 2:51 pm
x 1241

Re: Bypassing GPU for mesh loading and reading

Post by paroj »

Code: Select all

DefaultHardwareBufferManager dmgr;
auto mesh = MeshManager::getSingleton().getByName("my.mesh");
mesh->setHardwareBufferManager(&dmgr)
mesh->load();
slapin
Bronze Sponsor
Bronze Sponsor
Posts: 362
Joined: Fri May 23, 2025 5:04 pm
x 26

Re: Bypassing GPU for mesh loading and reading

Post by slapin »

Thanks a lot!

slapin
Bronze Sponsor
Bronze Sponsor
Posts: 362
Joined: Fri May 23, 2025 5:04 pm
x 26

Re: Bypassing GPU for mesh loading and reading

Post by slapin »

Code: Select all

DefaultHardwareBufferManager dmgr;

crashes in case there is hardware buffer manager already initialized (in normal app).
It works in headless tool but I need it to work in normal app too.
If I don't use it I get everything through GPU :(

paroj
OGRE Team Member
OGRE Team Member
Posts: 2278
Joined: Sun Mar 30, 2014 2:51 pm
x 1241

Re: Bypassing GPU for mesh loading and reading

Post by paroj »

use DefaultHardwareBufferManagerBase