#Alpha clip vs alpha blending vs stencil

1 messages · Page 1 of 1 (latest)

white mist
#

Dudes which approach is more efficient for mobile devices
There is a rectangle mask. I want to render a different sprite inside the mask and outside, it should render the normal sprite.
1 Render the normal sprite and write a custom alpha test shader to clip based on the rectangle.

2 Render the normal sprite and write a custom alpha blending shader to show/hide pixels based on the rectangle.
3 Use the stencil buffer, unity sprite mask for example

cloud hollow
#

I would give your project a go with and without alpha clip. Alpha clip on mobile is always heavy, and some times performs even worse than blending (def use premultiply blending!)
It really depends on the excact scene

#

I would personally not use a whole stencil pass for this. Try to run without intermediate texture if possible