POV-Ray : Newsgroups : povray.general : object media / spotlight aberration Server Time
31 Jul 2024 18:25:54 EDT (-0400)
  object media / spotlight aberration (Message 1 to 10 of 12)  
Goto Latest 10 Messages Next 2 Messages >>>
From: Kenneth
Subject: object media / spotlight aberration
Date: 21 Sep 2006 05:35:01
Message: <web.45125ba9d84b4b77cc29cf380@news.povray.org>
By chance, I've just run across an amazingly wacky problem in POV 3.6.1c (on
Windows), having to do with media illuminated (or not!) by a spotlight.
Frankly, I don't know how I missed this before now.

A picture is worth 1000+ words, so I posted an image over at p.b.i

I took a *long* look at the various newsgroups (including beta-test) but
didn't see a reference to this particular issue. I realize that
media/transparency is still an on-going deal with the betas, so I don't
know if this particular problem has already been addressed. (Currently, I
can't download the latest beta, due to temporary technical issues at my
end.)

In a nutshell, here's the visual oddity:  The spotlight "cone" is actually
visible in an object's media, in a highly distorted way, when the object is
nowhere near the actual light cone (but in-between the cone and the camera.)
I've included a scene file to illustrate.  The spotlight, at upper left and
with a narrow spread,  is aimed at a simple solid box object.  There are
also two small emission media spheres in the scene, but FAR away from the
impinging spotlight, near to the camera. Completely out of the light.
(They're positioned to show off the abberation.) The same thing happens if
the spheres are behind the light cone. Even stranger is that the
"invisible" part of the light cone (the part UNDER the floor plane) is also
visible!

Some facts from experimenting:
1) it happens with all three media types
2) a cylinder light (which includes a spotlight) also shows it
3) the various media modifiers -- method, samples, intervals, accuracy,
etc.--don't affect it (although higher values for samples and/or intervals
lessen the effect)
4) camera re-positioning has no effect
5) turning no_shadow on or off in the media spheres has no effect
6) media_interaction OFF in the spotlight eliminates the problem (a solution
for emission and absorption media, but not for scattering media)

The problem seems to lie in the media's DENSITY block: no density block, no
cone appearance. But a density using ANY pattern with a color_map (either
default or user-defined) exhibits the problem. (And/or, perhaps it's an
issue with the inherent slope_maps in some of the patterns? Just a guess.)
Each pattern causes a different visual result. A spherical pattern
actually looks kind of interesting--like airbrush masking. (Hmm...seems
that even abnormal behavior has its uses!)

I can't tell if the distortion completely disappears when the spheres are IN
the light cone, but it looks to be so. And I didn't try moving the camera
and spheres closer to the cone, to see if that varied the effect.

Can someone run this on the latest POV beta?

Ken W.

------ code -----

camera {
  perspective
  location  <22,24,-55>
  look_at   <4,.1,.1>
  right     x*image_width/image_height
  angle 90
}

light_source {
  0*x
  color <1,0,0>
  spotlight
  translate <-36, 36, -36>
  point_at <0,0,0>
  radius 7
  tightness 10
  falloff 9
  // media_interaction off
}

// floor
object{
        box { <-65,-1, -40>, <75,0,50>
        texture{
                pigment{agate scale 15}
                finish {
                        ambient .2
                        diffuse .8
                       }
                }
            }
       }


// oblong box
box{<0,0,0>, <8,30,8>
        texture{
                pigment {color rgb 1}
                finish{
                        ambient .1
                        diffuse .9
                      }

               }
     translate <-4,0,-4>
    }

#declare media_sphere =
sphere{0,1 hollow no_shadow
    texture{
        pigment{color rgbt 1}
        finish{ // not needed, but does not alter problem
                ambient 0
                diffuse 0
              }
           }

    interior{
         media{
                emission .4
                density{bozo}
              }
            }
      }

object{media_sphere translate <22.5,22,-52>} // to right

object{media_sphere translate <18.9,23.4,-52>} // to left


Post a reply to this message

From: Tim Attwood
Subject: Re: object media / spotlight aberration
Date: 22 Sep 2006 04:33:02
Message: <45139fbe@news.povray.org>
The problem is in the spotlight definition...

Although it is legal to put "translate" before the spotlight terms, it
confuses the parser. This is similar to placing "spotlight" after the
spotlight terms, which is legal, but causes the light to act as a point-
light.

This light works fine, but this is still a parsing bug...

