home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Hackers Magazine 57
/
CdHackersMagazineNr57.iso
/
Software
/
Multimedia
/
k3d-setup-0.7.11.0.exe
/
share
/
k3d
/
shaders
/
displacemnt
/
k3d_displacementmap.sl
< prev
next >
Encoding:
Amiga
Atari
Commodore
DOS
FM Towns/JPY
Macintosh
Macintosh JP
Macintosh to JP
NeXTSTEP
RISC OS/Acorn
Shift JIS
UTF-8
Wrap
Text File
|
2008-01-23
|
369 b
|
16 lines
displacement k3d_displacementmap(float Km = 1;
float ZeroPoint = 0.0;
string texturename = "";)
{
point PP;
point N1, N2;
float Ct;
Ct = (texturename != "") ? float texture(texturename) : 0;
N1 = calculatenormal(P);
P = P - (Km * (Ct - ZeroPoint)) * normalize(N);
N2 = calculatenormal(P);
N = normalize(N) + normalize(N2) - normalize(N1);
}