POV-Ray : Newsgroups : povray.general : Problem with photon mapping Server Time
5 Nov 2024 20:16:16 EST (-0500)
  Problem with photon mapping (Message 1 to 9 of 9)  
From: Yeager
Subject: Problem with photon mapping
Date: 21 Nov 2004 07:35:00
Message: <web.41a08aa1ee452319510445a30@news.povray.org>
Hi!!

I'm a new user of POV. I looked your FAQ but I didn't find answers to my
problem.

I need to model a cornell box with photon mapping. I used different scenes
gave with pov to do it.

However, my photons in the scene are not always shot and when they are shot,
they don't give good results of global illumination. I don't see any
difference between basic ray tracing and photon mapping?

Following my pov file.

Thank you for your help

Arnaud Lapeyrade

// Persistence Of Vision Ray Tracer Scene Description File
// File: cornell.pov
// Vers: 3.5
// Desc: Radiosity demo scene. See also
http://www.Graphics.Cornell.EDU/online/box/
// Date: August 2001
// Auth: Kari Kivisalo

// +w300 +h300

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

global_settings {
  assumed_gamma 1
  max_trace_level 25

  photons {
    spacing 0.1 // study the photon spacing impact
    count 1000000
    autostop off
    //save_file "D:BOULOT3D_Computer_GraphicsAssignment2map.ph"
  }

}

#declare Finish=finish{diffuse 0.75 ambient 0}

#declare White=texture{pigment{rgb<1,1,1>} finish{Finish}}
#declare Red=texture{pigment{rgb<0.5,0.3,0.01>} finish{Finish}}
#declare Green=texture{pigment{rgb<0.025,0.236,0.1>} finish{Finish}}
#declare Radius = 10;

#declare LightColor=<1,0.67,0.21>;

//#declare N=3;       // Divisions per side
//#declare DX=13/N;   // Dimensions of sub patches
//#declare DZ=10.5/N;

/*
light_source {
  <27.8, 54.88, 27.95>
  color rgb <1.0, 1.0, 1.0>
  shadowless

  photons {
    reflection on
    refraction on
  }
}*/



light_source{
    <27.8,54.88,27.95>
    color LightColor
 // area_light <5, 0, 0>, <0, 0, 5>, 5, 5
    adaptive 2

    photons {
    reflection on
    refraction on
    area_light
  }
}


camera{
  location  <27.8, 27.3,-56.0>
  direction <0, 0, 1>
  look_at <27.8, 27.3, 1>
}


// ------------------------ OBJECTS ----------------------------

// Light Patch

sphere {
    <16,10.0,35.0>,Radius

    material {
      texture {
        pigment { color Col_Glass_Clear }
        finish { F_Glass9 }
      }
      interior {
        I_Glass_Exp(4)
      //  fade_color Col_Red_03
      }
    }

    photons {
    reflection on
    refraction on
    collect off
  }
}

union{
  sphere {
    <40.0,10.0,10.0>,Radius

    material {
      texture {
        pigment { color Col_Glass_Clear }
        finish { F_Glass6 }
      }

    }

    photons {
    reflection on
    refraction on
    collect off
  }
  hollow off
  }
}


union{
  box{
    <21.3,54.87,33.2><34.3,54.88,22.7> no_shadow
    pigment{rgb<1,1,1>} finish{ambient 0.78 diffuse 0}
  }
}

union{
  // Floor
  triangle{<55.28, 0.0, 0.0>,<0.0, 0.0, 0.0>,<0.0, 0.0, 55.92>
          photons {
            target
            reflection off
            refraction off
            collect on
          }
  }

  triangle{<55.28, 0.0, 0.0>,<0.0, 0.0, 55.92>,<54.96, 0.0, 55.92>
          photons {
            target
            reflection off
            refraction off
            collect on
          }
  }

  // Ceiling
  triangle{<55.60, 54.88, 0.0>,<55.60, 54.88, 55.92>,<0.0, 54.88, 55.92>
            photons {
            target
            reflection off
            refraction off
            collect on
          }
  }

  triangle{<55.60, 54.88, 0.0>,<0.0, 54.88, 55.92>,<0.0, 54.88, 0.0>
          photons {
            target
            reflection off
            refraction off
            collect on
          }
  }

  // Back wall
  triangle{<0.0, 54.88, 55.92>,<55.60, 54.88, 55.92>,<54.96, 0.0, 55.92>
          photons {
            target
            reflection off
            refraction off
            collect on
          }
  }

  triangle{<0.0, 54.88, 55.92>,<54.96, 0.0, 55.92>,<0.0, 0.0, 55.92>
          photons {
            target
            reflection off
            refraction off
            collect on
          }
  }

  texture {White}

}

union {
  // Right wall
  triangle{<0.0, 54.88, 0.0>,<0.0, 54.88, 55.92>,<0.0, 0.0, 55.92>
          photons {
            target
            reflection off
            refraction off
            collect on
          }
  }

