From e64358197190bc148ec0b63cb7d3b7de4063791a Mon Sep 17 00:00:00 2001 From: antc13 Date: Tue, 19 Jan 2016 18:21:27 +0100 Subject: [PATCH] Commit in order to pull from Master. --- resources/Shaders/ForwardPlus.frag.glsl | 3 +-- src/Engine/Rendering/DrawFinalPassState.cpp | 2 +- src/Engine/Rendering/RawModelCustom.cpp | 4 +++- src/Engine/Rendering/Renderer.cpp | 8 ++++---- tools/MayaExporter/MayaExporter/Mesh.h | 7 ++++--- 5 files changed, 13 insertions(+), 11 deletions(-) diff --git a/resources/Shaders/ForwardPlus.frag.glsl b/resources/Shaders/ForwardPlus.frag.glsl index 450d8929..b6d07ba2 100644 --- a/resources/Shaders/ForwardPlus.frag.glsl +++ b/resources/Shaders/ForwardPlus.frag.glsl @@ -113,7 +113,7 @@ void main() totalLighting.Specular += result.Specular; } - //fragmentColor += Input.DiffuseColor * (totalLighting.Diffuse + totalLighting.Specular) * texel * Color; + fragmentColor += (totalLighting.Diffuse + totalLighting.Specular) * texel * Color; //fragmentColor += Input.DiffuseColor * (totalLighting.Diffuse) * texel * Color; //fragmentColor += vec4(0.0, LightGrids.Data[currentTile].Amount/3.0, 0, 1); //fragmentColor = texel * Input.DiffuseColor * Color; @@ -125,7 +125,6 @@ void main() } - fragmentColor = vec4(1.0f, 1.0f, 1.0f, 1.0f); } diff --git a/src/Engine/Rendering/DrawFinalPassState.cpp b/src/Engine/Rendering/DrawFinalPassState.cpp index 5bafc294..1cb9d7da 100644 --- a/src/Engine/Rendering/DrawFinalPassState.cpp +++ b/src/Engine/Rendering/DrawFinalPassState.cpp @@ -7,7 +7,7 @@ DrawFinalPassState::DrawFinalPassState() Enable(GL_BLEND); BlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); Enable(GL_DEPTH_TEST); - Disable(GL_CULL_FACE); //Should be enabled, fix it johan and andreas. + Enable(GL_CULL_FACE); ClearColor(glm::vec4(200.f / 255, 0.f / 255, 200.f / 255, 0.f)); Clear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); } diff --git a/src/Engine/Rendering/RawModelCustom.cpp b/src/Engine/Rendering/RawModelCustom.cpp index a749e1fd..b7f2a2fd 100644 --- a/src/Engine/Rendering/RawModelCustom.cpp +++ b/src/Engine/Rendering/RawModelCustom.cpp @@ -148,7 +148,9 @@ void RawModel::ReadMaterialSingle(unsigned int &offset, char* fileData, unsigned throw Resource::FailedLoadingException("Reading Material texture path failed"); } - newMaterial.TexturePath = (fileData + offset); + newMaterial.TexturePath = "Textures/"; + newMaterial.TexturePath += (fileData + offset); + newMaterial.TexturePath += ".png"; offset += nameLengths[0]; } diff --git a/src/Engine/Rendering/Renderer.cpp b/src/Engine/Rendering/Renderer.cpp index f86fea43..983b0736 100644 --- a/src/Engine/Rendering/Renderer.cpp +++ b/src/Engine/Rendering/Renderer.cpp @@ -101,10 +101,10 @@ void Renderer::Draw(RenderFrame& frame) m_Camera = scene->Camera; // remove renderer camera when Editor uses the render scene cameras. FillDepth(*scene); - //m_PickingPass->Draw(*scene); - //m_LightCullingPass->GenerateNewFrustum(*scene); - //m_LightCullingPass->FillLightList(*scene); - //m_LightCullingPass->CullLights(*scene); + m_PickingPass->Draw(*scene); + m_LightCullingPass->GenerateNewFrustum(*scene); + m_LightCullingPass->FillLightList(*scene); + m_LightCullingPass->CullLights(*scene); m_DrawFinalPass->Draw(*scene); //m_DrawScenePass->Draw(rq); diff --git a/tools/MayaExporter/MayaExporter/Mesh.h b/tools/MayaExporter/MayaExporter/Mesh.h index 0538e83c..11f6bcf8 100644 --- a/tools/MayaExporter/MayaExporter/Mesh.h +++ b/tools/MayaExporter/MayaExporter/Mesh.h @@ -69,9 +69,10 @@ public: for (auto aVertex : Vertices) { aVertex.WriteBinary(out); } - //for (auto aIndex : Indices) { - for (std::map>::reverse_iterator aIndex = Indices.rbegin(); aIndex != Indices.rend(); aIndex++){ - out.write((char*)(*aIndex).second.data(), sizeof(int) * (*aIndex).second.size()); + for (auto aIndex : Indices) { + //for (std::map>::reverse_iterator aIndex = Indices.rbegin(); aIndex != Indices.rend(); aIndex++){ + //out.write((char*)(*aIndex).second.data(), sizeof(int) * (*aIndex).second.size()); + out.write((char*)aIndex.second.data(), sizeof(int) * aIndex.second.size()); } }