New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Scalable UI textures #2302
Scalable UI textures #2302
Conversation
Does this have any performance impact? |
In theory, it should be negligable since we usually scale things only once during game start. |
Basically, should be finished now, but there are some minor issues left:
|
And a separate question - what to do with scrollbars? Currently they use completely unrelated textures (e.g. bookmark one). As a result, they look alien even in clean game, and with UI replacers situation is even worse. So I suggest to provide custom textures for scrollbars arrows and track button. In this case:
|
OK, I managed to solve the issue with cursor scaling, but this part still will need a review from AnyOldName3. |
I'm not seeing anything immediately obviously stupid, but I don't really know anything about how MyGUI works and very little with SDL. What I'm getting from looking at this is that MyGUI is being told how many pixels to make UI elements and how many pixels of each texture to put into those UI elements and we're now telling it to not assume the latter is a fixed amount. I'd have thought that there'd also be a way to specify which parts of a texture to use using floating point coordinates in the range 0 to 1 (seeing as that's how textures are actually sampled), and then we wouldn't have to deal with lots of what this is doing, as something that uses the top left quarter of a texture is going to use the top left quarter of the texture no matter how big it is. |
A sort of it - we autocalculate skin size based on actual target texture resolution instead of taking it from layout files. As a result, if a widget which uses it has a different size, it will rescale texture to fit its size.
I tried to find something useful, but did not find anything. Without the |
Well, just for reference - I managed to add the Resources folder to the VFS and feed it to MyGUI, so we can provide overridable textures for scrollbars, but I suppose it is for another PR. |
All right, it is a time for a proper testing and review. |
Did some testing. When I have Arch Linux with kernel version
Probably it's just my specific setup problem. But usually I play with |
Can't reproduce. |
@elsid you using a hybrid graphics setup that makes use of nvidia:prime implementation? |
yes |
Too bad. Are there alternative ways to rescale crosshair textures properly? |
@elsid, can you check if the hardware decompression works with this function?
|
Still have freeze, but it happens only when I open inventory.
second launch:
|
All right, it seems I will have to drop the cursor scaling at all. Can you check again if the UI (including inventory) works fine with commented |
UI with commented |
Ok, I dropped the cursor scaling. |
Currently most of our UI textures can have only fixed size because of MyGUI design.
As a result, such textures look bad if player uses UI scaling. Also Morrowind often does not use textures directly - it uses textured meshes instead. For example, it makes impossible to use HD crosshair replacers, which work in Morrowind.
The main idea here is to implement an autosized texture skin widget, which will use the whole texture indifferently from texture resolution.
What I managed to achive so far:
Scalable cursors.Removed since may cause driver crashes on some setups.Unfortunately, I do not know how to handle compound widgets, which do not use the whole texture (e.g. door markers, scrollbars).