POV-Ray : Newsgroups : povray.general : finite texture Server Time
2 Aug 2024 00:13:26 EDT (-0400)
  finite texture (Message 1 to 10 of 12)  
Goto Latest 10 Messages Next 2 Messages >>>
From: Steely
Subject: finite texture
Date: 12 Apr 2005 07:35:00
Message: <web.425bb18bc9122b16420f83140@news.povray.org>
In our german POV forum a guy came up with this question and no one of us
was able  to solve it. So I decided to forward it.
// -----------------

The task is to make a big stone wall made by boxes, half a unit high and a
unit wide. The single stones shall have a marble texture that way, that
every stone is slight different from the others. But instead of building
the wall out of 500 single stones, he wants *one* box with a brick pattern
*and* every brick shall have a different look.
// -----------------

Any Ideas ?

TIA

Steely


Post a reply to this message

From: Lance Birch
Subject: Re: finite texture
Date: 12 Apr 2005 07:53:25
Message: <425bb6b5$1@news.povray.org>
"Steely" <nomail@nomail> wrote in message
news:web.425bb18bc9122b16420f83140@news.povray.org...
> In our german POV forum a guy came up with this question and no one of us
> was able  to solve it. So I decided to forward it.
> // -----------------
>
> The task is to make a big stone wall made by boxes, half a unit high and a
> unit wide. The single stones shall have a marble texture that way, that
> every stone is slight different from the others. But instead of building
> the wall out of 500 single stones, he wants *one* box with a brick pattern
> *and* every brick shall have a different look.
> // -----------------
>
> Any Ideas ?

What about a material_map?  Granted it would involve creating an image with a
series of differently coloured bricks (one colour for each different texture for
the bricks), but this would facilitate the use of n textures for the bricks and
allow the desired variation.

The image could be generated by creating a simple rendering of a plane with a
brick pattern and no anti-aliasing, taking the result into an image program and
filling each brick with a different colour.

That's the best solution I can think of off the top of my head, but perhaps
someone else can think of a more elegant solution.

Lance.

thezone - thezone.firewave.com.au


Post a reply to this message

From: Jim Charter
Subject: Re: finite texture
Date: 12 Apr 2005 08:38:06
Message: <425bc12e$1@news.povray.org>
Steely wrote:
> In our german POV forum a guy came up with this question and no one of us
> was able  to solve it. So I decided to forward it.
> // -----------------
> 
> The task is to make a big stone wall made by boxes, half a unit high and a
> unit wide. The single stones shall have a marble texture that way, that
> every stone is slight different from the others. But instead of building
> the wall out of 500 single stones, he wants *one* box with a brick pattern
> *and* every brick shall have a different look.
I remember Gail Shaw did something along those lines varying the colors 
of the bricks using the warp statement but I could never figure out what 
she did.  It still may have invovled a fixed number of variations.

Another possibility might be to cleverly nest two gradient patterns such 
that the horizontal gradient forms and alternating occurance of a 
material.  Each of those is then defined as one of two vertical 
gradients one of which is displaced.  Or perhaps use two properly scaled 
Cells pattern for the vertical with a texture map of different marbles.


Post a reply to this message

From: andrel
Subject: Re: finite texture
Date: 12 Apr 2005 08:48:59
Message: <425BC368.6090605@hotmail.com>
Lance Birch wrote:
> "Steely" <nomail@nomail> wrote in message
> news:web.425bb18bc9122b16420f83140@news.povray.org...
> 
>>In our german POV forum a guy came up with this question and no one of us
>>was able  to solve it. So I decided to forward it.
>>// -----------------
>>
>>The task is to make a big stone wall made by boxes, half a unit high and a
>>unit wide. The single stones shall have a marble texture that way, that
>>every stone is slight different from the others. But instead of building
>>the wall out of 500 single stones, he wants *one* box with a brick pattern
>>*and* every brick shall have a different look.
>>// -----------------
>>
>>Any Ideas ?
> 
> 
> What about a material_map?  Granted it would involve creating an image with a
> series of differently coloured bricks (one colour for each different texture for
> the bricks), but this would facilitate the use of n textures for the bricks and
> allow the desired variation.
You can color the bricks with 3 colors that never touch. If the marble 
texture does not have structures that are larger than a brick size you 
may get away with that.
> 
> The image could be generated by creating a simple rendering of a plane with a
> brick pattern and no anti-aliasing, taking the result into an image program and
> filling each brick with a different colour.
> 
> That's the best solution I can think of off the top of my head, but perhaps
> someone else can think of a more elegant solution.
> 
> Lance.
> 
> thezone - thezone.firewave.com.au
> 
>


Post a reply to this message

