question

Joshua Maruska avatar image
Joshua Maruska asked ·

Trailing edges on Toon lines

I tend to render technical objects that have a lot of parallel faces, but are at different "depths". Most of my data is coming from CAD, has no UV's, and the topology typically is pretty awful by DCC standards.


When rendering toon-line images, anywhere there is a trailing edge of a surface that is coplanar with another surface, Arnold Toon will skip that toon line. This omission tends to drop a lot of detail that otherwise should be represented.


Any depth-pass or normal-pass tricks to get these conditions to render? I'm rendering in Maya (MtoA), but I'm guessing tricks from any platform would help.


I think a similar question has been asked here...

https://answers.arnoldrenderer.com/questions/14378/toon-contour-lines-based-on-depth.html


Cheers,

Joshua


toon
10 |600 characters needed characters left characters exceeded

Up to 5 attachments (including images) can be used with a maximum of 2.0 MiB each and 9.8 MiB total.

Joshua Maruska avatar image
Joshua Maruska answered ·

I think this is the answer. I need to stress test it a bit, but piping a aiCurvature node into Mask_Color did the trick.



2 comments Share
10 |600 characters needed characters left characters exceeded

Up to 5 attachments (including images) can be used with a maximum of 2.0 MiB each and 9.8 MiB total.

Going back to the original model, it does seem to work as I would like it to. I am using a couple different Toon shader instances to control when and where edges appear - such as the honeycomb pattern in the lower right where having everything outlined made the image very busy. Nice to have options!


1 Like 1 · ·
Lee Griggs avatar image Lee Griggs Joshua Maruska ·

Nice trick! Glad you got it to work in the end.

1 Like 1 · ·
Joshua Maruska avatar image
Joshua Maruska answered ·

@Lee Griggs do you have any more ideas on this use case?

4 comments Share
10 |600 characters needed characters left characters exceeded

Up to 5 attachments (including images) can be used with a maximum of 2.0 MiB each and 9.8 MiB total.

Can you upload the geo somewhere so that I can have a play with it?

0 Likes 0 · ·

@Lee Griggs Sure thing. Here is the Maya file with both test objects.

ToonTool_example.mb.zip

0 Likes 0 · ·
Lee Griggs avatar image Lee Griggs Joshua Maruska ·

Sorry, I could only fix the right issue by separating the cubes.

0 Likes 0 · ·
1600066986991.png (123.2 KiB)
Show more comments
Joshua Maruska avatar image
Joshua Maruska answered ·

I don't think it's a topology issue. This was modeled in Maya - just a cube and some offset extruded faces. Same condition though - the top faces are parallel so the back edge disappears.




For giggles, here is a similar model - but two cubes on top of one another. They have been combined into one body so they share the same Toon ID (not typical of my models, but just to make a point). Both top faces are a single quad.



And as another example. This is the same Maya model where I took the top inner face and rotated it out of plane by 0.1º. The back edge appears because the two faces are no longer parallel - again, not a real world scenario, as I often have parallel faces.


2 comments Share
10 |600 characters needed characters left characters exceeded

Up to 5 attachments (including images) can be used with a maximum of 2.0 MiB each and 9.8 MiB total.

Have you tried tweaking the UV threshold? I found that values between 0.1 and 0.2 adds some extra lines that can be useful.

1 Like 1 · ·

That didn't seem to do anything. Maybe because there are no UV's on the model? I think that's what Ramon Montoya Vozmediano was looking at with the uv_transform.offset.x to length shader hook-up to pipe screen space information into the UV system.

0 Likes 0 · ·
Lee Griggs avatar image
Lee Griggs answered ·

Does reducing the angle_threshold or changing the edge_detection to geometric_normal help at all?

2 comments Share
10 |600 characters needed characters left characters exceeded

Up to 5 attachments (including images) can be used with a maximum of 2.0 MiB each and 9.8 MiB total.


No difference between edge detection modes. I did a quick multi-frame output with the angle threshold keyed from 0º to 180º. Even at zero, the trailing edge of both the protruding cylinder and the square are missing.


I'm guessing the CAD data is dense enough that the edge mode makes little difference as these models don't typically play smoothing tricks found in a usual DCC model.

0 Likes 0 · ·

Maybe mesh->remesh/retopologise could help?


0 Likes 0 · ·
1599201192458.png (7.0 KiB)
Ramon Montoya Vozmediano avatar image
Ramon Montoya Vozmediano answered ·

You are right, toon does not use depth to detect edges. We will look into adding that feature.

In the meantime, if you are not using UVS, you could

1) use a uv_transform shader as the root for your shading tree
2) pipe the uv_transform.offset.x to a length shader, whose length.input points to the camera position


With that setup the toon shader will see distance to current camera (i.e. depth) as U, and you can use uv_threshold to control where edges are inserted.


1 comment Share
10 |600 characters needed characters left characters exceeded

Up to 5 attachments (including images) can be used with a maximum of 2.0 MiB each and 9.8 MiB total.

Did I do this right? It still looks the same. (This is with a 15º angle threshold)

0 Likes 0 · ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 5 attachments (including images) can be used with a maximum of 2.0 MiB each and 9.8 MiB total.

Welcome to the Arnold Answers community.

This is the place for Arnold renderer users everywhere to ask and answer rendering questions, and share knowledge about using Arnold, Arnold plugins, workflows and developing tools with Arnold.

If you are a new user to Arnold Answers, please first check out our FAQ and User Guide for more information.

When posting questions, please be sure to select the appropriate Space for your Arnold plugin and include the plugin version you are using.

Please include images, scene and log files whenever possible as this helps the community answer your questions.

Instructions for generating full verbosity log files are available for MtoA, MaxtoA, C4DtoA, HtoA, KtoA, and Kick.

If you are looking for Arnold Documentation and Support please visit the Arnold Support site.

To try Arnold please visit the Arnold Trial page.

Bottom No panel present for this section.