POV-Ray : Newsgroups : povray.advanced-users : Invisible Photon Mapping Server Time
23 Nov 2024 20:50:05 EST (-0500)
  Invisible Photon Mapping (Message 1 to 10 of 30)  
Goto Latest 10 Messages Next 10 Messages >>>
From: Quartz
Subject: Invisible Photon Mapping
Date: 1 Sep 2011 00:45:07
Message: <web.4e5f0af057ee503f2b8e18870@news.povray.org>
I'm not sure if this question would be considered for "advanced" users or not,
but: Is it possible to cast caustics from an object without seeing things
reflected in its surface?

I am modeling a planet, and I would like to see reflected light illuminating the
dark side of one of its moons. I briefly tried radiosity, but photon mapping
seemed more accurate.

My problem is that I don't want to see objects reflected in the surface of the
planet; I only want the caustics it casts. ...Is this outright impossible?

Below is a boiled-down version of my scene code.
Thanks, God bless!

------

#local sun_radius      =   40.00; // units in meters*10^6
#local plan_orbt_rdus  = 3000.00; // planet's orbit radius
#local aphelion_offset =   20.00; // distance of ephelion from otherwise
circular orbit
#local plan_radius     =    6.53;
#local plan_moon_dist  =    6.00; // dist @ closest point between moon's
surfaces
#local plan_moon_rdus  =    6.22; // moon radius
#local plan_rotn_prod  =    4.70; // rotation period in hours
#local camr_dist       =    3.00; // multiplier for camera dist
#local plan_poso = radians(073);  // planet's orbital position in radians
counterclockwise from positive x axis
#local plan_day  = 0;             // planet's rotational position in hours - one
full turn every multiple of 4.70

#local plan_moon_posr = plan_radius+plan_moon_dist+plan_moon_rdus;
#local plan_rotn = (plan_day/4.7)*-360-degrees(plan_poso);
#local plan_posx =
cos(plan_poso)*(plan_orbt_rdus+aphelion_offset*0.5)-aphelion_offset*0.5;
#local plan_posz = sin(plan_poso)*plan_orbt_rdus;

camera
 {
 location <0,1,-0.1>*(plan_moon_posr+plan_moon_rdus)*(camr_dist+1.0) look_at 0
 right x*image_width/image_height
 rotate <0,plan_rotn,0>
 translate <plan_posx,0,plan_posz>
 angle 48
 }
light_source {<-10,0.1,0> color rgb 1 photons {reflection on}}

global_settings
 {
 ambient_light 0
 max_trace_level 15
 photons {count 100000 spacing 10}
 }

#local plan_color = <0.3,0.7,1>;
union
 {
 sphere {0,plan_radius hollow texture {pigment {rgb plan_color} finish
{reflection plan_color*20}} photons {target reflection on collect off}}
 sphere {<plan_moon_posr,0,0>,plan_moon_rdus texture {pigment {rgb plan_color}}
photons {target} rotate <0,150,0>}
 translate <plan_posx,0,plan_posz>
 }


Post a reply to this message

From: Jaime Vives Piqueres
Subject: Re: Invisible Photon Mapping
Date: 1 Sep 2011 03:56:39
Message: <4e5f3ab7@news.povray.org>

> My problem is that I don't want to see objects reflected in the
> surface of the planet; I only want the caustics it casts. ...Is this
> outright impossible?

   Untested solutions that come to my mind:

   1) use two planet objects: one without reflection nor photons block,
the other with reflection and photons but with a "no_image" modifier.

   2) use a two pass render: on the first pass save the photons, on the
second load the photons and get ride of the reflection on the planet finish.

   Hope this helps...

-- 
Jaime Vives Piqueres
		
La Persistencia de la Ignorancia
http://www.ignorancia.org


Post a reply to this message

From: clipka
Subject: Re: Invisible Photon Mapping
Date: 1 Sep 2011 09:48:12
Message: <4e5f8d1c$1@news.povray.org>
Am 01.09.2011 06:40, schrieb Quartz:
> I'm not sure if this question would be considered for "advanced" users or not,
> but: Is it possible to cast caustics from an object without seeing things
> reflected in its surface?
>
> I am modeling a planet, and I would like to see reflected light illuminating the
> dark side of one of its moons. I briefly tried radiosity, but photon mapping
> seemed more accurate.
>
> My problem is that I don't want to see objects reflected in the surface of the
> planet; I only want the caustics it casts. ...Is this outright impossible?

