0.13.2b Retro mode and render aspect ratio

Discuss Daggerfall Unity and Daggerfall Tools for Unity.
ifkopifko
Posts: 195
Joined: Thu Apr 02, 2015 9:03 am

0.13.2b Retro mode and render aspect ratio

Post by ifkopifko »

Hi there, I have not posted for a good while, but I have tried to follow on the main improvements Interkarma and the other developers and modders have been able to pull off. Truly awesome work! Just to try it all out took me a lot of time… which I enjoyed very much. :-) A big thanks to all of you!

My post might get a bit longish, sorry about that. :-) Also, if the things I write have been discussed before, I apologize (please, just post some links to the discussions if possible or just tell me politely to STFU). Not sure whether to put some of this into the Help&Support section as well…

The render overhaul (linear lighting) made a big improvement in the graphics in my opinion. Also, I very much like the post processing and other graphical goodies that got implemented… especially the ambient occlusion… voxel multiscale FTW, even though I have no idea how it works. :-)

I also like the new posts on introducing the claustrophobic dungeon feeling into DFU. I have been able to achieve this effect with the combination and tuning down ambient light and use the voxel ambient occlusion… well… at least it worked to my liking.

There are some things I have noticed when fooling around in DFU settings and stuff. Some are probably new to the 0.13 line, some are older. Currently running 0.13.2b on windows, all below observations are based on this version.

- Aspect ratio… A complex matter… I am aware that this has been discussed a lot, not sure whether a “perfect” solution exists, I did not find it. I take it that Daggerfall Setup is rendered and displayed correctly (640x400 stretched on a 4:3 screen area) and the goal is to reach parity with it (even though I would prefer the HUD and UI to be squashed a bit… just my personal feeling).

- So, there are three elements to consider. The UI menus like Char sheet, inventory etc. The large onscreen HUD. The rendered game world.

- The standard HD DFU with free-scaling disabled seems alright to me personally. I do not use the large HUD but it seems a bit squashed compared to the original, the character face on the large HUD has the same proportions as the face on the paper-doll in the UI screens. The UI seems rendered at 16:10 ratio, which is squashed compared to the original, but is very much to my liking. The “world” aspect ratio seems correct (same as original, with maybe a miniscule deviation – a bit wider than the original) for any resolution I have tried. However, if you enable free-scaling, the character face on the large HUD is not scaled with the rest of the HUD and so it does not have the same proportions as the paper-doll face.

- The retro mode… The last info on the perfect setup says to set a 4:3 resolution and enable free-scaling and enable retro mode. However, I have noticed that the “world” aspect ratio is incorrect in this setup and it’s different from the standard HD DFU and also from the original DF – narrower than the original. Actually, if you set a 16:10 resolution you will have the same “world” aspect ratio as HD DFU… but the UI will be 16:10 so even though it suits my taste, it is different from the original DF. The large HUD also will not get stretched to the “correct” aspect ratio (this again suits my taste since widescreen monitors do not have vertical space to spare in my opinion).

- Another thing… Before the 0.13 the retro mode (which I love to use) did not seem to use much different rendering when compared to the standard HD DFU. You had the palletisation and posterisation options to introduce retro color look. Now however, the retro mode seems to use a very different rendering than HD DFU. Even without palletisation and posterisation the colors are somehow simplified… Different shaders, different color depth, I have no idea. In this state the palletisation and posterisation options are useless, because then it really gets messy far beyond the original DF retro look. :-D


Now, mind you, I am a big fan of the retro mode, but I am not a purist in this respect. I like to use HD UI textures and the crisp text, HD paper-doll etc. I also use some graphical mods for the “world”, like enhanced sky (primarily because of motion sickness), real grass, HD flats, and shadows of course. And of course the much appreciated voxel ambient occlusion, even though it tends to create some graphical artifacts at some places… especially in the current retro mode.

