POV-Ray : Newsgroups : povray.newusers : Lighting Server Time
11 Oct 2026 17:58:14 EDT (-0400)
  Lighting (Message 1 to 28 of 28)  
From: Felbrigg
Subject: Lighting
Date: 4 Feb 2004 05:52:32
Message: <4020cef0$1@news.povray.org>
Can anyone give me pointers for lighting.  If I want to light an object on a
tabletop, is there a quick way of getting a realistic sunlight on it.  I've
tried making my light source yellowish ( the suns yellow/orange isnt it )
but I still end up with artificial looking lighting.


Post a reply to this message

From: Warp
Subject: Re: Lighting
Date: 4 Feb 2004 06:11:59
Message: <4020d37f@news.povray.org>
Felbrigg <som### [at] microsoftcom> wrote:
> Can anyone give me pointers for lighting.  If I want to light an object on a
> tabletop, is there a quick way of getting a realistic sunlight on it.  I've
> tried making my light source yellowish ( the suns yellow/orange isnt it )
> but I still end up with artificial looking lighting.

  That's because sunlight is white.

  What do you mean by "realistic sunlight" other than a white light source
far away (or using parallel light)?

-- 
#macro M(A,N,D,L)plane{-z,-9pigment{mandel L*9translate N color_map{[0rgb x]
[1rgb 9]}scale<D,D*3D>*1e3}rotate y*A*8}#end M(-3<1.206434.28623>70,7)M(
-1<.7438.1795>1,20)M(1<.77595.13699>30,20)M(3<.75923.07145>80,99)// - Warp -


Post a reply to this message

From: Felbrigg
Subject: Re: Lighting
Date: 4 Feb 2004 06:25:51
Message: <4020d6bf$1@news.povray.org>
The problem with my question is that I dont know what to ask for!  My
tabletop scenes always seem rather flat and boring,  I was wondering if
there is a quick piece of pov code for a decent light source.  I've tried
area lights which give me a nice penumbra.

Is there a common light source object out there somewhere that many people
use in tabletop scenes that I dont know about?


"Warp" <war### [at] tagpovrayorg> wrote in message
news:4020d37f@news.povray.org...
> Felbrigg <som### [at] microsoftcom> wrote:
> > Can anyone give me pointers for lighting.  If I want to light an object
on a
> > tabletop, is there a quick way of getting a realistic sunlight on it.
I've
> > tried making my light source yellowish ( the suns yellow/orange isnt
it )
> > but I still end up with artificial looking lighting.
>
>   That's because sunlight is white.
>
>   What do you mean by "realistic sunlight" other than a white light source
> far away (or using parallel light)?
>
> -- 
> #macro M(A,N,D,L)plane{-z,-9pigment{mandel L*9translate N color_map{[0rgb
x]
> [1rgb 9]}scale<D,D*3D>*1e3}rotate y*A*8}#end M(-3<1.206434.28623>70,7)M(
> -1<.7438.1795>1,20)M(1<.77595.13699>30,20)M(3<.75923.07145>80,99)// -
Warp -


Post a reply to this message

From: Warp
Subject: Re: Lighting
Date: 4 Feb 2004 08:18:00
Message: <4020f108@news.povray.org>
Felbrigg <som### [at] microsoftcom> wrote:
> The problem with my question is that I dont know what to ask for!  My
> tabletop scenes always seem rather flat and boring,  I was wondering if
> there is a quick piece of pov code for a decent light source.  I've tried
> area lights which give me a nice penumbra.

  Making your light source an area light certainly adds realism to the
scene when used well.

  If you want more realistic lighting you are probably looking for
radiosity. Be warned, though, that depending on the scene you might
get a good-looking radiosity right away or (most often than not)
you'll be fine-tuning the radiosity settings for hours and days
before you get something decent.

  Lighting is not, however, the only (nor even the most important) thing
that affects the realism of a scene. Textures (all its components,
pigment, finish and normal) are a very important part of making a
scene look realistic. Often a single texture alone can make an enormous
difference all the way from plastic CG-looking image to a photorealistic
one.
  I recommend that you practice making good-looking textures.

  (Focal blur is one feature which sometimes adds surprising amounts
of photorealism to a scene... Not always, though.)

-- 
#macro N(D)#if(D>99)cylinder{M()#local D=div(D,104);M().5,2pigment{rgb M()}}
N(D)#end#end#macro M()<mod(D,13)-6mod(div(D,13)8)-3,10>#end blob{
N(11117333955)N(4254934330)N(3900569407)N(7382340)N(3358)N(970)}//  - Warp -


Post a reply to this message

From: Dan P
Subject: Re: Lighting
Date: 4 Feb 2004 11:04:15
Message: <402117ff$1@news.povray.org>
Also, I find that using multiple light sources can go along way. Throw a
bright, shadowless indigo light at a different location (color rgb <0.8,
0.9, 1> for example) and it will add a lot of depth. In reality, there is
rarely only one light source and you don't always need radiosity to get a
realistic effect. Look at a book cover once: often, you'll see that one side
of the face is lit with a yellowish light and the other side is light with
an indigo/cyan light. It makes a really neat effect.

If you're willing, we're interested in seeing your work if you post it on a
site and helping you out that way too. There are lots of tricks of light
(pun intended) that can turn a blah scene into something amazing.


Post a reply to this message

From: Felbrigg
Subject: Re: Lighting
Date: 4 Feb 2004 11:29:46
Message: <40211dfa$1@news.povray.org>
I've already posted a couple of images in the binaries.images section namely
"Cactus halo" and "Rain Drops" but if you would like to help me out, look
there for one I've just posted called "Spilled Liquid" (Source included)
This is an example of an almost but never quite right table top image.  If
you can give me some tips on how to improve it, adjusting the lighting etc I
would be very grateful.

Thanks.


"Dan P" <dan### [at] yahoocom> wrote in message
news:402117ff$1@news.povray.org...
> Also, I find that using multiple light sources can go along way. Throw a
> bright, shadowless indigo light at a different location (color rgb <0.8,
> 0.9, 1> for example) and it will add a lot of depth. In reality, there is
> rarely only one light source and you don't always need radiosity to get a
> realistic effect. Look at a book cover once: often, you'll see that one
side
> of the face is lit with a yellowish light and the other side is light with
> an indigo/cyan light. It makes a really neat effect.
>
> If you're willing, we're interested in seeing your work if you post it on
a
> site and helping you out that way too. There are lots of tricks of light
> (pun intended) that can turn a blah scene into something amazing.
>
>


Post a reply to this message

