POV-Ray : Newsgroups : povray.binaries.images : random-colored BRICKS : Re: random-colored BRICKS Server Time
17 May 2024 23:35:31 EDT (-0400)
  Re: random-colored BRICKS  
From: Bill Pragnell
Date: 23 Apr 2018 16:20:01
Message: <web.5ade3ec495b142bd1b6c6b3a0@news.povray.org>
Sven Littkowski <I### [at] SvenLittkowskiname> wrote:
> This is the code i have right now. Looks alright, just the grain
> continues into each other "brick"...

Here's a simple example which will 'randomise' a pigment into bricks in the X-Z
plane (I assume if you're after a floor texture, you're not worried about it
looking good in any other planes).

#declare BX = 0.75;
#declare BZ = 0.25;
#declare YOffset = 2;
#declare MaxSceneSize = 100;
#declare Example = pigment {
 bozo color_map { [0 rgb 0] [1 rgb 1] }
 scale 0.1
 warp { repeat x*BX offset y*YOffset }
 warp { repeat z*BZ offset x*(MaxSceneSize + 0.5)*BX }
}

BX and BZ are the x and z brick dimensions. YOffset is an out-of plane offset
that gives the randomness - it only needs to be big enough to produce a
noticeable change in the pattern. MaxSceneSize is the row-on-row offset to make
sure the repetition is out of sight (or just not noticeable).

Obviously you'll need to synchronise the pattern and the warps between pigments
and normals so they match up. Your example code was two layered textures so
it'll be best to #declare stuff so you can change it easily. You were using wood
textures, so I don't know if you were relying on the core of the pattern - my
YOffset tactic might not work well with that. Good luck!

Nice wood texture btw ;-)

Bill


Post a reply to this message

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