Place an image onto a part of a loaded model (GLB/GLTF)

Task is to make an image appear on a model, as a sticker/logo say for a Tshirt without breaking the existing texture and material.

Is learning how to code GLSL and then how to extend/patch materials the only way to do that?

Have you considered decals ? Here’s an example.

They are pretty dynamic and don’t affect the original model / texture, so may be exactly the thing you are looking for?

Otherwise you can also consider canvas texture - paint original texture on a canvas, then apply a sticker over it.

(thank you so much for a reply)

I used decals to start with but either I’m misunderstanding them, or they can’t be used in the way I want, because they distort the image. Imagine if I wanted a decal on a can, that said, Pepsi. I don’t want the word Pepsi to be stretched/bent the way it does. I wonder if decals have the ability to do what I need. The projection method seems to be the issue. Couple of pics show the problem.

I started with canvas and got that working great, but then I saw that it was causing issues as far as being able to separate the shiny-ness of the image so I ended up with a flat looking image. I assumed drawing to the canvas ruins normals, reflectivity, etc, which decals do not as they have their own.

So, here is what I am wondering… Why is there not an example online anywhere to be found. Has nobody ever made a codepen, etc for this. It seems a fairly normal feature, I’ve read lots of forum messages about it, but I can’t see any examples. Is it actually possible?

DecalGeometry is probably what you want. I’m not sure why it’s distorted in your screenshot above — I tried clicking around on the demo and didn’t get anything like that. Could be a bug, or might be that you’re looking for a different projection method?

great, thank you both, not time to give up yet then… Now I’ve seen Sagir’s cool Painter I believe!

I already pinged @Click_Clock_Boom in the past - he said he dropped the project cause he’s not interested in it anymore, but proceeded to ghost me indefinitely after I asked if he could open source it for us :’) If you do succeed with convincing him, would be great to share it - as Andy said there’s not many examples of painting on textures around.

I’ve played with the @Click_Clock_Boom paint, and actually, it has the same issue with distortion - it looks like back to the drawing board.

The issue is to do with the decalgeometry ORIENTATION parameter as in… var x = new DecalGeometry( mesh, position, orientation, size );

I don’t see that the orientation Euler can be set to give ability to ‘wrap around’ instead of splatter/smudge.

Using the paint program, I loaded a dog.obj - the material wasn’t loaded, but anyways, you can see the problem easily. I want the dog to have the Diet Coke logo on him so you can read it.

(hitting the target in a more centred location doesn’t solve the problem, unless it’s flat, and you project at a direct angle - that’s why the AK47 stickers appear to be nearly correct).

What i want is a way to project onto the texture, so that when it’s uvWrapped, it’ll be in the correct place - which means I need GLSL and uVu weirdness I think - or back to using canvas and loosing separate material characteristics.

… unless… can you project from inside the dogs chest? - but what Euler… ugh…