OGRE-Next
4.0.0unstable
Object-Oriented Graphics Rendering Engine
|
The purpose of this class is to trigger shader compilations on demand (e.g. More...
#include <OgreVertexFormatWarmUp.h>
Public Member Functions | |
VertexFormatWarmUpStorage () | |
~VertexFormatWarmUpStorage () | |
void | analyze (SceneManager *sceneManager) |
void | createWarmUp (SceneManager *sceneManager) |
void | destroyWarmUp () |
void | loadFrom (DataStreamPtr &dataStream) |
void | saveTo (DataStreamPtr &dataStream) |
The purpose of this class is to trigger shader compilations on demand (e.g.
at startup or at loading time) without having to load meshes and skeletons.
Normally to warm up all shader caches, you'd have to create an Item of each Mesh + Material combo that is needed.
This is tedious to keep by hand and can increase loading time and RAM consumption because a significant time is spent on loading meshes and skeletons.
This class simplifies that task by splitting up it up in parts:
What VertexFormatWarmUpStorage in Part I simply does is to collect all useful combos of Vertex_Format + Material settings and saves them to file.
In Part II, VertexFormatWarmUpStorage will create a very small vertex buffer with the same vertex format and apply the material to it. This way attempting to render will result in nothing on screen (because it's all 0s and degenerate triangles), the shader gets parsed and the hit to VRAM and disk loading times are minimum.
Ogre::VertexFormatWarmUpStorage::VertexFormatWarmUpStorage | ( | ) |
Ogre::VertexFormatWarmUpStorage::~VertexFormatWarmUpStorage | ( | ) |
void Ogre::VertexFormatWarmUpStorage::analyze | ( | SceneManager * | sceneManager | ) |
void Ogre::VertexFormatWarmUpStorage::createWarmUp | ( | SceneManager * | sceneManager | ) |
void Ogre::VertexFormatWarmUpStorage::destroyWarmUp | ( | ) |
void Ogre::VertexFormatWarmUpStorage::loadFrom | ( | DataStreamPtr & | dataStream | ) |
void Ogre::VertexFormatWarmUpStorage::saveTo | ( | DataStreamPtr & | dataStream | ) |