POV-Ray : Newsgroups : povray.general : Too many layers? Server Time
12 Aug 2024 13:22:22 EDT (-0400)
  Too many layers? (Message 1 to 8 of 8)  
From: Anthony Bennett
Subject: Too many layers?
Date: 17 Feb 1999 11:53:53
Message: <36CAF589.6B52DB56@panama.phoenix.net>
Hello, all. I'm working on a texture that looks like the flag of the
USA, and I have a background texture with the thirteen
bands/strips/stripes. I also have a star texture which consists of three
triangle-like textures piled on top of each other. These triangles are
made of 2 layers in themselves The problem occurs when I try to stick in
50 stars. POV begins to render and then just stops and complains about
too many layers. Is there any way of increasing the ammount of layers it
accepts beyond 256?. According to my calculations (1+(3*2)*50)=301
layers. Can I make it work? Or will I be forced to use an image map?

Thanks in advance for any input guys.


Post a reply to this message

From: Ron Parker
Subject: Re: Too many layers?
Date: 17 Feb 1999 12:35:44
Message: <36cafdf0.0@news.povray.org>
On Wed, 17 Feb 1999 11:59:53 -0500, Anthony Bennett wrote:
>Hello, all. I'm working on a texture that looks like the flag of the
>USA, and I have a background texture with the thirteen
>bands/strips/stripes. I also have a star texture which consists of three
>triangle-like textures piled on top of each other. These triangles are
>made of 2 layers in themselves The problem occurs when I try to stick in
>50 stars. POV begins to render and then just stops and complains about
>too many layers. Is there any way of increasing the ammount of layers it
>accepts beyond 256?. According to my calculations (1+(3*2)*50)=301
>layers. Can I make it work? Or will I be forced to use an image map?

You can use a repeat warp to duplicate your stars instead of placing
each one separately.  I think if you do it right, you can end up with
all of the stars in a single texture.


Post a reply to this message

From: Ken
Subject: Re: Too many layers?
Date: 17 Feb 1999 12:37:21
Message: <36CAFDEB.AE3FFE4D@pacbell.net>
Anthony Bennett wrote:
> 
> Hello, all. I'm working on a texture that looks like the flag of the
> USA, and I have a background texture with the thirteen
> bands/strips/stripes. I also have a star texture which consists of three
> triangle-like textures piled on top of each other. These triangles are
> made of 2 layers in themselves The problem occurs when I try to stick in
> 50 stars. POV begins to render and then just stops and complains about
> too many layers. Is there any way of increasing the ammount of layers it
> accepts beyond 256?. According to my calculations (1+(3*2)*50)=301
> layers. Can I make it work? Or will I be forced to use an image map?
> 
> Thanks in advance for any input guys.

  I envy your hard work and enthusiasm but it is quite likely you are going
about this the wrong way.

  A quick study of a map catalog here shows the middle, to top of the line
flags, as having individual components for each visible geometrical pattern.
This means that each strip is one colored piece, the stars are each a single
colored 5 point star and so on and so a forth. Take the individual pieces and
sew them altogether and you have one each flag. This would reduce your colors
for the object to just three and no layering would be required at all.

 Another approach one could try is by differencing the different layers
against a surface where the difference object adds it's color to the
first object. It would take a very shallow difference to avoid having it look
like a bomb test site, but I have done similar things just to see how
it would look and found it to have it's advantages in certain situations.
One in particular is adding decals to only one surface of a solid object
without the image appearing on the opposite side in reverse.

 An image map would be the easiest method by far.

-- 
Ken Tyler

mailto://tylereng@pacbell.net


Post a reply to this message

From: Anthony Bennett
Subject: Solution
Date: 17 Feb 1999 23:41:41
Message: <36CB9B13.80956562@panama.phoenix.net>
I tried your solution Mr. Parker, but warp only seems to work with pigment
and not texture, which is what I am using for the stars. I have included the
code I'm using to make stars, if you find that I'm doing it the stupid way,
please let me know.

Mr. Tyler, your first suggestions  were a bit off the mark. I prolly just
didn't explain well enough. I have a problem expressing myself using words.
Telepathy would probably channel just what I want to say. I'll have to wait
'till I evolve that. =)

Anyway... the solution I finally used was, the background was made with a
gradient pigment and the stars and blue part were an image map I made
quickly in Photoshop. (Done before I read your suggestion, Mr. Tyler). I put
a render of it in the binaries.images section so you can see it.

