Ravi Gidwani
Ravi Gidwani

Reputation: 308

threejs: optimize vertices and faces

We are using threejs to develop some 3D scenes in WebGL. We often find ourselves with geometries that have vertices in 5/6 figures (say anywhere between 50K to 200K vertices). The thing is these geometries are built using primitive threejs geometries (e.g Spheres and TubeGeometry). So my question is are there know techniques that can be applied to reduced the number of vertices but still maintaining reasonable quality in geometries? Here are couple of examples geometries as a example.

  1. A merged geometry of 30/35 spheres e.g with THREE.SphereGeometry( 30, 13, 13 );
  2. A grid of TubeGeometries forming cloth like structure. something like the image below: cloth

I am hoping threejs (or experts working with 3D engine like Unity) can provide some inputs on ways to reduce vertices on these geometries.

Upvotes: 2

Views: 1133

Answers (1)

bjorke
bjorke

Reputation: 3305

Is you problem fill rate or total memory?

If it is fill rate, you will see faster rendering at smaller sizes. If it's CPU memory, smaller sizes will be about the same.

If fill rate, how much depth complexity do you have (# of primitives that share the same pixel)? If it's high, sorting your primitives using renderOrder so that they render nearest-to-furthest should help reduce frame times.

Upvotes: 2

Related Questions