ios - Multisampling for drawing app -


i'm creating drawing ios application, , in need of smoothing lines being drawn user. i'm using multisampling normal.

for each time user moves finger, code :

  1. create points make line , draw these points sampling buffer.
  2. resolve sampling buffer.
  3. the result buffer drawn canvas.

the problem when user have big canvas (e.g: 2048x2048), resolve process takes quite time it's causing drawing lag/choppy. resolve process resolve pixels in buffer, regardless whether pixels needs resolved or not.

i saw drawing app procreate, , draws smoothly no lag big canvas.

so, possible, don't know how that.

does have idea solution?

thanks.

just in case has same problem me, found decent solution :

  1. create smaller sampling fbo purpose of drawing lines last point current point. use 256x256 buffer.
  2. when drawing last point current point, use sampling buffer , resolve.
  3. draw sampling buffer current layer.

the result not bad, no more lag. problem setting appropriate transform, matrix, etc quite hard.


Comments

Popular posts from this blog

Unable to remove the www from url on https using .htaccess -