From: Jim Charter
Subject: Re: finite texture
Date: 12 Apr 2005 09:16:18
Message: <425bca22$1@news.povray.org>
This code illustrates what I mean.  By playing with the texture maps for
TCells1  and  TCells2 you should be able to get sufficient variety?




         #local Tgrout =
         texture {
                 pigment { rgb 1 }
         };
         #local TBlack =
         texture {
                 pigment { rgb 0 }
         };
         #local TRed =
         texture {
                 pigment { rgb Red }
         };
         #local TCyan =
         texture {
                 pigment { rgb Cyan }
         };
         #local TCells1 =
         texture {
                         cells
                         texture_map {
                                 [0 TBlack]
                                 [1 TCyan]
                         }
         };
         #local TCells2 =
         texture {
                         cells
                         texture_map {
                                 [0 TRed]
                                 [1 TCyan]
                         }
         };
         #local T1 =
         texture {
                         gradient x
                         texture_map {
                                 [.05   Tgrout]
                                 [.05   TCells1]
                                 [.95   TCells1]
                                 [.95   Tgrout]
                         }

         };
         #local T2 =
         texture {
                         gradient x
                         texture_map {
                                 [.05   Tgrout]
                                 [.05   TCells2]
                                 [.95   TCells2]
                                 [.95   Tgrout]
                         }
                         translate x*.5
         };

         plane {
                 z, 0

                 texture {

                         gradient y
                         scale .5
                         texture_map {
                                 [.05   Tgrout]
                                 [.05   T1]
                                 [.45   T1]
                                 [.45   Tgrout]
                                 [.55   Tgrout]
                                 [.55   T2]
                                 [.95   T2]
                                 [.95   Tgrout]
                         }


                 }
         }


Post a reply to this message

From: Lance Birch
Subject: Re: finite texture
Date: 12 Apr 2005 11:11:56
Message: <425be53c@news.povray.org>
I know it's A Bad Idea to post binaries here, but it's so tiny I thought no one
would mind!  Anywhere, here's an example of the material_map idea.  This one
uses 144 randomly generated textures for the bricks.  Save it as a .pov and put
the png in the same directory - you may have to correct for the line breaks.

--

camera {location <0,0,-1> look_at <0,0,0>}
light_source {<10,-4,-4> 2}

#declare Index = 0;
#declare R = seed(134624);
#declare BrickTex = array[144];
#while (Index <= 143)
 #declare BrickTex[Index] = texture {pigment{color rgb
<rand(R),rand(R),rand(R)>} normal {bumps rand(R)} scale rand(R)/2}
 #declare Index = Index + 1;
#end
#declare Index = 0;

plane {z, 0
 texture {
  material_map {
   png "brick.png"
   texture {pigment {color rgb <1,1,1>}}
   #while (Index <= 143)
    texture {BrickTex[Index]}
    #declare Index = Index + 1;
   #end
  }
 }
}

--

Hope this helps!

Lance.

thezone - thezone.firewave.com.au


Post a reply to this message


Attachments:
Download 'brick.png' (6 KB)

Preview of image 'brick.png'
brick.png


 

From: bmc
Subject: Re: finite texture
Date: 12 Apr 2005 12:50:00
Message: <web.425bfb64e46da0b4fd28b6860@news.povray.org>
"Steely" <nomail@nomail> wrote:
> In our german POV forum a guy came up with this question and no one of us
> was able  to solve it. So I decided to forward it.
> // -----------------
>
> The task is to make a big stone wall made by boxes, half a unit high and a
> unit wide. The single stones shall have a marble texture that way, that
> every stone is slight different from the others. But instead of building
> the wall out of 500 single stones, he wants *one* box with a brick pattern
> *and* every brick shall have a different look.
> // -----------------
>
> Any Ideas ?
>
> TIA
>
> Steely


i had a similar problem a few weeks ago. this is what i came up with:

#declare brick_length = 2;
#declare brick_d = .1;  // thickness of the motar
// position "inside" the stone
#declare fn_brick_u = function(u,v) { u - floor(v)*brick_length/2 - floor((u
- floor(v)*brick_length/2)/brick_length)*brick_length }
#declare fn_brick_v = function(u,v) { v - floor(v) }
// middle point of the stone
#declare fn_brick_n_u = function(u,v) { floor((u -
floor(v)*brick_length/2)/brick_length)*brick_length }
#declare fn_brick_n_v = function(u,v) { floor(v) }
// mask for motar
#declare fn_mortar = function(u,v) {
  max (
    select(u-brick_d,1,select(brick_length-brick_d-u,1,0)),
    select(v-brick_d,1,select(1-brick_d-v,1,0))
  )
}

....together with a pattern for the stones...

#declare fn_pig = function {
  pattern {
    marble
    warp { turbulence 1 }
  }
}

.... gives a nice stone wall pigment:

pigment {
  function { fn_mortar(fn_brick_u(x,y),fn_brick_v(x,y)) }
  pigment_map {
    [ 0.0 //the stones
      function { fn_pig(
                   fn_brick_u(x,y)+fn_brick_n_u(x,y)*100,
                   fn_brick_v(x,y)+fn_brick_n_v(x,y)*100,z) }
      color_map {
        [0.0 color rgb 0.0 ]
        [1.0 color rgb 1.0 ]
      }
    ]
    [ 1.0 // the mortar
      color Red
    ]
  }
  scale .5
}

