|
| HlmsManager () |
|
virtual | ~HlmsManager () |
|
void | _changeRenderSystem (RenderSystem *newRs) |
|
void | _datablockAdded (HlmsDatablock *datablock) |
| Internal function used by Hlms types to tell us a datablock has been created so that we can return it when the user calls @getDatablock.
|
|
void | _datablockDestroyed (IdString name) |
| Internal function to inform us that the datablock with the input name has been destroyed.
|
|
const BlockIdxVec & | _getActiveBlocksIndices (const HlmsBasicBlock &blockType) const |
| Gets the indices of active blocks.
|
|
const HlmsBlendblock * | _getBlendblock (uint16 idx) const |
| Gets a blendblock based on its index.
|
|
BasicBlock const *const * | _getBlocks (const HlmsBasicBlock &blockType) const |
| Gets all blocks of a given type.
|
|
uint16 | _getInputLayoutId (const VertexElement2VecVec &vertexElements, OperationType opType) |
| Always returns a unique ID for the given vertexElement / OperationType combination, necessary by Hlms to generate a unique PSO.
|
|
const HlmsMacroblock * | _getMacroblock (uint16 idx) const |
| Gets a macroblock based on its index.
|
|
const HlmsSamplerblock * | _getSamplerblock (uint16 idx) const |
| Gets a samplerblock based on its index.
|
|
void | addReference (const BasicBlock *block) |
| Increments the reference count for the block, despite being const.
|
|
void | destroyBlendblock (const HlmsBlendblock *Blendblock) |
|
void | destroyMacroblock (const HlmsMacroblock *macroblock) |
| Destroys a macroblock created by HlmsManager::getMacroblock.
|
|
void | destroySamplerblock (const HlmsSamplerblock *Samplerblock) |
| @See destroyMacroblock
|
|
const HlmsBlendblock * | getBlendblock (const HlmsBlendblock &baseParams) |
| See HlmsManager::getMacroblock.
|
|
HlmsCompute * | getComputeHlms (void) |
|
HlmsDatablock * | getDatablock (IdString name) const |
| Retrieves an exisiting datablock (i.e.
|
|
HlmsDatablock * | getDatablockNoDefault (IdString name) const |
| @See getDatablock.
|
|
const HlmsDatablockMap & | getDatablocks (void) const |
| Returns all registered datablocks.
|
|
HlmsDatablock * | getDefaultDatablock (void) const |
| Datablock to use when another datablock failed or none was specified.
|
|
Hlms * | getHlms (HlmsTypes type) |
| Returns a registered HLMS based on type. May be null.
|
|
Hlms * | getHlms (IdString name) |
| Returns a registered HLMS based on name. May be null.
|
|
virtual Real | getLoadingOrder (void) const |
| Gets the relative loading order of scripts of this type.
|
|
const HlmsMacroblock * | getMacroblock (const HlmsMacroblock &baseParams) |
| Creates a macroblock that matches the same parameter as the input.
|
|
HlmsDatablock * | getMaterial (IdString name) const |
| Alias function.
|
|
const HlmsSamplerblock * | getSamplerblock (HlmsSamplerblock baseParams) |
| @See getMacroblock.
|
|
virtual const StringVector & | getScriptPatterns (void) const |
| Gets the file patterns which should be used to find scripts for this class.
|
|
bool | getShadowMappingUseBackFaces (void) |
|
HlmsTextureManager * | getTextureManager (void) const |
|
void | loadMaterials (const String &filename, const String &groupName, HlmsJsonListener *listener, const String &additionalTextureExtension) |
| Opens a file containing a JSON string to load all Hlms materials from.
|
|
void | operator delete (void *ptr) |
|
void | operator delete (void *ptr, const char *, int, const char *) |
|
void | operator delete (void *ptr, void *) |
|
void | operator delete[] (void *ptr) |
|
void | operator delete[] (void *ptr, const char *, int, const char *) |
|
void * | operator new (size_t sz) |
|
void * | operator new (size_t sz, const char *file, int line, const char *func) |
| operator new, with debug line info
|
|
void * | operator new (size_t sz, void *ptr) |
| placement operator new
|
|
void * | operator new[] (size_t sz) |
|
void * | operator new[] (size_t sz, const char *file, int line, const char *func) |
| array operator new, with debug line info
|
|
virtual void | parseScript (DataStreamPtr &stream, const String &groupName) |
| Parse a script file.
|
|
void | registerComputeHlms (HlmsCompute *provider) |
|
void | registerHlms (Hlms *provider, bool deleteOnExit=true) |
| Registers an HLMS provider.
|
|
void | saveMaterial (const HlmsDatablock *datablock, const String &filename, HlmsJsonListener *listener, const String &additionalTextureExtension) |
| Saves a specific Hlms material at the given file location.
|
|
void | saveMaterials (HlmsTypes hlmsType, const String &filename, HlmsJsonListener *listener, const String &additionalTextureExtension) |
| Saves all materials of the registered Hlms at the given file location.
|
|
void | setShadowMappingUseBackFaces (bool useBackFaces) |
| Sets whether or not shadow casters should be rendered into shadow textures using their back faces rather than their front faces.
|
|
void | unregisterComputeHlms (void) |
|
void | unregisterHlms (HlmsTypes type) |
| Unregisters an HLMS provider of the given type.
|
|
void | useDefaultDatablockFrom (HlmsTypes type) |
|
HLMS stands for "High Level Material System".
HlmsMacroblock & HlmsBlendblock pointers are never recycled when their reference counts reach 0. This allows us to better cache PSOs instead of destroying them every time materials are destroyed.
A user can only create up to OGRE_HLMS_MAX_LIFETIME_MACROBLOCKS & OGRE_HLMS_MAX_LIFETIME_BLENDBLOCKS. If for some reason you need more, increase these values (they're macros) and recompile Ogre
Always returns a unique ID for the given vertexElement / OperationType combination, necessary by Hlms to generate a unique PSO.
We store the OperationType in the last 6 bits because of v1 reasons, since v1::VertexDeclaration does not store OperationType, thus it cannot cache beforehand, and calling this function from Hlms::calculateHashForV1 would make material asignment to SubEntity more expensive than it is.
That means there 10 bits left for vertexElements, and that's how many different vertex elements you can create (1024).
- See also
- v1::VertexDeclaration::_getInputLayoutId
- Parameters
-
- Returns
- The returned value is deterministic, however it depends on the order in which _getInputLayoutId is called.
Destroys a macroblock created by HlmsManager::getMacroblock.
Blocks are manually reference counted and calling this function will decrease the count.
The internal object (BasicBlock::mRsData) will actually be destroyed when the count reaches 0; however the actual pointer is never deallocated throghout the lifetime of HlmsManager, it is only deactivated.
This guarantees caches of HlmsPso that once a Macroblock is created, its pointer always valid.
When count reaches 0, it will perform an O(N) search but N <= OGRE_HLMS_NUM_MACROBLOCKS
Creates a macroblock that matches the same parameter as the input.
If it already exists, returns the existing one.
Macroblocks must be destroyed with destroyMacroblock. Don't try to delete the pointer directly.
Calling this function will increase the reference count of the block. Make sure to call destroyMacroblock after you're done using it; which will decrease the reference count (it won't be actually destroyed until the reference is 0).
Up to 32 different macroblocks are supported at the same time.
VERY IMPORTANT:
You can only create up to OGRE_HLMS_MAX_LIFETIME_MACROBLOCKS different macroblocks throghout the entire lifetime of HlmsManager, EVEN if you call destroyMacroblock on them, as we need to ensure caches of HlmsPso remain valid.
- Parameters
-
baseParams | A macroblock reference to base the parameters. This reference may live on the stack, on the heap, etc; it's RS-specific data does not have to be filled. e.g. this is fine: HlmsMacroblock myRef; myRef.mDepthCheck = false; HlmsMacroblock *finalBlock = manager->getMacroblock( myRef ); myRef.mRsData == finalBlock.mRsData not necessarily true |
- Returns
- Created or cached datablock with same parameters as baseParams