POV-Ray : Newsgroups : povray.general : photons and sunpos.inc Server Time
15 Nov 2024 21:14:48 EST (-0500)
  photons and sunpos.inc (Message 1 to 6 of 6)  
From: Anthony D  Baye
Subject: photons and sunpos.inc
Date: 14 Jun 2004 03:00:30
Message: <40CD4D0F.FAD8F9CD@sdsmt.edu>
I'm currently working with an outdoor scene, and I'm using sunpos.inc
for my lightsource.  The problem arises when I turn on photons, I keep
getting an error message saying "Photon map could not be saved: No
photons."
Does this have something to do with the distance sunpos.inc translates
the light_source?  or am I missing something?
I tried incresing the number of photons using the spacing keword rather
than count, but it still hadn't finished the photon run after almost
three hours.

Might I get better results if I used a shadowless light_source w/o media
interaction to cast the photons, placing it closer to the scene and
aligning it with
rotate <0, Az-90, Al> (provided by sunpos.inc)?

I'm running POV 3.5 on a Macintosh G4, 400 Mhz with 64 megs of ram
(shockingly pathetic, isn't it?)

/*
 Persistence of Vision Ray Tracer Scene Description File
 File: Fountain.pov
 Vers: 3.5
 Desc: A beautiful marble fountain with wrought copper detailing.
 Date: 10-19-03
 Auth: Anthony D. Baye
*/

#include "kolors.inc"
#include "textures.inc"
#include "functions.inc"
#include "sunpos.inc"

#declare ft = 12 ;

/* !-- Global Switches --! */
#declare Rad = off ;  //  Bool
#declare Pho = on ;  //  Bool
#declare Tex = on ;  //  Bool
#declare Spr = off ;  //  Bool
#declare Cam = 2  ;  //  1 = Viewer, 2 = Director, 3 = Aerial
#declare Sky = on ;  //  Bool
/* ----------------------- */

#include "FountainPieces2.inc"

/* !---- Global Settings ----! */
global_settings {
#if(Rad)
 radiosity {
  pretrace_start 0.02
  pretrace_end   0.01
  count 75

  nearest_count 10
  error_bound 0.1
  recursion_limit 2

  low_error_factor 0.2
  gray_threshold 0.2
  minimum_reuse 0.015
  brightness 0.59

//  save_file "Fountain.rca"
  load_file "Fountain.rca"

  adc_bailout 0.01/2
  }
#end

#if (Pho)
 photons {
  count 20000
  autostop 0
  jitter 0.4
  media 50, 30
  save_file "Fountain.ptn"
//  load_file "Fountain.ptn"
  }
#end

 max_trace_level 10

}

/* !---- Viewer and Lighting ----! */

/* --------------- Cameras ------------- */

/* Camera View */
#if(Cam = 1)
 camera {
  location  <0.0, 5.5*ft, -5.5*ft>
  up y
  right  4/3*x
  look_at   <0.0, 5.5*ft,  0.0>
  rotate 25.0*y
  }
#end

/* Directors View */
#if(Cam = 2)
camera {
 location  <0.0, 4.5*ft, -20.0*ft>
 up y
 right 4/3*x
 look_at   <0.0, 4.5*ft,  0.0>
 }
#end

/* Aerial View */
#if(Cam = 3)
camera {
 location  <0.0, 50.0*ft, -200.0*ft>
 up y
 right 4/3*x
 look_at   <0.0, 6.0*ft,  0.0>
 }
#end
/* ------------------------------------ */

light_source {
 SunPos(2004, 6, 12, 10, 30, 104.00, 44, 103.625)
 color rgb 0.625
 photons {
  refraction on
  reflection on
  }
  fade_power 2
  media_interaction on
  photons { reflection on refraction on }
 }

/*  !---------- Sky ----------! */

#if(Sky = off)
sky_sphere {
 pigment { function { abs(y) } color_map {[0.0 color rgb 1] [0.375 color
rgb 0.625] } }
 }
#else

#if(Sky = on)

sky_sphere {
 pigment { function { abs(y) } color_map {[0.0 color rgb 1] [0.375 color
SkyBlue2 ] } }
 }
/*
sky_sphere {
 pigment { function { abs(y) } color_map {[0.0 color rgb 1] [0.375 color
SkyBlue2 ] } }
 pigment {
  gradient y
   color_map {
    [0.000 0.00125 color rgbf <1.0, 0.8, 0.0, 0.0> color rgbf <1.0,
0.75, 0.0, 0.0> ]
    [0.00125 0.01 color rgbf <1.0, 0.75, 0.0, 0.0625> color rgbf <1.0,
0.75, 0.0, 1.0> ]
    }
   scale 1
   rotate 90.0*z
   rotate <0, Az-90, Al>
  }
 }
*/
/* ! ------ Sky Media ------ ! */

media {
 method 3
 intervals 1
 scattering { 4, <0.000009, 0.00000775, 0.000005>/2.0 extinction 1 }
 samples 30, 50
// absorption rgb <0.0000064, 0.000005397, 0.0>/2
 confidence 0.9999
 variance 1/1000
 ratio 0.9
 density {
  wrinkles
  ramp_wave
  color_map {
   [0 rgb 0]
   [0.4 rgb 0]
   [0.6 rgb 0.275]
   [1 rgb 0.475]
   }
  scale <600000*ft, 100000*ft, 50000*ft>/1.0
/*  rotate y*25
  translate <1000*ft, (28.0*(5280*ft))-(70000*ft), 0>*/
  }
 density {
  crackle
  triangle_wave
  turbulence 1.5
  color_map {
   [0 rgb 0]
   [0.3 rgb 0]
   [0.75 rgb 0.25]
   [1 rgb 0.5]
   }
  scale <1000000*ft, 500000*ft, 750000*ft>*10
/*  rotate y*-25
  translate <0, (28.0*(5280*ft))-(70000*ft), 0>*/
  }
 }

/* ! ---- End Sky Media ---- ! */
#end
#end

/* !---- Beginning of Scene ----! */

#declare River_Rock =
texture {
 pigment {
  agate
  turbulence 0.8
  color_map {
   [0.0, 0.25 color rgbf <0.349019, 0.082352, 0.27843, 0.1>
       color rgbf <0.419607, 0.0, 0.188235, 0.1> ]
   [0.25, 0.5 color rgbf <0.349019, 0.0, 0.188235, 0.1>
       color rgbf <0.45, 0.0, 0.1875, 0.1> ]
   [0.5, 0.75 color rgbf <0.45, 0.0, 0.1875, 0.1>
       color rgbf <0.45, 0.1875, 0.25, 0.1> ]
   [0.75, 1.0 color rgbf <0.45, 0.1875, 0.25, 0.1>
       color rgbf <0.875, 0.875, 0.875, 0.1> ]
   }
  }
 finish { reflection 0.00390625 ambient 0.1 diffuse 0.03125 phong 0.25
phong_size 0.0625 }
 }

#declare SandStone =
texture {
 pigment {
  granite
  turbulence 1.5
  color_map {
   [0.0 color rgbf <0.5, 0.0, 0.0, 0.1> ]
   [0.0 color rgbf <0.875, 0.875, 0.875, 0.1> ]
   }
  scale 0.0155125
  }
 normal { wrinkles 1 sine_wave scale 0.1875 }
 }

#declare f_Cobble =
function {
 pigment {
  image_map {
   tga "Cobblestone.tga"
   map_type 0
   interpolate 2
   }
  rotate 90*x
  scale <6.0*ft, 1.0, 6.0*ft>
  translate <-3.0*ft, 0.0, -3.0*ft>
  }
 }

object {
 union {
  difference {
   plane { y, 0 }
   box { <-225.0*ft, -2.0, -125.0*ft> <225.0*ft, 0.0, 125.0*ft> }
   }
  isosurface {
   function { y - f_Cobble(x,y,z).red*0.25 }
   max_gradient 4
   threshold 0
   contained_by { box { <-225.0*ft, -2.0, -125.0*ft> <225.0*ft, 0.25,
125.0*ft> } }
   max_trace 4
   }
  }
  texture {
   gradient y
   texture_map {
    [0.0 pigment { White } normal { granite 1 scale 0.001 } ]
    [0.0625 pigment { White } normal { granite 1 scale 0.001 } ]
    [0.078125 River_Rock ]
    [1.0 River_Rock ]
    }
   }
  photons { target reflection on refraction on }
 }

object {
 union {
  box { <-225.0*ft, 0.0, 75.0*ft> <-15.0*ft, 15.0*ft, 125.0*ft> }
  box { <225.0*ft, 0.0, 75.0*ft> <15.0*ft, 15.0*ft, 125.0*ft> }
  box { <-75.0*ft, 0.0, 60.0*ft> <-125.0*ft, 15.0*ft, -60.0*ft> }
  box { <75.0*ft, 0.0, 60.0*ft> <125.0*ft, 15.0*ft, -60.0*ft> }
  difference {
   box { <-15.0*ft, 0.0, 120.0*ft> <15.0*ft, 15.0*ft, 125.0*ft> }
   box { <-5.0*ft, -0.015625, 119.96875*ft> <5.0*ft, 6.0*ft,
125.03125*ft> }
   cylinder { <0.0, 6.0*ft, 119.96875*ft> <0.0, 6.0*ft, 125.03125*ft>
5.0*ft }
   }
  }
  pigment { White*0.875 }
  finish { reflection 0.001 ambient 0.1 diffuse 0.03125 phong 0.25
phong_size 0.0625 }
   photons { target reflection on refraction on }
 }

object {
 union {
  object { Basin }
  object { Capital translate 9.0*ft*y }
 #local fA = 0 ;
 #while(fA < 360)
  object { Column translate <0.0, 0.0, 6.125*ft> rotate fA*y }
  object { FCavityGrille translate 5.75*y rotate fA*y }
 #local fA = fA + 72.0 ;
 #end
  }
#if(Tex)
  pigment { Ivy_Marble scale 4 }
  finish { ambient 0.4 roughness 0.05 diffuse 0.6 reflection 0.01 }
 #else
  pigment { White }
#end
   photons { target reflection on refraction on }
 }


Post a reply to this message

From: Hughes, B 
Subject: Re: photons and sunpos.inc
Date: 14 Jun 2004 05:21:31
Message: <40cd6e1b$1@news.povray.org>
Hi Anthony. I'm of little or no help, except to say that I looked at it in
3.6 and can't get the photons to work either. It's obviously not the
sunpos.inc though, because replacing that with a typical location vector has
the same affect.

Also, FYI, I'm getting a "Photons 0 (sampling 1x1)" status message when
using the 'spacing' method, doing nothing else it seems, and file cannot be
saved message you told of  if using 'count'. However, there is a "photons
shot" and number showing up in the message stream after the rendering.

Bob H.


Post a reply to this message

From: Hughes, B 
Subject: Re: photons and sunpos.inc
Date: 14 Jun 2004 20:43:00
Message: <40ce4614$1@news.povray.org>
Now that I've thought about it and retried your scene file (less the
fountain object and image map) I had realized I might be using too small a
photon 'spacing' value for something with a global media, even though I had
already used spacing 0.5 before. I just haven't used photons and global
media together much myself, not that I could remember anyway.

