Sine Wave Displacement Testing
A renderman shader was written and applied to a polygonal plane
in Maya. 60 frames were rendered in Renderman and also in
Maya MTOR. Notice that in Maya the settings will have to be
modified to get the same level of detail that you can accomplish
within renderman.
Movies
Rendered with PRMAN
Rendered with Maya MTOR
Process
Shader Settings in Maya
MTOR:
Using the lerp function, the frequency of the waves was animated.
float waviness = noise(P) * turb;
hump = sin((s + phase + waviness) * 2 * PI * sfreq) + offset;/*hump
= hump + sin((t + phase) * 2 * PI * tfreq) + offset;*/
P = P - n * hump * Km;
N = calculatenormal(P);
}
Adding More Detail
- Rendered in Maya MTOR
Lights were added along with the modification of the shader to add
multiple levels of detail in the ripples of the water.
Additionally, two separate coordinate systems are used to
generate movement through the water. To Do: I am still troubleshooting the flashes of
light that appear on the surface.....
Adding multiple
levels of noise
Shader Settings in Maya:
The lerp function was used to modify the frequency of the waves
and the movement of the sine curve. Two separate coordinate
systems
were used to effect the movement of the turbulence and waves
over time .
Adding a glass shader and animating
the coordinate systems
Modifying Lighting
and Fixing Errors:
I had to recreate the original plane because it was causing the
light artifacts that you see in the above version.
#include "H:/rman/shaders/wave/getWaveHt.h"
displacement
basic_wave(float
Km = -0.3,/* height of the entire wave */
tKm = 1,/* height of the turb ONLY */
wKm = 1,/* height of the wave ONLY */
sfreq = 1,/* number of waves in the s direction */
phase01 = 1,/* movement of the wave in the s dir */
phase02 = 1,
offset = 0,
waviness = .3,/* curviness of the crest of the wave */
nfreq = 3,/* freq of the turb */
detail = 3;/* richness of the details of the turb */
string wavesys = "object",
turbsys = "object")
{
float hump = 0;
normal n;
point pp = transform(wavesys, P);
point ppp = transform(turbsys, P);
n = normalize(N);
hump = getWaveHt(pp, s, sfreq,
phase01, waviness) * wKm;
hump = hump + turbulence(ppp,
detail, nfreq) * tKm;
P = P - n * hump * Km;
N = calculatenormal(P);
}
-