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

Re: [Public WebGL] using the same context with multiple canvases

On Mon, Nov 12, 2012 at 12:16 PM, Mark Callow <callow.mark@artspark.co.jp> wrote:

On 2012/11/11 12:10, Gregg Tavares (社用) wrote:

This won't work for us. The problem we were trying to solve was being able to
use 1 context to render to multiple canvases. Each canvas is a different size.
The typical application that needs this is a 3D editor with multiple 3D views
each sizes by the user.

The reason we need 1 context to be able to write to all of those canvases
is because sharing GL resources brings with it a huge amount of state
issues. The solution was just being able to use the same context on mulitple
That is not a very good example. It is easily accomplished by changing the viewport on a single canvas. The only reason to use separate canvases would be if you wanted to separate the views and put other stuff between them. However I don't think that would be a very satisfactory UI experience.

Nearly every mainstream 3D lets you open multiple views in multiple windows. Just setting the viewport is not enough. Here's some examples

Maya (I suppose this one could be made if you required them to use no HTML5 for UI but that would be sad

Here's another


All my game dev friends use multiple monitors with Unity3D

There's even the case where you may just want to show textures and not want them in memory twice. 
If you can use the context to render to multiple canvas you can show that texture window using the same textures. No need to keep around img tags just to have that window.

Just changing the viewport on a single canvas would severely restrict what you can do. 


But that means each canvas has its own backingstore as each canvas
is a different size. We can't use a solution where the backing store is 
part of context, not the canvas.

You could use a single backing store the size of the larger canvas. You can reuse the auxiliary buffers in the same way.



注意:この電子メールには、株式会社エイチアイの機密情報が含まれている場合が有ります。正式なメール受信者では無い場合はメール複製、 再配信または情報の使用を固く禁じております。エラー、手違いでこのメールを受け取られましたら削除を行い配信者にご連絡をお願いいたし ます.

NOTE: This electronic mail message may contain confidential and privileged information from HI Corporation. If you are not the intended recipient, any disclosure, photocopying, distribution or use of the contents of the received information is prohibited. If you have received this e-mail in error, please notify the sender immediately and permanently delete this message and all related copies.