So... out of the decimal places for spacing and into greater than one or the
tens and hundreds instead. I found it would be okay then if spacing 10, or
more, is used. Not too sure if it'll do what you need though. 'count'
refuses to accept a number and store the photon map, so I don't know if it's
simply unusable with global media. Someone else might know.

Anyway, looks like there could be a problem (or limitation in the sense of
taking too much computational power to be feasible for the average user)
with the combination of global media and photons I wasn't aware of... or
don't recall anything about it to pass on to you.

Bob H.


Post a reply to this message

From: Phil Cook
Subject: Re: photons and sunpos.inc
Date: 15 Jun 2004 07:35:01
Message: <opr9mvqsl8efp2ch@news.povray.org>
And lo on Mon, 14 Jun 2004 01:00:32 -0600, Anthony D. Baye  
<ant### [at] sdsmtedu> did spake, saying:

> I'm currently working with an outdoor scene, and I'm using sunpos.inc
> for my lightsource.  The problem arises when I turn on photons, I keep
> getting an error message saying "Photon map could not be saved: No
> photons."
> Does this have something to do with the distance sunpos.inc translates
> the light_source?  or am I missing something?
> I tried incresing the number of photons using the spacing keword rather
> than count, but it still hadn't finished the photon run after almost
> three hours.