light_source {
  0*x
  color <1,0,0>
  spotlight // before all spot terms
  point_at <0,0,0>
  radius 7
  tightness 10
  falloff 9
  translate <-36, 36, -36> // after all light terms
}


Post a reply to this message

From: Kenneth
Subject: Re: object media / spotlight aberration
Date: 22 Sep 2006 05:40:00
Message: <web.4513ab5d55cb6906b0d7b10e0@news.povray.org>
"Tim Attwood" <tim### [at] comcastnet> wrote:
> The problem is in the spotlight definition...
>
> Although it is legal to put "translate" before the spotlight terms, it
> confuses the parser....

Hi, Tim--

Well, I'm amazed. That simple trick eliminated the problem. I would never
have thought of looking at the ordering of terms in the light source (and
didn't know it could make such a difference!) Thank you.

UNFORTUNATELY, "inserting" a spotlight into a scene's code using the insert
menu (as I did) automatically  plugs in the problem-causing arrangement of
terms. I had always assumed that the POV developers had already worked out
the "best" way to write these bits of code. Now I'm not so sure (and that's
kind of unsettling.) At the very least, the current spotlight SDL code--and
the cylinder light code-- need to be rewritten (to reflect whatever *is* the
best form of the terms, given the parsing problems you mentioned.)
Errors like this--in such basic parts of the  POV package--are a bit more
than just a nuisance.

If I may ask: How did you happen to come by this bit of information? Is
there perhaps a source of similar info on the 'net that I should be looking
at?

Ken W.


Post a reply to this message

From: Kenneth
Subject: Re: object media / spotlight aberration
Date: 22 Sep 2006 05:45:01
Message: <web.4513afd255cb6906b0d7b10e0@news.povray.org>
I forgot to ask: Do you know if this little problem with the
spotlight/cylinder light SDL code is confined only to the Windows version
of POV-Ray, or is it across the board, in all versions?

Ken


Post a reply to this message

From: Alain
Subject: Re: object media / spotlight aberration
Date: 22 Sep 2006 19:25:43
Message: <451470f7$1@news.povray.org>
Tim Attwood nous apporta ses lumieres en ce 22/09/2006 04:35:
> The problem is in the spotlight definition...

> Although it is legal to put "translate" before the spotlight terms, it
> confuses the parser. This is similar to placing "spotlight" after the
> spotlight terms, which is legal, but causes the light to act as a point-
> light.

> This light works fine, but this is still a parsing bug...

> light_source {
>   0*x
>   color <1,0,0>
>   spotlight // before all spot terms
>   point_at <0,0,0>
>   radius 7
>   tightness 10
>   falloff 9
>   translate <-36, 36, -36> // after all light terms
> }

Not good! Now the light is placed at <-36,36,-36> and point_at <-36,36,-36>, and 
it don't light the scene any more. The traslate at the end apply to ALL 
coordinates: location AND point_at. A rotate or scale at the same place would 
also apply to both location and point_at.
Placing the light at <-36,36,-36> and removing the translate and the problem is 
still there.

-- 
Alain
-------------------------------------------------
Grandchildren are God's reward for not killing your own.


Post a reply to this message

From: Thomas de Groot
Subject: Re: object media / spotlight aberration
Date: 23 Sep 2006 04:20:19
Message: <4514ee43$1@news.povray.org>
I changed your little scene a bit, just to make it more intuitive for me.
I don't know what happens, but it has to do imo with the relative, combined 
positions of camera, media sphere, and spotlight. I don't think that the 
spotlight code itself is the culprit. Try this with the scene below, only 
switching the camera z-position between -70 (no aberration) and -80 
(aberration in one of the spheres).

Thomas

camera {
  perspective
  location  <20,25,-70>
  look_at   <0,0,0>
  right     x*image_width/image_height
  angle 90
}

light_source {
  0*x
  color <1,1,0>
  spotlight
  translate <0, 36, -36>
  point_at <0,0,0>
  radius 7
  tightness 10
  falloff 9
  media_interaction on
}

// floor
object{
        box { <-65,-1, -40>, <65,0,40>
        texture{
                pigment{agate scale 15}
                finish {
                        ambient .2
                        diffuse .8
                       }
                }
            }
       }


// oblong box
box{<-4,0,-4>, <4,30,4>
        texture{
                pigment {color rgb 1}
                finish{
                        ambient .1
                        diffuse .9
                      }

               }
     translate <0,0,0>
    }

