Material Parameters

Usefull modifiable parameters are :

Fonction<Intensity> *Diffuse;
Fonction<Intensity> *Specular;
Fonction<Real> *Hardness;
Fonction<Real> *Reflection;
Fonction<Real> *Refraction;
Intensity Attenuation;
Intensity Ambient;
Real Ior;
bool Fresnel;  // true will make use of Fresnel's reflection/refraction model
Intensity Density;
Intensity VolumicColor; 

You just access them with these methods :

setDiffuse(Intensity&)  or  setDiffuse(Real, Real, Real)  or  setDiffuse(Fonction&)
  (idem for specular)
setHardness(Real&)  or  setHardness(Fonction&)
setReflection(Real&)  or  setReflection(Fonction&)
setRefraction(Real&)  or  setRefraction(Fonction&)
setAttenuation(Intensity)
setAmbient(Intensity)  or  setAmbient(Real, Real, Real)
setIor(Real)
setFresnel(bool)
setDensity(Intensity)
setVolumicColor(Intensity) // no, you can't do any volumic rendering with this because it it a single color, not a function 

You can write your own subclass of Fonction<Real> or Fonction<Intensity> to use your own functions.

Example of a constant function you could use for diffuse color :

class ConstantIntensity : public Fonction<Intensity> {
public:
	ConstantIntensity(Intensity i) : cst(i) {}
	
	Intensity f(Real x, Real y, Real z) const {
       return cst; // or whatever function of (x,y,z)
    }

	bool is3D() const { return true; }

	Fonction<Intensity>* clone() const { return new ConstantIntensity(*this); }

private:
	Intensity cst;
};

These are the only methods you must redefine from Fonction<xxx>. This example is for a volumic texture; now if you still want to create your own surfacic texture, just make is3D() return false and write method f(Real u, Real v).

Note that when using volumic textures, the coordinates passed to your function are in World coordinates; while with a surfacic texture, you get the surfacic coordinates on the object.