Table of Contents

Scripts > FBX Processor for 3ds Max

Learn how to properly process FBX SpeedTree exports when importing into Autodesk's 3ds Max.

This script has been deprecated. We have a new, streamlined process outlined here. This script and its documentation will be included until the process of migrating all of the functionality contained within is complete.

If you were to import a SpeedTree FBX straight into 3ds Max, the standard 'FBX' importer supports only a few of the texture options that are used in the SpeedTree Modeler (such as opacity in the alpha channel of the diffuse map). To ensure that materials are recreated the same as in the Modeler, you must import and process your SpeedTree FBX files with this utility.


SpeedTree FBX Processor

Import and Process

Use this button to import and process an FBX or OBJ file that was exported from the SpeedTree Modeler.

Process Selected

Use this button to process an object already in the scene.

Single Material ID
This option will limit the processing of selected objects to a specific material ID. Most SpeedTree FBX files are imported as a single mesh, with a mult-sub material assigned to specific material ID's. For instance, to reprocess the settings on just the bark, enable this option and set the number spinner to the material ID of the bark material.

Settings

Backface Cull
If enabled, the processed materials will not be “2-sided” and will have backface culling enabled if using the “Arch and Design (mi)” option. The processed objects will have backface culling enabled via the “Object Properties” dialog. When disabled, all backface culling flags are disabled and “2-sided” materials are enabled.

Normal Map / Bump Map
This option lets the user determine whether to use normal or bump mapping for surface relief. Bump mapping may work better under some renderers/settings.

NOTE: Bump mapping requires grayscale height maps for all materials. We provide these in the alpha channel of the normal map for our bark and bark detail materials, but not for other materials such as leaves.

Render Vertex Colors

If enabled, processed materials will be set to blend the vertex colors with the diffuse material. This will make baked ambient occlusion renderable. If using this method, adding additional ambient occlusion such as radiosity or final gather are optional since vertices are already shaded with the baked-in ambient occlusion.

The FBX exporter in the SpeedTree Modeler has an option to encode the diffuse color of assigned color sets in the same way. In this case, the diffuse color of the color sets will be rendered as vertex colors either in place of or along with ambient occlusion.

(Left) Ambient occlusion included, (Right) no additional ambient occlusion.

Include Translucency
If enabled, the processing will create a “Translucent Shader” material if it contains transmission information (located in the alpha channel of the specular/trans map, and optionally the emission channels). These materials are more complex but more realistic with the scanline renderer, and if both using mental ray and “Use Arch and Design (mi)” is checked, translucency will be enabled within the Arch & Design shader.

(Left) Translucency included, (Right) no translucency.

Change Color To…
Transmission color can be brought over to 3ds Max via the “transmission to emissive” option on the mesh exporter. If this option is omitted, the 'FBX' Processor can encode a new transmission color by enabling this checkbox and editing the color swatch before processing the selection. This option is intended for use on processing objects already in the scene rather than on new imports.

Intensity Scale
A scalar for the intensity of the transmission effect.

Use Mask
A toggle on whether to use the translucency mask of the material or not.

Invert Mask
Depending on your render settings, particularly with the mental ray renderer, you may need to invert the translucency mask for the effect to appear correctly in your scene. If your translucency mask is masking out the wrong parts of the material, toggle this checkbox and process your objects again.

Apply To Solid Objects
Light transmission (translucency) looks different depending on if your model is intended to be a thick tree or a wispy plant. For instance, the branches of a tree do not transmit light, but the stems of a flower or plant do. By default, this utility will only apply translucency to objects that contain an opacity mask and a transmission mask (i.e. leaves). To treat all objects as translucent, enable this option. When enabled, light will pass through solid branches as well as leaves.

Mental Ray / iRay Settings

The following group of settings only apply to scenes with mental ray (or the new iRay renderer) assigned as the current renderer, since they implement various mental ray specific shaders.

Use Arch and Design (mi)
When enabled, all imported materials are converted into “Arch & Design (mi)” shaders. We find that this shader family provides the most realistic surfaces available with the rendering packages included with 3ds Max. The Arch & Design shader provides great translucency, displacement, and reflective components, and plays nice with Daylight Systems, mr Sun and Sky, and Gamma/LUT Correction. As such, it is appropriate for all types of materials that can be generated in the SpeedTree Modeler.

Include Displacement
When enabled, any processed materials that do not contain opacity or translucency maps, but do contain height data in the normal map alpha channel will have displacement enabled in the material. It is recommended to calculate a “displacement volume scalar” so that very thin branches only receive a fraction of the displacement offset that the larger branches receive. See the next section for more details.

Fix Normal Map Gamma
If your scene has “Gamma/LUT Correction” enabled, chances are that your bitmaps are set to have an input gamma of 2.2. This checkbox will ensure that normal maps are NOT gamma corrected by applying a “Utility Gamma & Gain (mi)” shader to de-gamma all normal maps. Otherwise, your normal maps will skew badly due to the input gamma settings.

File Settings

Create UNC Filepaths
When checked, processed objects will be assigned bitmap file pathnames that conform to the UNC (Universal Naming Convention) format. This is necessary if the imported models are to be rendered over a network, since otherwise the server will assume that the files are stored on the local machine. The UNC format would convert "C:\\Trees\Sample\Bark.tga" to "\\COMPUTER_NAME\C$\Trees\Sample\Bark.tga", where COMPUTER_NAME is the name of the user's machine.


Displacement Calculator

Since the typical tree model has both very large and very small branches that share the same bark, using a constant displacement offset on all branches will not work very well; the same amount of offset that is appropriate on the trunk will look far too rough for the smallest branches on the tree and vice versa. To accommodate this difference, you will need to compare the volumes of each branch and scale displacement based on the differences in volume. Calculate this displacement scaling with the options in the “Displacement Calculator” group.

Material ID
This option will limit the processing of selected objects to a specific material ID. Most SpeedTree 'FBX' files are imported as a single mesh, with a mult-sub material assigned to specific material ID's. For instance, to reprocess the settings on just the bark, enable this option and set the number spinner to the material ID of the bark material.

Fade Open Edges
If you are planning on displacing both branch and cap geometry, you may encounter separation where these two geometry types meet due to both sets of edge vertices becoming displaced. To avoid this artifact, make sure that “Fade open edges” is enabled before calculating displacement. The result is that displacement is faded to zero for all open edge vertices, eliminating displacement separation between branches and caps.

Volume Scalar
Since the difference in volume between the largest branch (usually the trunk) and the smaller twigs can be orders of magnitude, a linear calculation will cause most branches to be assigned a volume value that is far too low to be visible in a render. Set the “Volume scalar” value to something much lower than 1.0 for better results. You can think of this value roughly as “the percentage of the greatest volume where displacement starts to decay” - basically an exponent. The default value of 0.5 will render full displacement on the majority of major branches, and only the last branch level will be void of displacement.