POV-Ray : Newsgroups : povray.binaries.images : Photons and dispersion. Server Time
17 Nov 2024 02:22:04 EST (-0500)
  Photons and dispersion. (Message 1 to 7 of 7)  
From: Bruno Cabasson
Subject: Photons and dispersion.
Date: 8 Sep 2006 08:30:00
Message: <web.450160b5141fe20cf5fba6ef0@news.povray.org>
Hi all!

Here is a simple scene with photons and dispersion for a simple shape made
of glass. The dispersion coefficient is high (1.035) in order to produce a
desired exagerated effect.

I have one concern with this result: the shadow of the shape on the ground
does not seem to be anti-aliased. What's up?

I also see bandings and white spots near the Sphere/cylinder edge on the
shadow. Numerical artifacts for the latter, and too few photons for the
former?

The render time is about 1:15 hours, mainly taken by the shape, on Win, P4,
2.8 GHz for 1024*768 resolution.

The code is short so I can put it hereafter.

Comments and suggestions welcome.

    Regards.

         Bruno.

// Persistence of Vision Ray Tracer Scene Description File
// File: ?.pov
// Vers: 3.5
// Desc: Basic Scene Example
// Date: mm/dd/yy
// Auth: ?
//

#version 3.5;

#include "colors.inc"
#include "stones.inc"


global_settings {
  assumed_gamma 1.0
  max_trace_level 20
  photons
  {
     spacing 0.003
  }
}

// ----------------------------------------

camera {
  location  <0.0, 0.5, -4.0>
  angle 50
  right     x*image_width/image_height
  look_at   <0.0, 0.,  0.0>
}

sky_sphere {
  pigment {
    gradient y
    color_map {
      [0.0 rgb <0.6,0.7,1.0>]
      [0.7 rgb <0.0,0.1,0.8>]
    }
  }
}

light_source {
  <0, 0, 0>            // light's position (translated below)
  color rgb <1, 1, 1>  // light's color
  translate <-30, 35, 30>
  photons
  {
    reflection on
    refraction on
  }
}

// ----------------------------------------

plane {
  y, -1
  pigment {rgb 0}
  normal {bozo 0.5 scale 0.0001}
  finish {specular 0.4 roughness 0.1}
}

merge
{
  sphere {0, 1}
  cylinder {0, 2*y, 0.25}
  sphere {2*y, 0.3}
  texture {
    pigment {rgbt 1}
    normal {bozo 0.75 scale 0.2}
    finish{
      specular 0.8 roughness 0.015
      reflection {0.2, 0.5 fresnel}
      conserve_energy
    }
  }
  interior
  {
    ior 1.3
    fade_color Green fade_power 1001 fade_distance 2
    dispersion 1.035 dispersion_samples 30
  }
  photons
  {
    target 1
    reflection on
    refraction on
    collect off
  }
  rotate 180*z
  rotate 60*z
  rotate -20*y
  translate <-1, 0.5, 3>
  //no_image
}


Post a reply to this message


Attachments:
Download 'photons_1.jpg' (174 KB)

Preview of image 'photons_1.jpg'
photons_1.jpg


 

From: Le Forgeron
Subject: Re: Photons and dispersion.
Date: 8 Sep 2006 08:49:34
Message: <450166de$1@news.povray.org>
Bruno Cabasson scripsit::
> Hi all!
> 
> Here is a simple scene with photons and dispersion for a simple shape made
> of glass. The dispersion coefficient is high (1.035) in order to produce a
> desired exagerated effect.
> 
> I have one concern with this result: the shadow of the shape on the ground
> does not seem to be anti-aliased. What's up?
> 

Ponctual light do not produce soft-shadow. you would need an
area_light for that kind of effect.

> I also see bandings and white spots near the Sphere/cylinder edge on the
> shadow. Numerical artifacts for the latter, and too few photons for the
> former?
> 

I do not know. may be it's just how it would be in reality...

> The render time is about 1:15 hours, mainly taken by the shape, on Win, P4,
> 2.8 GHz for 1024*768 resolution.
> 
> The code is short so I can put it hereafter.

