POV-Ray : Newsgroups : povray.text.scene-files : Refraction bug(?) this time Server Time
29 Jul 2024 04:28:30 EDT (-0400)
  Refraction bug(?) this time (Message 4 to 13 of 13)  
<<< Previous 3 Messages Goto Initial 10 Messages
From: =Bob
Subject: Re: Refraction bug(?) this time
Date: 2 Dec 1998 23:48:08
Message: <36661808.0@news.povray.org>
I think I get you.
Except for the fact that, what I'm thinking about is, since there is no csg 
taking place and all the objects are set to hollow (meaning the sphere 
hollowness should be unchanged regardless) why then isn't it still just a 
totally invisible object? It ought to be as a container object should be for 
media and not ever become visible when an external object encounters it.
I remind you of the fact that *all* objects are set to hollow and inversing 
any would still make for all hollow (or is this the thing, hollow turns 
off???). Reason of course being that the outside of any is already hollow 
anyway, and setting them to hollow is like making the entire scene hollow.
Right? or am I still not convincing anyone?

Message <36660FC3.9D17DED0@Kopp.com>, Nathan Kopp  typed...
>
>> // refraction seems to jump into an external object
>> // which itself does not have an ior
>> // 98.91, bob hughes
>> 
>> // when 1 (inverse used) refraction jumps into sphere, 2 does not
>
>Actually, this is technically not true.  The sphere DOES have an IOR... it is
>1.0 by default.  Because this is the same as the air (empty space), when
>you don't use inverse, you don't see any effect.  However, when you do
>use the inverse, as Ken mentioned, the camera is inside the water plane, so
>there is a change in IOR values when the light beam passes from the water
>(ior 1.23) into the sphere (ior 1.0).  Therefore, POV calculates the
>refraction angle properly.
>
>-Nathan

-- 
 omniVERSE: beyond the universe
  http://members.aol.com/inversez/POVring.html
=Bob


Post a reply to this message

From: Ken
Subject: Re: Refraction bug(?) this time
Date: 3 Dec 1998 00:14:00
Message: <36661D7A.C1C15D85@pacbell.net>
Forgetting your thoughts on the hollow key word instead
lets look at the different objects here and their properties.
If we took a box, instead of the plane, and assigned it
a refractive ior value. Inside of this box we place a sphere
with the value you ascribed of rgbf 1. As you have
mentioned by itself floating in air the object is technicaly
invisible. When you place the sphere inside the box on the
other hand it would be treated as something akin to an air
pocket inside a glass cube. The rays calculated for the space
in the cube will be different than those for the rest of the box
object. While technicaly this is an invalid model but it suffices
to illustrate the point.
  The hollow keyword is necessary for pov to understand
exactly what is inside and what is out. If you wanted to
place a media inside the box and not the sphere pov gets
confused as to whose surface normal belongs to who. The
hollow keyword sets this conditionaly but has no other effect
on solid objects. In effect the object is really still solid. Only
the way the objects interior is treated is different when media
effects are being calculated.

Ken Tyler

=Bob wrote:

> I think I get you.
> Except for the fact that, what I'm thinking about is, since there is no csg
> taking place and all the objects are set to hollow (meaning the sphere
> hollowness should be unchanged regardless) why then isn't it still just a
> totally invisible object? It ought to be as a container object should be for
> media and not ever become visible when an external object encounters it.
> I remind you of the fact that *all* objects are set to hollow and inversing
> any would still make for all hollow (or is this the thing, hollow turns
> off???). Reason of course being that the outside of any is already hollow
> anyway, and setting them to hollow is like making the entire scene hollow.
> Right? or am I still not convincing anyone?
>
> Message <36660FC3.9D17DED0@Kopp.com>, Nathan Kopp  typed...
> >
> >> // refraction seems to jump into an external object
> >> // which itself does not have an ior
> >> // 98.91, bob hughes
> >>
> >> // when 1 (inverse used) refraction jumps into sphere, 2 does not
> >
> >Actually, this is technically not true.  The sphere DOES have an IOR... it is
> >1.0 by default.  Because this is the same as the air (empty space), when
> >you don't use inverse, you don't see any effect.  However, when you do
> >use the inverse, as Ken mentioned, the camera is inside the water plane, so
> >there is a change in IOR values when the light beam passes from the water
> >(ior 1.23) into the sphere (ior 1.0).  Therefore, POV calculates the
> >refraction angle properly.
> >
> >-Nathan
>
> --
>  omniVERSE: beyond the universe
>   http://members.aol.com/inversez/POVring.html
> =Bob


