Tue, May 7, 2:19 AM CDT

Welcome to the Poser - OFFICIAL Forum

Forum Coordinators: RedPhantom

Poser - OFFICIAL F.A.Q (Last Updated: 2024 May 07 1:31 am)



Subject: P6 tip - DirtyNuts style dirt shaders using Ambient Occlusion


  • 1
  • 2
Ajax ( ) posted Wed, 23 March 2005 at 9:08 PM · edited Mon, 06 May 2024 at 2:31 PM

file_206770.jpg

Now that we have an Ambient Occlusion node it's possible to create shaders that automatically fill nooks and crannies with dirt. The image above shows four basic AO based dirt shaders. I've rendered without shadows so you can see exactly what the shaders look like without any lighting effects. In the next few posts, I'll show you how the shaders are built. Essentially, AO is used to tell the shader which bits of the model should have dirt on them.


View Ajax's Gallery - View Ajax's Freestuff - View Ajax's Store - Send Ajax a message


Ajax ( ) posted Wed, 23 March 2005 at 9:21 PM

file_206771.jpg

Here's the node layout for the first shader. This one is the floor of the first image. The shader starts with the ambient occlusion node, which we then filter through a math power function. This takes the square root of the AO output, which just softens the transition between light and dark areas of the AO node. After that, we subtract the output from 1 with another math node. This just inverts the colour, so now we have white in the places where we want dirt and black in the places where we don't. From there, we take the output to the bias parameter of a clouds node. By doing this, we tell the clouds node to make white cloudy bits where we want dirt and blackness everywhere else. Finally, we use the output of the clouds node to drive a blender, with dark green for dirt and white for clean areas.


View Ajax's Gallery - View Ajax's Freestuff - View Ajax's Store - Send Ajax a message


Ajax ( ) posted Wed, 23 March 2005 at 9:24 PM

file_206773.jpg

Here's the next one (the right hand wall this time). This one uses fractal sum instead of clouds. That's really the only difference.


View Ajax's Gallery - View Ajax's Freestuff - View Ajax's Store - Send Ajax a message


Ajax ( ) posted Wed, 23 March 2005 at 9:30 PM

file_206775.jpg

This third shader is the one used on the left hand wall. It's a little more complicated than the others. This time we use use an fBm node for the dirt noise. I've set it to use the new Improved noise type because that gives more attractive noise. However, this introduces a problem because the new noise type never gives complete blackness, even when the bias is set to zero. To compensate for that, I'm running the inverted AO output through a math step function that will tell the shader where there should be no AO shading and then multiplying that with the fBm output to make sure that no noise appears in areas that should be dirt free. Without this step, all areas would have at least a little dirt.


View Ajax's Gallery - View Ajax's Freestuff - View Ajax's Store - Send Ajax a message


Ajax ( ) posted Wed, 23 March 2005 at 9:33 PM

file_206776.jpg

Last one. This is the shader used on the ball. It's just like the previous one, only using turbulence instead of fBm.


View Ajax's Gallery - View Ajax's Freestuff - View Ajax's Store - Send Ajax a message


GWeb ( ) posted Wed, 23 March 2005 at 9:38 PM

Very Nasty Very Bad bad BAD!! shadow. Not all corners r supposed to get AO


Ajax ( ) posted Wed, 23 March 2005 at 9:38 PM

file_206778.jpg

