Merge remote-tracking branch 'origin/master' into Sound

Conflicts:
	include/Core/Engine.h
This commit is contained in:
Stiffly
2015-09-17 13:18:56 +02:00
44 changed files with 18806 additions and 228 deletions
+11 -11
View File
@@ -77,20 +77,20 @@ void dd::Camera::SetOrientation(glm::quat val)
void dd::Camera::UpdateProjectionMatrix()
{
m_ProjectionMatrix = glm::ortho(
-16.f,
16.f,
-9.f,
9.f,
m_NearClip,
m_FarClip
);
// m_ProjectionMatrix = glm::perspective(
// m_FOV,
// m_AspectRatio,
// m_ProjectionMatrix = glm::ortho(
// -16.f,
// 16.f,
// -9.f,
// 9.f,
// m_NearClip,
// m_FarClip
// );
m_ProjectionMatrix = glm::perspective(
m_FOV,
m_AspectRatio,
m_NearClip,
m_FarClip
);
}
void dd::Camera::UpdateViewMatrix()
+1
View File
@@ -40,6 +40,7 @@ void dd::EventBroker::Unsubscribe(BaseEventRelay &relay) // ?
{
if (it->second == &relay)
{
relay.m_Broker = nullptr;
eventRelays.erase(it);
break;
}
+16 -5
View File
@@ -113,6 +113,8 @@ void dd::Renderer::CreateBuffers()
m_ScreenQuad = CreateQuad();
m_UnitQuad = ResourceManager::Load<Model>("Models/Core/UnitQuad.obj");
m_UnitSphere = ResourceManager::Load<Model>("Models/Core/UnitSphere.obj");
m_StandardNormal = ResourceManager::Load<Texture>("Textures/Core/NeutralNormalMap.png");
m_StandardSpecular = ResourceManager::Load<Texture>("Textures/Core/NeutralSpecularMap.png");
glGenRenderbuffers(1, &m_rbDepthBuffer);
glBindRenderbuffer(GL_RENDERBUFFER, m_rbDepthBuffer);
@@ -208,7 +210,7 @@ void dd::Renderer::CreateBuffers()
void dd::Renderer::Draw(RenderQueueCollection& rq)
{
//DrawDeferred(rq.Deferred, rq.Lights);
DrawDeferred(rq.Deferred, rq.Lights);
rq.Forward.Jobs.sort(dd::Renderer::DepthSort);
DrawForward(rq.Forward, rq.Lights);
@@ -289,8 +291,8 @@ void dd::Renderer::DrawForward(RenderQueue &objects, RenderQueue &lights)
glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, GL_ONE);
glBindFramebuffer(GL_FRAMEBUFFER, m_fbDeferred3);
glClearColor(1, 0.9, 0.8f, 1);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
// glClearColor(1, 0.9, 0.8f, 1);
// glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
m_spForward->Bind();
DrawScene(objects, *m_spForward);
@@ -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);
@@ -39,6 +39,7 @@ void main()
//frag_Diffuse = DiffuseTexel * (vec4(La, 0.0) * (vec4(LightingTexel.rgb, 0.0) + vec4(LightingTexel.a, LightingTexel.a, LightingTexel.a, 0.0)));
//frag_Diffuse = DiffuseTexel * (vec4(La, 0.0) + LightingTexel);
//frag_Diffuse = DiffuseTexel * (vec4(1.f, 1.f, 1.f, 0.0) + LightingTexel);
frag_Diffuse = DiffuseTexel;
frag_Diffuse = DiffuseTexel + LightingTexel;
//frag_Diffuse = DiffuseTexel;
//frag_Diffuse = vec4(LightingTexel.r, LightingTexel.g, LightingTexel.b, 1.0);
}
+1 -1
View File
@@ -163,7 +163,7 @@ void dd::World::Initialize()
}
}
void dd::World::CommitEntity(EntityID entity)
int dd::World::CommitEntity(EntityID entity)
{
for (auto pair : m_Systems)
{