Jump to content
  • Advertisement
Sign in to follow this  
Trounce

Opacity in .X Files? Nothing partially transparent.

This topic is 5097 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello, I'm using Deep Exploration to export 3DS files to .X. My problem is that my program code (and the SDK example) ignore my material opacity. Where is the opacity stored in the .X file (or the Alpha -- whatever it's called), how can I test for it, and what do I need to add to my render function to display that material as partially opaque? Loading my newly exported .X file back in to Deep Exploration shows partially opaque materials correctly. So it must be a feature lacking in my (and the SDK example's) mesh loading routine? Thank you!

Share this post


Link to post
Share on other sites
Advertisement
Either in the alpha channel of your texture maps or in the Material data object (it's the 4th # in the diffuse color channel). Just because you set an alpha value however, doesn't mean your program will use it - you have to detect the value and set alpha blending when rendering your meshes.

Share this post


Link to post
Share on other sites
Ah perfect. Now I can test for opacity no problem -- which was half the battle. :)

...but I just don't know what to do with it. There are a large amount of Alpha related functions, and I'm not sure which I need use. The parts of the mesh that I want to blend don't have textures applied. I'm not sure if that complicates things.

Share this post


Link to post
Share on other sites
Okay, I scoured the 'net and can't find a -single- example on using AlphaBlending with meshes and Managed DirectX (C#). Can any coding guru out there shed some light on this issue?

Share this post


Link to post
Share on other sites
When you render your mesh I guess you are looping through the subsets. Firstly make sure alpha is on: device->SetRenderState( D3DRS_ALPHABLENDENABLE, TRUE );

Then render the subsets without alpha (those where material alpha = 1.0f) and then those with alpha and thats about it - you should get transparency showing.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!