POV-Ray : Newsgroups : povray.general : Media emission as true light source? Server Time
5 Aug 2024 04:18:03 EDT (-0400)
  Media emission as true light source? (Message 21 to 26 of 26)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: Christopher James Huff
Subject: Re: Media emission as true light source?
Date: 5 Feb 2003 11:34:53
Message: <cjameshuff-373B50.11315805022003@netplex.aussie.org>
In article <web.3e412247c7b69b7a1c4fca030@news.povray.org>,
 "Neil Conway" <nei### [at] yahoocom> wrote:

> In terms of CPU time, it doesn't necessarily represent a problem if this
> takes weeks of CPU per picture.  Firstly, I don't need to do it very often,
> and secondly, I can always beg some time on our Beowulf cluster (hmm, I
> now remember reading that photons don't lend themselves well to clustered
> tracing...).

You must be thinking of radiosity. Radiosity computes some information 
while rendering, keeping the data in sync is extremely difficult. Photon 
mapping precomputes a photon map, and doesn't have this kind of problem.

-- 
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: Neil Conway
Subject: Re: Media emission as true light source?
Date: 5 Feb 2003 12:05:03
Message: <web.3e41430dc7b69b7a1c4fca030@news.povray.org>
Warp wrote:
>Neil Conway <nei### [at] yahoocom> wrote:
>> Then,
>> looking at the hourglass picture, I see a mirror !?  I had thought this was
>> exactly what the manual said wasn't possible...
>
>  Which part of the manual, exactly?
>
>  Reflection is one of the most basic and simplest features of raytracing.
>Where did you get the impression that it would be difficult?

D'oh.  I've been looking around, and I believe I got this (mis)impression
from a whole variety of titbits of info, one of which was the FAQ; part of
the FAQ explains why light doesn't reflect from mirrors: "Although this
method is very efficient and it allows you to render simple scenes in
question of seconds, it has some drawbacks. One of them is that you can't
calculate light reflecting from mirrors."

I guess my brain wasn't distinguishing properly between "can't calculate
light reflecting from mirrors" and "can't calculate rays reflecting from
mirrors".  Clearly the latter is possible(!).  (Try as I might, I couldn't
figure out why it wasn't trivial - of course, it is... ;-)

Thanks for continuing to squash my misconceptions!

Neil


Post a reply to this message

From: Christopher James Huff
Subject: Re: Media emission as true light source?
Date: 5 Feb 2003 14:38:27
Message: <cjameshuff-AA7E9A.14353205022003@netplex.aussie.org>
In article <web.3e4118dbc7b69b7a1c4fca030@news.povray.org>,
 "Neil Conway" <nei### [at] yahoocom> wrote:

> Are multiple reflections handled by the radiosity & emitting media code?  (I
> mean multiple reflections from regular objects btw.)

The emitting code doesn't "handle" any reflections. I don't know what 
you are asking, your question doesn't make sense.


> I've read the FAQ's on this before, but I must admit I'm still somewhat
> puzzled.  A perfect mirror (unlike machined metal) should be trivial to
> handle - the direction of the ray is simply reflected about the normal to
> the mirror, after which you track it until it hits something else.  Is it
> that people want to handle imperfect mirrors?  Or is it simply that the
> angular density of the rays becomes an issue?

You seem to have a misconception of how raytracing works. Ordinary 
raytracing works by following rays backwards from the camera to a 
surface, and computing the illumination of that surface. Computing 
reflections of other parts of the scene is possible this way, computing 
reflection of light through a scene is not. Photon mapping can handle 
light coming indirectly from a light source through a reflection, but 
media does not emit photons.


