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:

  1. Create a texture. See Using single textures.

  2. 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.

  3. In the Library > Materials and Textures > Materials select the material.

    ../../_images/select-textured-material.png
  4. In the Properties set the Texture property to the texture you want to use in the material.

    ../../_images/set-texture-property.png
  5. 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.

    ../../_images/set-material-property.png

Creating a cubemap textured material

To create a cubemap textured material:

  1. Create a cubemap texture. See Using cubemap textures.

  2. 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.

  3. In the Library > Materials and Textures > Materials select the material.

    ../../_images/select-cubemap-textured-material.png
  4. In the Properties set the TextureCube property to the cubemap texture you want to use in the material.

    ../../_images/set-texturecube-property.png
  5. 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.

    ../../_images/set-material-property-cubemap.png

Creating a physically-based textured material

To create a physically-based textured material:

  1. 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.

    ../../_images/create-physically-based-textured.png ../../_images/physically-based-textured-material.png
  2. 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

    ../../_images/physically-based-textured-base-color.png
  3. 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.

    ../../_images/physically-based-textured-roughness.png
  4. 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.

    ../../_images/physically-based-textured-metallic.png
  5. 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

    ../../_images/physically-based-textured-normal.png
  6. 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.

    ../../_images/physically-based-textured-occlusion.png
  7. 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. You can use the Intensity (I) property field to adjust the exposure of this color.

  8. To use detail textures:

    1. In the Library > Materials and Textures > Material Types select the material type that your material uses.

      ../../_images/physically-based-textured-material-type.png
    2. 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.

      ../../_images/enable-basecolor-detail-texture.png
    3. 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.

    4. 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.

See also

Using materials

Using material types

Using single textures

Using cubemap textures

Physically-based material properties

Material types and materials