So to the point. I would like to ask whether it would be possible to add a certain mode/functionality. My idea would be to use the retro look for the “world” and perhaps turn on/off the various aspects of its “retroidness”… like the color simplification which does not suit my taste too much and it does not work very well with the ambient occlusion… or so it seems to me. Also, it would be nice to be able to leverage the widescreen look while keeping the retro look (a bit pixelated low resolution), back in the days there haven’t been any widescreen PC monitors, but I think that wider view enhances these games quite a lot.

Perhaps one partial solution that comes to mind would be to have the ability to set a separate custom “world render” resolution and aspect ratio, which would be decoupled from the resolution at which the UI and HUD are rendered. Of course, I have no idea how difficult to implement this might prove and how many thing it could potentially break, so it’s just an idea… might be a bad idea. :-)

A longish post… as expected. So thank you again… also for reading this post. :-D If you have any comments, feedback, I’m all ears. Also, if something above is not clear, just tell me, I will try to fix it, provide screenshots etc.

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

Re: 0.13.2b Retro mode and render aspect ratio

Post by King of Worms »


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

Re: 0.13.2b Retro mode and render aspect ratio

Post by Interkarma »

Retro Mode is getting some love in 0.13.3. The current trick of setting a 16:10 game resolution and freescaling whole UI has always been a bit hacky (i.e. the old "gold" and "silver" settings). This relies on Unity itself scaling game window properly on desktop, which doesn't work as expected on Linux or in fullscreen exclusive. This setup is also rather fiddly and hard to understand, so even on Windows there's a chance something isn't setup properly on user's end.

New setup properly ratios 16:10 rendertexture into a 4:3 camera viewport fitted to your resolution with pillarbox bars either side. The old UI freescaling setting is gone and there's additional logic to help UI elements scale better when 4:3 is enabled. All you have to do is tick the 4:3 Aspect Ratio box shown in my tweet KoW linked above.

I acknowledge palettization and posterization present darker colours with new shaders. The solution here is ColorBoost, also in 0.13.3. This effect blends lit fragments back towards their native diffuse colours, which in turn helps palettization select correct colours from look-up table. You can control strength of effect individually in dungeons, exteriors, and interiors using sliders to dial in your preference alongside mods and other settings. ColorBoost also provides the dungeon falloff effect to effectively lower draw distance in dungeons. You can use all this in combination with any of the other built-in effects.

I'll update retro mode topic in sticky with suggested defaults for these settings once 0.13.3 is live.

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

Re: 0.13.2b Retro mode and render aspect ratio

Post by ifkopifko »

Hey, thanks for dropping the answers, both of you. :-) I have noticed the tweets and am looking forward to try it all out, rest assured. :-D

In the meantime I have prepared some screenshots to illustrate what I am talking about. Main thing for me is the “rendered world” aspect ratio, the camera setup or how to call it. See screenshots below, comparing DF Setup vs HD DFU vs Retro DFU.
Spoiler!
Dagger Dosbox without_UI.png
Dagger Dosbox without_UI.png (96.27 KiB) Viewed 18743 times
HD DFU 1280x960.jpg
HD DFU 1280x960.jpg (185.57 KiB) Viewed 18743 times
Retro DFU 1280x960.jpg
Retro DFU 1280x960.jpg (205.76 KiB) Viewed 18743 times

