POV-Ray : Newsgroups : povray.general : Faster "specular mapping"? : Faster "specular mapping"? Server Time
1 Aug 2024 20:11:11 EDT (-0400)
  Faster "specular mapping"?  
From: Tom York
Date: 28 May 2005 03:25:01
Message: <web.42981b303c530a66e0d101b60@news.povray.org>
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
  }
}

The above is wrapped in a simple macro that accepts arbitrary pigments and
specular map file names and spits out the texture. It works, but it takes a
long time to parse. For example, I tried this with a 14.5MB mesh and a
1024x1024 specular map stored as a TGA file. On disk, this TGA
file (RLE compressed) is a few hundred K. If I load the specular map
into a dummy texture but don't use it in the above code (i.e. I don't use
specular mapping) then the parse time is 15 seconds (and a 640x360 takes
about 4 seconds to render). If I then remove the dummy and use the specular
map in the above code, I get a parse time of 32 seconds, which I would like
to reduce greatly. Even with specular mapping on the render time remains
between 4 and 5 seconds, which I was very happy with.

Now, this inflated parse time is maybe not too bad - if it's a disk access
issue then it should disappear when I render from a RAMdisk. However, if
anyone knows a more efficient way to achive the same result then I might be
able to avoid a RAMdisk altogether (desirable, since I'm going to be doing
animation). If it's not a disk access issue then I'm looking for a more
minimalist approach that produces the same result. Does anyone know of such
a way? I am using POVRay 3.6.1 on Windows XP (service pack 2)


Post a reply to this message

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