fixing shading a bit

This commit is contained in:
Dynamitos
2025-01-26 21:49:53 +01:00
parent d8b80760ba
commit e24bcd508c
8 changed files with 28 additions and 38 deletions
+2 -1
View File
@@ -9,5 +9,6 @@ glm::vec3 BRDF::evaluate(HitInfo hit, glm::vec3 viewDir, glm::vec3 lightDir, glm
glm::vec3 h = glm::normalize(lightDir + viewDir);
float specular = pow(std::min(std::max(glm::dot(normal, h), 0.0f), 1.0f), shininess);
return (albedo * diffuse * lightColor) + (specularColor * specular);
return (albedo * diffuse * lightColor);
//+(specularColor * specular);
}
+1 -1
View File
@@ -11,7 +11,7 @@ struct BRDF
glm::vec3 albedo = glm::vec3(1, 1, 1);
float alpha = 1;
glm::vec3 specularColor = glm::vec3(1, 1, 1);
float shininess = 0;
float shininess = 0.04;
glm::vec3 emissive = glm::vec3(0, 0, 0);
MaterialType materialType;
glm::vec3 evaluate(struct HitInfo hit, glm::vec3 viewDir, glm::vec3 lightDir, glm::vec3 lightColor);
+1 -1
View File
@@ -17,7 +17,7 @@ struct Ray
struct HitInfo
{
float t;
float t = std::numeric_limits<float>::max();
glm::vec3 position;
glm::vec3 normal;
// not entirely sure what that does