POV-Ray : Newsgroups : povray.advanced-users : caustics and fog (photon mapping with scattering media) Server Time
24 Nov 2024 01:28:19 EST (-0500)
  caustics and fog (photon mapping with scattering media) (Message 1 to 10 of 12)  
Goto Latest 10 Messages Next 2 Messages >>>
From: ghostch
Subject: caustics and fog (photon mapping with scattering media)
Date: 2 Feb 2010 14:55:01
Message: <web.4b688106814e79f9129802db0@news.povray.org>
Hi!
What I want to do is having a glass- sphere with refraction-interior to focus
light rays emitted by a simple point light. The refraction is causing
nice caustics on the ground below the sphere. Now I wanted to add "ground fog"
to the scene in order to make the focussed light beam visible. I am using a box
as containing object placed somewhere around the area where the caustics
appeared.
However, when the fog is there, it does not seem to interact with the photons in
any way. There is only the shadow cast by the sphere. I am completely missing
the caustics on the floor also.
Hope anyone can explain.. Here is my code.


global_settings{
   photons{
        spacing 0.1
     radius  0.5
     //autostop 0
     media 100

 }
   max_trace_level 16 // increase value to avoid black spots
}

#include "textures.inc"

#declare cam_pos = <-100, 50, 100>;
#declare cam_look_at = <50, 50, 100>;
#declare cam_sky = <0, 1, 0>;

#declare FreeSurfaceTexture = texture{
    pigment{
        rgbt 1
        }
    finish {
        ambient 0.05
        diffuse 0.25
        brilliance 6.0
        phong 0.8
        phong_size 120
        reflection { 0.01, 0.7 }
    }
}

#declare WaterInterior = interior{
   ior 1.35
   dispersion 1.03
   media {
     absorption 0.001
   }
}

camera{
location cam_pos
look_at cam_look_at
sky cam_sky
}

// the ground
plane {
   <0,1,0>, 0
         texture{Polished_Chrome
              pigment{ color rgb 0.7*<0.7,1,0.7>}
              normal { crackle 0.75 turbulence 0.25 scale 0.25}
              finish { diffuse 0.9}
       scale 40
 }
}

// a wall
box {
    <0,0,200>,<100,100,210>

    texture {
       Red_Marble
       scale 8
    }
    normal {
       agate
       scale 8
    }
}


// the sphere
sphere{
<50,50,100>,33
texture {
   FreeSurfaceTexture
}interior{
 WaterInterior
}
photons{
 target
 reflection on
 refraction on
 collect off
}
hollow
}

// the fog
box{
 <1,1,99>,<99,15,199>
 pigment { rgbf 1 }
 hollow
 photons { pass_through  }

 interior{
  media{
     scattering {
      1, 0.01
 extinction 0.01
     }
  }
 }
}


light_source{
   <0,120,0>, color rgbf 0.9
   adaptive 1
}


Post a reply to this message

From: Warp
Subject: Re: caustics and fog (photon mapping with scattering media)
Date: 2 Feb 2010 15:35:06
Message: <4b688c7a@news.povray.org>
I made a minimal scene which reproduces the phenomenon.

  Comment out the box, and the caustic highlight appears. With the box there's
no caustic. If the box has a transmit value smaller than 1, the caustic appears
on the top surface of the box but doesn't go through.

  I'm not sure why this happens.

//-------------------------------------------------------------------------
global_settings { photons { count 10000 } }
camera { location <0, 1, -5> look_at -y*.5 }
light_source { y*10, 1 }
plane { y, -2 pigment { rgb 1 } }
sphere
{ 0, 1
  pigment { rgb <.9, 1, .9> filter 1 }
  finish { specular .5 roughness .01 reflection { .1, .3 } }
  interior { ior 1.5 }
  photons { target reflection on refraction on }
}

box
{ <-2, -1.9, -2>, <2, -1.5, 2>
  pigment { rgbt 1 }
  photons { pass_through }
}
//-------------------------------------------------------------------------

-- 
                                                          - Warp


Post a reply to this message

From: Christian Froeschlin
Subject: Re: caustics and fog (photon mapping with scattering media)
Date: 2 Feb 2010 16:32:40
Message: <4b6899f8$1@news.povray.org>
Warp wrote:

>   I made a minimal scene which reproduces the phenomenon.
> 
>   Comment out the box, and the caustic highlight appears. With the box there's
> no caustic. If the box has a transmit value smaller than 1, the caustic appears
> on the top surface of the box but doesn't go through.
> 
>   I'm not sure why this happens.

According to the documentation, pass_through does not have
an effect on photons which have already hit their target. You
probably need to specify "refraction on" to get it to work.

Apart from that, I don't think I would expect photons to affect
media if the container object is tagged with pass_through ;)


Post a reply to this message

From: Warp
Subject: Re: caustics and fog (photon mapping with scattering media)
Date: 2 Feb 2010 16:41:21
Message: <4b689c01@news.povray.org>
Christian Froeschlin <chr### [at] chrfrde> wrote:
> According to the documentation, pass_through does not have
> an effect on photons which have already hit their target. You
> probably need to specify "refraction on" to get it to work.

  If you do that, the caustics change drastically. The box is not "invisible"
