WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Tutorials & Other Helpful Info. (https://www.wowinterface.com/forums/forumdisplay.php?f=12)
-   -   Pixel Perfection for Specific Resolution (https://www.wowinterface.com/forums/showthread.php?t=31813)

Carighan 10-09-10 05:44 PM

Game's height was 819,2 for me. :O

Anyways, worked amazingly awesome. Big thanks.

Gnarfoz 10-13-10 05:31 PM

4.0.1 makes this unnecessary, it seems?

Turning UIScale off seems to give the desired effect now.

(GetScreenHeight returns 1050 for me, which is my actual Y-resolution.)

Barjack 10-13-10 09:49 PM

Quote:

Originally Posted by Gnarfoz (Post 209543)
4.0.1 makes this unnecessary, it seems?

Turning UIScale off seems to give the desired effect now.

(GetScreenHeight returns 1050 for me, which is my actual Y-resolution.)

The general technique is still useful if you want to be able to scale frames without scaling certain elements (e.g. 1-pixel border on a scalable map). Or for people who use uiscale but want a certain element to render at pixel scale. That said I'm still not entirely sure what needs to be changed in order for that to work in 4.0.1.

kbc8090 10-17-10 11:34 PM

Has anyone considered the prospect that in 4.0.1 any element needing a pixel perfect border needs to be placed on the screen with whole numbers for x and y values? I'm not very proficient in LUA or how the interface works, but I can find my way around, but I assume for anything dragable the values are typically never whole numbers, as evidence from looking at various SavedVariable files over the years.

Edit 1: Also height/width need to be whole numbers as well.

Edit 2: Also it looks like the height/width values need to be divisible by 2, but x/y values do not.

Back in 3.3.5 I used 0.7 for my uiScale, I ended up getting my Stuf frames to be pixel perfect simply by adjusting the x and y values of the frame... just placing them at a certain location on the screen. If I moved them 1 px, usually one edge would become blurry.

Well I'm trying to adjust my LitePanels on beta at the moment, going for a 0.64 uiScale on 1920x1200, and I noticed whenever I put the x value to a number with a decimal the borders become fuzzy.

x = 370, y = 0 the panels are pixel perfect
x = 370.5, y = 0 the panels are fuzzy.

Maybe this is old news, maybe not, just thought I'd post. It could be that the old UI automatically rounded up or down when elements were dragged on the screen?

Gnarfoz 10-18-10 02:15 PM

In 4.0, with UIScale turned off, you can simply use whole numbers and it will be pixel perfect, see my post above.

For UIScale turned on, the actual values will probably vary, and you're forced to exactly one particular UIScale value, cf. first post of this thread.

For UIScale turned on and some other value, well, good luck. You'll have to play with the settings of most of your addons and hope they support fractional sizes (i.e. width=200.4, height=50.5, etc.).

Haleth 10-18-10 02:35 PM

The pixel perfect script and turning UI scale off deliver the same results, with the exception that if you turn UI scale off, the game still looks fine in windowed mode.

There's still a slight difference, though. There is one pixel line in my UI, and a lot of font shadows, that look off compared to pre 4.0.1.

Vlad 10-18-10 02:52 PM

Weird, tried to run various "perfect uiscale" macros but none made the anti-aliasing addon written some posts ago, show poor rendered lines where the black and white borders smear together.

I guess we can't get it perfect when running window mode maximized, the resolution is something like 1920.00019234 and the height is 1060.111052 or similar, point is I got a 1920x1080 screen and apparently the decimals somehow mess it up when it's not exactly 16:9 scaled.

Anyone got a suggestion?

Gnarfoz 10-18-10 07:04 PM

If it doesn't show smeared lines, it's perfect - what more do you want?

Also, WoW can't represent integers, it only does floats internally, so all numbers will look like that.

Vlad 10-22-10 10:04 AM

Quote:

Originally Posted by Gnarfoz (Post 212261)
If it doesn't show smeared lines, it's perfect - what more do you want?

Typo, I meant that the anti-aliasing addon showed lines in the square that were smeared. In fact none looked proper, no mater what macro I used. It also is like this even when disabling the uiscale and letting the game handle it by itself. I guess that resolution simply can't have a perfect uiscale as it's not perfectly scaled to 16:9 or other acceptable ratios sized.

Toran 12-08-10 11:39 PM

I'm a bit puzzled why it's preferable to use no uiscale. Wouldn't all of the screen elements be huge? I know I would have to go into each addon and resize/rescale them - seems like in the end you would be in the same place as just using uiscale via the calculations from earlier in the thread.

Not doubting anything anyone is saying, just trying to understand which is the right way to go. :)

Petrah 12-09-10 02:07 PM

Quote:

Originally Posted by Toran (Post 222127)
I'm a bit puzzled why it's preferable to use no uiscale. Wouldn't all of the screen elements be huge? I know I would have to go into each addon and resize/rescale them - seems like in the end you would be in the same place as just using uiscale via the calculations from earlier in the thread.

Not doubting anything anyone is saying, just trying to understand which is the right way to go. :)

