Fixed compilation errors and bugs
Former-commit-id: f09f4135cafa7601b217b11b0ebda74789629b6e
This commit is contained in:
parent
18cc3b16df
commit
380b65814a
|
|
@ -81,7 +81,6 @@ class NAZARA_API NzForwardRenderQueue : public NzAbstractRenderQueue, NzResource
|
||||||
typedef std::map<const NzStaticMesh*, std::vector<NzMatrix4f>, StaticMeshComparator> StaticMeshContainer;
|
typedef std::map<const NzStaticMesh*, std::vector<NzMatrix4f>, StaticMeshComparator> StaticMeshContainer;
|
||||||
typedef std::map<const NzMaterial*, std::pair<SkeletalMeshContainer, StaticMeshContainer>, MaterialComparator> MeshContainer;
|
typedef std::map<const NzMaterial*, std::pair<SkeletalMeshContainer, StaticMeshContainer>, MaterialComparator> MeshContainer;
|
||||||
|
|
||||||
std::map<const NzMaterial*, std::vector<BillboardData>, MaterialComparator> billboards;
|
|
||||||
MeshContainer opaqueModels;
|
MeshContainer opaqueModels;
|
||||||
std::vector<std::pair<unsigned int, bool>> transparentsModels;
|
std::vector<std::pair<unsigned int, bool>> transparentsModels;
|
||||||
std::vector<TransparentSkeletalModel> transparentSkeletalModels;
|
std::vector<TransparentSkeletalModel> transparentSkeletalModels;
|
||||||
|
|
|
||||||
|
|
@ -56,14 +56,14 @@ void NzForwardRenderTechnique::Draw(const NzScene* scene)
|
||||||
int lightCountLocation = -1;
|
int lightCountLocation = -1;
|
||||||
|
|
||||||
// Rendu des modèles opaques
|
// Rendu des modèles opaques
|
||||||
for (auto& matIt : m_renderQueue.visibleModels)
|
for (auto& matIt : m_renderQueue.opaqueModels)
|
||||||
{
|
{
|
||||||
NzForwardRenderQueue::SkeletalMeshContainer& skeletalContainer = matIt.second.first;
|
NzForwardRenderQueue::SkeletalMeshContainer& skeletalContainer = matIt.second.first;
|
||||||
NzForwardRenderQueue::StaticMeshContainer& staticContainer = matIt.second.second;
|
NzForwardRenderQueue::StaticMeshContainer& staticContainer = matIt.second.second;
|
||||||
|
|
||||||
if (!skeletalContainer.empty() || !staticContainer.empty())
|
if (!skeletalContainer.empty() || !staticContainer.empty())
|
||||||
{
|
{
|
||||||
NzMaterial* material = matIt.first;
|
const NzMaterial* material = matIt.first;
|
||||||
|
|
||||||
// On commence par récupérer le shader du matériau
|
// On commence par récupérer le shader du matériau
|
||||||
const NzShader* shader;
|
const NzShader* shader;
|
||||||
|
|
@ -115,7 +115,7 @@ void NzForwardRenderTechnique::Draw(const NzScene* scene)
|
||||||
// Meshs statiques
|
// Meshs statiques
|
||||||
for (auto& subMeshIt : staticContainer)
|
for (auto& subMeshIt : staticContainer)
|
||||||
{
|
{
|
||||||
NzStaticMesh* mesh = subMeshIt.first;
|
const NzStaticMesh* mesh = subMeshIt.first;
|
||||||
std::vector<NzMatrix4f>& matrices = subMeshIt.second;
|
std::vector<NzMatrix4f>& matrices = subMeshIt.second;
|
||||||
if (!matrices.empty())
|
if (!matrices.empty())
|
||||||
{
|
{
|
||||||
|
|
@ -146,14 +146,14 @@ void NzForwardRenderTechnique::Draw(const NzScene* scene)
|
||||||
///TODO: LightManager ?
|
///TODO: LightManager ?
|
||||||
if (lightCountLocation != -1)
|
if (lightCountLocation != -1)
|
||||||
{
|
{
|
||||||
std::vector<const NzLight*>& visibleLights = m_renderQueue.visibleLights;
|
std::vector<const NzLight*>& lights = m_renderQueue.lights;
|
||||||
|
|
||||||
lightComparator.pos = matrix.GetTranslation();
|
lightComparator.pos = matrix.GetTranslation();
|
||||||
std::sort(visibleLights.begin(), visibleLights.end(), lightComparator);
|
std::sort(lights.begin(), lights.end(), lightComparator);
|
||||||
|
|
||||||
unsigned int max = std::min(std::min(NAZARA_RENDERER_SHADER_MAX_LIGHTCOUNT - lightCount, m_maxLightsPerObject), static_cast<unsigned int>(visibleLights.size()));
|
unsigned int max = std::min(std::min(NAZARA_RENDERER_SHADER_MAX_LIGHTCOUNT - lightCount, m_maxLightsPerObject), static_cast<unsigned int>(lights.size()));
|
||||||
for (unsigned int i = 0; i < max; ++i)
|
for (unsigned int i = 0; i < max; ++i)
|
||||||
visibleLights[i]->Apply(shader, lightCount++);
|
lights[i]->Apply(shader, lightCount++);
|
||||||
|
|
||||||
shader->SendInteger(lightCountLocation, lightCount);
|
shader->SendInteger(lightCountLocation, lightCount);
|
||||||
}
|
}
|
||||||
|
|
@ -167,7 +167,7 @@ void NzForwardRenderTechnique::Draw(const NzScene* scene)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const std::pair<unsigned int, bool>& pair : m_renderQueue.visibleTransparentsModels)
|
for (const std::pair<unsigned int, bool>& pair : m_renderQueue.transparentsModels)
|
||||||
{
|
{
|
||||||
// Matériau
|
// Matériau
|
||||||
NzMaterial* material = (pair.second) ?
|
NzMaterial* material = (pair.second) ?
|
||||||
|
|
@ -244,14 +244,14 @@ void NzForwardRenderTechnique::Draw(const NzScene* scene)
|
||||||
///TODO: LightManager ?
|
///TODO: LightManager ?
|
||||||
if (lightCountLocation != -1)
|
if (lightCountLocation != -1)
|
||||||
{
|
{
|
||||||
std::vector<const NzLight*>& visibleLights = m_renderQueue.visibleLights;
|
std::vector<const NzLight*>& lights = m_renderQueue.lights;
|
||||||
|
|
||||||
lightComparator.pos = matrix.GetTranslation();
|
lightComparator.pos = matrix.GetTranslation();
|
||||||
std::sort(visibleLights.begin(), visibleLights.end(), lightComparator);
|
std::sort(lights.begin(), lights.end(), lightComparator);
|
||||||
|
|
||||||
unsigned int max = std::min(std::min(NAZARA_RENDERER_SHADER_MAX_LIGHTCOUNT - lightCount, m_maxLightsPerObject), static_cast<unsigned int>(visibleLights.size()));
|
unsigned int max = std::min(std::min(NAZARA_RENDERER_SHADER_MAX_LIGHTCOUNT - lightCount, m_maxLightsPerObject), static_cast<unsigned int>(lights.size()));
|
||||||
for (unsigned int i = 0; i < max; ++i)
|
for (unsigned int i = 0; i < max; ++i)
|
||||||
visibleLights[i]->Apply(shader, lightCount++);
|
lights[i]->Apply(shader, lightCount++);
|
||||||
|
|
||||||
shader->SendInteger(lightCountLocation, lightCount);
|
shader->SendInteger(lightCountLocation, lightCount);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1271,7 +1271,7 @@ bool NzRenderer::EnsureStateUpdate()
|
||||||
|
|
||||||
location = shaderImpl->GetUniformLocation(nzShaderUniform_TargetSize);
|
location = shaderImpl->GetUniformLocation(nzShaderUniform_TargetSize);
|
||||||
if (location != -1)
|
if (location != -1)
|
||||||
shaderImpl->SendVector(location, 1.f/NzVector2f(s_targetSize));
|
shaderImpl->SendVector(location, NzVector2f(s_targetSize));
|
||||||
|
|
||||||
s_uniformTargetSizeUpdated = true;
|
s_uniformTargetSizeUpdated = true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue