|
|
OK, I thought of something else to do with bricks :)
The code for this is a little bit hairy, but it basically entails making my own
cells pattern by sampling a declared pigment as a function. I can't use the
repeat warp trick because of the sampling, so instead I have to bake the offset
into the function call. This also offsets the sampled pigment, so I have to
pre-offset that in the other direction before using it.
// these are for the brick light/dark variation
#declare LightRand = pigment {
bozo color_map { [0 rgb 0.5] [1 rgb 1] } scale 0.01
}
#declare DarkRand = pigment {
bozo color_map { [0 rgb 0.1] [1 rgb 0.5] } scale 0.01
}
// bricks size can't be in a vector if it's to be used in a function call
#declare BSX = 0.5;
#declare BSY = 0.25;
#declare BSZ = 0.5;
// function version of the base pigment (using object Obj here)
#declare WallPigFn = function { pigment {
object { Obj pigment { LightRand } pigment { DarkRand } }
} }
// pre-offset version of the base pigment
#declare WallPigFnOffset = function {
WallPigFn(
x - 0.5*BSX*floor(y/BSY),
y,
z - 0.5*BSZ*floor(y/BSY)
).x
}
// colour scheme
#declare LCol = <1, 0.5, 0.5>;
#declare DCol = <0.2, 0.2, 0.5>;
// cells-like sampled brick pattern
#declare SampledBrick = pigment {
function {
WallPigFnOffset(
BSX*floor((x+0.5*BSX*floor(y/BSY))/BSX) + 0.5*BSX,
BSY*floor(y/BSY) + 0.5*BSY,
BSZ*floor((z+0.5*BSZ*floor(y/BSY))/BSZ) + 0.5*BSZ
)
}
color_map {
[0 rgb 0.1*DCol]
[0.5 rgb DCol]
[0.5001 rgb 0.1*LCol]
[1 rgb LCol]
}
translate z*0.5*BSZ
}
// now with mortar
#declare CombinedSampled = pigment {
brick
pigment { rgb 0 }
pigment { SampledBrick }
brick_size <BSX, BSY, BSZ>
mortar 0.035
}
Post a reply to this message
Attachments:
Download 'textbricks.jpg' (293 KB)
Preview of image 'textbricks.jpg'
|
|