From 479c450fef4b7cfcc66408efe47cdb3d5b33f2a4 Mon Sep 17 00:00:00 2001 From: Martin Opat Date: Mon, 30 Dec 2024 12:09:12 +0100 Subject: [PATCH] Re-implemented vec3 initializations based on new definition --- src/illumination/shading.h | 2 +- src/linalg/mat.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/illumination/shading.h b/src/illumination/shading.h index 26c8db4..fa3ee8e 100644 --- a/src/illumination/shading.h +++ b/src/illumination/shading.h @@ -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; } diff --git a/src/linalg/mat.h b/src/linalg/mat.h index 41bf6b4..92f6fdc 100644 --- a/src/linalg/mat.h +++ b/src/linalg/mat.h @@ -20,5 +20,5 @@ __device__ Vec3 computeGradient(float* volumeData, const int volW, const int vol float gz = volumeData[zp * volW * volH + y * volW + x ] - volumeData[zm * volW * volH + y * volW + x ]; - return Vec3(gx, gy, gz); + return Vec3::init(gx, gy, gz); }