POV-Ray : Newsgroups : povray.general : no_shadow and photon pass_through Server Time
26 Dec 2024 02:09:32 EST (-0500)
  no_shadow and photon pass_through (Message 1 to 10 of 11)  
Goto Latest 10 Messages Next 1 Messages >>>
From: Nigel
Subject: no_shadow and photon pass_through
Date: 31 Jul 2007 18:20:01
Message: <web.46afb544907043f1d1c9ffdd0@news.povray.org>
From section 3.6.3.2.2 of the documentation


automatically. You can then turn off pass_through if necessary by simply
using photons { pass_through off }.


This is exactly what I am trying to do, but it does not seem to work for me.
 I'm using Povray 3.6.1

I've created a small scene below, a glass sphere on a plane, to demonstrate
this.

With the no_shadow modifier present, no caustics (and no shadow) are visible
on the plane.  Whereas I was expecting to see caustics on the plane (having
explicitly turned pass_though off in the objects photon block) but no
shadow.

If you comment out the no_shadow line, caustics (and the shadow) are visible
on the plane.

Am I doing something wrong?

Here is the scene.

#include "textures.inc"

global_settings {
      photons { count 20000 autostop 1 }
}

camera {
  location  <0.25, 1.5, -2.0>
  direction 1.5*z
  look_at   <0.25, 0.5,  0.0>
}

light_source {
  <0, 0, 0>
  color rgb <1, 1, 1>
  translate <-30, 30, 0>
  photons {
    refraction on
    reflection on
  }
}

sphere {
 <0,0,0> .5
 no_shadow // enabling no_shadow automatically tags object as pass_through
(3.6.3.2.2)
 material { M_Glass3 }

 photons{
  target
  reflection on
  refraction on
  collect off
  pass_through off // explicitly turn pass_through off
 }
 translate <0,.5,0>
}

plane {  y, -.2  pigment { color rgb <1,1,1> } }


Post a reply to this message

From: Tim Attwood
Subject: Re: no_shadow and photon pass_through
Date: 1 Aug 2007 19:11:41
Message: <46b1132d@news.povray.org>
> From section 3.6.3.2.2 of the documentation
>
> "If you use the no_shadow keyword, the object will be tagged as 
> pass_through
> automatically. You can then turn off pass_through if necessary by simply
> using photons { pass_through off }.

It also says that pass_through is ignored after a photon hits a target 
object.
Since your sphere is a target, pass_through is ignored.

There isn't a good way to separate photon caustics from the shadow
calculation. The light that makes up the hotspot is light that was bent 
inward
from the edges of the object, the dark edges of the shadow are a result of
this.

That said, you could easily stick a shadowless fill light over the spot you
would like a light spot, or use a radial pigmnet with an object pattern.

// fill light
light_source{
  <0.65,-0.1,0>
  color <1,1,1>
  shadowless
  fade_distance 0.15
  fade_power 2
}


Post a reply to this message

From: Tim Attwood
Subject: Re: no_shadow and photon pass_through
Date: 3 Aug 2007 20:16:03
Message: <46b3c543$1@news.povray.org>
> I disagree.  If you comment out the no_shadow modifier in the sphere and
> then render twice, once with "pass_through off" and once with 
> "pass_through
> on" within the sphere's photon block, you will see 1 image with caustics 
> and
> 1 image with no caustics, even though the sphere is a target.

Well, I guess you could look at it that way.

