POV-Ray : Newsgroups : povray.newusers : difficult problem with lights Server Time
27 Nov 2024 05:37:09 EST (-0500)
  difficult problem with lights (Message 1 to 10 of 12)  
Goto Latest 10 Messages Next 2 Messages >>>
From: Christina B 
Subject: difficult problem with lights
Date: 15 May 2003 18:17:59
Message: <3ec41217$1@news.povray.org>
I am a very new POV-ray user and am a little hesitant about asking such 
a basic question.  I have been trying different practice pieces and 
everything works except lights.  I have a picture at 
http://www.ccbrundage.net/save/image2.jpg - the cross is supposed to be 
shiny gold but no matter what I do, I can't get a light to shine on it.  
I have had this trouble with all my pictures.  I have tried every type 
of light, location, etc.  I would appreciate any suggestions - I would 
like the light to shine from the left - but anywhere is ok now!!!

Many thanks in advance,
Christina B.

-- 


http://www.ccbrundage.net/saints/
http://www.ccbrundage.net/
http://web.tampabay.rr.com/ccb/
http://www.thecelticplanet.com/


Post a reply to this message


Attachments:
Download 'iso-8859-1' (2 KB)

From: Bill Hails
Subject: Re: difficult problem with lights
Date: 15 May 2003 18:29:04
Message: <3ec414b0@news.povray.org>
Christina B. wrote:

> I am a very new POV-ray user and am a little hesitant about asking such a
> basic question.  I have been trying different practice pieces and
> everything works except lights.  I have a picture at
> http://www.ccbrundage.net/save/image2.jpg - the cross is supposed to be
> shiny gold but no matter what I do, I can't get a light to shine on it.  I
> have had this trouble with all my pictures.  I have tried every type of
> light, location, etc.  I would appreciate any suggestions - I would like
> the light to shine from the left - but anywhere is ok now!!!
> 
> Many thanks in advance,
> Christina B.
> 

Nice picture.
It looks like you haven't actually declared a texture or a pigment for the 
cross, I mean if you don't declare a pigment or a texture for an object,
it will look black. Are you sure you have a gold texture active?

-- 
Bill Hails


Post a reply to this message

From: Warp
Subject: Re: difficult problem with lights
Date: 15 May 2003 21:18:50
Message: <3ec43c7a@news.povray.org>
Posting the scene file in question would help finding the problem in
this case.

  Let me introduce a rather technical explanation about how objects "shine"
when light hits them and how this is achieved in a renderer like POV-Ray.

  It's clear that light reflects from objects and that's why we see these
objects in the first place. However, this is a simplification. Light can
reflect from the surface of an object in different ways depending on the
properties of the surface.
  In a simplified lighting model (which is usually enough for making
good-looking images) there are two ways light can reflect from a surface:
Diffusely and specularly.

  Diffuse reflection assumes the surface is extremely rough at microscopic
level and thus reflects light equally to all directions (all directions
that can be seen from the surface, naturally). Less-technical synonyms for
a diffuse surface are "matte" and "dull". The brightness of the surface
is not dependent on the direction you are looking at it.

  Specular reflection assumes a very smooth surface, with little roughness,
which causes light to be reflected mostly like a mirror does. The brightness
of the surface is highly dependant on where do you look at it from: If
the light is reflected directly at your eye, you see a bright spot at
that place in the surface.

  Since most real-life surfaces are not purely diffuse nor specular, but
something in between, this is simulated by calculating both properties
and adding them together (even though it might not be 100% physically
correct, it gives a result which looks good enough).

  Now, shiny surfaces are shiny because they have a very high specular
property to them. They reflect a lot of light specularly (ie. in the
reflected direction).
  This means that to get a shiny object, you have to specify a high
specular property to it.

  One requirement for the object to look shiny is that light reflects
from its surface to the camera. That is, parts of the surface must be
oriented so that this happens.
  One problem which might arise is if you use objects with sharp edges
and planar (ie. flat) surfaces. There simply might not be any surface on
the object which is oriented correctly to show a shiny highlight.

  Objects in real life have seldom sharp edges and perfectly planar
surfaces. Rounding the edges of your object helps a lot (the specular
highlights will usually appear on the rounded edges because part of
them will have the right orientation). Naturally positioning the camera
and the light source so that they are at the proper angle with respect
to a planar surface of the object will give a (usually big) highlight
on this surface, but that's usually quite artificial (even though
sometimes it gives a great look to the object).

  So from the above technical mumbo-jumbo we can conclude two requirements
