UIDetect

  • brussell
  • Topic Author
More
6 years 1 month ago - 3 years 10 months ago #1 by brussell UIDetect was created by brussell
UIDetect can be used to automatically toggle shaders depending on the visibility of UI elements.
It's useful for games, where one wants to use effects like DOF, CA or AO, which however shouldn't
be active when certain UI elements are displayed (e.g. inventory, map, dialoque boxes, options
menu etc.). Multiple UIs can be defined, while each is characterized by a number of user-defined
pixels and their corresponding color values (RGB).
-> see full description here: github.com/brussell1/Shaders/blob/master/Shaders/UIDetect.fxh

Example video (DOF, CA and Moviebars get toggled when UI becomes visible)
Example video with RGB mask (DOF (exaggerated) is disabled on HUD, inventory and options menu)

For the latest updates visit my repository github.com/brussell1/Shaders

Changelog
Warning: Spoiler!
Last edit: 3 years 10 months ago by brussell.
The following user(s) said Thank You: crosire, Wicked Sick, conan2k, Qsimil

Please Log in or Create an account to join the conversation.

  • crosire
More
6 years 1 month ago #2 by crosire Replied by crosire on topic brussells humble shaders: UIDetect
You definitly want "UIPixelCoord" and "UIPixelRGB" to be "static const float3", or else they will be interpreted as uniforms instead of constants, which is considerably slower.
The following user(s) said Thank You: Pondural, brussell, Qsimil, Fu-Bama

Please Log in or Create an account to join the conversation.

  • brussell
  • Topic Author
More
6 years 1 month ago #3 by brussell Replied by brussell on topic brussells humble shaders: UIDetect
I've added an example video to my initial post, in case anybody thinks tl;dr

Please Log in or Create an account to join the conversation.

  • Illuzio
More
6 years 1 month ago - 6 years 1 month ago #4 by Illuzio Replied by Illuzio on topic UIDetect
Your shader is great, thank you for your work!

I had an idea that might interest you!
All PC video game interfaces that are played on the keyboard/mouse have a common point when displayed on the screen (and which is identical for all resolutions) "A cursor appears".

Here's my idea: your shader should be able to detect the presence of the cursor on the screen, it compares the pixels of the cursor (relative to an image of it in the folder "textures") and it makes this comparison on the position of the cursor in the screen.
(The shader must be able to detect several different cursors because there are games that use more than one cursor).

With this system, you can even create a shader to display a custom cursor when the interface appears!

