<!--
{
  "availability" : [
    "iOS: 9.0.0 -",
    "iPadOS: 9.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.11.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "ModelIO",
  "identifier" : "/documentation/ModelIO/MDLNormalMapTexture/init(byGeneratingNormalMapWith:name:smoothness:contrast:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Model I/O"
    ],
    "preciseIdentifier" : "c:objc(cs)MDLNormalMapTexture(im)initByGeneratingNormalMapWithTexture:name:smoothness:contrast:"
  },
  "title" : "init(byGeneratingNormalMapWith:name:smoothness:contrast:)"
}
-->

# init(byGeneratingNormalMapWith:name:smoothness:contrast:)

Initializes a normal map to be generated from the specified texture.

```
init(byGeneratingNormalMapWith sourceTexture: MDLTexture, name: String?, smoothness: Float, contrast: Float)
```

## Parameters

`sourceTexture`

The texture from which to generate a normal map.

`name`

The [`name`](/documentation/ModelIO/MDLNamed/name) property for the new texture object.

`smoothness`

A number between `0.0` and `1.0` indicating how much the texture should be smoothed before the normal map is generated. A value of `0.0` means that the texture is not smoothed at all before being processed.

`contrast`

A value used to magnify the effect of the generated normal map. A value of `1.0` indicates no magnification is applied.

## Return Value

A new normal map texture object.

## Discussion

This initializer does not generate texel data; the [`MDLNormalMapTexture`](/documentation/ModelIO/MDLNormalMapTexture) class automatically generates data when you use one of the [`MDLTexture`](/documentation/ModelIO/MDLTexture) methods listed in Accessing Texture Data. The generated texture uses the same dimensions and other properties as the source texture.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)