POV-Ray : Newsgroups : povray.advanced-users : Media photons Server Time
25 Nov 2024 14:26:26 EST (-0500)
  Media photons (Message 1 to 10 of 17)  
Goto Latest 10 Messages Next 7 Messages >>>
From: Andrew Coppin
Subject: Media photons
Date: 25 Sep 2002 11:49:10
Message: <3d91daf6@news.povray.org>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I can't get media photons to work.

I'm working on a tank full of water. (See povray.binaries.images -
"The Tank".) As you can see, I've already got some wonderful caustics
on the floor using photon mapping. So I thought it would be nice to
have shards of light in the water itself as well. I added some
scattering media to the water and turned on media photons. POV-Ray
spent 45 mins trying to make Swiss cheese out of my harddrive, then
gave up and said I didn't have enough memory. So I tried reducing the
number of photons. This time, POV-Ray spend a few hours shooting
photons, eventually dumping a photon map file of over 600MB. It took
*ages* to render the thing - the harddrive was paging on every line!
And when it did finish, the image was almost totally black.
(Presumably because there's not enough photons.)

So I was wondering... Is the media photons feature supposed to work?
Or did they implement it so that in 10 years' time there will be
computers powerful enough to do it? My machine is a 1.4GHz AMD with
256MB of RAM - hardly low spec!

Any ideas?
Andrew.

-----BEGIN PGP SIGNATURE-----
Version: PGPfreeware 7.0.3 for non-commercial use <http://www.pgp.com>

iQA/AwUBPZHXZLEpzUF0Y1JeEQKdaQCdEEEQofrItrw3B67OOsn2W1lNuLcAoMDY
Qv2IIyam11LSGWXc2lZ4CFip
=LFCY
-----END PGP SIGNATURE-----


Post a reply to this message

From: Christopher James Huff
Subject: Re: Media photons
Date: 25 Sep 2002 12:39:43
Message: <chrishuff-CD3992.12370925092002@netplex.aussie.org>
In article <3d91daf6@news.povray.org>,
 "Andrew Coppin" <orp### [at] btinternetcom> wrote:

> So I was wondering... Is the media photons feature supposed to work?
> Or did they implement it so that in 10 years' time there will be
> computers powerful enough to do it? My machine is a 1.4GHz AMD with
> 256MB of RAM - hardly low spec!

They work and are useable. The demo file optics.pov was designed on a 
"blue and white" Power Mac G3 at 350MHz with 384MB RAM. They are highly 
memory intensive though...storing photons throughout a volume takes a 
lot more photons than storing on a surface. It might be your tank is 
just too big. The blackout sounds odd too...did you get the media 
looking good before you tried photons? The number of photons won't 
really affect brightness, just the fineness of detail in the caustics.
You definitely need to reduce the number of media photons if it is so 
hard for your machine. Buying more RAM wouldn't be a bad idea either.

-- 
Christopher James Huff <cja### [at] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: chr### [at] tagpovrayorg
http://tag.povray.org/


Post a reply to this message

From: Tim Nikias
Subject: Re: Media photons
Date: 25 Sep 2002 13:03:19
Message: <3d91ec57$1@news.povray.org>
> The blackout sounds odd too...did you get the media
> looking good before you tried photons?

I suspect the scattering media is set incorrectly... Try that,
and then fiddle with the rest. It often happens to me that the
image gets darker when using scattering media, sometimes
setting extinction lower helps.

Regards,
Tim


--
Tim Nikias
Homepage: http://www.digitaltwilight.de/no_lights/index.html
Email: Tim### [at] gmxde


Post a reply to this message

From: Slime
Subject: Re: Media photons
Date: 25 Sep 2002 13:06:32
Message: <3d91ed18$1@news.povray.org>
> So I was wondering... Is the media photons feature supposed to work?
> Or did they implement it so that in 10 years' time there will be
> computers powerful enough to do it? My machine is a 1.4GHz AMD with
> 256MB of RAM - hardly low spec!

I used media photons heavily in this image:

http://www.slimeland.com/images/pictures/realwater.jpg

Just make sure your maximum number of media photons is as low as possible
(try 50 for starters), and reduce the spacing enough.

Try it on a smaller container at first to get the hang of it.

 - Slime
[ http://www.slimeland.com/ ]


Post a reply to this message

From: Christopher James Huff
Subject: Re: Media photons
Date: 25 Sep 2002 14:33:55
Message: <chrishuff-374641.14312125092002@netplex.aussie.org>
In article <3d91ec57$1@news.povray.org>,
 "Tim Nikias" <tim### [at] gmxde> wrote:

> I suspect the scattering media is set incorrectly... Try that,
> and then fiddle with the rest. It often happens to me that the
> image gets darker when using scattering media, sometimes
> setting extinction lower helps.

With transparent, refracting objects, this would make sense. Without 
photons, POV lets light go straight through objects, only simulating 
attenuation. With photons, the light can be refracted completely away 
from some areas, concentrating in others, making parts of the image 
darker.

-- 
Christopher James Huff <cja### [at] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: chr### [at] tagpovrayorg
http://tag.povray.org/


Post a reply to this message

From: Andrew Coppin
Subject: Re: Media photons
Date: 25 Sep 2002 16:26:35
Message: <3d921bfb@news.povray.org>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

As always, thanks you your replies people :-)

Maybe I was a little unclear... The image looks fine with scattering
media. (I had to play around with the exact density so that you get
enough scattering to see some effect, but not so much that it's like
a glass of milk!) It's only when I turned on media photons that
things went wrong. I got an almost totally black image, with just a
few dark-red "specks" here and there. (The media is slightly
blue-ish, to make it look more "watery".)

I have to say that I did all this a few weeks ago, before I
discovered this news server, and I can't seem to find the actual
image itself (the one with media photons turned on). And buggered if
I'm going to render it again! Was just checking whether what I'm
trying to do is actually impossible or whether I've just got the
settings wrong... To do the original image (the one I posted), I just
put "photons {}" into global_settings and it all worked perfectly.
Clearly I'll have to try harder to get media photons to work...

Andrew.

PS. It probably doesn't help that the water is an isosurface... Might
it be faster if the water were a normal box with an isosurface CSG'd
off the top? (I.e., so POV-Ray only has to do isosurface tests on the
upper-part of the image.)

-----BEGIN PGP SIGNATURE-----
Version: PGPfreeware 7.0.3 for non-commercial use <http://www.pgp.com>

iQA/AwUBPZIb8bEpzUF0Y1JeEQKvFwCff3KEIK7nRPzp3VEgOLtmOsUkwJYAn0V+
9PKUevEHPcV3kvzJ2EXeKdin
=gZ9r
-----END PGP SIGNATURE-----


Post a reply to this message

From: Andrew Coppin
Subject: Re: Media photons
Date: 25 Sep 2002 16:26:59
Message: <3d921c13@news.povray.org>
> I used media photons heavily in this image:
>
> http://www.slimeland.com/images/pictures/realwater.jpg

Oooo hey, I *like* that...

Andrew.


Post a reply to this message

From: Tom Melly
Subject: Re: Media photons
Date: 26 Sep 2002 08:27:11
Message: <3d92fd1f$1@news.povray.org>
"Andrew Coppin" <orp### [at] btinternetcom> wrote in message
news:3d921bfb@news.povray.org...

<snip>

Andrew, by coincidence I've been playing with the same problem, and have just
posted an image in binaries.images (code below).

BTW do you really need an iso for your water? Photons work fine with a normal.
The only reasons to use an iso IMHO would be:

a) your function is not suitable for a normal (anyone want to comment on this?)