And as for the reduced color space in retro mode (or whatever magic is causing the different shades to blend together into a solid color), I think it works well for default DFU setup (ambient light set to 1, no voxel ambient occlusion). But when you try to use those features, the retro mode seems broken to me… almost as if some posterisation is happening without actually turn posterisation on. I do not know how to describe it better, so here are some screenshots again (too many to put them into attachment I think, link to gallery: https://imgur.com/a/n9nix0u ).
https://imgur.com/X2xRb7H HD DFU, default
https://imgur.com/WmtsIoK Retro DFU, default
https://imgur.com/2ysYfNN HD DFU, voxel AO on
https://imgur.com/KrwKdYe Retro DFU, voxel AO on
https://imgur.com/sDf9y21 HD DFU, ambient lighting 0.6
https://imgur.com/cjhqrbp Retro DFU, ambient lighting 0.6
https://imgur.com/ZDE2cO1 HD DFU, ambient lighting 0.6 + voxel AO on
https://imgur.com/ockkuTt Retro DFU, ambient lighting 0.6 + voxel AO on

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

Re: 0.13.2b Retro mode and render aspect ratio

Post by Interkarma »

Hmm, you really can't measure aspect ratio by drawing arbitrary boxes over projected geometry. Aspect ratio relates to output area (e.g. screen resolution). The "stuff" projected into that view is more to do with camera and field of view. You could keep the same aspect ratio and still have wildly different projections by changing FoV.

For effects, keep in mind that retro mode is genuinely rendering into a 320x200 or 640x400 target. That's not a lot of detail for AO to blend with, so it's just going to crunch a lot of the screen down to black. These effects are all optional, and just because they don't look good together doesn't mean they're broken. I love both short ribs and ice cream, but damned if I'm gonna eat short ribs slathered in ice cream. :)

TBF, a lot of Unity's builtin effects need a high pixel density to work properly and won't look so hot at retro resolutions. You might be able to dial in something you like, but a lot of visual effects just won't play nice in low res. One exception is ColorBoost, which is unique to DFU and intended primarily to be used with retro mode and palettization/posterization (although you can enable it anytime, not just with retro mode).

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

Re: 0.13.2b Retro mode and render aspect ratio

Post by ifkopifko »

I’m sorry for being so persistent…

Aspect ratio: Alright, I do not claim to be an expert in this, but I believe you can measure aspect ratio of projected objects as long as you measure near the center of the view (we are not dealing with vastly different FOVs in these examples so I don’t see a problem). Unless the camera is “broken” somehow, a square should have a square shape in that area.

The issue I have tried to point out does have to do with FOV. It seems to me that the FOV setting in DFU (probably engine thing) sets the vertical FOV according to the setting used, while the horizontal FOV is then calculated based on the render resolution used… on its aspect ratio. The thing is, that in retro mode you render to 320x200 or 640x400, which are 16:10 resolutions. Afterwards you stretch it onto a 4:3 screen and so the vertical and horizontal FOVs are not in proportion anymore… and so the square will not look like a square in the center of the view.

The first three screenshots show this. Retro DFU has the same vertical FOV as HD DFU, but it has wider horizontal FOV – hence you can see the torch on the right for example.

If it is a problem to set non-square pixels for FOV calculation in Unity, the easiest workaround would be to use 320x240 and 640x480 for retro rendering, if you really want to keep the 4:3 look. Personally, I like it as it is (widescreen looks a lot more immersive in my opinion). I would even like to have a 16:9 retro resolution available (710x400).


Colors and effects: I get the point on effects compatibility and resolution requirements. It’s true to some extent, but what does crush the picture is the color simplification the retro uses. Now, maybe this color simplification is exactly what you need to achieve the sharp pixelated retro look. If you’ll have time, perhaps if you would try setting your DFU as in my screenshots (dungeon ambient light = 0.6, voxel ambient occlusion = on – I use 0.9 AO effect intensity) and resolution 640x400. Try running up the dark corridor in PH from the screenshot place to the dungeon exit for example. And then try turning on the retro 640x400 and behold the color banding/blending in the corridor. If it’s just impossible to make these effects “compatible” with retro mode, I take it. But it’s still a pity, because the ambient occlusion adds so much depth to the dungeons in my opinion.

My question in the first post was, whether it would be possible to turn off this color simplification in retro mode, or even better perhaps, if it would be possible to make an option to set custom render resolution for the “world” and keep the screen native resolution for the UI and HUD. If it’s something non-trivial, then do not bother, it was meant as an innocent question only.


