POV-Ray : Newsgroups : povray.general : Photon - Cornell Box Server Time
5 Aug 2024 00:21:23 EDT (-0400)
  Photon - Cornell Box (Message 11 to 19 of 19)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: Tim Nikias
Subject: Re: Photon - Cornell Box
Date: 20 Feb 2003 20:09:06
Message: <3e557c32$1@news.povray.org>
Okay, I'll post the example scene right after I wrote this
post.

Its actually a little tricky:
First, the object that will cast photons will need no_image,
in order for the object to not show up when rendering.
Still, it will casts shadows and reflect photons.
Then, a second object is needed, which will use
no_shadow (since one is already cast by the first
object) and it has to be slightly larger, since photons
don't like coincident surface (like nothing in POV does ;-).

For this to work, I've also written a macro which takes
care of these things all by itself. You need to supply
an object (without any texturing), a transform that will
be applied to it (like transform{translate <5,11,2>})
and two materials (since materials include everything,
ranging from pigment, normal, finish to interior):
One material which will have an effect on how and
in which color the photons are reflected (and thus needs
some reflection statement), the other can be any kind
of material (but doesn't need reflection, for your intended
diffuse look).
After these four things are declared, you call the macro and
feed it the desired options, and voila!
A diffuse object casting photons!
(see binaries.images)

Regards,
Tim

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


Post a reply to this message

From: White Zebra
Subject: Re: Photon - Cornell Box
Date: 20 Feb 2003 22:49:50
Message: <3e55a1de$1@news.povray.org>
Tim,

You amaze me.

This is an interesting technique you have there. I've looked at your image
and the specular reflections of photons are currently too obvious as the
caustics on the floor and on the the two walls behing clearly shows. I think
that something that might help diffuse the caustics a little more would be
to add a very rough bump material on the surface of the reflecting objects.

White Zebra

"Tim Nikias" <tim### [at] gmxde> wrote in message
news:3e557c32$1@news.povray.org...
> Okay, I'll post the example scene right after I wrote this
> post.
>
> Its actually a little tricky:
> First, the object that will cast photons will need no_image,
> in order for the object to not show up when rendering.
> Still, it will casts shadows and reflect photons.
> Then, a second object is needed, which will use
> no_shadow (since one is already cast by the first
> object) and it has to be slightly larger, since photons
> don't like coincident surface (like nothing in POV does ;-).
>
> For this to work, I've also written a macro which takes
> care of these things all by itself. You need to supply
> an object (without any texturing), a transform that will
> be applied to it (like transform{translate <5,11,2>})
> and two materials (since materials include everything,
> ranging from pigment, normal, finish to interior):
> One material which will have an effect on how and
> in which color the photons are reflected (and thus needs
> some reflection statement), the other can be any kind
> of material (but doesn't need reflection, for your intended
> diffuse look).
> After these four things are declared, you call the macro and
> feed it the desired options, and voila!
> A diffuse object casting photons!
> (see binaries.images)
>
> Regards,
> Tim
>
> --
> Tim Nikias
> Homepage: http://www.digitaltwilight.de/no_lights/index.html
> Email: Tim### [at] gmxde
>
>


Post a reply to this message

From: White Zebra
Subject: Re: Photon - Cornell Box
Date: 20 Feb 2003 22:59:43
Message: <3e55a42f$1@news.povray.org>
Tim,

Sorry for the confusion, I did not use the expression "specular reflection"
in a precise enough manner. What I really meant was that the photons would
be reflected specularly. Not that we would see specular reflection of other
objects in the objects.

The difference is that when a photon is bounced from a specular surface, it
is bounced back *only* in the mirror direction from the surface normal.
While when a photon is bounced from a diffuse surface, it is bounced back in
*all* directions. Because of that, global photons do not produce caustics.
They will just add more radiance to alreadu illuminated objects.

Regards,

White Zebra