From: Dan P
Subject: Re: Lighting
Date: 4 Feb 2004 13:56:22
Message: <40214056@news.povray.org>
"Felbrigg" <som### [at] microsoftcom> wrote in message
news:40211dfa$1@news.povray.org...
> I've already posted a couple of images in the binaries.images section
namely
> "Cactus halo" and "Rain Drops" but if you would like to help me out, look
> there for one I've just posted called "Spilled Liquid" (Source included)
> This is an example of an almost but never quite right table top image.  If
> you can give me some tips on how to improve it, adjusting the lighting etc
I
> would be very grateful.

No problem! I'll download those tonight when I get home (I'm at work right
now). I look forward to seeing your efforts!!!


Post a reply to this message

From: Dan P
Subject: Re: Lighting
Date: 4 Feb 2004 21:02:15
Message: <4021a427$1@news.povray.org>
"Dan P" <dan### [at] yahoocom> wrote in message
news:40214056@news.povray.org...
> "Felbrigg" <som### [at] microsoftcom> wrote in message
> news:40211dfa$1@news.povray.org...
> > I've already posted a couple of images in the binaries.images section
> namely
> > "Cactus halo" and "Rain Drops" but if you would like to help me out,
look
> > there for one I've just posted called "Spilled Liquid" (Source included)
> > This is an example of an almost but never quite right table top image.
If
> > you can give me some tips on how to improve it, adjusting the lighting
etc
> I
> > would be very grateful.
>
> No problem! I'll download those tonight when I get home (I'm at work right
> now). I look forward to seeing your efforts!!!

NICE JOB, Felbrigg!  JC had a good point about the background too. When we
have things that are reflective, we need something to reflect to make it
more intresting and make it stand out a bit. Another, different colored
light source in front and to the right gives it that extra something that
brings it alive (modified example follows):

#include "colors.inc"
#include "textures.inc"
#include "shapes.inc"


#declare SnakeWood =
texture {  /* Bottom wood-grain layer */
    pigment {
        wood
        turbulence 0.05
        color_map {
            [0.00 rgb <0.58, 0.45, 0.23>]
            [0.34 rgb <0.65, 0.45, 0.25>]
            [0.40 rgb <0.33, 0.23, 0.13>]
            [0.47 rgb <0.60, 0.40, 0.20>]
            [1.00 rgb <0.25, 0.15, 0.05>]
        }
    }
    finish {
        crand 0.02
        //ambient 0.32
        diffuse 0.63
        phong 0.2
        phong_size 10
    }
    normal { bumps 0.05 }
}
texture {     /* top layer, adds small dark spots */
    pigment {
        bozo
        color_map {
            [0.0 rgbt <1.00, 1.00, 1.00, 1.00>]
            [0.8 rgbt <1.00, 0.90, 0.80, 0.80>]
            [1.0 rgbt <0.30, 0.20, 0.10, 0.40>]
        }
    scale 0.25
    }
}


// New stuff -- DAP
light_source
{
  <60, 20, -50>
  color rgb <0.2, 0.25, 0.3>
  shadowless
}

sky_sphere
{
 pigment
 {
  wrinkles

  color_map
  {
   [0, rgb <0, 0, 0> ]
   [1, rgb <0.7, 0.6, 0.5> ]
  }

  scale <0.1, 0.1, 0.1>
 }
}






light_source {<-20, 20, 0> color White area_light  <5, 0, 0>, <0, 0, 5>, 11,
11 adaptive 1 jitter photons { refraction on reflection on } }

camera  {
        location <0,10,-25> look_at <0,0,0>
       }

//background { Black }//color <0.25,0.35,0.80> }
box     {
        <-1,-1,-1>,
        <1,1,1>
        texture {
                pigment { Red }
                }
        scale <2,2,2>
        rotate <0,-15,0>
        translate <2,1,10>
        }
box     {
        <-1,-1,-1>,
        <1,1,1>
        texture {
                pigment { Red }
                }
        scale <2,2,2>
        rotate <0,-16,0>
        translate <2,1,-9>
        }
cylinder{
        <-1,-1,-1>,
        <1,1,1>,
        1
        texture {
                pigment { White*2 }
                }
        scale <1,5,1>
        translate <-7,3,0>
        }

plane   { <0, 1, 0>, -0.001
        texture { SnakeWood }//pigment { checker pigment{Red},
pigment{White} } scale <10,10,10> rotate <0,43,0>}
        }

#declare Point1 = <-10,1,10>;
#declare Point2 = <-10,1,0>;
#declare Point3 = <-10,1,-10>;
#declare Point4 = <0,1,-10>;
#declare Point5 = <10,1,-10>;
#declare Point6 = <15,1,2>;     //<10,1,0>;
#declare Point7 = <10,1,2>;    //<10,1,10>;
#declare Point8 = <0,1,10>;
#declare Point9 = <-14,1,12>; //<-10,1,10>;
#declare Point10 = <-10,1,0>;
#declare Point11 = <-10,1,-10>;

merge {
// outside of the puddle
sphere_sweep {
        cubic_spline
        11,
        Point1,1
        Point2,1
        Point3,1
        Point4,1
        Point5,1
        Point6,1
        Point7,1
        Point8,1
        Point9,1
        Point10,1
        Point11,1
        }

// inside of the puddle
prism {
    cubic_spline
    0, // sweep the following shape from here ...
    2, // ... up through here
    11, // the number of points making up the shape ...
        <Point1.x,Point1.z>,
        <Point2.x,Point2.z>,
        <Point3.x,Point3.z>,
        <Point4.x,Point4.z>,
        <Point5.x,Point5.z>,
        <Point6.x,Point6.z>,
        <Point7.x,Point7.z>,
        <Point8.x,Point8.z>,
        <Point9.x,Point9.z>,
        <Point10.x,Point10.z>,
        <Point11.x,Point11.z>
  }

        hollow
        texture {
                pigment {
                        Clear // rgbt <0.858824,0.576471,0.439216>
                        }
                finish  {
                        reflection { 0.1,0.8 }
                        }
                }
        interior        {
                        ior Water_Ior
                        }
        translate <0,-1.5,0>

 }


Post a reply to this message

From: Dan P
Subject: Re: Lighting
Date: 4 Feb 2004 21:04:05
Message: <4021a495$1@news.povray.org>
I just noticed on more thing that I think helps too: Adding a specular
highlight to the water. Sometimes, just using specular highlights instead of
reflections can make some interesting stuff. Here is the new code:

#include "colors.inc"
#include "textures.inc"
#include "shapes.inc"