As a quick solution try upping the reflection values (0.1 seems to work):  
9.1.3.5 Photon mapping is calculated only for those (user-specified)  
objects that need it (ie. objects that have reflection and/or refraction).

As your objects barely reflect or refract maybe there aren't enough  
photons doing anything worth storing?

> Might I get better results if I used a shadowless light_source w/o media
> interaction to cast the photons, placing it closer to the scene and
> aligning it with
> rotate <0, Az-90, Al> (provided by sunpos.inc)?
>
> I'm running POV 3.5 on a Macintosh G4, 400 Mhz with 64 megs of ram
> (shockingly pathetic, isn't it?)

Not really I run on occasion on a 266 PII with 64Mb now that's pathetic :)

--
Phil Cook

-- 
All thoughts and comments are my own unless otherwise stated and I am  
happy to be proven wrong.


Post a reply to this message

From: Hughes, B 
Subject: Re: photons and sunpos.inc
Date: 15 Jun 2004 08:38:48
Message: <40ceedd8$1@news.povray.org>
"Phil Cook" <phi### [at] nospamdeckingdealscouk> wrote in message
news:opr9mvqsl8efp2ch@news.povray.org...
>
> As a quick solution try upping the reflection values (0.1 seems to work):
> 9.1.3.5 Photon mapping is calculated only for those (user-specified)
> objects that need it (ie. objects that have reflection and/or refraction).
>
> As your objects barely reflect or refract maybe there aren't enough
> photons doing anything worth storing?

I think that statement from the doc might just be about using photon blocks
with target and/or collect. There may be a reflection threshold going on,
too, but nothing I'd know about; aside from the count, spacing, and some
other settings anyway.

Besides, I already tried increasing the reflections and got the same result
concerning the map not saving if 'count' were used. I didn't raise that
above 2 million, where-- IIRC-- it caused the "photons shot" number to
increase, however it just refused to save a map even then. Without having
tried everything possible I could never say it would never do so, just that
it seems a bit odd for it to not reach that point with a lower count than
that anyway.

I should say, though, 'spacing' has always been my usual method of using
photons so this trouble with count isn't anything I'm likely to encounter
myself.
;-)

