diff --git a/assets/Textures/Core/NeutralSpecularMap.png b/assets/Textures/Core/NeutralSpecularMap.png index 20c4387..eccbb9a 100755 Binary files a/assets/Textures/Core/NeutralSpecularMap.png and b/assets/Textures/Core/NeutralSpecularMap.png differ diff --git a/include/Core/Engine.h b/include/Core/Engine.h index d692aa3..06adf81 100755 --- a/include/Core/Engine.h +++ b/include/Core/Engine.h @@ -303,7 +303,7 @@ public: glm::mat4 modelMatrix = glm::translate(glm::mat4(), absoluteTransform.Position) * glm::toMat4(absoluteTransform.Orientation) * glm::scale(absoluteTransform.Scale); - EnqueueModel(modelAsset, modelMatrix, modelComponent->Transparent, modelComponent->Color); + EnqueueModel(modelAsset, modelMatrix, modelComponent->Transparent, modelComponent->Color, modelComponent->ModelFile); } } @@ -351,7 +351,7 @@ public: } //TODO: Get this out of engine.h - void EnqueueModel(Model* model, glm::mat4 modelMatrix, float transparent, glm::vec4 color) + void EnqueueModel(Model* model, glm::mat4 modelMatrix, float transparent, glm::vec4 color, std::string fileName) { for (auto texGroup : model->TextureGroups) { @@ -366,6 +366,7 @@ public: job.EndIndex = texGroup.EndIndex; job.ModelMatrix = modelMatrix; job.Color = color; + job.fileName = fileName; m_RendererQueue.Deferred.Add(job); } diff --git a/include/Core/RenderQueue.h b/include/Core/RenderQueue.h index ccf1a3a..9984770 100755 --- a/include/Core/RenderQueue.h +++ b/include/Core/RenderQueue.h @@ -52,6 +52,8 @@ struct ModelJob : RenderJob unsigned int ShaderID; unsigned int TextureID; + std::string fileName; + glm::mat4 ModelMatrix; GLuint DiffuseTexture; GLuint NormalTexture; diff --git a/include/Core/Renderer.h b/include/Core/Renderer.h index 241366d..1b8e078 100755 --- a/include/Core/Renderer.h +++ b/include/Core/Renderer.h @@ -76,6 +76,8 @@ private: GLuint m_ScreenQuad = 0; Model* m_UnitSphere = nullptr; Model* m_UnitQuad = nullptr; + Texture* m_StandardNormal; + Texture* m_StandardSpecular; GLuint m_rbDepthBuffer = 0; GLuint m_fbDeferred1 = 0; diff --git a/src/game/Core/Renderer.cpp b/src/game/Core/Renderer.cpp index 261dffb..306eac4 100755 --- a/src/game/Core/Renderer.cpp +++ b/src/game/Core/Renderer.cpp @@ -113,6 +113,8 @@ void dd::Renderer::CreateBuffers() m_ScreenQuad = CreateQuad(); m_UnitQuad = ResourceManager::Load("Models/Core/UnitQuad.obj"); m_UnitSphere = ResourceManager::Load("Models/Core/UnitSphere.obj"); + m_StandardNormal = ResourceManager::Load("Textures/Core/NeutralNormalMap.png"); + m_StandardSpecular = ResourceManager::Load("Textures/Core/NeutralSpecularMap.png"); glGenRenderbuffers(1, &m_rbDepthBuffer); glBindRenderbuffer(GL_RENDERBUFFER, m_rbDepthBuffer); @@ -321,14 +323,23 @@ void dd::Renderer::DrawScene(RenderQueue &objects, ShaderProgram &program) glActiveTexture(GL_TEXTURE0); glBindTexture(GL_TEXTURE_2D, modelJob->DiffuseTexture); - if (modelJob->NormalTexture != 0) { + if (modelJob->NormalTexture != 0 && false) { glActiveTexture(GL_TEXTURE1); glBindTexture(GL_TEXTURE_2D, modelJob->NormalTexture); + } else { + glActiveTexture(GL_TEXTURE1); + glBindTexture(GL_TEXTURE_2D, *m_StandardNormal); } - if (modelJob->SpecularTexture != 0) { + + if (modelJob->SpecularTexture != 0 && false) { glActiveTexture(GL_TEXTURE2); glBindTexture(GL_TEXTURE_2D, modelJob->SpecularTexture); } + else { + glActiveTexture(GL_TEXTURE2); + glBindTexture(GL_TEXTURE_2D, *m_StandardSpecular); + } + glBindVertexArray(modelJob->VAO); glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, modelJob->ElementBuffer); diff --git a/src/game/Game/LevelSystem.cpp b/src/game/Game/LevelSystem.cpp index 08648ee..74bba6b 100755 --- a/src/game/Game/LevelSystem.cpp +++ b/src/game/Game/LevelSystem.cpp @@ -116,7 +116,7 @@ void dd::Systems::LevelSystem::CreateBrick(int row, int line, glm::vec2 spacesBe model->ModelFile = "Models/Test/Brick/Brick.obj"; float x = spaceToEdge + line * spacesBetweenBricks.x; float y = spaceToEdge + row * spacesBetweenBricks.y; - transform->Scale = glm::vec3(1.6, 0.2, 0.5); + transform->Scale = glm::vec3(1.6, 0.35, 0.5); transform->Position = glm::vec3(x - 7, y + 1, -10.f); m_World->CommitEntity(brick); return; diff --git a/src/game/Game/PadSystem.cpp b/src/game/Game/PadSystem.cpp index 0d039f8..9cfb5ca 100755 --- a/src/game/Game/PadSystem.cpp +++ b/src/game/Game/PadSystem.cpp @@ -199,7 +199,7 @@ bool dd::Systems::PadSystem::OnContact(const dd::Events::Contact &event) auto ent = m_World->CreateEntity(); std::shared_ptr transform = m_World->AddComponent(ent); transform->Position = glm::vec3(transformBall->Position.x, transformBall->Position.y + 0.01f, -10.f); - transform->Scale = glm::vec3(1.f, 1.f, 1.f); + transform->Scale = glm::vec3(0.5f, 0.5f, 0.5f); auto model = m_World->AddComponent(ent); model->ModelFile = "Models/Test/Ball/Ballopus.obj"; //auto pointlight = m_World->AddComponent(ent);