Toon material

Started by mikejb, January 01, 2021, 10:23:30 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

mikejb

Not sure if there's a way to do this within Keyshot (v9), but here goes!

If I apply the Toon material to an object, is there a way to render just the contour lines and ignore any material or colours? For example, the attached image shows a light blue cube with the Toon material added, showing black contour lines. How (if possible) can I render out just the contour lines with a transparent background? I'm using a simple cube as an example. My other images will be quite a bit more complicated.

Edit: I don't need to render the hidden lines.

Anindo Ghosh

The "Toon Transparent Black" material does this.

However, if the surfaces are transparent, the back edges will show through, whether you want the hidden lines or not.

mikejb

#2
Thank you for your reply. Unfortunately having the contour lines showing through would be a big problem with the type of objects I'm using, and I'd need 100% transparency as well.

I should mention that I can make the Toon material completely transparent by using the Toon "fill" material and then turning the transparency slider for my material down to zero, but as mentioned above, this causes the hidden contour lines to show, which I don't want. I suppose a quick fix would be to have my material set to a solid colour with black contour lines, render that out and then use Photoshop to key out the solid colour, but this isn't an ideal way I don't think.

I appreciate your help all the same. :)

Anindo Ghosh

One thing I am unable to understand:
If a given material has 100% transparency, how would the "hidden" lines remain hidden? They have to be hidden by something, after all.

mikejb

Yes, that would make perfect sense in the real world, I agree. :)

Let's, for example say that you had a nice model of a computer keyboard, and as well as the nice realistic render of the keyboard you wanted to outline it and all the keys etc. with a black contour line. Well, using the Toon material in Keyshot would definitely outline it the way that you want, but it would also turn your nice model into a flat toon-like image! So, my thought was that you could render the keyboard model as normal, and then after that apply the Toon material and extract the contour lines to overlay onto the original "proper" render.

TGS808

I don't think you're going to be able to do what you want solely in KeyShot in a single image. You're going to have to render out two versions and put them together in Photoshop but you don't have to worry about keying out any solid colors. Just render your realistic version, then your toon version. For your toon version, set all your outlines to black, all your fills to white and turn off the shadows (including ground shadows). In Photoshop place the toon image over the realistic version and set the toon layer blend mode to Multiply. That will knock out all the white, leaving you with only the black outlines over your real version. You can then use the opacity slider on that layer to make the lines lighter depending on the look you want.

mikejb

Perfect! Thank you very much.


Quote from: TGS808 on January 02, 2021, 04:40:00 PM
I don't think you're going to be able to do what you want solely in KeyShot in a single image. You're going to have to render out two versions and put them together in Photoshop but you don't have to worry about keying out any solid colors. Just render your realistic version, then your toon version. For your toon version, set all your outlines to black, all your fills to white and turn off the shadows (including ground shadows). In Photoshop place the toon image over the realistic version and set the toon layer blend mode to Multiply. That will knock out all the white, leaving you with only the black outlines over your real version. You can then use the opacity slider on that layer to make the lines lighter depending on the look you want.

Anindo Ghosh

1. For the compositing option, to prevent the hidden toon lines, you would have to switch off the "Interior Edge Contour" in the toon controls, Advanced section.

2. For more control over the "toon lines" and no compositing required, the Curvature texture will enable any material, such as the yellow emissive in my example, to be used for the "toon lines". For regular toon-like toon lines, a black Flat material would work.

bdesign

Hi mikejb-

The Contour Texture will add an edge detail to your parts, similar to the Toon material, but applied to any material.

Cheers,
Eric

INNEO_MWo

What about this?

mikejb

Thanks everyone for the excellent help and advice. I've now got more options than I can poke a stick at!

TGS808

I stand corrected. That is was by Eric comes as little surprise.  :D His method works perfectly and should give you the results you want inside of KS. I completely forgot about the contour texture that was added. D'oh!

DriesV

Yes, a Label with Contour-textured opacity will allow to overlay Toon-style contours onto any material type that accepts Labels.
Look for the 'Contour' materials in the Material Library. These are already set up to be used as Labels, in order to show overlay contours.

Below is an example where the 'Contour Emissive Blue' material from the Library was dragged into the Labels list of the grey plastic material.

Dries