PNG Mask Problem ( Weird )

Blitz3D Forums/Blitz3D Beginners Area/PNG Mask Problem ( Weird )

Jack Dawson(Posted 2011) [#1]
Well I used a program that generated a tree. It made the B3D file and I import it in. Here is the Code to bring it in.



the b3d file you can get here
http://www.youdidwhattowho.com/tree_1.b3d

here is the image of what it looks like in the tree generator


Here is what it looks like with the above code. I did this both in an NVidia and an ATI card, with similar results.

NVidia


ATI


I just cannot seem to get this. I DID a search, but it didn't find anything on this problem. The PNG forum threads I read all were talking about static PNG files, and none of the OBJ or B3D threads I could find would talking about this problem. So If I missed a topic somewhere, sorry about this double post.

EDIT : I didn't realize my other post was in BlitzMax, it gets confusing here sometimes. I moved the other post on the Max forum to here.

Last edited 2011


Jack Dawson(Posted 2011) [#2]
I also have a simular problem with PNG files, another one I did a search on and it seems no one got an answer to this, so I thought I would post pictures and the code to see if this helps.




PNG file itself


This is what its supposed to look like


This is what it looks like in Blitz3D


Anyone have any ideas here ?

EDIT : I didn't realize my other post was in BlitzMax, it gets confusing here sometimes. I moved the other post on the Max forum to here.

Last edited 2011


Warner(Posted 2011) [#3]
Concerning your first post, the tree model, it seems to have a texture called Cross04.png that is loaded using flag 4 instead of flag 2.
That means that all black pixels will be transparent. In Photoshop (and maybe other programs as well), transparent pixels are saved as white pixels with an alpha value of 0.0. This means Blitz3d will render them white.
You could either change Cross04.png so that it's background is black, or you should save the model again, with flag 2 enabled on any brush that uses this texture.

Edit: about your second post: 2D images in Blitz use only 1 bit alpha. That means alpha is either on or off (100% or 0%). An alpha gradient (smooth transition from 1.0 to 0.0) is not supported. You could either use a 3D object with that image as a texture, or use dithering in your image editor to simulate the alpha gradient:


Last edited 2011


Jack Dawson(Posted 2011) [#4]
That is brilliant. Didn't realize all I had to do was put the PNG file on an object like a cube. GREAT JOB !!

And here is a picture of the animated tree. ( Still frame )

Thanks to your showing What the problem was, I am now able to import B3D files with no problems. :-)