An attempt to blur a displacement.
A .vfl file that generates fun displacements.
Date Created:Friday December 29th, 2006 03:41 AM
Date Modified:Tuesday July 29th, 2008 08:47 PM
Original displacement with no blur:

/*
*
* This adds uv's based on s & t if there are no uv coordinates
*
* Author: Dan Lynch
*
*/
#pragma hint path image
#pragma hint uv hidden
#pragma range h 0 1
#pragma label h "Height"
#pragma hint switcher toggle
#pragma label switcher "Blur"
#pragma label d "Distance"
#pragma range d 0 0.12
#pragma label samples "Samples"
#pragma group Blur switcher samples d
#pragma disable d switcher 0
#pragma disable samples switcher 0
displace
d_disp
(
float h=0.1;
string path = "Mandril.pic";
export vector uv = 0;
int switcher=0, samples=5;
float d=0.1;
)
{
P = wo_space(P);
N = wo_nspace(N);
float u;
float V;
if (!isbound("uv")) {
u = s;
V = t;
} else {
u = uv.x;
V = uv.y;
}
vector var;
if (switcher) {
var = vector (colormap(path,u - d, V - d, u + d, V - d, u - d, V + d, u + d, V + d, samples, "filter", "gaussian"));
} else {
var = vector(texture(path,u,V));
}
P+=normalize(N)*var*h;
P=ow_space(P);
N=normalize(computenormal(P,N,Ng));
}




Downloads:
Download: colormap_blur.vfl 1 KB
Please login or Click Here to register for downloads
Colormap Blur 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