>...  As this seems to be the case would you agree that the end of
> section 2.6.3.2.2 is misleading? (I made an error in my first post
> referencing section 3.6.3.2.2 instead of 2.6.3.2.2  from
> http://www.povray.org/documentation/view/3.6.1/425/ )

Yeah, maybe it's not the clearest documentation.

Target makes lights enabled to emit photons cast some at
the target object.

Pass_though controls interaction with the photons, when it
is on the object doesn't bend or reflect photons, though it
can still diminish them.

No_shadow stops photons as if an object is non-transparent.


Post a reply to this message

From: Kenneth
Subject: Re: no_shadow and photon pass_through
Date: 17 Sep 2007 02:05:00
Message: <web.46ee188eb7aeba29a63789cd0@news.povray.org>
"Nigel" <nomail@nomail> wrote:
> From section 3.6.3.2.2 of the documentation
>

> automatically. You can then turn off pass_through if necessary by simply
> using photons { pass_through off }.
>
>
> This is exactly what I am trying to do, but it does not seem to work for me.
>  I'm using Povray 3.6.1
>

I've just run into the same problem. The POV documentation is very clear
that no_shadow and pass_through *should* work together exactly as you
described.  But they don't.

I think it's a bug.

Ken W.


Post a reply to this message

From: Kenneth
Subject: Re: no_shadow and photon pass_through
Date: 17 Sep 2007 02:40:00
Message: <web.46ee1f4bb7aeba29a63789cd0@news.povray.org>
"Kenneth" <kdw### [at] earthlinknet> wrote:

> I've just run into the same problem. The POV documentation is very clear
> that no_shadow and pass_through *should* work together exactly as you
> described.  But they don't.
>
> I think it's a bug.
>
> Ken W.

Actually, my scene is a bit different from yours, but the problem
still shows up.

My "ground" is a thin flat box, with some reflection and a normal pattern,
and no-shadow. Its photon block is

photons {target reflection on refraction off  pass_through off}

Just as the docs recommend, to make it reflect photon caustics even though
it has no_shadow.

Sitting on this box is another rectangular box, to show any reflected photon
effects from the "ground." Two lights shine down onto both objects.

The result is NO reflected caustics on the rectangular box, when they should
be there (according to the docs.)  As you did, I commented out the no_shadow
keyword, and the caustics (from the ground's normal pattern) appeared.

KW


Post a reply to this message

From: Kenneth
Subject: Re: no_shadow and photon pass_through
Date: 17 Sep 2007 17:35:01
Message: <web.46eef06bb7aeba29e01602e20@news.povray.org>
"Kenneth" <kdw### [at] earthlinknet> wrote:
>
> I've just run into the same problem. The POV documentation is very clear
> that no_shadow and pass_through *should* work together exactly as you
> described.  But they don't.
>
> I think it's a bug.
>

It's possible that I'm reading the photon documentation incorrectly.  But
the problem is there, in one form or another.

I put together a small, simplified scene that is more in line with what the
docs describe (or *seem* to describe): A single front light shining 45-deg.
down at three objects: The "ground" (a thin, square horizontal box with some
reflection and a normal pattern--the photon TARGET), and two thin, wide
vertical boxes (slabs) standing on the ground, one behind the other,
both facing the light source and separated from each other
somewhat. NEITHER of which is a photon target.
Normally, the front slab would shadow the rear slab, AND keep the light
from reaching the ground "target" area inbetween the two slabs--
blocking the ground there, so that no light can reach it and no photon
caustics can reflect upward from that shadowed area onto the rear slab.

Running the scene as-is, the caustics work as expected: They show up on the
front slab but not on the rear slab.

Adding photons{pass_through on} to the front slab has two effects:  Caustics
still appear on that surface (kind of a surprise to me, since the docs don't
mention that) AND the light source's light goes through it unimpeded, to
strike the ground "target" area behind it, creating (reflecting) caustics
from there upward onto the rear slab. The regular shadow, from the front
slab, is still there.

So far, so good.

HOWEVER, adding no-shadow to the front slab is where the problem arises.
The light source light goes through it completely unimpeded (no shadow, of
course), but NO caustics show up on it now, yet caustics are still
reflected onto the rear slab even when the front slab has
photons{pass_through off}. It just doesn't seem to be working correctly.

Leaving no stone unturned, I tried this scene with different types of light
sources; but the behavior is the same.

BTW, the photon docs in 3.6.3.2.3 seem to imply (to me at least) that a
photon block is *required* in light sources.  That's not the case; they can
be left out (unless you WANT to turn off reflection or refraction there.)

KW


Post a reply to this message

From: Alain
Subject: Re: no_shadow and photon pass_through
Date: 18 Sep 2007 00:30:58
Message: <46ef5482@news.povray.org>
Kenneth nous apporta ses lumieres en ce 2007/09/17 17:33:
> "Kenneth" <kdw### [at] earthlinknet> wrote:
>> I've just run into the same problem. The POV documentation is very clear
>> that no_shadow and pass_through *should* work together exactly as you
>> described.  But they don't.
>>
>> I think it's a bug.
>>
> 
> It's possible that I'm reading the photon documentation incorrectly.  But
> the problem is there, in one form or another.
> 
> I put together a small, simplified scene that is more in line with what the
> docs describe (or *seem* to describe): A single front light shining 45-deg.
> down at three objects: The "ground" (a thin, square horizontal box with some
> reflection and a normal pattern--the photon TARGET), and two thin, wide
> vertical boxes (slabs) standing on the ground, one behind the other,
> both facing the light source and separated from each other
> somewhat. NEITHER of which is a photon target.
> Normally, the front slab would shadow the rear slab, AND keep the light
> from reaching the ground "target" area inbetween the two slabs--
> blocking the ground there, so that no light can reach it and no photon
> caustics can reflect upward from that shadowed area onto the rear slab.
> 
> Running the scene as-is, the caustics work as expected: They show up on the
> front slab but not on the rear slab.
> 
> Adding photons{pass_through on} to the front slab has two effects:  Caustics
> still appear on that surface (kind of a surprise to me, since the docs don't
> mention that) AND the light source's light goes through it unimpeded, to
> strike the ground "target" area behind it, creating (reflecting) caustics
> from there upward onto the rear slab. The regular shadow, from the front
> slab, is still there.
> 
> So far, so good.
> 
> HOWEVER, adding no-shadow to the front slab is where the problem arises.
> The light source light goes through it completely unimpeded (no shadow, of
> course), but NO caustics show up on it now, yet caustics are still
> reflected onto the rear slab even when the front slab has
> photons{pass_through off}. It just doesn't seem to be working correctly.
> 
> Leaving no stone unturned, I tried this scene with different types of light
> sources; but the behavior is the same.
> 
> BTW, the photon docs in 3.6.3.2.3 seem to imply (to me at least) that a
> photon block is *required* in light sources.  That's not the case; they can
> be left out (unless you WANT to turn off reflection or refraction there.)
> 
> KW
> 
In the documentation, it is clearly said that pass_through only affect PRIMARY 
photons: those hiting the object directly, and never secondary photons: those 
that already have been reflected or been refracted by some ther object. The 
problem, is that it's buried, and easily missed, in a long explanation.
pass_trough object are only ignored between the light_source and a target.

-- 
Alain
-------------------------------------------------
Don't argue with an idiot; people watching may not be able to tell the difference.


Post a reply to this message

From: Kenneth
Subject: Re: no_shadow and photon pass_through
Date: 19 Sep 2007 00:15:01
Message: <web.46f0a0f1b7aeba29ddc78dcc0@news.povray.org>
Alain <ele### [at] netscapenet> wrote:

> In the documentation, it is clearly said that pass_through only affect PRIMARY
> photons: those hiting the object directly, and never secondary photons: those
> that already have been reflected or been refracted by some ther object. The
> problem, is that it's buried, and easily missed, in a long explanation.
> pass_trough object are only ignored between the light_source and a target.
>

My explanation of my scene may not be clear. Here's the code for it. (It
renders quickly---more or less....)

I made up a special normal pattern for the "ground" box--the photon
"target"--to better illustrate the caustic effects. It has two distinctly
different and separate normal patterns, to create different-looking
caustics on each vertical slab, depending on where the light is allowed to
hit the ground.

The green front slab is positioned so that it will BLOCK the light from
reaching the ground behind it...that is, blocking the light on it's way to
the ground "target" there. The blue rear slab is positioned so that it will
pick up any reflected caustics from the ground in-between the slabs, IF any
light reaches there.

Run the scene as-is, to see the nice bump-pattern caustic effect on the
front slab, and to confirm that no light of any kind is getting past it.
Then uncomment pass_through on in the front slab. The results are as
expected--light is allowed to "pass through" it on it's way to the ground
behind it (and creating a "banded" caustic pattern on the rear slab,
reflected from the different normal pattern on the ground there.) Note that
the bumpy caustic pattern on the front slab is NOT passing through, though.

As mentioned, so far so good.

Now, keeping pass_through on, also uncomment no_shadow in the front slab.
The results are that the light (and the bumpy caustics) are going
completely through the first slab. The rear slab now shows caustics from
both normal patterns. Looks cool; but there are no caustics on the front
slab anymore. (Maybe that's to be expected; don't know.)  The *real*
trouble comes when turning pass_through on to OFF; it has no effect, even
though the POV docs say that it should be different.

KW

----[code]----
global_settings{
  ambient_light 4
  photons{spacing .06 jitter 1.0 radius 0,2}
  }

camera {
  perspective
  location  <75, 125, -35>
  look_at   <5,10,25>
  right     x*image_width/image_height  // aspect ratio
  angle 75
}


light_source {
  0*x
  color rgb <1,1,1>
  spotlight
  translate <0, 200, -200>
  point_at <0, 0, -20>
  radius 10
  tightness 1
  falloff 12
}

#declare sine_normal =
 normal{function{-abs(sin (100*z))}};


// floor or base...the photon TARGET
box{<-80,-1,-80>,<80,0,80>
 texture{
  pigment{color rgb <1,.5,.5>*.5} // RED
  finish{reflection .4}
  normal{
   gradient z
   normal_map{
    [0.0 bumps  .015 scale .07 no_bump_scale]
    [0.5 bumps .015 scale .07 no_bump_scale]
    [0.5 sine_normal .01]
    [1.0 sine_normal .01]

    }
    scale 155
    translate -78*z
    }
        }
 photons{
  target
  reflection on
  refraction off
  }
 }

// FRONT box
box{<-60,0,0>,<60,60,2>
 pigment {color rgb <.5,.7,.5>} // GREEN
 // no_shadow
 photons{
 //pass_through on  // OFF doesn't work, when no_shadow is present.
        }
   }

// REAR box
box{<-30,0,0>,<30,70,2>
 pigment {color rgb <.5,.5,.7>} // BLUE
 translate 55*z
   }


Post a reply to this message

From: Tim Attwood
Subject: Re: no_shadow and photon pass_through
Date: 19 Sep 2007 06:09:53
Message: <46f0f571$1@news.povray.org>
The docs are off a bit, but for clarification...

Docs: "The keyword pass_through causes
photons to pass through the object unaffected
on their way to a target object."

Docs: "Once a photon hits the target object,
it will ignore the pass_through flag."
Photons can still be deposited on objects
with pass_through on.

When no_shadow is used in an object then
photons are not deposited on it.

This is usually the effect that people notice
and incorrectly equate with pass_through or
collect on.

The docs suggest that you can set pass_through
off on no_shadow objects to prevent photons
from being cast thru it, but this isn't the case.
If POV was actually this way the banded
part of the caustics from the far water would
disappear when pass_through was off in your
test scenes, but the spots from the near water
would remain on the rear box anyways.

There are ways to work-around this if you want
such images.

Example 1: You can split the water into
two objects and remove target from one of
the sides to only have the near caustic on
the rear wall.

Example 2: You can render the image with
pass through set on the center wall with
save_file set to catch the caustics, then
re-render with load_file and no_shadow
to let the spotlight hit the far water, but
still have caustics on the no_shadow wall.


suggested documentation change for 3.6...
3.6.3.2.2  Shooting Photons at an Object

remove old wording
---------------------
If you use the no_shadow keyword, the object
will be tagged as pass_through automatically.
You can then turn off pass_through if necessary
by simply using photons { pass_through off }.

replace with
------------
If you use the no_shadow keyword, no photons
will be deposited on the object, and photons
will pass through the object.  When using the
no_shadow keyword in an object the pass_through
and collect keywords are ignored.

suggested code improvement
-----------------------------
Deposit photons on no_shadow objects. The old
behavior can be preserved with collect off.


Post a reply to this message

From: Alain
Subject: Re: no_shadow and photon pass_through
Date: 19 Sep 2007 18:38:07
Message: <46f1a4cf$1@news.povray.org>
Tim Attwood nous apporta ses lumieres en ce 2007/09/19 06:09:
> The docs are off a bit, but for clarification...
> 
> Docs: "The keyword pass_through causes
> photons to pass through the object unaffected
> on their way to a target object."
> 
> Docs: "Once a photon hits the target object,
> it will ignore the pass_through flag."
> Photons can still be deposited on objects
> with pass_through on.
> 
> When no_shadow is used in an object then
> photons are not deposited on it.
> 
> This is usually the effect that people notice
> and incorrectly equate with pass_through or
> collect on.
> 
> The docs suggest that you can set pass_through
> off on no_shadow objects to prevent photons
> from being cast thru it, but this isn't the case.
> If POV was actually this way the banded
> part of the caustics from the far water would
> disappear when pass_through was off in your
> test scenes, but the spots from the near water
> would remain on the rear box anyways.
> 
> There are ways to work-around this if you want
> such images.
> 
> Example 1: You can split the water into
> two objects and remove target from one of
> the sides to only have the near caustic on
> the rear wall.
> 
> Example 2: You can render the image with
> pass through set on the center wall with
> save_file set to catch the caustics, then
> re-render with load_file and no_shadow
> to let the spotlight hit the far water, but
> still have caustics on the no_shadow wall.
> 
> 
> suggested documentation change for 3.6...
> 3.6.3.2.2  Shooting Photons at an Object
> 
> remove old wording
> ---------------------
> If you use the no_shadow keyword, the object
> will be tagged as pass_through automatically.
> You can then turn off pass_through if necessary
> by simply using photons { pass_through off }.
> 
> replace with
> ------------
> If you use the no_shadow keyword, no photons
> will be deposited on the object, and photons
> will pass through the object.  When using the
> no_shadow keyword in an object the pass_through
> and collect keywords are ignored.
> 
> suggested code improvement
> -----------------------------
> Deposit photons on no_shadow objects. The old
> behavior can be preserved with collect off. 
> 
> 
It changed with the beta 3.7 22.

An object with no_shadow DOES collect photons and stops photons from reaching 
surfaces behind it.

An object with both no_shadow and pass_through does collect and stop reflected 
photons, but primary photons will reach surfaces behind the object.

-- 
Alain
-------------------------------------------------
BE ALERT!!!!  (The world needs more lerts ...)


Post a reply to this message

Goto Latest 10 Messages Next 1 Messages >>>

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