POV-Ray : Newsgroups : moray.win : For the wishlist: A better layered texture code translation Server Time
28 Mar 2024 20:33:45 EDT (-0400)
  For the wishlist: A better layered texture code translation (Message 1 to 1 of 1)  
From: Thomas de Groot
Subject: For the wishlist: A better layered texture code translation
Date: 14 Oct 2006 04:16:24
Message: <45309cd8@news.povray.org>
The way in which Moray translates  textures to POV-Ray is not always 
straightforward. Look at the following example of a layered texture made in 
Moray:

//  $MRY$: 'Layer1'


#declare _auto_name_no_1_ =
   texture
   {
      pigment
      {
         color rgb <1.0, 0.0, 0.0>
      }
   }
   texture
   {
      pigment
      {
         leopard
         color_map
         {
            [ 0.0     rgbft <0.0, 0.0, 1.0, 0.0, 0.0> ]
            [ 0.156584  rgbft <1.0, 1.0, 1.0, 0.0, 1.0> ]
            [ 1.0     rgbft <1.0, 1.0, 1.0, 0.0, 1.0> ]
         }
      }
   }

#declare Layer1 =
   material  // Layer1
   {
      texture { _auto_name_no_1_ }
      scale  0.1
   }


Instead of declaring first a  _auto_name_no_1_ for the layered texture, and 
then declare the material, why not do this immediatly? That would make the 
code better comprehensible, like this:

#declare Layer1 =
material  // Layer1
{
   texture
   {
      pigment
      {
         color rgb <1.0, 0.0, 0.0>
      }
   }
   texture
   {
      pigment
      {
         leopard
         color_map
         {
            [ 0.0     rgbft <0.0, 0.0, 1.0, 0.0, 0.0> ]
            [ 0.156584  rgbft <1.0, 1.0, 1.0, 0.0, 1.0> ]
            [ 1.0     rgbft <1.0, 1.0, 1.0, 0.0, 1.0> ]
         }
      }
   }
   scale  0.1
}


Thomas


Post a reply to this message

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