Author Topic: Edge outlines? (toon shader, wireframe or something?)  (Read 14651 times)

0 Members and 1 Guest are viewing this topic.

Offline Darth Vader

  • Newbie
  • *
  • Posts: 7
Edge outlines? (toon shader, wireframe or something?)
« 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.  :(


Offline Greg Polymerou

  • Newbie
  • *
  • Posts: 13
Re: Edge outlines? (toon shader, wireframe or something?)
« Reply #1 on: January 04, 2016, 06:43:56 am »
Try doing it with Occlusion Texture Node

Use this video as your guide.

Offline timb

  • Newbie
  • *
  • Posts: 33
Re: Edge outlines? (toon shader, wireframe or something?)
« Reply #2 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.)

Offline Darth Vader

  • Newbie
  • *
  • Posts: 7
Re: Edge outlines? (toon shader, wireframe or something?)
« Reply #3 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  :'(

Offline Esben Oxholm

  • KeyShot Beta
  • Hero Member
  • *****
  • Posts: 1667
  • esbenoxholm.dk/keyshot-video-course
    • Freelance CG Artist
Re: Edge outlines? (toon shader, wireframe or something?)
« Reply #4 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,

Offline Darth Vader

  • Newbie
  • *
  • Posts: 7
Re: Edge outlines? (toon shader, wireframe or something?)
« Reply #5 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.

Offline Darth Vader

  • Newbie
  • *
  • Posts: 7
Re: Edge outlines? (toon shader, wireframe or something?)
« Reply #6 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
« Last Edit: January 06, 2016, 08:50:28 am by Darth Vader »

Offline bdesign

  • Hero Member
  • *****
  • Posts: 795
Re: Edge outlines? (toon shader, wireframe or something?)
« Reply #7 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

Offline maruska

  • Newbie
  • *
  • Posts: 4
Re: Edge outlines? (toon shader, wireframe or something?)
« Reply #8 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...

Offline bdesign

  • Hero Member
  • *****
  • Posts: 795
Re: Edge outlines? (toon shader, wireframe or something?)
« Reply #9 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

Offline maruska

  • Newbie
  • *
  • Posts: 4
Re: Edge outlines? (toon shader, wireframe or something?)
« Reply #10 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.

Offline maruska

  • Newbie
  • *
  • Posts: 4
Re: Edge outlines? (toon shader, wireframe or something?)
« Reply #11 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...