#declare SnakeWood =
texture {  /* Bottom wood-grain layer */
    pigment {
        wood
        turbulence 0.05
        color_map {
            [0.00 rgb <0.58, 0.45, 0.23>]
            [0.34 rgb <0.65, 0.45, 0.25>]
            [0.40 rgb <0.33, 0.23, 0.13>]
            [0.47 rgb <0.60, 0.40, 0.20>]
            [1.00 rgb <0.25, 0.15, 0.05>]
        }
    }
    finish {
        crand 0.02
        //ambient 0.32
        diffuse 0.63
        phong 0.2
        phong_size 10
    }
    normal { bumps 0.05 }
}
texture {     /* top layer, adds small dark spots */
    pigment {
        bozo
        color_map {
            [0.0 rgbt <1.00, 1.00, 1.00, 1.00>]
            [0.8 rgbt <1.00, 0.90, 0.80, 0.80>]
            [1.0 rgbt <0.30, 0.20, 0.10, 0.40>]
        }
    scale 0.25
    }
}


// New stuff -- DAP
light_source
{
  <60, 20, -50>
  color rgb <0.2, 0.25, 0.3>
  shadowless
}

sky_sphere
{
 pigment
 {
  wrinkles

  color_map
  {
   [0, rgb <0, 0, 0> ]
   [1, rgb <0.7, 0.6, 0.5> ]
  }

  scale <0.1, 0.1, 0.1>
 }
}






light_source {<-20, 20, 0> color White area_light  <5, 0, 0>, <0, 0, 5>, 11,
11 adaptive 1 jitter photons { refraction on reflection on } }

camera  {
        location <0,10,-25> look_at <0,0,0>
       }

//background { Black }//color <0.25,0.35,0.80> }
box     {
        <-1,-1,-1>,
        <1,1,1>
        texture {
                pigment { Red }
                }
        scale <2,2,2>
        rotate <0,-15,0>
        translate <2,1,10>
        }
box     {
        <-1,-1,-1>,
        <1,1,1>
        texture {
                pigment { Red }
                }
        scale <2,2,2>
        rotate <0,-16,0>
        translate <2,1,-9>
        }
cylinder{
        <-1,-1,-1>,
        <1,1,1>,
        1
        texture {
                pigment { White*2 }
                }
        scale <1,5,1>
        translate <-7,3,0>
        }

plane   { <0, 1, 0>, -0.001
        texture { SnakeWood }//pigment { checker pigment{Red},
pigment{White} } scale <10,10,10> rotate <0,43,0>}
        }

#declare Point1 = <-10,1,10>;
#declare Point2 = <-10,1,0>;
#declare Point3 = <-10,1,-10>;
#declare Point4 = <0,1,-10>;
#declare Point5 = <10,1,-10>;
#declare Point6 = <15,1,2>;     //<10,1,0>;
#declare Point7 = <10,1,2>;    //<10,1,10>;
#declare Point8 = <0,1,10>;
#declare Point9 = <-14,1,12>; //<-10,1,10>;
#declare Point10 = <-10,1,0>;
#declare Point11 = <-10,1,-10>;

merge {
// outside of the puddle
sphere_sweep {
        cubic_spline
        11,
        Point1,1
        Point2,1
        Point3,1
        Point4,1
        Point5,1
        Point6,1
        Point7,1
        Point8,1
        Point9,1
        Point10,1
        Point11,1
        }

// inside of the puddle
prism {
    cubic_spline
    0, // sweep the following shape from here ...
    2, // ... up through here
    11, // the number of points making up the shape ...
        <Point1.x,Point1.z>,
        <Point2.x,Point2.z>,
        <Point3.x,Point3.z>,
        <Point4.x,Point4.z>,
        <Point5.x,Point5.z>,
        <Point6.x,Point6.z>,
        <Point7.x,Point7.z>,
        <Point8.x,Point8.z>,
        <Point9.x,Point9.z>,
        <Point10.x,Point10.z>,
        <Point11.x,Point11.z>
  }

        hollow
        texture {
                pigment {
                        Clear // rgbt <0.858824,0.576471,0.439216>
                        }
                finish  {
                        reflection { 0.1,0.8 }
                        specular 0.5
                        }
                }
        interior        {
                        ior Water_Ior
                        }
        translate <0,-1.5,0>

 }


Post a reply to this message

From: Dan P
Subject: Re: Lighting
Date: 4 Feb 2004 21:53:42
Message: <4021b036$1@news.povray.org>
This kinda gives you the coffee look you were asking about. I dunno, I think
it still kinda looks like gravy though.
Mmmmmn, gravy.


#include "colors.inc"
#include "textures.inc"
#include "shapes.inc"


#declare SnakeWood =
texture {  /* Bottom wood-grain layer */
    pigment {
        wood
        turbulence 0.05
        color_map {
            [0.00 rgb <0.58, 0.45, 0.23>]
            [0.34 rgb <0.65, 0.45, 0.25>]
            [0.40 rgb <0.33, 0.23, 0.13>]
            [0.47 rgb <0.60, 0.40, 0.20>]
            [1.00 rgb <0.25, 0.15, 0.05>]
        }
    }
    finish {
        crand 0.02
        //ambient 0.32
        diffuse 0.63
        phong 0.2
        phong_size 10
    }
    normal { bumps 0.05 }
}
texture {     /* top layer, adds small dark spots */
    pigment {
        bozo
        color_map {
            [0.0 rgbt <1.00, 1.00, 1.00, 1.00>]
            [0.8 rgbt <1.00, 0.90, 0.80, 0.80>]
            [1.0 rgbt <0.30, 0.20, 0.10, 0.40>]
        }
    scale 0.25
    }
}


// New stuff -- DAP
light_source
{
  <60, 20, -50>
  color rgb <0.2, 0.25, 0.3>
  shadowless
}

sky_sphere
{
 pigment
 {
  wrinkles

  color_map
  {
   [0, rgb <0, 0, 0> ]
   [1, rgb <0.7, 0.6, 0.5> ]
  }

  scale <0.1, 0.1, 0.1>
 }
}






light_source {<-20, 20, 0> color White area_light  <5, 0, 0>, <0, 0, 5>, 11,
11 adaptive 1 jitter photons { refraction on reflection on } }

camera  {
        location <0,10,-25> look_at <0,0,0>
       }

//background { Black }//color <0.25,0.35,0.80> }
box     {
        <-1,-1,-1>,
        <1,1,1>
        texture {
                pigment { Red }
                }
        scale <2,2,2>
        rotate <0,-15,0>
        translate <2,1,10>
        }
box     {
        <-1,-1,-1>,
        <1,1,1>
        texture {
                pigment { Red }
                }
        scale <2,2,2>
        rotate <0,-16,0>
        translate <2,1,-9>
        }
cylinder{
        <-1,-1,-1>,
        <1,1,1>,
        1
        texture {
                pigment { White*2 }
                }
        scale <1,5,1>
        translate <-7,3,0>
        }

plane   { <0, 1, 0>, -0.001
        texture { SnakeWood }//pigment { checker pigment{Red},
pigment{White} } scale <10,10,10> rotate <0,43,0>}
        }

