In some simple scenes, you might not want to calculate lighting. The engine provides UnlitMaterial, which uses the most streamlined shader code and only requires color or texture to render. Unlit material is suitable for rendering baked models. It only needs a basic texture or color to display the high-quality rendering results obtained from offline rendering. However, the downside is that it cannot display real-time light and shadow interactions because Unlit is determined by the texture and is not affected by any lighting.
Parameter | Application |
---|---|
baseColor | Base color. Base color * Base color texture = Final color. |
baseTexture | Base texture. Used in conjunction with the base color, it is a multiplicative relationship. |
tilingOffset | Scaling and offset of texture coordinates. It is a Vector4 data that controls the scaling and offset of texture coordinates in the uv direction. Refer to example |
If you need to use the material through a script, you can go to the material usage tutorial.
As introduced in the baking tutorial, if we have already created the baked map and want a convenient material where the color is only influenced by the baked texture, without adding lights, debugging normals, or adjusting advanced properties like metallic roughness, then you can try Galacean's UnlitMaterial. glTF has a dedicated KHR_materials_unlit plugin, which Galacean will parse to generate Unlit material.
Test model: TREX.zip
Next, we will introduce how to export a glTF file with the unlit plugin using Blender software.
The default shader type is BSDF. We need to change the shader type in the surface material properties to Background.
Add the baked texture and connect Color and Shader together.
If the preview is normal, export the glTF.
Drag the exported glTF file into the editor or glTF Viewer. If the material type is UnlitMaterial, it means that the KHR_materials_unlit extension has been exported, and Galacean has parsed it into an Unlit material.