From: Martin Magnusson
Subject: Material map question
Date: 6 Sep 2000 12:05:22
Message: <39b66b42@news.povray.org>
I have a small problem:
I'd like to make a texture based on a bitmap (greyscale) and declare one
texture for the black areas, another texture for the white areas, and have
some average on the grey pixels (i e pretty much like a regular texture_map
but based on a bitmap in stead of POV's patterns). It seems that
material_map doesn't let me do this unless I specify a single texture for
each pixel value (which can be done using a macro and average, but that
isn't a very nice solution). Is there another way?
Martin Magnusson wrote:
> > I have a small problem:> > I'd like to make a texture based on a bitmap (greyscale) and declare one> texture for the black areas, another texture for the white areas, and have> some average on the grey pixels (i e pretty much like a regular texture_map> but based on a bitmap in stead of POV's patterns). It seems that> material_map doesn't let me do this unless I specify a single texture for> each pixel value (which can be done using a macro and average, but that> isn't a very nice solution). Is there another way?
There is image_pattern in megapov probably doing exactly what you want.
Christoph
--
Christoph Hormann <chr### [at] gmxde>
Homepage: http://www.schunter.etc.tu-bs.de/~chris/
Martin Magnusson wrote:
> Is there another way?
Don't think so. I did something similar some time ago. Here's a stripped down version
you might find useful.
texture {
material_map {
png "" map_type 1 once
#local i=0;
#local I=255;
#while (i<=I)
texture{
average
texture_map {
[ i/I pigment{Pig1} finish {Fin}] // index 1 ->
[ 1-i/I pigment{Pig2} finish {Fin2}] // <- index 256
}
}
#local i=i+1;
#end
}
scale <475,98,0>/475*5
}
--
ICQ 74734588