I searched around and saw this post from the old forum:
but its still a mystery to me. I can successful clone mesh, skeleton and the animation but then what do I do with the decal? Do I merge it with the clone?
I wish it was that easy Unfortunately parenting doesn’t make the child mesh animate.
I know in Blender you can reproject textures onto mesh with different topology and UV. If I could do that here then I could merge it with the texture of the avatar but I’m not sure if that’s possible in Babylon.js
That would only change position of the decal. What I’m trying to do is get the decal to warp like the skin. Its as if I placed a tattoo on the skin. I need it to have exact same properties
So in this case I would probably recommend having a second texture (dynamic) over your mesh.
The texture will be filled with transparent pixels by defaut and you could render on it when required
But the decal is a mesh. How can I merge the decal texture into a texture for another mesh? The texture of a decal does not have the same UV as the base
Yes, I need to figure out how to project an image onto a point on the texture in realtime. This is where I am stuck. The complexity lies in the UV mapping because of the different islands
At the moment my workaround is to make an ajax to call Blender (in background mode) which runs a Python script that reprojects the decal onto the mesh via texture baking. It feels very bloated to do it like this. Hopefully someone knows a better way!
ok, maybe I’m missing something. If I use dynamic texture (for example, with text) and place it on the UV map for the 3D model the image gets broken up by the UV islands.
well, you’re surely going to get sick of me, but I’m stumped! I can’t find how to match one UV over another. I’ve checked doco and forum posts. Someone mentioned “uv2” array property of a mesh but I can’t find that.
I’ve got this decal and I’m trying to wrap it over this dress. 2 very different shapes with different UVs (the decal is crossing over 2 islands). Please, if you find an example or documentation, send it my way
(I know it looks like it lines up well in this picture, but remember I need it to be rigged to the skeleton exactly the same as the dress so it can be animated)
The second channel is easy to use from bjs standpoint (just set texture.coordinatesIndex = 1)
But you need to export your mesh with two channels of uv. The first one as usual to support your material diffuse etc…
The second one has to be added in blender and wrapped on the mesh
Calling Blender is not so bad for me 'cos I don’t need it to be instant. User can wait a second for the result. Hopefully 100 concurrent instances of Blender doesn’t drain the server too much.
Not so good for realtime applications though, like playing a game and you shoot someone, they get a decal blood-smear but that blood-smear needs to animate with their crumbling body. Probably not many people using Babylon.js for realtime 1st-person or 3rd-person games tho.