Packaging materials and assets

Anything and everything that's related to OGRE or the wider graphics field that doesn't fit into the other forums.
Post Reply
Frankincense
Kobold
Posts: 33
Joined: Mon May 05, 2014 5:36 pm
x 3

Packaging materials and assets

Post by Frankincense »

Hi all,

I'm looking to see what the general approach is to releasing a game with it's scripts, materials and assets. Ideally I would like to have all of the shader/material text files as binaries (presumably using the HLMS & microcode cache? viewtopic.php?f=4&t=61004 & viewtopic.php?f=11&t=62487).

Is there a standard approach for creating binaries for materials/shaders? Or are the raw text files always packaged?
Could I play my game and then package the hlmsDiskCacheX.bin & microcodeCodeCache.cache files? Or are these files host/execution specific?
Would something like the Script Cache Plugin generate binaries that can be safely deployed? https://wiki.ogre3d.org/Script+Cache+Plugin

Also, if I wanted to package up the other game assets (textures, models, etc.) then I presume a multi-file archive format is the standard approach?


Thanks,
Frank
User avatar
dark_sylinc
OGRE Team Member
OGRE Team Member
Posts: 5296
Joined: Sat Jul 21, 2007 4:55 pm
Location: Buenos Aires, Argentina
x 1278
Contact:

Re: Packaging materials and assets

Post by dark_sylinc »

Hi!
Frankincense wrote: Wed Oct 27, 2021 10:02 pm Ideally I would like to have all of the shader/material text files as binaries (presumably using the HLMS & microcode cache?
I'm afraid the Hlms files will have to be bundled as text; however it can be obfuscated via the Resource system.

The caches merely optimize load times to avoid hitches.
Frankincense wrote: Wed Oct 27, 2021 10:02 pm Could I play my game and then package the hlmsDiskCacheX.bin & microcodeCodeCache.cache files? Or are these files host/execution specific?
See Ogre 2.1 FAQ:
Direct3D11's shader cache can be used anywhere, including other systems.
OpenGL's shader cache can only be used in the computer it was generated with, and may be invalidated if the user updates his drivers or changes GPU.
The HlmsDiskCache can be bundled to all of your clients, it's not host-specific. And with the HlmsDiskCache you can generate a new microcode cache on the local client.
Frankincense wrote: Wed Oct 27, 2021 10:02 pm Also, if I wanted to package up the other game assets (textures, models, etc.) then I presume a multi-file archive format is the standard approach?
The ResourceGroupManager system hasn't changed since Ogre 1.x; thus the same documentation applies to most of it. If you want to package stuff you do it as Zips rather than files. If Zips is too standard for you (i.e. anyone can open a zip file), you can take a look at ZipArchive and implement your own that performs your own obfuscation (i.e. that's what Torchlight & Shadows Heretic Kingdom did).

How you actually want to proceed is up to you.
Frankincense
Kobold
Posts: 33
Joined: Mon May 05, 2014 5:36 pm
x 3

Re: Packaging materials and assets

Post by Frankincense »

Excellent, thanks for your help - I will look into how to apply some sort of obfuscated zip files and see how that goes :)
Post Reply