- This page provides an overview about how to properly use the Hero Material/Shader in 3ds Max and Maya.
HeroMaterial, also referred to simply as Material is a way to define the surface of a mesh. It is a collection of textures and shader settings to enhance an object's surface. This is done by the artists in 3ds Max or Maya. HeroMaterial is designed specifically to work with HeroEngine. You must use the HeroMaterial (or a derivative created for your derived HeroEngine variant) for all of your assets. HeroEngine does not support any other 3ds Max or Maya material types.
- A collection of textures and shader settings placed on an object to enhance the surface.
- Generally the same as a map, however procedurals are also referred to as textures.
- Also called a texture map, is a bitmap file that is used as texture. Our maps are of the .dds format
Below is a breakdown of the different components of the HeroMaterial, click on the 3dsMax or Maya image below to see a large view of the material window:
Diffuse(Color)/Alpha Map Map
- Texture Slot - DXT1 or DXT5 .dds files only.
- None - DXT1 files (No Alpha Channel)
- Gradient - Alpha Channel used for more expensive translucency map
- Mask - Alpha Channel used for Black & White translucency mask
- Displace - Alpha Channel used for Bump Map/Paralax offset map
- Glow Mask - Alpha Channel used for what texels should glow with Bloom (See Glow wiki page)
- Texture Slot - DXT1 or DXT5 .dds files only.
- Specular In Normal - Optional toggle for DXT5 files where alpha channel is the Spec Map.
Texture Address Mode
- Address U: - Wrap or Clamp
- Address V: - Wrap or Clamp
- Effect Selection: - Special Case Shaders such as Hair for characters.
- Translucency: - Used with Gradient Alpha Mode in Diffuse/Alpha Map. If an Alpha Map is not present, the whole model will be transparent based on the value.
- Reflectivity: - How much of the area cube map is visible.
- No Illumination - Toogle on for Unlit; Normal and Specular is not used.
- No Fog - Toogle on for object not to be affected by Fog.
- Ambient Only - Toogle on for object to be effected by Ambient lighting only.
- Glow - Toogle on for use with Glow Mask Alpha Mode in Diffuse/Alpha Map
- Collide Only - Toogle on for Collision only objects. The object will not render, but will offer collision.
- Polygon Mode: - Collide and Ignore are the only supported modes.
- Texture Slot - DXT5 .dds files only. Alpha Channel required for bending between Diffuse and Macro maps.
- UV Multiplier: - Repeat the tiling of the Macro Map.
Detail Map is obsolete and should not be used.
Animated UVs(UV Scroll Speed)
- Channel 0: - Change the Panning Speed of the Diffuse map. U: in the left column. V: in the right column.
- Channel 1: - Change the Panning Speed of the Alpha map. U: in the left column. V: in the right column.
It is required that every unique material used, on any asset you create, have a unique name.
Every asset exported from 3ds Max/Maya contains a list of all materials and their settings used on that asset. This is because 3ds Max/Maya does not have a generic way to expose materials externally from the scene files they are created in. This can cause problems when many asset files attempt to use the same material.
First, HeroEngine considers any material to be unique by its name. So when an asset loads, all materials are added to a list internally. If a given material is already in the list, then uses what it already has. If not, it adds the material and the settings specified in the asset file.
- This means that the art team must be extremely careful to avoid name conflicts. Two different materials cannot have the same name!
- Secondly, when there is an update to a material, every asset that uses that material must be updated in Max with identical changes and re-exported!
HeroBlade detects when an asset loads and it has a material that is the same name as an asset already loaded, but the settings differ. A Material Redefinition Error will apear in the Error window when this happens. It is important that you correct these errors. When such conflicts occur, the first asset loaded "wins"... in other words, it uses the first definition of the material it sees. This may explain why, when you change the material settings on an asset and load it into HeroBlade, it doesn't seem to work: another asset has already established the settings.
When assets load into the game client, a material library entry is made for each material encountered, by name. If a material by the same name is already in memory, it is assumed that it is the same material with all of the same settings. If it isn't, an error is reported (in HeroBlade), and the asset will use the first material's settings (which would obviously be wrong).
Your art team must coordinate to make sure you are using unique names for all of your materials.
Here is an example of what happens when you make the mistake of having two different materials with the same name. I use this one cause its the harder kind to spot.
These 2 HeroMaterials have the same material name. One was applied to a box, the other to a ball. They were loaded into the same scene, first the ball, then the box. The balls version of the material did not have specular set on the normal map, therefor, the box will not have specular either despite the settings are different in the material. This is because they reference the same material name and the balls version was loaded first, so the box's version was ignored.
When this sort of thing happens, your error panel will spit out an error. It will tell you which material has a problem and which object the material was first defined on. Then it will tell you which setting was in conflict. Then you can either change the name of the material by reexporting, or make the settings the same by reexporting as well.
The error will read something like this:
By keeping an eye on material naming and paying close attention to the error panel when adding new assets, you can greatly increase your material efficiency.
One problem that can occur is that, during the art content development process, a material has its settings changed. The asset is re-exported with the new settings. But if other assets use the same material, they will have different settings now! This means that you must make sure the material is updated in all 3ds Max files that use it, and that you re-export all of these assets and update them in the Repository.
If you do not, you will have problems if any two of these assets are every loaded together (highly likely).
It is good to keep a database (spreadsheet) or some other mechanism to keep track of material usages, to help with this problem.
- What is a NON_HERO_MATERIAL error? Sometimes when you enter an area you will see errors displayed in HeroBlade's Errors Panel about NON_HERO_MATERIALs.
A NON_HERO_MATERIAL error means that the specified asset is using a 3ds Max or Maya material instead of the expected HeroMaterial designed specifically to work with HeroEngine. Correcting this error is generally easy and involves the artist opening the 3ds Max/Maya file for the asset and fixing (remove or replace) the materials that are NON_HERO_MATERIALS.
This will also happen if the post process is not run on export, which it should be by default. For example "place2dTexture2" is apart of any Maya material, but it is cleaned up by the post process. Occasionally it is possible for the post process to fail and cause this as well, re-exporting the object almost always fixes it. It is always best to double check and make sure only Hero Materials are on the object.
- Maya users should remove place2dTexture nodes before exporting. Delete these generate nodes from your Hypershade. When creating new File Nodes for a HeroShader, uncheck the "With new texture placement" before clicking on the File button within the Create Render Node dialog as seen below.
HeroEngine Tutorial - 3ds Max Hero Material
How to create and apply Hero Materials in 3ds Max for use in HeroEngine.
HeroEngine Tutorial - Maya Hero Shader
How to create and apply a Hero Shader in Maya for use in HeroEngine.