Community
Arnold for Cinema 4D Forum
Rendering with Arnold in CINEMA 4D using the C4DtoA plug-in.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Toon edge width decrease over distance?

7 REPLIES 7
Reply
Message 1 of 8
shawn
1136 Views, 7 Replies

Toon edge width decrease over distance?

I'm looking to create a simple line art-style animation using the Toon material. The manual says:

"The Width Scale can be used to control the Edge depending on the distance from the camera" but doesn't actually explain how one would do that.

So how can I make the lines get thinner as they get farther from the camera?

I generally do this sort of thing with the basic Sketch and Toon as I have more options regarding line style, animating strokes, etc, but the models I'm dealing with have a ton of parts and edges and take forever to calculate using S&T.

Thank you.

Shawn Marshall

7 REPLIES 7
Message 2 of 8
lee_griggs
in reply to: shawn
Message 3 of 8
shawn
in reply to: shawn

Thanks for taking the time to reply. I did find that thread before posting this question here, but when I read:

"You can use an aiStateFloat set to Rl. This gives you the distance from the camera to the shading point. Add one with aiAdd and take the reciprocal with aiReciprocal, thus taking the linear distance input and applying the function 1/(x+1)."

my eyes glazed over. Sketch and Toon has a simple checkbox and parameters for decreasing line width; I was hope Arnold's implementation would have a similar, simple interface. I guess not.

Message 4 of 8
madsd
in reply to: shawn

Use this node diagram.

Ri -> reciprocal -> range -> add -> width.

You can see the tea pot in the distance has thinner Contour lines since the width is biased from the Z-Depth pass the Ri node produces.

Open GID fullscreen, to read node names, you have the exact same nodes in C4D, so should not cause any problems to follow along.

4562-3333.gif

Message 5 of 8
nwoolridge
in reply to: shawn

@Shawn Marshall Here's an R20 C4D file with the nodes set up. You will need to adjust the range output max and the overall line thickness in render settings to suit your scene scale... arnold-toon-line-thickness-scale-with-distancec4d.zip

Message 6 of 8
shawn
in reply to: shawn

Thanks so much for the replies and sample files; I appreciate it.

Message 7 of 8
Max_Dalla
in reply to: shawn

Thanks a lot for the file! .... if I wanted to add noise to the lines is there a way to apply it?
Message 8 of 8
lee_griggs
in reply to: shawn

https://www.youtube.com/watch?v=9tQ9whQPQ_A

Lee Griggs
Arnold rendering specialist
AUTODESK

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

Post to forums  

Autodesk Design & Make Report