feat: ambient lighting
This commit is contained in:
parent
ef67495aef
commit
abb990b9d4
|
@ -4,5 +4,12 @@ out vec4 FragColor;
|
||||||
|
|
||||||
void main()
|
void main()
|
||||||
{
|
{
|
||||||
FragColor = vec4(1.0, 0.5, 0.2, 1.0);
|
vec3 objectColor = vec3(1.0, 0.5, 0.2);
|
||||||
|
vec3 lightColor = vec3(1.0, 1.0, 1.0);
|
||||||
|
float ambientStrength = 0.1;
|
||||||
|
|
||||||
|
vec3 ambient = ambientStrength * lightColor;
|
||||||
|
vec3 result = ambient * objectColor;
|
||||||
|
|
||||||
|
FragColor = vec4(ambient, 1.0);
|
||||||
}
|
}
|
||||||
|
|
|
@ -130,9 +130,6 @@ int main()
|
||||||
GLuint shaderProgram = compileShaderProgram();
|
GLuint shaderProgram = compileShaderProgram();
|
||||||
Icosphere sphere(2);
|
Icosphere sphere(2);
|
||||||
|
|
||||||
// Wireframe
|
|
||||||
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
|
|
||||||
|
|
||||||
// Main loop
|
// Main loop
|
||||||
while (!glfwWindowShouldClose(window))
|
while (!glfwWindowShouldClose(window))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue