Adjust the texture to the shadows on the camera

So I want to make a t-shirt filter, but, I want the filter to track the shadows of the shirt so it will look more realistic.

Like carlings did.

Any help? I kinda did it with the light leak example but it uses a rectangle and I can’t add it to a target tracker. When I use the plane it distorts because it still uses the camera texture so its the same as I put a camera texture on a 1x1 plane.

Can you post some screenshots of the effect you’re going for? There’s a lot of ways to skin a cat and I want to be sure I’m giving you the right approach :slight_smile:

Asked my sister to press on CMD, SHIFT, 3 while I was standing on the edge of the bed. :smiley:

2 Likes

The idea is that you want to match up the camera texture so it will deform the texture on the shirt. You’ll use a scene render pass to stamp out the 3D element into a flat texture that matches the size of the camera texture. From there, it’s just plugging those things into a distortion patch!

Here’s a neat photoshop tutorial that will give you some more ideas on how to make it look even more realistic :wink:

2 Likes

It does work but there is a problem… I can’t use a target tracker, it shows the plane even without the target being visible.

Yeah, because it’s a custom render pipeline you will need to build in your own logic for hiding/showing the 3d object

Didn’t quite understand…?

The “visible” checkbox doesn’t work with render passes, so you need to wire up your own logic based on when you want the thing to be rendered. I’m assuming that you will want to render when the tracker is found, so you’d do something like this:

Here’s what I understand so far.

  1. I am taking the camera texture’s most contrast image and use it as the distortion texture of the image.
  2. the render pipeline doesn’t know by itself that I need to render it when the target is found so I need my own way to “teach” it.

Am I right so far?

1 Like

Yeah that’s right. If you want to make it more readable, you could make a group from that graph I showed above. It could have a “visible” boolean, and a texture input. That way you can check it on and off quickly during dev, and it is a bit easier to understand when you are looking through the graph

Hi! so it works, everything works fine now but I only want to ask one last thing.
How can I make it less distorted? because it’s really distorted on curves and stuff… I tried to play around with the patches but as far as I can tell, there is no way to lower the strength of the render pass…

Dig in to the inside of the texture distortion patch. I’m not sure why they don’t expose the strength parameter, but it’s in there.

1 Like