Welcome, Guest.
Username: Password: Remember me

TOPIC: RBM Color Mask

RBM Color Mask 11 months 4 weeks ago #1

  • Elimina
  • Elimina's Avatar
  • Offline
  • ΞLIMINΛ
  • Posts: 329
  • Thank you received: 358
So I was thinking of ways to improve Reflective Bump Mapping so that it does not effect every color, and I thought of a concept that makes sense but I don't know I it is even possible. So, I was thinking of a way to stop certain colors from giving off reflections, and I thought about how the Custom effect Color Hue FX singles out a single color from the image and allows the user to expand how many shades of that color are actually appearing on the screen. I was thinking that if that same concept was some how applied to RBM but in a inversed manner, then it could eliminate reflections on grass and other colors that the user wishes to choose. I came up with some visuals to aid me in my explanations

Here is the image that uses Color Hue FX to single out grass color from the rest of the colors


And here is a concept look at what would happen if that color was able to be masked from the image and no reflections would appear on those shades. (obviously not all of the area inside of the green zone would be masked from the reflections, since there are gray and black areas that would still keep the reflections):


Do you think that this is even possible to do?
Last Edit: 11 months 4 weeks ago by Elimina.
The administrator has disabled public write access.

RBM Color Mask 11 months 4 weeks ago #2

  • crosire
  • crosire's Avatar
  • Offline
  • Posts: 2451
  • Thank you received: 1391
In theory this can be done, I think.
Example: A first pass would single out the color that should be affected and create a mask, using the stencil buffer for example (which is way underused, only SMAA does use it currently, even though it is very powerful). The next passes would then only run on the pixels with the specified color.
But then again, I did not check the implementation of this particular shader, so I can't say if it makes sense in its context.
Cheers, crosire =)
Last Edit: 11 months 4 weeks ago by crosire.
The administrator has disabled public write access.
The following user(s) said Thank You: Elimina

RBM Color Mask 11 months 4 weeks ago #3

  • Elimina
  • Elimina's Avatar
  • Offline
  • ΞLIMINΛ
  • Posts: 329
  • Thank you received: 358
I wasn't saying that Color Hue FX would be a definite mask if it was implemented, but it gave me the idea of masking colors from the buffer like it does in the black and white look. :)

Another quick question/idea about RBM. Is there a way to stop the black outlines from appearing on objects? They appear in the foreground too, but you can notice them the most in the distance. think that if RBM had a fade like the AO, then most of the problem would be solved. We would still have objects close to use with outlines but at least half of the problem is fixed.
Last Edit: 11 months 4 weeks ago by Elimina.
The administrator has disabled public write access.

RBM Color Mask 11 months 3 weeks ago #4

  • Marty McFly
  • Marty McFly's Avatar
  • Offline
  • We've tried nothing and we're all out of ideas!
  • Posts: 609
  • Thank you received: 719
A fade can be done for sure but then I'd like to make it fixed start at 0 so it falls off directly at camera until a certain point, not start/end like AO fade. About the color separation...well my understanding of reflection is that it reflects everything. The masking may improve the visuals in one Screenshot and not the other and that's what I try to prevent at all costs: things that only look right under certain circumstances. When I write an effect it has to look same in all areas, not that it that I need to tweak it for every scene. Because of this reason many of my shaders remain unreleased such as true screen space reflections that look somewhat correctish in still images but twitched heavily in motion or the parallax occlusion mapping thing.
The administrator has disabled public write access.
The following user(s) said Thank You: Elimina

RBM Color Mask 11 months 3 weeks ago #5

  • Elimina
  • Elimina's Avatar
  • Offline
  • ΞLIMINΛ
  • Posts: 329
  • Thank you received: 358
Marty McFly wrote:
A fade can be done for sure but then I'd like to make it fixed start at 0 so it falls off directly at camera until a certain point, not start/end like AO fade.

Thanks for responding. If this is implemented, it will definitely allow people to use it more often in games, but it will specially allow users to add it in games with a lot of metal objects that would usually have reflections like Alien Isolation, Space Engineers(Dx9), etc without having those black artifacts

___________________________________________________________________________________
Marty McFly wrote:
About the color separation...well my understanding of reflection is that it reflects everything. The masking may improve the visuals in one Screenshot and not the other and that's what I try to prevent at all costs: things that only look right under certain circumstances. When I write an effect it has to look same in all areas, not that it that I need to tweak it for every scene. Because of this reason many of my shaders remain unreleased such as true screen space reflections that look somewhat correctish in still images but twitched heavily in motion or the parallax occlusion mapping thing.