Thanks!

> 
> Comments and suggestions welcome.
> 
>     Regards.


-- 
Eifersucht ist die Leidenschaft, die mit Eifer sucht, was Leiden
schafft.

Eco: -8.75 Soc: -6.72
http://www.politicalcompass.org/


Post a reply to this message

From: Cousin Ricky
Subject: Re: Photons and dispersion.
Date: 8 Sep 2006 15:00:00
Message: <web.4501bcad710e67c043a5e2560@news.povray.org>
> Bruno Cabasson scripsit::
> >
> > I have one concern with this result: the shadow of the shape on the ground
> > does not seem to be anti-aliased. What's up?
>
Le Forgeron <jgr### [at] freefr> wrote:
> Ponctual light do not produce soft-shadow. you would need an
> area_light for that kind of effect.

That doesn't explain the aliasing, though.  With proper anti-aliasing and no
area light, the shadow should have a sharp, but smooth edge.  (An area light
will almost certainly bypass the aliasing problem, but you will pay a lot
more than an hour 15.)

My first thought was too high an antialias_threshold value, but the green
part of the sphere has subtler tones than the shadow, yet it looks fine.


Post a reply to this message

From: Cousin Ricky
Subject: Re: Photons and dispersion.
Date: 8 Sep 2006 17:00:00
Message: <web.4501d3fb710e67c043a5e2560@news.povray.org>
"Bruno Cabasson" <bru### [at] alcatelaleniaspacefr> wrote:
>
> I have one concern with this result: the shadow of the shape on the ground
> does not seem to be anti-aliased. What's up?

It's two things.

