This commit is contained in:
Daniel Ledda
2025-01-10 13:48:51 +01:00
parent 994cbc688f
commit 25384c743d
2 changed files with 2 additions and 2 deletions

View File

@@ -25,6 +25,6 @@ void main() {
float spec = pow(max(dot(view_direction_norm, reflect_dir), 0.0), 32); float spec = pow(max(dot(view_direction_norm, reflect_dir), 0.0), 32);
vec3 specular = specular_strength * spec * light_color; vec3 specular = specular_strength * spec * light_color;
vec3 result = (ambient + diffuse + specular) * solid_color; vec3 result = specular * (solid_color + 2 * light_color) / 2 + (ambient + diffuse) * solid_color;
frag_color = vec4(result, 1.0); frag_color = vec4(result, 1.0);
} }

View File

@@ -338,7 +338,7 @@ int main_gfx() {
big_frame.cam->pos = glm::vec3(0.0f, 4.0f, 4.0f); big_frame.cam->pos = glm::vec3(0.0f, 4.0f, 4.0f);
camera_look_at(big_frame.cam, 0.0f, 0.0f, 0.0f); camera_look_at(big_frame.cam, 0.0f, 0.0f, 0.0f);
glm::vec3 light_pos = glm::vec3(4.0f, 12.0f, 2.0f); glm::vec3 light_pos = glm::vec3(-15.0f, 10.0f, 6.0f);
glUseProgram(app_state.active_shader->prog_id); glUseProgram(app_state.active_shader->prog_id);
glUniform3fv( glUniform3fv(