I agree that it is necessary to keep effects from looking good in one scene while lowering the visuals of another scene, but if you have a game with an abundance of green grass (and I can name plenty of games that have this), then a toggle for a mask that stops reflections on green areas (if it was even possible) would allow users to actually use RBM more often than not on those types of games. I mean, this is all theoretical since I have no idea if a color buffer can be masked in a similar format to what I explained.
Last Edit: 11 months 3 weeks ago by Elimina.
The administrator has disabled public write access.

RBM Color Mask 11 months 3 weeks ago #6

  • Marty McFly
  • Marty McFly's Avatar
  • Offline
  • We've tried nothing and we're all out of ideas!
  • Posts: 609
  • Thank you received: 719
Doable is it, very easily actually. While I'm on that, I could lower the resolution of the color buffer the RBM samples from to increase performance - lower res won't be noticeable anyways because reflection is warped and distorted by the surface roughness of the reflective texture.
Is a control like the HSV color grading enough? Selection for red, magenta, purple etc? Or does it need even more fine - tuning?
Last Edit: 11 months 3 weeks ago by Marty McFly.
The administrator has disabled public write access.
The following user(s) said Thank You: Elimina

RBM Color Mask 11 months 3 weeks ago #7

  • Elimina
  • Elimina's Avatar
  • Offline
  • ΞLIMINΛ
  • Posts: 329
  • Thank you received: 358
Marty McFly wrote:
Is a control like the HSV color grading enough? Selection for red, magenta, purple etc? Or does it need even more fine - tuning?

I think that at least one option for fine tuning that is absolutely necessary for this to work is a option to select The hue range of the color that is going to be masked. I had to increase amount of green range by a considerable amount to actually get the grass to fully appear in the image. I have not tried out HSV, so I will have to try it out when I get home
The administrator has disabled public write access.

RBM Color Mask 11 months 3 weeks ago #8

  • Marty McFly
  • Marty McFly's Avatar
  • Offline
  • We've tried nothing and we're all out of ideas!
  • Posts: 609
  • Thank you received: 719
Well you cannot sort out more than one hue range with the color hue fx and adding more will be much more complex and not user friendly.
The administrator has disabled public write access.

RBM Color Mask 11 months 3 weeks ago #9

  • Elimina
  • Elimina's Avatar
  • Offline
  • ΞLIMINΛ
  • Posts: 329
  • Thank you received: 358
Marty McFly wrote:
Well you cannot sort out more than one hue range with the color hue fx and adding more will be much more complex and not user friendly.

I wasn't saying that you would be adding another hue range, I was just saying that a option for single color hue range to reach dark/lighter shades of a color is needed as an option as well (Like in color hue fx ). You said:

Marty McFly wrote:
Is a control like the HSV color grading enough? Selection for red, magenta, purple etc? Or does it need even more fine - tuning?

So I assumed that this meant that you were only planning to add a selection for a few colors, with no tuning at all :P I didn't exactly know what options you were planning on taking from HSV but I might of assumed incorrectly on your statement.
Last Edit: 11 months 3 weeks ago by Elimina.
The administrator has disabled public write access.

RBM Color Mask 11 months 3 weeks ago #10

  • Marty McFly
  • Marty McFly's Avatar
  • Offline
  • We've tried nothing and we're all out of ideas!
  • Posts: 609
  • Thank you received: 719
Well the color hue fx can only do one hue range. But if I wanted to sort out green and something else, I cannot do that with Color hue fx. The HSV color grading had predefined options for several hues around the color wheel so if you wanted to sort out green, just turn green down. If you want to sort out magenta, turn magenta down. The single hues of color grading have effect until the next hue, like orange has 100 effect on orange hue and 0 percent on red and yellow (the neighbour colors), values in between are interpolated. Vice versa, red hue has 100 percent effect on red hues and lowers to 0 percent when it reaches orange. It's basically like color hue fx just the range and position is predefined for each hue. If you want a larger hue range, just turn down more neighbouring hues.
The administrator has disabled public write access.

RBM Color Mask 11 months 3 weeks ago #11

  • Elimina
  • Elimina's Avatar
  • Offline
  • ΞLIMINΛ
  • Posts: 329
  • Thank you received: 358
Marty McFly wrote:
Well the color hue fx can only do one hue range. But if I wanted to sort out green and something else, I cannot do that with Color hue fx. The HSV color grading had predefined options for several hues around the color wheel so if you wanted to sort out green, just turn green down. If you want to sort out magenta, turn magenta down. The single hues of color grading have effect until the next hue, like orange has 100 effect on orange hue and 0 percent on red and yellow (the neighbour colors), values in between are interpolated. Vice versa, red hue has 100 percent effect on red hues and lowers to 0 percent when it reaches orange. It's basically like color hue fx just the range and position is predefined for each hue. If you want a larger hue range, just turn down more neighbouring hues.

