[x3d-public] loading X3DOM and X_ITE on same page. Conflicts with frame buffers? [was: RE: JSON parser]
John Carlson
yottzumm at gmail.com
Sat Mar 17 17:57:24 PDT 2018
Note that X3DOM has some errors that I think Andreas has proposed a patch for at a previous time. Perhaps we can get a patch into the dev branch?
I am not sure what the effect of fixing these would be, but we could try?
Note that I can’t get X_ITE to error out with only X_ITE canvases.
Can we get some coordination, Perhaps? Or at least stop chewing up WebGL contexts when there’s only 4 canvases on a page where the world or DOM is being replaced? Is there a better Browser API for x3dom?
I’m not saying my code is perfect, or that I’ve even read the documentation. Mostly this is guesswork and looking and examples on my part.
Thanks,
John
Uncaught TypeError: Cannot read property 'position' of undefined
at Context.x3dom.gfx_webgl.Context.shutdown (x3dom-full.debug.js:28115)
at x3dom.X3DDocument.shutdown (x3dom-full.debug.js:13211)
at Element.onNodeRemoved (x3dom-full.debug.js:12736)
at Ie (jquery-3.3.1.min.js:2)
at w.fn.init.remove (jquery-3.3.1.min.js:2)
at loaderJQuery.js:410
at X3DJSONLD.js:550
at doValidate (loaderJQuery.js:698)
at Object.success (loaderJQuery.js:736)
at u (jquery-3.3.1.min.js:2)
x3dom-full.debug.js:28115 Uncaught TypeError: Cannot read property 'position' of undefined
at Context.x3dom.gfx_webgl.Context.shutdown (x3dom-full.debug.js:28115)
at x3dom.X3DDocument.shutdown (x3dom-full.debug.js:13211)
at HTMLUnknownElement.onNodeRemoved (x3dom-full.debug.js:12736)
at loadXmlBrowsers (loaderJQuery.js:85)
at loaderJQuery.js:282
at loaderJQuery.js:419
at X3DJSONLD.js:550
at doValidate (loaderJQuery.js:698)
at Object.success (loaderJQuery.js:736)
at u (jquery-3.3.1.min.js:2)
Sent from Mail for Windows 10
From: John Carlson
Sent: Saturday, March 17, 2018 8:31 PM
To: Holger Seelig; x3d-public at web3d.org; Andreas Plesch
Subject: loading X3DOM and X_ITE on same page. Conflicts with frame buffers? [was: RE: JSON parser]
Okay, I have a smaller example here:
https://coderextreme.net/X3DJSONLD/src/main/html/flipper2.html
(press the Load button several times…it might be in the lower left corner.)
X_ITE seems to bail out here:
x_ite.js:77145 Error: Couldn't create frame buffer.
at new DepthBuffer (x_ite.js:51297)
at Layer.X3DRenderObject (x_ite.js:77141)
at Layer.X3DLayerNode [as constructor] (x_ite.js:80092)
at new Layer (x_ite.js:80560)
at new LayerSet (x_ite.js:80674)
at new World (x_ite.js:80897)
at X3DBrowser.setExecutionContext (x_ite.js:81220)
at X3DBrowser.replaceWorld (x_ite.js:114277)
at loaderJQuery.js:222
at fire (x_ite.js:5425)
Any ideas? Ideally, it would reuse the DepthBuffer of the old world, I would hope. Not really sure though.
John
Sent from Mail for Windows 10
From: John Carlson
Sent: Saturday, March 17, 2018 8:09 PM
To: Holger Seelig
Subject: RE: JSON parser
I’ve tried duplicating with 2 canvases and XML and JS loaders without success. Will try full X3DOM and X_ITE next.
John
Sent from Mail for Windows 10
From: John Carlson
Sent: Saturday, March 17, 2018 7:54 PM
To: Holger Seelig
Subject: RE: JSON parser
Holger, have you tried these APIs with more than 16 or so invocations…enough to fill the number of WebGL contexts? On a single web page? I start getting black canvases as I reload 2 different browser canvases with different worlds. This applied to previous versions of X_ITE and Cobweb as well.
See: https://coderextreme.net/X3DJSONLD/src/main/html/index.html (select 5 or so items from the pulldown in succession).
This would be a great boon to my development if we could solve this. I wouldn’t have to reload the page. It’s getting to the point with EXI, etc. that I am running out of WebGL contexts rapidly, I think, and X_ITE or X3DOM should reclaim them (it looks like X3DOM does, but not sure if it gives them to X_ITE).
Or whatever is going on. Please advise if you’ve seen it before with these APIs.
Thanks,
John
Sent from Mail for Windows 10
From: Holger Seelig
Sent: Wednesday, March 14, 2018 1:36 PM
To: John Carlson
Subject: Re: JSON parser
Thank you for your mail,
I created a test page which will test all three cases following your
examles. The page works well in Chrome and Firefox and will also work in
Edge.
Have also tested your JSON loader with some special files (PROTO, IMPORT
EXPORT ...) and everything is fine.
Best regards,
Holger
Am 04.03.2018 um 13:52 schrieb John Carlson:
> These are my interfaces to X_ITE from JavaScript. At least 2 of these
> get stuck loading. As far as I know, these work with 4.1.3.
>
> John
>
> function load_X_ITE_XML(content) {
>
> X3D(function() {
>
> var browser = X3D.getBrowser("#x_itexml");
>
> browser.replaceWorld(browser.createX3DFromString(content));
>
> }, function() {
>
> alert("Failed to render XML to X_ITE");
>
> });
>
> }
>
> function load_X_ITE_DOM(element, browserSelector) {
>
> X3D(function() {
>
> if (typeof X3D.getBrowser !== 'undefined') {
>
> var browser = X3D.getBrowser("#x_itedom");
>
> if (typeof browser !== 'undefined' && typeof
> browser.importDocument !== 'undefined') {
>
> var importedScene =
> browser.importDocument(element);
>
> browser.replaceWorld(importedScene);
>
> }
>
> }
>
> }, function() {
>
> alert("Failed to render DOM to X_ITE");
>
> });
>
> }
>
> function load_X_ITE_JS(jsobj, browserSelector) {
>
> X3D(function() {
>
> if (typeof X3D.getBrowser !== 'undefined') {
>
> var browser = X3D.getBrowser("#x_itejson");
>
> if (typeof browser !== 'undefined' && typeof
> browser.importJS !== 'undefined') {
>
> var importedScene =
> browser.importJS(jsobj);
>
> browser.replaceWorld(importedScene);
>
> }
>
> }
>
> }, function() {
>
> alert("Failed to render JSON to X_ITE");
>
> });
>
> }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20180317/3ed396b4/attachment-0001.html>
More information about the x3d-public
mailing list