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
Solved! Go to Solution.
Solved by maruska. Go to Solution.
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.
Does reducing the angle_threshold or changing the edge_detection to geometric_normal help at all?
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.
Did I do this right? It still looks the same. (This is with a 15º angle threshold)
Maybe mesh->remesh/retopologise could help?
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.
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.
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.
Can you upload the geo somewhere so that I can have a play with it?
Sorry, I could only fix the right issue by separating the cubes.
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.
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!
Nice trick! Glad you got it to work in the end.
The just released Arnold 7.2.4 (and associated plugins) now properly finds these edges. https://arnoldrenderer.com/download/