mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-07 19:23:04 +02:00
Fixed other compilation errors / warnings
This commit is contained in:
parent
b66aa4a742
commit
08aa133472
2 changed files with 5 additions and 5 deletions
|
@ -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);
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue