|
![](/i/fill.gif) |
On 17.02.2010 22:57, Christian Froeschlin wrote:
> Ive wrote:
>
>>> #declare N_Cloth = normal {function {f_cloth(x,y,z).red}}
>>>
>>
>> sorry, but this will not work (as expected) as the function you feed
>> into the normal statement needs to evaluate the *slope* and not the
>> *height* at a specific point in 3d space.
>
> I have to admit I didn't think too deep about this and just did a
> test render which looks suspicously similar to that of Thomas ;)
>
> In the documentation I now found 3.5.2.1
>
> "Each of the various pattern types available is in fact a mathematical
> function that takes any x, y, z location and turns it into a number
> between 0.0 and 1.0 inclusive. That number is used to specify where the
> various high and low spots are."
>
> I'd interpret that to mean it's actually the height, not the slope.
> Also, a slope_map assigning slopes to heights makes more sense then.
See the attached images from an old test scene of mine (updated to 3.7
beta).
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.
So to me it *looks* like it is expecting a slope not a height, no matter
what the docs do say ;)
In fact I would be glad if this wouldn't be the case as I do need
sometimes the same image as a transparency and a normal map and it has
to be loaded twice (one time as am image_map and one time as a bump_map)
resulting in quite a waste of memory.
Here's the source:
// ------------------------------------------------
#version 3.7;
camera {
location -z*4
direction 1.5*z
right x*image_width/image_height
look_at 0
}
light_source {0, rgb 1
translate <30, 30, -10>
}
#declare N_Lace1 = normal {bump_map {jpeg "pat" interpolate 2}}
box {-1, 1
pigment {rgb 0.6}
finish {ambient 0 diffuse 1 specular 0.1}
normal {N_Lace1 bump_size 1}
translate -x*1
}
#declare P_Lace2 = pigment {image_map{jpeg "pat" file_gamma 1.0
interpolate 2}}
#declare F_Lace2 = function {pigment {P_Lace2}}
#declare N_Lace2 = normal {function {F_Lace2(x,y,z).gray} bump_size 0.1}
box {-1, 1
pigment {rgb 0.6}
finish {ambient 0 diffuse 1 specular 0.1}
normal {N_Lace2}
translate x*1
}
// ------------------------------------------------
Post a reply to this message
Attachments:
Download 'pat.jpg' (48 KB)
Download 'normaltest.jpg' (138 KB)
Preview of image 'pat.jpg'
![pat.jpg](/povray.binaries.images/attachment/%3C4b7f03d4%40news.povray.org%3E/pat.jpg?preview=1)
Preview of image 'normaltest.jpg'
![normaltest.jpg](/povray.binaries.images/attachment/%3C4b7f03d4%40news.povray.org%3E/normaltest.jpg?preview=1)
|
![](/i/fill.gif) |