Jump to content

Data Visualization Authoring Tool


JBatUN
 Share

Recommended Posts

@kcoley  Sorry if I'm being a pain!

I'll try to explain as best I can as I understand how difficult it can be to try to troubleshoot something without all the information.  As mentioned before, the vertex color is data driven from the sps creation process.  The material is part of the authoring process where I've incorporated virtually all materials and properties.  You can see in the attached an example where parameters are set for PBR Metallic Roughness.  Unless a base texture is set, the colors are retained and the textures are used for effect.  This is applied to the geometry before the sps init function.

From what I can tell from the export, the color shader data is included - if I work in Babylon editor and I manually set the material to colorShader the colors do show up.  The data points otherwise render as black.  The platform (ground) material properties are not carried over either.  None of the parameters set for the material are included in the export.  I've attached a screen shot for what is seen in editor to see the difference.

Hope this helps.

JB

Cambro.png

Editor.png

Editor-colorShader.png

Link to comment
Share on other sites

@JBatUN no problem!  Thanks, this does provide more info.  It seems you are using Babylon's Solid Particle System, which I will need to add support for.  I am reading up on it to see what changes I'll have to make to support it.  I'll update once I get a sense of an ETA for the feature!

 

As for the ground, I suspect it is another material that I have not supported in export. I currently support StandardMaterial, PBRMaterial, PbrMetallicRoughnessMaterial and PbrSpecularGlossinessMaterial.  Is it a different material than the ones I have listed?

Link to comment
Share on other sites

@kcoley  If you have any questions please don't hesitate - happy to share any info I can that would be helpful.  I can produce a .babylon file of the scene if needed.

As for the ground, it's a plane with StandardMaterial texture.  What's odd is even the diffuse, specular, and emissive colors seem to be lost.  In editor I see a normal map is referenced, but it reads as undefined.  One problem may be because I do (as an option) apply a displacement map.  Otherwise the params are standard configuration of the material.

var path = getTexture( platOpts.texture );
platform.applyDisplacementMap(path+"Displacement.png", 0, 1.5);

Standing by if I can be of any assistance.

P.S. Although the GLB can be rendered in Babylon, Three, and ClayGL viewers, it will not import in Blender (could simply be an issue with the Blender export add-on).  I had to convert the GLB to OBJ to import.

It's a bit of a shame that khronos lists so many exporters but very few importers.

Thanks again and have a great weekend,

JB

Link to comment
Share on other sites

@JBatUNa .babylon file would be super helpful since I can directly see what doesn't export.  Strange that the StandardMaterial isn't exporting, so I'll take a closer look at the serializer to see if I have overlooked something.

 

Thanks!

Link to comment
Share on other sites

@kcoley I'm attaching a babylon file in case it helps.  Unfortunately I had to produce it from Babylon editor but unedited - so hopefully it is close to what I would produce natively from the application.   For some reason the usual serializer is not working for me (var serializedScene = BABYLON.SceneSerializer.Serialize( scene ) ...).

Thanks,

JB

 

 

sceneFile.babylon.zip

Link to comment
Share on other sites

@kcoley  I viewed the file in the Babylon sandbox and indeed it shows all the data and everything needed ... the lines and geometry with vertex colors.  That's pretty much all I need for the export since the values are all data generated.  The rest I can handle in Blender, etc...

This could be an issue of the other viewers or plug-ins but I'll share with you just in case it does relate to the serialization process.  The file you shared would not import into Blender or Three.js editor or ClayGL viewer.  In all cases there was an error.

When I export a new glb directly from my application, I import it to the Three.js editor, change the material for the boxes to basic, then the vertex colors show and I re-export to GLB (using the three.js serializer in the editor) - this GLB imports to Blender with no problem.

1.] Export GLB from Cambro

2.] View file:

-- Babylon Sandbox - Good

-- Blender: Error

-- Three.js Editor:  Good, with change to Basic Shader and Use Vertex Colors

3.] Import to Blender

-- Export from Three.js editor to new GLB

-- Import to Blender:  Good

In short, for some reason the GLB output from Babylon will not import to blender but the from three.js it will.

Cheers,

JB

Link to comment
Share on other sites

Hi @JBatUN, I tested the generated glb against threeJS and it does seem like there is an issue during export, according to the glTF validator.  I am looking into this now, as it is related to how I am exporting line meshes.  I will send you an updated model that you can verify against ASAP.

Thanks!

Link to comment
Share on other sites

@kcoley  Thanks!!!  Your efforts are very much appreciated.  I've been testing a lot with Blender to see if I could find the specific issues.  Just to be clear, here are the results:

- Export GLB from my app ...

-- Import to Blender -> fail

-- Test with Babylon Sandbox -> works no problem, vertex colors are rendered.

-- Export GLB from Babylon Sandbox and import to blender -> fail (same errors)

-- Test with Three.js editor -> imports, but shader has to be changed to Basic and vertex color on.

-- export GLB from three.js editor (with changes)  and import to blender - success

For now I've been using this quick work around to test blender rendering and everything has been perfect.  A simple test image (Blender Cycles Renderer) below of Global Cholera cases.

test.png.1bb91ffb640de0d0b8e42b745d95e8bb.png

As @Deltakosh mentioned, with all the moving parts here between my app and Blender, it could be either of the two.  I also recognize that this is probably not the usual workflow for most users. 

Again, thanks for all your efforts,

JB

Link to comment
Share on other sites

Hi @JBatUN no problem!

It looks like the .babylon file that you provided has some glDrawElements out of bounds issues, which can be viewed by dragging the file to the BabylonJS sandbox and viewing the output in a browser debugger (I checked in Chrome's debugger).  Specifically, during export to glTF, the index count of a submesh of a linesystem is greater than the actual number of indices in its mesh.  I was wondering if you are using submeshes in your tool in a special way?

As a test, I made a pass of the exporter where I did not export a submesh if its index count was greater than the number of indices in its main mesh, I would not export the indices and attached that file below.  

 

~Kacey

sceneFile.glb

Link to comment
Share on other sites

@kcoley  Your findings definitely gave me some clues to look for.  For the test view, there are basically 5 layers: a plane platform, map country borders (translated from geojson multiline string), map graticule, line based text labels, and a babylon primitive (e.g. box) generated from SPS.  I'm not knowingly using submeshes unless SPS is considered as such.  From your message I guessed the culprit would be the map, graticule or text labels (all line based) so I took a closer look at these.

I generated four output GLBs ... without labels, without map, and without the grid.  In each case the Blender import failed.  This was a surprise.  I then removed the SPS generated objects (box geometry) and it worked without errors.  For my usual work around I loaded the file in the Three.js editor, changed the SPS material to MESHBASIC and set Vertex Colors to Vertex.  The GLB file size changed from 1.09MB to 1.05MB but loads in Blender with no issue.  I tested the outputs from the Three.js editor with all the different materials thinking it was a blender issue - but all GLBs imported ok.  The reason I've been using Three for the re-export is I have the same problem when exporting from the sandbox.

This could be a Blender Importer issue.  And even more likely my code.  Thankfully the work around is enabling us to keep progressing since this summer we'll be producing possibly hundreds of publication outputs (print, video, interactive).  Without Babylon, none of it would be possible.  So I hope all your efforts are not because I've made a mistake somewhere!!!

Another BIG THANKS for your support and efforts,

JB

 

Link to comment
Share on other sites

  • 3 years later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...