|
@@ -4,6 +4,10 @@
|
|
|
|
|
|
|
|
namespace BansheeEngine
|
|
namespace BansheeEngine
|
|
|
{
|
|
{
|
|
|
|
|
+ /**
|
|
|
|
|
+ * @brief Slightly more fine grained version of RenderOperation, as each pass
|
|
|
|
|
+ * is specified as an individual operation. Used for sorting within the RenderQueue.
|
|
|
|
|
+ */
|
|
|
struct CM_EXPORT SortedRenderOp
|
|
struct CM_EXPORT SortedRenderOp
|
|
|
{
|
|
{
|
|
|
SortedRenderOp()
|
|
SortedRenderOp()
|
|
@@ -14,15 +18,44 @@ namespace BansheeEngine
|
|
|
UINT32 passIdx;
|
|
UINT32 passIdx;
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * @brief Render objects determines rendering order of objects contained within it. Normally the rendering
|
|
|
|
|
+ * order is determined by object material, and can influence rendering of transparent or opaque objects,
|
|
|
|
|
+ * or be used to improve performance by grouping similar objects together.
|
|
|
|
|
+ *
|
|
|
|
|
+ * You need to provide your own implementation of the render queue sorting method. Likely the sorting method
|
|
|
|
|
+ * will need to be closely tied to the renderer used.
|
|
|
|
|
+ */
|
|
|
class CM_EXPORT RenderQueue
|
|
class CM_EXPORT RenderQueue
|
|
|
{
|
|
{
|
|
|
public:
|
|
public:
|
|
|
RenderQueue();
|
|
RenderQueue();
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * @brief Adds a new render operation to the rendering queue. These operations will be sorted
|
|
|
|
|
+ * and rendered by the Renderer in sorted order.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param material The material to use for rendering the object.
|
|
|
|
|
+ * @param mesh The mesh to render.
|
|
|
|
|
+ * @param submeshIdx Sub-mesh index in "mesh" to render.
|
|
|
|
|
+ * @param worldPosForSort The world position used for sorting.
|
|
|
|
|
+ */
|
|
|
void add(const MaterialPtr& material, const MeshBasePtr& mesh, UINT32 submeshIdx, const Vector3& worldPosForSort);
|
|
void add(const MaterialPtr& material, const MeshBasePtr& mesh, UINT32 submeshIdx, const Vector3& worldPosForSort);
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * @brief Clears all render operations from the queue.
|
|
|
|
|
+ */
|
|
|
void clear();
|
|
void clear();
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * @brief Sorts all the render operations using user-defined rules.
|
|
|
|
|
+ */
|
|
|
virtual void sort() = 0;
|
|
virtual void sort() = 0;
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * @brief Returns a list of sorted render operations. Caller must ensure
|
|
|
|
|
+ * "sort" is called before this method.
|
|
|
|
|
+ */
|
|
|
const Vector<SortedRenderOp>::type& getSortedRenderOps() const;
|
|
const Vector<SortedRenderOp>::type& getSortedRenderOps() const;
|
|
|
|
|
|
|
|
protected:
|
|
protected:
|