Here's that first render again, but with some of P6's nice new lighting options turned on (one point light with ambient occlusion lighting turned on). Remember to turn on raytracing any time you want to use ambient occlusion (whether it's for lighting or for shaders). AO won't work without raytracing.


View Ajax's Gallery - View Ajax's Freestuff - View Ajax's Store - Send Ajax a message


Gareee ( ) posted Wed, 23 March 2005 at 9:38 PM

is there any render speed difference with any of these settings? Since they all look "good", whichever one renders the fastest might be the choice one. (not sure how much math increases renderspeed)

Way too many people take way too many things way too seriously.


stonemason ( ) posted Wed, 23 March 2005 at 9:46 PM

nice work Ajax can you make it smaller more subtle?

Cg Society Portfolio


Ajax ( ) posted Wed, 23 March 2005 at 10:05 PM

GWeb, actually if you take a look at the mathematical procedure behind AO, yes all corners are supposed to get it. That's how the AO algorithm works and it's also one of the reason AO is far from a perfect solution for true radiant lighting. Gareee, Not much difference in speed between the four shaders shown, no. It's just a matter of which noise pattern you like the best. Stonemason, Yep, you can make it smaller and more subtle. The size of the individual dirt grains is controlled with the scale parameters of whichever noise node you use. The density is controlled with the bias parameter on the same node. Controlling how far the dirt extends from the corners is a matter of filtering the AO output through some math nodes.


View Ajax's Gallery - View Ajax's Freestuff - View Ajax's Store - Send Ajax a message


Ajax ( ) posted Wed, 23 March 2005 at 11:01 PM

file_206780.jpg

Here's one more pic. This one shows how it looks when you apply these principles to more realistic shaders. The same four noise types are being used in this render, though with some parameter tweeks to make the dirt just a touch less strong.


View Ajax's Gallery - View Ajax's Freestuff - View Ajax's Store - Send Ajax a message


GWeb ( ) posted Wed, 23 March 2005 at 11:19 PM

Attached Link: http://www-viz.tamu.edu/students/bmoyer/617/ambocc/

More info on Ambient Occlusion http://www-viz.tamu.edu/students/bmoyer/617/ambocc/


Ajax ( ) posted Wed, 23 March 2005 at 11:53 PM

file_206781.jpg

I wanted to see what those shaders looked like on a more detailed model, so here's Stonemasons Whispering Wall with the shader from the left hand wall applied to the face.


View Ajax's Gallery - View Ajax's Freestuff - View Ajax's Store - Send Ajax a message


stonemason ( ) posted Wed, 23 March 2005 at 11:58 PM

get that bump out of the gradient slot!!..lol :) it's a nice effect with the shader,it looks a bit grainy,& obviously made up of dots..is there any way to clean that up?

Cg Society Portfolio


Ajax ( ) posted Thu, 24 March 2005 at 12:23 AM

Attached Link: http://www.metafex.net/cinefex/tutorials/dn/

It's meant to be grainy and made up of dots. It pretty much matches the appearance I was trying for, rather like the grainy dirt you see in the bottom right couple of pictures on the linked page. Those were done with the old C4D DirtyNuts shader. What sort of look did you have in mind? If you've got a pic, I'll see if I can come up with something similar.


View Ajax's Gallery - View Ajax's Freestuff - View Ajax's Store - Send Ajax a message


Lawndart ( ) posted Thu, 24 March 2005 at 12:24 AM

By the title of this thread I thought I was going to have to suggest that you turn on the nudity flag. LOL


stonemason ( ) posted Thu, 24 March 2005 at 12:44 AM

I'm not sure what I'm looking for,just less apparent dots I guess,can you control the amount of dots?..make it alot more dense but keep the opacity http://www.maxon.net/pages/products/c4d/r85/images/dirt_nodirt.jpg

Cg Society Portfolio


Xena ( ) posted Thu, 24 March 2005 at 12:45 AM

I thought he'd been running around the back yard naked again ;P


GWeb ( ) posted Thu, 24 March 2005 at 12:47 AM

Stonemason Excellent link!! you have made my point acrossed!! Thanks!!!!!


Ajax ( ) posted Thu, 24 March 2005 at 12:47 AM

Looks doable. Just a matter of spending lots of time tweaking I think. Let me see what I can do.


View Ajax's Gallery - View Ajax's Freestuff - View Ajax's Store - Send Ajax a message


GWeb ( ) posted Thu, 24 March 2005 at 1:05 AM

My suggestion is to have AO shading interact with property shading for color balancing. I wish I downloaded P6 stead of Box but I want a copy of book and a pretty box hehe.


Ajax ( ) posted Thu, 24 March 2005 at 4:02 AM

file_206782.jpg

Stef, Is any of these closer to what you had in mind?


View Ajax's Gallery - View Ajax's Freestuff - View Ajax's Store - Send Ajax a message


GWeb ( ) posted Thu, 24 March 2005 at 4:24 AM

Top right is better but not satistified. After looking at all of these. AO is not supposed to look dusty. AO is supposed to slight decrease or increase color temperature along with shading.


GWeb ( ) posted Thu, 24 March 2005 at 4:28 AM

Can you match AO color with the sphere's color shading? I also would like you to make another sample like this but with lighter color in AO setting. GWeb


Ajax ( ) posted Thu, 24 March 2005 at 4:43 AM

