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
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 »

chantling wrote: Tue Jan 22, 2019 4:38 am I was also getting seams along the edges of stairs in dungeons and some seams in walls.
I think this is a totally different issue, those come from the approximate modeling of the original game, some have cracks like that. Most of the time it was fine in the original game because scenes were rendered in 320x200, but the cracks are perfectly visible with modern resolutions.
chantling wrote: Tue Jan 22, 2019 4:38 am Also quite a few 3d objects appeared to be floating just above the ground,
Again this is an issue with game data, approximate modeling again.

Talking of that, blending 3d and 2d objects is a trick and will always look wrong under some angles. To compensate, the heights of 2d objects (treasures, torches, stuff on tables,...) must have been set manually to look good under the expected viewing angle, and some tweaks that "looked good" with the original engine may look weird in a newer engine.
Mind you some heights are totally wrong even for the original engine! They're a few famous obviously levitating treasure piles in cabinets and torches in mid air.
Mastodon: @pango@fosstodon.org
When a measure becomes a target, it ceases to be a good measure.
-- Charles Goodhart

chantling
Posts: 10
Joined: Tue Nov 27, 2018 2:15 pm

Re: Invisible grid in ground textures in cities

Post by chantling »

Yeah, the levitating 2D objects I assumed were just funky placement. The 3D ones, like the columns in the Mage's Guild in the pic I posted or signposts outside buildings, seem strange; you'd think the placement on those would be exact enough that there's not an obvious gap below. But it's only obvious because of the shadows in DFUnity. Without those, the 3D objects have never looked "connected" to the ground to me. I'm not sure what it is about Daggerfall that lends to that effect; objects frequently look like they're floating at a point in space between the viewer and the actual scene. Like a perspective illusion.

User avatar
Hazelnut
Posts: 3015
Joined: Sat Aug 26, 2017 2:46 pm
Contact:

Re: Invisible grid in ground textures in cities

Post by Hazelnut »

Interkarma wrote: Sat Dec 15, 2018 1:28 pm I've only ever seen this with Intel integrated GPUs (not sure about AMD). Seems to be a precision issue at boundary - possibly a difference with how shader instructions are optimised or executed on these down-level graphics processors compared to discrete GPUs with more power.
Unfortunately it is an issue with AMD graphics cards as well. When I started working on DFU I was using a RX270 (AMD) and I saw this issue but was so new didn't make a fuss just figured it was still in development. Shortly afterwards I switched to a 1050Ti (because of the stupid card prices at the time) and the issue went away I think - well it's possible I was just ignoring it, but that doesn't sound like me. Just recently upgraded to a RX580 now they're back to sane prices (1050 will go to son to replace his 750Ti) and I get the tile seams in DFU.

Seams.png
Seams.png (299.15 KiB) Viewed 2845 times
chantling wrote: Tue Jan 22, 2019 4:38 am Just got a radeon RX570 a few days ago. Aside from loading DFUnity briefly to see what kind of fps difference I got, I didn't play with it until this new release. Immediately rushed to try out the new smaller dungeons and it appears that the seams are gone.
Hmm, can you give an update since the RX570 is basically the same card as my RX580 so it's sort of wierd if I get seams but you don't! I'm using Radeon Software Version 18.12.3, Direct3D® Version 9.14.10.01377, OpenGL® Version 25.20.15000.13543.

Going to update to latest drivers and see what happens...
See my mod code for examples of how to change various aspects of DFU: https://github.com/ajrb/dfunity-mods

User avatar
Hazelnut
Posts: 3015
Joined: Sat Aug 26, 2017 2:46 pm
Contact:

Re: Invisible grid in ground textures in cities

Post by Hazelnut »

So latest drivers changed nothing, didn't think they would but you never know. Now using Radeon Software Version 19.1.1, Direct3D® Version 9.14.10.01377, OpenGL® Version 25.20.15000.13544 for what it's worth.
See my mod code for examples of how to change various aspects of DFU: https://github.com/ajrb/dfunity-mods

chantling
Posts: 10
Joined: Tue Nov 27, 2018 2:15 pm

Re: Invisible grid in ground textures in cities

Post by chantling »

Sorry, I meant the seams in the dungeon walls. The texture seams on the ground are still there.

User avatar
Hazelnut
Posts: 3015
Joined: Sat Aug 26, 2017 2:46 pm
Contact:

Re: Invisible grid in ground textures in cities

Post by Hazelnut »

Ah, okay, so looks like AMD cards do have this issue across the board then? Unless someone with AMD doesn't have the issue? Also my linux laptop using whatever built in gfx the intel i5 has doesn't have seams.

Anyone know about shaders then? :D I certainly don't. Maybe someone knows of a shader expert who is an AMD fan that may take a look?
See my mod code for examples of how to change various aspects of DFU: https://github.com/ajrb/dfunity-mods

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 »

Interkarma wrote: Sat Jan 19, 2019 10:07 pm I can confirm this is a bug is my classic sky code. I thinks it's a gap in my math (never my strongest quality) for calculating sliding sky texture offset.

I've been meaning to look at this one for ages, but haven't gotten around to it yet. Feel free to add a bug report if you like, that will make sure it gets looked at later. :)
The root issue seems to be that transform.eulerAngles.y can become slightly negative (not by much, I've seen up to -0,000563718).
Submitted a PR, even if it's not very elegant...
Mastodon: @pango@fosstodon.org
When a measure becomes a target, it ceases to be a good measure.
-- Charles Goodhart

User avatar
Interkarma
Posts: 7236
Joined: Sun Mar 22, 2015 1:51 am

Re: Invisible grid in ground textures in cities

Post by Interkarma »

Hey! Thanks for looking into that, much appreciated. :)

BansheeXYZ
Posts: 555
Joined: Fri Oct 23, 2015 8:19 pm

Re: Invisible grid in ground textures in cities

Post by BansheeXYZ »

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.

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 »

That could be interesting indeed, given I don't have access to such hardware.

It seems there's more than one issue at play though.
One is a math mistake, trying to derive a discontinuous function was creating thin seams near the player and blinking further away.
Another is, from what I've read, some hardware/driver combo (AMD seems to be in that case, I'm not sure about Intel) using 24bit floats instead of 32bit. Beside the fact it's not standard compliant, the rounding errors create visible artefacts around tiles.
I found a solution for the former, but I'm not sure if anything can be done for the latter :(
Mastodon: @pango@fosstodon.org
When a measure becomes a target, it ceases to be a good measure.
-- Charles Goodhart

Post Reply