## Code Excerpt for Texture Model TurbulenceRidge

    Scalar Persistence; // in [0 .. 1] stepsize 0.05
    Scalar Offset;   // in [0 .. 1] stepsize 0.05
    Scalar Stretch;     // in [0 .. 1] stepsize 0.1

    void TextureTurbulenceRidge::setupParameter(const std::vector<Scalar> &parameter){

        persistence_ = Persistence*3;
        offset_ = Offset;
        stretch_ = Stretch;

    }

    // this texture produces values outside the 0 and 1 range,
    // which will be normalized in the renderImage call
    Scalar TextureTurbulenceRidge::evaluate(const Scalar &x, const Scalar &y){

      Scalar amplitude, value = 0.;
      Scalar f = 1.;

      for(int i = 0; i < 6; i++) {
        f = pow(2.0,i);
        amplitude = pow(persistence_,i);
        value += ridge( ((perlin_.noise((1-stretch_)*f*x,f*y, 0.2)/(Scalar) f)*amplitude), offset_);
      }

      return value;

    }