Create stunning AI-generated skybox assets within Unity for use as HDRIs in game dev and immersive projects.
In order to use this package you need to provide an API key from Blockade Labs in the API section. Get one at https://api.blockadelabs.com.
Option 1: Install from the Unity Asset Store
Window > Package Manager
My Assets
Blockade Labs SDK
and click Install
.Option 2: Install with OpenUPM-CLI:
openupm add com.blockadelabs.sdk
Option 3: Install as a git package
Window > Package Manager
+ > Add package from git URL...
https://github.com/Blockade-Games/BlockadeLabs-SDK-Unity.git
The Blockade SDK can be used standalone or optionally together with a Pusher websockets package. If installed, the Pusher package will use websockets to listen for any changes in the Asset Generation Process on Runtime and make updates accordingly, which should improve performance for your games on Runtime.
You can learn more about the Pusher package here.
The Pusher library requires .NET Framework runtime:
Edit > Project Settings > Player > Api Compatibility Level
to .NET Framework
.Option 1: Install the Pusher package with git:
Window > Package Manager
+ > Add package from git URL...
https://github.com/pusher/pusher-websocket-unity.git#upm
Option 2: Install the Pusher package with OpenUPM-CLI:
openupm add com.pusher.pusherwebsocketunity
After installing the Pusher package on 2021.x.x versions you might get an error saying:
Assembly 'Packages/com.pusher.pusherwebsocketunity/Packages/PusherClient.2.1.0/lib/net472/PusherClient.dll' will not be loaded due to errors: PusherClient references strong named Newtonsoft.Json Assembly references: 12.0.0.0 Found in project: 13.0.0.0.
To resolve the issue go to Edit > Project Settings > Player > Other Settings > Configuration > Assembly Version Validation
and disable Version Validation
.
Refer to the changelog file here.
2020.3 and newer.
After importing the package, open Packages > Blockade Labs SDK > Scenes > SkyboxScene
.
Note: Demo scene uses Text Mesh Pro elements for runtime UI. If you haven't imported TMP Essentials
you will be prompted to do so after you load the scene. When you are done importing TMP Essentials,
reload the scene by either double clicking on it in the Assets/Samples/Blockade Labs SDK/Scenes
.
The scene contains two notable gameObjects:
Blockade Labs Skybox Generator
generates skybox textures and materials.Blockade Labs Skybox Mesh
generates and configures a mesh which combines the skybox with a generated depth map.To be able to generate assets on runtime you just need to follow these simple steps:
Blockade Labs Skybox Generator
gameObject.API key
in the designated field.Assets/Blockade Labs SDK
for use in your project.You can generate a new skybox that will replace the existing one by following these steps.
Blockade Labs Skybox Generator
gameObject.API key
in the designated inspector field.Apply
button.Prompt
field.Generate Skybox
Button.Assets/Blockade Labs SDK
for use in your project.Move Scene Camera to Skybox
to see the skybox in the scene view.For detailed information on how skyboxes work in Unity, see using skyboxes.
Window > Rendering > Lighting
.Environment
tab.skybox material
into the the Skybox Material
field.Environment Lighting Source
is set to Skybox
, then click Generate Lighting
.GameObject > Volume > Global Volume
.HDRP volume profile
in to the Profile
field.The Blockade Labs Skybox Generator
component generates a color texture and a depth texture, which are assigned to the skybox material.
The Blockade Labs Skybox Mesh
component generates a Tetrahedron mesh to apply this material. You can configure the Mesh Density
and Depth Scale
fields. The mesh and material will be configured to apply the generated depth map to deform the mesh.
Try zooming in and out with the scroll wheel in play mode to see the effect of the depth scale!
If you want to use the generated mesh in your own scene, click Save Prefab
, then drag the new prefab into your scene.