Invisible grid in ground textures in cities

Post here if you need help getting started with Daggerfall Unity or just want to clarify a potential bug. Questions about playing or modding classic Daggerfall should be posted to Community.
User avatar
Interkarma
Posts: 7236
Joined: Sun Mar 22, 2015 1:51 am

Re: Invisible grid in ground textures in cities

Post by Interkarma »

BansheeXYZ wrote: Mon Jul 01, 2019 2:39 am Seems Pango has made some recent bugfixes for this. Any chance we could get some test builds to see if it works on all hardware? I use Intel graphics and get the seams badly, others seem to be getting them on certain AMD and Intel cards.
I'm dropping new builds on Friday with this change merged. Hopefully it helps, but from Pango's description of the problem it may not be so easily resolved in this case. Let us know how you go with next builds.

User avatar
pango
Posts: 3347
Joined: Wed Jul 18, 2018 6:14 pm
Location: France
Contact:

Re: Invisible grid in ground textures in cities

Post by pango »

I found this reading interesting, pointing the problem to fmod() usage:
https://stackoverflow.com/questions/147 ... s-aliasing
i'm not sure how useful it is though, as UNITY_SAMPLE_TEX2DARRAY* have no variant that takes derivatives.
(but maybe it's about the "math" seams?)

On an old Radeon HD 3450, I managed to fix (hide?) the seams by replacing

Code: Select all

float2 uv = fmod(unwrappedUV, 1.0);
with

Code: Select all

float2 uv = fmod(unwrappedUV + 1.0 / _TilemapDim, 1.0);
But that feels like black magic... Also, this fix only works for that card; All other cards start displaying seams :(
Last edited by pango on Thu Jul 25, 2019 6:22 am, edited 1 time in total.
Mastodon: @pango@fosstodon.org
When a measure becomes a target, it ceases to be a good measure.
-- Charles Goodhart

User avatar
Teralitha
Posts: 359
Joined: Wed Jul 17, 2019 3:44 pm

Re: Invisible grid in ground textures in cities

Post by Teralitha »

AMD Radeon RX 570 here. No mods. I also see these lines on the ground, but I didnt think anything of them. Gameplay is more important to me.

Mummelpuffin
Posts: 3
Joined: Sat Aug 17, 2019 4:35 am

Re: Invisible grid in ground textures in cities

Post by Mummelpuffin »

Just gonna pop in and necro this to confirm that this is occurring on my rx580 on 0.10.4.

User avatar
pango
Posts: 3347
Joined: Wed Jul 18, 2018 6:14 pm
Location: France
Contact:

Re: Invisible grid in ground textures in cities

Post by pango »

I know, it's not gone on Intel and AMD :(

For reference I came across this, with more ideas of stuff to try: https://gamedev.stackexchange.com/quest ... ured-cubes

This looks a lot like what we're facing, but it's unclear how it's fixed. A similar trick to the one I used for my old card (add an offset to uv) is mentioned: https://forums.torque3d.org/viewtopic.php?t=231
Mastodon: @pango@fosstodon.org
When a measure becomes a target, it ceases to be a good measure.
-- Charles Goodhart

User avatar
pango
Posts: 3347
Joined: Wed Jul 18, 2018 6:14 pm
Location: France
Contact:

Re: Invisible grid in ground textures in cities

Post by pango »

I tried to give it another shot, but I no longer have any AMD/ATI videocard at hand (the old motherboard died), so that's a blind attempt...
The hypothesis is a bug in the implementation of texture clamping with Tex2DArrays, and implement some pseudo CLAMP_TO_EDGE manually:
https://github.com/Interkarma/daggerfal ... e-clamping
(to be clear if you want to try it you need to be able to compile Daggerfall Unity on your own).
Mastodon: @pango@fosstodon.org
When a measure becomes a target, it ceases to be a good measure.
-- Charles Goodhart

User avatar
pango
Posts: 3347
Joined: Wed Jul 18, 2018 6:14 pm
Location: France
Contact:

Re: Invisible grid in ground textures in cities

Post by pango »

While on the topic of textures filtering, border of tiles with classic textures and bi/trilinear filtering will never look better than
trilinear classic tile borders.jpg
trilinear classic tile borders.jpg (109.81 KiB) Viewed 2125 times
(unless somebody reimplements bi/trilinear filtering on top of tiles texture indirection instead of beneath). If you use classic textures, Main Filter = Point is highly recommended anyway.

And if I'm not mistaken trilinear filtering for GUI and Video textures makes no sense since they don't have mipmaps... No harm done, but it should give the same result as bilinear filtering.
Mastodon: @pango@fosstodon.org
When a measure becomes a target, it ceases to be a good measure.
-- Charles Goodhart

User avatar
TheLacus
Posts: 1305
Joined: Wed Sep 14, 2016 6:22 pm

Re: Invisible grid in ground textures in cities

Post by TheLacus »

pango wrote: Fri May 22, 2020 2:48 am I tried to give it another shot, but I no longer have any AMD/ATI videocard at hand (the old motherboard died), so that's a blind attempt...
The hypothesis is a bug in the implementation of texture clamping with Tex2DArrays, and implement some pseudo CLAMP_TO_EDGE manually:
https://github.com/Interkarma/daggerfal ... e-clamping
(to be clear if you want to try it you need to be able to compile Daggerfall Unity on your own).
I tested it on an AMD card, didn't help 😔

User avatar
pango
Posts: 3347
Joined: Wed Jul 18, 2018 6:14 pm
Location: France
Contact:

Re: Invisible grid in ground textures in cities

Post by pango »

Crap. Well, that was worth a shot I guess. It will be difficult to fix without the hardware at hand.
Mastodon: @pango@fosstodon.org
When a measure becomes a target, it ceases to be a good measure.
-- Charles Goodhart

JordRobbo98
Posts: 3
Joined: Sun May 24, 2020 4:25 pm

Re: Invisible grid in ground textures in cities

Post by JordRobbo98 »

Just wanted to let you know, I have these grid lines also, with or without texture mods, I am using an AMD card too (5700XT). Any testing you guys need I’m more than happy just drop me a PM, love how far this has come in the past few years alone, anything I can do to help just let me know, Keep it up!😀

Post Reply