a subtle hack UI Mask
- UTwelve
- Topic Author
Working in FF14. so,maybe other games will work too...
so subtle,you need to try,I can't guarantee anything.
There are three in the list,is order
- HackUIMask ←top
- ** other fx **
- HackUICut ←is a UI black mask,avoid UI impact on next FX
- **other fx **
- HackUIRestore ←end
HackUImask.fx
Please Log in or Create an account to join the conversation.
- UTwelve
- Topic Author
Please Log in or Create an account to join the conversation.
- aaronth07
Please Log in or Create an account to join the conversation.
- Daodan
aaronth07 wrote: Probably a stupid question
Not at all. In some games the UI is visible in the alpha component of the backbuffer. With that it is possible to create a UI mask at runtime (i.e. a mask that automatically adapts to the UI). As far as i know UIMask.fx masks the UI based on an image you provide and UIDetect.fx can bypass other effects (DOF for example) based on the color of certain pixels.
Please Log in or Create an account to join the conversation.
- Scorpio82CO
Please Log in or Create an account to join the conversation.
- dddfault
- peronmls
Please Log in or Create an account to join the conversation.
- Marty McFly
peronmls wrote: honestly Would there ever be such a fix? It's the only thing really bad with reshade. I never understood why the dev's never try to fix it but can release more advanced shaders like raytracing that will just obscure any HUD on screen. That's the only immersion breaking reshade does for me.
Doubtable that it'll ever happen. Each game renders their UI in a different way, different elements and so on. It would defeat the purpose of ReShade to manage things on a game to game level. It also can't be done perfectly with a shader either as UI elements are so diverse, detecting them with any sort of failsafe heuristic is impossible. Also it's not possible to restore data obscured by the UI, so effects that would require such data cannot be fixed, even if the UI was detected perfectly.
Please Log in or Create an account to join the conversation.
- Martigen
But isn't this exactly what the shader posted in the OP is doing? It's not even using a texture as an overlay, so it seems to be doing it on the fly. I haven't tried the shader yet but it's intriguing.Marty McFly wrote:
peronmls wrote: honestly Would there ever be such a fix? It's the only thing really bad with reshade. I never understood why the dev's never try to fix it but can release more advanced shaders like raytracing that will just obscure any HUD on screen. That's the only immersion breaking reshade does for me.
Doubtable that it'll ever happen. Each game renders their UI in a different way, different elements and so on. It would defeat the purpose of ReShade to manage things on a game to game level. It also can't be done perfectly with a shader either as UI elements are so diverse, detecting them with any sort of failsafe heuristic is impossible. Also it's not possible to restore data obscured by the UI, so effects that would require such data cannot be fixed, even if the UI was detected perfectly.
Please Log in or Create an account to join the conversation.
- Marty McFly
Also, transparent effects, what the person above asked for, is completely impossible. Just because our eyes can discern what's a transparent object does not mean that a shader can.
Please Log in or Create an account to join the conversation.
- Martigen
Cool, thanks for explaining MartyMarty McFly wrote: It uses the alpha channel of the backbuffer before any rendering happened. By chance, FF14 draws the UI mask into alpha channel, so you have info where UI is and where not. No other game I know of does this, and thus you'd have to infer from the screen colors, a failsafe method is impossible that way. Plus you cannot restore data behind the UI, that's why this shader masks it with black to mask it from future effects that might smear it beyond the UI mask borders.
Also, transparent effects, what the person above asked for, is completely impossible. Just because our eyes can discern what's a transparent object does not mean that a shader can.
Please Log in or Create an account to join the conversation.
- Niko of Death
Please Log in or Create an account to join the conversation.
- crosire
float4 UIMask = tex2D(ReShade::BackBuffer, texcoord).a;
float4 UIMask = tex2D(ReShade::DepthBuffer, texcoord).x == 0.0;
Please Log in or Create an account to join the conversation.
- Niko of Death
i.imgur.com/hcwTlLq.png
Please Log in or Create an account to join the conversation.
- Radstark
Please Log in or Create an account to join the conversation.
- nu_bie
edit: found out how, just gotta switch destblend around. works for the UI but not for character dialogue bust, hmm.
Please Log in or Create an account to join the conversation.
- UTwelve
- Topic Author
I realize that I didn't provide a clear introduction in my previous post due to my limited English proficiency. Unfortunately, the topic can no longer be edited. Thankfully, I can now rely on ChatGPT to assist me in translation. Therefore, I would like to provide a revised explanation here.
I noticed that some games have a peculiar feature where the UI is visible in the alpha channel of the back buffer, such as in FF14. Therefore, I decided to create my own subtle UI culling shader.
It's called "subtle" because it's not universally applicable to every game. You need to check if the game's UI is in the buffer.
The shader works by extracting the UI from the buffer, filling the original scene with black for further visual processing, and finally placing the UI back into the scene.By using this shader, you'll find that it consists of three parts: "HackUIMask," "HackUICut," and "HackUIRestore."
As the name implies, below is a demonstration of how to use them.
In the list, you need to arrange them like this:
- HackUIMask ←Placed at the top of the list, it will extract the UI.
- ** your other fx ** ←Here, some shaders can be placed, which are affected by the UI before being filled with black. I'm not sure what purpose this serves, but I kept this space for it.
- HackUICut ←It will fill the original position of the UI with black, which can prevent subsequent shaders from being affected by the UI.
- **your other fx ** ←This is the normal place to put shaders, and the UI here has been masked with black.
- HackUIRestore ←At the end of the list, put the UI back on the screen.
ps. Just in case someone is not aware, the order of the list determines the order of the shaders, from top to bottom.
Please Log in or Create an account to join the conversation.