---
title: "init(name:semantic:textureSampler:)"
framework: modelio
role: symbol
role_heading: Initializer
path: "modelio/mdlmaterialproperty/init(name:semantic:texturesampler:)"
---

# init(name:semantic:textureSampler:)

Initializes a material property with a texture sampler object.

## Declaration

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

## Parameters

- `name`: A descriptive name for the material property. For details, see the doc://com.apple.modelio/documentation/ModelIO/MDLMaterialProperty/name property.
- `semantic`: The semantic meaning for the material property’s value. For details, see the doc://com.apple.modelio/documentation/ModelIO/MDLMaterialProperty/semantic property.
- `textureSampler`: A texture sampler object.

## Return Value

Return Value A new material property object whose type property is MDLMaterialPropertyType.texture.

## Discussion

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

- [init(name:semantic:)](modelio/mdlmaterialproperty/init(name:semantic:).md)
- [init(name:semantic:string:)](modelio/mdlmaterialproperty/init(name:semantic:string:).md)
- [init(name:semantic:url:)](modelio/mdlmaterialproperty/init(name:semantic:url:)-2ldk4.md)
- [init(name:semantic:color:)](modelio/mdlmaterialproperty/init(name:semantic:color:).md)
- [init(name:semantic:float:)](modelio/mdlmaterialproperty/init(name:semantic:float:).md)
- [init(name:semantic:float2:)](modelio/mdlmaterialproperty/init(name:semantic:float2:).md)
- [init(name:semantic:float3:)](modelio/mdlmaterialproperty/init(name:semantic:float3:).md)
- [init(name:semantic:float4:)](modelio/mdlmaterialproperty/init(name:semantic:float4:).md)
- [init(name:semantic:matrix4x4:)](modelio/mdlmaterialproperty/init(name:semantic:matrix4x4:).md)
