Edge outlines? (toon shader, wireframe or something?)

Started by Darth Vader, December 27, 2015, 03:14:45 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Darth Vader

How can you make any material with edge outlines like with toon shader, but only the outlines? Skin or metal with outlines?
I couldn't find a way to mix the skin material with the toon material's outlines.  :(


Greg Polymerou


timb

Thanks for the reply.  I have used that tutorial.  I just thought it would be easier to work with the Toon material options in a lot of cases (edge widths, etc.)

Darth Vader

I am the one who commented in that video, because you can't achieve any material mixed with outlines for now  :'(

Esben Oxholm

Although it would be nice to be able to do this within KeyShot, it is pretty fast to do in Photoshop.
You just do a rendering with the normal materials and a rendering with the toon shader. For the toon shader it is important that everything but the outline is completely white. Then, in photoshop, you layer the toon rendering on top of the material rendering and set the blend mode for the toon layer to 'multiply'.

This is how I created the attached image using your screenshots, Darth.
Maybe you already know all this... if not, let me know if you need a more clear explanation :)

Best,

Darth Vader

Thanks for the suggestion :) I haven't thought of mixing them in PS and it worked fine, but the idea was to achieve the effect with KS. I've received a reply from someone on the above youtube video - "This would require the Wireframe or Toon shaders to be available as textures. Currently they aren't. I can see how this would be useful. I will talk to development." So i guess it's not possible for now.

Darth Vader

#6
I have an even bigger crisis now :'( When I import a model with a transparent texture I can't apply a material with textures like cloth or pretty much anything :( For example - a dot with transparent background on a cube - I can't apply any material on that cube that has textures. I tried using the label option, but the texture looks bad as if it's is glued on and not part of the model. This is the problem - https://www.keyshot.com/forum/index.php?topic=11781.0

bdesign

Here is a technique you may find helpful:

Apply a Toon material as a label over your base material. Set the Toon material Color to black. Connect an Color To Number node into the Toon Opacity. Set the "Output From" value to .01. Connect another Color To Number node into the Toon Contour Color. For a "black" outline, set the "Output From" value to around -100. For a "white" outline, set the "Output From" value to around +100. Experiment with the values to get some varying degrees of dark and light contours. You can also get some cool effects by texture mapping the Contour Color and Contour Width parameters. Here is a quick example render with outlines on Advanced, Dielectric, and Translucent materials.
Eric

maruska

@bddesign: does your Color to Number technique still work in current versions of Keyshot? I get a very odd result - with the toon outline some how just creating a inverted color value rather than a black outline...

bdesign

Hello maruska-

Yes, the technique still works. I think perhaps in your example, the Color To Number node plugged in to the Contour Color may not be set to a low enough negative value, but not sure since you didn't post screen shots of your settings.  I'm attaching the .ksp file for you to check out. Hope it helps.

Eric

maruska

Hmmm. I get the same result with your file.

It seems your trick is exploiting a floating-point error, and I wonder if there is a difference between Mac's and PC's in interpreting the math - although 0.01 * 100 seems pretty straightforward enough.

J.

maruska

Ok - I did some tests with the Toon Outlines file and it does indeed work - however - the viewport (realtime) image and even the render preview (offline render) don't match the file that's actually written to disk. So I guess I just need to ignore the previews and just let the render finish...