Oh, that's how HSV works (I never got a chance to try it out) After reading your explanation it seems like it would work. Thanks for taking the time to look into my request.
The administrator has disabled public write access.

RBM Color Mask 11 months 3 weeks ago #12

  • Marty McFly
  • Marty McFly's Avatar
  • Offline
  • We've tried nothing and we're all out of ideas!
  • Posts: 609
  • Thank you received: 719
Here to clarify how the controls for red, orange and yellow for example work and what their range is. Color hue FX only has one of these areas and the only thing you can do is select its center and radius.

The administrator has disabled public write access.
The following user(s) said Thank You: Elimina

RBM Color Mask 3 months 2 weeks ago #13

Oh boy, this will be huge thread respawn... But would it be possible to draw RBM only in alpha channel of a texture? Some older games were using alpha channel to apply environment mapping and it would be nice to replace it with something more advanced.
The administrator has disabled public write access.

RBM Color Mask 3 months 2 weeks ago #14

  • Marty McFly
  • Marty McFly's Avatar
  • Offline
  • We've tried nothing and we're all out of ideas!
  • Posts: 609
  • Thank you received: 719
While it is true that such information is often stored in the alpha channels of the textures games use, this information is not saved in the alpha channel of the game'so screen output which ReShade reads.
The administrator has disabled public write access.

RBM Color Mask 3 months 2 weeks ago #15

  • MaxG3D
  • MaxG3D's Avatar
  • Offline
  • Posts: 27
  • Thank you received: 2
Simple brightness threshold mentioned in the other thread should be good enough.
Last Edit: 3 months 2 weeks ago by MaxG3D.
The administrator has disabled public write access.

RBM Color Mask 2 months 1 week ago #16

  • Marty McFly
  • Marty McFly's Avatar
  • Offline
  • We've tried nothing and we're all out of ideas!
  • Posts: 609
  • Thank you received: 719
*Digs out thread*

So I've sat down and rewrote RBM from 0, using the normal from color stuff I used in a private MXAO branch before I discarded it. Currently for ReShade 3.0 only (port to 2.0 is elementary, my dear watson). Key features:
  • Hue based multiplier, remove bump from surfaces with a certain hue - it doesn't get any closer to object masking than this, sorry. Elimina requested such a feature
  • Correct fresnel term for correct view angle depending reflectance mult
  • Smooth brightness threshold so only bright objects cause reflection
  • Overall greatly improved quality of effect and removed most artifacts like the black pixel bug, it fits as well into any scene as any ReShade powered AO


pastebin.com/SPN5NCHg

Once I figure out this .. thing called GitHub, I'm gonna push it to the ReShade Shader repo as well.
Last Edit: 2 months 1 week ago by Marty McFly.
The administrator has disabled public write access.
The following user(s) said Thank You: crosire, Elimina, andrew

ReShade 3.0 Progress 2 months 1 week ago #17

  • Genrix
  • Genrix's Avatar
  • Offline
  • Posts: 11
  • Thank you received: 3
One small question, crosire . It`s possible to make RBM shader with the option of the limit range, like MXAO #define AO_FADE ____ START / END? Because RBM draws on top of the fog in Fallout4. It looks very ugly. :(
Or is it necessary to ask for Marty? I hope he reads this topic. :)
Last Edit: 2 months 1 week ago by Genrix.
The administrator has disabled public write access.

ReShade 3.0 Progress 2 months 1 week ago #18

  • crosire
  • crosire's Avatar
  • Offline
  • Posts: 2451
  • Thank you received: 1391
Genrix wrote:
One small question, crosire
Moved your post, since that's not my area of expertise.
Cheers, crosire =)
The administrator has disabled public write access.
The following user(s) said Thank You: Genrix

ReShade 3.0 Progress 2 months 1 week ago #19

  • Marty McFly
  • Marty McFly's Avatar
  • Offline
  • We've tried nothing and we're all out of ideas!
  • Posts: 609
  • Thank you received: 719
Ah yes, I knew I forgot something. Fadeout will come soon, I'm on mobile atm.
The administrator has disabled public write access.
The following user(s) said Thank You: Elimina, Genrix

ReShade 3.0 Progress 2 months 6 days ago #20

  • Elimina
  • Elimina's Avatar
  • Offline
  • ΞLIMINΛ
  • Posts: 329
  • Thank you received: 358
Marty McFly wrote:
Ah yes, I knew I forgot something. Fadeout will come soon, I'm on mobile atm.

Thank you for your effort in improving this effect. :) Was the option to add a blur to the reflection ever implemented in the new version? (Discussed in reshade.me/forum/shader-suggestions/1914-rbm-blur-option#14072)
Last Edit: 2 months 6 days ago by Elimina.
The administrator has disabled public write access.