Use normalized cross product results for irradiance map generation in PBR tutorials.

This commit is contained in:
Joey de Vries
2021-04-07 10:00:07 +02:00
parent bc41d2c019
commit 85ee9d136f
3 changed files with 6 additions and 6 deletions

View File

@@ -19,8 +19,8 @@ void main()
// tangent space calculation from origin point
vec3 up = vec3(0.0, 1.0, 0.0);
vec3 right = cross(up, N);
up = cross(N, right);
vec3 right = normalize(cross(up, N));
up = normalize(cross(N, right));
float sampleDelta = 0.025;
float nrSamples = 0.0;

View File

@@ -14,8 +14,8 @@ void main()
// tangent space calculation from origin point
vec3 up = vec3(0.0, 1.0, 0.0);
vec3 right = cross(up, N);
up = cross(N, right);
vec3 right = normalize(cross(up, N));
up = normalize(cross(N, right));
float sampleDelta = 0.025;
float nrSamples = 0.0f;

View File

@@ -14,8 +14,8 @@ void main()
// tangent space calculation from origin point
vec3 up = vec3(0.0, 1.0, 0.0);
vec3 right = cross(up, N);
up = cross(N, right);
vec3 right = normalize(cross(up, N));
up = normalize(cross(N, right));
float sampleDelta = 0.025;
float nrSamples = 0.0f;