  triangle{<0.0, 54.88, 0.0>,<0.0, 0.0, 55.92>,<0.0, 0.0, 0.0>
          photons {
            target
            reflection off
            refraction off
            collect on
          }
  }

  texture {Green}
}

union {
  // Left wall
  triangle{<55.28, 0.0, 0.0>,<54.96, 0.0, 55.92>,<55.60, 54.88, 55.92>
          photons {
            target
            reflection off
            refraction off
            collect on
          }
  }

  triangle{<55.28, 0.0, 0.0>,<55.60, 54.88, 55.92>,<55.60, 54.88, 0.0>
          photons {
            target
            reflection off
            refraction off
            collect on
          }
  }

  texture {Red}


}


Post a reply to this message

From: Christoph Hormann
Subject: Re: Problem with photon mapping
Date: 21 Nov 2004 08:00:01
Message: <cnq37o$afq$1@chho.imagico.de>
Yeager wrote:
> Hi!!
> 
> I'm a new user of POV. I looked your FAQ but I didn't find answers to my
> problem.
> 
> I need to model a cornell box with photon mapping. I used different scenes
> gave with pov to do it.
> 
> However, my photons in the scene are not always shot and when they are shot,
> they don't give good results of global illumination. I don't see any
> difference between basic ray tracing and photon mapping?

POV-Ray uses photon mapping for calculating caustics but not for global 
illumination.  In other words - photons in POV-Ray only take into 
account the specular but not the diffuse light transport.  This is 
explained in detail in Wann Jensen's work and Nathan's paper on the 
POV-Ray photon patch (you can find it at 
http://nathan.kopp.com/photons.htm).  In fact photons can't be used 
efficiently for global illumination directly, you can just use them for 
speeding up other global illumination techniques.

Christoph

-- 
POV-Ray tutorials, include files, Sim-POV,
HCR-Edit and more: http://www.tu-bs.de/~y0013390/
Last updated 23 Sep. 2004 _____./\/^>_*_<^\/\.______


Post a reply to this message

From: Lance Birch
Subject: Re: Problem with photon mapping
Date: 21 Nov 2004 09:13:29
Message: <41a0a289@news.povray.org>
"Yeager" <non### [at] club-internetfr> wrote in message
news:web.41a08aa1ee452319510445a30@news.povray.org...
> Hi!!
>
> I'm a new user of POV. I looked your FAQ but I didn't find answers to my
> problem.
>
> I need to model a cornell box with photon mapping. I used different scenes
> gave with pov to do it.

In addition to what Christoph has said, basically what you're looking for is
POV-Ray's radiosity functions.

For examples of using Radiosity and Photons in POV-Ray, check out Tim
Nikias' excellent Cornell Box example page and radiosity and photons
settings tutorial at the following address:

http://www.nolights.de/past_pros/radiosity/radiosity.html


Lance.

thezone - thezone.firewave.com.au
thehandle - www.thehandle.com


Post a reply to this message

From: Alain
Subject: Re: Problem with photon mapping
Date: 21 Nov 2004 09:38:23
Message: <41a0a85f@news.povray.org>
Yeager nous apporta ses lumieres ainsi en ce 2004-11-21 07:31... :

>
>light_source{
>    <27.8,54.88,27.95>
>    color LightColor
> // area_light <5, 0, 0>, <0, 0, 5>, 5, 5
>    adaptive 2
>
>    photons {
>    reflection on
>    refraction on
>    area_light
>  }
>}
>  
>
I look at your light_source. If you enable the area_light, at 5*5, 
adaptive 2 is like not using adaptive at all. adaptive 0 use a minimum 
2*2 aray, adaptive 1 a minimum 3*3 aray, adaptive 2 a minimum 5*5 aray, 
adaptive 3 a minimum 9*9 aray... up to the size of the aray effectively 
used.

Alain


Post a reply to this message

From: Warp
Subject: Re: Problem with photon mapping
Date: 21 Nov 2004 12:56:52
Message: <41a0d6e4@news.povray.org>
Btw, all objects collect photons by default, so specifying
"photons { collect on }" for each one of them is just a waste of space
and resources. (And *specially* specifying it for each single object
in a union, when you could just specify it once for the entire union.)

  (Btw: How did you expect walls to reflect light when you have
specified "photons { reflection off }" for them? Not that it works
for non-reflecting surfaces anyways, but just curious.)

-- 
#macro M(A,N,D,L)plane{-z,-9pigment{mandel L*9translate N color_map{[0rgb x]
[1rgb 9]}scale<D,D*3D>*1e3}rotate y*A*8}#end M(-3<1.206434.28623>70,7)M(
-1<.7438.1795>1,20)M(1<.77595.13699>30,20)M(3<.75923.07145>80,99)// - Warp -


