RBM Color Mask

  • Elimina
  • Topic Author
More
8 years 4 months ago - 8 years 4 months ago #1 by Elimina RBM Color Mask was created by Elimina
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: 8 years 4 months ago by Elimina.

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

  • crosire
More
8 years 4 months ago - 8 years 4 months ago #2 by crosire Replied by crosire on topic RBM Color Mask
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.
Last edit: 8 years 4 months ago by crosire.
The following user(s) said Thank You: Elimina

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

  • Elimina
  • Topic Author
More
8 years 4 months ago - 8 years 4 months ago #3 by Elimina Replied by Elimina on topic RBM Color Mask
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: 8 years 4 months ago by Elimina.

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

  • Marty McFly
More
8 years 4 months ago #4 by Marty McFly Replied by Marty McFly on topic RBM Color Mask
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 following user(s) said Thank You: Elimina

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

  • Elimina
  • Topic Author
More
8 years 4 months ago - 8 years 4 months ago #5 by Elimina Replied by Elimina on topic RBM Color Mask

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: 8 years 4 months ago by Elimina.

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

  • Marty McFly
More
8 years 4 months ago - 8 years 4 months ago #6 by Marty McFly Replied by Marty McFly on topic RBM Color Mask
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: 8 years 4 months ago by Marty McFly.
The following user(s) said Thank You: Elimina

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

  • Elimina
  • Topic Author
More
8 years 4 months ago #7 by Elimina Replied by Elimina on topic RBM Color Mask

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

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

  • Marty McFly
More
8 years 4 months ago #8 by Marty McFly Replied by Marty McFly on topic RBM Color Mask
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.

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

  • Elimina
  • Topic Author
More
8 years 4 months ago - 8 years 4 months ago #9 by Elimina Replied by Elimina on topic RBM Color Mask

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: 8 years 4 months ago by Elimina.

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

  • Marty McFly
More
8 years 4 months ago #10 by Marty McFly Replied by Marty McFly on topic RBM Color Mask
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.

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

  • Elimina
  • Topic Author
More
8 years 4 months ago #11 by Elimina Replied by Elimina on topic RBM Color Mask

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.

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

  • Marty McFly
More
8 years 4 months ago #12 by Marty McFly Replied by Marty McFly on topic RBM Color Mask
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 following user(s) said Thank You: Elimina

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

  • WSH303
More
7 years 7 months ago #13 by WSH303 Replied by WSH303 on topic RBM Color Mask
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.

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

  • Marty McFly
More
7 years 7 months ago #14 by Marty McFly Replied by Marty McFly on topic RBM Color Mask
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.

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

  • MaxG3D
More
7 years 7 months ago - 7 years 7 months ago #15 by MaxG3D Replied by MaxG3D on topic RBM Color Mask
Simple brightness threshold mentioned in the other thread should be good enough.
Last edit: 7 years 7 months ago by MaxG3D.

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

  • Marty McFly
More
7 years 6 months ago - 7 years 6 months ago #16 by Marty McFly Replied by Marty McFly on topic RBM Color Mask
*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, [strike]my dear watson[/strike]). 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: 7 years 6 months ago by Marty McFly.
The following user(s) said Thank You: crosire, Elimina, andrew

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

  • Genrix
More
7 years 6 months ago - 7 years 6 months ago #17 by Genrix Replied by Genrix on topic ReShade 3.0 Progress
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: 7 years 6 months ago by Genrix.

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

  • crosire
More
7 years 6 months ago #18 by crosire Replied by crosire on topic ReShade 3.0 Progress

Genrix wrote: One small question, crosire

Moved your post, since that's not my area of expertise.
The following user(s) said Thank You: Genrix

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

  • Marty McFly
More
7 years 6 months ago #19 by Marty McFly Replied by Marty McFly on topic ReShade 3.0 Progress
Ah yes, I knew I forgot something. Fadeout will come soon, I'm on mobile atm.
The following user(s) said Thank You: Elimina, Genrix

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

  • Elimina
  • Topic Author
More
7 years 6 months ago - 7 years 6 months ago #20 by Elimina Replied by Elimina on topic ReShade 3.0 Progress

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: 7 years 6 months ago by Elimina.

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.