#declare Point1 = <-10,1,10>;
#declare Point2 = <-10,1,0>;
#declare Point3 = <-10,1,-10>;
#declare Point4 = <0,1,-10>;
#declare Point5 = <10,1,-10>;
#declare Point6 = <15,1,2>;     //<10,1,0>;
#declare Point7 = <10,1,2>;    //<10,1,10>;
#declare Point8 = <0,1,10>;
#declare Point9 = <-14,1,12>; //<-10,1,10>;
#declare Point10 = <-10,1,0>;
#declare Point11 = <-10,1,-10>;

merge {
// outside of the puddle
sphere_sweep {
        cubic_spline
        11,
        Point1,1
        Point2,1
        Point3,1
        Point4,1
        Point5,1
        Point6,1
        Point7,1
        Point8,1
        Point9,1
        Point10,1
        Point11,1
        }

// inside of the puddle
prism {
    cubic_spline
    0, // sweep the following shape from here ...
    2, // ... up through here
    11, // the number of points making up the shape ...
        <Point1.x,Point1.z>,
        <Point2.x,Point2.z>,
        <Point3.x,Point3.z>,
        <Point4.x,Point4.z>,
        <Point5.x,Point5.z>,
        <Point6.x,Point6.z>,
        <Point7.x,Point7.z>,
        <Point8.x,Point8.z>,
        <Point9.x,Point9.z>,
        <Point10.x,Point10.z>,
        <Point11.x,Point11.z>
  }

        hollow
        texture {
                pigment {
                 rgbft <0.2, 0.16, 0, 0.8, 0.3>
                        //Clear // rgbt <0.858824,0.576471,0.439216>
                        }
                finish  {
                        reflection { 0.1,0.9 }
                        specular 0.5
                        }
                }
        interior        {
                        ior Water_Ior
                        }
        translate <0,-1.5,0>

 }


Post a reply to this message

From: Dan P
Subject: Re: Lighting
Date: 4 Feb 2004 21:58:08
Message: <4021b140$1@news.povray.org>
Oh, and I forgot about the table too! A little reflection there and a little
specular highlight and BAM (to steal from Emeril)!

#include "colors.inc"
#include "textures.inc"
#include "shapes.inc"


#declare SnakeWood =
texture {  /* Bottom wood-grain layer */
    pigment {
        wood
        turbulence 0.05
        color_map {
            [0.00 rgb <0.58, 0.45, 0.23>]
            [0.34 rgb <0.65, 0.45, 0.25>]
            [0.40 rgb <0.33, 0.23, 0.13>]
            [0.47 rgb <0.60, 0.40, 0.20>]
            [1.00 rgb <0.25, 0.15, 0.05>]
        }
    }
    finish {
        crand 0.02
        //ambient 0.32
        diffuse 0.63
        phong 0.2
        phong_size 10
    }
    normal { bumps 0.05 }
}
texture {     /* top layer, adds small dark spots */
    pigment {
        bozo
        color_map {
            [0.0 rgbt <1.00, 1.00, 1.00, 1.00>]
            [0.8 rgbt <1.00, 0.90, 0.80, 0.80>]
            [1.0 rgbt <0.30, 0.20, 0.10, 0.40>]
        }
    scale 0.25
    }
}


// New stuff -- DAP
light_source
{
  <60, 20, -50>
  color rgb <0.2, 0.25, 0.3>
  shadowless
}

sky_sphere
{
 pigment
 {
  wrinkles

  color_map
  {
   [0, rgb <0, 0, 0> ]
   [1, rgb <0.7, 0.6, 0.5> ]
  }

  scale <0.1, 0.1, 0.1>
 }
}






light_source {<-20, 20, 0> color White area_light  <5, 0, 0>, <0, 0, 5>, 11,
11 adaptive 1 jitter photons { refraction on reflection on } }

camera  {
        location <0,10,-25> look_at <0,0,0>
       }

//background { Black }//color <0.25,0.35,0.80> }
box     {
        <-1,-1,-1>,
        <1,1,1>
        texture {
                pigment { Red }
                }
        scale <2,2,2>
        rotate <0,-15,0>
        translate <2,1,10>
        }
box     {
        <-1,-1,-1>,
        <1,1,1>
        texture {
                pigment { Red }
                }
        scale <2,2,2>
        rotate <0,-16,0>
        translate <2,1,-9>
        }
cylinder{
        <-1,-1,-1>,
        <1,1,1>,
        1
        texture {
                pigment { White*2 }
                }
        scale <1,5,1>
        translate <-7,3,0>
        }

plane   { <0, 1, 0>, -0.001
        texture { SnakeWood }//pigment { checker pigment{Red},
pigment{White} } scale <10,10,10> rotate <0,43,0>}
        finish { specular 0.3 reflection 0.15 }
        }

#declare Point1 = <-10,1,10>;
#declare Point2 = <-10,1,0>;
#declare Point3 = <-10,1,-10>;
#declare Point4 = <0,1,-10>;
#declare Point5 = <10,1,-10>;
#declare Point6 = <15,1,2>;     //<10,1,0>;
#declare Point7 = <10,1,2>;    //<10,1,10>;
#declare Point8 = <0,1,10>;
#declare Point9 = <-14,1,12>; //<-10,1,10>;
#declare Point10 = <-10,1,0>;
#declare Point11 = <-10,1,-10>;

merge {
// outside of the puddle
sphere_sweep {
        cubic_spline
        11,
        Point1,1
        Point2,1
        Point3,1
        Point4,1
        Point5,1
        Point6,1
        Point7,1
        Point8,1
        Point9,1
        Point10,1
        Point11,1
        }

// inside of the puddle
prism {
    cubic_spline
    0, // sweep the following shape from here ...
    2, // ... up through here
    11, // the number of points making up the shape ...
        <Point1.x,Point1.z>,
        <Point2.x,Point2.z>,
        <Point3.x,Point3.z>,
        <Point4.x,Point4.z>,
        <Point5.x,Point5.z>,
        <Point6.x,Point6.z>,
        <Point7.x,Point7.z>,
        <Point8.x,Point8.z>,
        <Point9.x,Point9.z>,
        <Point10.x,Point10.z>,
        <Point11.x,Point11.z>
  }

        hollow
        texture {
                pigment {
                 rgbft <0.2, 0.16, 0, 0.8, 0.3>
                        //Clear // rgbt <0.858824,0.576471,0.439216>
                        }
                finish  {
                        reflection { 0.1,0.9 }
                        specular 0.5
                        }
                }
        interior        {
                        ior Water_Ior
                        }
        translate <0,-1.5,0>

 }


Post a reply to this message

From: Phil Cook
Subject: Re: Lighting
Date: 5 Feb 2004 06:20:00
Message: <opr2v9spm2p4ukzs@news.povray.org>
On Wed, 4 Feb 2004 16:34:56 -0000, Felbrigg <som### [at] microsoftcom> wrote:

