Working lights and deferred rendering
This commit is contained in:
@@ -265,7 +265,7 @@ void dd::Renderer::DrawDeferred(RenderQueue &objects, RenderQueue &lights)
|
||||
glClearColor(0, 0, 0, 1);
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
m_spDeferred3->Bind();
|
||||
glUniform3fv(glGetUniformLocation(*m_spDeferred3, "La"), 1, glm::value_ptr(glm::vec3(0.3f)));
|
||||
glUniform3fv(glGetUniformLocation(*m_spDeferred3, "La"), 1, glm::value_ptr(glm::vec3(0.5f)));
|
||||
glActiveTexture(GL_TEXTURE0);
|
||||
glBindTexture(GL_TEXTURE_2D, m_GDiffuse);
|
||||
glActiveTexture(GL_TEXTURE1);
|
||||
|
||||
@@ -38,6 +38,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;
|
||||
frag_Diffuse = DiffuseTexel * (vec4(1.f, 1.f, 1.f, 0.0) + LightingTexel);
|
||||
//frag_Diffuse = DiffuseTexel;
|
||||
//frag_Diffuse = vec4(LightingTexel.r, LightingTexel.g, LightingTexel.b, 1.0);
|
||||
}
|
||||
@@ -84,6 +84,6 @@ void main()
|
||||
|
||||
vec4 diffuseTexel = texture(DiffuseTexture, Input.TextureCoord);
|
||||
|
||||
//FragmentColor = phong(Input.Position, normalize(normal), specularTexel.rgb, specularTexel.a);
|
||||
FragmentColor = diffuseTexel;
|
||||
FragmentColor = phong(Input.Position, normalize(normal), specularTexel.rgb, specularTexel.a);
|
||||
//FragmentColor = diffuseTexel;
|
||||
}
|
||||
Reference in New Issue
Block a user