---
title: "init(skybox:specular:diffuse:)"
framework: realitykit
role: symbol
role_heading: Initializer
path: "realitykit/environmentresource/init(skybox:specular:diffuse:)"
---

# init(skybox:specular:diffuse:)

Creates an EnvironmentResource a skybox, specular and diffuse texture resources.

## Declaration

```swift
@MainActor convenience init(skybox skyboxTexture: TextureResource?, specular specularTexture: TextureResource, diffuse diffuseTexture: TextureResource) throws
```

## Parameters

- `skyboxTexture`: A skybox texture to preserve. If nil, derives a low-resolution proxy from other inputs for lower memory usage.
- `specularTexture`: An image based light specular texture.
- `diffuseTexture`: An image based light diffuse texture.

## Discussion

Discussion note: SkyboxGenerator and ImageBasedLightTextureGenerator can generate required textures into a LowLevelTexture, itself wrapped as a TextureResource. note: The skybox is not needed for image based lighting with VirtualEnvironmentProbeComponent and ImageBasedLightComponent.

## See Also

### Creating an environment resource

- [init(named:in:skyboxMode:)](realitykit/environmentresource/init(named:in:skyboxmode:).md)
- [EnvironmentResource.SkyboxMode](realitykit/environmentresource/skyboxmode.md)
- [init(equirectangular:options:)](realitykit/environmentresource/init(equirectangular:options:)-8e7wv.md)
- [init(equirectangular:options:)](realitykit/environmentresource/init(equirectangular:options:)-5bxl3.md)
