Procedural mesh cube with 24 vertices?

Hi guys,

I have been playing with procedural mesh lately. I have managed to build some nice meshes, but then I wanted to know how to generate UVs (and general idea of UVs) to give my shapes some pretty material.

So I went to some simple example and used “Generate Box Mesh” to create a box with UV’s already generated. I was very confused to see that Generate Box Mesh function will generate 24 vertices (vertices.lenght == 24).
To make a simple cube I would use only 8, can someone please explain me why is 24 vertices best for a cube?

Kind regards,

In UE4, it doesn’t use smoothing groups, instead, the whole mesh is smoothed together so the only way to prevent polygons from smoothing together is to split them apart. Since a cube is made from 6 sides, and each side has 4 vertices, 4x6=24

Thanks for the great explanation.

Make a plane, or runtime editable terrain.

I’ve made a 100x100 grid with 2000 vertices that would increase or decrease in z based on mouse location, left mouse click.

I was trying to get a grid that was 1,000,000 ish vertices (I.e nice smooth terrain) but **** it had a terrible performance hit and generating UV’s were a nightmare. Although the normal skylight made its dodgy vector parameter green (grass) look rather pretty.