POV-Ray : Newsgroups : povray.general : Leveller 2 and using hf pigments in iso-functions : Re: Leveller 2 and using hf pigments in iso-functions Server Time
2 Nov 2024 17:21:46 EDT (-0400)
  Re: Leveller 2 and using hf pigments in iso-functions  
From: Christoph Hormann
Date: 16 Jan 2004 09:32:04
Message: <879ld1-542.ln1@triton.imagico.de>
Tom Melly wrote:
> When I create a tga in leveller and use it as a height-field, everything is
> fine.
> 
> However, when I try and use the same tga as a pigment-function in a height
> field, it looks like garbage.
> 
> I've been able to get around the problem by rendering an orthographic hf of the
> tga, applying a gradient pigment, no lights and ambient 1, and then using the
> resultant bitmap in my function.
> 

Short answer: POV-Ray treats tga images differently in heightfields and 
image_maps.

Longer answer: The tga export in leveller probably makes use of the 
special interpretation of 24 bit tga images for heightfields in POV. 
You can use such files in isosurface via image maps but you will have to 
do interpolation manually (or use two separate image files for low and 
high byte).

Without interpolation:

#declare fn_Image=function {
   pigment {
     image_map {
       tga "test.tga"
       map_type 0
       once
     }
   }
}

#declare fn_Height=
function {
   fn_Image(x, y, z).red+fn_Image(x, y, z).green/256
}

Note it is quite surely more efficient to use a different image file 
format for this purpose but sadly POV-Ray 3.5 does only support 16 bit 
grayscale image_maps in form of ASCII pgm files.  This will be different 
in the next version though.

Christoph

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


Post a reply to this message

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