> (On re-reading your paragraph above, I realise you meant specular
> reflections of light emitted from media.  However, I understood from the
> docs that specular reflections aren't really handled at all - correct?)

No, I meant diffuse reflections, handled by radiosity. POV simulates 
light emitted by media and reflected directly into the camera by 
ordinary raytracing and diffuse illumination of other surfaces with 
radiosity, but it can not simulate specular reflection of light emitted 
by media.
Specular reflection of light from light sources can be done with 
photons, but emitting media doesn't emit photons. You could spread a 
bunch of photon-emitting light sources through your media, it would be 
slow but could give a better approximation.

-- 
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: Neil Conway
Subject: Re: Media emission as true light source?
Date: 6 Feb 2003 04:45:07
Message: <web.3e422e67c7b69b7a1c4fca030@news.povray.org>
Christopher James Huff wrote:
>In article <web.3e4118dbc7b69b7a1c4fca030[at]news.povray.org>,
> "Neil Conway" <nei### [at] yahoocom> wrote:
>
>> Are multiple reflections handled by the radiosity & emitting media code?  (I
>> mean multiple reflections from regular objects btw.)
>
>The emitting code doesn't "handle" any reflections. I don't know what
>you are asking, your question doesn't make sense.

What I meant was, is the light emitted from an emission medium reflected
from objects onto other objects?  (I'm starting to get the idea, sorry it's
so painfully slow.)  I now believe the correct term is "inter-diffuse"
reflection.  I know that radiosity handles multiple reflections for regular
light sources, but it's not immediately clear if the same applies to
media...

>You seem to have a misconception of how raytracing works.

[See a couple of messages higher - I had misunderstood the FAQ (sheesh!)
when it said that reflections of light from mirrors weren't possible...]

>reflections of other parts of the scene is possible this way, computing
>reflection of light through a scene is not. Photon mapping can handle
>light coming indirectly from a light source through a reflection, but
>media does not emit photons.

Thanks for the tips.  I had been browsing the source code, and had just
reached the conclusion that media don't emit photons :-))  (I think this is
what you alluded to in a previous message?)

However, it looks like a simple patch to generate genuine photons from media
- lots of CPU time, but fairly straightforward, no?  I might give that a
stab if it's not a desperately stupid thing to try...

thanks again
Neil


Post a reply to this message

From: Tom Melly
Subject: Re: Media emission as true light source?
Date: 6 Feb 2003 10:56:07
Message: <3e428597@news.povray.org>
"Neil Conway" <nei### [at] yahoocom> wrote in message
news:web.3e422e67c7b69b7a1c4fca030@news.povray.org...
>
> What I meant was, is the light emitted from an emission medium reflected
> from objects onto other objects?  (I'm starting to get the idea, sorry it's
> so painfully slow.)  I now believe the correct term is "inter-diffuse"
> reflection.  I know that radiosity handles multiple reflections for regular
> light sources, but it's not immediately clear if the same applies to
> media...
>

[sample scene below]

Yes, provided you are using radiosity, inter-diffuse reflection is handled. What
is not handled is direct reflection. In other words, if you placed a mirror on a
red wall near some emitting media, then objects facing the wall would pick up
some red light (from the inter-diffuse reflection), but no white light (assuming
that an object was placed in the correct position to receive direct reflection
of the media via the mirror).

The only way that the direct reflection could be handled would be with photons,
which can only (iirc) be used with normal light sources, not emitting media.

One setting relating to inter-diffuse reflection in radiosity is
recursion_limit, which represents how many times light is allowed to "bounce"
before the radiosity calculation is abandoned.

The following scene will allow you to play with radiosity/photons/emitting media
and to see how they interact.

A few notes describing what you are seeing.

The camera is looking down on the scene.
There is a light and some emitting media at the same point
The light/media is in front of a small box with a white pigment
Beyond the small box is a larger one with a checker-board texture.
Some squares of the checker texture are pale green, the others are mirrors.

Radiosity will allow the small box to pick up some of the pale green
Photons will allow the small box to pick up the direct reflections from the
mirrored surfaces.
You will find that direct reflection will only occur when doPointLight and
doPhotons are both set to true.

// Persistence of Vision Ray Tracer Scene Description File
// File: ?.pov
// Vers: 3.5
// Desc: Basic Scene Example
// Date: mm/dd/yy
// Auth: ?
//

#version 3.5;

#include "colors.inc"

#declare doMedia =      true;
#declare doRadiosity =  true;
#declare doPhotons =    true;
#declare doPointLight = true;

global_settings {
  assumed_gamma 1.0
  ambient_light 0
  #if(doPhotons)
    photons {
      spacing 0.01
    }
  #end
  #if(doRadiosity)
    radiosity {
      pretrace_start 0.08
      pretrace_end   0.04
      count 200
      media on
      recursion_limit 5
      error_bound 0.75
    }
  #end
}

camera {
  location  <0.0,10,3>
  look_at   <0.0,0.0,3.01>
}

#if(doMedia)
sphere{
  0,1 pigment{rgbf 1}
  interior{
    media{
      emission 1
      density{
        agate density_map{
          [0.5 rgb 0]
          [1 rgb 20]
        }
      }
      density{
        spherical
      }
    }
  }
  hollow
  translate y*2
  photons{collect off pass_through} // required if media is not to block photons
}
#end

#if(doPointLight)
  light_source {
    0*x                  // light's position (translated below)
    color rgb <1,1,1>    // light's color
    translate <0, 2, 0>
    photons{}

  }
#end

box{
  <-4,-2,5>,<4,5,5.5>
  texture{
    checker
    texture{
      pigment{rgb<0.5,1,0.5>}
    }
    texture{
      pigment{Black}
      finish{reflection 1 diffuse 0}
    }
  }
  photons{target reflection on refraction off}
}

plane{
  y,-1 pigment{
    bozo pigment_map{[0 Gray20][1 Gray80]}
  }
  photons{collect off}
}

box{
  <-2,-5,0>,<2,1,1>
  pigment{White} rotate x*-45 translate z*2
}


Post a reply to this message

From: Neil Conway
Subject: Re: Media emission as true light source?
Date: 7 Feb 2003 06:45:04
Message: <web.3e439b44c7b69b7a1c4fca030@news.povray.org>
Tom Melly wrote:
>The only way that the direct reflection could be handled would be with photons,
>which can only (iirc) be used with normal light sources, not emitting media.

Yes - I'm pondering the wisdom of a patch to emit photons from media...

>The following scene will allow you to play with radiosity/photons/emitting
>media and to see how they interact.

Excellent, thanks - I'll play with it now ;-)

Neil


Post a reply to this message

<<< Previous 10 Messages Goto Initial 10 Messages

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