[x3d-public] Using FBOs to render multiple x3d scenes to same webgl context?

doug sanden highaspirations at hotmail.com
Sat Oct 10 08:25:38 PDT 2015

> An FBO is an opengl thingy and analogous to the render targets model in
> directx. Paraphrase from
> https://en.m.wikipedia.org/wiki/Framebuffer_Object . What is available
> on the web in webgl? Can I use this to render several x3d scenes to
> the same webgl context (ignoring device input for now)? I'm running
> out of webgl contexts in chrome. How many FBOs can be bound to a
> context?


Good questions. 

My reading: 
for a single webgl context you can have either buffer=0 (default, screen backbuffer) or 1 FBO (buffer=int) bound. 
With FBO's you don't do swapbuffers. So you would initialize one, bind it, draw to it (draw calls are directed to the current bound buffer) then (somehow) use it as an image, then free it. then create and bind another fbo, ...
Or you could pre-create several fbos, then change the bound buffer (somehow) during draws. For example stereo drawing would need to do something like this - create 2 buffers, bind 1, (shift the viewpoint by half-eyebase_ draw, bind to second fbo, (shift viewpoint other way) draw, then present the 2 fbos somehow as images 


More information about the x3d-public mailing list