Post a reply to this message

From: =Bob
Subject: Re: Refraction bug(?) this time
Date: 3 Dec 1998 00:31:44
Message: <36662240.0@news.povray.org>
I know exactly what you mean now.
It's the different-surface concept, such as the well known water in a glass 
type paradox.
Refraction has been put into the air, simply put, as was said. The sphere then 
is an intersecting surface despite its own composition where no refraction 
exists thus causing the bent rays at that surface. Still plane interior, as it 
were, encompassing the sphere.
Makes perfect sense too. Only wish I had thought of it before myself, but 
maybe others reading here will be enlightened as well.
And damn good thing I didn't send in a genuine bug report to the POV Team!

  :)

Message <36661D7A.C1C15D85@pacbell.net>, Ken  typed...
>
>  Forgetting your thoughts on the hollow key word instead
>lets look at the different objects here and their properties.
>If we took a box, instead of the plane, and assigned it
>a refractive ior value. Inside of this box we place a sphere
>with the value you ascribed of rgbf 1. As you have
>mentioned by itself floating in air the object is technicaly
>invisible. When you place the sphere inside the box on the
>other hand it would be treated as something akin to an air
>pocket inside a glass cube. The rays calculated for the space
>in the cube will be different than those for the rest of the box
>object. While technicaly this is an invalid model but it suffices
>to illustrate the point.
>  The hollow keyword is necessary for pov to understand
>exactly what is inside and what is out. If you wanted to
>place a media inside the box and not the sphere pov gets
>confused as to whose surface normal belongs to who. The
>hollow keyword sets this conditionaly but has no other effect
>on solid objects. In effect the object is really still solid. Only
>the way the objects interior is treated is different when media
>effects are being calculated.
>
>Ken Tyler
>
>=Bob wrote:
>
>> I think I get you.
>> Except for the fact that, what I'm thinking about is, since there is no csg
>> taking place and all the objects are set to hollow (meaning the sphere
>> hollowness should be unchanged regardless) why then isn't it still just a
>> totally invisible object? It ought to be as a container object should be 
for
>> media and not ever become visible when an external object encounters it.
>> I remind you of the fact that *all* objects are set to hollow and inversing
>> any would still make for all hollow (or is this the thing, hollow turns
>> off???). Reason of course being that the outside of any is already hollow
>> anyway, and setting them to hollow is like making the entire scene hollow.
>> Right? or am I still not convincing anyone?
>>
>> Message <36660FC3.9D17DED0@Kopp.com>, Nathan Kopp  typed...
>> >
>> >> // refraction seems to jump into an external object
>> >> // which itself does not have an ior
>> >> // 98.91, bob hughes
>> >>
>> >> // when 1 (inverse used) refraction jumps into sphere, 2 does not
>> >
>> >Actually, this is technically not true.  The sphere DOES have an IOR... it 
is
>> >1.0 by default.  Because this is the same as the air (empty space), when
>> >you don't use inverse, you don't see any effect.  However, when you do
>> >use the inverse, as Ken mentioned, the camera is inside the water plane, 
so
>> >there is a change in IOR values when the light beam passes from the water
>> >(ior 1.23) into the sphere (ior 1.0).  Therefore, POV calculates the
>> >refraction angle properly.
>> >
>> >-Nathan
>>
>> --
>>  omniVERSE: beyond the universe
>>   http://members.aol.com/inversez/POVring.html
>> =Bob
>
>
>

-- 
 omniVERSE: beyond the universe
  http://members.aol.com/inversez/POVring.html
=Bob


Post a reply to this message

From: Ken
Subject: Re: Refraction bug(?) this time
Date: 3 Dec 1998 06:51:26
Message: <36667A9F.62493D0D@pacbell.net>
I'm glad you were able to read between the lines in my explanation.
I saw through your logic but was having a hard time trying to present
a model you would understand.
   On issues like this I really wish that some of the super raytracing
