Main Page Contents

Using Material Editor

@section NMaxHowtoMEditorOverview Overview

Nebula2 uses standard D3D FX files as its shader file format. FX files define all necessary render states, texture unit states, vertex/pixel shader programs and allow fallback paths for older hardware.

@section NMaxHowtoMEditorMaterialEditor The Nebula2 Custom Material Editor

meditor01.png

Setup material

Click Standard 3DS Max shader button. It will show up Material/Map Browser dialog.

meditor02.png

Select Nebula2 custom material in the Material Browser

Select Nebula2 material and click 'Ok' button.

IMPORTANT: The Nebula 3DS Max Toolkit also supports Standard material type in Material/Map Browser which is native material type of 3DS Max. But the Standard material is remained for the purpose of backward compatiable or testing only. It is highly recommended to use Nebula custom material which is provided by the Nebula 3DSMax Toolkit.

meditor03.png

Nebula2 custom material rollout

This will bring Nebula2 custom material editor to you. By default, there is 'None' for Nebula2 Shader Types rollout panel and nothings for Parameters rollout.

Select any one of the shaders in dropdown listbox and then its parameters will come out.

@section NMaxHowtoMEditorSupportedMaterialTypes Supported Material and Map Types

The Nebula 3DSMax Tookit material editor supports several types of the 3DSMax material other than standard material type of the 3DSMax.

@subsection NMaxHowtoMEditorMultiSubMaterials Multi-Sub Materials

Nebula is available to use only one single material for its nshapenode. If your model has multiple material, you should use multi-sub material for its material. If the model has multi-sub material, the toolkit create a ntransformnode for the parent node and put each sub material becomes its child node and create a nshapenode for each sub materials.

multisub01.png

Multi/Sub material on the Material Editor

The toolkit plugin will create ntransformnode for the multi-sub material and then place each nshapenode under the created ntransformnode. The toolkit plugin will use object's name for its creating a ntransformnode and automatically add index number at the end of the per its child nshapenode. The added index number will be automatically counted and increased by the toolkit plugin. The number of child nshapenodes are same as the number of the sub material.

The above multi-sub material on the image which contains ten sub materials for its material will be result the following when it exported:

    ntransformnode <object_name>
     |
     +- nshapenode <object_name_0>
     |
     +- nshapenode <object_name_1>
     |
     +- ...
     |
     +- nshapenode <object_name_10>

@subsection NMaxHowtoMEditorShellMaterials Shell Materials ...

@subsection NMaxHowtoMEditorCubemap CubeMap ...

@section NMaxHowtoMEditorOverviewExistingShaders Overview of Existing Shaders

The toolkit comes from the current CVS. You are encouraged to add your own shaders, or even implement a completely new shader library.

@section NMaxHowtoMEditorShaderXMLFile Shaders and the shader.xml file

Shader files reside under "home:data/shaders. Each supported render path has its own subdirectory where the actual effect(.fx) files are located (2.0 for DX9 shaders, fixed for fixed function DX7 shaders). Common shader files are located in the lib subdirectory.

The shaders.xml file describes the shader properties for the 3DS Max toolkit plugin, for instance which shader attributes exist, which shader attributes should be shown in the Material Editor, what their data types and default values are, etc.

To add a new shader to the shader library:

You can also edit the properties of the shader.xml with Simple Shader Browser which can be found in the $nebula2/utils directory. Run shader.py and it will brings the window like the following image:

shdbrowser.png

Simple Shader Browser

Make sure you've aleady installed python 2.4 and wxpython 2.6.x (or higher for both of them) on your system before you run shader.py.

That's all to add a new shader.