[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Public WebGL] off-line opengl render?

I wrote something to render print resolution images with WebGL a while ago. Its hacky and extremely ugly but it served the purpose.

1.click on the "stop" link at the top to pause animation
2.enter captureCanvas(10240,10240,1024);

The result will be a 10K image rendered as 1K buckets. Most time is spent in jpeg encoding and everything is stored in DOM elements. Did I mention its ugly? :)

The bucket division and rendering logic is here:

I'm using Vlad's mjs library for projection matrices and I added a custom perspective projector with frustum offsets for the buckets:

Aleksandar Rodić
+1 510 761 5522

On Tue, Jun 19, 2012 at 10:20 AM, Florian Bösch <pyalot@gmail.com> wrote:
On Tue, Jun 19, 2012 at 12:31 PM, Tom Sparks <tom_a_sparks@yahoo.com.au> wrote:
I don't know if my local webgl runtime can deal with large images, but then there are limitation with url length
 All WebGL implementations support 2048x2048 and most (91%) support 4096x4096.
You don't need dataURL, you can obtain the image rendered if you attach a texture to an FBO and perform a readPixels from the FBO, you will get a typed Uint8Array back.
Upload to your server can be done with XHR2 that can transmit binary data, so no expensive conversion to base64 or the like required.