|
![](/i/fill.gif) |
SharkD wrote:
> I may have asked this before, but what are some good ways to create 2D
> textures that tile?
In 2D space you can use diamond tiling:
#declare repeatable_pattern=
pigment{
cylindrical rotate x*90 scale 1.00
pigment_map{
[0 rgb 0]
[1 crackle scale .5]
}
}
plane{z,0
pigment{
average
pigment_map{
[1 repeatable_pattern translate -x]
[1 repeatable_pattern translate x]
[1 repeatable_pattern translate -y]
[1 repeatable_pattern translate y]
}
translate(x+y)
warp{repeat x*2}
warp{repeat y*2}
}
}
or square tiling:
#declare repeatable_pattern=
pigment{
cylindrical rotate x*90 scale 1.50
pigment_map{
[0 rgb 0]
[1 crackle scale .5]
}
}
plane{z,0
pigment{
average
pigment_map{
[1 repeatable_pattern translate<-1,-1,0>]
[1 repeatable_pattern translate<1,-1,0>]
[1 repeatable_pattern translate<-1,1,0>]
[1 repeatable_pattern translate<1,1,0>]
}
translate(x+y)
warp{repeat x*2}
warp{repeat y*2}
}
}
where "repeatable_pattern" is a pigment you wish to use in excess.
> Secondly (and this is the more advanced part), how might I turn tiling
> on and off for a particular direction?
I think perhaps you'll be keeping track of where the break in repetition
occurs, so for a tile which repeats using diamond tiling, with a break
in repetition to the right:
pigment{
average
pigment_map{
[1 repeatable_pattern translate -x]
[1 non_repeatable_pattern translate x]
[1 repeatable_pattern translate -y]
[1 repeatable_pattern translate y]
}
translate(x+y)
warp{repeat x*2}
warp{repeat y*2}
}
might suffice.
I hope this helps somewhat.
Sam
Post a reply to this message
|
![](/i/fill.gif) |