Re-implemented vec3 initializations based on new definition
This commit is contained in:
parent
32d0f3a0fb
commit
479c450fef
|
|
@ -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();
|
Vec3 reflectDir = (normal * (2.0 * normal.dot(lightDir)) - lightDir).normalize();
|
||||||
double spec = pow(fmax(viewDir.dot(reflectDir), 0.0), shininess);
|
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;
|
return ambient + diffuse + specular;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -20,5 +20,5 @@ __device__ Vec3 computeGradient(float* volumeData, const int volW, const int vol
|
||||||
float gz = volumeData[zp * volW * volH + y * volW + x ]
|
float gz = volumeData[zp * volW * volH + y * volW + x ]
|
||||||
- volumeData[zm * volW * volH + y * volW + x ];
|
- volumeData[zm * volW * volH + y * volW + x ];
|
||||||
|
|
||||||
return Vec3(gx, gy, gz);
|
return Vec3::init(gx, gy, gz);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue