Jump to content
  • Advertisement
Sign in to follow this  
tokaplan

Loading FX instance in D3DXLoadMeshFromX

This topic is 4866 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

The 6th parameter of D3DXLoadMeshFromX ( LPD3DXBUFFER* ppEffectInstances ) is supposed to return an array of effect instances specified in X file. And it does, filling D3DXEFFECTINSTANCE structure. But for some reason or other, it does NOT fill its (LPSTR pEffectFilename) field, though I can see that the effects file name IS specified in X file. This sort of troubles me, for it's the only field I really need. Any suggestions? Thank you.

Share this post


Link to post
Share on other sites
Advertisement
Sorry, I forgot to show what I'm doing:

LPD3DXBUFFER effectInstance = NULL;
if( FAILED( hr = D3DXLoadMeshFromX( strPath, D3DXMESH_SYSTEMMEM, pd3dDevice,
&pAdjacencyBuffer, &pMtrlBuffer, &effectInstance,
&m_dwNumMaterials, &m_pSysMemMesh ) ) )
{
return hr;
}

D3DXEFFECTINSTANCE* effect =
(D3DXEFFECTINSTANCE*)effectInstance->GetBufferPointer();

strcpy( m_effectFileName, effect->pEffectFilename );

And I always receive NULL in effect->pEffectFilename, though other fields of D3DXEFFECTINSTANCE contain valid information.

Share this post


Link to post
Share on other sites
I remember something similar happened to me.

It should return an array of instances but the first item in the array always had no filename associated with it. So I always start at "1"... it works but I never understood why this happened. Maybe my maya exporter was buggy.

Share this post


Link to post
Share on other sites
Where and how exactly in the X file can the effect instance be specified? It would be cool for me to know that as currently I keep a track of various effect files for the different meshes I load in my project.

thanks
Tan

Share this post


Link to post
Share on other sites
Panda exporter includes an EffectInstance template in the generated X if the corresponding checkbox is set.

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!