I was experimenting with the Dwarf.x file in the Irrlicht media folder, I changed his axe to a 32-bit PNG (and edited the .X file to point at the new image) and made parts of the axe transparent by making the alpha channel grey at certain places. Just to be sure I had the right image, I drew a pattern on the axe, so I know it was the right image.
It didn't show up as transparent in MeshViewer.
Does this mean the .X format can not take transparency from the textures? Or at least Irrlicht doesn't support it?
Can .X file format handle 32-bit textures?
-
- Posts: 36
- Joined: Sat Feb 06, 2010 11:52 am
You'll have to tell the material on the mesh file that it's transparent.
use getMaterial(0) to get the material, then set the MaterialType type to EMT_TRANSPARENT_ALPHA_CHANNEL
It's kinda silly, IMO irrlicht should only read it's own mesh format so it can contain this information inside it, without programmer intervention.
use getMaterial(0) to get the material, then set the MaterialType type to EMT_TRANSPARENT_ALPHA_CHANNEL
It's kinda silly, IMO irrlicht should only read it's own mesh format so it can contain this information inside it, without programmer intervention.
-
- Posts: 36
- Joined: Sat Feb 06, 2010 11:52 am
-
- Posts: 36
- Joined: Sat Feb 06, 2010 11:52 am
Presumably because existing textures that are 32-bit and have transparency have been built in .x assuming that the transparency won't work, right?hybrid wrote:Problem with enabling the transparency always is that suddenly many existing meshes don't work anymore.
Therefore it would be pretty dumb of people to use 32-bit textures on their .X models. Therefore not many people would do that. Therefore it's not going to be that much of a problem.
Therefore, if I am creating my own .X models, and I'm happily using 32-bit textures with perfect alpha channels, then I can switch this flag on for each material, right? Unless there is a performance reason not to do it.
Out of interest, what is the model format of choice for using transparent textures? I basically am using imported PNGs to make very simple rooms (texturing the inside of a cube) but I need to cut holes in the texture for windows etc.
Thanks (again!) for your help, Hybrid, and thanks to Pippy as well.
-
- Competition winner
- Posts: 1123
- Joined: Sun Jun 10, 2007 11:14 pm
-
- Posts: 36
- Joined: Sat Feb 06, 2010 11:52 am
-
- Competition winner
- Posts: 1123
- Joined: Sun Jun 10, 2007 11:14 pm