POV-Ray : Newsgroups : povray.general : Media emission as true light source? Server Time
5 Aug 2024 02:17:21 EDT (-0400)
  Media emission as true light source? (Message 17 to 26 of 26)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: ABX
Subject: Re: Media emission as true light source?
Date: 5 Feb 2003 09:35:58
Message: <s0824vs8u4329c72jskgtujv8rf9ovh9bm@4ax.com>
On 5 Feb 2003 09:23:08 -0500, Warp <war### [at] tagpovrayorg> wrote:
>   Some main ideas about the signatures is that they should be as short as
> possible, and as obfuscated as possible (so that you simply have no idea
> what it will render) and when rendered, they will show a nice image, preferably
> with your name/initials/nick in it.

IMO POV signatures are also nice tutorials what SDL can and how to write some
simple effects without unnecessary overloading. Of course it requires usually
"unrolling" of script which can be another lesson of SDL. I consider sigs as
an optional stage in SDL experience.

ABX
-- 
disc{z,-z#macro O()asc(substr("-+((1*(,1,/.-,*/(,&.323/'1"e 1))/10-4#declare
e=e-1;#end#local e=26;5pigment{#local g=function(_){ceil(_)-_}function#local
k=function{pattern{object{sphere_sweep{linear_spline 13#while(e)<O()O()>.01#
end}}}}{k(g(atan2(x,y)),g(ln(pow(x+y,2)+1e-5)),0)}}finish{ambient 1}}//ABX35


Post a reply to this message

From: Neil Conway
Subject: Re: Media emission as true light source?
Date: 5 Feb 2003 09:40:06
Message: <web.3e412134c7b69b7a1c4fca030@news.povray.org>
Warp wrote:
>Nathan Kopp <pov### [at] nkoppmailshellcom> wrote:
>> 1) Lack of specular & phong highlights.
>
>  Making the surfaces a bit reflective, and specially playing with the
>reflection exponent should help a lot with this.

Well, you've clearly had practice :-))

(Several other people have also added points about reflections - thanks
folks.)

To add more coal to the fire, I have just browsed the first few pictures in
your gallery (wow!).  I see your first picture (Juice.jpg) has what look
exactly like specular reflections from the surface of the glass sheet on
the table, not to mention highlights on the drinking vessels.  Then,
looking at the hourglass picture, I see a mirror !?  I had thought this was
exactly what the manual said wasn't possible...
The mirror shows a reflection of the rear side of the hourglass etc.  Was
this "real" or did you have to cheat by making additional objects (or a
composite picture)?

Nice one :-)

Neil


Post a reply to this message

From: Neil Conway
Subject: Re: Media emission as true light source?
Date: 5 Feb 2003 09:45:03
Message: <web.3e412247c7b69b7a1c4fca030@news.povray.org>
Tom Melly wrote:
>Just to muddy the waters... specular reflection of light can be done in POV by
>using photons (like many raytracers, POV doesn't handle specular reflection of
>light easily, since rays are traced from the camera to the light source).

Hmm, I've been hopping to and fro in the docs - must read 'em properly - and
I did read about photons.  I will go back and try to figure out what they
can do for me (and what their limitations are).

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

thanks
Neil


Post a reply to this message

From: Warp
Subject: Re: Media emission as true light source?
Date: 5 Feb 2003 09:56:22
Message: <3e412616@news.povray.org>
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?

-- 
#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: 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.