Creating textured materials¶
Use textured materials to render a texture on a mesh. In Kanzi you can use textured materials with:
Single textures use a single image for the texture.
Cubemap textures combine six square-shaped images into one texture to represent reflections of the environment. Each image represents the scenery in one of the six directions along the x, y, and z axes from the viewpoint of the cubemapped object.
Physically-based textured materials use multiple textures to define the appearance of the material. See Creating a physically-based textured material.
Creating a textured material¶
To create a textured material:
Create a texture. See Using single textures.
Create or use a material which uses a material type that supports textures. See Using material types and Using materials.
For example, use the TexturedMaterial or VertexPhongTexturedMaterial.
In the Library > Materials and Textures > Materials select the material.
In the Properties set the Texture property to the texture you want to use in the material.
In the Node Tree select the node on which you want to use the textured material and in the Properties set the Material property to the textured material.
Creating a cubemap textured material¶
To create a cubemap textured material:
Create a cubemap texture. See Using cubemap textures.
Create or use a material which uses a material type that supports cubemap textures. See Using material types and Using materials.
For example, use the VertexPhongTexturedCubeMaterial.
In the Library > Materials and Textures > Materials select the material.
In the Properties set the TextureCube property to the cubemap texture you want to use in the material.
In the Node Tree select the node on which you want to use the cubemap textured material and in the Properties set the Mesh Material property to the cubemap textured material.
Creating a physically-based textured material¶
To create a physically-based textured material:
Create or use a material which uses a physically-based material type that supports textures.
For example, use the PhysicallyBasedTexturedMaterial. If your project does not contain that material, in the Library > Materials and Textures press Alt and right-click Material Types, and select PhysicallyBasedTextured.
The PhysicallyBasedTextured material type by default enables adjusting materials based on their metalness and roughness.
To set the main texture for the material, in the Properties set:
Base Color Texture to the texture that contains the base color map for the material
Base Color Factor to the color that you want to use to filter values from the Base Color Texture
To set the roughness of the material, in the Properties set:
Roughness Texture to the texture that contains the roughness map
Kanzi reads the roughness map from the green color channel of the texture. You can use this same texture to set also the metallic and occlusion maps.
Roughness Factor to scale the values provided by the Roughness Texture:
For a rough, diffuse surface set the property value to 1.
For a smooth, glossy surface set the property value to 0.
To set the metalness of the material, in the Properties set:
Metallic Texture to the texture that contains the metallic map
Kanzi reads the metallic map from the blue color channel of the texture. You can use this same texture to set also the roughness and occlusion maps.
Metallic Factor to scale the values provided by the Metallic Texture:
For a material whose reflective behavior fully resembles that of a metal, set the property value to 1.
For a dielectric material set the property value to 0.
To set the normal map for the material, in the Properties set:
Normal Texture to the texture that contains the normal map
Normal Scale to set the intensity of the Normal Texture
To set the occlusion map for the material, in the Properties set:
Occlusion Texture to the texture that contains the occlusion map
The occlusion map provides information about which areas of the surface receive indirect lighting. Kanzi reads the occlusion map from the red color channel of the texture. You can use this same texture to set also the roughness and metallic maps.
Occlusion Strength to set the intensity of the Occlusion Texture.
To set the areas where the material emits light, in the Properties set:
Emissive Texture to the texture that describes the parts of the surface that emit light
Emissive Factor to the color that you want to use to filter values from the Emissive Texture
To use detail textures:
In the Library > Materials and Textures > Material Types select the material type that your material uses.
In the Properties in the Preprocessor Defines property enable the use of detail textures.
For example, to enable setting a detail texture that contains the base color for the material, set the value of KANZI_SHADER_USE_BASECOLOR_TEXTURE_DETAIL to 1.
In the Properties under the Property Types click Sync with Uniforms.
Kanzi Studio adds to the physically-based textured material, which uses this material type, the properties that you can use to set the detail textures for the material.
In the Library > Materials and Textures > Materials select the physically-based textured material and in the Properties set the detail textures that you enabled for the material.
For example, if you enabled KANZI_SHADER_USE_BASECOLOR_TEXTURE_DETAIL, set:
Detail Base Color Texture to the detail texture that contains the base color for the material
Detail Base Color Factor to the color that you want to use to filter values from the Detail Base Color Texture
Kanzi alpha-blends this color with the base color that you set with the Base Color Factor property.