Graphics/ForwardShading: Fixed non-lit translucide rendering
Former-commit-id: dea27941badf51be183e9912c82be6f719015490
This commit is contained in:
parent
53ae616d49
commit
1fff550c06
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue