POV-Ray : Newsgroups : povray.general : Feature Request - Texture Override, Help Request Server Time
5 Nov 2024 01:21:23 EST (-0500)
  Feature Request - Texture Override, Help Request (Message 1 to 10 of 20)  
Goto Latest 10 Messages Next 10 Messages >>>
From: Kyle
Subject: Feature Request - Texture Override, Help Request
Date: 15 Jan 2008 23:21:49
Message: <hp0ro31f9m1dr7spccdp4g3j0hj5fvhdh0@4ax.com>
Perhaps someone can help me figure out a way to do this...

I've built a brick road by unioning several hundred bricks to create a section of
road, and then
laying the sections end to end to form the complete road.  Each brick in a section has
a different
texture.  Now, I'm trying to add stripes to the road.  I can do it within the texture
statement used
for the bricks, but that creates stripes that are too uniform.  I'd like to have some
curvature and
disparities in the stripes, which I cannot figure out how to do without the
disparities being
obviously duplicated in each section.  Any ideas?

This is where I think a texture override would be very helpful.  The road could be
built as above,
unioning bricks to form sections and then unioning the sections to form the road. 
Then an overall
texture could be applied that defines the stripes for the entire union.  This would be
helpful for
applying dirt textures too.

Any help would be appreciated.


Post a reply to this message

From: Jan Dvorak
Subject: Re: Feature Request - Texture Override, Help Request
Date: 16 Jan 2008 00:26:05
Message: <478d956d$1@news.povray.org>
Kyle napsal(a):
> Perhaps someone can help me figure out a way to do this...
> 
> I've built a brick road by unioning several hundred bricks to create a section of
road, and then
> laying the sections end to end to form the complete road.  Each brick in a section
has a different
> texture.  Now, I'm trying to add stripes to the road.  I can do it within the
texture statement used
> for the bricks, but that creates stripes that are too uniform.  I'd like to have
some curvature and
> disparities in the stripes, which I cannot figure out how to do without the
disparities being
> obviously duplicated in each section.  Any ideas?
> 
> This is where I think a texture override would be very helpful.  The road could be
built as above,
> unioning bricks to form sections and then unioning the sections to form the road. 
Then an overall
> texture could be applied that defines the stripes for the entire union.  This would
be helpful for
> applying dirt textures too.
> 
> Any help would be appreciated.
> 
union the bricks and apply a stripes texture (object rgb,Clear)


Post a reply to this message

From: Kyle
Subject: Re: Feature Request - Texture Override, Help Request
Date: 16 Jan 2008 08:19:23
Message: <b90so35gumm76bgjr66r6gl6qihvdm834e@4ax.com>
On Wed, 16 Jan 2008 06:25:54 +0100, Jan Dvorak <jan### [at] centrumcz> wrote:

>union the bricks and apply a stripes texture (object rgb,Clear)

I wish it were that simple.  

I've put together a simple sample scene to better describe the issue.  As you'll see
in this scene, the bricks in each section are textured with individual pigment values.
 Because of this, any
texture applied to the o_Road object has no impact.  I can apply the stripes to the
bricks as they are created, but doing so causes obvious uniformity in the stripes. 
I'd rather have the stripes not
be uniform and instead have some slight curvature to them as they are drawn down the
road.  Furthermore, I'd also like to be able to apply an overall "dirt" texture that
is more pronounced at the
edges of the road and not obviously uniform.  

BTW, for anyone that is wondering, building the road in sections of bricks instead of
individual bricks conserves memory and parse/render time.


//+w700 +h500
//+w700 +h500 +a0.1 +j0.5 +am2
             
#include "functions.inc"

global_settings {
  assumed_gamma 1
  max_trace_level 15
}

light_source { vrotate (<0, 500, -500>, <0, -60, 0>), rgb 1 }

camera {
  location <-9, 5, 0> look_at <-5, 4.5, 15> angle 54
  right x*image_width/image_height
}

#declare l_Seed = seed(123);
#declare l_Gap = 0.125;

// basic brick
#declare o_Brick = box { <-4, -1, -2>, <4, 1, 2> scale 1/12 }

// brick pigment source
#declare p_Brick =
  pigment {
    gradient x
    color_map {
      [0 rgb <0.6055, 0.4423, 0.3066>]
      [1 rgb <0.7, 0.3, 0.2>]
    }
  }

