## Code Excerpt for Texture Model WoodPlanks

    Scalar BrickX; // in [0 .. 1] stepsize 0.01
    Scalar BrickY; // in [0 .. 1] stepsize 0.01
    Scalar Shift;  // in [0 .. 2] stepsize 1

    PatternBrick brick;
    NoisePerlin perlin;

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

        width_ = 0.05 + (BrickX * 0.55);

        if(BrickX>=0.5) height_ = 0.05 + (BrickY * 0.255);
        else height_ = 0.05 + (BrickY * 0.55);

        Scalar mortar = max(width_ * height_ / 28.0, 0.008);
        Scalar shift = 0;
        if( floor(RingSize) == 1) {
            shift = 0.5;
        }
        else if(floor(Shift) == 2)
        {
            shift = 0;
            width_ = 2.0;
            height_ = 0.05 + (BrickY * 0.2);
        }

        brick.setupParameter(width_, height_, mortar, shift,
                             //add fake shadow, shift noise and noise
                             1,1,0 );

    }

    Scalar TextureWoodPlanks::evaluate(const Scalar &x_norm, const Scalar &y_norm){

        Scalar value = 0.0;
        Scalar brick_pattern = brick.evaluate(x_norm, y_norm);
        Scalar streaks = 0.0;

        if(width_>height_){
            streaks = perlin.noiseNormalized((x_norm+brick_.x_brick_index_),
                                             (y_norm+brick_.y_brick_index_) * settings_.resolution_y * 0.7 * (1 - height_*0.5),
                                             0.2)*1.4;
        }else{
            streaks = perlin.noiseNormalized((x_norm+brick_.x_brick_index_) * settings_.resolution_x * 0.7 * (1 - width_*0.5),
                                             y_norm+brick_.y_brick_index_,
                                             0.2)*1.4;
        }

        Scalar grain = perlin.noiseNormalized(x_norm * 120, y_norm * 260, 0.2) * 0.5 ;
        Scalar wood = grain * streaks;

        value =  brick_pattern - wood;

        return value;
    }