opengl es - Reusing parts of the previous frame when drawing 2D with WebGL -
i'm using webgl similar image processing. draw single quad in orthoscopic projection, , perform processing in fragment shaders. there 2 steps, in first 1 original texture quad processed in fragment shader , written framebuffer, second step processes data final canvas.
the users can zoom , translate image. work smoothly, need hit 60 fps, or gets noticeably sluggish. no issue on desktop gpus, on mobile devices weaker hardware , higher resolutions gets problematic.
the translation case noticeable , problematic, user drags mouse pointer or finger on screen , image lagging behind. translation case theoretically reuse lot of data previous frame.
ideally i'd copy canvas last frame, translate x,y pixels, , whole image processing in fragment shaders on parts of canvas aren't covered translated previous canvas.
is there way in webgl?
if want access previous frame need draw texture attached framebuffer. draw texture canvas translated.
Comments
Post a Comment