- Home /
I was able to solve the problem myself.
ReadPixels Overlaying Opacity
I have encountered an error while trying to save the contents of the screen to a Texture
. My program currently uses ReadPixels
and would save the screen contents just fine.
However, I tried to add a semi-transparent overlay to the scene using a GUITexture
. The texture applied to this GUITexture
has the transparency embedded in its .png
, and displays just fine when it is visible. However, when I use ReadPixels
and view the texture generated by this, the portion of the image covered by this overlay is semi-transparent as well.
In other words, my output image shows through portions of the background by transferring alpha of the overlay to the entire picture. Any idea what might be causing this or how to fix it?
Self Solution Edit
I was able to solve this problem by simply looping through the entire Texture that I had read and setting the pixels to all have an alpha of 1.0. Strange that it would not transfer that information by default, but it worked.
Follow this Question
Related Questions
How to get banner ad's screenshot to a texture? 0 Answers
Texture2D.ReadPixels ignores Sprite Mask, captures hidden sprites 0 Answers
glTexSubImage3D in unity 0 Answers
Can a Texture2D be created at runtime from a snapshot of a RenderTexture? 3 Answers
Problems rendering background image in unity,Problems rendering background texture 0 Answers