Fading a bump map

Started by human_bean, October 31, 2017, 03:53:06 PM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

human_bean

Hi All,

I'm trying to figure out how to fade a bump map pattern and haven't had success.

For example in the attached image, I'd like to bump map to fade from full depth to zero as it goes toward the right side.  I thought I could plug in a "color to number" utility in to the bump settings but it will not allow me to.

Is there a way to do this?

Thanks.

NM-92

Yes! You'll just have to control the bump height with a gradient texture. It works just like roughness textures. Black represents a value of 0 and white a value of 1. So, map the texture properly and you're good to go. (I don't remember exactly this information so the black and white stuff can be inverse). Good luck with that and show your results !

Esben Oxholm

Hi!

Definitely, as NM-92 says.

Here's an example showing one way to do it.
If you add a 'bump add' node you can add a gradient texture into the weight of your bump map and thus control the amount gradually.

Grab the KSP for the scene here if you want to check out any details: https://we.tl/I6aNJQIfEj


human_bean

Hi guys,

Thanks for your response, I was able to get it to work using the bump add node as Oxholm suggested, however, applying a gradient texture as suggested by NM-92 did not, even though it looks like it should.

Any ideas on why this might be?

NM-92

Ahh, that would be cause you're working with a procedural ! My suggestion applies to bitmaps only, didn't know that, sorry. Images attached.

human_bean

Ooh I see.  Good to know it will at least work with bitmaps.  Strange that it doesn't work with procedural.

Esben Oxholm

There is also a few limitations to adding the gradient directly into the bump height input: You can't do negative bump heights and you can't go above a bump height of 1, as the black and white colors translates to values between 0 and 1.

When using the gradient as input for the weight in a bump add node it serves more like a multiplier of whatever values you have as the bump height.

human_bean

Quote from: Esben Oxholm on November 01, 2017, 01:22:39 PM
There is also a few limitations to adding the gradient directly into the bump height input: You can't do negative bump heights and you can't go above a bump height of 1, as the black and white colors translates to values between 0 and 1.

When using the gradient as input for the weight in a bump add node it serves more like a multiplier of whatever values you have as the bump height.

I see!  That makes sense.

I wish it was possible to plug the 'color to number' node to have more control over bump maps, kind of like how you can with roughness.

NM-92

Quote from: Esben Oxholm on November 01, 2017, 01:22:39 PM
There is also a few limitations to adding the gradient directly into the bump height input: You can't do negative bump heights and you can't go above a bump height of 1, as the black and white colors translates to values between 0 and 1.

When using the gradient as input for the weight in a bump add node it serves more like a multiplier of whatever values you have as the bump height.

Great tips. Never did something very serious with this technique so i didn't know many of those things. Thanks for clearing that up.

Esben Oxholm

Quote from: NM-92 on November 01, 2017, 07:09:30 PM
Quote from: Esben Oxholm on November 01, 2017, 01:22:39 PM
There is also a few limitations to adding the gradient directly into the bump height input: You can't do negative bump heights and you can't go above a bump height of 1, as the black and white colors translates to values between 0 and 1.

When using the gradient as input for the weight in a bump add node it serves more like a multiplier of whatever values you have as the bump height.

Great tips. Never did something very serious with this technique so i didn't know many of those things. Thanks for clearing that up.

No problem. I first learned this myself a few weeks back!  :)

INNEO_MWo

Hi.

I've run a short test with a procedural texture for the bump and faded it with a gradient. The gradient is attached to the bump height. If you like, you can add a color to number node between the gradient and the material node to drive the height values from white to black.

For details look into the files.

Hope that helps

Cheers
Marco

soren

#11
There is a texturable Bump Height on the Material nodes, you can use for manipulating bump height via a texture. In addition, you can use the Color To Number node to remap the 0-1 range of the Color gradient (or any other color texture) to any numerical range - e.g. from -0.5 to 0.5 as shown below.

The Color to Number parameters are a bit hard to understand (yes, a curve would be nice):

  • Input From is mapped to Output From (in the screen shot, 0 becomes -0.5). Black is 0.
  • Input To is mapped to Output To (in the screen shot, 1 becomes 0.5). White is 1.

Values in between are linearly interpolated ("blended"). If you enable Smooth, something similar to ease in/out is applied so you can achieve a smoother transition. If you narrow the input range, it is similar to boosting the contrast of the color source, but with finer numerical control and the ability to clamp/mask out values outside a specific range. The output range is used to control the desired values on the target parameter (i.e. bump height or roughness).

Hope this helps,
Søren

Esben Oxholm

Quote from: Søren on November 02, 2017, 01:00:01 PM
There is a texturable Bump Height on the Material nodes, you can use for manipulating bump height via a texture. In addition, you can use the Color To Number node to remap the 0-1 range of the Color gradient (or any other color texture) to any numerical range - e.g. from -0.5 to 0.5 as shown below.

The Color to Number parameters are a bit hard to understand (yes, a curve would be nice):

  • Input From is mapped to Output From (in the screen shot, 0 becomes -0.5). Black is 0.
  • Input To is mapped to Output To (in the screen shot, 1 becomes 0.5). White is 1.

Values in between are linearly interpolated ("blended"). If you enable Smooth, something similar to ease in/out is applied so you can achieve a smoother transition. If you narrow the input range, it is similar to boosting the contrast of the color source, but with finer numerical control and the ability to clamp/mask out values outside a specific range. The output range is used to control the desired values on the target parameter (i.e. bump height or roughness).

Hope this helps,
Søren


Thanks for the clarification, Søren! Super helpful.
I've always had a tough time to describe with words what happens in the color to number node, but now I have this to refer to :)