Equirectangular world texture

Hello friends !

I have a problem when I put an equirectangular texture to the world. It almost works, but there is ugly deformations when playing game. Is there something i’m missing ?

In viewport, everything is OK :
When I run the game, it’s not as nice :

I made another try with an image from wikipedia, same result :
original image :

viewport (OK) :
in game (not OK) :

Thanks in advance for helping me,

Hi, that is a “known” issue, reported here: https://github.com/armory3d/armory/issues/1277.

I solved the problem by putting the earth at the “pole” of the map, where there is no deformation.
I know there are deformations on the stars but that’s invisible :slight_smile:

That’s quite an interesting solution :grin: :+1: , I was looking at the code to see if I could maybe poke it a bit to see if I could fix it, and I found that the environment shader code resides here: https://github.com/armory3d/armory/tree/master/Shaders/world_pass, in the fragment shader in a particular line there is call to a envMapEquirect function,
https://github.com/armory3d/armory/blob/dfda5f9dbbb2dd07228c755edce9fd98bace41a9/Shaders/world_pass/world_pass.frag.glsl#L138 that is a function that resides in here https://github.com/armory3d/armory/blob/master/Shaders/std/math.glsl.

Googling “environment Map Equirect” and directly “envMapEquirect” too I found different snippets of code so I tested the first one I came across https://github.com/vorg/pragmatic-pbr/blob/master/local_modules/glsl-envmap-equirect/index.glsl, and changing the one in armory to be like that one it seems to work, only that the orientation and rotation is wrong… with a bit more of shader and math knowledge than I currently have I think it could be sorted out :sweat_smile:.

1 Like

The problem is not in shader, rather in hdr generate by cmft
See the comparison (ignore the quality):
(Left is original, right is generate by cmft)

See the forth’s tower transformer that isn’t visibile in original

See the tree on right that isn’t visible in original

Binary of cmft build is 2 year old, I think they should be update, this might fix the issue or the issue might resides in the export settings of cmft

1 Like