What's going on here? PNG alpha.

BlitzMax Forums/MiniB3D Module/What's going on here? PNG alpha.

Hujiklo(Posted 2010) [#1]
Using B3d with 32 bit png textures is giving inconsistent results. A tester for my game is using a Sony Via with a ATI HD 4650 graphics card and cannot see any 3d meshes properly if they are textured with an alpha channelled PNG.

The only meshes that show up are the left\right toggles in the 4th(problem) image below - these are 64x64pixels. I tried making all the other textures square also but that makes no difference either...texture sizes are 256x64 and 1024x512.

Does anybody have any ideas what's going wrong? Spent 2 days now trying all sorts but to no avail.

Below are images of how the screens should look and how they are showing up on the notebook. Note how the 3d tileset is showing up normally as it does not use any PNGs with alpha channel.









ima747(Posted 2010) [#2]
First question, what's up with the direct x option in the config view? minib3d is opengl only. Just curious...

textures with an alpha are handled the same way as entities with less than solid opacity. Try changing the opacity of some of your other objects to see what happens, wether it's a rendering issue, or more likely hardware.

How are you rounding the corners of your tiles?

you said you tried making the problem textures square, were they power of 2 square or just square? shouldn't really matter since minib3d does a pow2 on textures but just curious again.

What happens if you put one of the working textures in place of a non working one? Does it show up, or is it broken.

Is there anything different about the creation path for the PNGs? Were some exported from photoshop for device and some just saved and PNG or anything?

Does it only happen on that one tester's system?

Can you put up an example program for others to try on their cards?


_Skully(Posted 2010) [#3]
Make them 0.99 alpha, I seem to recall hearing of some glitch that way.


ima747(Posted 2010) [#4]
There are times when the alpha doesn't properly register (doesn't usually look like that for me...) so the .99 alpha forces minib3d to draw them with alpha so that could also help.


Hujiklo(Posted 2010) [#5]
Thanks for the replies.

Ima747 - the game is a mockup and these are not the final gfx, also the options screen is a framework that is not necessarily for MiniB3D.

The tiles are 3d objects with slightly curved corners - no alpha going on there.

Textures are all power of two and art path is the same for absolutely everything!

I'll try that 0.99 alpha trick and see if that sorts it out. You never know.

Where in the MiniB3D code does it handle the alpha tranparencies of textures\meshes? It might be worth sniffing around there. I bet for certain this is a silly little bug.

I'll report back, if the first fix doesn't work I'll try swapping a texture with no transparency to see if it is indeed the issue. It does seem to be a case of MiniB3D handling only one transparency at a time...as only one entity ever shows up correctly - maybe this is the clue? Some variable is not being reset in MiniB3D source code?


ima747(Posted 2010) [#6]
Alpha textures are not so much handled by minib3d as by openGL. If minib3d detects that something should be drawn with alpha (either because the texture has alpha, or the object has alpha) it then goes through a process of sending it to the openGL render que in reverse depth order from the camera (just like you draw 2D stuff from back to front so the overlaps are correct) Without alpha opengl renders things fine so it doesn't bother sorting things by depth.

Was there any difference in the way the PNGs were made between ones that work/don't work?

If you think it's just the first one that works, what happens if you remove the first one (or alter it to be a solid so it's not alpha)? Does the second one then work instead or is it still just as broken?


Hujiklo(Posted 2010) [#7]
No all PNGs are exactly the same and exported straight from Photoshop...I'm actually waiting to hear back from the tester to see if the 0.99 alpha setting worked or not. Blinkin' hope so ;)


jkrankie(Posted 2010) [#8]
It could be a bug in the ATI drivers though...

Cheers
Charlie


ima747(Posted 2010) [#9]
indeed. long story short is if it's just him ask him to update his drivers. ATI especially in my experience has had some real sketch opengl support... or who knows he might even be running generics or something...


Hujiklo(Posted 2010) [#10]
Note: I gave up on this - new drivers did nothing :(

Thanks for the suggestions and help.