POV-Ray : Newsgroups : povray.general : Feature Request - Texture Override, Help Request : Re: Feature Request - Texture Override, Help Request Server Time
21 May 2024 18:11:08 EDT (-0400)
  Re: Feature Request - Texture Override, Help Request  
From: Kyle
Date: 17 Jan 2008 07:38:24
Message: <uvhuo392o7f7k36t3er7qcrir79kq9dpj2@4ax.com>
On Wed, 16 Jan 2008 17:41:51 EST, "SharkD" <nomail@nomail> wrote:

>// put some sections together to build a road
>#declare o_Road =
>  union {
>    #declare S = 0;
>    #while (S < 10)
>    union {
>      #declare Z = 0;
>      #declare section_translate = z*S*20*(4+l_Gap)/12;
>      #while (Z < 20)
>        #declare X = 0;
>        #while (X < 20)
>          #declare brick_translate = <(X-10 #if(Z/2=int(Z/2)) +0.5
>#end)*(8+l_Gap), 0, Z*(4+l_Gap)>/12;
>          object {
>            o_Brick
>            texture {
>              pigment { eval_pigment(p_Brick, x*rand(l_Seed)) }
>            }
>       texture {
>         pigment {p_Stripe_z}
>         translate x*.5
>         scale 10
>         translate -brick_translate
>         translate -section_translate
>       }
>            translate brick_translate
>          }
>          #declare X = X + 1;
>        #end
>        #declare Z = Z + 1;
>      #end
>   translate section_translate
>    }
>      #declare S = S + 1;
>    #end
>  }

SharkD,

What you've done here is nothing more than nesting unions to build the complete road
brick by brick, which will be a huge memory hog.  It's basically the same as removing
the outer union and loop (the
one using the S variable), and then increasing Z to a value of Z*S.  In the original
code, the road is built from predefined sections of bricks, which consumes
considerably less memory and saves allot
of parse time as compared to the brick by brick method.  Plus, I think the way you're
applying the second texture will still show breaks between the sections.

I think I'm going to have to change my scene.  Instead of having the brick road fade
out into the distance, I may try curving it enough to have it diminish from view more
quickly.  Another possibility
is that I may use the brick by brick method to a point, and then switch over to
another object for the distant bricks, such as a box with a home-brewed brick pattern
applied.

I still think a method to layer a texture over a union of individually textured
objects would be a greatly welcomed feature addition to POV-Ray.  This isn't the first
time I've run into a circumstance
where such a feature would provide the simplest solution to a problem.


Post a reply to this message

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