Is it possible to use the texture's alpha values when drawing 2D images?
I know you can get it so that either all or none of certain pixels are transparent, but what if I want a value in between for each pixel?
draw2dImage Alpha
Re: draw2dImage Alpha
draw2DImage allow enable alpha blending, so all values between 0-255 are available for pixels related to alpha.
Library helping with network requests, tasks management, logger etc in desktop and mobile apps: https://github.com/GrupaPracuj/hermes
Re: draw2dImage Alpha
I know that you can use alpha on the vertex level, but I want to be able to load a texture with an alpha channel and have it use that for alpha blending.
Currently, if you try and do this now, it clamps the value to all invisible or all visible.
Currently, if you try and do this now, it clamps the value to all invisible or all visible.
Re: draw2dImage Alpha
Which Irrlicht version do you use?
Library helping with network requests, tasks management, logger etc in desktop and mobile apps: https://github.com/GrupaPracuj/hermes
Re: draw2dImage Alpha
I'm currently using Irrlicht 1.8.
I've taken a look at the source code on the direct x side of things and can tweak the code in CD3D9Driver::setRenderStates2DMode to change the alpha blending between the vertex alpha and texture alpha, but there seems to be something going on at the actual texture alpha. Somewhere else in the code the texture alpha must be getting clamped to either all (255) or none (0).
Can someone help me find where in the source this is happening?
The main method to look at is CD3D9Driver::draw2DImage
I've taken a look at the source code on the direct x side of things and can tweak the code in CD3D9Driver::setRenderStates2DMode to change the alpha blending between the vertex alpha and texture alpha, but there seems to be something going on at the actual texture alpha. Somewhere else in the code the texture alpha must be getting clamped to either all (255) or none (0).
Can someone help me find where in the source this is happening?
The main method to look at is CD3D9Driver::draw2DImage
Re: draw2dImage Alpha
Have you look at the documentation?
Just pass true to 'useAlphaChannelOfTexture' parameter.
http://irrlicht.sourceforge.net/docu/cl ... e526bbcdb3
Just pass true to 'useAlphaChannelOfTexture' parameter.
http://irrlicht.sourceforge.net/docu/cl ... e526bbcdb3