Playing at 320x200

Talk about the mods you'd like to see in Daggerfall Unity. Give mod creators some ideas!
Khrome
Posts: 15
Joined: Tue Oct 24, 2017 1:34 am

Re: Playing at 320x200

Post by Khrome »

Interkarma wrote: Mon May 27, 2019 9:49 pm There are two stages to unpack here:
  1. If you set your resolution to 320x200, then Daggerfall Unity renders everything into a true 320x200 framebuffer.
  2. This is then presented to your display, which at fullscreen is scaled over the entire display area. Daggerfall Unity uses a bordlerless fullscreen window, not exclusive resolution. The scaling here is done by Unity and your GPU.
The texture filtering option you see in settings controls how textures are sampled in stage 1. Point filtering is just good old nearest-neighbour sampling.

The presentation in stage 2 requires the render to be scaled over your display surface. Unity itself (via the GPU) seems to use a bilinear or similar sampler to do this scaling. This is what results in the CRT-like blur over the whole display. I'm unaware of a way to change this step to use nearest-neighbour, which would result in a more 1:1 appearance with the render generated in stage 1.

But it's important for everyone to understand that Daggerfall Unity is rendering a true 320x200 framebuffer. I have intentionally built the game this way from the start. The issue is one of presentation as that render output is scaled to your actual display area, which is necessary if you want fullscreen. This is something done by Unity itself, and I don't believe we have any control over this. If I become aware of a way to control this, and it's not too involved, I'd be happy to add the support into DFU.
I did think it had to do with monitor/gpu scaling, though i was able to rule out the monitor at least, and i disabled all scaling in the gpu (as far as i could find the relevant setting in the control panel and via nvinspector), so i guess it must indeed be within Unity.

Though, this is why i was thinking of applying a shader on top of the game: I thought it'd be possible to 'pixelize' the output to a 320x200 resolution while still rendering the image itself at 1080p for example (i -think- this is how games like undertale and vvvvvv manage their pixel look). However, i guess that would likely produce some errors due to how the image is pixelized instead of properly rendered at the given resolution.

What i don't get is the fullscreen being borderless fullscreen though: The output window acts like a fullscreen window does (the same kind of behaviour, screen blacking out, unable to alt-tab without the screen going away, etc). I wonder how Unity does this on a technical level.

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

Re: Playing at 320x200

Post by Interkarma »

Khrome wrote: Tue May 28, 2019 9:15 am What i don't get is the fullscreen being borderless fullscreen though: The output window acts like a fullscreen window does (the same kind of behaviour, screen blacking out, unable to alt-tab without the screen going away, etc). I wonder how Unity does this on a technical level.
The game minimising when losing focus doesn't mean its not borderless windowed. It can just mean the game minimises when it loses focus. A fullscreen borderless window can behave either way. :)

If you guys prefer the borderless window not to minimise when alt-tabbing away, it's a really quick change to enable this. You can set it either way in Unity, I just have it set to minimise presently.

BTW, I hit up Aras (previously lead graphics programmer at Unity) on Twitter about controlling the filter mode of presentation scaling. He wasn't aware if this can be controlled or not, and hasn't worked on the graphics side for a couple of years now. It's possible to work around this by using a render-texture to control the final output. I'll evaluate if it's worth my time to do this a bit later in the project, depending on demand for a perfect 320x200 output.

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

Re: Playing at 320x200

Post by BansheeXYZ »

I feel like 800p (4x) should be the enforced minimum, if only to set a baseline for mods. Things that are designed for modern resolutions, especially fonts and ui elements, start to break down at these tiny resolutions. There's no way to design something to look good at both.

comradesean
Posts: 3
Joined: Tue May 28, 2019 5:39 pm

Re: Playing at 320x200

Post by comradesean »

320x200 is something chocolate doom does very well too. I'd very much appreciate the original resolutions being supported in DFU as well.

User avatar
MasonFace
Posts: 543
Joined: Tue Nov 27, 2018 7:28 pm
Location: Tennessee, USA
Contact:

Re: Playing at 320x200

Post by MasonFace »

