Why do we need merge geometries ourselves?

I'm finally understanding the performance impact of merged geometries. I've noticed the GPU has draw calls for all shared geometries combined with materials (or perhaps its just the material count). My question is why are developers forced to figure out how to merge geometries when its clear that the three.js will just divide everything out of your merged geometry anyways?

I'm probably missing something.

Answers


It is difficult to make general statements about WebGLRenderer performance, because each use case is different.

But typically, performance will improve if the number of draw calls is reduced. If you have multiple meshes, and they all share the same material, then by merging the mesh geometries into a single geometry, you reduce the number of draw calls to one.

Remember, this approach makes sense only if your multiple meshes are static relative to each other, because once merged, they cannot be transformed independently.

And yes, it is true, that if your mesh has multiple materials, the the renderer will break the geometry up into smaller geometries -- one for each material -- prior to rendering.

Here is a useful tip: In the console, type renderer.info and inspect the resulting object returned. This will give you insight into what is going on behind the scenes.

You can also display renderer.info live on your screen by using this utility.

three.js r.68


Need Your Help

R Retrieve column name under condition in a matrix

r matrix condition

I have a matrix with 0 or 1 values. When a line has only one "1", I want to get in return the column name in which is the "1" value and in any other cases get "0". For the example below:

Grouping list of tuples in python

python list grouping itertools

I have a list that consist of tuples and I already sorted this list based on 2nd item. Then I want to make my list grouped

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.