Texturing objects without UV - is there a reliable solution?

Hi,
In my work I have to texture (hundreds) meshes from CAD software. There’s no time for hand UVing or fixing the meshes so the only solution are:

  1. Fast UVing with select sharp edges>mark seam>unwrap
  2. Using box mapping
  3. Using triplanar materials (from Simon Thommes)

The problem is there’s always artifacts. Even if I decimate planar objects there’s still stretched texture. Is there a fast solution without being clunky or buggy?[blender-uv-stretched.blend|attachment]

blender-uv-stretched.blend (3.8 MB)

Those are related to the topology and the fact that your mesh is made of long, skinny triangles.

You’re using a tangent space normal map, so even in your triplanar/box mapped versions, your UV map is being used to create the tangent, and these long skinny triangles interpolate poorly, especially for determining tangents. (And really, you can’t use box mapping or triplanar projection on a tangent space normal map, it’s going to give you artifacts. Tangent space normal maps aren’t built for that. Really, you can’t even use your tangent space normal map with any arbitrary UV map. Your normal map isn’t built for that UV map.)

The first thing I would experiment with here is converting my normal maps to bump maps using a tool like njob ( http://charles.hollemeersch.net/njob/ ). Bump maps don’t need tangents and so can be safely box mapped, projection mapped. Yes, there’s a loss of precision involved, and they don’t handle magnification as well as tangent space normal maps. If the first is a problem, there should be some commercial tools that can create 16 bit bump maps (although I don’t know which, just guessing); if the second is a problem, you can bake from bump to a tangent space normal map appropriate to your own model.

In the case of this particular model, you could do triplanar and swizzle your normal map for use as an object space normal map instead, but that’s kind of involved math and you want to understand how normal maps work first. And, definitely not with any kind of blend or blur value.

1 Like

When I work from CAD exports, in edit mode I usually do: “select all - tris to quads followed by delete/dissolve limited”. For simple sheet metal parts like this I also make sure to suppress any small regular bevels (I keep chamfers) prior to export. Especially deburr bevels you might have added to make in-software renders look better. Such stuff on easy models are best to remake in Blender or just use the bevel node (Cycles). Complex bevels (likely not used on sheet metal parts) like face bevels, conical bevels, varying bevels, asymmetric bevels, and complex continuous bevels - these are hard to impossible to get (at least accurately) in Blender.

Using object coords (not UV space), normal maps that depict complete randomness like this one where up vs down doesn’t matter, works good enough as normal maps. This won’t “work” where up vs down matters, such as pressed diamond pattern.

Normal maps are better, more efficient, can hold more information, depicts angles accurately, and suffer less resolution problems. But they are mostly meant for game assets with proper UVs laid out, where the normals are either painted into the texture or baked from a high resolution mesh. Bump maps are way more forgiving to handle, as they don’t require UVs, and they also work with box mapping/triplanar mapping techniques in that dark is low, bright is high, and orientation doesn’t matter. It’s heavier to calculate for the renderer, because the normal modification have to be derived from the texture whereas in a normal map it just looks it up.

If you have problems with normals due to weird topology, sometimes you can get away with it using a Weighted Normal modifier or even just set annoying flat faces with erroneous shading to be flat shaded. Otherwise, or when working with curved surfaces, you’re gonna spend a lot of time cleaning up the mesh. There is no B-Rep rendering in Blender.

1 Like

Here is a tri-planar method that works well with bump maps. The method you’re using works well where color transitions doesn’t matter much, but for continuous bump maps these transitions cause sharp and very ugly bumps. It also has a texture mixer, which allows dense repeats of seamless textures (1k 8bit BW example included, created in Blender). Unpack it and use the image editor to replace the file rather than the image node.
blender-uv-stretched (2).blend (2.8 MB)

1 Like