Page 1 of 1

0.13.5 - Portrait scaling issue on large HUD

Posted: Thu May 26, 2022 4:30 pm
by Ninelan
There appears to be a mistake in handling the portrait in the large GUI as of 0.13.3!
1.png
1.png (294.81 KiB) Viewed 5004 times
The portrait is squished onto a square format, it is most apparent with taller faces.

This is how they used to appear in a previous version, and they used to vary from each other a lot in size depending on how much whitespace or how compact the sprite was.
2.png
2.png (119.95 KiB) Viewed 5004 times


As far as I know in classic Daggerfall, the portrait sprites are true to their size in context to the GUI.
As we see, the pixels in the portrait and the GUI are proportionate to each other, and of the same scale. The face does not appear bigger or smaller depending on what head you are using.
3.png
3.png (71.33 KiB) Viewed 5004 times

0.13.5 - Portrait scaling issue on large HUD

Posted: Thu May 26, 2022 10:06 pm
by Interkarma
Thanks, I'll take another pass at this one. The way I used to handle this (in your second screenshot) is the most technically correct and flexible, but people complained about the smaller size on larger portraits.

It's not possible to do this exactly like classic here. The large docked HUD in DFU has to work across whatever resolution and aspect ratio the player throws at it, whereas classic only has 320x200 to worry about. I'm sure I can do better though.

Re: 0.13.5 - Portrait scaling issue on large HUD

Posted: Fri May 27, 2022 4:58 pm
by Ninelan
Oh yeah, an exact match would be something for pedants, even the old method was good enough on the smaller heard sprites to not really be significantly distracting.

As long as the face area on all the sprites takes up the same rough area, and is big enough in comparison to the box it sits in, it'll be just perfect.
It also doesn't hurt if things like hair go slightly out of the box. I know in DFU there's this buffer zone that's especially noticeable in the squished faces between the face and the portrait box edge, which is probably contributing to the smallness that got exaggerated on the bigger sprites.

Re: 0.13.5 - Portrait scaling issue on large HUD

Posted: Wed Sep 21, 2022 12:13 am
by pango
I think the ScaleToFit mode was actually correct, to preserve aspect ratio; The reason why heads look smaller than classic is because headPanelRect size is conservative, leaving like 2 pixels of padding in all directions vs the HUD frame.
If headPanelRect is increased to the maximum allowed by the HUD (Rect headPanelRect = new Rect(5, 4, 37, 37) or so), all heads are scaled as large as possible, with no distorsion.

Large heads are then displayed correctly, but the smallest heads are displayed larger than in classic! If this is an issue, I think all face textures could be padded with transparent pixels up to the largest width and largest height of all faces before scaling. Maybe the same effect could be achieved without padding using an extra in-between Component of largest-face-width x largest-face-height size?

WIP: https://github.com/Interkarma/daggerfal ... ce-scaling

P.S.: Just noticed that some faces gfx are very tall, or already contain transparent padding... And do not always totally fit inside the HUD frame in classic
The quest is not over!