POV-Ray : Newsgroups : povray.general : Glass Server Time
16 Oct 2026 01:17:58 EDT (-0400)
  Glass (Message 1 to 19 of 19)  
From: J-Print News
Subject: Glass
Date: 9 Jan 2001 01:31:47
Message: <3a5ab053@news.povray.org>
I've been trying too figure out if PovRay renders glass correctly or not.

If you have a glass sphere that is slightly green (like normal window
glass). With most ray tracers and renderers they just map a colour too the
surface of the glass resulting in an even distribution of transparent green
when rendered(like a balloon), with of course refraction added. In real life
the centre of the sphere is actually darker because the light travels a
longer distance through the middle of the sphere than near the edge.

If PovRay doesn't do this, I think it should be easy too make something to
do this: the longer the distance that the light travels through the object,
the more light is absorbed. But I know nothing about programming or
scripting(yet). I don't want to use it only in spheres but in other shapes
as well.

Is there someone that can help me with this?

Thanks

Nekar Xenos
_____________

'E xapis meta sou.


Post a reply to this message

From: Peter Popov
Subject: Re: Glass
Date: 9 Jan 2001 02:16:28
Message: <c7el5tc1ci9jj2lg2mtj4gsn4qk3q81o6c@4ax.com>
On Tue, 9 Jan 2001 08:34:39 +0200, "J-Print News" <vir### [at] iconcoza>
wrote:

>I've been trying too figure out if PovRay renders glass correctly or not.

To an extent :)

>If you have a glass sphere that is slightly green (like normal window
>glass). With most ray tracers and renderers they just map a colour too the
>surface of the glass resulting in an even distribution of transparent green
>when rendered(like a balloon), with of course refraction added. In real life
>the centre of the sphere is actually darker because the light travels a
>longer distance through the middle of the sphere than near the edge.

In real life glass is green because it absorbs some blue and red. To
achieve the same effect, make your sphere clear white and add a
magenta absorbing media. It behaves in the exact same way as you are
asking. The surface does not need to have a color as it is infinitely
thin (in POV's way of thinking); think of it as coating. You can give
it a finish with reflection and specular highlights, of course.

>If PovRay doesn't do this, I think it should be easy too make something to
>do this: the longer the distance that the light travels through the object,
>the more light is absorbed. 

This is exactly what absorbing media does. 

You can also use light attenuation which is faster. In official POV it
is not very accurate, I think, but MegaPOV offers an alternative
formula which is real-life based.

Note: I may be thining of light fading here but I don't have Mega
installed yet to check out (did a full reinstall just yesterday).


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


Post a reply to this message

From: J-Print News
Subject: Re: Glass
Date: 9 Jan 2001 05:25:34
Message: <3a5ae71e@news.povray.org>
Thanks

Is MegaPov free? Where can I get it?

Nekar
Peter Popov <pet### [at] vipbg> wrote in message
news:c7el5tc1ci9jj2lg2mtj4gsn4qk3q81o6c@4ax.com...
> On Tue, 9 Jan 2001 08:34:39 +0200, "J-Print News" <vir### [at] iconcoza>
> wrote:
>
> >I've been trying too figure out if PovRay renders glass correctly or not.
>
> To an extent :)
>
> >If you have a glass sphere that is slightly green (like normal window
> >glass). With most ray tracers and renderers they just map a colour too
the
> >surface of the glass resulting in an even distribution of transparent
green
> >when rendered(like a balloon), with of course refraction added. In real
life
> >the centre of the sphere is actually darker because the light travels a
> >longer distance through the middle of the sphere than near the edge.
>
> In real life glass is green because it absorbs some blue and red. To
> achieve the same effect, make your sphere clear white and add
> it a finish with reflection and specular highlights, of course.
>
> >If PovRay doesn't do this, I think it should be easy too make something
to
> >do this: the longer the distance that the light travels through the
object,
> >the more light is absorbed.
>
> This is exactly what absorbing media does.
>
> You can also use light attenuation which is faster. In official POV it
> is not very accurate, I think, but MegaPOV offers an alternative
> formula which is real-life based.
>
> Note: I may be thining of light fading here but I don't have Mega
> installed yet to check out (did a full reinstall just yesterday).
>
>
> Peter Popov ICQ : 15002700
> Personal e-mail : pet### [at] vipbg
> TAG      e-mail : pet### [at] tagpovrayorg