There is already a shader that can replace the cursor (but it's still visible.), it can maybe help you, you can find it here .

(Excuse my bad English, I'm french.)
Last edit: 6 years 1 month ago by Illuzio.

Please Log in or Create an account to join the conversation.

  • hunt1hunt
More
5 years 11 months ago - 5 years 11 months ago #5 by hunt1hunt Replied by hunt1hunt on topic UIDetect
@brussell:
thank you very for your shader! Want to know Can use the mouse to get the coordinates of the ui element and the corresponding RGB value sequence instead of the eyedropper when the effect sequence is not started? tanks!
Last edit: 5 years 11 months ago by hunt1hunt.

Please Log in or Create an account to join the conversation.

  • brussell
  • Topic Author
More
5 years 11 months ago #6 by brussell Replied by brussell on topic UIDetect
@Illuzio
I've tried to use the mouse pointer for ui detection recently, but it's not really reliable. Every game behaves differently.

@hunt1hunt
Currently not, but I'll look into it!

Please Log in or Create an account to join the conversation.

  • JizargoLikesKitten
More
5 years 9 months ago #7 by JizargoLikesKitten Replied by JizargoLikesKitten on topic UIDetect
I tried everything for past 3 hours tonight to get this shader working and have been completely unable to hide any UI in ESO from DoF.

Please Log in or Create an account to join the conversation.

  • JizargoLikesKitten
More
5 years 9 months ago #8 by JizargoLikesKitten Replied by JizargoLikesKitten on topic UIDetect
After messing around with this some more, I think the problem is because the UI is semi-transparent.

Any work around for this?

Please Log in or Create an account to join the conversation.

  • brussell
  • Topic Author
More
5 years 9 months ago #9 by brussell Replied by brussell on topic UIDetect
No. But you could try it with an UI mod like this one: www.esoui.com/downloads/info1678-CleanerHUD.html

Please Log in or Create an account to join the conversation.

  • rogueyoshi
More
5 years 6 months ago - 5 years 6 months ago #10 by rogueyoshi Replied by rogueyoshi on topic UIDetect
Hello. HiAlgo Boost is able to automatically detect UI elements during it's Dynamic Resolution Scale without needing a pre-determined mask. It is even toggle-able. Perhaps it is possible to do this in ReShade using the same method?

www.hialgo.com/TechnologyBOOST.html
Last edit: 5 years 6 months ago by rogueyoshi.

Please Log in or Create an account to join the conversation.

  • ZabaZu
More
4 years 1 month ago #11 by ZabaZu Replied by ZabaZu on topic UIDetect
Have you considered setting up a database of sorts for user submitted per-game UI profiles? It could be an incredibly useful contribution to the community. Not implying anything fancy necessarily, something along the lines of a google spreadsheet just so a user can find their game and copy paste the settings.

Please Log in or Create an account to join the conversation.

  • brussell
  • Topic Author
More
4 years 1 month ago #12 by brussell Replied by brussell on topic UIDetect
@ZabaZu

Unfortunately the color values of the pixels are different depending on resolution, anti-aliasing and other settings (probably even on gpu vendor).
So even if there were a database of game profiles, everyone of them would only be valid for a very specific game/hardware configuration.
While I basically like the idea, in it's current state it would not be very useful or user-friendly.

Please Log in or Create an account to join the conversation.

  • crosire
More
4 years 1 month ago - 4 years 1 month ago #13 by crosire Replied by crosire on topic UIDetect
@brussell While I have you, would you mind rearranging your github.com/brussell1/Shaders repository slightly, so that all fx files are in a single directory? The upcoming ReShade setup tool will allow the user to select your repository directly to download (unless you don't want that), but it is only capabable of extracting shaders from a single directory. It doesn't really matter how that directory is named, just that all fx files are in it and not spread into multiple directories (like how in github.com/crosire/reshade-shaders all shaders are in a "Shaders" directory).
Last edit: 4 years 1 month ago by crosire.
The following user(s) said Thank You: brussell

Please Log in or Create an account to join the conversation.

  • brussell
  • Topic Author
More
4 years 1 month ago - 4 years 1 month ago #14 by brussell Replied by brussell on topic UIDetect
@crosire
Already done!
Last edit: 4 years 1 month ago by brussell.

Please Log in or Create an account to join the conversation.

  • brussell
  • Topic Author
More
3 years 10 months ago - 3 years 10 months ago #15 by brussell Replied by brussell on topic UIDetect
Updated to v. 2.0.

Changelog:
-added RGB mask support via external texture
-> Example video (here shaders are disabled on HUD, Inventory and Options menu): i.imgur.com/cvfOq54.mp4
-added ShowPixel technique

A full description and configuration info can be found in UIDetect.fxh
Last edit: 3 years 10 months ago by brussell.
The following user(s) said Thank You: Faustus86

Please Log in or Create an account to join the conversation.

  • Martigen
More
3 years 10 months ago #16 by Martigen Replied by Martigen on topic UIDetect
This is fantastic, thank you!

I don't suppose you (or someone else) could make a step-by-step tutorial for the mask method? Even reading the instructions in UIDetect.fxh with Gimp was a little over my head (I've used Gimp before, but nothing related to layers etc).

Please Log in or Create an account to join the conversation.

  • MinerOfWorlds
More
3 years 10 months ago - 3 years 10 months ago #17 by MinerOfWorlds Replied by MinerOfWorlds on topic UIDetect
Awesome! Working flawlessly with System shock 2 so far.

By the way, how did you get this working with deus ex? The huds transparent for me or is it one of the later games?
Last edit: 3 years 10 months ago by MinerOfWorlds. Reason: Added a question.

Please Log in or Create an account to join the conversation.

  • brussell
  • Topic Author
More
3 years 10 months ago #18 by brussell Replied by brussell on topic UIDetect
@Martigen
I thought the instructions are pretty straightforward. Maybe you can write where you're stuck?

@MinerOfWorlds
You can disable the transparency in the game options.

Please Log in or Create an account to join the conversation.

  • Radstark
More
3 years 10 months ago - 3 years 10 months ago #19 by Radstark Replied by Radstark on topic UIDetect
Some games have a UI with very subtle transparency. Would it be possible to make the effect check if the pixels are in a range of colours, rather than of that exact colour?
For example, if a certain pixel has an RGB value of (30,55,190) in my screenshot, but I know it varies slightly, I could set an offset value - say, 5 - so that the effect, rather than checking that exact RGB value, would instead check if the pixel's red value is between 25 and 35, green between 50 and 60, and blue between 185 and 195.
Would it be worth a try? I don't think it would affect performance much if at all.

On a side note: I had difficulty figuring out what colour of the mask should correspond to mask 1, 2, or 3. I guess it's red for mask 1, green for mask 2 and blue for mask 3 but I'm not sure since I couldn't get it to work with DCUO anyway for the above reason. I think it would be ok to add this information in the instructions just to be sure.
Last edit: 3 years 10 months ago by Radstark.

Please Log in or Create an account to join the conversation.

  • Sauron462
More
3 years 9 months ago #20 by Sauron462 Replied by Sauron462 on topic UIDetect
When trying to use this with ReShade 4.7, it gives me an error that these shaders failed to compile, and shows they have a few errors preventing them from doing so. Am I doing something wrong?

Please Log in or Create an account to join the conversation.

We use cookies
We use cookies on our website. Some of them are essential for the operation of the forum. You can decide for yourself whether you want to allow cookies or not. Please note that if you reject them, you may not be able to use all the functionalities of the site.