to the photons.

> Apart from that, I don't think I would expect photons to affect
> media if the container object is tagged with pass_through ;)

  You might not expect it, but that doesn't mean you are right.

http://wiki.povray.org/content/Documentation:Tutorial_Section_3.7#Media_and_photons

-- 
                                                          - Warp


Post a reply to this message

From: ghostch
Subject: Re: caustics and fog (photon mapping with scattering media)
Date: 2 Feb 2010 17:20:02
Message: <web.4b68a3fa7f82e719129802db0@news.povray.org>
Christian Froeschlin <chr### [at] chrfrde> wrote:
> According to the documentation, pass_through does not have
> an effect on photons which have already hit their target.

Does that mean there is no way that media interact with photons that have
already passed through a lens or some other target?
Doesn't the documentation also say "photons interact fully with media
blablabla"?


Post a reply to this message

From: Alain
Subject: Re: caustics and fog (photon mapping with scattering media)
Date: 2 Feb 2010 20:01:18
Message: <4b68cade@news.povray.org>

> Christian Froeschlin<chr### [at] chrfrde>  wrote:
>> According to the documentation, pass_through does not have
>> an effect on photons which have already hit their target.
>
> Does that mean there is no way that media interact with photons that have
> already passed through a lens or some other target?
> Doesn't the documentation also say "photons interact fully with media
> blablabla"?
>
>
>

You can.
Just add photons{pass_through} to your container.
The photons will ignore the container, but NOT the contained media.


Alain


Post a reply to this message

From: ghostch
Subject: Re: caustics and fog (photon mapping with scattering media)
Date: 3 Feb 2010 04:25:00
Message: <web.4b693fcb7f82e719129802db0@news.povray.org>
Alain <aze### [at] qwertyorg> wrote:

> > Christian Froeschlin<chr### [at] chrfrde>  wrote:
> >> According to the documentation, pass_through does not have
> >> an effect on photons which have already hit their target.
> >
> > Does that mean there is no way that media interact with photons that have
> > already passed through a lens or some other target?
> > Doesn't the documentation also say "photons interact fully with media
> > blablabla"?
> >
> >
> >
>
> You can.
> Just add photons{pass_through} to your container.
> The photons will ignore the container, but NOT the contained media.
>
>
> Alain

Nope. Take a look at Warp's example and mine above. Doesn't seem to work for
photons that already hit a target!
What I really want are caustics projected on some kind of media so to say.


Post a reply to this message

From: Warp
Subject: Re: caustics and fog (photon mapping with scattering media)
Date: 3 Feb 2010 11:40:12
Message: <4b69a6eb@news.povray.org>
ghostch <nomail@nomail> wrote:
> Nope. Take a look at Warp's example and mine above. Doesn't seem to work for
> photons that already hit a target!
> What I really want are caustics projected on some kind of media so to say.

  Photons do interact with media inside an object which has a "pass_through"
setting. In this case the problem is not with media per se, but something
else entirely. The photons are not going through the object regardless of
the keyword (and thus do not affect the media inside it).

-- 
                                                          - Warp


Post a reply to this message

From: Christian Froeschlin
Subject: Re: caustics and fog (photon mapping with scattering media)
Date: 3 Feb 2010 13:42:04
Message: <4b69c37c@news.povray.org>
Warp wrote:

> If you do that, the caustics change drastically. The box is not "invisible"
> to the photons.

hmm ... indeed. You also need to specify "collect off". Then your
box with rgbt 1 and ior 1.0 does not seem to change the caustics,
although it likely causes more internal calculations due to the
invisible ray intersection points. The media also shows up:

--------------------------------------------------------------
global_settings { max_trace_level 10 photons { count 10000 media 100} }
camera { location <0, 1, -5> look_at -y*.5 }
light_source { y*10, 1 }
plane { y, -2 pigment { rgb 1 } }

sphere
{ 0, 1
   pigment { rgb <.9, 1, .9> filter 1 }
   finish { specular .5 roughness .01 reflection { .1, .3 } }
   interior { ior 1.5 }
   photons { target reflection on refraction on }
}

box
{ <-2, -1.9, -2>, <2, -1.5, 2> hollow
   interior
   {
     ior 1.0
     media {scattering {1, 0.5*<1,0,0>}}
   }
   pigment { rgbt 1 }
   photons { collect off refraction on}
}
--------------------------------------------------------------


Post a reply to this message

From: Christian Froeschlin
Subject: Re: caustics and fog (photon mapping with scattering media)
Date: 3 Feb 2010 13:53:31
Message: <4b69c62b$1@news.povray.org>
ghostch wrote:
> Christian Froeschlin <chr### [at] chrfrde> wrote:
>> According to the documentation, pass_through does not have
>> an effect on photons which have already hit their target.
> 
> Does that mean there is no way that media interact with photons that have
> already passed through a lens or some other target?

No, it just means you can't use pass_through. See my other reply
in this thread for a modified example with caustics and media.

The tutorial may be a bit misleading when it states that you
need to specify pass_through for the media photons to work. In
that example it is required because photons enter the media
container prior to hitting the target.


Post a reply to this message

Goto Latest 10 Messages Next 2 Messages >>>

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