28#ifndef __RenderQueueSortingGrouping_H__
29#define __RenderQueueSortingGrouping_H__
152 return hasha < hashb;
186 return (adepth > bdepth);
359 bool splitPassesByLightingType,
360 bool splitNoShadowPasses,
361 bool shadowCastersNotReceivers);
486 bool splitPassesByLightingType,
487 bool splitNoShadowPasses,
488 bool shadowCastersNotReceivers)
500 PriorityMap::iterator i;
538 mPriorityGroups.insert(PriorityMap::value_type(priority, pPriorityGrp));
542 pPriorityGrp = i->second;
559 PriorityMap::iterator i, iend;
597 PriorityMap::iterator i, iend;
601 i->second->setSplitPassesByLightingType(split);
611 PriorityMap::iterator i, iend;
615 i->second->setSplitNoShadowPasses(split);
624 PriorityMap::iterator i, iend;
628 i->second->setShadowCastersCannotBeReceivers(ind);
641 PriorityMap::iterator i, iend;
645 i->second->resetOrganisationModes();
659 PriorityMap::iterator i, iend;
663 i->second->addOrganisationMode(om);
677 PriorityMap::iterator i, iend;
681 i->second->defaultOrganisationMode();
712 mPriorityGroups.insert(PriorityMap::value_type(priority, pDstPriorityGrp));
716 pDstPriorityGrp = i->second;
720 pDstPriorityGrp->
merge( pSrcPriorityGrp );
A viewpoint from which the scene will be rendered.
Concrete IteratorWrapper for const access to the underlying key-value container.
bool hasMoreElements() const
KeyType peekNextKey(void) const
Concrete IteratorWrapper for nonconst access to the underlying key-value container.
static bool RealEqual(Real a, Real b, Real tolerance=std::numeric_limits< Real >::epsilon())
Compare 2 reals, using tolerance for inaccuracies.
Class defining a single pass of a Technique (of a Material), i.e.
uint32 getHash(void) const
Gets the 'hash' of this pass, ie a precomputed number to use for sorting.
Lowest level collection of renderables.
void addOrganisationMode(OrganisationMode om)
Add a required sorting / grouping mode to this collection when next used.
PassGroupRenderableMap mGrouped
Grouped.
~QueuedRenderableCollection()
void acceptVisitorDescending(QueuedRenderableVisitor *visitor) const
Internal visitor implementation.
void acceptVisitorAscending(QueuedRenderableVisitor *visitor) const
Internal visitor implementation.
static RadixSort< RenderablePassList, RenderablePass, uint32 > msRadixSorter1
Radix sorter for accessing sort value 1 (Pass)
vector< Renderable * >::type RenderableList
void acceptVisitorGrouped(QueuedRenderableVisitor *visitor) const
Internal visitor implementation.
void merge(const QueuedRenderableCollection &rhs)
Merge renderable collection.
vector< RenderablePass >::type RenderablePassList
Vector of RenderablePass objects, this is built on the assumption that vectors only ever increase in ...
void addRenderable(Pass *pass, Renderable *rend)
Add a renderable to the collection using a given pass.
OrganisationMode
Organisation modes required for this collection.
@ OM_SORT_ASCENDING
Sort ascending camera distance Note value overlaps with descending since both use same sort.
@ OM_PASS_GROUP
Group by pass.
@ OM_SORT_DESCENDING
Sort descending camera distance.
RenderablePassList mSortedDescending
Sorted descending (can iterate backwards to get ascending)
void removePassGroup(Pass *p)
Remove the group entry (if any) for a given Pass.
static RadixSort< RenderablePassList, RenderablePass, float > msRadixSorter2
Radix sorter for sort value 2 (distance)
map< Pass *, RenderableList *, PassGroupLess >::type PassGroupRenderableMap
Map of pass to renderable lists, this is a grouping by pass.
void clear(void)
Empty the collection.
uint8 mOrganisationMode
Bitmask of the organisation modes requested.
void acceptVisitor(QueuedRenderableVisitor *visitor, OrganisationMode om) const
Accept a visitor over the collection contents.
void sort(const Camera *cam)
Perform any sorting that is required on this collection.
QueuedRenderableCollection()
void resetOrganisationModes(void)
Reset the organisation modes required for this collection.
Visitor interface for items in a QueuedRenderableCollection.
virtual void visit(Renderable *r)=0
Visit method called once per Renderable on a grouped collection.
virtual ~QueuedRenderableVisitor()
virtual void visit(RenderablePass *rp)=0
Called when visiting a RenderablePass, i.e.
virtual bool visit(const Pass *p)=0
QueuedRenderableVisitor()
Class for performing a radix sort (fast comparison-less sort based on byte value) on various standard...
Collection of renderables by priority.
void setSplitPassesByLightingType(bool split)
Sets whether or not the queue will split passes by their lighting type, ie ambient,...
void addSolidRenderable(Technique *pTech, Renderable *rend, bool toNoShadowMap)
Internal method for adding a solid renderable.
void sort(const Camera *cam)
Sorts the objects which have been added to the queue; transparent objects by their depth in relation ...
const QueuedRenderableCollection & getSolidsNoShadowReceive(void) const
Get the collection of solids for which shadow receipt is disabled (only applicable when shadows are e...
const QueuedRenderableCollection & getSolidsDiffuseSpecular(void) const
Get the collection of solids currently queued per light (only applicable in additive shadow modes).
const QueuedRenderableCollection & getSolidsBasic(void) const
Get the collection of basic solids currently queued, this includes all solids when there are no shado...
QueuedRenderableCollection mSolidsDiffuseSpecular
Solid per-light pass list, used with additive shadows.
QueuedRenderableCollection mTransparentsUnsorted
Unsorted transparent list.
bool mSplitNoShadowPasses
RenderPriorityGroup(RenderQueueGroup *parent, bool splitPassesByLightingType, bool splitNoShadowPasses, bool shadowCastersNotReceivers)
const QueuedRenderableCollection & getTransparentsUnsorted(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.
void addUnsortedTransparentRenderable(Technique *pTech, Renderable *rend)
Internal method for adding an unsorted transparent renderable.
const QueuedRenderableCollection & getTransparents(void) const
Get the collection of transparent objects currently queued.
void addTransparentRenderable(Technique *pTech, Renderable *rend)
Internal method for adding a transparent renderable.
bool mShadowCastersNotReceivers
void defaultOrganisationMode(void)
Set the sorting / grouping mode for the solids in this group to the default.
void addRenderable(Renderable *pRend, Technique *pTech)
Add a renderable to this group.
QueuedRenderableCollection mSolidsBasic
Solid pass list, used when no shadows, modulative shadows, or ambient passes for additive.
const QueuedRenderableCollection & getSolidsDecal(void) const
Get the collection of solids currently queued for decal passes (only applicable in additive shadow mo...
QueuedRenderableCollection mTransparents
Transparent list.
void setShadowCastersCannotBeReceivers(bool ind)
Sets whether or not objects which cast shadows should be treated as never receiving shadows.
void clear(void)
Clears this group of renderables.
void addSolidRenderableSplitByLightType(Technique *pTech, Renderable *rend)
Internal method for adding a solid renderable.
QueuedRenderableCollection mSolidsNoShadowReceive
Solid pass list, used when shadows are enabled but shadow receive is turned off for these passes.
void merge(const RenderPriorityGroup *rhs)
Merge group of renderables.
void removePassEntry(Pass *p)
remove a pass entry from all collections
void addOrganisationMode(QueuedRenderableCollection::OrganisationMode om)
Add a required sorting / grouping mode for the solids in this group.
QueuedRenderableCollection mSolidsDecal
Solid decal (texture) pass list, used with additive shadows.
bool mSplitPassesByLightingType
RenderQueueGroup * mParent
Parent queue group.
void resetOrganisationModes(void)
Reset the organisation modes required for the solids in this group.
A grouping level underneath RenderQueue which groups renderables to be issued at coarsely the same ti...
void addRenderable(Renderable *pRend, Technique *pTech, ushort priority)
Add a renderable to this group, with the given priority.
void defaultOrganisationMode(void)
Setthe sorting / grouping mode for the solids in this group to the default.
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.
ConstMapIterator< PriorityMap > ConstPriorityMapIterator
MapIterator< PriorityMap > PriorityMapIterator
void merge(const RenderQueueGroup *rhs)
Merge group of renderables.
void resetOrganisationModes(void)
Reset the organisation modes required for the solids in this group.
bool mSplitNoShadowPasses
ConstPriorityMapIterator getIterator(void) const
Get a const iterator for browsing through child contents.
map< ushort, RenderPriorityGroup *, std::less< ushort > >::type PriorityMap
void setShadowCastersCannotBeReceivers(bool ind)
Sets whether or not objects which cast shadows should be treated as never receiving shadows.
bool mShadowsEnabled
Whether shadows are enabled for this queue.
bool mSplitPassesByLightingType
PriorityMap mPriorityGroups
Map of RenderPriorityGroup objects.
PriorityMapIterator getIterator(void)
Get an iterator for browsing through child contents.
uint8 mOrganisationMode
Bitmask of the organisation modes requested (for new priority groups)
void setSplitNoShadowPasses(bool split)
Sets whether or not the queue will split passes which have shadow receive turned off (in their parent...
RenderQueueGroup(RenderQueue *parent, bool splitPassesByLightingType, bool splitNoShadowPasses, bool shadowCastersNotReceivers)
void setSplitPassesByLightingType(bool split)
Sets whether or not the queue will split passes by their lighting type, ie ambient,...
bool getShadowsEnabled(void) const
Are shadows enabled for this queue?
bool mShadowCastersNotReceivers
void clear(bool destroy=false)
Clears this group of renderables.
Class to manage the scene object rendering queue.
Abstract class defining the interface all renderable objects must implement.
virtual Real getSquaredViewDepth(const Camera *cam) const =0
Returns the camera-relative squared depth of this renderable.
Class representing an approach to rendering this particular Material.
float Real
Software floating point type.
SceneCtlAllocatedObject RenderQueueAlloc
bool _OgreExport operator()(const RenderablePass &a, const RenderablePass &b) const
DepthSortDescendingLess(const Camera *cam)
Comparator to order pass groups.
bool _OgreExport operator()(const Pass *a, const Pass *b) const
RadixSortFunctorDistance(const Camera *cam)
float operator()(const RenderablePass &p) const
Functor for accessing sort value 1 for radix sort (Pass)
uint32 operator()(const RenderablePass &p) const
Struct associating a single Pass with a single Renderable.
Renderable * renderable
Pointer to the Renderable details.
RenderablePass(Renderable *rend, Pass *p)
Pass * pass
Pointer to the Pass.
std::map< K, V, P, A > type