POV-Ray : Newsgroups : povray.general : index of refraction ("ior") fails to influence on _transmitted_ light Server Time
4 Nov 2024 13:32:19 EST (-0500)
  index of refraction ("ior") fails to influence on _transmitted_ light (Message 1 to 10 of 13)  
Goto Latest 10 Messages Next 3 Messages >>>
From: chefboss
Subject: index of refraction ("ior") fails to influence on _transmitted_ light
Date: 14 Aug 2007 12:35:01
Message: <web.46c1d8f6ec2f0da46f43f7c30@news.povray.org>
When rendering one of the test-scenes with (Version 3.6.1 (g++ 3.4.1 @
i686-pc-linux-gnu) there is an obviously non-realistic behaviour:
Light, transmitted by a glass of given refraction, does not behave correctly
when projected onto a plane behind the sphere. The refracted light gives
ever the same pattern, independently of the given "ior".

I posted this to the bug-report-site, but the last previous post there is
from 2006, so here again: for the effect to be seen, either use the
following two files and run them yourself, or just download them from
    http://manganese-blue.com/index.php?main_page=page_3,
where you also can examine the readily-rendered images.

> following 2 files to be saved into files and run on any standard linux

----------------------------------save as eg. "driving.pl"------------------
--------then chmod 755, then run, but save file below first----------------
--------nothing magic happens: just put values for "ior" into the scenefile-
--------and post-processing of the generated images----------------
#!/usr/bin/perl
$=$/;
system "mkdir anim";
system "rm anim/*";
for($i=1;$i<=1.9;$i+=0.1){
        print $i;
        system "cat reftest.pov | sed 's/xiorx/$i/g' > actual.pov";
        system "povray +Q9 actual.pov";
        $istr='"'.'index of refraction (ior): '.$i.'"';
        system "convert actual.png -fill white -draw 'text 10,10 $istr'
actual$i.png";
        system "mv actual$i.png anim/";
}
--------------------------------------------------------------------------

------------scene-file (name it "reftest.pov", so that the above script---
--------------can find and manipulate/execute it several times -----------
global_settings {
  assumed_gamma 2.2
  max_trace_level 25
}

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

camera {
   location  <0.75, 3.5, -3.5>
   direction <0.0,  0.0,  0.5>       //  "wide-angle" view
   up        <0.0,  1.0,  0>
   right     <4/3,  0.0,  0>
   look_at   <0,    0,   -1>}

// Light sources, two to the front, right, on from the left, rear.
//light_source {<-30, 11,  20> color White}
//light_source {< 31, 12, -20> color White}
light_source {< 32, 11, -20> color LightGray}
light_source {< 32, 11, -20> color LightGray}
light_source {< 32, 11, -20> color LightGray}
light_source {< 32, 11, -20> color LightGray}
light_source {< 32, 11, -20> color LightGray}

union {
   // A green glass ball inside of a box-shaped frame
   sphere { <0, 0, 0>, 1.75
      interior{
         caustics 1.0
         ior xiorx
      }
      texture {
      //   T_Glass1
      Glass2
//      White_Marble
        pigment {color green 0.90 filter 0.85}
         finish {
            phong 1 phong_size 300         // Very tight highlights
            reflection 0.15                // Needs a little reflection
added
           // reflection xiorx                // Needs a little reflection
added
         }
      }
   }

 plane { y, -1.5
   texture {
 //      T_Stone1
        White_Marble
      pigment {
         octaves 3
         rotate 90*z
      }
      finish { reflection 0.10 }
   }
}
--------------------------------------------------------------------------

Upon examination of the generated pics it's clear that the focal-length of
the sphere-lens does not vary as it should with the ior.

Again: see http://manganese-blue.com/index.php?main_page=page_3
for the ready stuff.

More bugs to follow ...


Post a reply to this message

From: Christian Froeschlin
Subject: Re: index of refraction ("ior") fails to influence on _transmitted_ light
Date: 14 Aug 2007 15:17:07
Message: <46c1ffb3$1@news.povray.org>
Try with photons instead of "caustics"


Post a reply to this message

From: Warp
Subject: Re: index of refraction ("ior") fails to influence on _transmitted_ light
Date: 14 Aug 2007 16:46:37
Message: <46c214ac@news.povray.org>
chefboss <chi### [at] manganese-bluecom> wrote:
> When rendering one of the test-scenes with (Version 3.6.1 (g++ 3.4.1 @
> i686-pc-linux-gnu) there is an obviously non-realistic behaviour:
> Light, transmitted by a glass of given refraction, does not behave correctly
> when projected onto a plane behind the sphere. The refracted light gives
> ever the same pattern, independently of the given "ior".

  What makes you think it's a bug? There's nothing working differently
from how it should be working.
  'caustics' is more or less obsolete. Use 'photons' instead.

-- 
                                                          - Warp


Post a reply to this message

From: Alain
Subject: Re: index of refraction ("ior") fails to influence on _transmitted_ light
Date: 14 Aug 2007 21:40:17
Message: <46c25981$1@news.povray.org>
chefboss nous apporta ses lumieres en ce 2007/08/14 12:31:
> When rendering one of the test-scenes with (Version 3.6.1 (g++ 3.4.1 @
> i686-pc-linux-gnu) there is an obviously non-realistic behaviour:
> Light, transmitted by a glass of given refraction, does not behave correctly
> when projected onto a plane behind the sphere. The refracted light gives
> ever the same pattern, independently of the given "ior".
> 
> I posted this to the bug-report-site, but the last previous post there is
> from 2006, so here again: for the effect to be seen, either use the
> following two files and run them yourself, or just download them from
>     http://manganese-blue.com/index.php?main_page=page_3,
> where you also can examine the readily-rendered images.
> 
>> following 2 files to be saved into files and run on any standard linux
> 
> ----------------------------------save as eg. "driving.pl"------------------
> --------then chmod 755, then run, but save file below first----------------
> --------nothing magic happens: just put values for "ior" into the scenefile-
> --------and post-processing of the generated images----------------
> #!/usr/bin/perl
> $=$/;
> system "mkdir anim";
> system "rm anim/*";
> for($i=1;$i<=1.9;$i+=0.1){
>         print $i;
>         system "cat reftest.pov | sed 's/xiorx/$i/g' > actual.pov";
>         system "povray +Q9 actual.pov";
>         $istr='"'.'index of refraction (ior): '.$i.'"';
>         system "convert actual.png -fill white -draw 'text 10,10 $istr'
> actual$i.png";
>         system "mv actual$i.png anim/";
> }
Why don't you use the integrated animation feature of POV-Ray?
in an ini file:
+fn // set output to PNG so you don't need to convert.
+kff 9 // start an animation of 9 frames

Then, you use the internal clock variable to change the ior:
interior{ ior 1.1 + clock/2}// make the ior go from 1.1 to 1.6.
> --------------------------------------------------------------------------
> 
> ------------scene-file (name it "reftest.pov", so that the above script---
> --------------can find and manipulate/execute it several times -----------
> global_settings {
>   assumed_gamma 2.2
//deprecated and no longer supported in future versions starting with V3.7
>   max_trace_level 25
> }
> 
> #include "colors.inc"
> #include "shapes.inc"
> #include "textures.inc"
> #include "glass.inc"
> #include "stones.inc"
> 
> camera {
>    location  <0.75, 3.5, -3.5>
>    direction <0.0,  0.0,  0.5>       //  "wide-angle" view
>    up        <0.0,  1.0,  0>// default value
>    right     <4/3,  0.0,  0>// default value
>    look_at   <0,    0,   -1>}
> 
> // Light sources, two to the front, right, on from the left, rear.
> //light_source {<-30, 11,  20> color White}
> //light_source {< 31, 12, -20> color White}
> light_source {< 32, 11, -20> color LightGray}
> light_source {< 32, 11, -20> color LightGray}
> light_source {< 32, 11, -20> color LightGray}
> light_source {< 32, 11, -20> color LightGray}
> light_source {< 32, 11, -20> color LightGray}
> 
> union {
>    // A green glass ball inside of a box-shaped frame
>    sphere { <0, 0, 0>, 1.75
>       interior{
>          caustics 1.0
>          ior xiorx
>       }
>       texture {
>       //   T_Glass1
>       Glass2
> //      White_Marble
>         pigment {color green 0.90 filter 0.85}
>          finish {
>             phong 1 phong_size 300         // Very tight highlights
>             reflection 0.15                // Needs a little reflection
> added
>            // reflection xiorx                // Needs a little reflection
> added
>          }
>       }
>    }
> 
>  plane { y, -1.5
>    texture {
>  //      T_Stone1
>         White_Marble
>       pigment {
>          octaves 3
>          rotate 90*z
>       }
>       finish { reflection 0.10 }
>    }
> }
> --------------------------------------------------------------------------
> 
> Upon examination of the generated pics it's clear that the focal-length of
> the sphere-lens does not vary as it should with the ior.
Normal with the caustics keyword. Working as intended.
> 
> Again: see http://manganese-blue.com/index.php?main_page=page_3
> for the ready stuff.
> 
> More bugs to follow ...
> 
> 
You are using the, more or less obsolete, caustics feature. It's OK if you have 
a transparent plane with normals to simulate the caustics you find on the bottom 
of a swiming pool, but not much more.
The short commings of the caustics aproach: no caustics outside the shadowed 
area, independent of the distance,independent of the ior AND no reflection caustics.

To get ralistic focalisation, you need to use photons. A photons block in 
global_settings, another in the object to make it interact with the photons.

-- 
Alain
-------------------------------------------------
You know you've been raytracing too long when you look at a matrix transform and 
know instantly what it does.
John VanSickle


Post a reply to this message

From: chefboss
Subject: Re: index of refraction ("ior") fails to influence on _transmitted_ light
Date: 15 Aug 2007 11:30:01
Message: <web.46c31ae183113be96f43f7c30@news.povray.org>
I might like to have the transparent matter behaving like in the real world,
to visualize some effects and therefore obeying the laws of nature. Scenery
would not be very complicated and anyhow auto-generated (therefrom the
perl-driving manner (perl reading eg. from fortran-output)).

Before I have to implement it in _new_, here what I intend to do:
  - have _lots_ of objects, each with refraction _and_ reflection _and_
absorption
       of some colors
  - (refraction, absorption, reflection) _not_ the same for all the objects
  - light passing lots of those objects, not just one or two
  - embed the objects in each other, with the different ior and
reflectivities in
     action (as for (simple) example inside of a sphere of given ior lots of
     smaller spheres with _different_ ior's (smaller or bigger), thereby
giving
     a lot of total-reflections and so on)
As you see, the above is quite impossible to be faked by any "effects" and
has to be traced physically. Of course it would use a lot of computing
power and I didnt say povray were bad ... .

By the way: How comes that as the author of this question-page does appear a
"Christian Froeschlin" (see http://news.povray.org/povray.general/ )?
He gave only a tiny comment, and I did author it (as it seems to me)(i'm
just asking).


Post a reply to this message

From: Warp
Subject: Re: index of refraction ("ior") fails to influence on _transmitted_ light
Date: 15 Aug 2007 12:29:46
Message: <46c329fa@news.povray.org>
chefboss <chi### [at] manganese-bluecom> wrote:
> I might like to have the transparent matter behaving like in the real world,
> to visualize some effects and therefore obeying the laws of nature.

  I'm not really sure what is it that you are asking here.

  The answer has already given to you: Photon mapping.
http://povray.org/documentation/view/3.6.1/424/

-- 
                                                          - Warp


Post a reply to this message

From: Tim Attwood
Subject: Re: index of refraction ("ior") fails to influence on _transmitted_ light
Date: 15 Aug 2007 17:19:17
Message: <46c36dd5@news.povray.org>
> By the way: How comes that as the author of this question-page does appear 
> a
> "Christian Froeschlin" (see http://news.povray.org/povray.general/ )?
> He gave only a tiny comment, and I did author it (as it seems to me)(i'm
> just asking).

It's your newsreader.  The server had a few hours of downtime
and lost a few messages because of a hardware problem,
you need to reset your local copy of the newsgroup so you can
re-download the headers.  Your message shows up correct for
me.


Post a reply to this message

From: Alain
Subject: Re: index of refraction ("ior") fails to influence on _transmitted_ light
Date: 16 Aug 2007 18:05:23
Message: <46c4ca23$1@news.povray.org>
chefboss nous apporta ses lumieres en ce 2007/08/15 11:25:
> I might like to have the transparent matter behaving like in the real world,
> to visualize some effects and therefore obeying the laws of nature. Scenery
> would not be very complicated and anyhow auto-generated (therefrom the
> perl-driving manner (perl reading eg. from fortran-output)).
> 
> Before I have to implement it in _new_, here what I intend to do:
>   - have _lots_ of objects, each with refraction _and_ reflection _and_
> absorption
>        of some colors
>   - (refraction, absorption, reflection) _not_ the same for all the objects
>   - light passing lots of those objects, not just one or two
>   - embed the objects in each other, with the different ior and
> reflectivities in
>      action (as for (simple) example inside of a sphere of given ior lots of
>      smaller spheres with _different_ ior's (smaller or bigger), thereby
> giving
>      a lot of total-reflections and so on)
> As you see, the above is quite impossible to be faked by any "effects" and
> has to be traced physically. Of course it would use a lot of computing
> power and I didnt say povray were bad ... .
> 
> By the way: How comes that as the author of this question-page does appear a
> "Christian Froeschlin" (see http://news.povray.org/povray.general/ )?
> He gave only a tiny comment, and I did author it (as it seems to me)(i'm
> just asking).
> 
> 
> 
> 
> 
> 
> 
For that, you will need to bump up max_trace_level, possibly to it's maximum of 256.
To show the effect of light comming trough, your only choice will be to use 
photons and make all transparent ana all reflective objects photons targets.
To make things more realistic, you'll need to add some dispersion, in addition 
of the ior, to the interior.
To reproduce the internal coloration, you'll need to use 
fade_color/fade_distance instead of just coloring the object's surface.
To prevent black spots, you may need to change adc_bailout to a somewhat larger 
value than the default of 1/256.
As you project to have many "active" objects, your photons count will become 
very high: probably over 100 000 000!
Photons computations will be prety long. It will also use a big chunk of memory.

If you have some lense like objects and want them to actualy project images of 
other objects on some close by surface, you'll need LOTS of samples.
This will require even more time, and still more memory.

Just hoping that you have a powerfull CPU(s)/FPU(s) and tons or RAM.
If on multicore or multiprocessor, try the beta 3.7 to be able to benefit from them.

-- 
Alain
-------------------------------------------------
Educate and inform the whole mass of the people... They are the only sure
reliance for the preservation of our liberty.
Thomas Jefferson


Post a reply to this message

From: Christian Froeschlin
Subject: Re: index of refraction ("ior") fails to influence on _transmitted_ light
Date: 16 Aug 2007 18:19:56
Message: <46c4cd8c$1@news.povray.org>
Tim Attwood wrote:
>>By the way: How comes that as the author of this question-page does appear 
>>a
>>"Christian Froeschlin" (see http://news.povray.org/povray.general/ )?
>>He gave only a tiny comment, and I did author it (as it seems to me)(i'm
>>just asking).
> 
> 
> It's your newsreader.  The server had a few hours of downtime
> and lost a few messages because of a hardware problem,
> you need to reset your local copy of the newsgroup so you can
> re-download the headers.  Your message shows up correct for
> me. 

Well, actually it seems that the web interface of the forum
itself would need to update its local copies and/or overview
pages. Note that the overview page lists a title starting with
"re:", and that I have no interest in usurping your thread ;)


Post a reply to this message

From: Thorsten Froehlich
Subject: Re: index of refraction ("ior") fails to influence on _transmitted_light
Date: 17 Aug 2007 02:09:25
Message: <46c53b95$1@news.povray.org>
Christian Froeschlin wrote:
> Tim Attwood wrote:
>>> By the way: How comes that as the author of this question-page does
>>> appear a
>>> "Christian Froeschlin" (see http://news.povray.org/povray.general/ )?
>>> He gave only a tiny comment, and I did author it (as it seems to me)(i'm
>>> just asking).
>>
>>
>> It's your newsreader.  The server had a few hours of downtime
>> and lost a few messages because of a hardware problem,
>> you need to reset your local copy of the newsgroup so you can
>> re-download the headers.  Your message shows up correct for
>> me. 
> 
> Well, actually it seems that the web interface of the forum
> itself would need to update its local copies and/or overview
> pages. Note that the overview page lists a title starting with
> "re:", and that I have no interest in usurping your thread ;)

The web interface keeps track of messages an auto-incremented index. Due to
the crash when restoring some information those auto-counts can change in
certain ways. For speed the web interface uses only that number (rather than
the actual post id from the server) to sort messages*.

	Thorsten, POV-Team


* Before somebody asks: No, the date and time of a post won't work for
sorting because they come from the posters' newsreaders and are hardly ever
accurate (way too many people with wrong clock or timezone settings).


Post a reply to this message

Goto Latest 10 Messages Next 3 Messages >>>

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