POV-Ray : Newsgroups : povray.general : Faster "specular mapping"? : Re: Faster "specular mapping"? Server Time
1 Aug 2024 20:09:11 EDT (-0400)
  Re: Faster "specular mapping"?  
From: Christoph Hormann
Date: 28 May 2005 04:25:02
Message: <d799qt$af7$1@chho.imagico.de>
Tom York wrote:
> I'm looking for an optimisation. I've used material_map in the past to
> control finish properties like reflectivity, specular properties and so on.
> Based on a procedure posted some time ago on this news group (in 2000, I
> think) I do something like
> 
> texture {
>   material_map {
>     tga "specular_map.tga"
>     #declare Count = 1;
>     #while (Count <= 255)
>       texture {
>         pigment { rgb 1 }
>         finish {
>           specular (Count/255)
>         }
>       }
>       #local Count = Count + 1;
>     #end
>   }
> }

How about:

texture {
   image_pattern {
     tga "specular_map.tga"
   }
   texture_map {
     [ 0
       pigment { rgb 1 }
       finish {
         specular 0
       }
     ]
     [ 1
       pigment { rgb 1 }
       finish {
         specular 1
       }
     ]
   }
}

Also note you don't need to use a paletted image for this - grayscale 
will work fine as well (even 16 bit).

Christoph

-- 
POV-Ray tutorials, include files, Sim-POV,
HCR-Edit and more: http://www.tu-bs.de/~y0013390/
Last updated 03 May. 2005 _____./\/^>_*_<^\/\.______


Post a reply to this message

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