7 #ifndef NAZARA_DEFERREDRENDERQUEUE_HPP 8 #define NAZARA_DEFERREDRENDERQUEUE_HPP 10 #include <Nazara/Prerequesites.hpp> 11 #include <Nazara/Graphics/ForwardRenderQueue.hpp> 12 #include <Nazara/Graphics/Material.hpp> 13 #include <Nazara/Math/Box.hpp> 14 #include <Nazara/Math/Matrix4.hpp> 15 #include <Nazara/Utility/IndexBuffer.hpp> 16 #include <Nazara/Utility/MeshData.hpp> 17 #include <Nazara/Utility/VertexBuffer.hpp> 36 void AddDrawable(
int renderOrder,
const Drawable* drawable)
override;
37 void AddMesh(
int renderOrder,
const Material* material,
const MeshData& meshData,
const Boxf& meshAABB,
const Matrix4f& transformMatrix)
override;
38 void AddSprites(
int renderOrder,
const Material* material,
const VertexStruct_XYZ_Color_UV* vertices, std::size_t spriteCount,
const Texture* overlay =
nullptr)
override;
40 void Clear(
bool fully =
false)
override;
42 struct MeshInstanceEntry
44 NazaraSlot(IndexBuffer, OnIndexBufferRelease, indexBufferReleaseSlot);
45 NazaraSlot(VertexBuffer, OnVertexBufferRelease, vertexBufferReleaseSlot);
47 std::vector<Matrix4f> instances;
50 typedef std::map<MeshData, MeshInstanceEntry, ForwardRenderQueue::MeshDataComparator> MeshInstanceContainer;
52 struct BatchedModelEntry
54 NazaraSlot(
Material, OnMaterialRelease, materialReleaseSlot);
56 MeshInstanceContainer meshMap;
60 typedef std::map<const Material*, BatchedModelEntry, ForwardRenderQueue::MaterialComparator> MeshMaterialBatches;
62 struct BatchedMaterialEntry
64 std::size_t maxInstanceCount = 0;
65 MeshMaterialBatches materialMap;
68 typedef std::map<const MaterialPipeline*, BatchedMaterialEntry, ForwardRenderQueue::MaterialPipelineComparator> MeshPipelineBatches;
72 MeshPipelineBatches opaqueModels;
73 unsigned int clearCount = 0;
76 std::map<int, Layer> layers;
79 Layer& GetLayer(
unsigned int i);
83 void OnIndexBufferInvalidation(
const IndexBuffer* indexBuffer);
84 void OnMaterialInvalidation(
const Material* material);
85 void OnVertexBufferInvalidation(
const VertexBuffer* vertexBuffer);
89 #endif // NAZARA_DEFERREDRENDERQUEUE_HPP TODO: Inherit SoundEmitter from Node.
Definition: Algorithm.hpp:12
Graphics class that represents the rendering queue for our scene.
Definition: AbstractRenderQueue.hpp:26
Core class that represents a pointer and the step between two elements.
Definition: SparsePtr.hpp:19
Graphics class that represents a material.
Definition: Material.hpp:51
Graphics class that represents the rendering queue for forward rendering.
Definition: ForwardRenderQueue.hpp:26
Graphics class that represents the rendering queue for deferred rendering.
Definition: DeferredRenderQueue.hpp:22
Graphics class that represents something drawable for our scene.
Definition: Drawable.hpp:15