I don't think you'll get the proper results with photons; that approach 
assumes that the planet has a highly specular reflection profile, while 
really a planet probably should exhibit primarily diffuse reflection.

I'd suggest radiosity with a very (/really/ very) high sample count, 
setting any objects other than the planet to "no_radiosity" to avoid 
wasting intersection tests on them for the sake of radiosity sampling. 
Needs POV-Ray 3.7 though.


If you nonetheless want to go for the photons approach, try setting all 
of the objects in your scene to "no_reflection" so they don't appear in 
reflections.


Post a reply to this message

From: Alain
Subject: Re: Invisible Photon Mapping
Date: 1 Sep 2011 17:13:40
Message: <4e5ff584@news.povray.org>

> I'm not sure if this question would be considered for "advanced" users or not,
> but: Is it possible to cast caustics from an object without seeing things
> reflected in its surface?
>
> I am modeling a planet, and I would like to see reflected light illuminating the
> dark side of one of its moons. I briefly tried radiosity, but photon mapping
> seemed more accurate.
>
> My problem is that I don't want to see objects reflected in the surface of the
> planet; I only want the caustics it casts. ...Is this outright impossible?
>

If you don't want to see the reflection of something, you add 
no_reflection to that something.

It should not affect the photons, but if your photons do cast caustics 
on that object, they won't show as the receiving surface is no longer 
visible in any reflection. A reflective object with no_reflection will 
reflect it's environment but will itself won't be reflected by other 
reflective surfaces. It will also not self reflect.

Another aproach would be to use a totaly transparent object with only 
the bright areas not transparent and having emission 1 in the finish.

In your particular case, your "solution" is not realistic.
You must NOT use both count and spacing for your photons. One OR the 
other, never both. You don't need the photons block on the light_source: 
By default all light_source emit photons that both reflect and refract 
acording to the target objects properties. It's a left over from around 
version 3.1 when photons was just begining. Exception, shadowless lights 
don't emit any photons. Your moon don't need a photons block as it don't 
reflect nor refract.

I got very good results using radiosity only.
You should make your light_source parallel.
You should NOT use ambient_lights 0.
It beter to always use assumed_gamma 1 for all scenes.
You should upgrade to version 3.7. It works much beter.




Alain


Post a reply to this message

From: Quartz
Subject: Re: Invisible Photon Mapping
Date: 3 Sep 2011 20:05:00
Message: <web.4e62c036c559cf212b8e18870@news.povray.org>
Alain <aze### [at] qwertyorg> wrote:
> It should not affect the photons, but if your photons do cast caustics
> on that object, they won't show as the receiving surface is no longer
> visible in any reflection. A reflective object with no_reflection will
> reflect it's environment but will itself won't be reflected by other
> reflective surfaces. It will also not self reflect.

This doesn't appear to agree with the results that I'm getting. The
"no_reflection" approach did in fact work, although other considerations cause
me to agree that radiosity is more appropriate.

> You must NOT use both count and spacing for your photons. One OR the
> other, never both. ...

I can definitely believe I was misusing the photon feature; I'm still a newbie
with it.

> You should make your light_source parallel.

I would rather not, thanks, unless it is producing significant rounding errors
or slowing down the scene computation.

> You should NOT use ambient_lights 0.
> It beter to always use assumed_gamma 1 for all scenes.

As for ambient_light vs. assumed_gamma, it looks to me like their purposes are
totally different. An ambient_light of zero is recommended on this documentation
page for version 3.6:
http://povray.org/documentation/view/3.6.1/270/

> You should upgrade to version 3.7. It works much beter.

Upgrading to version 3.7 sounds exciting but unnecessary at this time.


Post a reply to this message

From: Alain
Subject: Re: Invisible Photon Mapping
Date: 3 Sep 2011 20:34:35
Message: <4e62c79b$1@news.povray.org>

