Contents

init(name:semantic:color:)

Initializes a material property with a color value.

Declaration

convenience init(name: String, semantic: MDLMaterialSemantic, color: CGColor)

Parameters

  • name:

    A descriptive name for the material property. For details, see the Name property.

  • semantic:

    The semantic meaning for the material property’s value. For details, see the Semantic property.

  • color:

    The color value for the material property.

Return Value

A new material property object whose type property is MDLMaterialPropertyType.color.

Discussion

A material property with a color value uses a uniform color for all pixels rendered using the material. This option is useful for base colors of solid-color objects, and also for material semantics where variation across the surface of the material is unnecessary. To vary colors across a surface, use a texture image instead.

See Also

Creating a Material Property