• Unity
  • Clipping mask over a character for texture effect?

Related Discussions
...

Hi!
I'm working with a character who simulates being on a screen so I need to show her with a scanline texture over her, but this texture needs to follow her shape and she is animated. I'm using the clipping mask to draw all her body and place this texture, but it gets a bit tedious once I have to change everything in animate mode to keep following her.

Maybe there's another way to handle this with the clipping mask or a better way to solve this and I'm missing it?

I will appreciate any help 😉

As clipping attachments should be kept to a minimal vertex count, this solution is unfortunately very very costly performance wise.

Typically such an overlay effect would be implemented via a custom shader that renders an additive scanline-texture on top. Which runtime are you using?

Hola Herald!
I'm using the 3.8

Sorry, Harald meant which game toolkit are you using?

Sorry, I missed that it was posted in the Unity subforum already (or has been moved).

You can use the RenderExistingMesh component (located in Spine Examples/Scripts/Sample Components) to re-render the same Skeleton twice, using your custom Material to draw a scanline overlay on top. Please note that the scanline needs to be in screenspace, a normal texture overlay will not be what you want.

If you do not want to write your own shader for the scanline, you should be able to find something of use on the Unity Asset Store, like this package:
https://assetstore.unity.com/packages/vfx/shaders/scanline-highlight-shader-55414