damyon Posted October 19, 2014 Share Posted October 19, 2014 I am trying to create a HUD out of some png images - but whenever I draw the image, it shows white where it should be transparent. The image is saved as a png with an alpha channel, but I tried tga as well with the same result. I am using 3.2 Indie Edition on Linux. The image file is attached. Here is my code to load the image: function Script:Start() self.texture = Texture:Load("Materials/HUD/hud.tex") end And here is my code to draw it: function Script:PostRender(context) context:SetBlendMode(Blend.Alpha) context:SetColor(1, 1, 1) left = context:GetWidth() - self.texture:GetWidth() top = context:GetHeight() - self.texture:GetHeight() context:DrawImage(self.texture,left,top) context:SetBlendMode(Blend.Solid) context:Sync(); end What I think the problem is: The automated conversion to textures is converting all images to DXCT1 RGB which has no alpha channel, but the working transparent textures that come with the editor use RGBA. Quote Link to comment Share on other sites More sharing options...
Josh Posted October 19, 2014 Share Posted October 19, 2014 Switch to DXT5 compression. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
damyon Posted October 19, 2014 Author Share Posted October 19, 2014 Aha - I found where to change it and it works now - thanks. Maybe this should be the default for imported images with alpha? Quote Link to comment Share on other sites More sharing options...
Josh Posted October 19, 2014 Share Posted October 19, 2014 Most images have alpha, I think. At least PNGS will I chose DXT1 because it uses a lot less space and still looks good. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.