Now render water through it's own buffer. Not currently visable through finaltexture. Also added a white texture to render the water.

This commit is contained in:
tleety
2015-09-23 18:01:15 +02:00
parent 8e2eb63c5e
commit d473e3711c
9 changed files with 303 additions and 26 deletions
+16 -4
View File
@@ -347,8 +347,6 @@ public:
}
}
//TODO: Add LightLoadShit
auto pointLightComponent = m_World->GetComponent<Components::PointLight>(entity);
if (pointLightComponent)
{
@@ -359,6 +357,19 @@ public:
pointLightComponent->Radius);
}
auto parent = m_World->GetEntityParent(entity);
if(parent != 0) {
auto waterParticleComponent = m_World->GetComponent<Components::WaterVolume>(parent);
if (waterParticleComponent) {
//TODO: Remove hardcoded color.
//TODO: Do i even need modelMatrix?
Components::Transform absoluteTransform = m_TransformSystem->AbsoluteTransform(entity);
glm::mat4 modelMatrix = glm::translate(absoluteTransform.Position)
* glm::scale(absoluteTransform.Scale);
EnqueueWaterParticles(absoluteTransform.Position, glm::vec4(1.f, 1.f, 1.f, 1.f), modelMatrix);
}
}
auto spriteComponent = m_World->GetComponent<Components::Sprite>(entity);
if (spriteComponent)
@@ -440,13 +451,14 @@ public:
}
void EnqueueWaterParticles(glm::vec3 position, glm::vec4 color)
void EnqueueWaterParticles(glm::vec3 position, glm::vec4 color, glm::mat4 modelMatrix)
{
WaterParticleJob job;
job.Position = position;
job.Color = color;
job.ModelMatrix = modelMatrix;
m_RendererQueue.Deferred.Add(job);
m_RendererQueue.Water.Add(job);
}
private: