on 31-08-2012 09:55 AM
I have an MDX which works fine in the viewer with an alpha blended texture. It's exported from Max as an FBX with the alpha texture as a 32bit BMP.
When I render using BasicModel, the alpha is not being read by the shader. I've tested this by setting alpha explicitly with:
color.w = step(0.5f, max(max(color.x, color.y), color.z));
And this comes out with some alpha'd sections of the textures, as expected.
I'm using a custom version of BasicModel to add some point lights, and have traced the texture loading down to one line:
new Texture2D( image, true ) ;
Which loads the texture from a block of data in memory and generates mipmaps. I've tried forcing the format to rgba, but this makes no odds.
So, my question is, where is my alpha channel?! It looks like Texture2D isn't working, as the data in the MDX is correct (going by the model viewer).
Can anyone shed some light on this?
Solved! Go to Solution.
on 31-08-2012 12:04 PM
on 31-08-2012 04:23 PM
on 31-08-2012 05:30 PM
Saving as 32bit PNG does appear to work, although it's a bit of a pain from photoshop as it wont save the alpha channel, rather is saves the transparency.
So this does seem to be a bug in the Texture2D code, as it works in the viewer, and also in other 32bit BMP's.
I can provide an MDX which fails if anyone from the SDK team are reading. It really does need fixing -- and preferably increasing the supported texture formats and adding compressed support.... )
on 31-08-2012 06:38 PM
Nice to hear that with png works,, now lets try to find out why that image don't work could you please send me the BMP? but ..may be I'm wrong but BMP format never had alpha channel.
on 31-08-2012 09:54 PM
on 05-09-2012 04:30 PM
I'm not too bothered about which format I use, it just happens that BMP is a bit easier to deal with when using alpha channels in PhotoShop.
What I find weird is that on some models, the BMP alpha works, on others it does not. Even when using a texture which "works" and copying it to another model, it mysteriously stops working.
I've swiched to using PNG's where appropriate but supporting something like TGA would be nice to have. Although PNG does indeed seem to do everything I need.
Website ©2013 Sony Computer Entertainment Europe
All content, game titles, trade names and/or trade dress, trademarks, artwork and associated imagery are trademarks and/or copyright material of their respective owners. All rights reserved. [more info]