A repetitive, tiled, displaced, surface.
Repetition through VEX!
Date Created:Friday December 29th, 2006 03:41 AM
Date Modified:Thursday July 31st, 2008 10:33 PM

float square(float x, y, minx, maxx, miny, maxy, taper)
{
return smooth(minx, minx + taper, x) *
(1 - smooth(maxx, maxx + taper, x)) *
smooth(miny, miny + taper, y) *
(1 - smooth(maxy, maxy + taper, y));
}
displace
repeat
(
float height = 0.1,
min_s = 0.1,
max_s = 0.8,
min_t = 0.1,
max_t = 0.8,
fuzz = 0.1,
s_repeats = 3,
t_repeats = 3)
{
float hump = 0;
vector n = normalize(N);
float ss = s * s_repeats%1;
float tt = t * t_repeats%1;
float row = floor(t * t_repeats);
if(row%2 == 0) ss = (s + 0.5) * s_repeats%1;
hump = square(ss, tt, min_s, max_s, min_t, max_t, fuzz);
P = P - n * hump * height;
N = computenormal(P);
}
Downloads:
Download: repeat.vfl 788 B
Please login or Click Here to register for downloads
Repeat by Dan Lynch
is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License
Based on a work at www.3daet.com
Permissions beyond the scope of this license may be available at http://www.3daet.com
