Fixed other compilation errors / warnings

This commit is contained in:
Olivier Prat 2019-04-05 11:32:00 +02:00
parent b66aa4a742
commit 08aa133472
2 changed files with 5 additions and 5 deletions

View file

@ -638,7 +638,7 @@ void CubeMap::convolveMipFaceForGGX(const GGXSamples& samples, CubeMap& output,
glm::vec4 CubeMap::computeConvolution(const glm::vec3& N, const GGXSamples& samples) const {
// from tangent-space vector to world-space
glm::vec3 bitangent = std::abs(N.z) < 0.999 ? glm::vec3(0.0, 0.0, 1.0) : glm::vec3(1.0, 0.0, 0.0);
glm::vec3 bitangent = std::abs(N.z) < 0.999f ? glm::vec3(0.0f, 0.0f, 1.0f) : glm::vec3(1.0f, 0.0f, 0.0f);
glm::vec3 tangent = glm::normalize(glm::cross(bitangent, N));
bitangent = glm::cross(N, tangent);

View file

@ -10,16 +10,16 @@ namespace ggx {
float evaluate(float NdotH, float roughness) {
float alpha = roughness * roughness;
float alphaSquared = alpha * alpha;
float denom = (float)(NdotH * NdotH * (alphaSquared - 1.0) + 1.0);
float denom = (float)(NdotH * NdotH * (alphaSquared - 1.0f) + 1.0f);
return alphaSquared / (denom * denom);
}
glm::vec3 sample(const glm::vec2& Xi, const float roughness) {
const float a = roughness * roughness;
float phi = (float)(2.0 * M_PI * Xi.x);
float cosTheta = (float)(std::sqrt((1.0 - Xi.y) / (1.0 + (a*a - 1.0) * Xi.y)));
float sinTheta = (float)(std::sqrt(1.0 - cosTheta * cosTheta));
float phi = 2.0f * (float) M_PI * Xi.x;
float cosTheta = std::sqrt((1.0f - Xi.y) / (1.0f + (a*a - 1.0f) * Xi.y));
float sinTheta = std::sqrt(1.0f - cosTheta * cosTheta);
// from spherical coordinates to cartesian coordinates
glm::vec3 H;