> I've already posted a couple of images in the binaries.images section 
> namely
> "Cactus halo" and "Rain Drops" but if you would like to help me out, look
> there for one I've just posted called "Spilled Liquid" (Source included)
> This is an example of an almost but never quite right table top image.  
> If
> you can give me some tips on how to improve it, adjusting the lighting 
> etc I
> would be very grateful.
>
> Thanks.
>
>
> "Dan P" <dan### [at] yahoocom> wrote in message
> news:402117ff$1@news.povray.org...
>> Also, I find that using multiple light sources can go along way. Throw a
>> bright, shadowless indigo light at a different location (color rgb <0.8,
>> 0.9, 1> for example) and it will add a lot of depth. In reality, there 
>> is
>> rarely only one light source and you don't always need radiosity to get 
>> a
>> realistic effect. Look at a book cover once: often, you'll see that one
> side
>> of the face is lit with a yellowish light and the other side is light 
>> with
>> an indigo/cyan light. It makes a really neat effect.
>>
>> If you're willing, we're interested in seeing your work if you post it 
>> on
> a
>> site and helping you out that way too. There are lots of tricks of light
>> (pun intended) that can turn a blah scene into something amazing.

If you are still interested google "three point lighting"

http://www.3drender.com/light/3point.html

This link's quite basic but still worth a look at, more advanced stuff is 
also available on google

Hope it's of use to you.

--
Phil

-- 
All thoughts and comments are my own unless otherwise stated and I am 
happy to be proven wrong.


Post a reply to this message

From: Stephen McAvoy
Subject: Re: Lighting
Date: 5 Feb 2004 06:55:54
Message: <mpb420h1n2f5c13n3f0k9u9liqsephasdu@4ax.com>
On Wed, 4 Feb 2004 16:34:56 -0000, "Felbrigg" <som### [at] microsoftcom> wrote:

> If you can give me some tips on how to improve it, adjusting the lighting etc I
>would be very grateful.

Interesting reading here. Again basic but that is what you need to start out
with. 

http://www.cybercollege.com/indexall.htm

Lighting starts here
http://www.cybercollege.com/tvp027.htm


Regards
        Stephen


Post a reply to this message

From: Felbrigg
Subject: Re: Lighting
Date: 5 Feb 2004 07:14:42
Message: <402233b2$1@news.povray.org>
Where to begin?

The second coloured light, had me foxed at first, I couldn't see the
difference until I opened "before" and "after" side by side in paint shop.
It does improove the scene - Good Tip.

Specular highlighting, hmm,  rendered it despite my misgivings and at first
I thought I was right and you were wrong, again, side by side in Paint shop
and WOW, it is better, you were right.  It gives better definition to the
spill, allowing the liquids edge to look truely curved.

Coffee colouring, nice.  I'd tried rgbf and rgbt but you hit me with a new
one there, rgbft, again WOW.

Reflection and specular on the table, didn't see that one coming.  Took me a
while to see a difference, It seems to have made the light source have a
sharper definition on the table top.  Is that it?  Can you give me any
pointers as to why you suggested this, what am I missing?

I'm struggling with this lighting stuff,  so much of it seems
counter-intuitive to me.  Your pointers have been really eye - opening.
Thanks very much.

P.S. I see from your other posts your a 'C' man.  Scary stuff, the nearest
I've got to that is C# what I call "the laymans C".  Do you know if it
possible to use C# to fire off PovRay like (i think) Moray does.  I've often
thought about writing a Win32 app to automate some animation experiments,
thus freeing me from the clock and frames constraints.


"Dan P" <dan### [at] yahoocom> wrote in message
news:4021b140$1@news.povray.org...
> Oh, and I forgot about the table too! A little reflection there and a
little
> specular highlight and BAM (to steal from Emeril)!
>
> #include "colors.inc"
> #include "textures.inc"
> #include "shapes.inc"
>
>
> #declare SnakeWood =
> texture {  /* Bottom wood-grain layer */
>     pigment {
>         wood
>         turbulence 0.05
>         color_map {
>             [0.00 rgb <0.58, 0.45, 0.23>]
>             [0.34 rgb <0.65, 0.45, 0.25>]
>             [0.40 rgb <0.33, 0.23, 0.13>]
>             [0.47 rgb <0.60, 0.40, 0.20>]
>             [1.00 rgb <0.25, 0.15, 0.05>]
>         }
>     }
>     finish {
>         crand 0.02
>         //ambient 0.32
>         diffuse 0.63
>         phong 0.2
>         phong_size 10
>     }
>     normal { bumps 0.05 }
> }
> texture {     /* top layer, adds small dark spots */
>     pigment {
>         bozo
>         color_map {
>             [0.0 rgbt <1.00, 1.00, 1.00, 1.00>]
>             [0.8 rgbt <1.00, 0.90, 0.80, 0.80>]
>             [1.0 rgbt <0.30, 0.20, 0.10, 0.40>]
>         }
>     scale 0.25
>     }
> }
>
>
> // New stuff -- DAP
> light_source
> {
>   <60, 20, -50>
>   color rgb <0.2, 0.25, 0.3>
>   shadowless
> }
>
> sky_sphere
> {
>  pigment
>  {
>   wrinkles
>
>   color_map
>   {
>    [0, rgb <0, 0, 0> ]
>    [1, rgb <0.7, 0.6, 0.5> ]
>   }
>
>   scale <0.1, 0.1, 0.1>
>  }
> }
>
>
>
>
>
>
> light_source {<-20, 20, 0> color White area_light  <5, 0, 0>, <0, 0, 5>,
11,
> 11 adaptive 1 jitter photons { refraction on reflection on } }
>
> camera  {
>         location <0,10,-25> look_at <0,0,0>
>        }
>
> //background { Black }//color <0.25,0.35,0.80> }
> box     {
>         <-1,-1,-1>,
>         <1,1,1>
>         texture {
>                 pigment { Red }
>                 }
>         scale <2,2,2>
>         rotate <0,-15,0>
>         translate <2,1,10>
>         }
> box     {
>         <-1,-1,-1>,
>         <1,1,1>
>         texture {
>                 pigment { Red }
>                 }
>         scale <2,2,2>
>         rotate <0,-16,0>
>         translate <2,1,-9>
>         }
> cylinder{
>         <-1,-1,-1>,
>         <1,1,1>,
>         1
>         texture {
>                 pigment { White*2 }
>                 }
>         scale <1,5,1>
>         translate <-7,3,0>
>         }
>
> plane   { <0, 1, 0>, -0.001
>         texture { SnakeWood }//pigment { checker pigment{Red},
> pigment{White} } scale <10,10,10> rotate <0,43,0>}
>         finish { specular 0.3 reflection 0.15 }
>         }
>
> #declare Point1 = <-10,1,10>;
> #declare Point2 = <-10,1,0>;
> #declare Point3 = <-10,1,-10>;
> #declare Point4 = <0,1,-10>;
> #declare Point5 = <10,1,-10>;
> #declare Point6 = <15,1,2>;     //<10,1,0>;
> #declare Point7 = <10,1,2>;    //<10,1,10>;
> #declare Point8 = <0,1,10>;
> #declare Point9 = <-14,1,12>; //<-10,1,10>;
> #declare Point10 = <-10,1,0>;
> #declare Point11 = <-10,1,-10>;
>
> merge {
> // outside of the puddle
> sphere_sweep {
>         cubic_spline
>         11,
>         Point1,1
>         Point2,1
>         Point3,1
>         Point4,1
>         Point5,1
>         Point6,1
>         Point7,1
>         Point8,1
>         Point9,1
>         Point10,1
>         Point11,1
>         }
>
> // inside of the puddle
> prism {
>     cubic_spline
>     0, // sweep the following shape from here ...
>     2, // ... up through here
>     11, // the number of points making up the shape ...
>         <Point1.x,Point1.z>,
>         <Point2.x,Point2.z>,
>         <Point3.x,Point3.z>,
>         <Point4.x,Point4.z>,
>         <Point5.x,Point5.z>,
>         <Point6.x,Point6.z>,
>         <Point7.x,Point7.z>,
>         <Point8.x,Point8.z>,
>         <Point9.x,Point9.z>,
>         <Point10.x,Point10.z>,
>         <Point11.x,Point11.z>
>   }
>
>         hollow
>         texture {
>                 pigment {
>                  rgbft <0.2, 0.16, 0, 0.8, 0.3>
>                         //Clear // rgbt <0.858824,0.576471,0.439216>
>                         }
>                 finish  {
>                         reflection { 0.1,0.9 }
>                         specular 0.5
>                         }
>                 }
>         interior        {
>                         ior Water_Ior
>                         }
>         translate <0,-1.5,0>
>
>  }
>
>