> Alain<aze### [at] qwertyorg>  wrote:
>> It should not affect the photons, but if your photons do cast caustics
>> on that object, they won't show as the receiving surface is no longer
>> visible in any reflection. A reflective object with no_reflection will
>> reflect it's environment but will itself won't be reflected by other
>> reflective surfaces. It will also not self reflect.
>
> This doesn't appear to agree with the results that I'm getting. The
> "no_reflection" approach did in fact work, although other considerations cause
> me to agree that radiosity is more appropriate.
>
>> You must NOT use both count and spacing for your photons. One OR the
>> other, never both. ...
>
> I can definitely believe I was misusing the photon feature; I'm still a newbie
> with it.

It's common isue, several users tend to use both while only one should 
be used.
There was also the isue of using reflection with a value larger than 1. 
The faint illumination on the moon was amplified 20 times causing an 
overly bright reflection.

>
>> You should make your light_source parallel.
>
> I would rather not, thanks, unless it is producing significant rounding errors
> or slowing down the scene computation.

Using parallel allow you to place the light_source representing a very 
far light much closer.
Usualy, light comming from a sun is such a case. You often end up with a 
light_source situated at over 100 000 000 units or even more when 
atempting to use real world distances, and that WILL cause problems, 
including causing the light_source to vanish.
Our Sun is at around 150000000 Km from us. In a scene scaled in m, the 
range of values is just to large to reliably compute (easily 10e10~10e12 
to 1).

>
>> You should NOT use ambient_lights 0.
>> It beter to always use assumed_gamma 1 for all scenes.
>
> As for ambient_light vs. assumed_gamma, it looks to me like their purposes are
> totally different. An ambient_light of zero is recommended on this documentation
> page for version 3.6:
> http://povray.org/documentation/view/3.6.1/270/
If you set ambient_lights 0 in a radiosity scene, you can't use high 
ambient finish as a source of illumination. Using version 3.7, you can 
use the emission finish component to have glowing objects.

ambient_lights in the global_settings purpose it to colour the ambient 
component.
It's way beter to use

#default{finish{ambient 0}}

or

add finish{ambient 0} in your textures.

assumed_gamma 1 use a linear scale allowing correct colour evaluations.

>
>> You should upgrade to version 3.7. It works much beter.
>
> Upgrading to version 3.7 sounds exciting but unnecessary at this time.

There are significant differences, many bug fixes, new features and tons 
of various improvements.
If you have a multicores processor, it will automaticaly use them all, 
for greatly improved render time. Even using a single core, it's very 
often faster than 3.6.1.
If you ever interupt a radiosity scene with 3.6.1, there will be a 
visible discontinuity. Not so with 3.7.

It's not about an exiting thing, but more about starting with a current 
version and not having to un-learn things that are no longer relevent.

>
>
>

Alain


Post a reply to this message

From: Quartz
Subject: Re: Invisible Photon Mapping
Date: 3 Sep 2011 21:10:00
Message: <web.4e62cef3c559cf212b8e18870@news.povray.org>
Alain <aze### [at] qwertyorg> wrote:
> There was also the isue of using reflection with a value larger than 1.

That was an intentional exaggeration for illustrative purposes.

> Using parallel allow you to place the light_source representing a very
> far light much closer.

I understand what you are saying, and often I have used parallel light sources.
In this case, call it a personal preference, since I am not using values that
high. Maybe later I will consider changing it.

> If you set ambient_lights 0 in a radiosity scene, you can't use high
> ambient finish as a source of illumination.

I don't need to in this scene. Maybe I will change my habit for my next scene,
but it doesn't matter now.

> assumed_gamma 1 use a linear scale allowing correct colour evaluations.

I am interested in being further educated on this point, but I don't have the
time right now unless it is pertinent to my question. Sorry.

> It's not about an exiting thing, but more about starting with a current
> version and not having to un-learn things that are no longer relevent.

That's what makes it exciting. But until I hear otherwise, I still see it as
unnecessary at the moment.


Post a reply to this message

From: Quartz
Subject: Re: Invisible Photon Mapping
Date: 3 Sep 2011 21:15:01
Message: <web.4e62d0b1c559cf212b8e18870@news.povray.org>
clipka <ano### [at] anonymousorg> wrote:
> I'd suggest radiosity with a very (/really/ very) high sample count,
> setting any objects other than the planet to "no_radiosity" to avoid
> wasting intersection tests on them for the sake of radiosity sampling.
> Needs POV-Ray 3.7 though.

