Using Material Editor
- NMaxHowtoMEditorOverview
- NMaxHowtoMEditorMaterialEditor
- NMaxHowtoMEditorSupportedMaterialTypes
- NMaxHowtoMEditorMultiSubMaterials
- NMaxHowtoMEditorShellMaterials
- NMaxHowtoMEditorCubemap
- NMaxHowtoMEditorOverviewExistingShaders
- NMaxHowtoMEditorShaderXMLFile
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

Setup material

Select Nebula2 custom material in the Material Browser
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.

Nebula2 custom material 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.

Multi/Sub material on the Material Editor
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.
- Standard the default shader with ambient, diffuse and specular lighting components, alpha testing, one color texture and one bump texture
- Standard Skinned the standard shader for smooth skinned characters skins; implements vertex skinning completely on the GPU. See Characters for details.
- Standard Alpha the standard alpha blended shader. Allows setting source and destination blend factors directly (additive blending would be Source=One Dest=One; normal alpha blending is Source=SrcAlpha, Dest=InvSrcAlpha)
- Standard Alpha(2 Layers) a 2-layered transparent shader
- Standard Blended the standard shader for blend shapes. Assigning a blend shape shader to a geometry indicates to the plugin that the geometry should be exported as a blend shape. See Blend Shapes for details.
- Standard Layered this a 4 layer shader for terrains (rather inefficient at the moment, since it uses 4 passes.
- Standard Lightmapped this is a shader for lightmapped geometry.
- Leaf this is a shader which implements dynamic sprite leafs in a tree crown,
- Tree this is a shader for geometry which should swing in the wind, like trees, bushes etc.
- Ocean a DX9-only ocean shader ported from an NVIDIA example shader
- Skybox, Cubemapped Skybox, Particle (Additive) and Particle (Alpha Blended) are OBSOLETE shaders
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:
- first create a new FX file which contains the shader's render states, texture unit configurations and vertex/pixel shader programs
- add a new shader entry to the shaders.xml file and describe the shader parameters for the 3DS Max plugin
- add a new entry to the renderpath.xml file in proj:data/shaders/2.0 and proj:data/shaders/fixed
- finally restart 3DS Max so that shaders.xml is re-parsed
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:

Simple Shader Browser
shader.py
.
That's all to add a new shader.