Skip to content

Commit

Permalink
Merge pull request #7169 from PimTournaye/imageLight-fix
Browse files Browse the repository at this point in the history
imageLight - panorama shader bug, added @perminder-17 code snippet
  • Loading branch information
davepagurek authored Aug 12, 2024
2 parents 56ec9b6 + f14faea commit 670de7b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/webgl/shaders/sphereMapping.frag
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ void main() {
float angleX = mix(uFovX/2.0, -uFovX/2.0, vTexCoord.x);
vec3 rotatedNormal = vec3( angleX, angleY, 1.0 );
rotatedNormal = uNewNormalMatrix * normalize(rotatedNormal);
float temp = rotatedNormal.z;
rotatedNormal.z = rotatedNormal.x;
rotatedNormal.x = -temp;
vec2 suv;
suv.y = 0.5 + 0.5 * (-rotatedNormal.y);
suv.x = atan(rotatedNormal.z, rotatedNormal.x) / (2.0 * PI) + 0.5;
Expand Down

0 comments on commit 670de7b

Please sign in to comment.