combining noises in VEX

   2395   0   0
User Avatar
Member
88 posts
Joined: 3月 2006
Offline
I'm trying to combine more than one noise function to P for a displacement shader but I'm having difficulty making it work. I can do it in VOPS but I'm fairly new to VEX. Here's the code for applying a single noise:
displace
water_disp(float wfreq=2, wamp=1; vector woffset={0,0,0})
{

vector Pw = wo_space(P+woffset)*wfreq;
vector Nn = normalize(N);
float Nw=0;

Nw+noise(Pw));

P+= Nn * Nw * wamp/1000;
N = computenormal(P);
}
  • Quick Links