POV-Ray : Newsgroups : povray.advanced-users : Debugging loop-generated texture_map : Debugging loop-generated texture_map Server Time
8 Dec 2021 08:26:44 EST (-0500)
  Debugging loop-generated texture_map  
From: Bald Eagle
Date: 21 Jul 2019 17:45:01
Message: <web.5d34dbd743e61d704eec112d0@news.povray.org>
So, I'm trying to take a bunch of textures and pick random ones and generate a
texture_map with those. (stolen from HOF pebbles.pov)

qtpovray gives me:

Parse Error: Must have at least one entry in map.
at File: TwistedSoaCheP.pov Line: 209 Col: 20

So I'm wondering why it doesn't register any entries.

I'm also wondering how I take the current erroneous state of the texture map and
output it to the debug stream, so I can actually see what's wrong.







   #declare TexArray = array [21];


    #declare Texture_Map =
    texture_map {
    #for (Tex, 0, 20)
     [ Tex/20
    //texture {
          // Add the default texture
     PebbleNormalAndFinish
     pigment {
            // Select a random pattern.
      PebblePatterns[rand(RandPat)*PebblePatternCount]
      color_map {
              // Choose a random colour scheme.
       PebbleColours[rand(RandCol)*PebbleColourCount]
      }
     }

          // Randomize the pattern's position and rotation.
          translate <rand(RandPat)*100, rand(RandPat)*100, rand(RandPat)*100>
          rotate <rand(RandPat)*360, rand(RandPat)*360, rand(RandPat)*360>
          ]
    //} // end texture

    /*
        // Decide randomly which of the dirt/speckle/line overlay textures we
want to use.
        #declare DecalLoop = 0;
        #while (DecalLoop < DecalPatternCount)
          #if (rand(RandPat) < 0.2)
            texture
            {
              PebbleNormalAndFinish
              DecalPatterns[DecalLoop]
              translate <rand(RandPat)*100, rand(RandPat)*100,
rand(RandPat)*100>
              rotate <rand(RandPat)*360, rand(RandPat)*360, rand(RandPat)*360>
            }
          #end
          #declare DecalLoop = DecalLoop + 1;
        #end
      */

   #end

   }


   #declare TexArray = array [21];


    #declare Texture_Map =
    texture_map {
    #for (Tex, 0, 20)
     [ Tex/20
    //texture {
          // Add the default texture
     PebbleNormalAndFinish
     pigment {
            // Select a random pattern.
      PebblePatterns[rand(RandPat)*PebblePatternCount]
      color_map {
              // Choose a random colour scheme.
       PebbleColours[rand(RandCol)*PebbleColourCount]
      }
     }

          // Randomize the pattern's position and rotation.
          translate <rand(RandPat)*100, rand(RandPat)*100, rand(RandPat)*100>
          rotate <rand(RandPat)*360, rand(RandPat)*360, rand(RandPat)*360>
          ]
    //} // end texture

    /*
        // Decide randomly which of the dirt/speckle/line overlay textures we
want to use.
        #declare DecalLoop = 0;
        #while (DecalLoop < DecalPatternCount)
          #if (rand(RandPat) < 0.2)
            texture
            {
              PebbleNormalAndFinish
              DecalPatterns[DecalLoop]
              translate <rand(RandPat)*100, rand(RandPat)*100,
rand(RandPat)*100>
              rotate <rand(RandPat)*360, rand(RandPat)*360, rand(RandPat)*360>
            }
          #end
          #declare DecalLoop = DecalLoop + 1;
        #end
      */

   #end

   }

It also doesn't like me trying to layer those.  Maybe I can make an array of
layered textures, and populate the texture_map with those.

(I tried to make the texture map by defining textures as array entries, and then
building the texture_map that way - but same error.)


Post a reply to this message

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