Over and out, I’ll return to my silent lurking here. :-) Sorry for making such a fuss about this. I look forward to 0.13.3 🙂

EDIT: Why do I keep calling the AO type "voxel"? I have no idea where I picked that up... it should be Multiscale Volumetric of course.

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

Re: 0.13.2b Retro mode and render aspect ratio

Post by Interkarma »

ifkopifko wrote: Fri Nov 19, 2021 7:33 am The thing is, that in retro mode you render to 320x200 or 640x400, which are 16:10 resolutions. Afterwards you stretch it onto a 4:3 screen
Yeah, this is what should be happening. :) Classic Daggerfall rendered to a 320x200 output signal (Mode13h). A common 4:3 monitor of the time stretched this into an area 320x240 - or 20% higher in the vertical dimension. Going from 16:10 to 4:3 is the desired outcome and how a 4:3 monitor in 1996 scaled game. The below article has a good summary of this, please check it out. Many old games drew everything a bit fatter intentionally to account for this, though I don't think DF's art direction was quite so consistent.

https://www.gamedeveloper.com/business/ ... pect-ratio

A great 4:3 upscale for retro screenshots from Mode13h games is 1600x1200. This resolution is a clean upscale of 5x width and 6x height (the 5x6 "mega-pixel" in above article). If you upscale classic DF screenshots to 1600x1200 (or if DOSBox is setup properly), you'll see the same vertical stretch in classic as well. DFU also uses this 5x6 rule to try and fit output best it can into whatever display user has. From 0.13.3, the guesswork has been taken out of this and you don't need to fiddle with different resolutions to hack the effect. The UI is a good place to compare these as it's not a projected object and FoV variance won't apply. See comparisons below:


Classic 4:3 (320x200 > 1600x1200)
classic_43.png
classic_43.png (140.2 KiB) Viewed 18612 times
DFU 4:3 (320x200 > 1600x1200) - 0.13.3
dfu_43.png
dfu_43.png (594.44 KiB) Viewed 18612 times

BTW, I've noted your earlier point about portrait in large HUD and will take a look at this.

So the aspect ratio and 4:3 resolution scaling really is same proportions as classic here. When in comes to 3D environment, this is entirely down to FoV. If you want to change horizontal FoV, there's a mod for this. I should make it an option in base game at some point. At time DFU started, Unity only supported vertical FoV on cameras.