Post a reply to this message

From: Christopher James Huff
Subject: Re: Lighting
Date: 5 Feb 2004 09:05:48
Message: <cjameshuff-B435B0.09055805022004@news.povray.org>
In article <402233b2$1@news.povray.org>,
 "Felbrigg" <som### [at] microsoftcom> wrote:

> The second coloured light, had me foxed at first, I couldn't see the
> difference until I opened "before" and "after" side by side in paint shop.

You'll learn to see this kind of thing more easily...just takes time and 
practice. Before long you won't be able to stop. YKYBRTTLW...


> Coffee colouring, nice.  I'd tried rgbf and rgbt but you hit me with a new
> one there, rgbft, again WOW.

Bad advice, IMO. The most realistic method that I've found is to use an 
entirely transparent texture (a pigment with rgbf 1), and media or 
interior attenuation for coloring. A colored transparent texture is like 
a thin film covering the coffee, but this simulates color throughout the 
body of the coffee.

-- 
Christopher James Huff <cja### [at] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: <chr### [at] tagpovrayorg>
http://tag.povray.org/


Post a reply to this message

From: Dan P
Subject: Re: Lighting
Date: 6 Feb 2004 00:01:17
Message: <40231f9d$1@news.povray.org>
"Felbrigg" <som### [at] microsoftcom> wrote in message
news:402233b2$1@news.povray.org...
> Where to begin?
>
> The second coloured light, had me foxed at first, I couldn't see the
> difference until I opened "before" and "after" side by side in paint shop.
> It does improove the scene - Good Tip.

Thanks :-)

> Specular highlighting, hmm,  rendered it despite my misgivings and at
first
> I thought I was right and you were wrong, again, side by side in Paint
shop
> and WOW, it is better, you were right.  It gives better definition to the
> spill, allowing the liquids edge to look truely curved.

The higher the specular value, the more defined the highlight becomes.

> Coffee colouring, nice.  I'd tried rgbf and rgbt but you hit me with a new
> one there, rgbft, again WOW.
>
> Reflection and specular on the table, didn't see that one coming.  Took me
a
> while to see a difference, It seems to have made the light source have a
> sharper definition on the table top.  Is that it?  Can you give me any
> pointers as to why you suggested this, what am I missing?

It added a highlight to the table. The trick is that it makes the surface
look less uniform.

> I'm struggling with this lighting stuff,  so much of it seems
> counter-intuitive to me.  Your pointers have been really eye - opening.
> Thanks very much.

No problem! :-)

> P.S. I see from your other posts your a 'C' man.  Scary stuff, the nearest
> I've got to that is C# what I call "the laymans C".  Do you know if it
> possible to use C# to fire off PovRay like (i think) Moray does.  I've
often
> thought about writing a Win32 app to automate some animation experiments,
> thus freeing me from the clock and frames constraints.

Sure, you can fire off POV-ray with pretty much any language -- it's just a
matter of running pvengine.exe. My job allows me to do a lot of different
programming languages so I get a really different perspective sometimes.

I'm glad I was able to help and I really liked that scene! It would be the
perfect scene for a tutorial too.


Post a reply to this message

From: Dan P
Subject: Re: Lighting
Date: 6 Feb 2004 00:05:47
Message: <402320ab$1@news.povray.org>
"Christopher James Huff" <cja### [at] earthlinknet> wrote in message
news:cjameshuff-B435B0.09055805022004@news.povray.org...
>
> Bad advice, IMO. The most realistic method that I've found is to use an
> entirely transparent texture (a pigment with rgbf 1), and media or
> interior attenuation for coloring. A colored transparent texture is like
> a thin film covering the coffee, but this simulates color throughout the
> body of the coffee.

Thanks for the tip! It makes sense to make the actual liquid itself the
color and not just the skin around the outside. The reason I did it that way
was for speed, really; I find interior media to really slow down my
renderings and I like to do a lot of animation with motion blurs so I throw
out a lot of frames. However, for a still-shot, I think Chris is definitely
right here -- it'll make the light interact with the coffee better.


Post a reply to this message

From: Christopher James Huff
Subject: Re: Lighting
Date: 6 Feb 2004 10:27:27
Message: <cjameshuff-5E6769.10274006022004@news.povray.org>
In article <402320ab$1@news.povray.org>,
 "Dan P" <dan### [at] yahoocom> wrote:

> Thanks for the tip! It makes sense to make the actual liquid itself the
> color and not just the skin around the outside. The reason I did it that way
> was for speed, really; I find interior media to really slow down my
> renderings and I like to do a lot of animation with motion blurs so I throw
> out a lot of frames. However, for a still-shot, I think Chris is definitely
> right here -- it'll make the light interact with the coffee better.

