<!--
{
  "availability" : [
    "iOS: 15.0.0 -",
    "iPadOS: 15.0.0 -",
    "macCatalyst: 15.0.0 -",
    "macOS: 12.0.0 -",
    "tvOS: 26.0.0 -",
    "visionOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "RealityKit",
  "identifier" : "/documentation/RealityKit/PhysicallyBasedMaterial/Specular-swift.struct/init(floatLiteral:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "RealityKit"
    ],
    "preciseIdentifier" : "s:17RealityFoundation23PhysicallyBasedMaterialV8SpecularV12floatLiteralAESf_tcfc"
  },
  "title" : "init(floatLiteral:)"
}
-->

# init(floatLiteral:)

Creates an object from single value.

```
init(floatLiteral value: Float)
```

## Parameters

`value`

A value from 0.0 to 1.0 to use as the specular value for
the material.

## Discussion

RealityKit automatically draws *specular highlights* for physically
based materials using the values of various properties, primarily
[`roughness`](/documentation/RealityKit/PhysicallyBasedMaterial/roughness-swift.property) and
[`metallic`](/documentation/RealityKit/PhysicallyBasedMaterial/metallic-swift.property). Specular
highlights are bright spots of reflected light that appear on shiny
objects.

![An illustration showing a sphere and a cube with rounded corners.](images/com.apple.RealityKit/PhysicallyBasedMaterial-Specular-swift-struct-init(floatLiteral:)-1@2x.png)

While many real-world objects can be accurately and realistically
simulated with just the core PBR properties, you can create
additional realistic effects by augmenting the specular highlights.

This initializer creates a
[`PhysicallyBasedMaterial.Specular`](/documentation/RealityKit/PhysicallyBasedMaterial/Specular-swift.struct) object from a
single value that applies to the entire material.

---

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)