Community
Arnold General Rendering Forum
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Trailing edges on Toon lines

17 REPLIES 17
SOLVED
Reply
Message 1 of 18
maruska
1853 Views, 17 Replies

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.

8036-toon-trailingedges.png

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


Tags (1)
Labels (1)
17 REPLIES 17
Message 2 of 18
ramon.montoya
in reply to: maruska

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.


Message 3 of 18
lee_griggs
in reply to: maruska

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

Lee Griggs
Arnold rendering specialist
AUTODESK
Message 4 of 18
maruska
in reply to: lee_griggs

8066-arnold-toon-anglethresholds.jpg


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.

Message 5 of 18
maruska
in reply to: ramon.montoya

8067-screen-shot-2020-09-03-at-51905-pm.png

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

Message 6 of 18
lee_griggs
in reply to: maruska

Maybe mesh->remesh/retopologise could help?

8068-1599201192458.png


Lee Griggs
Arnold rendering specialist
AUTODESK
Message 7 of 18
maruska
in reply to: maruska

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.


8078-screen-shot-2020-09-04-at-83856-am.png8080-screen-shot-2020-09-04-at-83828-am.png



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.8081-screen-shot-2020-09-04-at-84407-am.png



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.8083-screen-shot-2020-09-04-at-85252-am.png

Message 8 of 18
CiroCardoso3v
in reply to: maruska

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.

Lead Enviroment Artist @Axis Studios

Arnold Discord Server


Ciro Cardoso

EESignature

Message 9 of 18
maruska
in reply to: CiroCardoso3v

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.

Message 10 of 18
maruska
in reply to: maruska

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

Message 11 of 18
lee_griggs
in reply to: maruska

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

Lee Griggs
Arnold rendering specialist
AUTODESK
Message 12 of 18
maruska
in reply to: lee_griggs

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

ToonTool_example.mb.zip

Message 13 of 18
lee_griggs
in reply to: maruska

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

8150-1600066986991.png

Lee Griggs
Arnold rendering specialist
AUTODESK
Message 14 of 18
maruska
in reply to: lee_griggs

Darn it. That’s cheating. Ha.

Message 15 of 18
maruska
in reply to: maruska

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.


8197-screen-shot-2020-09-17-at-85852-pm.png8196-screen-shot-2020-09-17-at-85508-pm.png

Message 16 of 18
maruska
in reply to: maruska

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!


8198-screen-shot-2020-09-17-at-92611-pm.png

Message 17 of 18
lee_griggs
in reply to: maruska

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

Lee Griggs
Arnold rendering specialist
AUTODESK
Message 18 of 18
thiago.ize
in reply to: maruska

The just released Arnold 7.2.4 (and associated plugins) now properly finds these edges. https://arnoldrenderer.com/download/

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

Post to forums  

Autodesk Design & Make Report