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 );
const QueuedRenderableCollection & getSolidsNoShadowReceive(void) const
Get the collection of solids for which shadow receipt is disabled (only applicable when shadows are e...
QueuedRenderableCollection mSolidsNoShadowReceive
Solid pass list, used when shadows are enabled but shadow receive is turned off for these passes...
Functor for accessing sort value 1 for radix sort (Pass)
A viewpoint from which the scene will be rendered.
void merge(const RenderQueueGroup *rhs)
Merge group of renderables.
void setSplitNoShadowPasses(bool split)
Sets whether or not the queue will split passes which have shadow receive turned off (in their parent...
float Real
Software floating point type.
QueuedRenderableCollection mSolidsDecal
Solid decal (texture) pass list, used with additive shadows.
RenderablePassList mSortedDescending
Sorted descending (can iterate backwards to get ascending)
Struct associating a single Pass with a single Renderable.
Class for performing a radix sort (fast comparison-less sort based on byte value) on various standard...
RenderQueueGroup(RenderQueue *parent, bool splitPassesByLightingType, bool splitNoShadowPasses, bool shadowCastersNotReceivers)
Comparator to order objects by descending camera distance.
vector< Renderable * >::type RenderableList
A grouping level underneath RenderQueue which groups renderables to be issued at coarsely the same ti...
void resetOrganisationModes(void)
Reset the organisation modes required for the solids in this group.
void addOrganisationMode(OrganisationMode om)
Add a required sorting / grouping mode to this collection when next used.
Collection of renderables by priority.
static RadixSort< RenderablePassList, RenderablePass, uint32 > msRadixSorter1
Radix sorter for accessing sort value 1 (Pass)
map< Pass *, RenderableList *, PassGroupLess >::type PassGroupRenderableMap
Map of pass to renderable lists, this is a grouping by pass.
bool mSplitPassesByLightingType
ConstMapIterator< PriorityMap > ConstPriorityMapIterator
const QueuedRenderableCollection & getTransparentsUnsorted(void) const
Get the collection of transparent objects currently queued.
float operator()(const RenderablePass &p) const
void addOrganisationMode(QueuedRenderableCollection::OrganisationMode om)
Add a required sorting / grouping mode for the solids in this group.
OrganisationMode
Organisation modes required for this collection.
Class representing an approach to rendering this particular Material.
QueuedRenderableCollection mTransparents
Transparent list.
void resetOrganisationModes(void)
Reset the organisation modes required for the solids in this group.
DepthSortDescendingLess(const Camera *cam)
RenderQueueGroup * mParent
Parent queue group.
bool mSplitPassesByLightingType
void resetOrganisationModes(void)
Reset the organisation modes required for this collection.
Class defining a single pass of a Technique (of a Material), i.e.
static bool RealEqual(Real a, Real b, Real tolerance=std::numeric_limits< Real >::epsilon())
Compare 2 reals, using tolerance for inaccuracies.
Abstract class defining the interface all renderable objects must implement.
void addOrganisationMode(QueuedRenderableCollection::OrganisationMode om)
Add a required sorting / grouping mode for the solids in this group.
Concrete IteratorWrapper for nonconst access to the underlying key-value container.
bool hasMoreElements() const
Returns true if there are more items in the collection.
void setShadowsEnabled(bool enabled)
Indicate whether a given queue group will be doing any shadow setup.
bool getShadowsEnabled(void) const
Are shadows enabled for this queue?
Lowest level collection of renderables.
void defaultOrganisationMode(void)
Setthe sorting / grouping mode for the solids in this group to the default.
const QueuedRenderableCollection & getSolidsBasic(void) const
Get the collection of basic solids currently queued, this includes all solids when there are no shado...
Comparator to order pass groups.
bool mShadowCastersNotReceivers
Functor for descending sort value 2 for radix sort (distance)
const QueuedRenderableCollection & getSolidsDiffuseSpecular(void) const
Get the collection of solids currently queued per light (only applicable in additive shadow modes)...
uint8 mOrganisationMode
Bitmask of the organisation modes requested (for new priority groups)
vector< RenderablePass >::type RenderablePassList
Vector of RenderablePass objects, this is built on the assumption that vectors only ever increase in ...
RenderablePass(Renderable *rend, Pass *p)
bool mShadowsEnabled
Whether shadows are enabled for this queue.
void addRenderable(Renderable *pRend, Technique *pTech, ushort priority)
Add a renderable to this group, with the given priority.
void setShadowCastersCannotBeReceivers(bool ind)
Sets whether or not objects which cast shadows should be treated as never receiving shadows...
KeyType peekNextKey(void) const
Returns the next(=current) key element in the collection, without advancing to the next...
Superclass for all objects that wish to use custom memory allocators when their new / delete operator...
uint8 mOrganisationMode
Bitmask of the organisation modes requested.
QueuedRenderableCollection mSolidsBasic
Solid pass list, used when no shadows, modulative shadows, or ambient passes for additive.
PassGroupRenderableMap mGrouped
Grouped.
bool mShadowCastersNotReceivers
Visitor interface for items in a QueuedRenderableCollection.
ConstPriorityMapIterator getIterator(void) const
Get a const iterator for browsing through child contents.
uint32 getHash(void) const
Gets the 'hash' of this pass, ie a precomputed number to use for sorting.
void clear(bool destroy=false)
Clears this group of renderables.
void setShadowCastersCannotBeReceivers(bool ind)
Sets whether or not objects which cast shadows should be treated as never receiving shadows...
static RadixSort< RenderablePassList, RenderablePass, float > msRadixSorter2
Radix sorter for sort value 2 (distance)
QueuedRenderableCollection mTransparentsUnsorted
Unsorted transparent list.
uint32 operator()(const RenderablePass &p) const
void setSplitPassesByLightingType(bool split)
Sets whether or not the queue will split passes by their lighting type, ie ambient, per-light and decal.
void addRenderable(Renderable *pRend, Technique *pTech)
Add a renderable to this group.
void setSplitPassesByLightingType(bool split)
Sets whether or not the queue will split passes by their lighting type, ie ambient, per-light and decal.
PriorityMap mPriorityGroups
Map of RenderPriorityGroup objects.
void merge(const RenderPriorityGroup *rhs)
Merge group of renderables.
bool mSplitNoShadowPasses
Class to manage the scene object rendering queue.
Concrete IteratorWrapper for const access to the underlying key-value container.
const QueuedRenderableCollection & getTransparents(void) const
Get the collection of transparent objects currently queued.
void setSplitNoShadowPasses(bool split)
Sets whether or not passes which have shadow receive disabled should be separated.
MapIterator< PriorityMap > PriorityMapIterator
ValueType getNext()
Returns the next(=current) value element in the collection, and advances to the next.
Pass * pass
Pointer to the Pass.
QueuedRenderableCollection mSolidsDiffuseSpecular
Solid per-light pass list, used with additive shadows.
virtual Real getSquaredViewDepth(const Camera *cam) const =0
Returns the camera-relative squared depth of this renderable.
RadixSortFunctorDistance(const Camera *cam)
bool _OgreExport operator()(const Pass *a, const Pass *b) const
virtual ~QueuedRenderableVisitor()
bool _OgreExport operator()(const RenderablePass &a, const RenderablePass &b) const
QueuedRenderableVisitor()
map< ushort, RenderPriorityGroup *, std::less< ushort > >::type PriorityMap
PriorityMapIterator getIterator(void)
Get an iterator for browsing through child contents.
const QueuedRenderableCollection & getSolidsDecal(void) const
Get the collection of solids currently queued for decal passes (only applicable in additive shadow mo...
bool mSplitNoShadowPasses
Renderable * renderable
Pointer to the Renderable details.