POV-Ray : Newsgroups : povray.bugreports : Funny Normals through Clear Objects Server Time
14 May 2024 15:29:35 EDT (-0400)
  Funny Normals through Clear Objects (Message 1 to 1 of 1)  
From: darenw
Subject: Funny Normals through Clear Objects
Date: 24 Sep 2007 08:42:53
Message: <46f7b0cd$1@news.povray.org>
Incorrect normal perturbations are computed for surfaces seen through
partially or fully transparent objects, where those objects' textures have
been rotated and involve a texture_map.

It's a complex combination of factors involved, so
not surprising if this bug hasn't been known already.   It was discovered
in the general newsgroup, subject: Why are these "invisible" spheres
visible? initiated by gadoid.   This may explain some odd problems several
artists have had in the past but assumed it had to do with subtleties of
refraction or other complications.

The scene file below demos the problem.  A rendered image has been uploaded
to binaries.images under "funnynormal bug test image".  Note the weird
sideways lighting of some of the dimples.  All the discs you see in that
image should be completely invisible, and the background perfectly periodic
and uniformly side-lit.

Suspicion is some leftover transformation data from dealing with one object
lingers into the calculations for subsequent objects - some variable, or
some field in some structure involving normals or transforms isn't being
cleared.   Flaw is probably in lighting.cpp or normal.cpp.

Workaround: no easy ones so far.  I thought maybe an invisible object
between the transparent objects and the background, with a texture rotated
zero degrees, might reset the lingering transform data, but no luck.
However, an invisible object with a clear texture rotated oppositely does
fix the effect where it overlaps the first object as seen from the camera.

I'm using POV-Ray 3.6.1 on Linux (Ubuntu 7.04, my custom compile)  I use
command line rendering only, no GUIs.   My custom compile has hacks in the
parser and image outputing, but nothing that relates to the problem
described here.



///  povray +D +P +X -ifunnynormal.pov  +w800 +h600

plane {z, 0
 pigment {color rgb 1}
 finish {diffuse 1  ambient  0}
 normal { leopard 1  sine_wave    scale .2}
}

#declare ClearTex=   texture {
   pigment { color rgbf <.4, 1, 1, 1>}
   finish { ambient 0  diffuse 0}
}

#declare IndirectClearTex = texture {
  bozo  texture_map { [0 ClearTex] }
}


#declare ix=-3;
#while (ix <=3)
 disc {<ix*2, 2,-5>,z, .8 texture {        ClearTex rotate 45*ix*y}}
 disc {<ix*2, 0,-5>,z, .8 texture {IndirectClearTex rotate 45*ix*y}}
 disc {<ix*2,-2,-5>,z, .8 texture {IndirectClearTex rotate 45*ix*z}}
 #declare ix=ix+1;
#end

//---- try workaround wild ideas -----
box {   <-7, .1, -1>,  <7,  -1.9, -1.1> hollow
 //pigment { color rgbt .8 } normal {bozo 0}} // to make hack box visible
 //texture {IndirectClearTex rotate <0,0,0>} // reset stray transform?
 texture {IndirectClearTex   rotate 45*y  }  // try compensating?
}


light_source { <100, 0, -10>  rgb <.8,.8,1>*2 }
light_source { <0, 100, -30> rgb <.2, .2, 0> }
camera {
 orthographic
 location <0,0,-100>
 right <15,0,0>
 up <0,10,0>
 direction <0,0,1>*10
}


Post a reply to this message

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