guru's hung out reguraly on these group. Someone like Chris Young
himself, having worked on the core code and knowing the exact reasons
that things are structered the way they are, could really be a benneift
to the users of the program. While the docs do a fairly good job of describing the
circumstances, they do not always go into suffecient
detail or list a number of examples illustrating all that is needed
to understand all of the nuances of the features.

Oh well ! Wish in one hand and _ _ _ _ in the other...

Ken Tyler


Post a reply to this message

From: Nieminen Mika
Subject: Re: Refraction bug(?) this time
Date: 3 Dec 1998 13:27:41
Message: <3666d81d.0@news.povray.org>
Ken <tyl### [at] pacbellnet> wrote:
:   Forgetting your thoughts on the hollow key word instead
: lets look at the different objects here and their properties.
: ...

  I have noticed that there is a lot of confusion about hollow/solid
objects, the 'hollow' keyword and whether a 'plane' object is a 2-dimensional
surface or not.
  For example, I remember a sample scene in the official distribution
of povray (at least pov3.0; I haven't checked 3.1) with a wall made this
way:
plane
{ z,100 hollow
}
  There wasn't any reason why that wall plane should be hollow. Obviously
the maker of that sample scene put that keyword to get rid of the
"camera inside non-hollow object" warning.
  (of course the right way to make that wall should be:
plane
{ -z,-100
} )

  I have frequently seen people confused with the plane object. They
obviously think about it as a 2D sheet, with no inside part, with both
sides as outside.
  Another big confusion is the concept 'solid and hollow object' and the
keyword 'hollow'. They don't know that solidness and hollowness have
nothing to do with CSG but only with media. There is also confusion about
the fact that povray actually only models surfaces, not true solid 3D
objects.
  I'm not saying I understand everyting, of course :)
  I'm still a little confused with the 'clipped_by' statement. I don't
know, if you clip off a part of an object, where is the inside and
where the outside of the object, specially at the hole. This will affect
only the media inside the object, of course. I have never tested it. Anyone
know something about this?

-- 
main(i){char*_="BdsyFBThhHFBThhHFRz]NFTITQF|DJIFHQhhF";while(i=
*_++)for(;i>1;printf("%s",i-70?i&1?"[]":" ":(i=0,"\n")),i/=2);} /*- Warp. -*/


Post a reply to this message

From: Ken
Subject: Re: Refraction bug(?) this time
Date: 3 Dec 1998 14:18:13
Message: <3666E357.4309B895@pacbell.net>
Nieminen Mika wrote:

>   I have frequently seen people confused with the plane object. They
> obviously think about it as a 2D sheet, with no inside part, with both
> sides as outside.

Agreed on this one. And what makes it even more confusing isif you apply a solid
texture to the plane and your camera is on
the inside you can still see your scene clearly. Not true though
if you put your camera inside a solid textured box. This makes
it hard to grasp the relationships.

>   I'm not saying I understand everyting, of course :)

Yowser. And I thought I was alone in the dark.

>   I'm still a little confused with the 'clipped_by' statement. I don't
> know, if you clip off a part of an object, where is the inside and
> where the outside of the object, specially at the hole. This will affect
> only the media inside the object, of course. I have never tested it. Anyone
> know something about this?

That is an interesting point. I have a similar confusion about what
happens when you declare a 2D box like :

box{<-1,-1,0>,<1,1,0>}

This will render a single face of a 1x1x0(?) box. Where is the inside
and outside of such an object ? If a take six such 2D faces and
construct a cube from them using a union would I have to apply
the hollow state to get media to work inside ?

The same with disks. Is there a surface normal for the disk object
and how does it effect media ?

Stay tune for the answers to these questions and more in next weeks
dramatic episode of "All my Renders" ! Immediatly following our
show "One Life to Raytrace".

An now a word from our sponsers...

Ken Tyler


Post a reply to this message

From: =Bob
Subject: Re: Refraction bug(?) this time
Date: 3 Dec 1998 15:46:06
Message: <3666f88e.0@news.povray.org>
Well, back to the problem at hand.
I was a believer, for a brief moment or two, that the ior was being dealt with 
correctly according to the laws of POV-Ray then it occured to me...
Why was I never seeing same-such effect when using the other primitives, ie. a 
sphere, causing all "outside" areas to be affected with its ior?
I tried replacing the plane in my example with one and it does not cause the 
refraction to exist outwardly. Who already could have guessed that one? Most 
anybody I suppose.
Now see how the plane is awkwardly doing something other objects do not?
That means a plane (or other things too?) is not following the same principal. 
I understood the nature of them already, that they have inside and outside. 
Guess that's why this caught my attention so much, if other shapes in csg (or 
not, remember my example uses none) did this it would be a disaster since many 
csg-created objects use an inverse to get the right construction.
A plane *is* capable of csg too, as many may know, by keeping the 
inside/outside in mind, same goes for all the other primitives capable of csg.
Okay, carry on...
Btw, it's nice to have people here who can discuss this stuff.
Thanks all.

