|
|
Explanation: to generate realistic range images I need to create a Z based
pigment using the 'gradient' pigment modifier.
Problem: 'gradient' wraps from 0 to 1 continuously based upon a modulo
operation on Z, i.e. 'gradient' = fmod(z,1.0) where fmod = "floating point
remainder" in VC6++ (see pattern.c, void gradient for more details)
Question: how do I force or modify gradient z so that it is valid only
from 0<Z<1 and gradient z = 0 otherwise? If we can answer this question,
then creating random dot stereograms and producing other such range imagery
will become faster and more realistic using povray. My only alternative at
this point is to clip the scene, which causes a 10X increase in compute
time.
#declare DepthMapTexture = texture {
pigment {
gradient z // this little fellow keeps wrapping around with
increased z, i want to make him
color_map { // stop wrapping and return 0 when z > 1 and z < 0.
[0.0 color Black]
[1.0 color Red] }
scale 40
}
finish{ambient 1.0 diffuse 0.0}
}
Many Thanks! dan
Post a reply to this message
|
|