Cursor using filtering [RESOLVED]

Locked
chtujo
Posts: 67
Joined: Fri Sep 22, 2017 12:54 am
Location: Yeorth Burrowland

Cursor using filtering [RESOLVED]

Post by chtujo »

I'm not sure if this a bug or even worth posting, but it's been bugging me for a while.

The issue is the cursor always seems to use some sort of texture filtering, even with UI filtering set to point. This isn't with the latest build.

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

Re: Cursor using filtering

Post by Interkarma »

This frustrated me a while back. The cursor texture itself is set to point filtering, but the hardware cursor always seems to render with a filtered look. Not sure if this is a platform thing (e.,g. Windows/Linux) or a Unity thing.

Admittedly I didn't spend a lot of time on the problem. Happy to accept this as a bug for now and I'll see if I can do anything about it in future. However, I won't be changing to a software cursor, it must remain a hardware cursor.

chtujo
Posts: 67
Joined: Fri Sep 22, 2017 12:54 am
Location: Yeorth Burrowland

Re: Cursor using filtering

Post by chtujo »

Thanks! I'm not really sure what you're getting at with the hardware/software cursors though as I'm not a programmer. I do know that texture filtering looks awful with Daggerfalls default assets though.

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

Re: Cursor using filtering

Post by Interkarma »

A hardware cursor runs at operating system level and is independent from game rendering, frame-rate, etc. It's the most responsive type of cursor but unfortunately we don't have much control over its presentation because it's drawn by the operating system.

A software cursor runs within the games render environment and is heavily tied to frame rate. You have the most control over the cursor appearance (because you are drawing it within the game), but it's incredibly sensitive to performance and resolution. If you've ever experienced cursors that are laggy/swimmy, or scale weirdly when you change resolution (e.g. too big or too small) it's usually because they're using a software cursor that renders inside the game itself. I personally dislike software cursors.

Due to the way Daggerfall Unity operates as a borderless fullscreen window at highly variable resolutions (anywhere from 320x200 up to 4k) a hardware cursor is the best overall solution. It's consistently sized and always performs well, even if the game itself is running badly.

chtujo
Posts: 67
Joined: Fri Sep 22, 2017 12:54 am
Location: Yeorth Burrowland

Re: Cursor using filtering

Post by chtujo »

That makes sense, thanks. On a somewhat related note, is there a chance DFU will get aniscopic filtering? As I said I'm not a programmer, but it always looks the best, and after doing some quick research it seems to work exelently with pixel textures.

Edit: Nevermind about my research, it was actually some asset store thing that used aniscopic filtering.

ifkopifko
Posts: 195
Joined: Thu Apr 02, 2015 9:03 am

Re: Cursor using filtering

Post by ifkopifko »

Maybe an easy solution to fix the cursor filtering would be to swap the cursor image with a higher resolution image (but with pixelated look). It should at least help to make it less noticeable.

On the side note (anisotropic filtering), I have been wondering about it for a long time. It would probably make the low-res textures blurry. Again, upscaling would likely help.
However, searching this topic, I have come across this article, although I do not understand a thing it said :D :
https://csantosbh.wordpress.com/2014/01 ... -in-webgl/

Maybe someone can make some sense of it.

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

Re: Cursor using filtering

Post by Interkarma »

Daggerfall Unity already uses anisotropic filtering. When setting your resolution and quality settings, use the "Beautiful" or "Fantastic" profiles to force-enable global anisotropic filtering on all textures.

A good place to see aniso in action is when looking along the length of a long city wall (e.g. Daggerfall city) then moving forwards slowly. You'll see a lot more coherence on these textures with aniso enabled than on lower quality settings. It's already in there doing the work. :)

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

Re: Cursor using filtering

Post by Interkarma »

ifkopifko wrote: Fri Mar 16, 2018 8:45 am Maybe an easy solution to fix the cursor filtering would be to swap the cursor image with a higher resolution image (but with pixelated look). It should at least help to make it less noticeable.
Unfortunately hardware cursors are limited to 32x32 pixels, but it could be worth a shot. The default cursor is 10x10 so it suffers more from the scaling.

Edit: Yep, that definitely improves the look quite a bit. I'll ship next build with new cursor. This is probably the best it's going to look under the constraints available. Thanks for the suggestion! :)

ifkopifko
Posts: 195
Joined: Thu Apr 02, 2015 9:03 am

Re: Cursor using filtering

Post by ifkopifko »

Glad to be of some help at least. :D
Interkarma wrote: Fri Mar 16, 2018 9:00 am Daggerfall Unity already uses anisotropic filtering...
Good to know, I have never realised that. So it is possible to retain the pixelated look even with AF?
I always do see a distinct "line" in high contrast textures (e.g. house windows) at certain distance, even though I am using the "fantastic" profile. I have attributed it to the absence of AF. Maybe my dated video card is at fault then (Radeon HD4830), or perhaps low-res textures behave like this... will have to experiment with the high-res mods when I have some free time. :)

chtujo
Posts: 67
Joined: Fri Sep 22, 2017 12:54 am
Location: Yeorth Burrowland

Re: Cursor using filtering [RESOLVED]

Post by chtujo »

Sorry for the late reply, and thanks, I'm looking forward to the more pixel looking cursor.

Locked