With the release of Depthkit Expansion Packages for Unity (Phase 10) comes support for Unity version 2022!
Users attempting to setup a game object with the Depthkit Livestream Player may notice that it fails to receive and render the livestream from the Depthkit app, and produces the following error:
d3d11: failed to create 2D texture shader resource view id=1666
This is due to an issue with KlakSpout in Unity 2022, which the Depthkit Livestream Player depends on. This issue is flagged to be fixed in an upcoming version of KlakSpout, at which point, the error should disappear, and Depthkit Livestream assets should work normally. Until the KlakSpout fix is implemented, you can modify KlakSpout to work with Unity version 2022, and ensure that the modification is not overwritten by doing the following:
- If you have installed the
depthkit.live
package in your project, remove it from the Package Manager. - If you have added Keijiro’s registry to your project, remove it in Unity’s setting.
- Download an offline version of Keijiro’s KlakSpout packages from the KlakSpout repository by clicking Code > Download ZIP, and unzipping the archive once it is downloaded.
- Once unzipped, navigate to
KlakSpout-main > Packages > jp.keijiro.klak.spout > Runtime > Internal
. - Open
Receiver.cs
in a code editor like SublimeText. - On line 89, change
TextureFormat.RGBA32
toTextureFormat.BGRA32
. - On line 90, change
false, false, data.texturePointer
tofalse, true, data.texturePointer
. - Save and close
Receiver.cs
. - In Unity, open the Package Manager, click
Add package from disk
, navigate toKlakSpout-main\Packages\jp.keijiro.klak.spout
and selectpackage.json
. This will add the modified version of KlakSpout to the project. - Add the
depthkit.live
package to the project like normal. - If needed, reconfigure your Depthkit game object to use the livestream player.
Your Depthkit Livestream should now appear correctly, and not produce any errors.