Absorbing media will have a much lesser impact on speed than scattering 
media, especially when there's no variation in density to sample. And 
interior attenuation is very fast, because it never has to handle 
variable density and can use a much simpler method to compute the 
attenuation.

-- 
Christopher James Huff <cja### [at] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: <chr### [at] tagpovrayorg>
http://tag.povray.org/


Post a reply to this message

From: Christopher James Huff
Subject: Re: Lighting
Date: 6 Feb 2004 10:36:27
Message: <cjameshuff-886A52.10363906022004@news.povray.org>
In article <40231f9d$1@news.povray.org>,
 "Dan P" <dan### [at] yahoocom> wrote:

> The higher the specular value, the more defined the highlight becomes.

The higher the specular value, the brighter it becomes, specular 1 
giving full brightness at the brightest points of the highlight. The 
"roughness" parameter controls the "sharpness" of the highlight...small 
values will give a more hard, highly polished look.

-- 
Christopher James Huff <cja### [at] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: <chr### [at] tagpovrayorg>
http://tag.povray.org/


Post a reply to this message

From: Dan P
Subject: Re: Lighting
Date: 6 Feb 2004 11:15:52
Message: <4023bdb8@news.povray.org>
"Christopher James Huff" <cja### [at] earthlinknet> wrote in message
news:cjameshuff-5E6769.10274006022004@news.povray.org...
> In article <402320ab$1@news.povray.org>,
>  "Dan P" <dan### [at] yahoocom> wrote:
>
> Absorbing media will have a much lesser impact on speed than scattering
> media, especially when there's no variation in density to sample. And
> interior attenuation is very fast, because it never has to handle
> variable density and can use a much simpler method to compute the
> attenuation.

Oh, I see what you mean. I was basing that perception on scattering media,
not absorbing media. I'm really glad I've been reading these newsgroups -- 
it's been having a very positive impact on my scenes. Thanks, Chris!!!


Post a reply to this message

From: Mike Raiford
Subject: Re: Lighting
Date: 6 Feb 2004 11:29:08
Message: <4023c0d4$1@news.povray.org>
"Dan P" <dan### [at] yahoocom> wrote in message
news:4021b140$1@news.povray.org...

>         phong 0.2
>         phong_size 10

I've noticed some people use phong, while others use specular. I've always
been one to use specular, because it's more "accurate", but I've noticed
some of the best scenes tend to use phong.

What do people prefer and why?


Post a reply to this message

From: Felbrigg
Subject: Re: Lighting
Date: 6 Feb 2004 11:34:08
Message: <4023c200$1@news.povray.org>
I've hit the end on this scene now.  Not the end of learning by a long way,
thanks to everyone, and for those who want it, heres the final cut of the
code.

#include "colors.inc"
#include "textures.inc"
#include "shapes.inc"


#declare SnakeWood =
texture {  /* Bottom wood-grain layer */
    pigment {
        wood
        turbulence 0.05
        color_map {
            [0.00 rgb <0.58, 0.45, 0.23>]
            [0.34 rgb <0.65, 0.45, 0.25>]
            [0.40 rgb <0.33, 0.23, 0.13>]
            [0.47 rgb <0.60, 0.40, 0.20>]
            [1.00 rgb <0.25, 0.15, 0.05>]
        }
    }
    finish {
        crand 0.02
        //ambient 0.32
        diffuse 0.63
        phong 0.2
        phong_size 10
    }
    normal { bumps 0.05 }
}
texture {     /* top layer, adds small dark spots */
    pigment {
        bozo
        color_map {
            [0.0 rgbt <1.00, 1.00, 1.00, 1.00>]
            [0.8 rgbt <1.00, 0.90, 0.80, 0.80>]
            [1.0 rgbt <0.30, 0.20, 0.10, 0.40>]
        }
    scale 0.25
    }
}


//light_source {<-20, 20, 0> color White area_light  <5, 0, 0>, <0, 0, 5>,
11, 11 adaptive 1 jitter photons { refraction on reflection on } }
light_source {<-20, 20, 0> color White  photons { refraction on reflection
on } }

light_source { <60, 20, -50> color rgb <0.2, 0.25, 0.3> shadowless }

camera  {
        location <0,10,-25> look_at <0,0,0>
       }

background { Black }//color <0.25,0.35,0.80> }
box     {
        <-1,-1,-1>,
        <1,1,1>
        texture {
                pigment { Red }
                }
        scale <2,2,2>
        rotate <0,-15,0>
        translate <2,1,10>
        }
box     {
        <-1,-1,-1>,
        <1,1,1>
        texture {
                pigment { Red }
                }
        scale <2,2,2>
        rotate <0,-16,0>
        translate <2,1,-9>
        }
cylinder{
        <-1,-1,-1>,
        <1,1,1>,
        1
        texture {
                pigment { White*1.1 }
                //finish { ambient 0.2}
                }
        scale <1,5,1>
        translate <-7,3,0>
        }

plane   { <0, 1, 0>, -0.001
        texture {
                SnakeWood  rotate <0,32,0>
                //pigment { checker pigment{Red}, pigment{White} } scale
<10,10,10> rotate <0,43,0>
                }
        }

#declare Point1 = <-10,1,10>;
#declare Point2 = <-10,1,0>;
#declare Point3 = <-10,1,-10>;
#declare Point4 = <0,1,-10>;
#declare Point5 = <10,1,-10>;
#declare Point6 = <15,1,2>;     //<10,1,0>;
#declare Point7 = <10,1,2>;    //<10,1,10>;
#declare Point8 = <0,1,10>;
#declare Point9 = <-14,1,12>; //<-10,1,10>;
#declare Point10 = <-10,1,0>;
#declare Point11 = <-10,1,-10>;

merge {
// outside of the puddle
sphere_sweep {
        cubic_spline
        11,
        Point1,1
        Point2,1
        Point3,1
        Point4,1
        Point5,1
        Point6,1
        Point7,1
        Point8,1
        Point9,1
        Point10,1
        Point11,1
        }

// inside of the puddle
prism {
    cubic_spline
    0, // sweep the following shape from here ...
    2, // ... up through here
    11, // the number of points making up the shape ...
        <Point1.x,Point1.z>,
        <Point2.x,Point2.z>,
        <Point3.x,Point3.z>,
        <Point4.x,Point4.z>,
        <Point5.x,Point5.z>,
        <Point6.x,Point6.z>,
        <Point7.x,Point7.z>,
        <Point8.x,Point8.z>,
        <Point9.x,Point9.z>,
        <Point10.x,Point10.z>,
        <Point11.x,Point11.z>
  }

        hollow
        texture {
                pigment {
                        Clear // rgbt <0.858824,0.576471,0.439216>
                        }
                finish  {
                        reflection { 0.1,0.8 }
                        specular 0.5
                        }
                }
                interior        {
                                ior Water_Ior
                                //ior 1.33
                                media   {
                                        absorption < 0.7, 0.8, 0.98>}
                                }


        translate <0,-1.5,0>

 }


