|
![](/i/fill.gif) |
Some time ago (6. 1. 2001) i posted a macro for a 2d gradient pattern. I
now made a povray pattern calculating this in 3d based on Chris Huff's
type 1 displace warp code.
I also added a third type of displace warp similar to the second one.
Type 1 has an undocumented additional parameter specifying the distance
used for calculating the gradient. When changing this parameter, the
amount of displacement also changes, which seems not very useful to me.
See the first attached picture for illustration:
from left to right:
displace pigment
displaced pigment
type 1, 0.005
type 1, 0.05 (default)
type 1, 0.15
the second line is the new type 2.
For the new gradient pigment I used the keyword 'grad', because 'gradient'
is already occupied:
pigment {
grad {
[pigment]
distance [float]
range [float]
}
}
distance has the same effect as the additional parameter in displace
warps, range is a scaling factor. Since gradient values larger than 1 are
clipped, this can be useful when working with high gradients. I added the
same to the type 2 displace warp.
The second attached picture shows some samples for the 'grad' pattern, the
leftmost objects show the plain pigment, the others are the 'grad' pattern
with decreasing 'distance' from left to right. The first line uses 'range
0.45', the second 'range 0.9'.
Any comments and suggestions welcome of course.
Christoph
--
Christoph Hormann <chr### [at] gmx de>
IsoWood include, radiosity tutorial, TransSkin and other
things on: http://www.schunter.etc.tu-bs.de/~chris/
Post a reply to this message
Attachments:
Download 'grad_01.jpg' (27 KB)
Download 'grad_02.jpg' (31 KB)
Preview of image 'grad_01.jpg'
![grad_01.jpg](/povray.binaries.images/attachment/%3C3A9051B7.EC1A5EF2%40gmx.de%3E/grad_01.jpg?preview=1)
Preview of image 'grad_02.jpg'
![grad_02.jpg](/povray.binaries.images/attachment/%3C3A9051B7.EC1A5EF2%40gmx.de%3E/grad_02.jpg?preview=1)
|
![](/i/fill.gif) |