"Tim Nikias" <tim### [at] gmxde> wrote in message
news:3e55765e$1@news.povray.org...
> What I suggested wouldn't give you specular
> reflections. Photons will be reflected off of specular-
> reflecting objects, which, when using no_image, won't
> show up on the final image. Thus, you need to place
> the same object, but in this case may change texture,
> normal, finish... So you can also leave out the reflection.
>
> You should look up on no_image, no_shadow,
> no_reflection for that.
>
> And in case this wouldn't work, you could still save the
> photons using specular-reflection, and then load them
> into the same scene, but with all specular reflections
> turned off.
>
> I'll post a short example when I've finished one.
>
> Regards,
> Tim
>
> --
> Tim Nikias
> Homepage: http://www.digitaltwilight.de/no_lights/index.html
> Email: Tim### [at] gmxde
>
> > Tim,
> >
> > Global photon mapping isn't implemented in POV-Ray. I've checked in the
> > source and there are some blocks of codes related to "GLOBAL_PHOTONS"
which
> > are not compiled. I guess that is because it is not flly functional or
fully
> > debugged.
> >
> > Yoursuggestion wouldn't work because it would produce specular
reflections.
> > I actually tried something similar to what you suggest. What I need is
> > diffuse reflection.
> >
> > Thanks for the suggestion. But I guess I'll wait for the global photons
to
> > be fully implemented and debugged.
> >
> > Black Zebra
> >
> > "Tim Nikias" <tim### [at] gmxde> wrote in message
> > news:3e5553c6@news.povray.org...
> > > As I've read the other comments on this, here goes:
> > >
> > > Photon-light-mapping is used to reflect or refract light
> > > off of either reflecting or refracting (transparent objects
> > > with any ior-value, even the default), so for refraction to
> > > work properly with photons, the object needs to be
> > > transparent or filtering to let some light travel through
> > > the object. In order to reflect photons, the object needs
> > > to have reflection in the finish{} Block.
> > >
> > > In order to achieve what you want, it might be possible
> > > to supply two objects, one with no_image and reflection,
> > > the other without reflection and without no_image.
> > > The no_image-object will be the target for photons, but
> > > won't show up on the image itself, thus you're non-reflecting
> > > objects SEEM to reflect photons.
> > >
> > > But this might not work. Then you'd have to do two passes:
> > > Render the scene with photons and all objects that reflect
> > > photons have reflection, save the photons. The second
> > > pass will be to load the photons, but keep the object without
> > > reflection.
> > >
> > > One of these, at least the last, should work.
> > >
> > > --
> > > Tim Nikias
> > > Homepage: http://www.digitaltwilight.de/no_lights/index.html
> > > Email: Tim### [at] gmxde
> > >
> > > > I'm trying to code the cornell box but using Photons Mapping instead
of
> > > > radiosity. So far, no success. I've got all my photons{} blocs in my
> > > > global, light and objects. The scene is very simple but all I get is
> > > > essentially the same render as with ray-trace only.
> > > >
> > > > Can anybody suggest something I might have missed?
> > > >
> > > > Thanks.
> > > >
> > > > Here is the scene file:
> > > >
> > > > global_settings {
> > > >   assumed_gamma 1.0
> > > >   max_trace_level 5
> > > >   photons {
> > > >     count 100000
> > > >     max_trace_level 9
> > > >   }
> > > > }
> > > >
> > > > #declare Finish=finish{diffuse 0.75 ambient 0}
> > > >
> > > > #declare White=texture{pigment{rgb<1,1,1>} finish{Finish}}
> > > > #declare Red=texture{pigment{rgb<0.57,0.025,0.025>} finish{Finish}}
> > > > #declare Green=texture{pigment{rgb<0.025,0.236,0.025>}
finish{Finish}}
> > > >
> > > > #declare LightColor=<1,0.67,0.21>;
> > > >
> > > >
> > > > light_source{
> > > >   <27.8,54.88,27.95>
> > > >   color LightColor
> > > >   spotlight radius -90 falloff 90 tightness 1 point_at
<27.8,0,27.95> //
> > for
> > > > cosine falloff
> > > >   photons {
> > > >     refraction on
> > > >     reflection yes
> > > >   }
> > > > }
> > > >
> > > >
> > > > camera{
> > > >   location  <27.8, 27.3,-80.0>
> > > >   direction <0, 0, 1>
> > > >   up        <0, 1, 0>
> > > >   right     <-1, 0, 0>
> > > >   angle 39.5
> > > > }
> > > >
> > > >
> > > > // ------------------------ OBJECTS ----------------------------
> > > >
> > > > // Light Patch
> > > > box{
> > > >   <21.3,54.87,33.2><34.3,54.88,22.7> no_shadow
> > > >   pigment{rgb<1,1,1>} finish{ambient 0.78 diffuse 1}
> > > >   photons {
> > > >     target
> > > >     refraction off
> > > >     reflection yes
> > > >     collect off
> > > >   }
> > > > }
> > > >
> > > > union{
> > > >   // Floor
> > > >   triangle{<55.28, 0.0, 0.0>,<0.0, 0.0, 0.0>,<0.0, 0.0, 55.92>}
> > > >   triangle{<55.28, 0.0, 0.0>,<0.0, 0.0, 55.92>,<54.96, 0.0, 55.92>}
> > > >   // Ceiling
> > > >   triangle{<55.60, 54.88, 0.0>,<55.60, 54.88, 55.92>,<0.0, 54.88,
> > 55.92>}
> > > >   triangle{<55.60, 54.88, 0.0>,<0.0, 54.88, 55.92>,<0.0, 54.88,
0.0>}
> > > >   // Back wall
> > > >   triangle{<0.0, 54.88, 55.92>,<55.60, 54.88, 55.92>,<54.96, 0.0,
> > 55.92>}
> > > >   triangle{<0.0, 54.88, 55.92>,<54.96, 0.0, 55.92>,<0.0, 0.0,
55.92>}
> > > >   texture {White}
> > > >   split_union off
> > > >   photons {
> > > >     target 1.0
> > > >     refraction off
> > > >     reflection yes
> > > >     collect off
> > > >   }
> > > > }
> > > >
> > > > union {
> > > >   // Right wall
> > > >   triangle{<0.0, 54.88, 0.0>,<0.0, 54.88, 55.92>,<0.0, 0.0, 55.92>}
> > > >   triangle{<0.0, 54.88, 0.0>,<0.0, 0.0, 55.92>,<0.0, 0.0, 0.0>}
> > > >   texture {Green}
> > > >   split_union off
> > > >   photons {
> > > >     target 1.0
> > > >     refraction off
> > > >     reflection yes
> > > >     collect off
> > > >   }
> > > > }
> > > >
> > > > union {
> > > >   // Left wall
> > > >   triangle{<55.28, 0.0, 0.0>,<54.96, 0.0, 55.92>,<55.60, 54.88,
55.92>}
> > > >   triangle{<55.28, 0.0, 0.0>,<55.60, 54.88, 55.92>,<55.60, 54.88,
0.0>}
> > > >   texture {Red}
> > > >   split_union off
> > > >   photons {
> > > >     target 1.0
> > > >     refraction off
> > > >     reflection yes
> > > >     collect off
> > > >   }
> > > > }
> > > >
> > > > box {
> > > >   // Short bloc
> > > >   <-8.35,0,-8.35>,<8.35,16.5,8.35>
> > > >   rotate <0,-17,0>
> > > >   translate <18.6,0,16.85>
> > > >   texture { White }
> > > >   photons {
> > > >     target 1.0
> > > >     refraction off
> > > >     reflection yes
> > > >     collect off
> > > >   }
> > > > }
> > > >
> > > >
> > > > box {
> > > >   // Tall bloc
> > > >   <-8.35,0,-8.35>,<8.35,33,8.35>
> > > >   rotate <0,17,0>
> > > >   translate <36.85,0,35.15>
> > > >   texture { White }
> > > >   photons {
> > > >     target 1.0
> > > >     refraction off
> > > >     reflection yes
> > > >     collect off
> > > >   }
> > > > }
> > > >
> > > > WhiteZebra
> > > >
> > >
> > >
> >
> >
>
>


