[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?

John,

Good questions. 

My reading: 
https://www.khronos.org/registry/webgl/specs/1.0/#5.5
https://www.khronos.org/opengles/sdk/docs/man/xhtml/glBindFramebuffer.xml
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 

-Doug
https://www.khronos.org/registry/webgl/specs/1.0/#5.5
https://www.khronos.org/opengles/sdk/docs/man/xhtml/glBindFramebuffer.xml 		 	   		  


More information about the x3d-public mailing list