POV-Ray : Newsgroups : povray.general : Displacement mapping in Povray : Re: Displacement mapping in Povray Server Time
2 Aug 2024 18:13:25 EDT (-0400)
  Re: Displacement mapping in Povray  
From: Sascha Ledinsky
Date: 29 Oct 2004 02:24:29
Message: <4181e21d$1@news.povray.org>
Christoph Hormann wrote:
>> I meant the tesselation approach (as used in POV-Ray for 
>> bezier-patches).  Theoretically it should be possible to add 
>> displacement mapping to the bezier-patch tesselation code.
> 
> 
> Why would you want to do this if it is a mesh anyway and you could 
> displace the mesh (any mesh, not just patches)?

I think there is a misconception of what displacement mapping does. What 
I understand as displacement mapping is in effect quite similar to bump 
mapping (POV's normal { ... } feature). The difference is that true 
displacement mapping does not simply chnage the surface normals (thats 
only a side effect), but actually changes the geometry. Thus, the 
displaced geometry will self-shadow, and the displacement itself is visible.

Here is an example image of a renderman displacement shader applied to a 
sphere: http://jrman.sourceforge.net/image.php?img=bumpBalls.png
Compared to a bump-mapped version 
http://www.povray.org/documentation/images/tutorial/pic1.png
the true displacement has several advantages: The displacement itself is 
visible, there is correct self shadowing and there is no "shadow line 
artifact".

While I totally agree that the displaced sphere can be done in POV-Ray 
using iso-surfaces, I don't think that it makes much sense to use 
iso-surfaces for e.g. character animation.

Back to your question:
I'd agree if we're talking about very-high-resolution triangle meshes 
only. Displacing the vertices has the same effect as applying a 
"displacement shader". But I disagree as far as NURBS, other patch 
meshes, or parametric surfaces in general are concerned (currently POV 
supports bicubic bezier patches only, and that not very well). 
Displacing just the controlpoints of a NURBS mesh has certainly not the 
desired effect!

For example, take a simple cylinder-like shape, made of four bicubic 
patches (48 unique control-points). Displacing these 48 controlpoints 
will change the shape and maybe add some bulges - but you couldn't apply 
  displacements that would give it (for example) the appearance of a 
brick wall that way.
Now, when POV-Ray parses the patches, it turns each patch into a 
triangle mesh (e.g. of 128 or more triangles, depending on u_steps and 
v_steps). Displacing this triangle grid is very close to what a true 
displacement shader would do.

Of course using an external application (or SDL macro) to tesselate the 
parametric surface into a high-density triangle mesh and THEN applying 
displacement to the tesselated grid would have the same effect - but I 
would neither claim that POV supports NURBS, nor that it supports 
displacment-mapping then...


Post a reply to this message

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