Post a reply to this message

From: Lance Birch
Subject: Re: Glass
Date: 9 Jan 2001 05:41:13
Message: <3a5aeac9@news.povray.org>
J-Print News wrote:
> Is MegaPov free? Where can I get it?

Yes, and right here:
http://nathan.kopp.com/patched.htm

--
Lance.

http://come.to/the.zone


Post a reply to this message

From: Chris Huff
Subject: Re: Glass
Date: 9 Jan 2001 12:08:05
Message: <chrishuff-DA0AD9.12094409012001@news.povray.org>
In article <c7el5tc1ci9jj2lg2mtj4gsn4qk3q81o6c@4ax.com>, Peter Popov 
<pet### [at] vipbg> wrote:

> Note: I may be thining of light fading here but I don't have Mega
> installed yet to check out (did a full reinstall just yesterday).

It sounds like you mean the fade_color addition...it lets you specify 
the color that light passing through the object attenuates to, and adds 
an attenuation calculation that is supposed to be more realistic. And it 
has nothing to do with light source fading, it is more of a solid-color 
media-like effect.

-- 
Christopher James Huff
Personal: chr### [at] maccom, http://homepage.mac.com/chrishuff/
TAG: chr### [at] tagpovrayorg, http://tag.povray.org/

<><


Post a reply to this message

From: David Fontaine
Subject: Re: Glass
Date: 9 Jan 2001 18:40:33
Message: <3A5BA04C.84746F2E@faricy.net>
J-Print News wrote:

> I've been trying too figure out if PovRay renders glass correctly or not.

Yes and no. That answer your question? ;)
(looks like Peter's explained it already)

--
David Fontaine  <dav### [at] faricynet>  ICQ 55354965
My raytracing gallery:  http://davidf.faricy.net/


Post a reply to this message

From: Warp
Subject: Re: Glass
Date: 10 Jan 2001 05:52:11
Message: <3a5c3edb@news.povray.org>
interior
{ fade_distance ...
  fade_power ...
}

-- 
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):_;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/


Post a reply to this message

From: Chris Huff
Subject: Re: Glass
Date: 10 Jan 2001 08:03:00
Message: <chrishuff-8059FF.08044010012001@news.povray.org>
In article <3a5c3edb@news.povray.org>, Warp <war### [at] tagpovrayorg> 
wrote:

> interior
> { fade_distance ...
>   fade_power ...
> }

And don't forget the fade_color available in MegaPOV.

-- 
Christopher James Huff
Personal: chr### [at] maccom, http://homepage.mac.com/chrishuff/
TAG: chr### [at] tagpovrayorg, http://tag.povray.org/

<><


Post a reply to this message

From: J-Print News
Subject: Glass Reflections
Date: 10 Jan 2001 09:55:56
Message: <3a5c77fc@news.povray.org>
I just thought of something else. Glass reflects not only on the outside but
on the inside as well. If you look carefully at a window pane at night
you'll notice there is actually a double reflection.

Can this be done in Pov?

Thanks

Nekar


Post a reply to this message

From: Peter Popov
Subject: Re: Glass
Date: 10 Jan 2001 10:13:31
Message: <838o5t8ke8ok7tpc1vid8cj519dq2tg97c@4ax.com>
On Tue, 09 Jan 2001 12:09:44 -0500, Chris Huff <chr### [at] maccom>
wrote:

>It sounds like you mean the fade_color addition...it lets you specify 
>the color that light passing through the object attenuates to, and adds 
>an attenuation calculation that is supposed to be more realistic. And it 
>has nothing to do with light source fading, it is more of a solid-color 
>media-like effect.

I actually mean this:

>:: 7.2. Realistic attenuation
>:: If you set fade_power in the interior of an object at 1000 or above, 
>:: MegaPov will use a realistic exponential attenuation function:
>:: 
>:: Attenuation = exp(-depth/fade_dist)
>:: 
>:: Colored attenuation does work with this exponential attenuation also.

