POV-Ray : Newsgroups : povray.general : shading model : Re: shading model Server Time
6 Aug 2024 16:58:29 EDT (-0400)
  Re: shading model  
From: Christopher James Huff
Date: 19 Feb 2002 01:44:09
Message: <chrishuff-4FAD0A.01435419022002@netplex.aussie.org>
In article <3c71e677$1@news.povray.org>,
 "John Bradshaw" <joh### [at] nospamhotmailcom> wrote:

> Is there a way to modify the povray shading model without digging into the
> source code (which I don't have for 3.5 anyway)?

Not really. You could possibly do it with functions: make separate red, 
green, and blue functions, and use them as patterns for pigments in an 
average pigment:
pigment {average
    pigment_map {
        [1 redFn color_map {[0 rgb 0][1 red 3]}]
        [1 greenFn color_map {[0 rgb 0][1 green 3]}]
        [1 blueFn color_map {[0 rgb 0][1 blue 3]}]
    }
}
Use a finish with diffuse 0 and ambient 1, and do all your calculations 
in those functions...very awkward for complex stuff though, especially 
since you only have the intersection point available, you have to figure 
out the other information yourself.


> I want to modify amount of lighting based on the angle between the camera
> incidence ray and the normal vector of points in the mesh. My goal is to
> create a scanning electron microscope look: bright edges (where the angle
> between viewing ray and normal vector is larger) and a duller center (where
> the angle is smaller).

Put a light with negative intensity at the camera position, and give a 
bright ambient to the texture. You might need to mess around with the 
brilliance to fine-tune it.

#declare CamPos = < 0, 0,-5>;

camera {
    location CamPos
}

light_source {CamPos, color rgb -0.9}

sphere {< 0, 0, 0>, 1
    texture {
        pigment {color rgb 1}
        finish {ambient 1 brilliance 2}
    }
}

-- 
Christopher James Huff <chr### [at] maccom>
POV-Ray TAG e-mail: chr### [at] tagpovrayorg
TAG web site: http://tag.povray.org/


Post a reply to this message

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