Thanks a lot for your suggestions! With all of your help, I have achieved quite
satisfying results in v. 3.6.1 using radiosity by increasing the objects'
diffuse terms instead of the sample count. But I'm afraid things are about to
get a lot more complex...

The only remaining problem is, my scene includes an atmosphere around the planet
using interior & media. The moment I turn my atmosphere on, even if its diffuse,
extinction, & attenuation are all turned off and I have turned off media in the
global radiosity settings, my "caustics" disappear.

Do I need to follow your directions after all, about high sample counts in v.
3.7?

For clarity, below is my ACTUAL scene code, including the atmosphere. Apologies
for the bitmaps, which I cannot attach. The "atmos_layers" variable is used as a
kind of quality setting, since a photo-ready number of layers takes too long to
render while I'm actively working on the scene. Set it to zero to remove the
atmosphere.

--------

#local sun_radius      =   40.00; // units in megameters
#local eith_orbt_rdus  = 3000.00; // eithalica's orbit radius
#local aphelion_offset =   20.00; // distance of ephelion from
                                  // otherwise circular orbit
#local eith_radius     =    6.53; // eithalica is the planet's name
#local eith_moon_dist  =    6.00; // dist @ closest point between
                                  // eithalica's & moon's surfaces
#local eith_moon_rdus  =    6.22; // moon radius
#local eith_rotn_prod  =    4.70; // rotation period in hours
#local camr_dist       =    3.00; // multiplier for camera dist
#local eith_poso = radians(073);  // eithalica's orbital position
                                  // in radians counterclockwise
                                  // from positive x axis
#local eith_day  = (10/142)*4.70; // eith's rotational position in
                                  // hours - one full turn every
                                  // multiple of 4.70

#local atmos_color    = <5.4e-3,1.8e-2,3.6e-2>; // color that is reflected
#local atmos_twilight = 1-(1-<1.0,0.7,0.4>)*0.5; // color that is transmitted
#local atmos_layers   = 4;                      // granularity of model
#local atmos_thick    = eith_moon_dist*0.6;     // distance from planet surface
to atmosphere extremity
#local atmos_curve    = 2.5;                    // tightness of density curve
#local atmos_thresh   = 0.0;                    // density below which we won't
bother

#local eith_moon_posr = eith_radius+eith_moon_dist+eith_moon_rdus;
#local eith_rotn = (eith_day/4.7)*-360-degrees(eith_poso);
#local eith_posx =
cos(eith_poso)*(eith_orbt_rdus+aphelion_offset*0.5)-aphelion_offset*0.5;
#local eith_posz = sin(eith_poso)*eith_orbt_rdus;

camera
 {
 location <0,1,-0.1>*(eith_moon_posr+eith_moon_rdus)*(camr_dist+1.0) look_at 0
 right x*image_width/image_height
 rotate <0,eith_rotn,0>
 translate <eith_posx,0,eith_posz>
 angle 48
 }
light_source
 {
 0 color rgb 3.0
 /*looks_like
  {
  sphere
   {
   0,sun_radius
   texture {pigment {rgb 5} finish {ambient 1}}
   no_shadow
   }
  }*/
 }/*
sphere
 {
 0,1e2
 texture {pigment {rgbt <0,0,0,1>}}
 no_shadow
 hollow
 interior
  {
  media
   {
   emission <1.0e-2,5.0e-3,7.0e-4>
   intervals 1
   method 3
   samples 20
   }
  }
 }*/
sky_sphere {pigment {rgb <0,0,0>}}

global_settings
 {
 ambient_light 0
 radiosity {brightness 1.0 count 100 media off}
 max_trace_level 15
 }
#default {finish {ambient 1 diffuse 1.0}}

/*torus {eith_orbt_rdus,0.5 texture {pigment {rgb <1,0.3,0>} finish {ambient
1}}}
torus
 {
 eith_orbt_rdus,0.5 texture {pigment {rgb <1,1,0>} finish {ambient 1}}
 scale <(aphelion_offset*0.5+eith_orbt_rdus)/eith_orbt_rdus,1,1>
 translate <-aphelion_offset*0.5,0,0>
 }*/

#local eith_texture = texture
 {
 pigment {rgb <0,0,0.4>}
 finish {specular 0.7}
 normal {agate scale 1e-3}
 };