Message <3666E357.4309B895@pacbell.net>, Ken  typed...
>
>Nieminen Mika wrote:
>
>>   I have frequently seen people confused with the plane object. They
>> obviously think about it as a 2D sheet, with no inside part, with both
>> sides as outside.
>
>Agreed on this one. And what makes it even more confusing isif you apply a 
solid
>texture to the plane and your camera is on
>the inside you can still see your scene clearly. Not true though
>if you put your camera inside a solid textured box. This makes
>it hard to grasp the relationships.
>
>>   I'm not saying I understand everyting, of course :)
>
>Yowser. And I thought I was alone in the dark.
>
>>   I'm still a little confused with the 'clipped_by' statement. I don't
>> know, if you clip off a part of an object, where is the inside and
>> where the outside of the object, specially at the hole. This will affect
>> only the media inside the object, of course. I have never tested it. Anyone
>> know something about this?
>
>That is an interesting point. I have a similar confusion about what
>happens when you declare a 2D box like :
>
>box{<-1,-1,0>,<1,1,0>}
>
>This will render a single face of a 1x1x0(?) box. Where is the inside
>and outside of such an object ? If a take six such 2D faces and
>construct a cube from them using a union would I have to apply
>the hollow state to get media to work inside ?
>
>The same with disks. Is there a surface normal for the disk object
>and how does it effect media ?
>
>Stay tune for the answers to these questions and more in next weeks
>dramatic episode of "All my Renders" ! Immediatly following our
>show "One Life to Raytrace".
>
>An now a word from our sponsers...
>
>Ken Tyler
>

-- 
 omniVERSE: beyond the universe
  http://members.aol.com/inversez/POVring.html
=Bob


Post a reply to this message

From: Nieminen Mika
Subject: Re: Refraction bug(?) this time
Date: 4 Dec 1998 08:55:11
Message: <3667e9bf.0@news.povray.org>
=Bob <ver### [at] aolcom> wrote:
: I understood the nature of them already, that they have inside and outside. 
: Guess that's why this caught my attention so much, if other shapes in csg (or 
: not, remember my example uses none) did this it would be a disaster since many 
: csg-created objects use an inverse to get the right construction.
: A plane *is* capable of csg too, as many may know, by keeping the 
: inside/outside in mind, same goes for all the other primitives capable of csg.

  I think you haven't completely understood the plane object.
  You say: "if other shapes in csg did this it would be a disaster". Actually
all other shapes DO this. Just put a box or a sphere or whatever in the
place of the plane and make it inverse. You will get the same effect.

  Most of the objects have well defined inside and outside. Everything that
is inside the surface of a sphere, is the inside of the sphere, and
everything else is outside (this may sound very trivial, but it's important
to understans). Everything that is below the surface of a plane is the
inside of the plane, and everything else is outside.
  Now, when you apply the 'inverse' keyword, this is changed: Everything
that is inside the sphere surface becomes outside, and everything outside
the sphere surface is now inside. When you make an 'inverse' plane,
everything that is below the plane becomes outside, and everything else
is inside.
  Now, suppose you have a plane and a sphere:

plane { y,-10 }
sphere { 0,1 }

  The sphere is outside the plane because it's above the plane (the plane
normal points upwards and it's located 10 units in the negative y direction).
  If we make this:

plane { y,-10 inverse }
sphere { 0,1 }

now the sphere is _inside_ the plane, because now everything above the plane
is inside it and everything below the plane is outside it.
  This works with other primitives too:

