Performance Difference between TIN and Regular Triangle Mesh

hi all,

Recently I am trying to rendering a large terrain (~400 km^2 with 5 metre resolution).

I used TIN (triangulated irregular network) to reduce number of vertices and faces (saves 10x).

I was expecting to have some performance gain in rendering TIN mesh in BJS. However, the opposite result was observed. On the left side is the regular grid with 7M vertices and right side with 600k. Even with such a big difference, higher FPS can be observed on the left side (28 vs 8).

Can anyone shed some light about the reason behind?

Sorry the original data is too big to upload in PG.

Many Thanks.

Hello and welcome abroad!
Are both representations using the same material?

Thanks carolhmj. Yes, they are using the same material.

Hmmm, that’s very interesting then :thinking: The only way I could imagine less vertices/indices needing more time was if the shader work was different, but they should have the same work if they’re using the same material… Just to confirm, it’s the standard material?
@Evgeni_Popov might have a better idea of what’s going on than me :slight_smile:

Would you have some live links so that we can have a better look? Having a GPU frame time 4x higher when you have 12x less triangles should not be possible (if the materials are the same in both cases)…

Thanks @carolhmj and @Evgeni_Popov .

Please find the two glb files below. They are not exactly the same due to different way to generate.
As so, their material is not exactly the same but i check manually and also assigned a default material to both, they do not make any performance difference statistically.

There is one difference may need to notice is the transformnode rotation. For the TIN mesh, there is one rotation applied to the parent transformnode. (Though it seems not relevant to the performance).

It seems there’s something wrong on your computer.

On my side (in the Sandbox), NG.glb shows a GPU frame time around 5.5ms, and TIN.glb around 2.5ms.

Are you able to test on different browsers?

Hello! It looks like you have more vertices in the left image so your triangles may not be welded. There are many other workflows for simplifying such as Blender, MeshLab and 3ds Max (re-topo tools).

Your files in MeshLab:

Edit: I think it’s performing correctly you have 14.3m faces in DEM and 1.3m in the “optimised” TIN. Maybe BJS isn’t displaying stats correctly?

I have been thinking about a new landscape tool for BJS but not seen any requests.

I’m also getting lower frame times on TIN vs NG. Tested on Edge.

@Evgeni_Popov Thanks. That’s interesting…

I tested Chrome (before is based on Edge) on the same Surface Pro 8. The fps result is similar (30 vs 10).

Then, I tested on my Mac Pro (M1 chip) in Safari. The result now become the same as both 30fps (not sure if it locks to 30fps on Mac though).

Is there any browser you specially suggest me to test?

Thanks @j-te .

The normal grid mesh simply uses regular grid to create triangles, thus lots of triangles (but not about welding).

BJS should display it correctly, as I can feel the lag-ish through the mouse.

I am getting high fps on each model but maybe you can test this which has been imported into 3ds, re-topo’d, xform’d and materials & textures removed: TIN_3ds.glb » Sendit

May have to switch the WebGL/check GPU rendering.

1 Like

Thanks @j-te .

When opened your glb file in BJS, i received similar fps as the original TIN model.