<!--
{
  "availability" : [
    "iOS: 10.0.0 -",
    "iPadOS: 10.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.12.0 -",
    "tvOS: 10.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "MetalKit",
  "identifier" : "/documentation/MetalKit/MTKTextureLoader/newTexture(name:scaleFactor:bundle:options:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "MetalKit"
    ],
    "preciseIdentifier" : "c:objc(cs)MTKTextureLoader(im)newTextureWithName:scaleFactor:bundle:options:error:"
  },
  "title" : "newTexture(name:scaleFactor:bundle:options:)"
}
-->

# newTexture(name:scaleFactor:bundle:options:)

Synchronously loads image data and creates a Metal texture from the named texture asset in an asset catalog.

```
func newTexture(name: String, scaleFactor: CGFloat, bundle: Bundle?, options: [MTKTextureLoader.Option : Any]? = nil) throws -> any MTLTexture
```

## Parameters

`name`

The name of a texture in an asset catalog.

`scaleFactor`

The scale factor of texture to request.

    In iOS and tvOS, pass the     <doc://com.apple.documentation/documentation/QuartzCore/CALayer/contentsScale>     value of the view where you plan to display texture content.

    In macOS, pass the     <doc://com.apple.documentation/documentation/AppKit/NSWindow/backingScaleFactor>     value of the window where you plan to display texture content.

`bundle`

The resource bundle containing the asset catalog to load textures from.

`options`

A dictionary describing any additional texture loading steps. See  <doc://com.apple.documentation/documentation/GLKit/texture-loading-options>.

    When using this method, the texture loader ignores the [`generateMipmaps`](/documentation/MetalKit/MTKTextureLoader/Option/generateMipmaps)    , [`SRGB`](/documentation/MetalKit/MTKTextureLoader/Option/SRGB)    , [`cubeLayout`](/documentation/MetalKit/MTKTextureLoader/Option/cubeLayout)    , and [`origin`](/documentation/MetalKit/MTKTextureLoader/Option/origin)     options.

## Return Value

A fully loaded and initialized Metal texture, or `nil` if an error occurred.

## Discussion

---

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)