TEN ‐ Material system workflow - Tomb-Raider-Level-Editor/Tutorials GitHub Wiki
Written by Lwmte
--
Hi everyone! With the release of TEN 1.10, I believe a lot of people may want an insight into how new material system works. Here is the video tutorial for it, along with a transcript, if you prefer text-based manuals!
https://www.youtube.com/watch?v=SE5_8euPEJg
So, the new version of Tomb Engine is out, and the biggest feature is material system. What is it and how to use it?
Material system allows you to link additional images (or maps) to your textures, that can change the appearance of the surface to which the texture is applied. You can use material system with both level textures in Tomb Editor, and with object textures in WadTool. In Tomb Editor, you will now see a new button in the texture panel, which will open a material editor, that allows you to define additional maps. Let's explain the purpose for all of them:
Normal map
It is a map that defines in which direction every pixel of your texture will reflect light. This applies to room lights and dynamic lights, and also to reflections, which we will describe later. It's important to note that Tomb Editor can automatically generate normal maps for your level textures in "Bumpmaps" dialog window. If you didn't assign a normal map in material editor but assigned bump level, those autogenerated normal maps will be used instead. If you assigned both - normal map from the material editor takes priority.
Ambient occlusion map
This one acts like a "shadow map" for your texture, allowing you to keep certain areas of it in shades, even if surface is reflective or lit by a bright light - unlike baked-in shadows, which will brighten under the light sources.
Specular map
Defines how reflective the surface is, with brighter parts being more reflective, and darker parts being less reflective. If material type is default - it acts like classic "shininess" effect, reflecting only dynamic light sources. However, if material type is set to reflective or skybox reflective - the surface will reflect the surroundings, as in original Tomb Raider 1 for Golden Lara, or the skybox, as in remasters for windows in Venice. If specular map is not defined for reflective or skybox reflective surfaces, engine takes the default value for the reflection.
Roughness map
This one may work together with specular map, and defines how blurry the specular highlight will be. The brighter roughness map is, the more intense and sharp specular highlight is. And vice versa - darker areas of a specular map will result in less sharp and more blurry highlights. Having roughness map is not mandatory - specular sharpness will just use default value if you didn't define roughness map. Also it doesn't define reflective material blurriness at the moment, but it may be added in the future.
Height map
Defines the height of every pixel of your texture, with white parts being the highest level, and black parts being the lowest. It allows you to use quite fancy visual effect called parallax mapping. By assigning heightmap for your texture, you can make it pop, like a real 3D model, without actually remodeling the surface. Similar effect was used in remasters and it's extremely useful for ladders, brick walls or generally any carved out surfaces. However, due to technical limitations of the feature, you can't use it together with:
- Animated textures
- Double-sided textures
- Mirrored textures
- Floor surfaces which spawn footprints
- And bullet holes or explosion marks - these are disabled for parallax surfaces.
Parallax textures can't be seamlessly tiled, so, to avoid artifacts on edges, you must make sure that heightmap fades to white on texture edges. Parallax mapping is expensive, so you should use it sparingly in important places of your level. Don't slap it on every single sufrace of your rooms.
Emissive map
Defines "glowing" areas of your texture, which will always stay bright, even if surface is in the shadows. Additionally it creates a glowing effect around the surface. You can extensively use this map to simulate bright surfaces that emit light - TV screens, light bulbs and LEDs on control panels, lava, and many more. You can also use emissive maps in combination with video textures - just assign emissive map to a video texture placeholder frame in animated textures window.
The next important element in the material editor is material type. At the moment, you can select three types of materials:
- Default. This is the standard textured surface without additional reflective properties.
- Reflective. This one uses screen-space reflection effect, similar to Golden Lara effect in original Tomb Raider 1. This reflection method has a drawback of being unstable on flat surfaces, such as room geometry.
- Skybox reflective. This one uses your skybox or horizon object for the reflection effect, and is generally more stable on any types of surfaces, including flat room geometry. You can safely use it for window or floor reflections as well.
As mentioned before, if you will define reflective or skybox reflective material type, but won't define specular map, whole texture will be treated as reflective.
Material system is fully supported for the objects as well. It is available in the mesh editor window in WadTool. To use it, you must add a new texture in the texture panel via new option: "Add external texture". This option keeps your texture as a separate file instead of uploading it into your wad file. Same option called "Keep textures external" is available in the import mesh dialog.
Also note that if you will add the same texture in both Tomb Editor and WadTool, they will share the material properties - that is because properties are saved in an .xml file, kept along with the texture file in the same folder. For builders who prefer more automated material workflow and familiar with the concept of sidecar loading, it is possible to keep additional maps alongside the original texture using specific suffixes. These maps will be loaded automatically, without the need to manually define them in the material editor window.
Let’s assume your texture file is called face.png. Then files from the same folder with these suffixes will be auto-loaded as...
- face_n.png - Normal map
- face_h.png - Height map
- face_s.png - Specular map
- face_ao.png - Ambient occlusion map
- face_r.png - Roughness map
- face_e.png - Emissive map
Remember that you can combine diffrent maps in different combinations for different visuals and artistic purposes. Don't hesitate to experiment and always ask for help, if you struggle to understand certain aspects of the workflow - we will be happy to provide support. Happy building!