Author Topic: Fading a bump map  (Read 4195 times)

0 Members and 1 Guest are viewing this topic.

Offline human_bean

  • Newbie
  • *
  • Posts: 10
Fading a bump map
« on: October 31, 2017, 03:53:06 pm »
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.

Offline NM-92

  • KeyShot Beta
  • Hero Member
  • *****
  • Posts: 1152
    • Behance
Re: Fading a bump map
« Reply #1 on: October 31, 2017, 07:57:44 pm »
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 !

Offline Esben Oxholm

  • KeyShot Beta
  • Hero Member
  • *****
  • Posts: 1670
  • esbenoxholm.dk/keyshot-video-course
    • Freelance CG Artist
Re: Fading a bump map
« Reply #2 on: October 31, 2017, 11:45:31 pm »
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


Offline human_bean

  • Newbie
  • *
  • Posts: 10
Re: Fading a bump map
« Reply #3 on: November 01, 2017, 10:57:41 am »
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?

Offline NM-92

  • KeyShot Beta
  • Hero Member
  • *****
  • Posts: 1152
    • Behance
Re: Fading a bump map
« Reply #4 on: November 01, 2017, 11:48:58 am »
Ahh, that would be cause you're working with a procedural ! My suggestion applies to bitmaps only, didn't know that, sorry. Images attached.

Offline human_bean

  • Newbie
  • *
  • Posts: 10
Re: Fading a bump map
« Reply #5 on: November 01, 2017, 12:02:48 pm »
Ooh I see.  Good to know it will at least work with bitmaps.  Strange that it doesn't work with procedural.

Offline Esben Oxholm

  • KeyShot Beta
  • Hero Member
  • *****
  • Posts: 1670
  • esbenoxholm.dk/keyshot-video-course
    • Freelance CG Artist
Re: Fading a bump map
« Reply #6 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.

Offline human_bean

  • Newbie
  • *
  • Posts: 10
Re: Fading a bump map
« Reply #7 on: November 01, 2017, 01:42:46 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.

Offline NM-92

  • KeyShot Beta
  • Hero Member
  • *****
  • Posts: 1152
    • Behance
Re: Fading a bump map
« Reply #8 on: November 01, 2017, 07:09:30 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.

Offline Esben Oxholm

  • KeyShot Beta
  • Hero Member
  • *****
  • Posts: 1670
  • esbenoxholm.dk/keyshot-video-course
    • Freelance CG Artist
Re: Fading a bump map
« Reply #9 on: November 01, 2017, 11:17:54 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!  :)

Offline MWo

  • Hero Member
  • *****
  • Posts: 875
  • Senior Technical Consultant @ INNEO (Germany)
    • german KeyShot page from INNEO Solutions
Re: Fading a bump map
« Reply #10 on: November 02, 2017, 11:34:12 am »
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

Offline Søren

  • Developer
  • Jr. Member
  • *****
  • Posts: 81
  • KeyShot Developer
    • KeyShot
Re: Fading a bump map
« Reply #11 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
« Last Edit: November 02, 2017, 01:02:00 pm by Søren »

Offline Esben Oxholm

  • KeyShot Beta
  • Hero Member
  • *****
  • Posts: 1670
  • esbenoxholm.dk/keyshot-video-course
    • Freelance CG Artist
Re: Fading a bump map
« Reply #12 on: November 03, 2017, 12:13:45 am »
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 :)