sphere { -y*10,1 }
sphere { 0,1 }

  The second sphere is outside the first sphere, but:

sphere { -y*10,1 inverse }
sphere { 0,1 }

now the second sphere is _inside_ the first sphere. The interior of the
first sphere has became the outside part of it. This may sound confusing,
I know...

  You also don't seem to know how 'inverse' works in CSG. Well, let's see:
  Suppose we have this:

intersection
{ sphere { 0,2 }
  sphere { 0,1 inverse }
}

  Intersection means that a point is inside it if it's inside all the objects
in the intersection.
  A point can be inside the first sphere only if it's at a distance less than
2 from the origin. A point can be inside the second sphere only of it's at
a distance _greater_ than 1 from the origin (because the second sphere is
inversed). So a point is inside this intersection only if it's at a distance
less than 2 and greater than 1 from the origin.
  This means that a point that is, for example, at a distance of 3 from the
origin is outside the intersection, and thus will not be affected by the
interior of it.
  If you don't believe this, you can try it with the "problematic" primivite,
the plane. For example:

intersection
{ sphere { 0,2 }
  plane { y,0 inverse }
}

  A point is inside this intersection if it's inside the sphere and above
the plane (because the plane is inversed). This means that a point can
be inside the intersection only if it's at a distance less than 2 from
the origin and also in the positive y direction.
  So a point that is, for example, 3 units above the plane is not inside the
intersection and it will not be affected by its interior.

  So there's nothing problematic about the plane.
  There's absolutely no difference between a sphere, a box or a plane when
we are talking about CSG or inside and outside. The only difference is
that the plane is infinite, but that's just a mathematical detail, and
we shouldn't get confused by such little peculiarity.

-- 
main(i){char*_="BdsyFBThhHFBThhHFRz]NFTITQF|DJIFHQhhF";while(i=
*_++)for(;i>1;printf("%s",i-70?i&1?"[]":" ":(i=0,"\n")),i/=2);} /*- Warp. -*/


Post a reply to this message

From: =Bob
Subject: Re: Refraction quirk(!)
Date: 5 Dec 1998 04:17:31
Message: <3668fa2b.0@news.povray.org>
Well, I tried a sphere in place of the plane and it does not affect the 
"invisible" sphere like the plane did (make a refractive appearance occur at 
that spheres surface).
If you tried this also, and got the same affect as the plane/sphere combo did, 
I must have a faulty pvengine or something here :)
Sorry you felt you had to go into that lengthy explanation of inverse, etc. 
(save for the others reading here), as I already know enough of that stuff, 
only get confused while actually making something. Check my gallery out and 
you'll see I've done plenty of csg, though I suppose I'm like many of us POV 
users and am constantly at odds with the script writing. Much trial and error 
always going on.

Well, before I posted this I decided to try a few other primitives in place of 
the plane and guess what I found...
Ones that *didn't* cause the refraction "jump" into the test sphere:
box, cylinder, cone, disc, sphere.
What *did* cause refraction at the test sphere surface:
blob (made up of 2 spheres, just so it was typical at least).
Come on now, try this stuff out for yourselves. There is something amiss.

Anyway, I say again, the other primitives I've tried do not do the same 
effect. So, suppose it is the infinite nature causing this? Or solely a plane 
thing? I'm not going to try every possible object to find out I think, I'll 
just wait to see what happens in the scenes I make and be surprised.

 ;|

