Notifications
Clear all

[Closed] Creating a Material similar to the DirectX material

I need to create a material that dynamically changes its UI and parameters based off a file. Similar to what happens when you change a shader file inside a DirectX material.

My grasp of material plugins, and my initial attempt at storing a property with an array of structs did not pan out. Are they using a rollout creator to make the UI? and if so, how are they creating the parameters inside the parameter block.

Any help would be appreciated.

Thanks

1 Reply

i use a XML file to create dynamically the rollouts and properties of a own material.
The process i do is:
– With MaxSDK i create a gup plugin. This plugin create a material plugin in a .ms file from the info in a XML file (i use tinyxml lib for parse it).
– i call the plugin exposing a function to MXS and i execute it when 3ds max starts with a startup .ms:

 createOSGMaterialPlugin()

– The .ms define a material plugin with custom attributes, each custom attribute has its own rollout and parameters to define the material. Basically each custom attribute is like a standard material with replaced UI.

if i update the XML file, i just call the exposed function from maxscript to generate the updated material.

You can use a .ms instead a gup plugin to generate the maxscript plugin material, but i supposed that it can be slower.

I took the idea from an opensource project (Nebula 2 engine) to create and manage it.
Source code:
http://svn.assembla.com/svn/nibelungs-demo/trunk/engine/code/contrib/nmax/src/export2/

i hope this can help you, but im not an expert in maxscript or max SDK.
i work with openSceneGraph engine so i have openGL shaders and not directX, but if you can use directX for your purpose i recommend shaderFX plugin to do your own Direct X files for Max.
http://www.lumonix.net/shaderfx.html