Make Photo Have Depth - Cheaper Version of Vertex Offset? (image inside)

Hello there good people of the forums,

so I am trying to give a depth effect to a simple image with alpha. Right now I am doing a local vertex offset based on an outline applied to a 400k poly plane. The look goes in a great direction but is way to performance-heavy to be working on mobile which it must.

How it looks now:

How can I achieve the look much cheaper?

Thanks very much!

bump -

Is that totally undoable or such a rare problem?

If you could explain your use case a bit more, then people might be able to help. A few questions come to mind - is this a dynamic scenario where you are extracting texture from camera or such, or just typical content (game, art, app whatever) that does not change.

In the latter case, I would just create an alpha channel texture for the cutouts and set the depths of the different planes correctly for foreground planes and have a backdrop texture. Just as an example. And if you want to save rendering resources, create more tightly framed geometry along the edges of the people so that there’s less overdraw. But I’m just guessing here.

you could optimize the 400k vertex count down?

or could deform the mesh manually from script just once at start.

Thanks for the answers!

So you’re both right in that it doesn’t need to be updated dynamically. It can be static - the extrusion could be generated once.

How would I go about deforming the mesh once at start?

Visually - I would like it to look like a solid block with depth.

then i’d look for something like mesh face extrusion…

see this thread for ideas also, you would need to find the edges around the image, then create mesh from those.

You could also use a more advanced form of Parallax Occlusion than Unity’s default “Height” mode uses.

https://www.gamedev.net/articles/programming/graphics/a-closer-look-at-parallax-occlusion-mapping-r3262

This will be more taxing on the pixel shader, but much less taxing on the vertex program, so it’s hard to say what will be more performant on mobile, a 400k+ mesh going through the vertex program or a simple 4 vertex quad with parallax occlusion.

There is a caveat to this approach though, the visual effect is constrained to within the plane the texture is on, so if you looked at it completely from the side you would just see the thin-edged plane, not a full extruded surface. (though I believe there are some approaches out there that can be used on a cube and affect silhouette, if you can find them)