This content has been marked as final. Show 4 replies
The easiest way is to use PNG with 32bit alpha channel. When you use these textures in your shader, then it will be transparent by default.
Make also sure you use the correct textureRenderFormat.
You could even animate the alpha of the image using imaging lingo. To set it on a single #fromImageObject texture you will need to create two images, a 32 bit "host" image and an 8 bit grayscale image. You can then use setAlpha() to apply the alpha information to your host image and then create the texture using the 32 bit imageobject (with the correct texturerenderformat). If either the host imageobject is not 32 bit or the grayscale image not 8 bit the setAlpha() operation will fail silently.
> If either the host
> imageobject is not 32 bit or the grayscale image not 8 bit the setAlpha()
> operation will fail silently.
Adding to this, if the dimensions aren't the same the setAlpha() command
will fail; and I wouldn't say "silently" as the command returns a
boolean indicating success or not:
bSuccess = imageObject.setAlpha(alphaImageObject)
Thanks very much for the replies. Unfortunately theres a lot of textures, with the vast majority already been made, and where an alpha was needed, its been supplied seperately as a seperate greyscale jpg. Next step is to try your suggestion of using the greyscale image as the alpha for an image object. And if not, get the required alpha textures remade as PNGs.