keijiro / KlakSpout

Spout plugin for Unity
The Unlicense
651 stars 97 forks source link

Error on 2022.1.9b7.2715 Unity version #81

Open jorgeavila opened 2 years ago

jorgeavila commented 2 years ago

Have this error in the version 2022.1.9b

d3d11: failed to create 2D texture shader resource view id=1666 [D3D error was 80070057]

keijiro commented 2 years ago

Does it reproduce on other Unity versions? Or it only reproduces on 2022.1?

jorgeavila commented 2 years ago

Only on 2022.1 already try previews versions

keijiro commented 2 years ago

Thanks. I'll investigate it.

MrMahgu commented 2 years ago

You can fix (not sure if correct fix) by changing \Runtime\Internal\Receiver.cs line 88/89 (I'm using HDRP)

TextureFormat.RGBA32, false, false to TextureFormat.BGRA32, false, true

jorgeavila commented 2 years ago

MrMahgu answer make it work! thanks

jorgeavila commented 2 years ago

Weird i try it over the weekend, sure it was working but now is throwing errors and get replace automtiacally sometimes with the old code

MrMahgu commented 2 years ago

Weird i try it over the weekend, sure it was working but now is throwing errors and get replace automtiacally sometimes with the old code

You would need to extract the package folder (Library\PackageCache\jp.keijiro.klak.spout@2.0.3) to its own folder and either delete it from your project and then reimport it from disk using your local modified copy.

I have a directory inside my base folder (the folder that contains all the Assets, Library, Packages, etc folders) called "LocalPackage". You can then modify the Packages/manifest.json by hand to repoint the Spout package to your new local copy.

Mine looks like this:

"jp.keijiro.klak.spout": "file:../LocalPackage/jp.keijiro.klak.spout@2.0.3"

WoutStandaert commented 1 year ago

Thanks a lot @MrMahgu that worked perfectly

Gabana commented 1 year ago

Hi, I upgraded Unity from 2021.2.7 to 2022.2.0b11 and i am getting this error.

I am using URP and the proposed fix by MrMahgu does not work for me.

@keijiro could you please have a look at this error? Seems like it is affecting all Unity 2022 versions

GeorgeAdamon commented 1 year ago

@MrMahgu You are a legend! Your solution worked in Unity 2022.1.23f1.

Gamgie commented 1 year ago

You can fix (not sure if correct fix) by changing \Runtime\Internal\Receiver.cs line 88/89 (I'm using HDRP)

TextureFormat.RGBA32, false, false to TextureFormat.BGRA32, false, true

This solution fix the bug for me in 2022.1.6f1

silverngx commented 1 year ago

Did anyone else have this issue? The solution did not work for 2022.2.2f1

PikaChokeMe commented 1 year ago

Did anyone else have this issue? The solution did not work for 2022.2.2f1

This works for me on 2022.2.21, make sure you change the texture format and the true false argument and make sure it actually saves.

Initially, I didn't realise we were also changing the texture format from TextureFormat.RGBA32 to TextureFormat.BGRA32

tastez commented 11 months ago

This fix works in beta 2023.1 !

arghhhhh commented 8 months ago

You can fix (not sure if correct fix) by changing \Runtime\Internal\Receiver.cs line 88/89 (I'm using HDRP)

TextureFormat.RGBA32, false, false to TextureFormat.BGRA32, false, true

For me, in Unity 2021 (URP), this fixes spout senders from external apps but breaks the senders inside the KlakSpout demo scene (alpha, gradient, timecode). I did not see a difference changing the mipmaps bool from false to true.

I was able to fix everything (external and unity spout senders) using texture format RGBA4444, but that causes a loss of image data (although I did not notice a difference in quality on my end).

RayneYoruka commented 7 months ago

Having this same issue, it works fine in unity 2020 but not in unity 2022.3.6f1

KamePoon commented 4 months ago

thanks @MrMahgu and @PikaChokeMe, this works for me in 2022.3.6f1 and 2023.2.14f1

Nohealforu commented 3 months ago

Using 2022.3.22f1 and changing the second bool to true, but leaving the texture format the same worked for me to receive from senders using this package and also other sender application (VTube Studio)

tastez commented 2 months ago

Headsup to anyone using latest MaxMSP and Spout package - tested in Unity 6000 and 2022 and 2023 - you'll need to init the texture as RGBAfloat as the output format has been changed upgraded

              ((int)data.width, (int)data.height, TextureFormat.RGBAFloat,
               false, true, data.texturePointer);

so depending on what spout is outputting (check with Spout Panel), you'll need to change the receiver script to init the texture correctly. here are the format names https://docs.unity3d.com/ScriptReference/TextureFormat.html

from what i understand the function in the script has 2 booleans for Mipmaps and Linear colorspace, then the format. I kept trying RGBA32 in the unity spout script to match 32bit RGBA Float out of my spout, but looking up the format names led me to RGBAFloat as being the correct one for my case.

so dont expect it to work for all software. Spout Demo Sender, for example sends, 8bit BGRA so the fix in this thread mentioned above works correctly - and this also used to be the format for MaxMSP's spout package until a couple of months ago or so.

kaushalkumar86 commented 2 months ago

Receiver.cs

Where to find that?