[solved] generate smoothed UVs @runtime from .stl

i load a .stl file during runtime, now i’d like to have at least ‘some’ texture on the mesh so one can differentiate faces with the same orientation on different depths

see the problem here:

i already assigned a material, i have a few directional lights (red/green/blue tinted)
but i cannot see the ‘top-cap’ of the cylinders in front of the ‘floor’ in the ‘back’ (see image)

the material has an albedo-texture set, but i guess the mesh is missing UVs.

unity seems to have an unwrap facility builtin, can i make use of it @ ?

nvrmnd, found (and fixed) this code…:

now it looks like this:

getting them smooth is something different, my .stl reader doesnt deduplicate vertices yet, so i cannot easily calc the correct smoothed normals since one vertex always occurs in only one triange