Go to the documentation of this file.
28 #ifndef __RenderQueueSortingGrouping_H__
29 #define __RenderQueueSortingGrouping_H__
92 virtual bool visit(
const Pass* p) = 0;
129 OM_SORT_DESCENDING = 2,
133 OM_SORT_ASCENDING = 6
152 return hasha < hashb;
186 return (adepth > bdepth);
261 void removePassGroup(
Pass* p);
270 mOrganisationMode = 0;
280 mOrganisationMode |= om;
289 void sort(
const Camera* cam);
346 void removePassEntry(
Pass* p);
359 bool splitPassesByLightingType,
360 bool splitNoShadowPasses,
361 bool shadowCastersNotReceivers);
370 {
return mSolidsBasic; }
374 {
return mSolidsDiffuseSpecular; }
378 {
return mSolidsDecal; }
382 {
return mSolidsNoShadowReceive; }
385 {
return mTransparentsUnsorted; }
388 {
return mTransparents; }
397 void resetOrganisationModes(
void);
413 void defaultOrganisationMode(
void);
420 void sort(
const Camera* cam);
431 mSplitPassesByLightingType = split;
439 mSplitNoShadowPasses = split;
447 mShadowCastersNotReceivers = ind;
486 bool splitPassesByLightingType,
487 bool splitNoShadowPasses,
488 bool shadowCastersNotReceivers)
490 , mSplitPassesByLightingType(splitPassesByLightingType)
491 , mSplitNoShadowPasses(splitNoShadowPasses)
492 , mShadowCastersNotReceivers(shadowCastersNotReceivers)
493 , mShadowsEnabled(true)
494 , mOrganisationMode(0)
500 PriorityMap::iterator i;
501 for (i = mPriorityGroups.begin(); i != mPriorityGroups.end(); ++i)
523 PriorityMap::iterator i = mPriorityGroups.find(priority);
525 if (i == mPriorityGroups.end())
529 mSplitPassesByLightingType,
530 mSplitNoShadowPasses,
531 mShadowCastersNotReceivers);
532 if (mOrganisationMode)
538 mPriorityGroups.insert(PriorityMap::value_type(priority, pPriorityGrp));
542 pPriorityGrp = i->second;
559 PriorityMap::iterator i, iend;
560 iend = mPriorityGroups.end();
561 for (i = mPriorityGroups.begin(); i != iend; ++i)
570 mPriorityGroups.clear();
596 mSplitPassesByLightingType = split;
597 PriorityMap::iterator i, iend;
598 iend = mPriorityGroups.end();
599 for (i = mPriorityGroups.begin(); i != iend; ++i)
601 i->second->setSplitPassesByLightingType(split);
610 mSplitNoShadowPasses = split;
611 PriorityMap::iterator i, iend;
612 iend = mPriorityGroups.end();
613 for (i = mPriorityGroups.begin(); i != iend; ++i)
615 i->second->setSplitNoShadowPasses(split);
623 mShadowCastersNotReceivers = ind;
624 PriorityMap::iterator i, iend;
625 iend = mPriorityGroups.end();
626 for (i = mPriorityGroups.begin(); i != iend; ++i)
628 i->second->setShadowCastersCannotBeReceivers(ind);
639 mOrganisationMode = 0;
641 PriorityMap::iterator i, iend;
642 iend = mPriorityGroups.end();
643 for (i = mPriorityGroups.begin(); i != iend; ++i)
645 i->second->resetOrganisationModes();
657 mOrganisationMode |= om;
659 PriorityMap::iterator i, iend;
660 iend = mPriorityGroups.end();
661 for (i = mPriorityGroups.begin(); i != iend; ++i)
663 i->second->addOrganisationMode(om);
675 mOrganisationMode = 0;
677 PriorityMap::iterator i, iend;
678 iend = mPriorityGroups.end();
679 for (i = mPriorityGroups.begin(); i != iend; ++i)
681 i->second->defaultOrganisationMode();
698 PriorityMap::iterator i = mPriorityGroups.find(priority);
699 if (i == mPriorityGroups.end())
703 mSplitPassesByLightingType,
704 mSplitNoShadowPasses,
705 mShadowCastersNotReceivers);
706 if (mOrganisationMode)
712 mPriorityGroups.insert(PriorityMap::value_type(priority, pDstPriorityGrp));
716 pDstPriorityGrp = i->second;
720 pDstPriorityGrp->
merge( pSrcPriorityGrp );
RenderablePassList mSortedDescending
Sorted descending (can iterate backwards to get ascending)
QueuedRenderableVisitor()
void setShadowsEnabled(bool enabled)
Indicate whether a given queue group will be doing any shadow setup.
void addOrganisationMode(QueuedRenderableCollection::OrganisationMode om)
Add a required sorting / grouping mode for the solids in this group.
QueuedRenderableCollection mSolidsDiffuseSpecular
Solid per-light pass list, used with additive shadows.
const QueuedRenderableCollection & getSolidsBasic(void) const
Get the collection of basic solids currently queued, this includes all solids when there are no shado...
void setShadowCastersCannotBeReceivers(bool ind)
Sets whether or not objects which cast shadows should be treated as never receiving shadows.
bool hasMoreElements() const
Returns true if there are more items in the collection.
A grouping level underneath RenderQueue which groups renderables to be issued at coarsely the same ti...
Superclass for all objects that wish to use custom memory allocators when their new / delete operator...
bool mSplitPassesByLightingType
bool mSplitNoShadowPasses
virtual ~QueuedRenderableVisitor()
void merge(const RenderQueueGroup *rhs)
Merge group of renderables.
map< ushort, RenderPriorityGroup *, std::less< ushort > >::type PriorityMap
RenderQueueGroup(RenderQueue *parent, bool splitPassesByLightingType, bool splitNoShadowPasses, bool shadowCastersNotReceivers)
MapIterator< PriorityMap > PriorityMapIterator
A viewpoint from which the scene will be rendered.
virtual Real getSquaredViewDepth(const Camera *cam) const =0
Returns the camera-relative squared depth of this renderable.
const QueuedRenderableCollection & getSolidsNoShadowReceive(void) const
Get the collection of solids for which shadow receipt is disabled (only applicable when shadows are e...
void clear(bool destroy=false)
Clears this group of renderables.
void addRenderable(Renderable *pRend, Technique *pTech, ushort priority)
Add a renderable to this group, with the given priority.
const QueuedRenderableCollection & getTransparents(void) const
Get the collection of transparent objects currently queued.
RenderablePass(Renderable *rend, Pass *p)
const QueuedRenderableCollection & getSolidsDecal(void) const
Get the collection of solids currently queued for decal passes (only applicable in additive shadow mo...
vector< RenderablePass >::type RenderablePassList
Vector of RenderablePass objects, this is built on the assumption that vectors only ever increase in ...
void setSplitNoShadowPasses(bool split)
Sets whether or not the queue will split passes which have shadow receive turned off (in their parent...
bool mSplitPassesByLightingType
ConstMapIterator< PriorityMap > ConstPriorityMapIterator
void addRenderable(Renderable *pRend, Technique *pTech)
Add a renderable to this group.
void defaultOrganisationMode(void)
Setthe sorting / grouping mode for the solids in this group to the default.
Class defining a single pass of a Technique (of a Material), i.e.
Class representing an approach to rendering this particular Material.
void addOrganisationMode(OrganisationMode om)
Add a required sorting / grouping mode to this collection when next used.
PriorityMap mPriorityGroups
Map of RenderPriorityGroup objects.
QueuedRenderableCollection mSolidsDecal
Solid decal (texture) pass list, used with additive shadows.
Renderable * renderable
Pointer to the Renderable details.
Visitor interface for items in a QueuedRenderableCollection.
OrganisationMode
Organisation modes required for this collection.
void merge(const RenderPriorityGroup *rhs)
Merge group of renderables.
void setSplitPassesByLightingType(bool split)
Sets whether or not the queue will split passes by their lighting type, ie ambient,...
QueuedRenderableCollection mSolidsBasic
Solid pass list, used when no shadows, modulative shadows, or ambient passes for additive.
static RadixSort< RenderablePassList, RenderablePass, uint32 > msRadixSorter1
Radix sorter for accessing sort value 1 (Pass)
bool _OgreExport operator()(const RenderablePass &a, const RenderablePass &b) const
bool mShadowCastersNotReceivers
bool _OgreExport operator()(const Pass *a, const Pass *b) const
Functor for accessing sort value 1 for radix sort (Pass)
vector< Renderable * >::type RenderableList
bool getShadowsEnabled(void) const
Are shadows enabled for this queue?
Comparator to order objects by descending camera distance.
static RadixSort< RenderablePassList, RenderablePass, float > msRadixSorter2
Radix sorter for sort value 2 (distance)
void setSplitNoShadowPasses(bool split)
Sets whether or not passes which have shadow receive disabled should be separated.
Collection of renderables by priority.
uint32 operator()(const RenderablePass &p) const
float operator()(const RenderablePass &p) const
RenderQueueGroup * mParent
Parent queue group.
ConstPriorityMapIterator getIterator(void) const
Get a const iterator for browsing through child contents.
void addOrganisationMode(QueuedRenderableCollection::OrganisationMode om)
Add a required sorting / grouping mode for the solids in this group.
bool mSplitNoShadowPasses
Concrete IteratorWrapper for nonconst access to the underlying key-value container.
void setSplitPassesByLightingType(bool split)
Sets whether or not the queue will split passes by their lighting type, ie ambient,...
QueuedRenderableCollection mSolidsNoShadowReceive
Solid pass list, used when shadows are enabled but shadow receive is turned off for these passes.
KeyType peekNextKey(void) const
Returns the next(=current) key element in the collection, without advancing to the next.
ValueType getNext()
Returns the next(=current) value element in the collection, and advances to the next.
Pass * pass
Pointer to the Pass.
const QueuedRenderableCollection & getSolidsDiffuseSpecular(void) const
Get the collection of solids currently queued per light (only applicable in additive shadow modes).
Class for performing a radix sort (fast comparison-less sort based on byte value) on various standard...
Lowest level collection of renderables.
Abstract class defining the interface all renderable objects must implement.
QueuedRenderableCollection mTransparents
Transparent list.
Comparator to order pass groups.
bool mShadowsEnabled
Whether shadows are enabled for this queue.
PassGroupRenderableMap mGrouped
Grouped.
bool mShadowCastersNotReceivers
float Real
Software floating point type.
uint32 getHash(void) const
Gets the 'hash' of this pass, ie a precomputed number to use for sorting.
void resetOrganisationModes(void)
Reset the organisation modes required for the solids in this group.
Concrete IteratorWrapper for const access to the underlying key-value container.
void resetOrganisationModes(void)
Reset the organisation modes required for this collection.
static bool RealEqual(Real a, Real b, Real tolerance=std::numeric_limits< Real >::epsilon())
Compare 2 reals, using tolerance for inaccuracies.
RadixSortFunctorDistance(const Camera *cam)
map< Pass *, RenderableList *, PassGroupLess >::type PassGroupRenderableMap
Map of pass to renderable lists, this is a grouping by pass.
QueuedRenderableCollection mTransparentsUnsorted
Unsorted transparent list.
void resetOrganisationModes(void)
Reset the organisation modes required for the solids in this group.
void setShadowCastersCannotBeReceivers(bool ind)
Sets whether or not objects which cast shadows should be treated as never receiving shadows.
uint8 mOrganisationMode
Bitmask of the organisation modes requested (for new priority groups)
uint8 mOrganisationMode
Bitmask of the organisation modes requested.
const QueuedRenderableCollection & getTransparentsUnsorted(void) const
Get the collection of transparent objects currently queued.
DepthSortDescendingLess(const Camera *cam)
Class to manage the scene object rendering queue.
Struct associating a single Pass with a single Renderable.
Functor for descending sort value 2 for radix sort (distance)
PriorityMapIterator getIterator(void)
Get an iterator for browsing through child contents.
Copyright © 2012 Torus Knot Software Ltd

This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
Last modified Tue Apr 13 2021 08:53:15