Thanks again for being to prompt and kind to help me.


/*   old code   */
#declare WhiteSpot =
pigment
{
 cylindrical
 color_map
 {
  [0 .05 color rgbt <0,0,0, 1> color rgbt <0,0,0, 1>]
  [.05 1 color rgbt <4,4,4,-3> color rgbt <4,4,4,-3>]
 }
 rotate 90*x
}

#declare Box =
pigment
{
 boxed
 color_map
 {
  [0 .05 color rgbt <0, 0, 0, 1> color rgbt <0, 0, 0, 1>]
  [.05 1 color rgbt <1, 1, 1, 6> color rgbt <1, 1, 1, 6>]
 }
 scale <1,1,20>
}

#declare WhiteTri =
texture
{
 pigment
 {
  average
  pigment_map
  {
   [1 WhiteSpot]
   [1 Box translate 1.2*y]
   [1 Box translate -1.2*y rotate 36*z ]
   [1 Box translate -1.2*y rotate -36*z ]
  }
  scale .75
 }
}

#declare Whitestar =
texture {WhiteTri scale .25  translate <2.5,2,0>}
texture {WhiteTri scale .25 rotate  72*z translate <2.5,2,0>}
texture {WhiteTri scale .25 rotate -72*z translate <2.5,2,0>}


Post a reply to this message

From: Ron Parker
Subject: Re: Solution
Date: 18 Feb 1999 12:10:24
Message: <36cc4980.0@news.povray.org>
On Wed, 17 Feb 1999 23:46:11 -0500, Anthony Bennett wrote:
>I tried your solution Mr. Parker, but warp only seems to work with pigment
>and not texture, which is what I am using for the stars. I have included the
>code I'm using to make stars, if you find that I'm doing it the stupid way,
>please let me know.

Yours worked when I tried putting the warps inside the pigments on each of
the layers, but I have what I think is a better solution, with no layers
and no playing with fire in the form of oversaturated color values.

You might want to translate and/or scale appropriately; for reference, one
of the stars is always centered at <0,0,0>.  

StarRadius is the radius of the circle drawn through the points on the star.  
XRepeat is the space between adjacent stars on a row.  YRepeat is the space 
between rows.  Make sure that your star will fit in the space you've 
allocated for it; rows may not overlap.  Enjoy!

//-------------------- BEGIN POV CODE
#declare StarRadius = 0.25;
#declare XRepeat = 1.0;
#declare YRepeat = 0.5;
                           
#declare Starpoint = pigment {
  radial 
  color_map {
    [.45 rgbt 1]
    [.45 rgb  1]
    [.55 rgb  1]
    [.55 rgbt 1]
  }      
  translate StarRadius*x
}
  
#declare Whitestar = pigment {
  radial
  pigment_map {
    [.1 Starpoint rotate 72*0*y ]
    [.1 Starpoint rotate 72*1*y ]
    [.3 Starpoint rotate 72*1*y ]
    [.3 Starpoint rotate 72*2*y ]
    [.5 Starpoint rotate 72*2*y ]
    [.5 Starpoint rotate 72*3*y ]
    [.7 Starpoint rotate 72*3*y ]
    [.7 Starpoint rotate 72*4*y ]
    [.9 Starpoint rotate 72*4*y ]
    [.9 Starpoint rotate 72*0*y ]
  }     
  rotate <90,0,90>
  translate <XRepeat/2,YRepeat/2,0>
  warp {repeat XRepeat*x}
  warp {repeat YRepeat*y offset XRepeat/2*x} 
  translate -<XRepeat/2,YRepeat/2,0>
}
//-------------------- END POV CODE


Post a reply to this message

From: Anthony Bennett
Subject: Solution?
Date: 18 Feb 1999 22:29:21
Message: <36CCDBC6.AAE81B05@panama.phoenix.net>
Thanks for your code, Mr. Parker, but can't one control the ammount of times a
pigment warps? It just seems a bit extra tedious to have to modify the background
to cover the extra stars instead of just pasting them on top. Thanks, though, the
stars are much more within my understanding now. The previous ones were
plagerized from some tutorial. I never understood them.


Post a reply to this message