Bob H.


Post a reply to this message

From: Phil Cook
Subject: Re: photons and sunpos.inc
Date: 15 Jun 2004 12:34:43
Message: <opr9m9leb8efp2ch@news.povray.org>
And lo on Tue, 15 Jun 2004 07:38:45 -0500, Hughes, B.  
<omn### [at] charternet> did spake, saying:

> "Phil Cook" <phi### [at] nospamdeckingdealscouk> wrote in message
> news:opr9mvqsl8efp2ch@news.povray.org...
>>
>> As a quick solution try upping the reflection values (0.1 seems to  
>> work):
>> 9.1.3.5 Photon mapping is calculated only for those (user-specified)
>> objects that need it (ie. objects that have reflection and/or  
>> refraction).
>>
>> As your objects barely reflect or refract maybe there aren't enough
>> photons doing anything worth storing?
>
> I think that statement from the doc might just be about using photon  
> blocks
> with target and/or collect. There may be a reflection threshold going on,
> too, but nothing I'd know about; aside from the count, spacing, and some
> other settings anyway.
>
> Besides, I already tried increasing the reflections and got the same  
> result
> concerning the map not saving if 'count' were used. I didn't raise that
> above 2 million, where-- IIRC-- it caused the "photons shot" number to
> increase, however it just refused to save a map even then. Without having
> tried everything possible I could never say it would never do so, just  
> that
> it seems a bit odd for it to not reach that point with a lower count than
> that anyway.
>
> I should say, though, 'spacing' has always been my usual method of using
> photons so this trouble with count isn't anything I'm likely to encounter
> myself.
> ;-)

Odd I set count to 20000 and I set the reflection on the last union object  
to 0.1 no error message and switching comments to load the photon map  
seemed quite happy.

--
Phil Cook

-- 
All thoughts and comments are my own unless otherwise stated and I am  
happy to be proven wrong.


Post a reply to this message

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