pango wrote: Mon May 27, 2019 4:16 pm
MasonFace wrote: Mon May 27, 2019 3:50 pm There is a method of taking the output of the main camera and feeding it into a smaller RenderTexture and making that your new screen output . . .
This is likely to give terrible results.
320x200 is very low, all texts will be unreadable, etc. It only works in the original game because it's rendering directly at that resolution...
Very good point. I suppose all UI/Text elements could be rendered into a higher resolution RenderTexture and then layered above the other RenderTexture. Very hacky, but the text would at least be readable.

User avatar
King of Worms
Posts: 4752
Joined: Mon Oct 17, 2016 11:18 pm
Location: Scourg Barrow (CZ)
Contact:

Re: Playing at 320x200

Post by King of Worms »

I think if the UI was readable in original, it should be readable in DFU?
At least the non-modded one I mean...

Btw 320x200 x 6 = 1920 x 1200 and thats the resolution of my 16:10 monitor, so my guess is, for such aspect ratio, the conversion should be quite clean without much blur caused by the monitor resizing.

PS: having the ui in HD and just the 3d world in 320x200 would be cool as hell tho (if something like a cool hell exists :twisted: )

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

Re: Playing at 320x200

Post by Interkarma »

King of Worms wrote: Tue May 28, 2019 8:21 pm PS: having the ui in HD and just the 3d world in 320x200 would be cool as hell tho (if something like a cool hell exists :twisted: )
I'm with KoW on this one. I love the idea of a crisp retro-looking world but still having sharp text in UIs. I put together a PoC before work that renders the world to a 320x200 render texture with point filtering, which is then blitted to a secondary viewport camera. The UI layers are rendered at your set fullscreen resolution so they stay sharp at all times.

I'll work on making this an option for next builds. When this option is enabled, it will likely break compatibility with stacked camera mods like distant terrain, but it seems likely retro purists wouldn't try to combine the two anyway. UI texture replacement mods should still work as before.

Here's a preview screenshot. World is rendering at 320x200 with full UHD screen resolution for UI.

320mode.png
320mode.png (1.02 MiB) Viewed 1723 times

User avatar
King of Worms
Posts: 4752
Joined: Mon Oct 17, 2016 11:18 pm
Location: Scourg Barrow (CZ)
Contact:

Re: Playing at 320x200

Post by King of Worms »

This sounds and looks awesome!!

Distant terrain is not a problem because even default terrain distance is HUGE comparred to vanila ,)

Thank you for looking at it, fingers crossed!

User avatar
mikeprichard
Posts: 1037
Joined: Sun Feb 19, 2017 6:49 pm

Re: Playing at 320x200

Post by mikeprichard »

Although I don't see myself ever playing at this retro resolution, enabling and combining it with the high-res DFU UI is indeed cool as hell.
Last edited by mikeprichard on Wed May 29, 2019 8:57 am, edited 1 time in total.

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

Re: Playing at 320x200

Post by Interkarma »

Done! All of the following will be in next round of builds:
  • Enable "Retro 320x200 World Rendering" on launcher UI to render world as crisp 320x200 with no blur. UI will still be rendered at your set resolution, so it's possible to have a retro world with an ultra-HD UI. For best results, use a 16:10 screen resolution like 1920x1200 to ensure world sprites are not stretched.
  • Fullscreen bordlerless window is now visible in background, so you can view other windows and start menu on top of DFU when alt-tabbing.
  • Windowed mode can now be resized by dragging on corners in the usual way.
  • Use Alt+Enter to toggle between fullscreen and windowed mode while game is running. Note that returning to fullscreen will use the prior window resolution, so possible to end up with letterbox or pillarbox bars. Just restart game to reset normal fullscreen resolution.
In below example screenshots, "Retro 320x200 World Rendering" is enabled with a 16:10 game resolution of 1920x1200. World is crisp and chunky, UI is nice and smooth, and world sprites are not stretched. Seems to be a nice combination of retro and modern elements.

320mode-2.png
320mode-2.png (759.58 KiB) Viewed 1701 times
320mode-3.png
320mode-3.png (893.01 KiB) Viewed 1699 times

Post Reply