|
|
@@ -7,6 +7,10 @@
|
|
|
|
|
|
namespace BansheeEngine
|
|
|
{
|
|
|
+ /**
|
|
|
+ * @brief Semantics that may be used for signaling the renderer
|
|
|
+ * for what is a certain shader parameter used for.
|
|
|
+ */
|
|
|
enum BansheeRendererParamSemantic
|
|
|
{
|
|
|
RPS_Time = 1000,
|
|
|
@@ -14,13 +18,16 @@ namespace BansheeEngine
|
|
|
};
|
|
|
|
|
|
/**
|
|
|
- * @brief Default renderer for Banshee. Performs frustum culling, sorting and renders
|
|
|
- * objects plainly according to their shaders with no fancy effects.
|
|
|
+ * @brief Default renderer for Banshee. Performs frustum culling, sorting and
|
|
|
+ * renders objects in custom ways determine by renderable handlers.
|
|
|
*
|
|
|
+ * @note Sim thread unless otherwise noted.
|
|
|
*/
|
|
|
- // TODO UNDOCUMENTED
|
|
|
class BS_BSRND_EXPORT BansheeRenderer : public Renderer
|
|
|
{
|
|
|
+ /**
|
|
|
+ * @brief Render data for a single render target.
|
|
|
+ */
|
|
|
struct RenderTargetData
|
|
|
{
|
|
|
RenderTargetPtr target;
|
|
|
@@ -52,28 +59,125 @@ namespace BansheeEngine
|
|
|
virtual void _onDeactivated();
|
|
|
|
|
|
private:
|
|
|
+ /**
|
|
|
+ * @brief Adds a new renderable proxy which will be considered for rendering next frame.
|
|
|
+ *
|
|
|
+ * @note Core thread only.
|
|
|
+ */
|
|
|
void addRenderableProxy(RenderableProxyPtr proxy);
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @brief Removes a previously existing renderable proxy so it will no longer be considered
|
|
|
+ * for rendering.
|
|
|
+ *
|
|
|
+ * @note Core thread only.
|
|
|
+ */
|
|
|
void removeRenderableProxy(RenderableProxyPtr proxy);
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @brief Updates an existing renderable proxy with new data. This includes data that changes
|
|
|
+ * often. For other data it is best to remove old proxy and add new one.
|
|
|
+ *
|
|
|
+ * @param proxy Proxy to update.
|
|
|
+ * @param localToWorld Local to world transform of the parent Renderable.
|
|
|
+ *
|
|
|
+ * @note Core thread only.
|
|
|
+ */
|
|
|
void updateRenderableProxy(RenderableProxyPtr proxy, Matrix4 localToWorld);
|
|
|
|
|
|
+ /**
|
|
|
+ * @brief Adds a new camera proxy will be used for rendering renderable proxy objects.
|
|
|
+ *
|
|
|
+ * @note Core thread only.
|
|
|
+ */
|
|
|
void addCameraProxy(CameraProxyPtr proxy);
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @brief Removes an existing camera proxy, meaning the camera will no longer be rendered from.
|
|
|
+ *
|
|
|
+ * @note Core thread only.
|
|
|
+ */
|
|
|
void removeCameraProxy(CameraProxyPtr proxy);
|
|
|
- void updateCameraProxy(CameraProxyPtr proxy, Matrix4 viewMatrix);
|
|
|
|
|
|
+ /**
|
|
|
+ * @brief Updates an existing camera proxy with new data. This includes data that changes
|
|
|
+ * often. For other data it is best to remove old proxy and add new one.
|
|
|
+ *
|
|
|
+ * @param proxy Proxy to update.
|
|
|
+ * @param camera World transform matrix of the camera.
|
|
|
+ * @param camera View transform matrix of the camera.
|
|
|
+ *
|
|
|
+ * @note Core thread only.
|
|
|
+ */
|
|
|
+ void updateCameraProxy(CameraProxyPtr proxy, Matrix4 worldMatrix, Matrix4 viewMatrix);
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @brief Adds a new set of objects to the cameras render queue.
|
|
|
+ *
|
|
|
+ * @param proxy Proxy of the render queues camera to add the objects to.
|
|
|
+ * @param renderQueue Objects to add to the cameras queue.
|
|
|
+ *
|
|
|
+ * @note Core thread only.
|
|
|
+ */
|
|
|
void addToRenderQueue(CameraProxyPtr proxy, RenderQueuePtr renderQueue);
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @brief Updates a material proxy with new parameter data. Usually called when parameters are manually
|
|
|
+ * updated from the sim thread.
|
|
|
+ *
|
|
|
+ * @param proxy Material proxy to update.
|
|
|
+ * @param dirtyParams A list of parameter buffers that need updating.
|
|
|
+ *
|
|
|
+ * @note Core thread only.
|
|
|
+ */
|
|
|
void updateMaterialProxy(MaterialProxyPtr proxy, Vector<MaterialProxy::ParamsBindInfo> dirtyParams);
|
|
|
|
|
|
+ /**
|
|
|
+ * @brief Performs rendering over all camera proxies.
|
|
|
+ *
|
|
|
+ * @param time Current frame time in milliseconds.
|
|
|
+ *
|
|
|
+ * @note Core thread only.
|
|
|
+ */
|
|
|
void renderAllCore(float time);
|
|
|
|
|
|
/**
|
|
|
* @brief Renders all objects visible by the provided camera.
|
|
|
+ *
|
|
|
+ * @param cameraProxy Camera used for determining destination render target and visibility.
|
|
|
+ * @param renderQueue Optionally non-empty queue of manually added objects to render.
|
|
|
+ *
|
|
|
+ * @note Core thread only.
|
|
|
*/
|
|
|
virtual void render(const CameraProxy& cameraProxy, const RenderQueuePtr& renderQueue);
|
|
|
|
|
|
+ /**
|
|
|
+ * @brief Activates the specified pass on the pipeline.
|
|
|
+ *
|
|
|
+ * @param material Parent material of the pass.
|
|
|
+ * @param passIdx Index of the pass in the parent material.
|
|
|
+ *
|
|
|
+ * @note Core thread only.
|
|
|
+ */
|
|
|
void setPass(const MaterialProxyPtr& material, UINT32 passIdx);
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @brief Draws the specified mesh proxy with last set pass.
|
|
|
+ *
|
|
|
+ * @note Core thread only.
|
|
|
+ */
|
|
|
void draw(const MeshProxy& mesh);
|
|
|
|
|
|
+ /**
|
|
|
+ * @brief Called by the scene manager whenever a Renderable component has been
|
|
|
+ * removed from the scene.
|
|
|
+ */
|
|
|
void renderableRemoved(const HRenderable& renderable);
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @brief Called by the scene manager whenever a Camera component has been
|
|
|
+ * removed from the scene.
|
|
|
+ */
|
|
|
void cameraRemoved(const HCamera& camera);
|
|
|
|
|
|
Vector<RenderableProxyPtr> mDeletedRenderableProxies;
|