POV-Ray : Newsgroups : povray.binaries.images : Woven Cloth Texture : Re: Woven Cloth Texture Server Time
31 Jul 2024 14:30:11 EDT (-0400)
  Re: Woven Cloth Texture  
From: Christian Froeschlin
Date: 25 Feb 2010 17:51:42
Message: <4b86fefe$1@news.povray.org>
Ive wrote:

> The first image is the grayscale image that is used within the second 
> one on the left side as a bump_map (and it looks of course as expected) 
> and on the right side via pigment and function declaration within a 
> normal statement - and this one does *not* look right.

hmm ... there may be a difference here between looking
"not right" and looking "like crap" ;) While the right image
is not what you want, it does actually seem to have light
and dark regions roughly in the correct place. I just had
a quick peek in the code and I think this is what happens:

In both cases, a scalar map needs to be interpreted for
normal perturbation. It can't actually be a slope, because
that wouldn't contain enough 3d information (note that some
built-in patterns such as bumps or wrinkles have vector
versions which can be used for direct perturbation).

To get from the scalar height map to a normal, a 3d triangle is
constructed from 3 points on the height map. It's normal vector
is the vector used for the normal perturbation at this location.

BUT!

The bump_map has it's own implementation. Similar to a
height_field, it will use the image pixel coordinates for
3d triangles. The general case will sample at the arbitrary
distance of 0.02 units in world coordinates. This leads to
very noticable sampling artifacts when the input function
is highly discrete.

In fact, you can get wildly different output when playing
with the accuracy parameter (which effectively represents the
sampling distance noted above):

#declare N_Lace2 = normal {function {F_Lace2(x,y,z).gray} accuracy 0.011 
bump_size 0.1}


Post a reply to this message

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