Load EFFECTS within an X file

Started by
15 comments, last by vidalsasoon 19 years, 2 months ago
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,
----------------------------------------------- - GENTS -"Every man dies, not every man really lives"[William Wallace] - visit my website: GENTS.it -- Using Effect files with DirectX 9 Basics Tutorial -- MilkShape 3D models and OpenGL ES Tutorial -
Advertisement
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!
----------------------------------------------- - GENTS -"Every man dies, not every man really lives"[William Wallace] - visit my website: GENTS.it -- Using Effect files with DirectX 9 Basics Tutorial -- MilkShape 3D models and OpenGL ES Tutorial -
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 :)
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,
----------------------------------------------- - GENTS -"Every man dies, not every man really lives"[William Wallace] - visit my website: GENTS.it -- Using Effect files with DirectX 9 Basics Tutorial -- MilkShape 3D models and OpenGL ES Tutorial -
So that's no solution to this problem?!

Does Microsoft have included a functionality un-useful?!

THANKS
----------------------------------------------- - GENTS -"Every man dies, not every man really lives"[William Wallace] - visit my website: GENTS.it -- Using Effect files with DirectX 9 Basics Tutorial -- MilkShape 3D models and OpenGL ES Tutorial -
Anyway there is another topic on Maya 6 exporter and all its tips and tricks!!!

Here is the link: Maya 6 .X Exporter, no materials?

Byez,
----------------------------------------------- - GENTS -"Every man dies, not every man really lives"[William Wallace] - visit my website: GENTS.it -- Using Effect files with DirectX 9 Basics Tutorial -- MilkShape 3D models and OpenGL ES Tutorial -
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,
----------------------------------------------- - GENTS -"Every man dies, not every man really lives"[William Wallace] - visit my website: GENTS.it -- Using Effect files with DirectX 9 Basics Tutorial -- MilkShape 3D models and OpenGL ES Tutorial -
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,
----------------------------------------------- - GENTS -"Every man dies, not every man really lives"[William Wallace] - visit my website: GENTS.it -- Using Effect files with DirectX 9 Basics Tutorial -- MilkShape 3D models and OpenGL ES Tutorial -
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?
------------------------See my games programming site at: www.toymaker.info
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 ^__^
----------------------------------------------- - GENTS -"Every man dies, not every man really lives"[William Wallace] - visit my website: GENTS.it -- Using Effect files with DirectX 9 Basics Tutorial -- MilkShape 3D models and OpenGL ES Tutorial -

This topic is closed to new replies.

Advertisement