Page 1 of 3

Brushed Aluminum

Posted: Mon Jan 12, 2009 11:43 pm
by ozzie
so, this time I've got new problem which (as usually) I don't know how to solve :/
not sure is there a problem with bump map or in other setting :/

I'm trying to make brushed aluminum and I don't know how to make it right. This is what I've done so far.
I was trying to do exactly as it was done in here:

http://www.indigorenderer.com/joomla/fo ... ht=brushed

I just used different map, and what ever I'll do I still have those black lines. I was trying to make it with 0.005 up to 0.01 bump but still nothing :/
HELP! :)

Code: Select all

<material>
		<name>Material</name>
		<phong>
			<exponent>
				<constant>10000</constant>
			</exponent>
			<ior>1.60838</ior>
			<nk_data>nkdata\al.nk</nk_data>
			<texture>
				<path>I:\Documents and Settings\Ozzie\Pulpit\HT_Brush.jpg</path>
				<uv_set>uv</uv_set>
				<exponent>2.200000</exponent>
				<a>0.001</a>
				<b>0.001</b>
				<c>0.001</c>
			</texture>
			<diffuse_albedo>
				<constant><rgb>
					<rgb>0.8 0.8 0.8</rgb>
					<gamma>2.2</gamma>
				</rgb></constant>
			</diffuse_albedo>
			<bump>
				<texture>
					<texture_index>0</texture_index>
				</texture>
			</bump>
		</phong>
	</material>

Posted: Tue Jan 13, 2009 12:15 am
by Zom-B
just use the B value for scaling the bump, A & C are more complicated to explain let them on 1, your line problem seems to come from there :)

try not to use a BumpMap, but a exponent Map for your material with a B value of about 100.

Posted: Tue Jan 13, 2009 1:03 am
by CTZn
Two things: as Zom-B mentioned the B (gain) value is way too strong, and bump technology is not well suited to work on aliased textures, blur it ! Actually black on white is worse than everything, that's where the issue comes from mostly. Bump needs shades to define a surface normal direction.

For bump and displacement a texture exponent of 1 is generally wanted, since exponent will change the bump slope. 2.2 is good for wavelength- dependent parameters (aka colors).

edit: ah well you beat me at it...

Posted: Tue Jan 13, 2009 1:04 am
by ozzie
I've used this same texture, but changed a little bit.
Thirst two objects from left are made just as it shown in blendigo, the last cube is just an PHONG al.nk with exponent map with B 100

I hope it will be fine :/

The Aluminum2 material code:

Code: Select all

	<material>
		<name>aluminum2</name>
		<phong>
			<exponent>
				<constant>10000</constant>
			</exponent>
			<ior>1.60838</ior>
			<nk_data>nkdata\Al.nk</nk_data>
			<texture>
				<path>I:\Documents and Settings\Ozzie\Pulpit\HT_Brush2.jpg</path>
				<uv_set>uv</uv_set>
				<exponent>2.200000</exponent>
				<a>0</a>
				<b>100</b>
				<c>1</c>
			</texture>
			<diffuse_albedo>
				<constant><rgb>
					<rgb>0.8 0.8 0.8</rgb>
					<gamma>2.2</gamma>
				</rgb></constant>
			</diffuse_albedo>
			<exponent>
				<texture>
					<texture_index>0</texture_index>
				</texture>
			</exponent>
		</phong>
	</material>

Posted: Tue Jan 13, 2009 1:51 am
by SmartDen
i think one can make such brushed metal with shaders. so you don't need any textures

Posted: Tue Jan 13, 2009 2:30 am
by ozzie
But.. you must know how to write them :) and I'm "OUT" at shader's topic :)

Posted: Tue Jan 13, 2009 7:39 am
by Schosch

Code: Select all

def eval() real :
						fbm(dot(getTexCoords(0)*1000.0, vec2(0.0, 0.75)), 4)*0.0003
This shader stretches the fbm noise in a certain direction.

The factor after getTexCoords (1000.0) controls the general noise scale (the higher the smaller), the values of vec2 control the direction and the length of the scratches, the value after vec2 (4) sets the number of noise octaves (and thereby the amount of detail) and the factor at the end (0.0003) controls the depth of the bump effect.

I have added this to the MatDB: Brushed aluminium

Posted: Tue Jan 13, 2009 8:31 am
by ozzie
Schosch wrote:

Code: Select all

def eval() real :
						fbm(dot(getTexCoords(0)*1000.0, vec2(0.0, 0.75)), 4)*0.0003
This shader stretches the fbm noise in a certain direction.

The factor after getTexCoords (1000.0) controls the general noise scale (the higher the smaller), the values of vec2 control the direction and the length of the scratches, the value after vec2 (4) sets the number of noise octaves (and thereby the amount of detail) and the factor at the end (0.0003) controls the depth of the bump effect.

I have added this to the MatDB: Brushed aluminium
That's it? just one line? You must be joking!?

Posted: Tue Jan 13, 2009 8:42 am
by Schosch
Actually there are two lines... :P
No, really, that is everything, you can try it out for yourself if you didn't already.

Posted: Tue Jan 13, 2009 8:44 am
by ozzie
Schosch wrote:Actually there are two lines... :P
No, really, that is everything, you can try it out for yourself if you didn't already.
all ready done it :)

Posted: Tue Jan 13, 2009 9:03 am
by ozzie
Schosch wrote:Actually there are two lines... :P
No, really, that is everything, you can try it out for yourself if you didn't already.
Why I'm not so clever as you :/ :( buuu ;(

Posted: Tue Jan 13, 2009 9:34 am
by Juniorsatan
Whenever i see these Materials who were build by 2 lines code, I got a missin' feeling of a nice & easy tutorial which explaines the conecept and the setup of the functions etc. Damn it, nice to see that we can build those mats without any texture.

Posted: Tue Jan 13, 2009 10:20 am
by ozzie
Yes, but if there would be some tutorial for it like "hello word" the live would be much easier:)
"Hello Word" in Indigo :/ Sound nice :)

Posted: Wed Jan 14, 2009 9:47 am
by Kram1032
Interesting would be, if another bfm-layer (with different seed) somehow controls that stretch, "randomizing the stretch-distance" - if that's at all possible^^

Posted: Thu Jan 15, 2009 6:32 am
by Schosch
Interesting would be, if another bfm-layer (with different seed) somehow controls that stretch, "randomizing the stretch-distance" - if that's at all possible^^

Code: Select all

def eval() real :
						fbm(dot(getTexCoords(0)*1000.0, vec2(0.0, clamp(noise(getTexCoords(0)), 1.0, 5.0))), 4)*0.0003
I've changed the shader code so that the scratches now have a more or less random length.