http://www.ogre3d.org/tikiwiki/Script+Cache+Plugin
Table of contents
Introduction
Script Cache
The Script Cache plugin attempts to speed up the time taken to parse resource script (like *.material, *.program etc). This is done by caching the binary representation of the compiled script (in memory) to disk, when the application is run the first time. Then on subsequent runs, the scripts would no longer be re-compiled again since their binary representation is already present in the cache. However, if the script is modified by the user, the cache would automatically be discarded and the modified version would be compiled and cached again.
Shader Cache
Ogre 1.8 introduced a new feature called ShaderCache. The plugin automatically uses the ShaderCache feature if compiled with Ogre 1.8+. The plugin would not use ShaderCache for Ogre 1.7 and below
Compiling
Download the latest code from here:
http://code.google.com/p/ogre-script-serializer/source/checkout
Use CMake to create the build system
Build the plugin. You should see the following modules:
Setup
Plugin=Plugin_ScriptSerializer
· [ScriptCache]
· extension=.sbin
· location=./ScriptCache
· searchExtensions=program material particle compositor os pu
·
· [ShaderCache]
filename=Shaders.cache
Note: The Script Cache directory should not be added to your resources.cfg if you include your plain-text scripts. However, if you wish to deploy only the binary scripts, then remove the references to your plain-text scripts and add the Script Cache directory to resources.cfg.
Benchmark
Here is the time it took to compile the scripts and startup the sample browser:
Advantages
Drawbacks
License
Released under MIT licence, similar to OGRE
References
Tracking Thread: http://www.ogre3d.org/forums/viewtopic.php?f=11&t=62487
Download Code: http://code.google.com/p/ogre-script-serializer/
Contributors to this page: CoreDumped .
Page last modified on Wednesday 02 of February, 2011 23:06:39 UTC by CoreDumped .
Ogre 1.8 Shader Cache
http://www.ogre3d.org/forums/viewtopic.php?f=4&t=61004
The idea is to save a cache before you release the product or at the first run on the client computer - and from then on use the cache to load shaders without compiling them.
If you want to save shaders to the cache:
* Before the resource load call GpuProgramManager::getSingleton().setSaveMicrocodesToCache(true);
* When you want to save the cache to a file call - GpuProgramManager::getSingleton().saveMicrocodeCache(...);
When you want to use the cache:
* Before the resource load call - GpuProgramManager::getSingleton().loadMicrocodeCache(...);