Sprite ACTUALLY rendered as unitquad now.
This commit is contained in:
@@ -327,7 +327,8 @@ void dd::Renderer::DrawScene(RenderQueue &objects, ShaderProgram &program)
|
|||||||
auto spriteJob = std::dynamic_pointer_cast<SpriteJob>(job);
|
auto spriteJob = std::dynamic_pointer_cast<SpriteJob>(job);
|
||||||
if (spriteJob)
|
if (spriteJob)
|
||||||
{
|
{
|
||||||
glm::mat4 modelMatrix = glm::scale(glm::vec3(0.5f)) * spriteJob->ModelMatrix;
|
glm::mat4 modelMatrix = spriteJob->ModelMatrix;
|
||||||
|
modelMatrix = modelMatrix * glm::scale(glm::vec3(0.5f));
|
||||||
MVP = PV * modelMatrix;
|
MVP = PV * modelMatrix;
|
||||||
glUniformMatrix4fv(glGetUniformLocation(shaderProgramHandle, "MVP"), 1, GL_FALSE, glm::value_ptr(MVP));
|
glUniformMatrix4fv(glGetUniformLocation(shaderProgramHandle, "MVP"), 1, GL_FALSE, glm::value_ptr(MVP));
|
||||||
glUniformMatrix4fv(glGetUniformLocation(shaderProgramHandle, "M"), 1, GL_FALSE, glm::value_ptr(modelMatrix));
|
glUniformMatrix4fv(glGetUniformLocation(shaderProgramHandle, "M"), 1, GL_FALSE, glm::value_ptr(modelMatrix));
|
||||||
|
|||||||
@@ -68,6 +68,7 @@ void main()
|
|||||||
//gl_Position = MVP * boneTransform * vec4(Position, 1.0);
|
//gl_Position = MVP * boneTransform * vec4(Position, 1.0);
|
||||||
gl_Position = MVP * vec4(Position, 1.0);
|
gl_Position = MVP * vec4(Position, 1.0);
|
||||||
|
|
||||||
|
//TODO: Make sure that boneTransform works here.
|
||||||
Output.Position = (V * M * boneTransform * vec4(Position, 1.0)).xyz;
|
Output.Position = (V * M * boneTransform * vec4(Position, 1.0)).xyz;
|
||||||
Output.Normal = (inverse(transpose(V * M)) * boneTransform * vec4(Normal, 0.0)).xyz;
|
Output.Normal = (inverse(transpose(V * M)) * boneTransform * vec4(Normal, 0.0)).xyz;
|
||||||
Output.Tangent = Tangent;
|
Output.Tangent = Tangent;
|
||||||
|
|||||||
Reference in New Issue
Block a user