Forward RenderTechnique now handles non-lighting shaders
Former-commit-id: f243ba8aea76ada91510f6b36c292ae0e18e2add
This commit is contained in:
parent
05e7e11356
commit
0f2cab56ff
|
|
@ -264,6 +264,8 @@ void NzForwardRenderTechnique::DrawOpaqueModels(const NzScene* scene) const
|
||||||
|
|
||||||
unsigned int passCount = (lightCount == 0) ? 1 : (lightCount-1)/NAZARA_GRAPHICS_MAX_LIGHTPERPASS + 1;
|
unsigned int passCount = (lightCount == 0) ? 1 : (lightCount-1)/NAZARA_GRAPHICS_MAX_LIGHTPERPASS + 1;
|
||||||
for (unsigned int pass = 0; pass < passCount; ++pass)
|
for (unsigned int pass = 0; pass < passCount; ++pass)
|
||||||
|
{
|
||||||
|
if (lightUniforms->exists)
|
||||||
{
|
{
|
||||||
unsigned int renderedLightCount = std::min(lightCount, NAZARA_GRAPHICS_MAX_LIGHTPERPASS);
|
unsigned int renderedLightCount = std::min(lightCount, NAZARA_GRAPHICS_MAX_LIGHTPERPASS);
|
||||||
lightCount -= renderedLightCount;
|
lightCount -= renderedLightCount;
|
||||||
|
|
@ -284,6 +286,7 @@ void NzForwardRenderTechnique::DrawOpaqueModels(const NzScene* scene) const
|
||||||
|
|
||||||
for (unsigned int i = renderedLightCount; i < NAZARA_GRAPHICS_MAX_LIGHTPERPASS; ++i)
|
for (unsigned int i = renderedLightCount; i < NAZARA_GRAPHICS_MAX_LIGHTPERPASS; ++i)
|
||||||
NzLight::Disable(shader, lightUniforms->uniforms, lightUniforms->offset*i);
|
NzLight::Disable(shader, lightUniforms->uniforms, lightUniforms->offset*i);
|
||||||
|
}
|
||||||
|
|
||||||
const NzForwardRenderQueue::StaticData* data = &staticData[0];
|
const NzForwardRenderQueue::StaticData* data = &staticData[0];
|
||||||
unsigned int instanceCount = staticData.size();
|
unsigned int instanceCount = staticData.size();
|
||||||
|
|
@ -315,6 +318,8 @@ void NzForwardRenderTechnique::DrawOpaqueModels(const NzScene* scene) const
|
||||||
NzRenderer::SetDepthFunc(oldDepthFunc);
|
NzRenderer::SetDepthFunc(oldDepthFunc);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
if (lightUniforms->exists)
|
||||||
{
|
{
|
||||||
for (const NzForwardRenderQueue::StaticData& data : staticData)
|
for (const NzForwardRenderQueue::StaticData& data : staticData)
|
||||||
{
|
{
|
||||||
|
|
@ -362,6 +367,15 @@ void NzForwardRenderTechnique::DrawOpaqueModels(const NzScene* scene) const
|
||||||
NzRenderer::SetDepthFunc(oldDepthFunc);
|
NzRenderer::SetDepthFunc(oldDepthFunc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
for (const NzForwardRenderQueue::StaticData& data : staticData)
|
||||||
|
{
|
||||||
|
NzRenderer::SetMatrix(nzMatrixType_World, data.transformMatrix);
|
||||||
|
DrawFunc(primitiveMode, 0, indexCount);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
staticData.clear();
|
staticData.clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue