Projecting decals to flat mesh with displacement

So I am in the process of projecting decals onto products in order to show what it would look like if it was printed for real.

This has worked pretty well as I’ve just used flat planes (I don’t have any models of the products or the capacity to create them, so I am just working with images and camera matching)

Where it doesn’t work great is when I have products like this one

in other words, where the decal would be displaced in the folds of the bag.

I am curious on a high level how one could make it look like the decal is following the folds?

I’ve considered creating a partial mesh for where the decal can be placed, but creating that manually is too much work to be feasible.

The other option is creating a displacement map, but then I again need to create it manually, as just grayscaling creates a weird result

This is a deceptively hard problem.

It can be made easier if you have control over how the meshes are authored. I.e. you UV map it so that the decal-able areas are laid out flat and contiguous in UV space, thus turning this into a 2d problem.

If this has to work with arbitrary assets, it’s kinda basically impossible.. and you will have to adjust your expectations with how well it conforms to the surface (i.e. use projective decals as you have been.)

1 Like

You are probably right.

I don’t have meshes to work on, and creating them for all the assets/images I have is not really feasible. So converting this to a 2D problem won’t work… Although I completely agree that this is the best way to get a believable result.

On the other hand I don’t need perfection, I just need to get closer to perfection than what I have now (which is without any warping)

After sleeping on the problem I have figured out that I don’t need to change the mesh. I can keep using a plane and distort the UV coordinates according to a height map gradient of the image (which can be automatically generated by a blender plugin GitHub - HugoTini/DeepBump: Normal & height maps generation from single pictures)

1 Like

If the mesh has good UVs (rather than UV archipelago), you might try to use the UVs instead of projecting decals.

Edit:

  • Just figured out @manthrax had said exactly this
  • @munhunger DeepBump might work for shallow folds (like the upper one), but most likely will fail for deep folds (like the second one):
1 Like