Initializer

init(name:semantic:url:)

Initializes a material property with a URL value.

Declaration

convenience init(name: String, semantic: MDLMaterialSemantic, url URL: URL?)

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.

url

The URL value for the material property—typically, the URL to a texture image.

Return Value

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

Discussion

A renderer (or other software component processing a material) is responsible for loading a texture image from the specified URL.

See Also

Creating a Material Property

init(name: String, semantic: MDLMaterialSemantic)

Initializes a material property without a value.

init(name: String, semantic: MDLMaterialSemantic, string: String?)

Initializes a material property with a string value.

init(name: String, semantic: MDLMaterialSemantic, textureSampler: MDLTextureSampler?)

Initializes a material property with a texture sampler object.

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

Initializes a material property with a color value.

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

Initializes a material property with a scalar value.

init(name: String, semantic: MDLMaterialSemantic, float2: vector_float2)

Initializes a material property with a 2-component vector value.

init(name: String, semantic: MDLMaterialSemantic, float3: vector_float3)

Initializes a material property with a 3-component vector value.

init(name: String, semantic: MDLMaterialSemantic, float4: vector_float4)

Initializes a material property with a 4-component vector value.

init(name: String, semantic: MDLMaterialSemantic, matrix4x4: matrix_float4x4)

Initializes a material property with a 4 x 4 matrix value.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software