1. The threshold *is* too high.  Set Antialias_Threshold to 0.02, or use
+A0.02.  (Most scenes won't need it this low, but this scene does.)  I also
figured out the reason why the glass seemed antialiased but not the shadow:
the dispersion!  As the light spread out inside the glass, it automatically
fudged the aliasing artifacts.

2. Ooh, i almost forgot.  Use +AM2.  Never mind that, just add
Sampling_Method=2 to your povray.ini file and be done with it.


Post a reply to this message

From: jtico
Subject: Re: Photons and dispersion.
Date: 10 Sep 2006 20:06:48
Message: <4504a898@news.povray.org>
I just wanted to say that megapov did an amazing job with your scenefile

Scene Statistics
   Finite objects:            1
   Infinite objects:          1
   Light sources:             1
   Total:                     3
Render Statistics
Image Resolution 1280 x 1024
----------------------------------------------------------------------------
Pixels:          1310720   Samples:         1537600   Smpls/Pxl: 1.17
Rays:          136549780   Saved:          20564619   Max Level: 14/20
----------------------------------------------------------------------------
Ray->Shape Intersection          Tests       Succeeded  Percentage
----------------------------------------------------------------------------
Cone/Cylinder                166648224        27585342     16.55
CSG Merge                    166648224        83774023     50.27
Plane                        166648224        62594811     37.56
Sphere                       333296448        94246382     28.28
----------------------------------------------------------------------------
Calls to Noise:           363233664   Calls to DNoise:              10
----------------------------------------------------------------------------
Shadow Ray Tests:         101326126   Succeeded:              20222013
Reflected Rays:            63552010   Total Internal:         11697850
Refracted Rays:            70582748
----------------------------------------------------------------------------
Number of photons shot:          877422
Surface photons stored:        12373426
Priority queue insert:        106559764
Priority queue remove:         20567750
Gather function called:        14882980
----------------------------------------------------------------------------
Smallest Alloc:                  20 bytes
Largest  Alloc:              327696 bytes
Peak memory used:         248589212 bytes
Total Scene Processing Times
   Parse Time:    0 hours  0 minutes  0 seconds (0 seconds)
   Photon Time:   0 hours  2 minutes 22 seconds (142 seconds)
   Cloth Time:    0 hours  0 minutes  0 seconds (0 seconds)
   Mechsim Time:  0 hours  0 minutes  0 seconds (0 seconds)
   Render Time:   0 hours  5 minutes  8 seconds (308 seconds)
   Postpr. Time:  0 hours  0 minutes  0 seconds (0 seconds)
   Total Time:    0 hours  7 minutes 30 seconds (450 seconds)

On a MacBook Pro 2.16 GHz Intel Core Duo.


Post a reply to this message

From: Bruno Cabasson
Subject: Re: Photons and dispersion.
Date: 11 Sep 2006 05:30:00
Message: <web.45052c40710e67c0f5fba6ef0@news.povray.org>
"Cousin Ricky" <ric### [at] yahoocom> wrote:
> "Bruno Cabasson" <bru### [at] alcatelaleniaspacefr> wrote:
> >
> > I have one concern with this result: the shadow of the shape on the ground
> > does not seem to be anti-aliased. What's up?
>
> It's two things.
>
> 1. The threshold *is* too high.  Set Antialias_Threshold to 0.02, or use
> +A0.02.  (Most scenes won't need it this low, but this scene does.)  I also
> figured out the reason why the glass seemed antialiased but not the shadow:
> the dispersion!  As the light spread out inside the glass, it automatically
> fudged the aliasing artifacts.
>
> 2. Ooh, i almost forgot.  Use +AM2.  Never mind that, just add
> Sampling_Method=2 to your povray.ini file and be done with it.

OK. After following these advises, I found that the aa threshold is
responsible for the (apparent) non anti-aliasing. I was persuaded that the
'constrast' between the shadow and the ground was OK for 0.3. The value 0.1
is enough. +AM2 is not necessary.

Another concern now: when I turn photons off by commenting out the photons{}
block in global_settings{} the shadow has a green color, which may seem
normal because the material is green (see picture). Why then, when photons
are on, does the shadow not inherit the green color of the glass?

    Regards


Post a reply to this message


Attachments:
Download 'photons_2.jpg' (75 KB)

Preview of image 'photons_2.jpg'
photons_2.jpg


 

From: Alain
Subject: Re: Photons and dispersion.
Date: 11 Sep 2006 17:56:14
Message: <4505db7e@news.povray.org>
Bruno Cabasson nous apporta ses lumieres en ce 11/09/2006 05:28:
> "Cousin Ricky" <ric### [at] yahoocom> wrote:
>> "Bruno Cabasson" <bru### [at] alcatelaleniaspacefr> wrote:
>>> I have one concern with this result: the shadow of the shape on the ground
>>> does not seem to be anti-aliased. What's up?
>> It's two things.
>>
>> 1. The threshold *is* too high.  Set Antialias_Threshold to 0.02, or use
>> +A0.02.  (Most scenes won't need it this low, but this scene does.)  I also
>> figured out the reason why the glass seemed antialiased but not the shadow:
>> the dispersion!  As the light spread out inside the glass, it automatically
>> fudged the aliasing artifacts.
>>
>> 2. Ooh, i almost forgot.  Use +AM2.  Never mind that, just add
>> Sampling_Method=2 to your povray.ini file and be done with it.
> 
> OK. After following these advises, I found that the aa threshold is
> responsible for the (apparent) non anti-aliasing. I was persuaded that the
> 'constrast' between the shadow and the ground was OK for 0.3. The value 0.1
> is enough. +AM2 is not necessary.
> 
> Another concern now: when I turn photons off by commenting out the photons{}
> block in global_settings{} the shadow has a green color, which may seem
> normal because the material is green (see picture). Why then, when photons
> are on, does the shadow not inherit the green color of the glass?
> 
>     Regards
> 
> 
> ------------------------------------------------------------------------
> 
Without photons, the shadow ignore the ior of the object, so the shadow is 
completely illuminated by the filtered light. It's a little like the onject was 
only a coloured empty shell. This is unrealistic.
With photons, the light don't reatch the shadowed area, only the photons do. 
It's what apens in the real world, and what you would see if you where outside 
on the moon: a totaly dark shadow only illuminated by the diffracted light.

-- 
Alain
-------------------------------------------------
Documentation; The worst part of programming.


Post a reply to this message

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