afritz1 / OpenTESArena

Open-source re-implementation of The Elder Scrolls: Arena.
MIT License
915 stars 68 forks source link

Mountains are floating #211

Closed ZeriBun closed 10 months ago

ZeriBun commented 3 years ago

image

As you can see, mountains are floating. Seems to be the case in lots of places. havent seen nonfloating mountains (edit: easiest way to replicate is spawning into imperial city, then disabling collision, turning around and going through the wall, then look east there is a mountain)

image dont even know if this is supposed to be a mountain (edit: theres far away houses infront of the mountain that are fogged out, thats why it looks weird. no bug here)

Thunderforge commented 3 years ago

Thanks for reporting this bug! Is there a particular location where this can be easily reproduced?

ZeriBun commented 3 years ago

you can noclip out of any cities walls, but without cheats you can go to cities that have unwalled sections like Southpoint in Valenwood

afritz1 commented 3 years ago

Possible solution for this is to have the engine calculate how tall a texel in an Arena mountain texture is in degrees, then move the projected vertices down by that much so it still works in case textures are able to be modded to have any resolution. This all rests on the assumption that the original game does indeed shift mountains down by a pixel.

afritz1 commented 3 years ago

A quick look through MOUNT000.IMG through MOUNT022.IMG shows that they in fact don't have a 1 pixel gap at the bottom like I originally thought, which is weird because I was so sure about that. So it could just be a renderer bug.

afritz1 commented 3 years ago

The volcano in Morrowind does however (VOLCANO1.DFA and VOLCANO2.DFA), so that is one place with the gap.

TEMP10.IMG has a gap.

afritz1 commented 10 months ago

This still happens in the new renderer but this issue can be closed. Reason:

The engine works like Minecraft - there is a set of loaded chunks around the player. The player's camera is some height above the ground and will be able to peer over the edge of the world pretty easily if there aren't that many chunks:

screenshot0000

The solution is to have more chunks so they stretch further out to the horizon and the perceived gap between the world edge and distant land shrinks (although performance is bad right now):

screenshot0001

I guarantee the meshes for all distant lands have their bottom edge resting on Y=0, and the rasterizer samples the center of pixels, so there is definitely no rounding or off-by-one problem happening here.