GWeb, I realise the title of this thread, containing the rather subtle words "dirt shaders", might not have given it away to you, but the whole point of what I'm doing here is to use AO as a means of filling corners with dirt. I had hoped that the very first sentence in this thread ("...it's possible to create shaders that automatically fill nooks and crannies with dirt") might have hinted that, but apparently I was being too obscure. "AO is not supposed to look dusty" Surprisingly enough, DIRT IS SUPPOSED TO LOOK DUSTY! Perhaps I'm still being too subtle, so I'll quote your own words from post 6 back at you: "Very Nasty Very Bad bad BAD!!" If you aren't interested in shaders that look dirty and/or dusty, please do us both a favour and go and find a thread that isn't about dirt shaders.


View Ajax's Gallery - View Ajax's Freestuff - View Ajax's Store - Send Ajax a message


Ajax ( ) posted Thu, 24 March 2005 at 5:25 AM

file_206783.jpg

Xena, LawnDart, I saved my dirtiest pair of balls just for you two :-)


View Ajax's Gallery - View Ajax's Freestuff - View Ajax's Store - Send Ajax a message


Eternl_Knight ( ) posted Thu, 24 March 2005 at 5:28 AM

Hehe, now the entire of Poserdom can use the old Ambient occlusion for "dirty shaders" trick Renderman users have had for some time. Good to see we're spreading the love grin I personally like the top left, the top-right is nice for say a "tarnished" look, but the top-left really does the "dirt thing" for me,


Ian Porter ( ) posted Thu, 24 March 2005 at 5:49 AM

Ajax, This is outstanding. I agree with Eternl Knight on the dirt effect preferences. I have a couple of questions:- a) Would this work for bump and displacement mapped detail? b) Although not strictly 'dirt', but coming under the heading of 'weathering' would it be possible to use the settings on the ball at top left with a rusty colour, and the settings on the ball at top right as is, at the same time, to create a rusting dirty ball? Cheers Ian


Ajax ( ) posted Thu, 24 March 2005 at 5:49 AM

Yeah, it's something I've wanted to see in the material room for a long time :-) I like the top left too, but I think I like the bottom right just a little better. I actually only put the top right one in as a control. There's almost no dirt in it at all.


View Ajax's Gallery - View Ajax's Freestuff - View Ajax's Store - Send Ajax a message


Ajax ( ) posted Thu, 24 March 2005 at 5:59 AM

Ian, Yep, sure will work for bump and displacement :-) Basically it drives a blender, so you just blend your dirt bump against your clean surface bump. Layering dirt AND rust will make the shader more complex with a bunch more nodes so it will be more difficult to manipulate in the material room and will render slower, but it's certainly doable. In the longer term I'd like to put together some more complex shaders like that. I'm really just playing with my new toy at the moment.


View Ajax's Gallery - View Ajax's Freestuff - View Ajax's Store - Send Ajax a message


Ajax ( ) posted Thu, 24 March 2005 at 6:09 AM

file_206785.jpg

Imagine this in bronze, with verdigris instead of dirt. Yum.


View Ajax's Gallery - View Ajax's Freestuff - View Ajax's Store - Send Ajax a message


Ian Porter ( ) posted Thu, 24 March 2005 at 6:35 AM

The head looks great in pewter. Thanks for answering my questions. Can't play until my Wait-Club membership expires .... Ian


stonemason ( ) posted Thu, 24 March 2005 at 6:40 AM

Ajax..the top 2 are spot on! Cheers Stefan

Cg Society Portfolio


stewer ( ) posted Thu, 24 March 2005 at 6:56 AM

I have visions of naked Jessis in very very dirty temples... :D


Mec4D ( ) posted Thu, 24 March 2005 at 7:49 AM

Ajax, this is outstanding! thanks for sharing!! ----- stewer! lol :P

_________________________________________________________

"Surrender to what it is - Let go of what was - Have faith in what will be "


Gareee ( ) posted Thu, 24 March 2005 at 8:13 AM

can you screen cap the top right settings? That looks like it would be good for victorian ship and vehicle renders. (it'd probably look nice on the martian tripod from Daz, or the Nautilus from Daz as well...)

Way too many people take way too many things way too seriously.


Mec4D ( ) posted Thu, 24 March 2005 at 8:17 AM

the top right settings are great! I agree with you Gareee and wish Ajax can share with us the setting too ;)

