baking pointcloud vertex color onto low poly, uv ready models

Hello there,
I will quickly describe the situation: we have a big amount of pointcloud scans with vertex color, and want to turn this enormous amount of data into a real time ready environment to be visualized in browser via Unity3d. In order to do that, every building will be triangulated manually and optimized (retopo process).

We have tried by automatically triangulating the point cloud mesh in Meshlab in order to normally bake a color map, and it did work, allthou it is a step we would like to remove from the pipeline for two reasons. One, It is extremely time consuming to triangulate all these pointcloud just in order to bake the colormap, while the results are arbitrary, faulty and have normals in very erratic fashion. Also, the retopo process can and will be done using snap to vertex and not snap to faces, as snap to vertex is way more precise.

I was wondering if there is a way to bake color maps from pointcloud that basically only have vertices, and no edges and faces. We were thinking of something maybe related with the skin modifier.

Blender has no vertex colors, but Meshlab can apply Color from Point Cloud to mesh, if this helps anything?

Hey there, what do you mean with blender has no vertex color? Because it does have vertex colors… you can paint vertex color and we managed to triangulate a pointcloud file to mesh in meshlab, and when we imported it in blender it did show vertex colors and everything looked nice… but its time consuming and “”“useless”"" in the end, since we would like to skip that step.

what you brought up with the color in meshlab might be interesting, would be nice to see if meshlab can bake textures from point cloud, without triangulating anything

To bake anything to a texture you need the object to have UVs so blender knows where to apply the colour to the texture.
To have UVs the object needs to have faces. Therefore you cannot bake just vertex data

Thats what i mean - a single vertex in blender has no color data.

In meshlab there is a function to transfer color from point cloud to an existing mesh called “Vertex Attribute Transfer”.

I believe i explained myself a bit unaccurately-
We will have UVs on the low poly version of the houses (its about buildings), but we would like to “project” the vertex color as colored dots onto the lowpoly’s UV map in order to bake a color map. We would like to do that without having to run the pointcloud files through meshlab to triangulate them (randomly), which we did once, and it did display correctly, with vertex colors, alltough the topology and the normals were terrible. So thats why we would like to skip the (arbitrary) triangulation step and “bake” the vertex color to a new, clean and low polygonal mesh with UVs.
We were wondering if it is possible to bake a colormap inbetween the pointcloud file (only vertices with color) and a low polygonal mesh with triangles and UVs.

Have a look at Meshlab: Texture - Transfer Vertex Attributes to Texture(between 2 Meshes)

does exactly this.

Back in the day (well, a few weeks ago) mathutils.kdtree was added so you could use that to load up the pointcloud data and lookup the closest vert after (somehow) calculating the UV pixel positions in 3d space. At least that’s how I’d go about it…

works great, thanks bashi!

finally understood what you mean by “blender has no vertex color”.
Vertex color in Blender is stored per vertex per face. If the vertex is not connected to any face it’s not possible for it to have color. It can only have color information if it is connected to at least one face. So a pointcloud will loose it’s color information if it’s imported into blender.

Ah i see :wink: (I should have written something along those lines the first time…)