## Code Excerpt for Texture Model WoodLines

    Scalar RingNo; // in [0 .. 1] stepsize 0.1
    Scalar Seed;   // in [0 .. 1] stepsize 0.1

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

        ring_no_ = 4 + RingNo*66;
        rings_alpha_ = 0.86;
        streaks_alpha_ = 0.4;
        grain_alpha_ = 0.22;
        shiftx_ = Seed*100;

    }

    Scalar TextureWoodLines::evaluate(const Scalar &x, const Scalar &y){

        Scalar value = 0.0;

        Scalar x_shift = x + shiftx_;
        Scalar rings_noise_straight = noise(0.8*x_shift, y*0.0, 0.2);
        Scalar tmp_straight = rings_noise_straight*ring_no_*1.1;
        Scalar rings_straight = tmp_straight - int(tmp_straight);

        rings_straight = fabs(rings_straight);

        // make the plank edges softer
        Scalar max = 0.9;
        if(rings_straight>=max){
            rings_straight=(1-smoothStep(rings_straight, max,1))*max; // smooth step from max to 0
        }

        Scalar streaks = noise(x* 40, y , 0.2);
        Scalar grain = noise(x * 160, y * 120, 0.2);

        // all
        value = rings_alpha_*rings_straight +streaks_alpha_*streaks + grain_alpha_*grain;
        return value;

    }