Sign in to follow this  

Load EFFECTS within an X file

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

Hi friends! I'm in front of a new problem... While exporting a mesh from Maya with the new Exporter (December SDK), I could include DirectX shaders and FX files linking within an X File... Now I've only a little problem!!!!!!!! How can I import this effects directly loading mesh?! I've seen that the D3DXLoadMeshHierarchyFromX has a position for an EFFECT buffer so that someone could import and load effects in the same way I need... I've searched in the NET some examples, tutorials, articles, posts, but I've found anything... It's possible that anyone use portable effects in X files?! Thanks you all! Byez,

Share this post


Link to post
Share on other sites
In the X file MATERIAL is now something like this:



Material {
0.000000;0.000000;0.000000;0.000000;;
0.000000;
0.000000;0.000000;0.000000;;
0.000000;0.000000;0.000000;;

EffectInstance {
".\\\\lambSkin_ps11_tex.fx";

EffectParamFloats {
"WorldIT";
16;
1.574955,
0.000000,
0.000000,
14.768572,
0.000000,
1.111118,
0.000000,
-12.419860,
0.000000,
0.000000,
1.574955,
1.587376,
0.000000,
0.000000,
0.000000,
1.000000;
}

EffectParamFloats {
"WorldViewProj";
16;
1.225400,
-0.078606,
-0.067600,
-0.067587,
0.000000,
1.640025,
-0.438313,
-0.438225,
0.150460,
0.640198,
0.550561,
0.550451,
-14.917331,
1.298546,
45.596375,
45.787235;
}

EffectParamFloats {
"World";
16;
0.634939,
0.000000,
0.000000,
0.000000,
0.000000,
0.899994,
0.000000,
0.000000,
0.000000,
0.000000,
0.634939,
0.000000,
-9.377137,
11.177803,
-1.007887,
1.000000;
}

EffectParamFloats {
"LightPos";
4;
13.000000,
141.000000,
-100.000000,
0.000000;
}

EffectParamFloats {
"AmbiColor";
4;
0.100000,
0.100000,
0.100000,
1.000000;
}

EffectParamFloats {
"DiffColor";
4;
0.900000,
1.000000,
0.900000,
1.000000;
}

EffectParamFloats {
"SpecColor";
4;
0.700000,
0.700000,
1.000000,
1.000000;
}

EffectParamFloats {
"SubColor";
4;
1.000000,
0.200000,
0.200000,
1.000000;
}

EffectParamFloats {
"RollOff";
1;
0.200000;
}

EffectParamString {
"ColorTexture";
".\\\\pelle.JPG";
}
}
}




How can I load with the function D3DXLoadSkinMeshFromXof() filling the

ID3DXBuffer *EffectBuffer = NULL;

and then apply those effects to different parts of the mesh in the X file?!

THANKS!

Share this post


Link to post
Share on other sites
Quote:
Original post by GENTS
I'm in front of a new problem... While exporting a mesh from Maya with the new Exporter (December SDK), I could include DirectX shaders and FX files linking within an X File...


Is there a new December SDK of DirectX? http://www.microsoft/directx/ and Downloads shows that the 9.0c is released the fourth september 2004... Since I've had problems with the exporter for maya 6 I was wondering if I'm missing something...

BTW: I still haven't gone back to work thats why I haven't been able to respond in the maya 6 exporter thread (if you were wondering :)

Share this post


Link to post
Share on other sites
Ok!!!
It's not so important whit which type of exporter you have exported meshes, but how can I load effects within an X file using some type of D3DXLoadSkinMeshFromXof() function...

I can't found solution to this problem... I've tried to write down some code but that doesn't work!!!

Could someone help me?!

THANKS!

BYEZ,

Share this post


Link to post
Share on other sites
So if it's not possible to load effect saved in .X files, how is possible to use different effects for different part of the same mesh?!

THANKS,

Share this post


Link to post
Share on other sites
I've solved the problem by NOT exporting EFFECTS with the .X files and using normal textures or materials...

BUT THE PROBLEM STILL REMAINS!!!

Nobody know how to load these effects saved in .X files?!

Byez,

Share this post


Link to post
Share on other sites
Well when you call D3DXLoadSkinMeshFromXof it should return a buffer to the effects - one per attribute. You then load them. I am unsure of what the problem is with this - is it not loading them or not seeing them?

Share this post


Link to post
Share on other sites
I don't know exactly how to start to load effects within the .X file...

So when you've finished your tutorial, post here how to do that and I'll go to your website to take a look...

Thanks a lot ^__^

Share this post


Link to post
Share on other sites
Have you even looked at the sdk sample code? I guess you havent, because its pretty clear.


Il give you a hint:

HRESULT ID3DXAllocateHierarchy::CreateMeshContainer(THIS_
LPCSTR Name,
CONST D3DXMESHDATA *pMeshData,
CONST D3DXMATERIAL *pMaterials,
CONST D3DXEFFECTINSTANCE *pEffectInstances,
DWORD NumMaterials,
CONST DWORD *pAdjacency,
LPD3DXSKININFO pSkinInfo,
LPD3DXMESHCONTAINER *ppNewMeshContainer)

have a closer look at paramter 4 (or 5 really, if you look at the THIS_ macro).
Thats right! Thats a pointer to an effect instance from the X file. All you have to do is to use it.

Share this post


Link to post
Share on other sites
I was getting compile errors trying to build it with VS.NET. if anyone still has this maya 6 directx exporter plugin laying around could they send it to vidalsasoon@gmail.com pls?

thanks
V.

Share this post


Link to post
Share on other sites
If you download last DXSDK Update extras you've not to complie anything... It's just compiled in "Bin" folder for you ^__^

I hope it will help...

Byez ^__^

Share this post


Link to post
Share on other sites
Quote:
Original post by GENTS
If you download last DXSDK Update extras you've not to complie anything... It's just compiled in "Bin" folder for you ^__^

I hope it will help...

Byez ^__^



hmmm, then what the hell was i trying to compile?! lol

Share this post


Link to post
Share on other sites

This topic is 4698 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this