POV-Ray : Newsgroups : povray.beta-test : Heightfield bug (most probably an inverted normals problem) : Heightfield bug (most probably an inverted normals problem) Server Time
2 Nov 2024 03:14:49 EDT (-0400)
  Heightfield bug (most probably an inverted normals problem)  
From: Warp
Date: 21 Jan 2002 18:49:19
Message: <3c4ca8ff@news.povray.org>
Smooth heightfiels show sometimes a bug which seems to be related to normals
getting inverted when they shouldn't. This causes wrong lighting which can
be mainly seen as dark spots (which go away with 'double_illuminate').

  The following example shows clearly the problem. It uses a slope y pattern
with slopes <0.5 (ie surfaces facing downwards) colored red and slopes >0.5
colored with gray to white. As a heightfield, it should not show any red
because all surfaces are faced upwards. However, it shows red where surface
normals are inverted.
  The curious thing about this is that the places of the inverted normals
(ie the red spots) are somehow dependant of the camera location. If you
try the two given camera locations you'll see that the amount and location
of the spots change.

-------------8<--------------8<-------------8<-------------8<-----------
camera
{ location #if(0) <0,0.3,0> #else 0 #end
  look_at z*1
}

height_field
{ function 200,200 { pattern { granite } }
  smooth
  scale <10,1.5,10>
  pigment {slope y color_map { [0 rgb x][.5 rgb .5][1 rgb 1] } }
  finish{ambient 1}
  translate -<5,.3,0>
}
-------------8<--------------8<-------------8<-------------8<-----------

  Tested on both windows and unix versions of povray.


-- 
#macro N(D)#if(D>99)cylinder{M()#local D=div(D,104);M().5,2pigment{rgb M()}}
N(D)#end#end#macro M()<mod(D,13)-6mod(div(D,13)8)-3,10>#end blob{
N(11117333955)N(4254934330)N(3900569407)N(7382340)N(3358)N(970)}//  - Warp -


Post a reply to this message

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