KeyShot Forum

Technical discussions => Materials => Topic started by: Darth Vader on December 27, 2015, 03:14:45 AM

Title: Edge outlines? (toon shader, wireframe or something?)
Post by: Darth Vader on December 27, 2015, 03:14:45 AM
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.  :(

(http://s18.postimg.org/fzs3qzdxz/Untitledkey.png)
Title: Re: Edge outlines? (toon shader, wireframe or something?)
Post by: Greg Polymerou on January 04, 2016, 06:43:56 AM
Try doing it with Occlusion Texture Node

Use this video as your guide.
https://www.youtube.com/watch?v=5umbUNOT6HI
Title: Re: Edge outlines? (toon shader, wireframe or something?)
Post by: timb on January 04, 2016, 08:59:09 AM
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.)
Title: Re: Edge outlines? (toon shader, wireframe or something?)
Post by: Darth Vader on January 04, 2016, 09:31:21 AM
I am the one who commented in that video, because you can't achieve any material mixed with outlines for now  :'(
Title: Re: Edge outlines? (toon shader, wireframe or something?)
Post by: Esben Oxholm on January 05, 2016, 05:34:32 AM
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,
Title: Re: Edge outlines? (toon shader, wireframe or something?)
Post by: Darth Vader on January 05, 2016, 07:12:02 AM
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.
Title: Re: Edge outlines? (toon shader, wireframe or something?)
Post by: Darth Vader on January 05, 2016, 07:21:07 AM
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
Title: Re: Edge outlines? (toon shader, wireframe or something?)
Post by: bdesign on March 29, 2016, 11:30:51 AM
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
Title: Re: Edge outlines? (toon shader, wireframe or something?)
Post by: maruska on July 27, 2016, 09:05:37 AM
@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...
Title: Re: Edge outlines? (toon shader, wireframe or something?)
Post by: bdesign on July 27, 2016, 10:48:35 AM
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
Title: Re: Edge outlines? (toon shader, wireframe or something?)
Post by: maruska on July 27, 2016, 12:43:06 PM
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.
Title: Re: Edge outlines? (toon shader, wireframe or something?)
Post by: maruska on July 29, 2016, 11:32:52 AM
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...