Post a reply to this message

From: Yeager
Subject: Re: Problem with photon mapping
Date: 22 Nov 2004 08:50:01
Message: <web.41a1eded5b211d0b1642bea10@news.povray.org>
Warp <war### [at] tagpovrayorg> wrote:
> Btw, all objects collect photons by default, so specifying
> "photons { collect on }" for each one of them is just a waste of space
> and resources. (And *specially* specifying it for each single object
> in a union, when you could just specify it once for the entire union.)
>
>   (Btw: How did you expect walls to reflect light when you have
> specified "photons { reflection off }" for them? Not that it works
> for non-reflecting surfaces anyways, but just curious.)
>
> --
> #macro M(A,N,D,L)plane{-z,-9pigment{mandel L*9translate N color_map{[0rgb x]
> [1rgb 9]}scale<D,D*3D>*1e3}rotate y*A*8}#end M(-3<1.206434.28623>70,7)M(
> -1<.7438.1795>1,20)M(1<.77595.13699>30,20)M(3<.75923.07145>80,99)// - Warp -

I don't expect that wall reflet light...Object do it but not walls. Walls
collect the photons and by this way we have photon map.


Post a reply to this message

From: Yeager
Subject: Re: Problem with photon mapping
Date: 22 Nov 2004 09:10:01
Message: <web.41a1f2755b211d0b1642bea10@news.povray.org>
"Lance Birch" <-> wrote:
> "Yeager" <non### [at] club-internetfr> wrote in message
> news:web.41a08aa1ee452319510445a30@news.povray.org...
> > Hi!!
> >
> > I'm a new user of POV. I looked your FAQ but I didn't find answers to my
> > problem.
> >
> > I need to model a cornell box with photon mapping. I used different scenes
> > gave with pov to do it.
>
> In addition to what Christoph has said, basically what you're looking for is
> POV-Ray's radiosity functions.
>
> For examples of using Radiosity and Photons in POV-Ray, check out Tim
> Nikias' excellent Cornell Box example page and radiosity and photons
> settings tutorial at the following address:
>
> http://www.nolights.de/past_pros/radiosity/radiosity.html
>
>
> Lance.
>
> thezone - thezone.firewave.com.au
> thehandle - www.thehandle.com

Ok I think I understood my mistake. I thought that radiosity algorithm was
with pathes in the scene but it's not.

Thank you for your help from all of you


Post a reply to this message

From: Warp
Subject: Re: Problem with photon mapping
Date: 22 Nov 2004 09:41:40
Message: <41a1faa4@news.povray.org>
Yeager <non### [at] club-internetfr> wrote:
> I don't expect that wall reflet light...Object do it but not walls. Walls
> collect the photons and by this way we have photon map.

  You told in your post that you are not getting the global illumination
effect you are trying to achieve, so I assumed you wanted photons to
reflect from walls in order to achieve global illumination.
  (Photon mapping in POV-Ray cannot be used for this purpose, but I was
just curious about what it was that you were trying to do. Global
illumination without light reflecting from walls is just not possible.)

-- 
#macro N(D)#if(D>99)cylinder{M()#local D=div(D,104);M().5,2pigment{rgb M()}}
N(D)#end#end#macro M()<mod(D,13)-6mod(div(D,13)8)-3,10>#end blob{
N(11117333955)N(4254934330)N(3900569407)N(7382340)N(3358)N(970)}//  - Warp -


Post a reply to this message

From: Yeager
Subject: Re: Problem with photon mapping
Date: 22 Nov 2004 11:15:00
Message: <web.41a2101d5b211d0b1642bea10@news.povray.org>
Warp <war### [at] tagpovrayorg> wrote:
> Yeager <non### [at] club-internetfr> wrote:
> > I don't expect that wall reflet light...Object do it but not walls. Walls
> > collect the photons and by this way we have photon map.
>
>   You told in your post that you are not getting the global illumination
> effect you are trying to achieve, so I assumed you wanted photons to
> reflect from walls in order to achieve global illumination.
>   (Photon mapping in POV-Ray cannot be used for this purpose, but I was
> just curious about what it was that you were trying to do. Global
> illumination without light reflecting from walls is just not possible.)
>
> --
> #macro N(D)#if(D>99)cylinder{M()#local D=div(D,104);M().5,2pigment{rgb M()}}
> N(D)#end#end#macro M()<mod(D,13)-6mod(div(D,13)8)-3,10>#end blob{
> N(11117333955)N(4254934330)N(3900569407)N(7382340)N(3358)N(970)}//  - Warp -


You right, but I think it is a misunderstanding from my about POV. I thought
I could use different methods with it like radiosity (I mean radiosity with
patches), and path raytracing + photon mapping. But more and more I learn
about about these methods more I understand that I was wrong, and that POV
doesn't realise exacly what I tought.


Post a reply to this message

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