[x3d-public] Bad rendering of JSON SimpleShader in X_ITE -- Also Bug in X3DOMProtoExpander.

John Carlson yottzumm at gmail.com
Tue May 22 14:57:14 PDT 2018


When I got rid of the space leading into data:text/string in the Cobweb shaders, the XML rendered properly.   So it’s the leading space generate either by the XML -> JSON translation (DOM2JSONSerializer.js) or the JSON -> DOM -> XML which is preventing the XML from rendering. I will switch to X3dToJson.xslt and see if that fixes it.

John
Sent from Mail for Windows 10

From: John Carlson
Sent: Tuesday, May 22, 2018 5:30 PM
To: Don Brutzman; Andreas Plesch; holger.seelig at yahoo.de; X3D Graphics public mailing list; x3dom mlist
Subject: RE: Bad rendering of JSON SimpleShader in X_ITE -- Also Bug in X3DOMProtoExpander.

Probably it’s not passing schema in X3DJSONLD because of the ProtoExpander.  The ProtoExpander does not exist in X_ITE to my knowledge (but it may have it’s own version).

When I turn off the proto expander in X3DJSONLD, and the schema does not report an error.  The shader only takes affect in XML when I load XML.  When I turn off the proto expander in X3DJSONLD, the JSON still does not render properly in X_ITE (as evidenced by the previous collection of files I submitted).

The online validator reports no error with the non-proto expanded JSON.

Attached is the expanded JSON and schema errors.

The schema error seems to surround:

                            "@decis": [
                              0.95,
                              0.44,
                              0.22
                            ],

Which should be an @value on the field, so the schema error is definitely an issue with the ProtoExpander.   This may affect and likely does affect X3DOM.

I doubt if this will shed light on the X_ITE bug, except to indicate the error is NOT in the XML parser, to my knowledge.

I still don’t know why the non-proto expanded JSON does not render properly in X_ITE.  I have just figured out another bug.

I believe the ProtoExpander error stems from IS and wanting to fill in an attribute somewhere, but I’m not really sure yet.  I will have to check to see if the target (proto?) field is an attribute or a field, I think.  Hmm.

This is probably why I had to get rid of the Proto in X3DOM, the first version of the shader I released for X3DOM.

John

Sent from Mail for Windows 10

From: John Carlson
Sent: Tuesday, May 22, 2018 4:51 PM
To: Don Brutzman; Andreas Plesch; holger.seelig at yahoo.de
Subject: RE: Bad rendering of JSON SimpleShader in X_ITE

Note that SimpleShader.json does not pass schema with X3DJSONLD, but does pass schema with my other tools.  Hmm.

You may want to try to validate against your own schema.  I will try against my online validator.

John

Sent from Mail for Windows 10

From: John Carlson
Sent: Tuesday, May 22, 2018 4:36 PM
To: Don Brutzman; Andreas Plesch; holger.seelig at yahoo.de
Subject: Bad rendering of JSON SimpleShader in X_ITE

Don, I’m not sure if this is a translation issue or an X_ITE issue that the JSON displays just as Material, and doesn’t use the shader.  I thought you would like to be informed.  I tried bringing the “data:text/plain;” to be start of the source text without any change to the rendering, but you may have better luck.

You’ll need to remove ../data/ twice in the xhtml.

This should be the original SimpleShader.x3d from sourceforge.

It might be with data:text/plain, we have to put the entire CDATA section inside a single string in JSON?  I don’t know yet.

Or maybe just remove the data:text/plain.  I will try that next.
John

Sent from Mail for Windows 10

From: John Carlson
Sent: Tuesday, May 22, 2018 4:20 PM
To: holger.seelig at yahoo.de; Andreas Plesch
Subject: RE: [x3dom/x3dom] Full patch from coderextreme/x3dom.IncludesJSONloading, protoexpander, inline changes, and field changes (#844)

Okay, it looks like there’s an issue with the JSONParser and X_ITE and X3DJSONLD, possibly.  See attached x_itesimpleshader.xhtml for differences between JSON and XML versions.  I haven’t done any debugging yet, there’s probably something on the console, like parsing a data URL (the shader).

Here is the original X3D and converted JSON.

John

Sent from Mail for Windows 10

From: John Carlson
Sent: Tuesday, May 22, 2018 3:59 PM
To: Andreas Plesch
Subject: Re: [x3dom/x3dom] Full patch from coderextreme/x3dom. IncludesJSONloading, protoexpander, inline changes, and field changes (#844)

Oh, okay.   I guess x_ite was falling back to material in some cases with X3DJSONLD.  Before I started mucking with the Proto from the original.
On Tue, May 22, 2018, 3:53 PM Andreas Plesch <andreasplesch at gmail.com> wrote:
Thanks, the screenshot came through.

But it looks like BSContact does not understand or use the ComposedShader at all. It just falls back to the Material. I think it has a console ?


On Tue, May 22, 2018 at 3:25 PM, John Carlson <yottzumm at gmail.com> wrote:
Hopefully this BS contact example makes it.

---------- Forwarded message ---------
From: John Carlson <yottzumm at gmail.com>
Date: Tue, May 22, 2018, 10:13 AM
Subject: RE: [x3dom/x3dom] Full patch from coderextreme/x3dom. Includes JSONloading, protoexpander, inline changes, and field changes (#844)
To: x3dom/x3dom <reply+000ac4f78369c959aaa1022cea58689148651aac125ae7a492cf00000001171b6f7792a169ce1351f190 at reply.github.com>, x3dom/x3dom <x3dom at noreply.github.com>
Cc: Author <author at noreply.github.com>

Here it is in BS Contact:  
 
Sent from Mail for Windows 10
 
From: Andreas Plesch
Sent: Tuesday, May 22, 2018 1:41 AM
To: x3dom/x3dom
Cc: John Carlson; Author
Subject: Re: [x3dom/x3dom] Full patch from coderextreme/x3dom. Includes JSONloading, protoexpander, inline changes, and field changes (#844)
 
https://rawgit.com/andreasplesch/x3dom/inlineShader/doc/x3doc/base/tutorials/lighting/customShader/example.html
is the tutorial example.
Here is the simpleShader.x3d for x3dom:
https://rawgit.com/andreasplesch/x3dom/inlineShader/test/regression-suite/test/cases/composedShader/inlineShader.xhtml
Do you know how it is supposed to look like ? light0 is probably the headlight.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
 




-- 
Andreas Plesch
Waltham, MA 02453





-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20180522/b4ac4754/attachment-0001.html>


More information about the x3d-public mailing list