Page 1 of 1

Bump map size

Posted: Wed Jan 18, 2012 11:18 pm
by aleksandera
I like this material, but the size of the scratches is a litle too big
on my objects:
http://www.indigorenderer.com/materials/materials/340

How do i edit this??

Thank you in advance for any answers.

Bump map size

Posted: Wed Jan 18, 2012 11:51 pm
by zeitmeister
You could change the mapping/tiling options in your host 3D application or relplace it with a new bumpmap.

Re: Bump map size

Posted: Thu Jan 19, 2012 12:08 am
by aleksandera
Can't It's a procedural map. :(

Re: Bump map size

Posted: Thu Jan 19, 2012 2:51 am
by zeitmeister
Sorry, didn't read it to the end.

I changed the vec.2 multiplier ("7") in the very second line:

Code: Select all

def scratchcoords( vec2 pos ) vec2 :
	vec2(  7. * ( doti ( pos  )  + noise(pos*0.1)) , 200. * ( dotj ( pos  ) + noise( pos*0.2) ) )
to f.e.:

Code: Select all

def scratchcoords( vec2 pos ) vec2 :
	vec2(  30. * ( doti ( pos  )  + noise(pos*0.1)) , 200. * ( dotj ( pos  ) + noise( pos*0.2) ) )
scratched-metal_smaller_scratches.jpg
If you set higher values here, the scratches gonna be smaller.
Hope it helps!

Re: Bump map size

Posted: Thu Jan 19, 2012 3:40 am
by aleksandera
Thank you! :D

Re: Bump map size

Posted: Thu Jan 19, 2012 5:03 am
by CTZn
By doing so you are changing one dimension of the scratches, it's not an homogeneous change zeitmeister :)

That said scaling the UVs from within the host application should work too, being procedural this shader does use actual UVs. In this regard it is best to multiply them at their source in the shader, wich is getTexCoords(0). The multiplier can be greater or smaller than 1.0 but it must be a float (dot something), integers will cause an error.

Once you have multiplied the input UVs like so, the depth must be changed proportionally. Divide the depth by the new multiplier and you should be done.

Code: Select all

(0.0005 / mult) * etc
where mult is the float you choosed as multiplier for getTexCoords(0).

This way the shader will effectively be scaled proportionally.

Re: Bump map size

Posted: Thu Jan 19, 2012 6:26 am
by galinette
Hello all,

In fact both approaches are correct... But produce different results

CTZn approach, UV scaling, will change the overall scaling of the texture over the material, in a classical way. Do not forget to change the overall bump (height) factor : shrinking UV at constant bump height will make the scratches profiles too steep.

Zeitmaster's is proposing a more subtle change. The scratch centers are not changed, but they are shortened. Changing the "200" would have changed the scratch width.

I will try to convert this to a parametric shader as soon as I have time, since it is possible now

Etienne

Bump map size

Posted: Thu Jan 19, 2012 10:23 am
by zeitmeister
Thank you all for pointing this out!!!

Re: Bump map size

Posted: Thu Jan 19, 2012 2:52 pm
by Headroom
Some helpful comments in the shader code would help a lot along the way.
Specifically for those that are not living Indigo on a daily basis or have the time to get intimate with ISL.

I am assuming that that is supported ;-)