mirror of
https://github.com/MartinOpat/cuda-based-raytrace.git
synced 2025-06-07 02:13:10 +02:00
Re-implemented vec3 initializations based on new definition
This commit is contained in:
@@ -12,7 +12,7 @@ __device__ Vec3 phongShading(const Vec3& normal, const Vec3& lightDir, const Vec
|
||||
|
||||
Vec3 reflectDir = (normal * (2.0 * normal.dot(lightDir)) - lightDir).normalize();
|
||||
double spec = pow(fmax(viewDir.dot(reflectDir), 0.0), shininess);
|
||||
Vec3 specular = Vec3(1.0, 1.0, 1.0) * (specularStrength * spec);
|
||||
Vec3 specular = Vec3::init(1.0, 1.0, 1.0) * (specularStrength * spec);
|
||||
|
||||
return ambient + diffuse + specular;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user