Jump to content

Architecture advice requested

The Leftover

Recommended Posts

I am working a brand new application.  Not a game.  I am pushing Babylon in ways that may be unique.  I could really use some advice on high mesh-count situations.  Please!

Here is the deal.  I generate graphics about crime data on SVG.  WebGL can look a lot better but it is still kinda balky.  The first two images are Attempted Murder in San Francisco for the past three years.  What you cannot see in those images but can see in the next two (aggravated assault) is that the whole city is tiled in hexagons.  About 40K for San Francisco, more for Chicago.  All results are delivered by presenting color, opacity (and now elevation) in hexes. Image 5 shows increases and decreases of theft from Motor Vehicle between two six-month periods.

Right now, I create a scene as follows:
~ Generate individual meshes to correspond with all "visible" hexes
~ Pattern-match materials and merge the hexes down from 30K meshes to about 200.
~ Dispose of the unmerged meshes
~ Show the scene
~ Gradually dispose of the meshes

These unused meshes are consuming a lot of time.  Especially since, except for a handful that are not merged, none of them are shown to the user!  It would be conceptually far more ideal to create the hexagonal geometries and group them directly rather than creating meshes.  I lack the chops to do it but am reasonably sure it is possible.  I welcome advice, snippets or . . . consulting offers?

Screen Shot 2018-01-24 at 1.21.36 PM.png

Screen Shot 2018-01-24 at 1.21.24 PM.png

Screen Shot 2018-01-24 at 1.23.00 PM.png

Screen Shot 2018-01-24 at 1.22.48 PM.png

Screen Shot 2018-01-24 at 1.33.36 PM.png

Link to comment
Share on other sites

Uh.  Further note on the rules:  I realize I have not boiled this down to a code sample on the playground . . . or anywhere.  This may be too vague.  I will try another cut.

I can express what I want in (30K++) individual meshes.  I can merge those meshes down to fewer than 300.  When they are merged and the temporary meshes are disposed, then performance is pretty damn good and the presentation is too.  However, the current implementation takes far longer than is acceptable for my target audience; they hit a button and should see a graph after a bit.

The supposition behind post this is that I am taking the long way 'round.  I can further optimize creation, merging and disposal in the existing process . . . but I suspect that my core folly is that I am creating scads of full-fledged meshes, used only for their geometry.

For example, if there was a way to generate arrays for the Positions and Normals and Kinds without creating the Meshes themselves, that would streamline things immensely.  Anyway, that's all I got.


Link to comment
Share on other sites

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.

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.


  • Recently Browsing   0 members

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