From: Ken
Subject: Re: Solution?
Date: 20 Feb 1999 20:13:24
Message: <36CF5D45.19B690CA@pacbell.net>
Anthony Bennett wrote:
> 
> Thanks for your code, Mr. Parker, but can't one control the ammount of times a
> pigment warps? It just seems a bit extra tedious to have to modify the background
> to cover the extra stars instead of just pasting them on top. Thanks, though, the
> stars are much more within my understanding now. The previous ones were
> plagerized from some tutorial. I never understood them.

  Per your request here I am. As Mr. Parker is the one who seems
to have the better insight as to how to control this I am going to
defer to Mr. Parker to answer this question for you. It's not that
I am unwilling to help you. It is because I too would have to take
the time to figure out what Mr. Parker has done and then decide the
best approach to change it so it suit your needs. It might be easy
or it might take me a week and I think Mr. Parker can save us both
a lot of time.

 Mr. Parker it's your spotlight...

-- 
Ken Tyler

mailto://tylereng@pacbell.net


Post a reply to this message

From: Ron Parker
Subject: Re: Solution?
Date: 22 Feb 1999 13:58:36
Message: <36d1a8dc.0@news.povray.org>
On Sat, 20 Feb 1999 17:11:33 -0800, Ken <tyl### [at] pacbellnet> wrote:
>Anthony Bennett wrote:
>> 
>> Thanks for your code, Mr. Parker, but can't one control the ammount of times a
>> pigment warps? It just seems a bit extra tedious to have to modify the background
>> to cover the extra stars instead of just pasting them on top. Thanks, though, the
>> stars are much more within my understanding now. The previous ones were
>> plagerized from some tutorial. I never understood them.
>
>  Per your request here I am. As Mr. Parker is the one who seems
>to have the better insight as to how to control this I am going to
>defer to Mr. Parker to answer this question for you. It's not that
>I am unwilling to help you. It is because I too would have to take
>the time to figure out what Mr. Parker has done and then decide the
>best approach to change it so it suit your needs. It might be easy
>or it might take me a week and I think Mr. Parker can save us both
>a lot of time.
>
> Mr. Parker it's your spotlight...

Thanks, Mr. Tyler.  Please, y'all, call me Ron.

I did see this post earlier, but I had to cogitate a bit on the proper 
solution.  Here, then, is the result of much ferocious cogitation.

This gives you a "field" of stars 6 across and 5 down, centered at the 
origin.  Dimensions are 5.5*XRepeat in the x direction and 9*YRepeat in the y 
direction. A little thought will show that to be the correct layout for the 
current US flag, though not perhaps the correct proportions.  It does require 
StarRadius <= XRepeat/2, but that shouldn't be an undue burden.  Figuring out 
what's going on here is left as an exercise for the reader, or for Ken if he 
should decide to figure out what I've done.  

Remember, this is still just a pigment.  You'll want to put it in a texture
and layer it over your flag-without-stars texture (or use a clever 
combination of gradients and boxed patterns to do the whole flag as a
single-layer pigment.)

//------------ Begin POV code
#declare StarRadius = .25;
#declare XRepeat = 1.0;
#declare YRepeat = 0.5;

#declare Starpoint = pigment {
  radial
  color_map {
    [.45 rgbt 1]
    [.45 rgb  1]
    [.55 rgb  1]
    [.55 rgbt 1]
  }
  translate StarRadius*x
}

#declare Whitestar = pigment {
  radial
  pigment_map {
    [.1 Starpoint rotate 72*0*y ]
    [.1 Starpoint rotate 72*1*y ]
    [.3 Starpoint rotate 72*1*y ]
    [.3 Starpoint rotate 72*2*y ]
    [.5 Starpoint rotate 72*2*y ]
    [.5 Starpoint rotate 72*3*y ]
    [.7 Starpoint rotate 72*3*y ]
    [.7 Starpoint rotate 72*4*y ]
    [.9 Starpoint rotate 72*4*y ]
    [.9 Starpoint rotate 72*0*y ]
  }
  rotate <90,0,90>
  translate <XRepeat/2,YRepeat/2,0>
  warp {repeat XRepeat*x}
  warp {repeat YRepeat*y offset XRepeat/2*x}
  translate -YRepeat/2*y
}
     
#declare Starfield=pigment {
  boxed
  pigment_map {
    [.00001 color rgbt 1]
    [.00001 Whitestar 
           scale <1/(XRepeat*2.75),1/(YRepeat*4.5),1>
    ]
  }
  scale <XRepeat*2.75, YRepeat*4.5, 1>
}                                
//------------ End POV code


Post a reply to this message

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