to make your object look shiny:

  1. Define a "finish { specular 1 }" (or a variant) in your object.

  2. Round the edges of your object. (This usually requires some modelling
     skills, but that's what rendering is all about.)

-- 
plane{-x+y,-1pigment{bozo color_map{[0rgb x][1rgb x+y]}turbulence 1}}
sphere{0,2pigment{rgbt 1}interior{media{emission 1density{spherical
density_map{[0rgb 0][.5rgb<1,.5>][1rgb 1]}turbulence.9}}}scale
<1,1,3>hollow}text{ttf"timrom""Warp".1,0translate<-1,-.1,2>}//  - Warp -


Post a reply to this message

From: Warp
Subject: Re: difficult problem with lights
Date: 15 May 2003 21:22:46
Message: <3ec43d65@news.povray.org>
Oh, forgot to add this:

  Naturally making the object reflective helps making it look shiny.
That is, the finish-block could look something like
"finish { specular 1 reflection .5 }"

-- 
#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: Christina B 
Subject: Re: difficult problem with lights
Date: 15 May 2003 23:43:50
Message: <3ec45e76$1@news.povray.org>
I really appreciate your explanation - too bad you didn't write the 
documentation!  I didn't catch the difference between diffuse and 
specular before.  I will try changing the coding.

Excuse the feeble coding because I have just been doing this this week - 
here is what I have now - 

So far the cross is still 2 separate boxes - I haven't put them together 
yet.  (I'll have to read the documentation for union vs. merge.)  The 
coding I have now is -

#declare F_MetalE  =
finish {
    brilliance 6
    diffuse D_GoldE
    ambient A_GoldE
    
    metallic M
    specular 0.80
    roughness 1/120
} 

box { <.6, .5, 3>, <1.2, .65, 3> 
 texture{
  F_MetalE}
  finish
  {ambient .1
   } 
  } 
 box { <.8, -.4, 3>, <.95, 1, 3> 
  texture{
  F_MetalE}
   finish {ambient .1
   }}   
-- 

I haven't yet made the 2 boxes into one object.  I would have been happy 
to get any kind of light onto any part of either one of those but no 
matter which way  I change the location and look_at of light sources, 
they never show up.  I have sometimes seen a little light on the plane 
but it doesn't seem to be coming from a direction consistent with my 
coding, so obviously I am doing something awfully wrong.  The 
documentation isn't really helpful in this for me.

Christina

http://www.ccbrundage.net/saints/
http://www.ccbrundage.net/
http://web.tampabay.rr.com/ccb/
http://www.thecelticplanet.com/
  "Warp" <war### [at] tagpovrayorg> wrote in message 
news:3ec43c7a@news.povray.org...
    Posting the scene file in question would help finding the problem in
  this case.

    Let me introduce a rather technical explanation about how objects 
"shine"
  when light hits them and how this is achieved in a renderer like 
POV-Ray.

    It's clear that light reflects from objects and that's why we see 
these
  objects in the first place. However, this is a simplification. Light 
can
  reflect from the surface of an object in different ways depending on 
the
  properties of the surface.
    In a simplified lighting model (which is usually enough for making
  good-looking images) there are two ways light can reflect from a 
surface:
  Diffusely and specularly.

    Diffuse reflection assumes the surface is extremely rough at 
microscopic
  level and thus reflects light equally to all directions (all 
directions
  that can be seen from the surface, naturally). Less-technical synonyms 
for
  a diffuse surface are "matte" and "dull". The brightness of the 
surface
  is not dependent on the direction you are looking at it.

    Specular reflection assumes a very smooth surface, with little 
roughness,
  which causes light to be reflected mostly like a mirror does. The 
brightness
  of the surface is highly dependant on where do you look at it from: If
  the light is reflected directly at your eye, you see a bright spot at
  that place in the surface.

    Since most real-life surfaces are not purely diffuse nor specular, 
but
  something in between, this is simulated by calculating both properties
  and adding them together (even though it might not be 100% physically
  correct, it gives a result which looks good enough).

    Now, shiny surfaces are shiny because they have a very high specular
  property to them. They reflect a lot of light specularly (ie. in the
  reflected direction).
    This means that to get a shiny object, you have to specify a high
  specular property to it.

    One requirement for the object to look shiny is that light reflects
  from its surface to the camera. That is, parts of the surface must be
  oriented so that this happens.
    One problem which might arise is if you use objects with sharp edges
  and planar (ie. flat) surfaces. There simply might not be any surface 
on
  the object which is oriented correctly to show a shiny highlight.

    Objects in real life have seldom sharp edges and perfectly planar
  surfaces. Rounding the edges of your object helps a lot (the specular
  highlights will usually appear on the rounded edges because part of
  them will have the right orientation). Naturally positioning the 
camera
  and the light source so that they are at the proper angle with respect
  to a planar surface of the object will give a (usually big) highlight
  on this surface, but that's usually quite artificial (even though
  sometimes it gives a great look to the object).

    So from the above technical mumbo-jumbo we can conclude two 
requirements
  to make your object look shiny:

    1. Define a "finish { specular 1 }" (or a variant) in your object.

    2. Round the edges of your object. (This usually requires some 
modelling
       skills, but that's what rendering is all about.)

  -- 
  plane{-x+y,-1pigment{bozo color_map{[0rgb x][1rgb x+y]}turbulence 1}}
  sphere{0,2pigment{rgbt 1}interior{media{emission 1density{spherical
  density_map{[0rgb 0][.5rgb<1,.5>][1rgb 1]}turbulence.9}}}scale
  <1,1,3>hollow}text{ttf"timrom""Warp".1,0translate<-1,-.1,2>}//  - Warp 
-


Post a reply to this message


Attachments:
Download 'windows-1252' (7 KB)

From: Peter Popov
Subject: Re: difficult problem with lights
Date: 16 May 2003 03:54:17
Message: <6759cvk455r5oif60ddi87fap3m7dvfbq5@4ax.com>
On Thu, 15 May 2003 23:43:46 -0400, "Christina B."
<ccb### [at] tampabayrrcom> wrote:

>I really appreciate your explanation - too bad you didn't write the documentation!

I believe Warp did actually write part of the documentation :)

Anyway, I think you've got the concept of diffuse and ambient just a
tad off. I guess you've used some other 3D applications (probably
OpenGL ones) where you set the color of an object by its diffuse and
ambient _colors_. However, in POV you need to set a _pigment_ to the
object to determine the color of an object. The finish statement more
or less determines the luminance of that color depending on the light
position, incidence angle etc. (it's not so simple of course but at
least that's what diffuse, ambient and brilliance do).

Here's a more or less shiny object in a simple scene:

sphere {
	0,1
	texture {
		finish {
			ambient 0.1
			diffuse 0.9
			brilliance 1.75
			phong 0.4 phong_size 10
			specular 0.8 roughness 0.005
			reflection 0.125 metallic on
			conserve_energy
		}
		pigment { rgb <0.3,0.6,1> }
	}
}

light_source { <10,10,-10> color rgb 1 }

camera {
  location -4*z
  look_at 0
}

union {
  box { -1, 1 translate <-1.1,-1.1,0> }
  box { -1, 1 translate <-1.1,1.1,0> }
  box { -1, 1 translate <1.1,-1.1,0> }
  box { -1, 1 translate <1.1,1.1,0> }
  texture { pigment { rgb 1 } finish { ambient 1 } }
  scale <10,20,0.1>
  translate <30,20,-15>
  no_shadow
}

I hope this helps.


Peter Popov ICQ : 15002700
Personal e-mail : pet### [at] vipbg
TAG      e-mail : pet### [at] tagpovrayorg


Post a reply to this message

From: ABX
Subject: Re: difficult problem with lights
Date: 16 May 2003 04:32:50
Message: <dd89cvciojd8n8djm087lbrnstbvmm5vd6@4ax.com>
On Thu, 15 May 2003 23:43:46 -0400, "Christina B." <ccb### [at] tampabayrrcom> wrote:
> I really appreciate your explanation - too bad you didn't write the documentation!

http://www.povray.org/documentation/view/305/

Chapter 9. POV-Ray Questions and Tips
by Warp
...

ABX


Post a reply to this message

From: Tom & Lu Melly
Subject: Re: difficult problem with lights
Date: 16 May 2003 15:14:35
Message: <3ec5389b@news.povray.org>
"Christina B." <ccb### [at] tampabayrrcom> wrote in message
news:3ec45e76$1@news.povray.org...

> I really appreciate your explanation - too bad you didn't write the
documentation!

Ah, you've opened a can of worms. I'll put the toast on.


Post a reply to this message

From: St 
Subject: Re: difficult problem with lights
Date: 16 May 2003 15:59:17
Message: <3ec54315@news.povray.org>
"Tom & Lu Melly" <all### [at] tomandlucouk> wrote in message
news:3ec5389b@news.povray.org...


>  I'll put the toast on.

  Is that with cheese? I think I'll join you...  ;)

   ~Steve~


Post a reply to this message

From: mcavoys
Subject: Re: difficult problem with lights
Date: 16 May 2003 17:30:36
Message: <3ec55869.195624413@news.povray.org>
On Fri, 16 May 2003 20:54:40 +0100, "St." <dot### [at] dotcom> wrote:


>  Is that with cheese? I think I'll join you...  ;)
>
Balsamic vinegar with worms, cheese with the things under rocks.

Regards
        Stephen


Post a reply to this message

Goto Latest 10 Messages Next 2 Messages >>>

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