Graphics/ForwardShading: Fixed non-lit translucide rendering

Former-commit-id: dea27941badf51be183e9912c82be6f719015490
This commit is contained in:
Lynix 2015-05-06 23:31:42 +02:00
parent 53ae616d49
commit 1fff550c06
1 changed files with 20 additions and 14 deletions

View File

@ -658,9 +658,12 @@ void NzForwardRenderTechnique::DrawTransparentModels(const NzScene* scene) const
shader->SendVector(shaderUniforms->eyePosition, viewer->GetEyePosition());
// On envoie les lumières directionnelles s'il y a (Les mêmes pour tous)
if (shaderUniforms->hasLightUniforms)
{
lightCount = std::min(m_directionalLights.GetLightCount(), NazaraSuffixMacro(NAZARA_GRAPHICS_MAX_LIGHT_PER_PASS, U));
for (unsigned int i = 0; i < lightCount; ++i)
m_directionalLights.GetLight(i)->Enable(shader, shaderUniforms->lightUniforms, shaderUniforms->lightOffset*i);
}
lastShader = shader;
}
@ -690,6 +693,8 @@ void NzForwardRenderTechnique::DrawTransparentModels(const NzScene* scene) const
NzRenderer::SetIndexBuffer(indexBuffer);
NzRenderer::SetVertexBuffer(vertexBuffer);
if (shaderUniforms->hasLightUniforms)
{
// Calcul des lumières les plus proches
if (lightCount < NAZARA_GRAPHICS_MAX_LIGHT_PER_PASS && !m_lights.IsEmpty())
{
@ -704,6 +709,7 @@ void NzForwardRenderTechnique::DrawTransparentModels(const NzScene* scene) const
for (unsigned int i = lightCount; i < NAZARA_GRAPHICS_MAX_LIGHT_PER_PASS; ++i)
NzLight::Disable(shader, shaderUniforms->lightUniforms, shaderUniforms->lightOffset*i);
}
NzRenderer::SetMatrix(nzMatrixType_World, matrix);
drawFunc(meshData.primitiveMode, 0, indexCount);