create3000 / x_ite

X_ITE X3D Browser, view and manipulate X3D and VRML scenes in HTML.
https://create3000.github.io/x_ite/
Other
67 stars 15 forks source link

Invalid asm.js: Invalid member of stdlib #121

Closed jamesleesaunders closed 1 year ago

jamesleesaunders commented 1 year ago

Describe the bug First of well done on the release of v8.1.0 and the shiny new website! Since v8+ I have started seeing the following warnings in console:

Chrome:
Invalid asm.js: Invalid member of stdlib Texturing3D.js:49

Firefox: 
asm.js type error: 'byteLength' is not a standard constant or typed array name [Texturing3D.js:13:373](https://create3000.github.io/code/x_ite/latest/assets/components/Texturing3D.js)
asm.js type error: Asm.js optimizer disabled because debugger is active

To Reproduce I am not sure if this is a fault of my d3-x3d code or not really an issue but to recreate visit: https://raw.githack.com/jamesleesaunders/d3-x3d/master/examples/X_ITE/chart/AreaChartMultiSeries.html

The same warnings can be seen across all charts: https://github.com/jamesleesaunders/d3-x3d#examples

Expected behavior No console warnings.

Desktop (please complete the following information): Welcome to X_ITE X3D Browser 8.1.0: Current Graphics Renderer Name: Google Inc. (Apple) ANGLE (Apple, Apple M1 Pro, OpenGL 4.1) WebGL version: WebGL 2.0 (OpenGL ES 3.0 Chromium)

Additional context This warning does not occur with previous versions (7.0.0) of x-ite, example: https://raw.githack.com/jamesleesaunders/d3-x3d/xite_bug/examples/X_ITE/chart/AreaChartMultiSeries.html (but there is a different error)

create3000 commented 1 year ago

This is caused when the Texturing3D component is loaded. Texturing3D has two dependencies CharLS and OpenJPEG, which are emscripten libraries, and these libraries generate the error. I still have no idea how to avoid the error, it is not critical, more an info.

But there is a way how to avoid loading the Texturing3D component. If you set a profile attribute to the X3D element, that does not include the Texturing3D component, then the error would not occur. See https://www.web3d.org/documents/specifications/19775-1/V4.0/index.html. I think profile Immersive of Interactive would be appropriate for the main cases. If you need additional components then add them to the header element.

Actually the profile attribute is required by the DTD, but if omitted profile Full is used in X_ITE. Which is not always what you want and load time of X_ITE is maximum.

jamesleesaunders commented 1 year ago

Great! Thanks for quick reply. I have now added profile = Interactive for default on d3-x3d Fixed by commit: https://github.com/jamesleesaunders/d3-x3d/commit/b0e02a7c723d62cae02575115b01188f8ee56adc

No more Testure warnings.

Adding this profile may help with performance and also when using d3-x3d with x3dom.js. Win win! Thanks!