Home › Forums › Syphon › Syphon Implementations – User › Frame rate issues in a client with Unity Syphon server › Reply To: Frame rate issues in a client with Unity Syphon server
In runtime builds or when the scene view is closed, there is only one context. When the window is updated/resized/fullscreen’d etc, the context is destroyed and recreated.
if you have a scene view open in the Unity Editor, it would appear that you have two shared contexts. Calling CGLGetCurrentContext() in Update will bounce between the two contexts, which leads me to believe that methods like Update() are called every other frame by the scene view and the game view- an unlikely although possible scenario. I have an email out to Aras requesting more information about that.
The syphon plugin does not currently take into account context destruction/recreation, and should, but I’m not sure how to go about this yet. Previously, I had it such that if the screen width or height was resized, it would destroy and recreate the server instance, effectively doing the same thing. I do not see this in your code, and I do not see anywhere you calling syphonServerDestroyResources which is very important on server destruction.
I doubt this is where the grinding is coming from though, with what Anton was saying.
This line of code always had me a little concerned:
Graphics.DrawTexture(new Rect(0, 0, 0, 0), syphonRT);
As it remains a mystery as to why it is needed for it Syphon to function properly in Unity.