ifkopifko wrote: Fri Nov 19, 2021 7:33 am what does crush the picture is the color simplification the retro uses.
There is no such effect unless you've also enabled posterization or palettization. The only thing retro mode does is render game to a 320x200 or 640x400 target instead of your display resolution. The other effects are optional. If you can't tune these in a way you like (and you'll have more options to help with this in 0.13.3) then best disable the effects. Hopefully from 0.13.3 you'll be able to find ways to tune the retro game more to your liking.

For my part, I don't see much benefit in continuing to contribute on this topic. We're not exactly seeing eye-to-eye, and I don't think our goals are aligned in the same directions. I'm sorry it doesn't look like we were able to find some common ground here. All the best ifkopifko. :)

Edit: As a compromise that hopefully you'll like, I've added an option to support both 4:3 and 16:10 aspect correction in 0.13.3. An example of 4:3 is 1600x1200 with 20% vertical stretch (the 5x6 method discussed above). An example of 16:10 is 1920x1200, which is a straight 6x6 upscale from classic's 320x200. Whichever you choose, DFU will fit into your actual display resolution. Some example screenshots can be seen in this tweet. Hopefully this change helps us find some common ground on aspect ratio. :)

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

Re: 0.13.2b Retro mode and render aspect ratio

Post by ifkopifko »

Thanks for you answer, I am sorry if I bother you too much, my intentions are only the best...
Interkarma wrote: Sat Nov 20, 2021 4:05 amThere is no such effect unless you've also enabled posterization or palettization. The only thing retro mode does is render game to a 320x200 or 640x400 target instead of your display resolution.
Unfortunately, that is not what I see on my side since 0.13. I have tested it some more, also with clean install and default settings. Paletisation and posterisation are OFF. I have found out that it has to do with the lighting system. I have compared also with standard HDDFU in 640x400 to rule out that low resolution is responsible. This color degradation is nearly not visible during daylight in the open, and it is not visible in houses and taverns as those are well lit. It is very visible in dungeons and outdoors when it gets dark. I’ll attach some screenshots again. In this first set of four pictures, please take a look at the grey brick on the wall on the left. Notice how the texture information gets lost as a large part of that brick turns a solid grey color (measured on screenshots, so it’s not a LCD monitor thing). It is also visible on the floor... (preferably look at the picture in its native resolution)

More examples in animated GIFs. Look at the floor inside a dungeon, and look at the horse and the grass below its feet… I mean hooves. :-) I expected that this is not intentional behavior... or is it something purely on my end?
PH Bricks.jpg
PH Bricks.jpg (264.81 KiB) Viewed 18558 times
Floor-GIF.gif
Floor-GIF.gif (541.32 KiB) Viewed 18558 times
Horse-GIF.gif
Horse-GIF.gif (634.62 KiB) Viewed 18558 times
With regard to aspect ratio (yeaaaah, I know)... it is frustrating, but it seems I cannot get my point across to you. :-D Thanks for the announced improvements, I’ll check it out when the new version comes available. As I have stated before, I am alright with it as is in 0.13.2b, I simply use 16:10 resolution with retro mode and everything is set according to my preference.

My original intention was only to point out a possible bug in the retro mode. You say it’s not a bug, but a feature. Alright, I take it, but just to explain myself… The article you linked deals with 2D art, not with rendering of 3D scene. My conclusion was based on two facts. 1. Standard HD DFU rendering of the game world (the 3D space) has a different “aspect ratio” then the retro DFU. 2. The standard HD DFU has its “aspect ratio” much closer to the original Daggerfall than the Retro DFU does. Everything is just taller and slimmer in the 4:3 retro mode. My assumption (I have no way how to prove it) is that original DF engine renders in non-square pixel system… probably for performance reasons. Back in the day it was a common thing in the software rendered 3D games. In DF we do not have the possibility to rotate the camera along the view axis (to do a spin, like in a jetfighter), then everything would deform and I would surely get nausea from something like that. :-D That is because with your retro 4:3 setup you sort of have an aspherical lens on the camera. You render in 90 horiznotal FOV and 65 vertical FOV (16:10), and then you stretch it vertically on a 4:3 screenspace, which should normally have 80 horizontal FOV and 65 vertical FOV. If that is on purpose, I’m not going to say anything against it, it’s just… very unusual.

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

Re: 0.13.2b Retro mode and render aspect ratio

Post by Interkarma »

OK, I now understand your colour issue with posterization/palettization off. This isn't an effect DFU is applying directly - rather it's the result of Linear > sRGB conversion and precision loss down in guts of engine.

What I can do is set retro mode to prefer a higher precision render target. Unity will fallback to a compatible (lower precision) render target if GPU doesn't support higher precision. I've tried this out on my end and confirmed it resolves visible precision loss during Linear > sRGB conversion. It also helps a lot with blending other postprocessing effects in retro mode, so win-win. Provided your GPU supports a higher precision texture formats, you'll see an improvement here in 0.13.3.

I'm not willing to discuss aspect ratio any further at this time. I feel like we're talking past each other here and not making any progress. Perhaps we can revisit this at another time after 0.13.3 has released. At least then we'll be comparing the same in-game aspect correction, rather than the purely hacky setup available in older versions.

All the best. :)

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

Re: 0.13.2b Retro mode and render aspect ratio

Post by ifkopifko »

Yay, thanks for looking into this issue, I can't wait to try out the next update. :-)

Post Reply