#declare media_sphere =
sphere{0,1 hollow no_shadow
    texture{
        pigment{color rgbt 1}
        finish{ // not needed, but does not alter problem
                ambient 0
                diffuse 0
              }
           }

    interior{
         media{
                emission .4
                density{bozo}
              }
            }
      }

object{media_sphere translate <-10,20,-50>}

object{media_sphere translate <10,20,-50>}


Post a reply to this message

From: Alain
Subject: Re: object media / spotlight aberration
Date: 23 Sep 2006 11:28:25
Message: <45155299$1@news.povray.org>
Thomas de Groot nous apporta ses lumieres en ce 23/09/2006 04:20:
> I changed your little scene a bit, just to make it more intuitive for me.
> I don't know what happens, but it has to do imo with the relative, combined 
> positions of camera, media sphere, and spotlight. I don't think that the 
> spotlight code itself is the culprit. Try this with the scene below, only 
> switching the camera z-position between -70 (no aberration) and -80 
> (aberration in one of the spheres).
> 
> Thomas
> 
>
With the camera at -70 the media spheres are both outside the line of sight to 
the spot_light cone.
Placing the camera at 0*x and one of the spheres at <0,20,-63> and the aberation 
apears. At that location the sphere is in front of where the light encounter the 
ground and should NOT have any interaction with the spot_light, as the light has 
been completely intercepted by the ground. The sphere is also way in front of 
the spot_light cone. It may be some aberation in the spot_light code.
In my view, it's a bug.

-- 
Alain
-------------------------------------------------
No matter how good she looks,
some other guy is sick and tired of putting up with her shit.
	Men's Room, Linda's Bar and Grill, Chapel Hill , NC


Post a reply to this message

From: Kenneth
Subject: Re: object media / spotlight aberration
Date: 23 Sep 2006 21:55:00
Message: <web.4515e42b55cb690689cb42c20@news.povray.org>
"Thomas de Groot" <t.d### [at] internlnet> wrote:
> I changed your little scene a bit, just to make it more intuitive for me.
> I don't know what happens, but it has to do imo with the relative, combined
> positions of camera, media sphere, and spotlight. I don't think that the
> spotlight code itself is the culprit. Try this with the scene below, only
> switching the camera z-position between -70 (no aberration) and -80
> (aberration in one of the spheres).
>
> Thomas
>

Hi, Thomas, sorry for the delay in answering (it has been  *busy* two days
for me.)

Thanks for posting your code.  I put a looks_like sphere into your
spotlight., then took a look at the scene from the top. Alain is right
about the positioning of the media spheres, they're both "behind" the
location of the light, outside the cone.  BUT, you're also right, in that
one of the spheres DOES show the aberration if the camera is moved back
slightly...due to that sphere now falling between the camera and the light
cone. Which points up how difficult it is to actually *produce* this effect
on purpose--the camera/media sphere/light all have to be in a particular
alignment to show the effect.  Which is probably why I had never noticed
this behavior before (or if I did, I never made the connection between all
three items.) Pretty crazy, huh.

Ken


Post a reply to this message

From: Kenneth
Subject: Re: object media / spotlight aberration
Date: 23 Sep 2006 22:05:00
Message: <web.4515e6bd55cb690689cb42c20@news.povray.org>
"Kenneth" <kdw### [at] earthlinknet> wrote:

> Some facts from experimenting:

> 4) camera re-positioning has no effect

Sorry if I confused anybody.  I didn't mean to imply that the camera can be
moved ANYWHERE to still show the effect; just nudging it a bit here and
there ( to see if that made a difference, which it doesn't.) The effect is
only visible when the media spheres are positioned in-between the
camera and the light cone.

Ken


Post a reply to this message

From: Kenneth
Subject: Re: object media / spotlight aberration
Date: 23 Sep 2006 22:15:00
Message: <web.4515e97f55cb690689cb42c20@news.povray.org>
Alain <ele### [at] netscapenet> wrote:

>
> ...The translate at the end apply to ALL
> coordinates: location AND point_at. A rotate or scale at the same place would
> also apply to both location and point_at.

Wow, something *else* I didn't realize. (Arrrgh! Details, details.) Perhaps
I should have; a light is an "object", after all. Dare I say that such a
detail is not made altogether clear in the POV docs? But then again, I
guess we shouldn't be spoon-fed *everything*...  ;-)

Thanks, Alain.

Ken


Post a reply to this message

Goto Latest 10 Messages Next 2 Messages >>>

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