POV-Ray : Newsgroups : povray.binaries.animations : cel shading texture : Re: cel shading texture Server Time
2 Nov 2024 09:20:51 EDT (-0400)
  Re: cel shading texture  
From: Batronyx
Date: 4 Apr 2002 22:51:47
Message: <3cad1f53@news.povray.org>
"Artis" <art### [at] aaaapollolv> wrote in message
news:3C9### [at] aaaapollolv...
> Just a little experiment with cel shading. Does anyone has an idea how
> to make outlines?
>

In 3.5 you can use the slope texture as the top layer in a layered texture
statement:

 texture{
   pigment {
      slope {vnormalize( CamLoc - PosVect)}
      color_map{
         [0 color Clear]
         [0.374 color Clear]
         [0.375 color Black]
         [0.625 color Black]
         [0.626 color Clear]
         [1.0 color Clear]
      }
   }

   finish {ambient 0.0}
 }

The trick is in the orientation vector statement. You can control the thickness
by reducing the amount of black in the middle of the color_map. This still has
its limitations though. For example, if there is any transparency in the object,
you get a stripe in the shadows where the black is. In some cases you might be
able to work around this by faking the shadow with an object pattern.

Also, it doesn't work great for certain orientations of objects having constant
slope (boxes, planes, etc.). These objects tend to be ideal candidates for Tek's
suggestion though.

Finally, too much perspective in the camera will also ruin the effect. So,
either use long-ish distance vectors in your camera statement, or small angle
values, or just use orthographic.

^"^


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.