HOME | DD

mCasual — mcjPow3Wave free bump displacement map demo

Published: 2023-03-12 07:52:39 +0000 UTC; Views: 342; Favourites: 1; Downloads: 2
Redirect to original
Description

w = 2048
ww = w / 2;
twoPi = Math.PI * 2;
ncyc = 4.5;
amps = new Array();
for( i = 0; i < ww; i++ )
{
t = i / ww; // 0 .. < 1
ramp = 1 - t;
ramp = ramp * ramp * ramp
ang = ncyc * twoPi * t;
amp = Math.cos( ang )
amp = amp + 1;
amp = amp / 2
amp = amp * ramp
amp = amp * 255;
amps.push( amp );
}

Related content
Comments: 0