POV-Ray : Newsgroups : povray.general : Odd slope pattern behavior (bug?) : Re: Odd slope pattern behavior (bug?) Server Time
2 Aug 2024 02:25:58 EDT (-0400)
  Re: Odd slope pattern behavior (bug?)  
From: Rune
Date: 10 Feb 2005 04:55:45
Message: <420b2fa1@news.povray.org>
I'm not sure I'm following you. Anyway, I think that a slope pattern should 
never be affected on normals that are on a lower level, since it creates a 
mutual dependency that makes it difficult to predict the result. The amount 
of the normal applied is dependent on the slope, but the slope is also 
dependent on the normal. I'm not even sure how it's implemented in the 
current code, no matter if the mutual dependency behavior is a bug or not.

Either way, there certainly is a bug. Have a look at the code below:


camera {orthographic location -6*z}
light_source {<0,1,-1>*1000, color 1}

#declare BaseTexture =
texture {
   slope y
   texture_map {
      [0.4 pigment {red   1}]
      [0.5 pigment {green 1} normal {spotted 5}]
      [0.6 pigment {blue  1}]
   }
}

#declare TextureA =
texture {
   gradient y
   texture_map {
      [0.0,BaseTexture]
      [1.0,BaseTexture]
   }
}

#declare TextureB =
texture {
   gradient y
   texture_map {
      [0.0,BaseTexture]
      [0.5,BaseTexture]
      [1.0,BaseTexture]
   }
}

#declare Object =
union {
   cylinder {-y, y, 1}
   sphere {-y, 1}
   sphere {y, 1}
   translate 5*z
}

object {Object texture {BaseTexture} translate -3*x}
object {Object texture {TextureA}}
object {Object texture {TextureB} translate  3*x}


TextureA and TextureB should look completely identical, yet they don't. The 
extra entry in the texture_map of TextureB clearly shows up even though it 
should make no difference. The thing is - the normal is taken into account 
for the slope at the beginning of map entry ranges but not in the end of map 
entry ranges. So in TextureA the slope is affected by normal decreasingly 
from pattern value 0.0 to 1.0, while in TextureB it's affected decreasingly 
from pattern value 0.0 to 0.5, then starting over at 0.5 and having 
decreasing effect again from 0.5 to 1.0.

There is absolutely no logic in this, and I'm very sure it's a bug. I'm just 
not sure what the intended correct behavior is, but it certainly can't be 
this.

Rune
-- 
3D images and anims, include files, tutorials and more:
rune|vision:  http://runevision.com
POV-Ray Ring: http://webring.povray.co.uk


Post a reply to this message

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