b) you are showing the water surface where it touches another object, and you
therefore want a genuinely perturbed surface.

Here is the code to my scene if it helps (some stuff surplus to your
requirements):

// Persistence of Vision Ray Tracer Scene Description File
// File: tmland?.pov
// Vers: 3.5
// Desc: IRTC Wip
// Date: mm/dd/yy
// Auth: Tom Melly
//

#version 3.5;

#include "colors.inc"
#include "functions.inc"

#declare Do_photons   = true;
#declare Do_media     = true;
#declare Do_bed       = true;
#declare Do_env       = true;
#declare Do_rock      = true;
#declare Do_qrock     = false;
#declare Photon_sp    = 0.2; //.2
#declare Cont_rad     = 35; // 35
#declare Sea_col      = <1,1,1,1>; //<0.5,0.9,1.0,1.0>;
#declare Sea_medcol   = <0.8,0.2,0.1>*0.75; // 0.75
#declare Dens_min     = 0.1;//.1
#declare Cam_z        = -15;

#declare Do_sea       = true;

#if(abs(Cam_z)+10>(Cont_rad))
  Camera too far away!
#end

global_settings {
  assumed_gamma 1.0
  ambient_light 0
  #if(Do_photons)
    photons{
      spacing Photon_sp
      autostop 0 jitter 0.4
      #if(Do_media)
        media 100
      #end
      save_file "tmland6.ph"
      //load_file "tmland6.ph"
    }
  #end
}

#declare Dens_func = function(x,y,z){min(1,Dens_min + pow(x/Cont_rad,2) +
pow(z/Cont_rad,2))}

#declare Sea_media =
media{
  method 3
  intervals 10
  samples 3,15
  scattering {1,0.025 extinction 0.8} //0.025
  absorption Sea_medcol
  density{function{Dens_func(x,y,z)}}
}


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

camera {
  location  <0.0, 0.0, Cam_z>
  look_at   <0.0, -5.0, 35>
}

sky_sphere {
  pigment {
    wrinkles scale 0.25
    color_map {
      [0.0 rgb <0.6,0.7,1.0>]
      [0.7 rgb <0.2,0.4,0.8>]
    }
  }
}

light_source {
  <0, 0, 0>
  color rgb <1, 1, 1>*2.5
  media_interaction on
  media_attenuation on
  fade_distance 1500
  fade_power 2
  translate <1000, 2000, -500>
}

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

#if(Do_bed)
  #declare Bed_func = function(x,y,z){
    y +
    5 +
    (sin(x*5 - sin(z + f_noise3d(x,0,z))*1)/20) -
    (sin((x+z)*1 -
    sin(z + f_noise3d(x,0,z))*1)/30)
  }
