The following files were generated by CgToWm3 applied to Charcoal.cg:

    Wm3CharcoalVShader.{h,inl,cpp}
    Wm3CharcoalPShader.{h,inl,cpp}
    Wm3CharcoalEffect.{h,inl,cpp}

They were manually modified as follows.

1. No changes to Wm3CharcoalVShader.{h,inl,cpp}.

2. The pmain function has "uniform float4 Constants".  The x value is
   called the "smudge factor" in the program.  The y value is called the
   "paper factor".  CgToWm3 only generates set/get for Constants.  The
   files Wm3CharcoalPShader.{h,inl} and Wm3CharcoalEffect.{h,inl} were
   modifed to replace {Set,Get}Constants by {Set,Get}SmudgeFactor and
   {Set,Get}PaperFactor.

3. Added line break to constructor declaration and body in the files
   Wm3CharcoalEffect.{h,cpp} to meet the 79-character restriction.  Added
   line breaks in Wm3CharcoalEffect.inl in SetAmbientIntensity and
   SetContrastExponent.
   
4. Added comments before the constructor declaration in Wm3CharcoalEffect.h
   about preconditions for use of the effect, namely, two lights are
   expected by the vertex shader.  Also, for each Geometry object to which
   the effect is attached, a set of texture coordinates must be generated
   for the contrast texture.  The function SetContrastTextureCoordinates was
   added to CharcoalEffect.

5. The constructor in Wm3CharcoalEffect.cpp is passed the contrast image.
   However, that image needs to be generated using the contrast exponent
   stored in the pixel shader.  The function GenerateContrastImage was added
   to CharcoalEffect to generate the contrast image, using the input image
   object for the storage.  Since you want the image to change when the
   contrast exponent is changed, a call to GenerateConstrastImage is made
   in the function SetContrastExponent.  The SetContrastExponent body was
   moved from Wm3CharcoalEffect.inl to Wm3CharcoalEffect.cpp.
