Instance Method

initWithName:semantic:textureSampler:

Initializes a material property with a texture sampler object.

Declaration

- (instancetype)initWithName:(NSString *)name semantic:(MDLMaterialSemantic)semantic textureSampler:(MDLTextureSampler *)textureSampler;

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.

textureSampler

A texture sampler object.

Return Value

A new material property object whose type property is MDLMaterialPropertyTypeTexture.

Discussion

Unlike the URL to a texture image, a texture sampler object specifies both a texture image and parameters for rendering that image.

See Also

Creating a Material Property

- initWithName:semantic:

Initializes a material property without a value.

- initWithName:semantic:string:

Initializes a material property with a string value.

- initWithName:semantic:URL:

Initializes a material property with a URL value.

- initWithName:semantic:color:

Initializes a material property with a color value.

- initWithName:semantic:float:

Initializes a material property with a scalar value.

- initWithName:semantic:float2:

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

- initWithName:semantic:float3:

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

- initWithName:semantic:float4:

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

- initWithName:semantic:matrix4x4:

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