Community
Arnold for Maya Forum
Rendering with Arnold in Maya using the MtoA plug-in.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Can you blend material based on direction?

6 REPLIES 6
SOLVED
Reply
Message 1 of 7
Anonymous
382 Views, 6 Replies

Can you blend material based on direction?

Is it possible to blend two materials based on the direction of the normals of the object?

So if you wanted a different material on the upward facing normals, like adding dust or dirt.

Another example might be if you wanted to have a material where the sun has faded the top of the surface.


I'm only really asking about how you would create the mask for the blend, not the material itself.


I thought there would be a way to do it using State Vector, normal but I cant work it out and there may be an easier way?


Thanks

Tags (1)
Labels (1)
6 REPLIES 6
Message 2 of 7
CiroCardoso3v
in reply to: Anonymous

Have a look at this


https://docs.arnoldrenderer.com/pages/viewpage.action?pageId=86806266

Lead Enviroment Artist @Axis Studios

Arnold Discord Server


Ciro Cardoso

EESignature

Message 3 of 7
Anonymous
in reply to: CiroCardoso3v

Thanks!

I cant believe I didn't see all those tutorials in the docs

Message 4 of 7
CiroCardoso3v
in reply to: Anonymous

No worries man. Glad to help

Lead Enviroment Artist @Axis Studios

Arnold Discord Server


Ciro Cardoso

EESignature

Message 5 of 7
madsd
in reply to: Anonymous

You can also use this shader I wrote in OSL.
It also works in the viewport.

shader SnowMask
(
    float Power  = 4.0
    [[
        float min =0.03,
        float max = 100.
    ]],
    float Slope = 0.5
    [[
        float min =  0.0,
        float max = 0.9999999
    ]],        
    output color Out = 1.0
)
{
    Out = pow((N[2] - Slope) / .5, 1.0 / Power);
}


Here is an example.
I use the Snowmask shader to dictate the normals that gets pushed through, and exposed a Slope and Power float set so the angles can get manipulated with a noise, as well as power can be noised up.

I then run an OSL curvature node in as a mask for the normal mask, and subtract the area beneath the statues dress, near the foot in the right side.
This returns a more realistic top/down scenario with occlusion as part of the equation.
You can then let the occlusion only work on 1 axis, 2 or all 3, depending on what you need.
This is the same as piping a vector into the Offset of the Arnold AO node, directional AO.

8391-qweqwe.gif

Message 6 of 7
lee_griggs
in reply to: Anonymous

MAXtoA version.

Lee Griggs
Arnold rendering specialist
AUTODESK
Message 7 of 7
Anonymous
in reply to: madsd

thats fantastic, thank you!

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report