Graphics: Make Background/RenderTechnique independent from Scene

Former-commit-id: d588a3bb74b08d79990a278ad2e399e9797755b4
This commit is contained in:
Lynix
2015-06-09 00:26:13 +02:00
parent e97cc666a1
commit 6f2f8d6390
32 changed files with 124 additions and 86 deletions

View File

@@ -65,7 +65,7 @@ bool NzDeferredPhongLightingPass::IsLightMeshesDrawingEnabled() const
return m_lightMeshesDrawing;
}
bool NzDeferredPhongLightingPass::Process(const NzScene* scene, unsigned int firstWorkTexture, unsigned secondWorkTexture) const
bool NzDeferredPhongLightingPass::Process(const NzAbstractViewer* viewer, const NzSceneData& sceneData, unsigned int firstWorkTexture, unsigned secondWorkTexture) const
{
NazaraUnused(secondWorkTexture);
@@ -97,8 +97,8 @@ bool NzDeferredPhongLightingPass::Process(const NzScene* scene, unsigned int fir
{
NzRenderer::SetRenderStates(lightStates);
NzRenderer::SetShader(m_directionalLightShader);
m_directionalLightShader->SendColor(m_directionalLightShaderSceneAmbientLocation, scene->GetAmbientColor());
m_directionalLightShader->SendVector(m_directionalLightShaderEyePositionLocation, scene->GetViewer()->GetEyePosition());
m_directionalLightShader->SendColor(m_directionalLightShaderSceneAmbientLocation, sceneData.ambientColor);
m_directionalLightShader->SendVector(m_directionalLightShaderEyePositionLocation, viewer->GetEyePosition());
for (auto& light : m_renderQueue->directionalLights)
{
@@ -130,8 +130,8 @@ bool NzDeferredPhongLightingPass::Process(const NzScene* scene, unsigned int fir
NzRenderer::SetRenderStates(lightStates);
NzRenderer::SetShader(m_pointSpotLightShader);
m_pointSpotLightShader->SendColor(m_pointSpotLightShaderSceneAmbientLocation, scene->GetAmbientColor());
m_pointSpotLightShader->SendVector(m_pointSpotLightShaderEyePositionLocation, scene->GetViewer()->GetEyePosition());
m_pointSpotLightShader->SendColor(m_pointSpotLightShaderSceneAmbientLocation, sceneData.ambientColor);
m_pointSpotLightShader->SendVector(m_pointSpotLightShaderEyePositionLocation, viewer->GetEyePosition());
NzMatrix4f lightMatrix;
lightMatrix.MakeIdentity();