nasser / zajal

Experimental creative coding framework
MIT License
161 stars 10 forks source link

Better smoothing with FBOs #44

Open nasser opened 13 years ago

nasser commented 13 years ago

Get rid of code like this


  if(_zj_smoothing == Qtrue && _zj_fill == Qtrue) {
    /*  smoothing is on and the rectangle was filled. draw a smooth outline. */
    ofNoFill();
    ofRect(NUM2DBL(x1), NUM2DBL(y1), NUM2DBL(w), NUM2DBL(h));
    ofFill();

  }

and use FBO multisampling to implement smoothing. render everything to an FBO and then draw that to the window. the smoothing method will control the number of samples in the FBO.

nasser commented 13 years ago

Possible syntax:

smoothing false # sets FBO's samples to 0
smoothing true # sets FBO's samples to maximum i.e. ofFbo::maxSamples()
smoothing 4 # sets FBO's samples to 4
smoothing 5 # sets FBO's samples to 5
smoothing 6 # sets FBO's samples to 6
nasser commented 12 years ago

If this can get in for 0.4.0, that's great. But it shouldn't hold things up.