7 #ifndef NAZARA_FORWARDRENDERTECHNIQUE_HPP 8 #define NAZARA_FORWARDRENDERTECHNIQUE_HPP 10 #include <Nazara/Prerequesites.hpp> 11 #include <Nazara/Graphics/AbstractRenderTechnique.hpp> 12 #include <Nazara/Graphics/Config.hpp> 13 #include <Nazara/Graphics/ForwardRenderQueue.hpp> 14 #include <Nazara/Graphics/Light.hpp> 15 #include <Nazara/Renderer/Shader.hpp> 16 #include <Nazara/Utility/IndexBuffer.hpp> 17 #include <Nazara/Utility/VertexBuffer.hpp> 27 void Clear(
const SceneData& sceneData)
const override;
28 bool Draw(
const SceneData& sceneData)
const override;
30 unsigned int GetMaxLightPassPerObject()
const;
32 RenderTechniqueType GetType()
const override;
34 void SetMaxLightPassPerObject(
unsigned int maxLightPassPerObject);
36 static bool Initialize();
37 static void Uninitialize();
40 struct ShaderUniforms;
42 void ChooseLights(
const Spheref&
object,
bool includeDirectionalLights =
true)
const;
43 void DrawBasicSprites(
const SceneData& sceneData, ForwardRenderQueue::Layer& layer)
const;
44 void DrawBillboards(
const SceneData& sceneData, ForwardRenderQueue::Layer& layer)
const;
45 void DrawOpaqueModels(
const SceneData& sceneData, ForwardRenderQueue::Layer& layer)
const;
46 void DrawOrderedSprites(
const SceneData& sceneData, ForwardRenderQueue::Layer& layer)
const;
47 void DrawTransparentModels(
const SceneData& sceneData, ForwardRenderQueue::Layer& layer)
const;
48 const ShaderUniforms* GetShaderUniforms(
const Shader* shader)
const;
49 void OnShaderInvalidated(
const Shader* shader)
const;
50 void SendLightUniforms(
const Shader* shader,
const LightUniforms& uniforms,
unsigned int index,
unsigned int lightIndex,
unsigned int uniformOffset)
const;
52 static float ComputeDirectionalLightScore(
const Spheref&
object,
const AbstractRenderQueue::DirectionalLight& light);
53 static float ComputePointLightScore(
const Spheref&
object,
const AbstractRenderQueue::PointLight& light);
54 static float ComputeSpotLightScore(
const Spheref&
object,
const AbstractRenderQueue::SpotLight& light);
55 static bool IsDirectionalLightSuitable(
const Spheref&
object,
const AbstractRenderQueue::DirectionalLight& light);
56 static bool IsPointLightSuitable(
const Spheref&
object,
const AbstractRenderQueue::PointLight& light);
57 static bool IsSpotLightSuitable(
const Spheref&
object,
const AbstractRenderQueue::SpotLight& light);
68 NazaraSlot(Shader, OnShaderUniformInvalidated, shaderUniformInvalidatedSlot);
69 NazaraSlot(Shader, OnShaderRelease, shaderReleaseSlot);
71 LightUniforms lightUniforms;
72 bool hasLightUniforms;
85 mutable std::unordered_map<const Shader*, ShaderUniforms> m_shaderUniforms;
86 mutable std::vector<LightIndex> m_lights;
87 Buffer m_vertexBuffer;
89 Texture m_whiteTexture;
90 VertexBuffer m_billboardPointBuffer;
91 VertexBuffer m_spriteBuffer;
92 unsigned int m_maxLightPassPerObject;
94 static IndexBuffer s_quadIndexBuffer;
95 static Texture s_dummyReflection;
96 static TextureSampler s_reflectionSampler;
97 static TextureSampler s_shadowSampler;
98 static VertexBuffer s_quadVertexBuffer;
99 static VertexDeclaration s_billboardInstanceDeclaration;
100 static VertexDeclaration s_billboardVertexDeclaration;
104 #include <Nazara/Graphics/ForwardRenderTechnique.inl> 106 #endif // NAZARA_FORWARDRENDERTECHNIQUE_HPP TODO: Inherit SoundEmitter from Node.
Definition: Algorithm.hpp:12
Graphics class that represents the rendering queue for our scene.
Definition: AbstractRenderQueue.hpp:26
Graphics class that represents the rendering technique for our scene.
Definition: AbstractRenderTechnique.hpp:20
Graphics class that represents the technique used in forward rendering.
Definition: ForwardRenderTechnique.hpp:21
Graphics class that represents the rendering queue for forward rendering.
Definition: ForwardRenderQueue.hpp:26