Feathered Sprite Mask / Uniform transparency on multiple sprite renderer group

I write this post not asking for these features, just wondering if they are possible to be added into unity or if there are any plans at all to add them in the future ( even if it means it may take years )

Feature 1: Feathered Sprite Mask:

As the title says just the sprite mask feature but with masking 50% of the sprite if the pixels on the mask are 50% transparent, i think its self explanatory.

Feature 2: Merging a bunch of sprite renderers into a group and being able to change the transparency on that group in a uniform way:

if you overlay 3 circles opaque in a triangle shape and then change the opacities it will look like it was a venn diagram instead of keeping its past solid shape, just now transparent, in other words each sprite renderer has its own transparency and will bleed to each other unless you merge them with code into 1 single sprite renderer.

there are workarounds right now to fix these but they are messy, you have to use shaders, i was wondering if there was some sort of quality of life on these features eventually planned for the future, or if the architectures in place simply are not worth meddling with to try to deploy these features in the near or far future. Anyway appreciate your time reading.

  1. “Masking” as a concept in Unity (SpriteMask, RectMask, etc) uses the Stencil Buffer, in which a pixel can either be on or off. A soft alpha mask is absolutely possible but will not work with the built-in masking systems. A dithered mask is another option (using a dither pattern texture to feather the edge instead of alpha). Otherwise google “unity soft alpha mask” to find out what your options are (tutorials, plugins, etc).

  2. Probably the easiest way to do that is to render the sprites with a camera into a RenderTexture, and then replace the sprites with the single new texture and fade it.

There is a demo package of that approach posted from January: How to fade a game object with all its children (Sprite Renderer / Image)?

1 Like

I did it by “photographing” the combined sprites (no alpha), then rendering the final result with alpha.

See enclosed package.

7844700–994638–RenderTextureSetup.unitypackage (41.2 KB)

i know there are workarounds, probably for 1. then its a no go, would require totally different approach.
For 2 it seems like it will be a lot of hassle to integrate. using like 1000 render textures prob wont be the best way either

You can most likely keep reusing the same render texture, unless you really need multiple at the same time. Once you render the image to the render texture, you can create new textures from the data and save them to disk if you need them in future sessions. Then just use the same render texture again for the next one.