union
 {
 // eithalica
 union
  {
  sphere
   {
   0,eith_radius texture {eith_texture}
   texture {pigment {image_map {png "./eithalica_tex.png" map_type 1}}}
   photons {target reflection on refraction off}
   }
  sphere
   {
   0,eith_radius+8e-2
   texture {pigment {image_map {png "./eithalica_clouds.png" map_type 1}}}
   photons {target reflection on refraction off}
   hollow
   }
  }

 // temalar
 union
  {
  sphere
   {
   0,eith_moon_rdus texture {eith_texture}
   texture {pigment {image_map {png "./temalar_tex.png" map_type 1}}}
   photons {target reflection on refraction off}
   }
  sphere
   {
   0,eith_moon_rdus+8e-2
   texture {pigment {image_map {png "./temalar_clouds.png" map_type 1}}}
   photons {target reflection on refraction off}
   hollow
   }
  translate <eith_moon_posr,0,0>
  }

 // chessol
 union
  {
  sphere
   {
   0,eith_moon_rdus texture {eith_texture}
   texture {pigment {image_map {png "./chessol_tex.png" map_type 1}}}
   photons {target reflection on refraction off}
   }
  sphere
   {
   0,eith_moon_rdus+8e-2
   texture {pigment {image_map {png "./chessol_clouds.png" map_type 1}}}
   photons {target reflection on refraction off}
   hollow
   }
  translate <eith_moon_posr,0,0>
  rotate <0,-120,0>
  }

 // siothum
 union
  {
  sphere
   {
   0,eith_moon_rdus texture {eith_texture}
   texture {pigment {image_map {png "./siothum_tex.png" map_type 1}}}
   photons {target reflection on refraction off}
   }
  sphere
   {
   0,eith_moon_rdus+8e-2
   texture {pigment {image_map {png "./siothum_clouds.png" map_type 1}}}
   photons {target reflection on refraction off}
   hollow
   }
  translate <eith_moon_posr,0,0>
  rotate <0, 120,0>
  }
 //torus {eith_moon_posr,0.1 texture {pigment {rgb <1,1,0>} finish {ambient 1}}}

 #local loop = 1;
 #while (loop <= atmos_layers)
  #local intensity = pow(1-(loop-1)/atmos_layers,atmos_curve);
  #if (loop = 1) #local gap = -1e-8; #else #local gap = +1e-8; #end
  #if (intensity > atmos_thresh)
   difference
    {
    merge
     {
     sphere {0,eith_radius+(loop/atmos_layers)*atmos_thick}
     sphere
{<eith_moon_posr,0,0>,eith_moon_rdus+(loop/atmos_layers)*atmos_thick}
     sphere
      {
      <cos(radians( 120))*eith_moon_posr,0,sin(radians( 120))*eith_moon_posr>,
      eith_moon_rdus+(loop/atmos_layers)*atmos_thick
      }
     sphere
      {
      <cos(radians(-120))*eith_moon_posr,0,sin(radians(-120))*eith_moon_posr>,
      eith_moon_rdus+(loop/atmos_layers)*atmos_thick
      }
     }
    merge
     {
     sphere {0,eith_radius+((loop-1)/atmos_layers)*atmos_thick+gap}
     sphere
{<eith_moon_posr,0,0>,eith_moon_rdus+((loop-1)/atmos_layers)*atmos_thick+gap}
     sphere
      {
      <cos(radians( 120))*eith_moon_posr,0,sin(radians( 120))*eith_moon_posr>,
      eith_moon_rdus+((loop-1)/atmos_layers)*atmos_thick+gap
      }
     sphere
      {
      <cos(radians(-120))*eith_moon_posr,0,sin(radians(-120))*eith_moon_posr>,
      eith_moon_rdus+((loop-1)/atmos_layers)*atmos_thick+gap
      }
     }
    texture {pigment {rgbt <0,0,0,1>} finish {diffuse 0.0*intensity}}
    hollow
    interior
     {
     media
      {
      scattering {1, atmos_color*intensity extinction 0}
      //ratio 0.1 intervals 1 method 3 samples 20
      collect off
      }
     //ior 1.01
     fade_color atmos_twilight
     fade_distance eith_moon_rdus*0.085/intensity
     fade_power 10.0
     }
    }
   #end
  #local loop = loop+1;
  #end
 rotate <0,eith_rotn,0>
 translate <eith_posx,0,eith_posz>
 }


