I need to set an Alpha8 texture quickly (I generate it on the fly). I see that SetPixels will work with it, but that takes a Color array (note: the float value kind with RGBA). SetPixels32 works with 8-bit RGBA’s. What I was hoping for was something like a SetPixels8, or Color8 or ColorGray type of API (none exist that I know of).
So do I really need to allocate a 32-bit color array for my 8-bit bitmap? Or a full RGBA pixel array that converts to float and back? Is there a better way?
This almost works, but i feel like it copy 1/4 of the picture over and over on the same picture. How could I fill the pixel values with only the alpha of a texture efficiently ? For now, I have textureA.LoadRawTextureData(Texture2DRGB.GetRawTextureData());
Yes, this works very well for us too. Thank you for this answer!
– ai_enabledThis almost works, but i feel like it copy 1/4 of the picture over and over on the same picture. How could I fill the pixel values with only the alpha of a texture efficiently ? For now, I have textureA.LoadRawTextureData(Texture2DRGB.GetRawTextureData());
– Orion_78