Post a reply to this message

From: Warp
Subject: Re: Photon - Cornell Box
Date: 21 Feb 2003 05:31:28
Message: <3e55ffff@news.povray.org>
WhiteZebra <ypo### [at] cogniscienceinccom> wrote:
> If you are talking about adding a reflection attribute un the finish block,
> I
> tried that but this is not what I'm looking for.

  Well, that's precisely what I was implying: What you want is not possible
with photons (not in POV-Ray).

> I've tried to set "collect on" everywhere (I just did) but still no photons.

  That's because you have no reflecting nor refracting surfaces. My point
was that even if you had reflecting/refracting surfaces, you would not see
any photons because no surface was collecting them.

-- 
#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: Tim Nikias
Subject: Re: Photon - Cornell Box
Date: 21 Feb 2003 06:07:55
Message: <3e56088b@news.povray.org>
> You amaze me.

Nah, just experience and a nack for experimenting.

What might work for every surface to collect photons
and every surface to reflect photons, would be to put
them all inside a union{} and make them a target. Photons
will be generated with all objects using reflection, but won't
show up in the final image due to no_image.

But, in this occasion, if you want the entire scene to be
light by photons, it would probably really be easier to put
something like
#declare Reflect_Photons=yes;
at the beginning and
finish{ #if (Reflect_Photons) reflection 1 #end [other finishes]}
inside every finish for every material.
Then render the scene with reflections on, and save the photons
using "save_file" inside the photon{} Block of the global
settings.
Then, switch Reflect_Photons to no/off/0 and use
load_file instead of save_file. Thus, no specular reflections,
but photons all over the place. This would get quiet parsing
and memory intensive though.

Let me see if I can cook up a small scene for that.

Regards,
Tim

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

> Tim,
>
> You amaze me.
>
> This is an interesting technique you have there. I've looked at your image
> and the specular reflections of photons are currently too obvious as the
> caustics on the floor and on the the two walls behing clearly shows. I think
> that something that might help diffuse the caustics a little more would be
> to add a very rough bump material on the surface of the reflecting objects.
>
> White Zebra


Post a reply to this message

From: Tim Nikias
Subject: Re: Photon - Cornell Box
Date: 21 Feb 2003 08:29:41
Message: <3e5629c5$1@news.povray.org>
Doesn't look too good. I'll post the scene as a reply
to the other one, but the effects aren't really satsifying.
For one, I've tried to use the blurred-reflections-technique
(as described on my homepage), and the texture is still
in the scene, though not in use.
Problem is, the photons get reflected too directly, and
as such, we get very sharp shadows. It works for some
parts of the scene, but not quiet satisfying. It seems
photons would have a long way to go to simulate global-
illumination.

Anyway, you can have a look at the scene and toy around.
Was a neat idea, but the experiments show that the effort
is futile. It would get ridiculously slow in parsing and
memory for an amount of photons using blurred-reflections
to get the desired global-illumination-look.

Anyways, perhaps some might get more insight into this
issue of using photons...

Regards,
Tim


--
Tim Nikias
Homepage: http://www.digitaltwilight.de/no_lights/index.html
Email: Tim### [at] gmxde
"Tim Nikias" <tim### [at] gmxde> schrieb im Newsbeitrag
news:3e56088b@news.povray.org...
> > You amaze me.
>
> Nah, just experience and a nack for experimenting.
>
> What might work for every surface to collect photons
> and every surface to reflect photons, would be to put
> them all inside a union{} and make them a target. Photons
> will be generated with all objects using reflection, but won't
> show up in the final image due to no_image.
>
> But, in this occasion, if you want the entire scene to be
> light by photons, it would probably really be easier to put
> something like
> #declare Reflect_Photons=yes;
> at the beginning and
> finish{ #if (Reflect_Photons) reflection 1 #end [other finishes]}
> inside every finish for every material.
> Then render the scene with reflections on, and save the photons
> using "save_file" inside the photon{} Block of the global
> settings.
> Then, switch Reflect_Photons to no/off/0 and use
> load_file instead of save_file. Thus, no specular reflections,
> but photons all over the place. This would get quiet parsing
> and memory intensive though.
>
> Let me see if I can cook up a small scene for that.
>
> Regards,
> Tim
>
> --
> Tim Nikias
> Homepage: http://www.digitaltwilight.de/no_lights/index.html
> Email: Tim### [at] gmxde
>
> > Tim,
> >
> > You amaze me.
> >
> > This is an interesting technique you have there. I've looked at your image
> > and the specular reflections of photons are currently too obvious as the
> > caustics on the floor and on the the two walls behing clearly shows. I think
> > that something that might help diffuse the caustics a little more would be
> > to add a very rough bump material on the surface of the reflecting objects.
> >
> > White Zebra
>
>


Post a reply to this message

From: Tom Melly
Subject: Re: Photon - Cornell Box
Date: 21 Feb 2003 09:28:24
Message: <3e563788$1@news.povray.org>
"Tim Nikias" <tim### [at] gmxde> wrote in message
news:3e5629c5$1@news.povray.org...

> Anyways, perhaps some might get more insight into this
> issue of using photons...

"Doctor, it hurts when I do this."
"Then don't do it."


Post a reply to this message

From: Tim Nikias
Subject: Re: Photon - Cornell Box
Date: 21 Feb 2003 09:33:50
Message: <3e5638ce@news.povray.org>
:-)

I meant that like: People who don't know a lot about
photons might get some information from it, which they
don't understand from the documentation. Sometimes
examples do help, you know. ;-)

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

>
> "Doctor, it hurts when I do this."
> "Then don't do it."
>
>


Post a reply to this message

From: Peter Popov
Subject: Re: Photon - Cornell Box
Date: 7 Mar 2003 12:12:10
Message: <7jkh6vs99254qsh0tlhi5313v7sln2fte9@4ax.com>
On Thu, 20 Feb 2003 22:56:50 -0500, "White Zebra"
<ypo### [at] cogniscienceinccom> wrote:

>The difference is that when a photon is bounced from a specular surface, it
>is bounced back *only* in the mirror direction from the surface normal.
>While when a photon is bounced from a diffuse surface, it is bounced back in
>*all* directions. Because of that, global photons do not produce caustics.
>They will just add more radiance to alreadu illuminated objects.

Ouch...

Even in a polygon-based renderer (which POV is not), I can smell some
very bad integrals involved to determine the energy distribution. In
POV's case, all I smell is a LOT of sampling should this technique
ever be implemented.


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


Post a reply to this message

<<< Previous 10 Messages Goto Initial 10 Messages

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