How to go from color to bump ? What's the best way ?

Moderator: Timo

How to go from color to bump ? What's the best way ?

Postby studio » Saturday 4. March 2006, 01:22

Image


Image


Is there a basic rule of thumb or a procedure for ransforming a VSL procedural color map (surface properties) into a matching bump map (surface geometry) ? For instance the images above show how I very clumsily created a bump mapping for displacing the matching color shader (Lichen) . I'm sure there are lot's of methods , but is there a simple smarter/cleaner method for creating a matching bump map ?

Thanks In Advance

studio
User avatar
studio
 
Posts: 133
Joined: Monday 17. November 2003, 00:13
Location: niagara

RE: How to go from color to bump ? What

Postby JuhaS » Saturday 4. March 2006, 12:55

Hello, I'm not sure if this is the smartest method but here's how I would do it. :)

Image

In a nutshell, create the pattern (and associated mapping scaling) in common properties and just do the
needed adjustments (color assignment, height scaling) in appropriate shaders.

JuhaS
JuhaS
 
Posts: 23
Joined: Friday 26. March 2004, 21:36
Location: Oulu, Finland

RE: How to go from color to bump ? What

Postby studio » Saturday 4. March 2006, 18:55

Hi :

That looks like a good rule of thumb for when you're first creating shaders , but what about an elaborate color shader that you want to transform to bumps too ? That is , is there a certain line of VSL (you can use my poor example above) that I could have just grabbed and added a Surface Geometry operation to ?

Thanks in Advance .

studio
User avatar
studio
 
Posts: 133
Joined: Monday 17. November 2003, 00:13
Location: niagara

RE: How to go from color to bump ? What

Postby JuhaS » Sunday 5. March 2006, 14:29

Well, if I understand the problem correctly,
you would have to change from color (which is 3 float values) to bump height (single float) by using some transformation. One might be
using sub channel average (in the Operation vsl object):

(x,y,z)->(x+y+z)/3

The results obviously depend heavily on the chosen colors in the shader so this may not produce very good results.

Anyway, if you want to use the color to produce bump height and save some work, you should define the color shader in Common Properties and then copy the resultant color to a global variable and then use that value in both Surface Properties and Surface Geometry, like in this marble shader I mangled.

Image

The reason for creating the color shader in Common is that it is executed before both Surface Geometry and Surface Properties and therefore you can move information from there to both of them. Had the color shader been defined in Surface Properties, you could not have copied the the color to variable and use it in Geometry because Geometry is executed before Surface Properties.

This is going off on a bit of a tangent, but if your color shader doesn't need any channels available only in Surface Properties, another (somewhat useless :) ) trick would be to create your color shader in Geometry and copy results to be used in Surface Properties.

JuhaS
JuhaS
 
Posts: 23
Joined: Friday 26. March 2004, 21:36
Location: Oulu, Finland

RE: How to go from color to bump ? What

Postby studio » Sunday 5. March 2006, 17:43

OK , got it . That explains a lot , and also why I couldn't get Geometry to eval the surf Prop output . Thanks . :yourock: This is an excellent explanation and now I understand why copying the entire surf prop code into surf geometry worked . I have some tests lined up for this and with the help of your post I should be able to get it working ... this time . :D

studio
User avatar
studio
 
Posts: 133
Joined: Monday 17. November 2003, 00:13
Location: niagara


Return to Shader/VSL/Texturing

Who is online

Users browsing this forum: No registered users and 4 guests

cron