#else
    #declare Bed_func = function(x,y,z){y + 5}
#end

#declare Bed_base =
difference{
  isosurface {
    function { Bed_func(x, y, z) }
    contained_by {sphere{0,Cont_rad}}
    accuracy 0.001
    max_gradient 2
    rotate y*35
  }
  plane{z,Cam_z-10}
  pigment{rgb<0.9,0.9,0.6>}
}

#declare Sea_func = function(x,y,z){y - 5}

#declare Sea_top =
difference{
  isosurface{
    function { Sea_func(x*1, y*1, z*1) }
    contained_by {sphere{0,Cont_rad}}
    accuracy 0.001
    max_gradient 5
    rotate y*25
  }
  plane{z,Cam_z-10}

  pigment{rgbf Sea_col}

  normal{bozo 5 scale 1/4}

  hollow
  #if(Do_photons) photons{target refraction on reflection on} #end
  finish{
    reflection{fresnel on}
    ambient 0 diffuse 0 conserve_energy
  }
  interior{
    ior 1.34
    #if(Do_media)
      media{Sea_media}
    #end
  }
}

#declare Wall =
difference{
  sphere{0,Cont_rad}
  sphere{0,Cont_rad - 0.01}
  plane{y,-7}
  plane{-y,-7.5}
  plane{z,Cam_z-10}
  pigment{rgb 0}
  #if(Do_photons) photons{collect off} #end
}

#if(Do_env|Do_bed)
  object{Bed_base}
#end
#if(Do_env|Do_sea)
  object{Sea_top}
#end

object{Wall}

#declare FAgate = function {
    pigment { agate color_map { [0 rgb 0] [1 rgb 1] }}
}
#declare FGranite = function {
    pigment { granite color_map { [0 rgb 0] [1 rgb 1] }}
}

#declare Rock_func = function(x,y,z){
  (x*x + y*y + z*z)
  + f_noise3d(x,y,z)/2
  - FAgate(x,y,z).gray/5
  - FGranite(x,y,z).gray/7
  - 1/2
}

#declare Rock =
isosurface {
  function { Rock_func(x/5, y/8, z/5) }
  contained_by { box { -10, 10 } }
  accuracy 0.001
  max_gradient 10

  pigment{rgb 0.5}

  translate <0,-3,0>
}

#if(Do_rock)
  object{Rock}
#else
  #if(Do_qrock)
    sphere{
      0,4
      scale <1,1.5,1>
      pigment{rgb 0.5}
      normal{agate scale 10}
      normal{granite scale 1/4}
      translate <0,-3,0>
    }
  #end
#end


Post a reply to this message

From: Andrew Coppin
Subject: Re: Media photons
Date: 26 Sep 2002 09:56:39
Message: <3d931217@news.povray.org>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

> BTW do you really need an iso for your water? Photons work fine
> with a normal. The only reasons to use an iso IMHO would be:
>
> a) your function is not suitable for a normal (anyone want to
> comment on this?)
>
> b) you are showing the water surface where it touches another
> object, and you therefore want a genuinely perturbed surface.

or c) you want to view the "waves" from a near-perpendicular
direction, and you want the front-most waves to obscure the more
distant waves ;-)

I had a look anyways - not a half bad image!

Andrew.

-----BEGIN PGP SIGNATURE-----
Version: PGPfreeware 7.0.3 for non-commercial use <http://www.pgp.com>

iQA/AwUBPZMSELEpzUF0Y1JeEQKjXgCgu1ko17h6+uyLlSi+qGDnKv1o8ecAn2i0
r5YitMX66AbQhPIVUjCJtmeh
=1l83
-----END PGP SIGNATURE-----


Post a reply to this message

From: Tom Melly
Subject: Re: Media photons
Date: 26 Sep 2002 10:01:31
Message: <3d93133b$1@news.povray.org>
"Andrew Coppin" <orp### [at] btinternetcom> wrote in message
news:3d931217@news.povray.org...

> > b) you are showing the water surface where it touches another
> > object, and you therefore want a genuinely perturbed surface.
>
> or c) you want to view the "waves" from a near-perpendicular
> direction, and you want the front-most waves to obscure the more
> distant waves ;-)

Heh - okay, c). (well, it's a sort of varient of my b), but whatthehell).

> I had a look anyways - not a half bad image!
>

Ta - from what I gather about your problem, the most likely reason, as other's
have suggested, is that your media-area is too large.


> Andrew.
>
> -----BEGIN PGP SIGNATURE-----
> Version: PGPfreeware 7.0.3 for non-commercial use <http://www.pgp.com>
>
> iQA/AwUBPZMSELEpzUF0Y1JeEQKjXgCgu1ko17h6+uyLlSi+qGDnKv1o8ecAn2i0
> r5YitMX66AbQhPIVUjCJtmeh
> =1l83
> -----END PGP SIGNATURE-----
>
>
>


Post a reply to this message

Goto Latest 10 Messages Next 7 Messages >>>

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