Without the ui scale, UI elements in game will be proportionate to your monitors screen resolution. A lot of UI's were already turning off the ui scale feature in game (Tukui and nUI just to name a few) long before Blizz made their recent change.

Seerah 12-09-10 05:13 PM

I used to turn my UI Scale down. With the recent change, I have to turn it up. ;)

Alternator 01-20-11 04:09 AM

Just some notes I've found that may be useful

My interest in this topic was to provide pixel perfection without altering how the users ui works (so the user can set "Use UI Scale", "Windowed" mode etc as they wish).


I've found the following:

Use UI Scale: Off

Then UIParent will always match the pixel size of your window client area... I say client area, because this also holds true when you go windowed mode and resize the window.. In this mode things are easy as you are always working in the desired size.


Use UI Scale: On

Not so easy.
While it is possible to get the resolution and then do conversions along the following lines (psuedo code)
Code:

xPixel, yPixel = the pixels you're interested in;
xRes, yRes = string.match(({GetScreenResolutions()})[GetCurrentResolution()], "(%d+)x(%d+)");
uiscale = UIParent:GetScale();
Width_Or_XCoord = xPixel * (768.0 / xRes) * GetMonitorAspectRatio() / uiscale;
Height_Or_YCoord = yPixel * (768.0 / yRes) / uiscale;

It won't work for windowed mode unfortunately, as none of those numbers will adjust when the size of the window changes nor am I aware of any attribute that provide the the new scale/dimensions of the window.


This can be a bit tricky, because it does mean if the user does go windowed and UI Scale is on, that you may start to have details drop out (although I chose not to use the technique so far, I would have had single pixel lines that sometimes don't show up)

sp00n 03-11-11 02:14 PM

I can't get this to work correctly.
I'm using a windowed setup on a 1920x1080 resolution. My available screen size for WoW, due to the task and header bar, is 1018 pixels in height.

According to the formulae I should be using a UIScale of 768/1018 = 0.75442.
However that doesn't work, I do not get clean borders, they're still blurred. Using 768/1080 = 0.71111... doesn't work either, nor does disabling UI scale altogether.

Switching to fullscreen mode makes 768/1080 work, I get clean and sharp edges, at least for kgpanels (but not for Shadowed Unitframes?).
However I do want to keep the game in windowed mode.
Does anybody have any ideas?

Aprikot 03-11-11 02:56 PM

Quote:

Originally Posted by sp00n (Post 231497)
I can't get this to work correctly.
I'm using a windowed setup on a 1920x1080 resolution. My available screen size for WoW, due to the task and header bar, is 1018 pixels in height.

According to the formulae I should be using a UIScale of 768/1018 = 0.75442.
However that doesn't work, I do not get clean borders, they're still blurred. Using 768/1080 = 0.71111... doesn't work either, nor does disabling UI scale altogether.

Switching to fullscreen mode makes 768/1080 work, I get clean and sharp edges, at least for kgpanels (but not for Shadowed Unitframes?).
However I do want to keep the game in windowed mode.
Does anybody have any ideas?

I believe you need a resolution less than your maximum for pixel perfection in windowed mode. The game is still running at 1080 vertical even though your viewable is being reduced. Custom values in config.wtf work for this e.g. SET gxResolution "1920x1018" before you load the game.


All times are GMT -6. The time now is 02:25 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI