I am trying to optimize my crude procedural mesh voxel feature.
I have done these tests in blender:
edit: the picture
- Figure 1 has been semi-optimized for face count. V: 792 F: 198
- In Figure 2 I have simply shared(welding?) vertices between faces. V:2076 F:1446
- Figure 3 is the worst case, nothing done. V:5784 F:1446
- Figure 0 is the welded version of Figure 1 and has only 10% reduction.
(reducing the vertex count in figure one was too little to bother perhaps?)
Problem is I currently get stellar face count reduction but meager vertex count reduction…
Is it worth to reduce the vertex count even though the face count stays the same?
(or even possible with procedural mesh… )
If you’re trying to construct that procedurally then you can’t avoid the third option since there’s no other way to construct it. Main thing is to avoid draw calls, those are going to be low-poly so the poly count is going to be low.
I’m fairly sure that V: 792 F: 198 and V:2076 F:1446 means 46% reduction for V and 87% reduction for F (compared to method #2), not 10%.
Blender vertex count will be different from engine vertex count.
In blender single “vertex” can be used by multiple faces. So, if you make a box, you’ll have exactly 8 verts and 6 quads.
When that box is exported into game engine, vertices are split. Basically, vertices stay “the same” only if they share the same vertex color (if applies), same texture coordinates, same position and same normal.
So, when you export cube into game engine, you’ll get 24 vertices and 12 triangles.
Also, instead of turning voxels into polygons, I’d suggest to look into non-polygonal voxel rendering. Turning voxels into triangles kinda defeats the point.
See http://voxels.blogspot.com/ for info.
https://youtube.com/watch?v=ij0vw8yTCsYhttps://www.youtube.com/watch?v=U5yE-eaUjyk
The blender api says:
The vertices will be sharing position, normal and uv. (and probably color)
So welding should be possible.
This article says that vertex count is more important:
Problem is I get stellar face count reduction but meager vertex count reduction…
Also using an actual voxel engine would be way above my skills.
Meanwhile this is educational.
I will update the picture to clear up the 10% difference.
It doesn’t matter what blender api says. You’ll be exporting the mesh. After the export blender api doesn’t apply.
You may want to tell people what are you trying to achieve there.
Have you plugged the model into the engine and run into performance problems?
UE4 splits meshes to control smoothing, so if you have a cube then each side will be separated, so instead of 8 vertices you’d have 24. If they all have the same smoothing group applied then it would have 8 vertices since they wouldn’t need to be split.
But in any case, it would be better to have lower vertices, but for cube shapes the poly count is so low that it’s not a big deal, you just need to use Blueprints to control things so that you don’t have a lot of draw calls.