Tasharen Entertainment Forum
Support => NGUI 3 Support => Topic started by: Real World on December 03, 2016, 04:36:49 PM
-
I've got two sprites that are layered on top of each other. For the sake of argument, the bottom one is a square and a circle is on top. I want to set the opacity of the combined sprites to 50% alpha but doing so makes the square visible through the circle. I want to render it so that pixels that are invisible at fully opaque remain invisible at 50% opacity.
The only solution I can think of right now is to render the the set to a texture and then display the texture at 50% alpha instead. Problem being that I have about 100 of these to display on screen (all unique) so the performance overhead would be too great. Anyone aware of a shader solution or another solution?
-
You need to create a custom shader that samples two textures. What you have is essentially two passes, and what you want has to be done in a single pass.