_________________________________________________________

"Surrender to what it is - Let go of what was - Have faith in what will be "


bigjobbie ( ) posted Thu, 24 March 2005 at 8:21 AM

Ajax - Absolutely bloody brilliant!! I love them ALL - please please please release a "Dirt Pack"!!! Wow!!


Gareee ( ) posted Thu, 24 March 2005 at 8:38 AM

Hmm I just had a thought... if you applied negative math nodes, couldn't this be converted to some kinda of highlight lighter spots type of shader setting?

Way too many people take way too many things way too seriously.


Likos ( ) posted Thu, 24 March 2005 at 8:41 AM

Can this be used to make a brisk texture look dirty? (Each individual brick, as opposed to only the corners of the mesh) Also please post a screen cap of the settings you used for the balls. Excellent use of the node by the way. Creative use like this could eliminate the use of textures for much of the structures within a scene.


Gareee ( ) posted Thu, 24 March 2005 at 8:46 AM

Something that would be really cool in poser, would be adding the ability to "bake" these on textures, and then save those textures. It's using in lightwave all the time to create actual texture maps. Since the P6 material room is really blossoming, that would be a way to "share" the new tech with the older poser version users. Not that I think it'll happen...

Way too many people take way too many things way too seriously.


Ian Porter ( ) posted Thu, 24 March 2005 at 8:49 AM

Gareee, I agree fully on the Victorian vehicles, a particular interest of mine. Bring on the rivets, coach-bolts and leaf springs! Ian


Gareee ( ) posted Thu, 24 March 2005 at 8:51 AM

Hmmm I'm also wondering, if this was included in a toon render, if it could be used to create a "stipple" drawing effect? Animated, that might be killer!

Way too many people take way too many things way too seriously.


shogakusha ( ) posted Thu, 24 March 2005 at 8:52 AM

Ajax, s always, the master of material nodes! This is a great piece of work, thanks fo rsharing! I cannot wait until I have to stop waiting }-) Shogakusha


Gareee ( ) posted Thu, 24 March 2005 at 8:54 AM

Ah, another thought.. maybe this could be combined with the slime shader as well? I want my P6... >whine

Way too many people take way too many things way too seriously.


Mazak ( ) posted Thu, 24 March 2005 at 9:00 AM
salvius ( ) posted Thu, 24 March 2005 at 9:49 AM

Garee: "Hmm I just had a thought... if you applied negative math nodes, couldn't this be converted to some kinda of highlight lighter spots type of shader setting?" Perhaps to simulate the shiny spots on larger bronze statues, where they've been rubbed by the hands of thousands of visiting tourists...?


GWeb ( ) posted Thu, 24 March 2005 at 11:03 AM

Ajax, Yeah I wasnt interested in dirt shader. I was interested in just the AO shading that interacts the lights. Your method for dirt shader is indeed good ones. GWeb


GWeb ( ) posted Thu, 24 March 2005 at 11:07 AM

Umm after looking at images and I reviewed AO function. The AO is supposed to be sensitive to the light that may affect the dirt shading. Just thought you might like to know.


Ajax ( ) posted Thu, 24 March 2005 at 4:59 PM

file_206787.jpg

Here's a screenshot of the settings for the top right shader, as requested. Control your dirt colour with Blender 3. Control your metal colour with Blender 4. The spread of the dirt is controlled with value 2 of Math Functions 5 (up for wider dirt, down for narrower dirt). Math Functions 3 controls the roughness of the edges of the dirt. Change both values at the same time, but keep value 1 exactly 1 higher than value 2. Notice the granite node feeding into Math Functions 4? For dirt like the top left ball in post 22, feed a turbulence node into Math Functions 4 instead (leave the granite node alone for the other things it drives). You'll need to adjust the scale settings of the turbulence node when you do that. I'll answer a few questions in a mo.


View Ajax's Gallery - View Ajax's Freestuff - View Ajax's Store - Send Ajax a message


bigjobbie ( ) posted Thu, 24 March 2005 at 5:14 PM

God bless your dirty balls sir!


  • 1
  • 2

Privacy Notice

This site uses cookies to deliver the best experience. Our own cookies make user accounts and other features possible. Third-party cookies are used to display relevant ads and to analyze how Renderosity is used. By using our site, you acknowledge that you have read and understood our Terms of Service, including our Cookie Policy and our Privacy Policy.