Skip to content

How can i save very large webgl snapshots? #408

Answered by greggman
znw-test asked this question in Q&A
Discussion options

You must be logged in to vote

There are 3 limits to the size you can make.

  1. The max size of a texture which is different on every device/OS/browser which you can query with gl.getParamater(gl.MAX_TEXTURE_SIZE)
  2. The amount of memory you have. A 9248 × 6936 canvas would be at least 513meg because its 32bits per pixel (red, green, blue, alpha) and a canvas has 2 buffers, the buffer being displayed and the buffer being drawn to. So 9248 x 6936 x 4 x 2. But by default the canvas has a depth buffer so change that last 2 (for 2 buffers) to 3 (drawingbuffer, displaybuffer, depthbuffer). Then also by default the drawingbuffer is usually antialiased at 4x so it's really 9248 x 6936 x4 x(4+1+1) so you're asking for 1.5gig of memory

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@znw-test
Comment options

Answer selected by znw-test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants