1

I am working on a game engine with no pixel shaders and on a fixed function GPU. I am trying to implement spherical mapping and coming across the problems with seams and artefacts when the texture wraps to the other side, similar to spherical mapping artefacts. This only happens when I use a normal matrix to convert the normals and not when I use an object's world transform to convert normals.

I am trying to implement a view-dependent spherical mapping scheme and have tried the two methods explained in these articles: https://www.ozone3d.net/tutorials/glsl_texturing_p04.php and https://learn.microsoft.com/en-us/windows/win32/direct3d9/spherical-environment-mapping. The former gives worse results than the latter, and the latter works perfectly with world space transforms.

I am just looking for any information as to why this happens and what can be done to prevent. I am aware that changing the vertex data for the sphere might help, but if there is a programmatic way to do it that would be helpful. You can see implementation to change texture coordinates for in this file on github in function SphereMappingCPU: https://github.com/crypt4489/PS2-Development/blob/master/src/main.c There are other implementations in source code as well. First picture is microsoft article implementation, second is ozone3d.net implementation using reflect equation.

Distortion caused by using microsoft article implementation:

Distortion caused by using ozone3d.net implementation:

Drew Fletcher
  • 41
  • 1
  • 4

0 Answers0