The DepthSortCallback class sorts the primitives of the Geometry object bound to the Actor in which the callback is installed.
More...
#include <DepthSortCallback.hpp>
List of all members.
Detailed Description
The DepthSortCallback class sorts the primitives of the Geometry object bound to the Actor in which the callback is installed.
This callback in order to work requires the following conditions:
- The Actor must be bound to a Geometry
- The bound Geometry must have a Geometry::vertexArray() of type ArrayFVec3
- Sorts only DrawElementsUInt/UShort/UByte objects with primitive type: PT_POINTS, PT_LINES, PT_TRIANGLES, PT_QUADS
Despite the fact that the condition list seems to be quite limiting it actually covers the most common usage cases. Furthermore the use of DrawElements* and the primitive types PT_POINTS, PT_LINES, PT_TRIANGLES, PT_QUADS grant the maximum flexibility.
- Note:
- This callback works well with different LODs.
- This callback works well with multipassing, the sorting is done only once.
- The sorting is based on the position of the vertices as specified by Geometry::vertexArray() and for obvious reasons cannot take into consideration transformations made in the vertex shader or in the geometry shader.
- The sorting is performed on a per DrawCall basis. For example, if a Geometry has 2 DrawCall A and B bound to it, then the polygons, lines or points of A will alway be rendered before the ones specified by B.
- See also:
- Transparency and Polygon Depth Sorting Tutorial
Constructor & Destructor Documentation
| vl::DepthSortCallback::DepthSortCallback |
( |
) |
[inline] |
Member Function Documentation
| virtual const char* vl::DepthSortCallback::className |
( |
) |
[inline, virtual] |
Returns the name of the class.
Reimplemented from vl::Object.
| virtual void vl::DepthSortCallback::operator() |
( |
const Camera * |
cam, |
|
|
Actor * |
actor, |
|
|
Renderable * |
renderable, |
|
|
const Shader * |
, |
|
|
int |
pass |
|
) |
| [inline, virtual] |
template<typename T , typename deT >
| void vl::DepthSortCallback::sort |
( |
deT * |
polys, |
|
|
std::vector< Point< T > > & |
sorted_points, |
|
|
std::vector< Line< T > > & |
sorted_lines, |
|
|
std::vector< Triangle< T > > & |
sorted_triangles, |
|
|
std::vector< Quad< T > > & |
sorted_quads |
|
) |
| [inline] |
| ESortMode vl::DepthSortCallback::sortMode |
( |
) |
const [inline] |
| void vl::DepthSortCallback::setSortMode |
( |
ESortMode |
sort_mode ) |
[inline] |
| void vl::DepthSortCallback::invalidateCache |
( |
) |
[inline] |
Forces sorting at the next rendering.
Member Data Documentation
The documentation for this class was generated from the following file: