Contents

init(name:semantic:float:)

Initializes a material property with a scalar value.

Declaration

convenience init(name: String, semantic: MDLMaterialSemantic, float value: Float)

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.

  • value:

    The scalar floating-point value for the material property.

Return Value

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

Discussion

Scalar values are appropriate for some semantics, such as the MDLMaterialSemantic.specularTint semantic (which controls the balance between material and light colors in specular highlighting). Providing a float value for the material property applies that value for all pixels rendered using the material; to provide variation in the semantic’s value across a surface, use a grayscale texture image instead.

See Also

Creating a Material Property