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 :
- create points make line , draw these points sampling buffer.
- resolve sampling buffer.
- 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 :
- create smaller sampling fbo purpose of drawing lines last point current point. use 256x256 buffer.
- when drawing last point current point, use sampling buffer , resolve.
- draw sampling buffer current layer.
the result not bad, no more lag. problem setting appropriate transform, matrix, etc quite hard.
Comments
Post a Comment