Graphics/RenderTechnique: Add uniform invalidation

Former-commit-id: 8f03073408a03854533d9911eb1a0605ebbb8767
This commit is contained in:
Lynix
2015-06-07 18:25:35 +02:00
parent 358fab7115
commit 0f4cf3c910
6 changed files with 36 additions and 4 deletions

View File

@@ -25,9 +25,13 @@ class NAZARA_API NzDeferredGeometryPass : public NzDeferredRenderPass
struct ShaderUniforms;
const ShaderUniforms* GetShaderUniforms(const NzShader* shader) const;
void OnShaderInvalidated(const NzShader* shader) const;
struct ShaderUniforms
{
NazaraSlot(NzShader, OnShaderUniformInvalidated, shaderUniformInvalidatedSlot);
NazaraSlot(NzShader, OnShaderRelease, shaderReleaseSlot);
int eyePosition;
int sceneAmbient;
int textureOverlay;

View File

@@ -11,6 +11,7 @@
#include <Nazara/Graphics/AbstractRenderTechnique.hpp>
#include <Nazara/Graphics/ForwardRenderQueue.hpp>
#include <Nazara/Graphics/Light.hpp>
#include <Nazara/Renderer/Shader.hpp>
#include <Nazara/Utility/IndexBuffer.hpp>
#include <Nazara/Utility/VertexBuffer.hpp>
@@ -40,6 +41,7 @@ class NAZARA_API NzForwardRenderTechnique : public NzAbstractRenderTechnique
void DrawOpaqueModels(const NzScene* scene) const;
void DrawTransparentModels(const NzScene* scene) const;
const ShaderUniforms* GetShaderUniforms(const NzShader* shader) const;
void OnShaderInvalidated(const NzShader* shader) const;
void SendLightUniforms(const NzShader* shader, const NzLightUniforms& uniforms, unsigned int uniformOffset, unsigned int index) const;
static float ComputeDirectionalLightScore(const NzSpheref& object, const NzAbstractRenderQueue::DirectionalLight& light);
@@ -58,6 +60,9 @@ class NAZARA_API NzForwardRenderTechnique : public NzAbstractRenderTechnique
struct ShaderUniforms
{
NazaraSlot(NzShader, OnShaderUniformInvalidated, shaderUniformInvalidatedSlot);
NazaraSlot(NzShader, OnShaderRelease, shaderReleaseSlot);
NzLightUniforms lightUniforms;
bool hasLightUniforms;