POV-Ray : Newsgroups : povray.advanced-users : Media photons Server Time
29 Jul 2024 12:20:49 EDT (-0400)
  Media photons (Message 8 to 17 of 17)  
<<< Previous 7 Messages Goto Initial 10 Messages
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

From: Peter Popov
Subject: Re: Media photons
Date: 26 Sep 2002 11:02:07
Message: <3786puorbl39gv5s7uu946eds799mcvlvq@4ax.com>
On Thu, 26 Sep 2002 14:56:36 +0100, "Andrew Coppin"
<orp### [at] btinternetcom> wrote:

>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 ;-)

Use a function-based height field intersected with a box, it might
work for you. You can get a major speed increase.


Peter Popov ICQ : 15002700
Personal e-mail : pet### [at] vipbg
TAG      e-mail : pet### [at] tagpovrayorg


Post a reply to this message

From: Andrew Coppin
Subject: Re: Media photons
Date: 26 Sep 2002 12:06:48
Message: <3d933098@news.povray.org>
Height field? Yes... that should be *much* faster just for this...

Andrew.


Post a reply to this message

From: Christopher James Huff
Subject: Re: Media photons
Date: 26 Sep 2002 14:34:43
Message: <chrishuff-D349D0.14321026092002@netplex.aussie.org>
In article <3d92fd1f$1@news.povray.org>,
 "Tom Melly" <tom### [at] tomandlucouk> wrote:

> BTW do you really need an iso for your water? Photons work fine with a normal.

Since his problem seems to be too many photons, this won't make a 
difference. And a truely perturbed surface will give more accurate 
results, and with large waves will look much better. A normal is only 
useful for small ripples and disturbed water, not for large waves which 
cover up further waves. A height field might do better for speed, if the 
triangle artifacts aren't too bad, but it wouldn't help his memory use 
at all.

-- 
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: Tom Melly
Subject: Re: Media photons
Date: 27 Sep 2002 05:07:50
Message: <3d941fe6$1@news.povray.org>
"Christopher James Huff" <chr### [at] maccom> wrote in message
news:chr### [at] netplexaussieorg...
>
> Since his problem seems to be too many photons, this won't make a
> difference. And a truely perturbed surface will give more accurate

Well, I was thinking more of render-time. Of course there are many situations
where a normal is not enough.


Post a reply to this message

From: Christopher James Huff
Subject: Re: Media photons
Date: 27 Sep 2002 09:08:37
Message: <chrishuff-8BEED1.09055027092002@netplex.aussie.org>
> Well, I was thinking more of render-time. Of course there are many situations
> where a normal is not enough.

Well, if it doesn't slow down renders without photons too much, it 
shouldn't slow down renders with them. It would make the collecting 
stage slower, though.

-- 
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: Tom Melly
Subject: Re: Media photons
Date: 27 Sep 2002 10:37:58
Message: <3d946d46$1@news.povray.org>
"Christopher James Huff" <chr### [at] maccom> wrote in message
news:chr### [at] netplexaussieorg...
>
> Well, if it doesn't slow down renders without photons too much, it
> shouldn't slow down renders with them. It would make the collecting
> stage slower, though.
>

True - but are there any circs when an iso didn't slow down rendering? Also, and
IMHO, if the render doesn't slow to a crawl when combining isos, media and
reflectivity then you're doing something wrong....

All I was really trying to say was that, if you're just trying to influence the
paths of photons, then a normal may be all you need (I should own up that until
the other day I didn't know that normals would influence photons, and therefore
used an iso quite unnecesserily).


Post a reply to this message

From: Rohan Bernett
Subject: Re: Media photons
Date: 14 Oct 2002 21:55:05
Message: <web.3dab749fc1d8def8d02c7b870@news.povray.org>
I wonder if this problem is similar to one I'm having with a scene involving
lasers reflectiong of mirrors around a room.

Media photons are used to make the reflected beam visible, but the most
distant beams don't appear. Could this problem be caused by the same thing
as Andrew's problem?

Rohan _e_ii


Post a reply to this message

<<< Previous 7 Messages Goto Initial 10 Messages

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