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