hope that helps!

thilo mack


Post a reply to this message

From: Jim Charter
Subject: Re: finite texture
Date: 12 Apr 2005 14:04:58
Message: <425c0dca$1@news.povray.org>
bmc wrote:
> "Steely" <nomail@nomail> wrote:
> 
>>In our german POV forum a guy came up with this question and no one of us
>>was able  to solve it. So I decided to forward it.
>>// -----------------
>>
>>The task is to make a big stone wall made by boxes, half a unit high and a
>>unit wide. The single stones shall have a marble texture that way, that
>>every stone is slight different from the others. But instead of building
>>the wall out of 500 single stones, he wants *one* box with a brick pattern
>>*and* every brick shall have a different look.
>>// -----------------
>>
>>Any Ideas ?
>>
>>TIA
>>
>>Steely
> 
> 
> 
> i had a similar problem a few weeks ago. this is what i came up with:
> 
> #declare brick_length = 2;
> #declare brick_d = .1;  // thickness of the motar
> // position "inside" the stone
> #declare fn_brick_u = function(u,v) { u - floor(v)*brick_length/2 - floor((u
> - floor(v)*brick_length/2)/brick_length)*brick_length }
> #declare fn_brick_v = function(u,v) { v - floor(v) }
> // middle point of the stone
> #declare fn_brick_n_u = function(u,v) { floor((u -
> floor(v)*brick_length/2)/brick_length)*brick_length }
> #declare fn_brick_n_v = function(u,v) { floor(v) }
> // mask for motar
> #declare fn_mortar = function(u,v) {
>   max (
>     select(u-brick_d,1,select(brick_length-brick_d-u,1,0)),
>     select(v-brick_d,1,select(1-brick_d-v,1,0))
>   )
> }
> 
> ....together with a pattern for the stones...
> 
> #declare fn_pig = function {
>   pattern {
>     marble
>     warp { turbulence 1 }
>   }
> }
> 
> .... gives a nice stone wall pigment:
> 
> pigment {
>   function { fn_mortar(fn_brick_u(x,y),fn_brick_v(x,y)) }
>   pigment_map {
>     [ 0.0 //the stones
>       function { fn_pig(
>                    fn_brick_u(x,y)+fn_brick_n_u(x,y)*100,
>                    fn_brick_v(x,y)+fn_brick_n_v(x,y)*100,z) }
>       color_map {
>         [0.0 color rgb 0.0 ]
>         [1.0 color rgb 1.0 ]
>       }
>     ]
>     [ 1.0 // the mortar
>       color Red
>     ]
>   }
>   scale .5
> }
> 
> hope that helps!
> 
> thilo mack
> 
> 
But the whole point is to randomly apply a large variety of different 
textures to different bricks without producing discreet brick objects. 
Are you not just applying the same stone texture across a brick texture?


Post a reply to this message

From: bmc
Subject: Re: finite texture
Date: 12 Apr 2005 18:40:00
Message: <web.425c4d81e46da0b4fd28b6860@news.povray.org>
> But the whole point is to randomly apply a large variety of different
> textures to different bricks without producing discreet brick objects.
> Are you not just applying the same stone texture across a brick texture?
you are right. i misread your post. i am sorry for that!

my solution to your problem (if i get it right this time ;-) becomes quite
complicated and might be an overkill.
the adventage is that it never repeats itself as with the image based
solution.
you can use fn_brick_n_u/fn_brick_n_v for a texture_map:

texture {
  function { f_noise3d(fn_brick_n_u(x,y),fn_brick_n_v(x,y),0)*1000 }
  texture_map {
    /* put all the different textures here */
  }
}

i multiplied the f_noise3d() with 1000 to get rid of its distribution.
without that you would get much more values around .5
this works fine on povray 3.6 and windows xp. you might have to write it as
(f_noise3d()*1000) - floor(f_noise3d()*1000) on other systems.
perhaps there is a better way to do that, but it seems to work.

there is still the problem with stones that lie next to each other and have
the same texture.
you can fix that by using textures as from my previous post in the
texture_map.


Post a reply to this message

From: Steely
Subject: Re: finite texture
Date: 12 Apr 2005 19:05:01
Message: <web.425c52e6e46da0b476e394630@news.povray.org>
I have been asked to told you this:

The guy who originally posted the problem in our forum has tried the several
solutions and *in this special case* the way shown by bmc leads to the best
results. He (and me too) would like to say thanks to all for the very fast
and professional help.

I guess we can expect his first public pictures in the next weeks and I will
drive him to post them here (he is building an ancient city and I have seen
very nice test renders).

Again: thanks to all.

S.


Post a reply to this message

Goto Latest 10 Messages Next 2 Messages >>>

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