962 Appendix Creating a Shader in Wild Magic
namespace Wm4
{
ColorRGBA p_BlendedTerrain (const float* afRegister,
SoftSampler** apkSampler, const float* afInPixel)
{
// Get register values.
float fPowerFactor = afRegister[0];
// Get samplers.
SoftSampler& rkGrassSampler = *apkSampler[0];
SoftSampler& rkStoneSampler = *apkSampler[1];
SoftSampler& rkBlendSampler = *apkSampler[2];
SoftSampler& rkCloudSampler = *apkSampler[3];
// Get input values.
const float* afGroundTCoord = &afInPixel[0];
const float* afBlendTCoord = &afInPixel[2];
const float* afCloudTCoord = &afInPixel[3];
const float* afFlowDirection = &afInPixel[5];
// *** program ***
ColorRGBA kGrassColor = rkGrassSampler(afGroundTCoord);
ColorRGBA kStoneColor = rkStoneSampler(afGroundTCoord);
ColorRGBA