Transparancy now working for forward rendering

This commit is contained in:
tleety
2015-09-15 13:20:01 +02:00
parent b9eda67a2a
commit c5bbcec5dc
3 changed files with 10 additions and 6 deletions
+3 -3
View File
@@ -355,7 +355,7 @@ public:
glm::mat4 modelMatrix = glm::translate(absoluteTransform.Position)
* glm::toMat4(orientation2D)
* glm::scale(absoluteTransform.Scale);
EnqueueSprite(texturediff, texturenorm, texturespec, modelMatrix, spriteComponent->Color);
EnqueueSprite(texturediff, texturenorm, texturespec, modelMatrix, spriteComponent->Color, absoluteTransform.Position.z);
}
}
@@ -386,7 +386,7 @@ public:
}
// TODO: Get this out of engine.h
void EnqueueSprite(Texture* texture, Texture* normalTexture, Texture* specularTexture, glm::mat4 modelMatrix, glm::vec4 color)
void EnqueueSprite(Texture* texture, Texture* normalTexture, Texture* specularTexture, glm::mat4 modelMatrix, glm::vec4 color, float depth)
{
SpriteJob job;
job.TextureID = texture->ResourceID;
@@ -395,7 +395,7 @@ public:
job.SpecularTexture = *specularTexture;
job.ModelMatrix = modelMatrix;
job.Color = color;
job.Depth = (glm::vec4(1,1,1,0) * modelMatrix).z;
job.Depth = depth;
m_RendererQueue.Forward.Add(job);