Post a reply to this message

From: Alain
Subject: Re: Invisible Photon Mapping
Date: 4 Sep 2011 16:53:48
Message: <4e63e55c$1@news.povray.org>

> clipka<ano### [at] anonymousorg>  wrote:
>> I'd suggest radiosity with a very (/really/ very) high sample count,
>> setting any objects other than the planet to "no_radiosity" to avoid
>> wasting intersection tests on them for the sake of radiosity sampling.
>> Needs POV-Ray 3.7 though.
>
> Thanks a lot for your suggestions! With all of your help, I have achieved quite
> satisfying results in v. 3.6.1 using radiosity by increasing the objects'
> diffuse terms instead of the sample count. But I'm afraid things are about to
> get a lot more complex...
>
> The only remaining problem is, my scene includes an atmosphere around the planet
> using interior&  media. The moment I turn my atmosphere on, even if its diffuse,
> extinction,&  attenuation are all turned off and I have turned off media in the
> global radiosity settings, my "caustics" disappear.
>
> Do I need to follow your directions after all, about high sample counts in v.
> 3.7?
>
> For clarity, below is my ACTUAL scene code, including the atmosphere. Apologies
> for the bitmaps, which I cannot attach. The "atmos_layers" variable is used as a
> kind of quality setting, since a photo-ready number of layers takes too long to
> render while I'm actively working on the scene. Set it to zero to remove the
> atmosphere.
>
Replaced your images with pattern and colour_map having a good amount of 
transparency.

Your looks_loke is good. A looks_like object is located relative to it's 
light_source and moves with it if you change the coordinates.

Why is your sun and planets both at coordinate 0?

With 3.6.1, there was a bug in radiosity: The recursion level had to 
take transparent surfaces into consideration. You have 4 athmospheric 
layers and recursion_level default to 3. Then, you have two sets of 
layers plus the actual surface, for a total of 9.

That said, I realy think that you should use only one athmospheric shell 
containing only scattering media. You then modulate the density of that 
media as needed, using the spherical pattern scalled to the radius of 
the athmonsphre or some custom function.
You then use one or more cloud shells. Those are hollow and don't have 
their own media.

fade_power 10? for your athmosphere?
A realistic fade_power is 1 for substances to use linear fading, or 1001 
to use the exponential formula.
Test without fading gives beter results.
It's fade_power 2 for a fading light_source.

Using version 3.7RC3, the radiosity works as expected.

Keep in mind that radiosity can't illuminate your media.
media on will enable emissive media and directly illuminated scattering 
media to affect the radiosity illumination of nearby objects.



Alain


Post a reply to this message

From: Quartz
Subject: Re: Invisible Photon Mapping
Date: 4 Sep 2011 19:25:01
Message: <web.4e6407efc559cf212b8e18870@news.povray.org>
Alain <aze### [at] qwertyorg> wrote:
> Why is your sun and planets both at coordinate 0?

The planet[s] should be in a union that's translated at the end.

> With 3.6.1, there was a bug in radiosity: The recursion level had to
> take transparent surfaces into consideration. You have 4 athmospheric
> layers and recursion_level default to 3. Then, you have two sets of
> layers plus the actual surface, for a total of 9.

Excellent! I think you've hit upon it, Alain! Thank you.

> That said, I realy think that you should use only one athmospheric shell
> containing only scattering media. You then modulate the density of that
> media as needed, using the spherical pattern scalled to the radius of
> the athmonsphre or some custom function.

Oh, I didn't realize we had a spherical pattern before! I will definitely
investigate.

> fade_power 10? for your athmosphere?
> A realistic fade_power is 1 for substances to use linear fading, or 1001
> to use the exponential formula.
> Test without fading gives beter results.
> It's fade_power 2 for a fading light_source.

This was to replace extinction, because I wasn't artistically satisfied with
realistic results. Still willing to work on that; I probably just didn't have it
configured correctly.

Thanks a lot, everyone! I might post more on this later, but my initial question
has been answered.


Post a reply to this message

Goto Latest 10 Messages Next 10 Messages >>>

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