// build a section of brick road
#declare o_Section =
  union {
    #declare Z = 0;
    #while (Z < 100)
      #declare X = 0;
      #while (X < 36)
        object { 
          o_Brick 
          pigment { eval_pigment(p_Brick, x*rand(l_Seed)) }
          translate <(X-18 #if(Z/2=int(Z/2)) +0.5 #end)*(8+l_Gap), 0, Z*(4+l_Gap)>/12 
        }
        #declare X = X + 1;
      #end
      #declare Z = Z + 1;
    #end
  }
  
// put some sections together to build a road
#declare o_Road =
  union {
    #declare Z = 0;
    #while (Z < 10)
      object { o_Section translate z*Z*100*(4+l_Gap)/12}
      #declare Z = Z + 1;
    #end
  }

object { o_Road }


Post a reply to this message

From: Arne Kleinophorst
Subject: Re: Feature Request - Texture Override, Help Request
Date: 16 Jan 2008 09:58:14
Message: <478e1b86$1@news.povray.org>
If you tend to have a planar road you could fake it with a small box / 
plane right on top of the road. Apply a transparent colormap, use a 
little turbulence  and there you go.

Arne

Kyle schrieb:
> On Wed, 16 Jan 2008 06:25:54 +0100, Jan Dvorak <jan### [at] centrumcz> wrote:
> 
>> union the bricks and apply a stripes texture (object rgb,Clear)
> 
> I wish it were that simple.  
> 
> I've put together a simple sample scene to better describe the issue.  As you'll see
in this scene, the bricks in each section are textured with individual pigment values.
 Because of this, any
> texture applied to the o_Road object has no impact.  I can apply the stripes to the
bricks as they are created, but doing so causes obvious uniformity in the stripes. 
I'd rather have the stripes not
> be uniform and instead have some slight curvature to them as they are drawn down the
road.  Furthermore, I'd also like to be able to apply an overall "dirt" texture that
is more pronounced at the
> edges of the road and not obviously uniform.  
> 
> BTW, for anyone that is wondering, building the road in sections of bricks instead
of individual bricks conserves memory and parse/render time.
  <snip>


Post a reply to this message

From: Chris B
Subject: Re: Feature Request - Texture Override, Help Request
Date: 16 Jan 2008 10:10:09
Message: <478e1e51@news.povray.org>
"Kyle" <hob### [at] gatenet> wrote in message 
news:b90so35gumm76bgjr66r6gl6qihvdm834e@4ax.com...
> On Wed, 16 Jan 2008 06:25:54 +0100, Jan Dvorak <jan### [at] centrumcz> 
> wrote:
>
>>union the bricks and apply a stripes texture (object rgb,Clear)
>
> I wish it were that simple.
> .. snip ...
> I can apply the stripes to the bricks as they are created, but doing so 
> causes obvious uniformity in the stripes.  I'd rather have the stripes not
> be uniform and instead have some slight curvature to them as they are 
> drawn down the road.  Furthermore, I'd also like to be able to apply an 
> overall "dirt" texture that is more pronounced at the
> edges of the road and not obviously uniform.
> ... snip ...

Hi Kyle,

I'd like a little more clarity about what you mean by 'stripes'. Do you mean 
road markings such as the white lane markings and yellow no-parking lines 
that you have on a lot of roads? If that's what you want I would suggest 
adding a separate object that stands proud of the surface (like paint does) 
and that tracks along the road rather than trying to do it just with 
textures.

For dirt, you might want to try adding a mostly transparent object a very 
small distance above the surface (a plane, a box or a prism object that 
follows the course of the road) where the upper surface is just enough above 
the brick surface to avoid coincident surfaces. You could use a 'spotted' 
pigment to simulate dirt. If the bricks are not totally flat, some could 
stick through this mostly transparent surface and would end up cleaner than 
the rest.

Regards,
Chris B.


Post a reply to this message

From: Kyle
Subject: Re: Feature Request - Texture Override, Help Request
Date: 16 Jan 2008 12:27:08
Message: <r6fso3525gj1fm5ular0uinna82enj64a0@4ax.com>
On Wed, 16 Jan 2008 15:58:12 +0100, Arne Kleinophorst <kle### [at] spamdebitelnet>
wrote:

>If you tend to have a planar road you could fake it with a small box / 
>plane right on top of the road. Apply a transparent colormap, use a 
>little turbulence  and there you go.

Yes, I've tried this method.  It looked kind of OK, but not to my liking.  In reality,
the paint on a brick road is usually not solid.  It is usually only painted on the top
of the bricks and is
usually quite worn off in many places too.  The worn look is easy enough, but the
paint crossing the gaps between the bricks is bothersome.  I've tried creating the
boxes for the lines, then
intersected them with the road and raised them up in the y direction a tad, but then I
had the texture of the road on the boxes due to the intersection.  Grr.  I may just
have to create a no-texture
copy of the road just to use for this purpose, even though it'll hog more memory.


Post a reply to this message

From: Kyle
Subject: Re: Feature Request - Texture Override, Help Request
Date: 16 Jan 2008 12:32:43
Message: <ijfso3dujkvp9073gnv7ndmnuqn2avisob@4ax.com>
On Wed, 16 Jan 2008 15:10:08 -0000, "Chris B" <nom### [at] nomailcom> wrote:

>I'd like a little more clarity about what you mean by 'stripes'. Do you mean 
>road markings such as the white lane markings and yellow no-parking lines 
>that you have on a lot of roads? 

Yes.

>If that's what you want I would suggest 
>adding a separate object that stands proud of the surface (like paint does) 
>and that tracks along the road rather than trying to do it just with 
>textures.

I have done something like that, but was not satisfied with the result.  Take a look
at my reply to Arne a few minutes ago.  I may be able to use a no-texture version of
the road to form an
intersection where I want the lines, and then raise it up above the surface of the
road.  It'll require another copy of the road though...

>For dirt, you might want to try adding a mostly transparent object a very 
>small distance above the surface (a plane, a box or a prism object that 
>follows the course of the road) where the upper surface is just enough above 
>the brick surface to avoid coincident surfaces. You could use a 'spotted' 
>pigment to simulate dirt. If the bricks are not totally flat, some could 
>stick through this mostly transparent surface and would end up cleaner than 
>the rest.

Yes, that's part of the problem.  The bricks are not flat, but are randomly skewed to
look more realistic.  I may still be able to use this idea, or perhaps the
non-transparent road idea as outlined
above.

Thanks for the suggestions.


Post a reply to this message

From: SharkD
Subject: Re: Feature Request - Texture Override, Help Request
Date: 16 Jan 2008 14:15:00
Message: <web.478e576326ad74ae368884fc0@news.povray.org>
Try this:

//BEGIN
//+w700 +h500
//+w700 +h500 +a0.1 +j0.5 +am2

#include "functions.inc"

global_settings {
  assumed_gamma 1
  max_trace_level 15
}

light_source { vrotate (<0, 500, -500>, <0, -60, 0>), rgb 1 }

camera {
  location <0, 10, 0> look_at 0// angle 54
  right x*image_width/image_height
}

#declare l_Seed = seed(123);
#declare l_Gap = 0.125;

// basic brick
#declare o_Brick = box { <-4, -1, -2>, <4, 1, 2> scale 1/12 }

// brick pigment source
#declare p_Brick =
  pigment {
    gradient x
    color_map {
      [0 rgb <0.6055, 0.4423, 0.3066>]
      [1 rgb <0.7, 0.3, 0.2>]
    }
  }

#declare p_Stripe =
  pigment {
    gradient x
    color_map {
      [0 rgbt <1,1,1,1,>]
      [1/2 rgbt <1,1,1,1,>]
      [1/2 rgbt <1,1,1,0,>]
      [1 rgbt <1,1,1,0,>]
    }
  }

// build a section of brick road
#declare o_Section =
  union {
    #declare Z = 0;
    #while (Z < 20)
      #declare X = 0;
      #while (X < 20)
        object {
          o_Brick
          texture
          {
            pigment { eval_pigment(p_Brick, x*rand(l_Seed)) }
          }
          translate <(X-18 #if(Z/2=int(Z/2)) +0.5 #end)*(8+l_Gap), 0,
Z*(4+l_Gap)>/12
        }
        object {
          o_Brick
          translate <(X-18 #if(Z/2=int(Z/2)) +0.5 #end)*(8+l_Gap), 0,
Z*(4+l_Gap)>/12
          scale <1,1.001,1>
        }
        #declare X = X + 1;
      #end
      #declare Z = Z + 1;
    #end
    texture
    {
      pigment {p_Stripe}
    }
  }

// put some sections together to build a road
#declare o_Road =
  union {
    #declare Z = 0;
    #while (Z < 10)
      object { o_Section translate z*Z*100*(4+l_Gap)/12}
      #declare Z = Z + 1;
    #end
  }

object { o_Road }
//END

What I did was duplicate each brick object (except without the texture), scale
it slightly in the y direction, and add a partially transparent texture to the
union of both sets of bricks.

This may not be what you want. But, it looks OK to me from a reasonable
distance. Since the shape of the bricks is the same (I didn't notice any random
values that might cause problems if overlooked), the striped pattern will
conform to the desired shape.

I know that you it /is/ possible to override the texture (or stack multiple
textures) within a single object. I guess this is in fact not possible for the
union of the very same objects. There's probably a good reason for this (at
least as a default behavior).

Let me know if this works out OK for you.


Post a reply to this message

From: Kyle
Subject: Re: Feature Request - Texture Override, Help Request
Date: 16 Jan 2008 15:22:09
Message: <6moso3tj40fk2t456s2djp5to9labhhtcs@4ax.com>
SharkD,

Thanks for your reply.

That's an interesting approach, but the lines would still be duplicated for each
section, which is not what I'm looking for.  Also, there may be some coinciding
surfaces issues by just scaling the
bricks in the y direction, but they may not be visible enough for concern.

A similar effect can be achieved by using layered textures for each brick, as
demonstrated below.  This eliminates the need to have a second brick object and avoids
the possible coinciding surfaces
issue.

// Replace both object statements in your code with this single statement
        object {
          o_Brick
          translate <(X-18 #if(Z/2=int(Z/2)) +0.5 #end)*(8+l_Gap), 0, Z*(4+l_Gap)>/12
          texture
          {
            pigment { eval_pigment(p_Brick, x*rand(l_Seed)) }
          }
          texture
          {
            pigment {p_Stripe}
          }
        }


Post a reply to this message

From: SharkD
Subject: Re: Feature Request - Texture Override, Help Request
Date: 16 Jan 2008 17:45:00
Message: <web.478e882f26ad74ae368884fc0@news.povray.org>
Kyle <hob### [at] gatenet> wrote:
> SharkD,
>
> Thanks for your reply.
>
> That's an interesting approach, but the lines would still be duplicated for each
section, which is not what I'm looki
ng for.  Also, there may be some coinciding surfaces issues by just scaling the
> bricks in the y direction, but they may not be visible enough for concern.
>
> A similar effect can be achieved by using layered textures for each brick, as
demonstrated below.  This eliminates th
e need to have a second brick object and avoids the possible coinciding surfaces
> issue.

You're right. Applying the texture to the brick is the proper way of doing it.
Try this:

//BEGIN
//+w700 +h500
//+w700 +h500 +a0.1 +j0.5 +am2

#include "functions.inc"

global_settings {
  assumed_gamma 1
  max_trace_level 15
}

light_source { vrotate (<0, 500, -500>, <0, -60, 0>), rgb 1 }

camera {
  location <0, 100, 0> look_at 0// angle 54
  right x*image_width/image_height
  translate z*20
}

#declare l_Seed = seed(123);
#declare l_Gap = 0.125;

// basic brick
#declare o_Brick = box { <-4, -1, -2>, <4, 1, 2> scale 1/12 }

// brick pigment source
#declare p_Brick =
  pigment {
    gradient x
    color_map {
      [0 rgb <0.6055, 0.4423, 0.3066>]
      [1 rgb <0.7, 0.3, 0.2>]
    }
  }

#declare p_Clear =
  pigment {
   color rgbt <1,1,1,1,>
  }

#declare p_White =
  pigment {
   color rgbt <1,1,1,0,>
  }

#declare p_Stripe_x =
  pigment {
    gradient x
    pigment_map {
      [0 p_Clear]
      [7/16 p_Clear]
      [7/16 p_White]
      [9/16 p_White]
      [9/16 p_Clear]
      [1 p_Clear]
    }
    warp { turbulence 0.1 octaves 3 lambda 1.5 omega 0.3 }
  }

#declare p_Stripe_z =
  pigment {
    gradient z
    pigment_map {
      [0 p_Clear]
      [3/16 p_Clear]
      [3/16 p_Stripe_x]
      [13/16 p_Stripe_x]
      [13/16 p_Clear]
      [1 p_Clear]
    }
    warp { turbulence 0.1 octaves 3 lambda 1.5 omega 0.3 }
  }


// build a section of brick road
#declare o_Section = 0;


// 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
  }

object { o_Road }
//END


Post a reply to this message

Goto Latest 10 Messages Next 10 Messages >>>

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