Sorry abouit not being precise before but I just finished installing.


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


Post a reply to this message

From: Warp
Subject: Re: Glass Reflections
Date: 10 Jan 2001 10:25:39
Message: <3a5c7ef2@news.povray.org>
J-Print News <vir### [at] iconcoza> wrote:
: Can this be done in Pov?

  The question would better be "could this be avoided with povray?".

  Povray does this by design. Trying to avoid this would be the hard thing
(I can't think of any way right now). Of course there's no reason to avoid
it...

-- 
char*i="b[7FK@`3NB6>B:b3O6>:B:b3O6><`3:;8:6f733:>::b?7B>:>^B>C73;S1";
main(_,c,m){for(m=32;c=*i++-49;c&m?putchar('\n'):m)for(_
=(c>>2)&7;putchar(m),_--?m:(_=(1<<(c&3))-1,(m^=3)&3););}  /*- Warp -*/


Post a reply to this message

From: Tom Melly
Subject: Re: Glass Reflections
Date: 10 Jan 2001 10:31:56
Message: <3a5c806c@news.povray.org>
"J-Print News" <vir### [at] iconcoza> wrote in message
news:3a5c77fc@news.povray.org...
> I just thought of something else. Glass reflects not only on the outside
but
> on the inside as well. If you look carefully at a window pane at night
> you'll notice there is actually a double reflection.
>
> Can this be done in Pov?
>

I wasn't sure so I tried it. This behaviour as far as I can see is
reproduced by default in both pov and mp. Try the following code:

#include "colors.inc"

light_source{<0,0,0> color rgb<1,1,1>*2 translate <0, 30, 0>}
light_source{<0,0,0> color rgb<1,1,1>*2 translate <0, -30, 0>}

camera{location  <5.0, 0.0, -5.0> look_at   <0.0, 0.0,  0.0>}

box{
  <-10,-10,0>,<10,10,1>
  pigment{rgbf 1}
  finish{reflection 1/2 ambient 0 diffuse 0}
}

sphere{0, 1 translate<-5,0,-5> pigment{Red}}


Post a reply to this message

From: Chris Huff
Subject: Re: Glass Reflections
Date: 10 Jan 2001 15:50:37
Message: <chrishuff-BEFAA0.15521810012001@news.povray.org>
In article <3a5c7ef2@news.povray.org>, Warp <war### [at] tagpovrayorg> 
wrote:

>   The question would better be "could this be avoided with povray?".
> 
>   Povray does this by design. Trying to avoid this would be the hard thing
> (I can't think of any way right now). Of course there's no reason to avoid
> it...

In the official version, textures affect both sides of each surface the 
same way, so glass panes will have that double-reflection effect 
(actually, many more than two reflections, depending on 
max_trace_level). MegaPOV allows you to override the texture of the 
"interior" side of the surface with the interior_texture feature. This 
feature also works with objects like bezier patches or triangles, which 
don't have an "interior" but clearly have two sides.

-- 
Christopher James Huff
Personal: chr### [at] maccom, http://homepage.mac.com/chrishuff/
TAG: chr### [at] tagpovrayorg, http://tag.povray.org/

<><


Post a reply to this message

From: Jamie Davison
Subject: Re: Glass Reflections
Date: 10 Jan 2001 15:56:03
Message: <MPG.14c6dbdad88f5cb2989867@news.povray.org>
>   The question would better be "could this be avoided with povray?".

[snip]

Easy.  Define two textures for the glass, one with reflection, and one 
with none.

Construct your pane of glass as a CSG difference of two cubes, one taking 
a face off the other.  Assign the textures, one to each cube, and viola!  
You have a pane of glass which has one face which eiother reflects or 
does not reflect, depending on how you assigned the textures.

Bye for now,
     Jamie.


Post a reply to this message

From: Ron Parker
Subject: Re: Glass Reflections
Date: 10 Jan 2001 15:58:54
Message: <slrn95pj8h.agl.ron.parker@fwi.com>
On Wed, 10 Jan 2001 20:54:04 -0000, Jamie Davison wrote:
>Construct your pane of glass as a CSG difference of two cubes, one taking 
>a face off the other.  Assign the textures, one to each cube, and viola!  
>You have a pane of glass which has one face which eiother reflects or 
>does not reflect, depending on how you assigned the textures.

Maybe, maybe not.  There's also TIR, which is solely dependent on the
IOR of the object.

-- 
Ron Parker   http://www2.fwi.com/~parkerr/traces.html
My opinions.  Mine.  Not anyone else's.


Post a reply to this message

From: Jamie Davison
Subject: Re: Glass Reflections
Date: 10 Jan 2001 17:09:58
Message: <MPG.14c6ed695d0c3372989868@news.povray.org>
> >Construct your pane of glass as a CSG difference of two cubes, one taking 
> >a face off the other.  Assign the textures, one to each cube, and viola!  
> >You have a pane of glass which has one face which eiother reflects or 
> >does not reflect, depending on how you assigned the textures.
> 
> Maybe, maybe not.  There's also TIR, which is solely dependent on the
> IOR of the object.

True enough I suppose.  Then you could always just use a clipped plane as 
a single face of a pane of glass, and fake it.  (the great maxim of 
computer graphics as far as I'm concerned, if it's too tricky to do the 
real way, fake it.  <grin>)

Although thinking about it, assuming that both textures were identical 
apart from the reflection settings (Interior etc.) then surely the non-
reflective face would work to kill any TIR that might be taking place?

I'll try playing with it tomorrow night, as I need to hit the shower and 
get to bed since I'm knackered.

Bye for now,
     Jamie.


Post a reply to this message

From: Warp
Subject: Re: Glass Reflections
Date: 11 Jan 2001 06:30:57
Message: <3a5d9971@news.povray.org>
Jamie Davison <jam### [at] dh70qdu-netcom> wrote:
: Construct your pane of glass as a CSG difference of two cubes, one taking 
: a face off the other.  Assign the textures, one to each cube, and viola!  
: You have a pane of glass which has one face which eiother reflects or 
: does not reflect, depending on how you assigned the textures.

  This works only when looking from one side of the glass, but not the other
side.
  Suppose that we are also seeing the other side of the glass at the same
time through a mirror...

-- 
char*i="b[7FK@`3NB6>B:b3O6>:B:b3O6><`3:;8:6f733:>::b?7B>:>^B>C73;S1";
main(_,c,m){for(m=32;c=*i++-49;c&m?putchar('\n'):m)for(_
=(c>>2)&7;putchar(m),_--?m:(_=(1<<(c&3))-1,(m^=3)&3););}  /*- Warp -*/


Post a reply to this message

From: Warp
Subject: Re: Glass Reflections
Date: 11 Jan 2001 06:32:50
Message: <3a5d99e2@news.povray.org>
Chris Huff <chr### [at] maccom> wrote:
: with the interior_texture feature

  Is the bug about this feature, which I reported long ago, already fixed?-)

-- 
char*i="b[7FK@`3NB6>B:b3O6>:B:b3O6><`3:;8:6f733:>::b?7B>:>^B>C73;S1";
main(_,c,m){for(m=32;c=*i++-49;c&m?putchar('\n'):m)for(_
=(c>>2)&7;putchar(m),_--?m:(_=(1<<(c&3))-1,(m^=3)&3););}  /*- Warp -*/


Post a reply to this message

From: Chris Huff
Subject: Re: Glass Reflections
Date: 11 Jan 2001 07:55:50
Message: <chrishuff-3EB52D.07573311012001@news.povray.org>
In article <3a5d99e2@news.povray.org>, Warp <war### [at] tagpovrayorg> 
wrote:

> : with the interior_texture feature
> 
>   Is the bug about this feature, which I reported long ago, already 
>   fixed?-)

Hmm, probably not...I remember looking at the lighting code, but 
couldn't figure it out. It was some problem with filtering textures, 
right?

-- 
Christopher James Huff
Personal: chr### [at] maccom, http://homepage.mac.com/chrishuff/
TAG: chr### [at] tagpovrayorg, http://tag.povray.org/

<><


Post a reply to this message

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