godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
90.7k stars 21.11k forks source link

Visible seams between GridMap tiles (sometimes only with MSAA enabled) #16337

Open ghost opened 6 years ago

ghost commented 6 years ago

image

Is hard to see. You need to open the image full size. There are no visible seams with MSAA Disabled but with 2x or higher I start seeing seams and edges of 3D meshes.

My guess is the texture or mesh is shrunk by a small factor in order to produce the edge aliasing.

I use a Gridmap is a cell size 1 , 1 , 1 and the tiles are all designed to be exactly 1 x 1 x 1 and the UV maps are made exactly to the dot for 64 x 64 textures.

This is on latest Godot 3.0 release

Calinou commented 3 months ago

If you wouldn't mind, could you explain to me a bit further why changing the filtering mode to Closest fixed this? I assume it has something to do with the atlas and the bleed you said before?

This is still due to a lack of padding between tiles in the atlas. When you use linear filtering, the edge of each tile will read from the nearest four pixels for linear interpolation. On each edge, two of those pixels will be from a different tile, possibly with a color that is very different. This is what leads to the visible line on tile edges.

Additionally, I was using the Cubic filter in order to make my texures blurry and not so pixelated. Is there a way to have both?

Yes, you need padding on the edges of your atlas tiles.

robbyph commented 3 months ago

Yes, you need padding on the edges of your atlas tiles.

How can I do this without losing the ability to "tile" my gridmap pieces, so that they line up with the texture of the next gridmap over? I think I might be misunderstanding how to do this. I appreciate your patience with me, I have to apologize, I'm very new to Godot, and Blender for that matter.

pineapplemachine commented 3 weeks ago

I'm having a similar issue with v4.3.stable.mono.official [77dcf97d8], but with just boxes placed in a grid without the use of a GridMap, with MSAA and all antialiasing turned off, and all unshaded materials without any lighting or shadows. But it is occurring only for the Mobile and Compatibility renderers, not for the Forward+ renderer, and it's showing up when using either an orthographic camera or (especially) a perspective camera with a low FOV.

For example, with a perspective camera and low FOV (5 degrees):

Mobile: image

Forward+: image

There's some more comments and media in a Twitter thread here: https://x.com/PineMach/status/1841918893478273349