lvgamedev / simairport-modding

4 stars 4 forks source link

PROBLEM - Between 2 textures the game creates automatic black lines (not so good) #87

Closed modair1000 closed 4 years ago

modair1000 commented 4 years ago

I wanted to create one desk with 3 mods (the textures have no black lines between) but the game creates them(black lines) automaticly between that 3 textures. You told me some weeks ago that this not happens , so is that a bug then ? image

BR146 commented 4 years ago

I fiddled around with the PO renderer and the underlying atlas texture and was able to remove those lines.

Changing the filter mode of the atlas texture (note: all mod sprites are pointing to the atlas texture) to Point does the trick: placeableObject.sprites[0].sd.sprite.texture.filterMode = FilterMode.Point;

Renderer

Originally, the game uses bilinear interpolation. At the edges to transparent, the transparent pixels are all black on the atlas (RGBA is 0,0,0,0). Interpolated with the opaque neighbors this gives some kind of black.

This old unity manual document addresses this in some sorts: https://docs.unity3d.com/462/Documentation/Manual/HOWTO-alphamaps.html

If the ‘gutters’ (blank areas between UV’s) have colors/transparencies that are very different from the colors inside the UV’d areas, then those colors can ‘bleed’ together which creates seams on the model.

joscha999 commented 4 years ago

Duplicate of #75