Creating DirectX Shader Material with max sdk

Started by
0 comments, last by skybreaker 15 years, 9 months ago
Hi, These days, I'm trying to create a "DirectX Shader Material " in a utility plugin and assign it to a node. There are dozens of examples on how to access the data within the IDXMaterial interface,but haven't found any thing useful about create one. I tried classid post here :"http://discussion.autodesk.com/thread.jspa?threadID=576586" like this :

Mtl * newmtl = (Mtl *) theSpeedRadiosityUtility.ip->CreateInstance(MATERIAL_CLASS_ID ,DXMATERIAL_CLASS_ID );
IDxMaterial* dxMtl = (IDxMaterial*)newmtl->GetInterface(IDXMATERIAL_INTERFACE);
node->SetMtl(newmtl);
after this , when I opened the Max Material Editor, the node is still using the "Standard" material there.But object in the viewport changed (just gray color). What should I do to change the "Standard" Material to "DirectX Shader Material " and furture select .fx file and other params? Any suggestion ? Thanks!
Advertisement
ha, problem solved. just do this:
ip->PutMtlToMtlEditor(newmtl) ;
ha.

This topic is closed to new replies.

Advertisement