keijiro / KlakSpout

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

KlakSpout fails to update Unity texture on sender start/stop/restart - Unity 2021.2.0b4 #73

Closed MrMahgu closed 2 years ago

MrMahgu commented 3 years ago

When restarting a spout sender (In my case, non KlakSpout sender) unity fails to pickup that the sender has restarted sending and no texture updates will happen unless the Receiver in Unity is enabled/disabled/restarted.

KlakSpout V1 continued to received the new sender texture without issue.

Steps to reproduce: Unity 2021.2.0b4 -> New Project Add scoped registries Install KlakSpout 2.0.2 Add Plane Add Spout Receiver to Plane Configure With Plane _MainTex Play Start sender Wait..1..Wait..2 Stop sender Wait..1..Wait..2 Start sender

texture is not updated with new sender texture

Windows 10, x64.

keijiro commented 3 years ago

Thanks for reporting the issue. Does it reproduce with SpoutSender.exe? https://github.com/leadedge/Spout2/tree/master/DEMO

MrMahgu commented 3 years ago

Yes. With SpoutSender.exe it still does not update texture if SpoutSender.exe is closed and re-opened and re-configured.

keijiro commented 3 years ago

Thanks for the information. I'll try reproducing it.

keijiro commented 2 years ago

Fixed in 2.0.3.

keijiro commented 2 years ago

I'm closing this issue now. Please feel free to reopen it if it still reproduces.

MrMahgu commented 2 years ago

In KlakSpout v1 - the last received frame was left active on the texture In KlakSpout v2 - the last received frame is discarded and removed

Which is desired for future?

keijiro commented 2 years ago

In KlakSpout v2 - the last received frame is discarded and removed

The spout receiver and its texture are internally removed, but Receiver.receivedTexture (backed by Receiver._buffer) remains intact until reconnection.

So, from a user's perspective, the last received frame is left active on the texture.

If you find a behavior that removes the last received frame on disconnection, please submit a bug report. That's not my intention.