POV-Ray : Newsgroups : povray.advanced-users : Toon rendering Server Time
25 Nov 2024 12:55:00 EST (-0500)
  Toon rendering (Message 1 to 5 of 5)  
From: nhytro
Subject: Toon rendering
Date: 10 Dec 2002 15:51:28
Message: <3df653d0@news.povray.org>
Hello! is there a way to do toon rendering and DOF with POV-ray?


thanks


Post a reply to this message

From: Jide
Subject: Re: Toon rendering
Date: 10 Dec 2002 16:59:53
Message: <3df663d9@news.povray.org>
nhytro wrote:
> Hello! is there a way to do toon rendering and DOF with POV-ray?
>
>
> thanks

With 3.5 there is no easy way of doing toon rendering that I know of but I
believe some people have done it, hopefully they'll see this and answer. I
assume focal blur is the same effect as DOF in some other packages. Check
section 6.4.3 in the docs.

-Jide


Post a reply to this message

From: T J Viking
Subject: Re: Toon rendering
Date: 11 Dec 2002 02:55:07
Message: <3df6ef5b@news.povray.org>
#version 3.5;

#include "colors.inc"

global_settings {
  assumed_gamma 1.0
}                  


#declare cam_loc=<0.0, 0.5, -8.0>;
#declare cam_target=<0.0, 0.0,  0.0>;
#declare cam_dir=cam_target-cam_loc;




// ----------------------------------------

camera {
  location  cam_loc
  direction 1.5*z
  right     x*image_width/image_height
  look_at   cam_target
}

sky_sphere {
  pigment {
    gradient y
    color_map {
      [0.0 rgb <0.6,0.7,1.0>]
      [0.7 rgb <0.0,0.1,0.8>]
    }
  }
}

light_source {
  <0, 0, 0>            // light's position (translated below)
  color rgb <1, 1, 1>  // light's color
  translate <-30, 30, -30>
}

// ----------------------------------------

plane {
  y, -1
  pigment { color rgb <0.7,0.5,0.3> }
}



#macro
cartoon_texture(edge,edge_color,base_color,light_hardness,light_ambience,obj_center)

  texture {
    pigment {
      slope obj_center-cam_loc
      color_map {
        [0.00 color rgb base_color ]
        [0.5-edge-0.01 color rgb base_color ]       
        [0.5-edge color rgb edge_color ]       
        [0.5+edge color rgb edge_color ]
        [0.5+edge+0.01 color rgb base_color ]
        [1.00 color rgb base_color ]
      }
    }
    finish{
      specular 0 ambient light_ambience diffuse 1 brilliance 1-light_hardness
    }
  }


#end


sphere {
  0.0, 1
  cartoon_texture(0.12,<0,0,0>,<1,0.5,0>,0.8,0.2,<0,0,0>)
  
  
}


blob {
  threshold .65
  sphere { <.5,0,0>, .8, 1 }
  sphere { <-.5,0,0>,.8, 1 }
  sphere { <0,0.5,-0.5>,.8, 1 }
  sphere { <0,-0.5,-0.5>,.8, 1 }

  
  rotate y*30
  translate  -2*z//use translate, rotate etc before applying texture!!!!
  translate  -x


  cartoon_texture(0.12,<0,0,0>,<1,0.5,1>,0.8,0.2,<-1,0,-2>) // we put there
transformed center!!

  
 
}

// as you can see.... the sharp objects render not properly.... just
// because the tangent of the surface is constant... got no idea how to cope with it
box { <2,-1,-3>,<4,1,-1>

  cartoon_texture(0.146,<0,0,0>,<0.5,1,0.5>,0.8,0.2,(<2,-1,-3>+<4,1,-1>)/2) 
}


Post a reply to this message

From: user
Subject: Re: Toon rendering
Date: 11 Dec 2002 14:13:34
Message: <3df78e5e$1@news.povray.org>
This great!! thanks for your help




T.J.Viking wrote:

> #version 3.5;
>
> #include "colors.inc"
>
> global_settings {
>   assumed_gamma 1.0
> }
>
>
> #declare cam_loc=<0.0, 0.5, -8.0>;
> #declare cam_target=<0.0, 0.0,  0.0>;
> #declare cam_dir=cam_target-cam_loc;
>
>
>
>
> // ----------------------------------------
>
> camera {
>   location  cam_loc
>   direction 1.5*z
>   right     x*image_width/image_height
>   look_at   cam_target
> }
>
> sky_sphere {
>   pigment {
>     gradient y
>     color_map {
>       [0.0 rgb <0.6,0.7,1.0>]
>       [0.7 rgb <0.0,0.1,0.8>]
>     }
>   }
> }
>
> light_source {
>   <0, 0, 0>            // light's position (translated below)
>   color rgb <1, 1, 1>  // light's color
>   translate <-30, 30, -30>
> }
>
> // ----------------------------------------
>
> plane {
>   y, -1
>   pigment { color rgb <0.7,0.5,0.3> }
> }
>
>
>
> #macro 
> cartoon_texture(edge,edge_color,base_color,light_hardness,light_ambience,obj_center)
>
>   texture {
>     pigment {
>       slope obj_center-cam_loc
>       color_map {
>         [0.00 color rgb base_color ]
>         [0.5-edge-0.01 color rgb base_color ]
>         [0.5-edge color rgb edge_color ]
>         [0.5+edge color rgb edge_color ]
>         [0.5+edge+0.01 color rgb base_color ]
>         [1.00 color rgb base_color ]
>       }
>     }
>     finish{
>       specular 0 ambient light_ambience diffuse 1 brilliance 
> 1-light_hardness
>     }
>   }
>
>
> #end
>
>
> sphere {
>   0.0, 1
>   cartoon_texture(0.12,<0,0,0>,<1,0.5,0>,0.8,0.2,<0,0,0>)
>
>
> }
>
>
> blob {
>   threshold .65
>   sphere { <.5,0,0>, .8, 1 }
>   sphere { <-.5,0,0>,.8, 1 }
>   sphere { <0,0.5,-0.5>,.8, 1 }
>   sphere { <0,-0.5,-0.5>,.8, 1 }
>
>
>   rotate y*30
>   translate  -2*z//use translate, rotate etc before applying texture!!!!
>   translate  -x
>
>
>   cartoon_texture(0.12,<0,0,0>,<1,0.5,1>,0.8,0.2,<-1,0,-2>) // we put 
> there transformed center!!
>
>
>
> }
>
> // as you can see.... the sharp objects render not properly.... just
> // because the tangent of the surface is constant... got no idea how 
> to cope with it
> box { <2,-1,-3>,<4,1,-1>
>
>  
> cartoon_texture(0.146,<0,0,0>,<0.5,1,0.5>,0.8,0.2,(<2,-1,-3>+<4,1,-1>)/2)
> }
>


Post a reply to this message

From: Doctor John
Subject: Re: Toon rendering
Date: 12 Dec 2002 09:40:03
Message: <web.3df89f1ad211930b29393de0@news.povray.org>
user wrote:
>This great!! thanks for your help
>
Oi! Stop top-posting

John
--

Run Fast
Run Free
Run Linux


Post a reply to this message

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