Message <3667e9bf.0@news.povray.org>, Nieminen Mika  typed...
>
>  I think you haven't completely understood the plane object.
>  You say: "if other shapes in csg did this it would be a disaster". Actually
>all other shapes DO this. Just put a box or a sphere or whatever in the
>place of the plane and make it inverse. You will get the same effect.
>
>  Most of the objects have well defined inside and outside. Everything that
>is inside the surface of a sphere, is the inside of the sphere, and
>everything else is outside (this may sound very trivial, but it's important
>to understans). Everything that is below the surface of a plane is the
>inside of the plane, and everything else is outside.
>  Now, when you apply the 'inverse' keyword, this is changed: Everything
>that is inside the sphere surface becomes outside, and everything outside
>the sphere surface is now inside. When you make an 'inverse' plane,
>everything that is below the plane becomes outside, and everything else
>is inside.
---snip---
>  This means that a point that is, for example, at a distance of 3 from the
>origin is outside the intersection, and thus will not be affected by the
>interior of it.
>  If you don't believe this, you can try it with the "problematic" primivite,
>the plane. For example:
>
>intersection
>{ sphere { 0,2 }
>  plane { y,0 inverse }
>}
>
>  A point is inside this intersection if it's inside the sphere and above
>the plane (because the plane is inversed). This means that a point can
>be inside the intersection only if it's at a distance less than 2 from
>the origin and also in the positive y direction.
>  So a point that is, for example, 3 units above the plane is not inside the
>intersection and it will not be affected by its interior.
>
>  So there's nothing problematic about the plane.
>  There's absolutely no difference between a sphere, a box or a plane when
>we are talking about CSG or inside and outside. The only difference is
>that the plane is infinite, but that's just a mathematical detail, and
>we shouldn't get confused by such little peculiarity.
>

-- 
 omniVERSE: beyond the universe
  http://members.aol.com/inversez/POVring.html
=Bob


Post a reply to this message

From: =Bob
Subject: Refraction quirk(!) test scene
Date: 5 Dec 1998 05:02:52
Message: <366904cc.0@news.povray.org>
As you may have already guessed I'm determined to show everyone this 
supposedly *normal* behaviour of refractive planes (and blobs, and ?) that 
some other primitives do not exhibit.
Please do try this test scene out and see for yourselves what I'm talking 
about. I've made it easy to test several basic primitives out.
Although, I am quite convinced (with the help of a brave few) that the plane 
is doing the correct thing according to what you would expect of it when 
inversing its properties.

// Refraction bug?
// refraction seems to jump into an external object.
// which itself does not have an ior (no csg used).
// only the plane and blob do this, others checked here do not.
// 98.92, bob hughes

// when 1 (inverse used) refraction jumps into sphere, 2 does not
#declare RB = 1;  //use 1 or 2

// 1=plane, 2=disc, 3=sphere, 4=cylinder, 5=cone, 6=box, 7=blob
#declare Primitive = 7;

// test scene below here
light_source { 0*x color rgb 1 }
camera {location <0,4,-9> look_at <0,3,0>}

// "invisible" sphere (no refraction used)
sphere {0,3
  hollow on
 pigment {rgbf<1,1,1,1>} normal {wrinkles .1}
  finish {ambient .1 diffuse .6 reflection 0 reflection_exponent 0}
 translate 3*y
}

// strange plane and blob (refraction can jump into sphere)
// these have a surface coinciding with near-center of the "invisible" sphere
#switch (Primitive)
#case (1)
plane {y,3
#break
#case (2)
disc {<0,3,0>,<0,1,0>,6
#break
#case (3)
sphere {<0,-3,0>,6
#break
#case (4)
cylinder {-3*y,3*y,6
#break
#case (5)
cone {-3*y,9,3*y,0
#break
#case (6)
box {<-3,-3,-3>,<3,3,3,>
#break
#case (7)  //single or multiple blob components have same effect
blob {threshold .33 sphere {<0,-3,0>,9,1} //sphere {<0,0,0>,4,1}
#break
#end

 hollow on
 texture {pigment {rgbf <1,1,1,.5>}
  normal {wrinkles .5 turbulence .5 triangle_wave}
   finish {phong 1 phong_size 100
//please note that reflection is turned off completely
   reflection 0 //reflection_exponent 1
   }
  }
 
 interior {ior 1.23} //some refraction for test primitives

#switch (RB)
 #case (1)
   inverse  // the culprit? or is it simply a refraction bug alone
 #break
 #case (2)
   //no inverse used
 #end
}

// base plane
plane {y,0 hollow on
 texture {pigment {rgb<.5,1,.5>}
  finish {ambient .3 diffuse .9}}
}

sky_sphere	// evening
{
  pigment
  {
    gradient y
color_map { [0.0 color rgb<0.9,0.5,0.475>] [1.0 color rgb<0.2,0.45,0.65>] }
  }
}
//END

-- 
 omniVERSE: beyond the universe
  http://members.aol.com/inversez/POVring.html
=Bob


Post a reply to this message

<<< Previous 3 Messages Goto Initial 10 Messages

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