Jump to content

Perf on mobile


GameMonetize
 Share

Recommended Posts

Link to comment
Share on other sites

Ok, I understand better the differences between 3js and bjs on this topic : 3js doesn't use indices. So I guess they duplicate some vertices from a geometry before passing it to the GPU.

This could explain why they have less light artifact on surface edges as they could appear : http://www.html5gamedevs.com/topic/17040-the-mystery-of-computenormals/?hl=mystery

In the other side, our computeNormals() method should be far more faster (less data to iterate on, direct access with the indices) and can be easily used to dynamically morph shapes.

 

@DK :

1 ) does convertToUnIndexedMesh() add some vertices in the positions array, a bit like convertToFlatShadded() does ?

2) I just read the nex doc "Optimizing your scene" what is really great.

 

Usually, a lambda BJS user has no idea about the geometry of the mesh he is using, so when would you suggest him to convert a mesh to unindexed ? 

And when not to do it ?

 

Maybe the user could just test if he feels some lack of performance. This is not simple because he may not have every kind of devices to test.

Link to comment
Share on other sites

 

Usually, a lambda BJS user has no idea about the geometry of the mesh he is using, so when would you suggest him to convert a mesh to unindexed ? 

And when not to do it ?

 

Maybe the user could just test if he feels some lack of performance. This is not simple because he may not have every kind of devices to test.

 

That's right. And also in real prod, scenes contains tons of meshes, would be a tedious process to check performance gain for a user who don't understand the concept, which one to convert, which one to keep ?...

 

It's the same for the shader optimisation section in fact. What is an "immutable" material ?

Link to comment
Share on other sites

@Jerome: does convertToUnIndexedMesh() add some vertices in the positions array, a bit like convertToFlatShadded() does ? Yes this is the process, flatten the indices into geometry buffers

 

@Vousk: the question is almost impossible to answer because it depends on GPU processing power. I would say that most of the time using indices is the best option (hence this is the default bjs behavior)

 

AN immutable material is a material frozen, locked. You cannot change a single property.

Link to comment
Share on other sites

@DK :

Something I don't really get ...

When Markus used instances instead of standard boxes, he got a big improvement, but this improvement wasn't really noticeable when he switched to UnIndexedMesh, according to the previous posts.

 

On my side, on my old laptop, when I used the SPS versus standard boxes, I got a huge improvement as expected because it's one draw call instead of 1000. It could even manage almost 2000 boxes at 60 fps 

If I used UnIndexedMesh boxes instead the standard boxes, there was still an improvement but not that big : bjs was then just at the same speed than 3js... around 50 fps for 1000 boxes/instances on my old laptop. This was important, because bjs, for thuis very scene, multiplied its speed by two on my machine and reached the 3js perf, but it was still lower than the SPS. 

 

The SPS is an indexed mesh. What I mean is that there are as many vertices and indices in the SPS with 1000 boxes than in 1000 individual boxes, only the number of draw calls differs.

 

So, I'm wondering if the indexed/unindexed stuff was the only reason about the initial performance difference ? 

Or is there another lead to dig in ?

Link to comment
Share on other sites

@DK :

Something I don't really get ...

When Markus used instances instead of standard boxes, he got a big improvement, but this improvement wasn't really noticeable when he switched to UnIndexedMesh, according to the previous posts.

 

On my side, on my old laptop, when I used the SPS versus standard boxes, I got a huge improvement as expected because it's one draw call instead of 1000. It could even manage almost 2000 boxes at 60 fps 

If I used UnIndexedMesh boxes instead the standard boxes, there was still an improvement but not that big : bjs was then just at the same speed than 3js... around 50 fps for 1000 boxes/instances on my old laptop. This was important, because bjs, for thuis very scene, multiplied its speed by two on my machine and reached the 3js perf, but it was still lower than the SPS. 

 

The SPS is an indexed mesh. What I mean is that there are as many vertices and indices in the SPS with 1000 boxes than in 1000 individual boxes, only the number of draw calls differs.

 

So, I'm wondering if the indexed/unindexed stuff was the only reason about the initial performance difference ? 

Or is there another lead to dig in ?

 

The initial performance difference reason was that the 3Js demo didn't use specular color. And material.freeze() gave some fps more.

Link to comment
Share on other sites

ok,

But regarding the perfs on my own old laptop, the gain was 100% for the initial bjs demo by adding material.freeze() and UnindexedMesh.

This bjs demo reached then the same perfs than 3js.

 

If I use a SPS (so one mesh instead 1000) with no other optimization (material or indexes), the gain overtakes widely the 3js perfs from the initial specifications.

 

I understand that the material freezing and the no-index method give some improvement for this very scene, but I notice that a not optimized mesh (single draw call) gives more gain. That's why I'm wondering if the index vs array, or material check vs no-check, is the only lead to dig in to get still better perfs.

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.

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...