Materials and textures¶
A material describes how a surface is rendered. For authored 3D assets, start with the metallic-roughness PBR workflow and import a glTF file. The importer creates materials from the asset; use PBR and environment lighting to set up the scene that illuminates them.
A PBR material commonly uses a base color and optional textures for base color, metallic/roughness, normals, occlusion and emissive output. A normal map changes the apparent surface direction; it does not add physical geometry. If a normal map looks inverted or seams are visible, check the map convention, exported normals and tangents, and the engine's importer settings.
For procedural geometry, create the PBR material explicitly:
Material material = new Material(assetManager, "Common/MatDefs/Light/PBRLighting.j3md");
material.setColor("BaseColor", new ColorRGBA(0.9f, 0.5f, 0.1f, 1f));
material.setFloat("Metallic", 1f);
material.setFloat("Roughness", 0.35f);
geometry.setMaterial(material);
A material definition determines its available parameter names and rendering behavior. Check the correct definition before setting parameters. For unlit surfaces, legacy assets or custom shaders, see other materials.