UIDetect
- brussell
- Topic Author
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
06.06.2020
-updated to v.2.0
-added RGB mask support via external texture
-added ShowPixel technique
-description now in UIDetect.fxh with more info
Please Log in or Create an account to join the conversation.
- crosire
Please Log in or Create an account to join the conversation.
- brussell
- Topic Author
Please Log in or Create an account to join the conversation.
- Illuzio
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.)
Please Log in or Create an account to join the conversation.
- hunt1hunt
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!
Please Log in or Create an account to join the conversation.
- brussell
- Topic Author
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
Please Log in or Create an account to join the conversation.
- JizargoLikesKitten
Any work around for this?
Please Log in or Create an account to join the conversation.
- brussell
- Topic Author
Please Log in or Create an account to join the conversation.
- rogueyoshi
www.hialgo.com/TechnologyBOOST.html
Please Log in or Create an account to join the conversation.
- ZabaZu
Please Log in or Create an account to join the conversation.
- brussell
- Topic Author
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
Please Log in or Create an account to join the conversation.
- brussell
- Topic Author
Already done!
Please Log in or Create an account to join the conversation.
- brussell
- Topic Author
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
Please Log in or Create an account to join the conversation.
- Martigen
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
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?
Please Log in or Create an account to join the conversation.
- brussell
- Topic Author
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
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.
Please Log in or Create an account to join the conversation.
- Sauron462
Please Log in or Create an account to join the conversation.