How do i give depth to a flat texture with a mask? Something like POM or Bump offset... Though maybe different?

I have a bunch of figurines that are flat textures. In my game i will display them as 3D tokens / standees. This are place in a plane, then a mask hides the outer part that defines the figure.

But still they are flat like a paper if you move around them.

So i need to create an effect that gives them a bit of depth like a cardboard piece. Just a little like half cm:

You see the dark part that gives it depth? How can i do this without editing the mesh?
Looks really cool and gives it a totally different aesthetic.

I see the question also asked here:

Someone else suggested me to just make it a mesh manually. This cant be done because the figures will change sometimes. And they are too many.

So i think the best is to be done in the material.

You would most likely have to do a 4 way scan of the image

  • top to bottom,
  • left to right
  • right to left
  • bottom to top

checking against x and y coordinates are not of the key color (in this case white) and breaking the current loop once a different color is found incrementing the change. Slowly gathering a 4 way grid of x and y coordinates.

You would then have to transform them to percentages along the axis and use that as reference to build a procedural mesh. It would have to have the same starting ratio as your cutout. slowly adding points based on the converted percentages. Once the mesh would be build you would need to move each face out by it’s normals adding the extra white border around the character.

It’s rather complex to do.

1 Like

Another way, you can do a bit of a fudge and just use a normal map to create a pseudo edge, not quite as nice as extruding it:

  1. cut out the image in a image editor (please excuse the 10 second job I did here)

Save that with alpha for the mask.

  1. Fill the image in so it’s back and white

  2. Create a Normal Map from that

  3. Just make a material from those.

That gives you something like this when viewing the the WorldNormal visualizer

which then looks like this

Edit: Also you can hook up the black and white mask to the PixelDepthOffset to give more depth

1 Like

Thanks. It gives some depth though maybe not enough. I understand maybe there isnt a good solution for this.

Other than this i have another idea that is a bit of a cope :lion::persevere:, but it works:
Just create more instances of the same plane in the Z, like a deck of cards, and it creates the effect i need:
Those are just 6 more planes. I think its worth it.

1 Like

Yeah I experimented with stacking them like that too and it looks ok when they’re close together - you can make them double sided which helps a bit too (may need to multiply the pixel depth by the “sign” node

1 Like

Thanks. Though in my situation it relies heavily on Hierarchical Instanced Static Mesh. That means, if i use a procedural mesh then i cant instance it.

So far, i have the solution with normals of RecourseDesign.
Or duplicate the same instance of plane in the Z. Which is a bit of a cope though its an interesting solution and looks quite cool. Probably need to change its material to black, the ones that are duplicated below.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.