POV-Ray : Newsgroups : povray.general : Material map question Server Time
9 Aug 2024 03:22:12 EDT (-0400)
  Material map question (Message 1 to 3 of 3)  
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?


Post a reply to this message

From: Christoph Hormann
Subject: Re: Material map question
Date: 6 Sep 2000 12:15:47
Message: <39B66DEB.53128C4@schunter.etc.tu-bs.de>
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/


Post a reply to this message

From: Sigmund Kyrre Aas
Subject: Re: Material map question
Date: 7 Sep 2000 12:46:47
Message: <39B7C644.9ACE4ABD@kyrre.net>
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


Post a reply to this message

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