Post a reply to this message

From: Dan P
Subject: Re: Lighting
Date: 6 Feb 2004 12:13:25
Message: <4023cb35$1@news.povray.org>
"Mike Raiford" <mra### [at] hotmailcom> wrote in message
news:4023c0d4$1@news.povray.org...
>
> "Dan P" <dan### [at] yahoocom> wrote in message
> news:4021b140$1@news.povray.org...
>
> >         phong 0.2
> >         phong_size 10
>
> I've noticed some people use phong, while others use specular. I've always
> been one to use specular, because it's more "accurate", but I've noticed
> some of the best scenes tend to use phong.
>
> What do people prefer and why?

That's interesting -- I never use phong, but I would think they are the same
thing, aren't they Chris? Maybe people who make the best scenes use phong
because they are long-time users of POV-ray and phong used to be specular
(or, was it, I'm not sure -- I don't have POV-ray at work).

This is a really good question. If anybody will know the answer, it will
definitely be Chris; he's got the internals down and then some :-)


Post a reply to this message

From: Mike Raiford
Subject: Re: Lighting
Date: 6 Feb 2004 12:19:11
Message: <4023cc8f$1@news.povray.org>
"Dan P" <dan### [at] yahoocom> wrote in message news:4023cb35> That's
interesting -- I never use phong, but I would think they are the same

> thing, aren't they Chris? Maybe people who make the best scenes use phong
> because they are long-time users of POV-ray and phong used to be specular
> (or, was it, I'm not sure -- I don't have POV-ray at work).

IIRC, in the tutorial that came with earlier versions of POV-Ray, they used
phong, but specular has been available since 0.9b (and probably earlier ...)

Comparing them, they seem to yeild identical results, though, the difference
seems to be a matter of syntax... I think


Post a reply to this message

From: Dan P
Subject: Re: Lighting
Date: 6 Feb 2004 13:29:12
Message: <4023dcf8$1@news.povray.org>
"Mike Raiford" <mra### [at] hotmailcom> wrote in message
news:4023cc8f$1@news.povray.org...
>
> "Dan P" <dan### [at] yahoocom> wrote in message news:4023cb35> That's
> interesting -- I never use phong, but I would think they are the same
>
> > thing, aren't they Chris? Maybe people who make the best scenes use
phong
> > because they are long-time users of POV-ray and phong used to be
specular
> > (or, was it, I'm not sure -- I don't have POV-ray at work).
>
> IIRC, in the tutorial that came with earlier versions of POV-Ray, they
used
> phong, but specular has been available since 0.9b (and probably earlier
...)
>
> Comparing them, they seem to yeild identical results, though, the
difference
> seems to be a matter of syntax... I think

There are a lot of things in POV-Ray that are from the olden days. I wonder
when the point will come where we phase those out so that the language
doesn't become confusing? (I don't think it is there yet, although I still
struggle with the media statement a lot).


Post a reply to this message

From: Christopher James Huff
Subject: Re: Lighting
Date: 6 Feb 2004 13:34:04
Message: <cjameshuff-E67770.13341606022004@news.povray.org>
In article <4023cb35$1@news.povray.org>,
 "Dan P" <dan### [at] yahoocom> wrote:

> That's interesting -- I never use phong, but I would think they are the same
> thing, aren't they Chris? Maybe people who make the best scenes use phong
> because they are long-time users of POV-ray and phong used to be specular
> (or, was it, I'm not sure -- I don't have POV-ray at work).
> 
> This is a really good question. If anybody will know the answer, it will
> definitely be Chris; he's got the internals down and then some :-)

Despite my lack of post-college experience?
Okay, here it goes:
They are definitely not the same thing. Phong is the older shading 
method, and is very simple mathematically, computationally cheap, but 
not very accurate. In terms of POV code, the equation used is:

phongAmt*surfaceColor*pow(vdot(reflectionVector, lightVector), phongSize)

The reflection vector is the direction a reflected ray would go, the 
light vector is a vector pointing towards the light source. When the two 
line up, their dot product equals 1, and the highlight is the brightest 
where you would see a reflection of the light. When the two are 
perpendicular, the result is 0, and the highlight drops to nothing.

Specular uses a different and more physically accurate highlight 
function:

specularAmt*surfaceColor*pow(vdot(halfPt, normal), 1/roughness)

where halfPt is halfway between the ray origin and the light source. It 
is also brightest at the points where the reflection of the light source 
would be visible, but the falloff is different.

If metallic is specified, a Fresnel reflection function is used. It 
takes the intensity part of the above calculation and adds some 
additional calculations based on the angle of the surface to the light:

specIntensity = specularAmt*pow(vdot(halfPt, normal), 1/roughness)
F = abs(acos(vdot(normal, lightVector))/(pi/2))
F = 0.014567225/sqr(F - 1.12) - 0.011612903

F is then clamped to the range 0-1, and the final highlight color is:

lightColor*specIntensity*(1 + metallicAmt*(1 - F)*(surfaceColor - 1))

This function is based on actual measurements of real-world surfaces, 
and is the most realistic highlight for metallic objects.

-- 
Christopher James Huff <cja### [at] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: <chr### [at] tagpovrayorg>
http://tag.povray.org/


Post a reply to this message

From: Dan P
Subject: Re: Lighting
Date: 6 Feb 2004 17:08:44
Message: <4024106c@news.povray.org>
"Christopher James Huff" <cja### [at] earthlinknet> wrote in message
news:cjameshuff-E67770.13341606022004@news.povray.org...
> In article <4023cb35$1@news.povray.org>,
>  "Dan P" <dan### [at] yahoocom> wrote:
>
> > That's interesting -- I never use phong, but I would think they are the
same
> > thing, aren't they Chris? Maybe people who make the best scenes use
phong
> > because they are long-time users of POV-ray and phong used to be
specular
> > (or, was it, I'm not sure -- I don't have POV-ray at work).
> >
> > This is a really good question. If anybody will know the answer, it will
> > definitely be Chris; he's got the internals down and then some :-)
>
> Despite my lack of post-college experience?

I'm not falling for any more flame-bait, Chris.
Great post, though.


Post a reply to this message

From: Dan P
Subject: Re: Lighting
Date: 6 Feb 2004 19:58:37
Message: <4024383d@news.povray.org>
"Felbrigg" <som### [at] microsoftcom> wrote in message
news:4023c200$1@news.povray.org...
> I've hit the end on this scene now.  Not the end of learning by a long
way,
> thanks to everyone, and for those who want it, heres the final cut of the
> code.

Beeeeeeeooootiful!


Post a reply to this message

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