The basic displacement function is:
public void displacement(output point P; output normal N)
{
//initialize m_shadingCtx variable just in case it had been used before
m_shadingCtx->init();
//assign m_hump variable based on wavelet noise
exampleVariable = something_To_Make_It_Change_Like_A_Map
//displace based on m_hump
m_shadingCtx->displace(vector(normalize(N)),exampleVariable, "displace");
//reinitialize m_shadingCtx
m_shadingCtx->init();
}
Which creates the sphere on the right. If the last "m_shadingCtx->init();" is omitted, the shader turns into a toon shader like the one on the left! Hooray for experimentation!
public void displacement(output point P; output normal N)
{
//initialize m_shadingCtx variable just in case it had been used before
m_shadingCtx->init();
//assign m_hump variable based on wavelet noise
exampleVariable = something_To_Make_It_Change_Like_A_Map
//displace based on m_hump
m_shadingCtx->displace(vector(normalize(N)),exampleVariable, "displace");
//reinitialize m_shadingCtx
m_shadingCtx->init();
}
Which creates the sphere on the right. If the last "m_shadingCtx->init();" is omitted, the shader turns into a toon shader like the one on the left! Hooray for experimentation!