Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NullReferenceException when the player window is resized #20

Open
MatteoFantasy opened this issue Feb 3, 2016 · 3 comments
Open

NullReferenceException when the player window is resized #20

MatteoFantasy opened this issue Feb 3, 2016 · 3 comments

Comments

@MatteoFantasy
Copy link

Hello !
I'm trying to have a Syphon and a window resize (by script or by hand) working together in (Unity 5.3 with openGL 2 and Syphon a17) and it crashes when launching a build of the program. When building in development mode and looking in the logs I get the following error :

Releasing render texture that is set as Camera.targetTexture!
(Filename: /Users/builduser/buildslave/unity/build/Runtime/Camera/Camera.cpp Line: 2942)

and then multiple instances of this one :

NullReferenceException: Object reference not set to an instance of an object
(Filename: /Users/anakin/code/AugmentaUnity/Assets/Plugins/Syphon/SyphonTexture-AdvancedUsers/SyphonServerTextureCustomResolution.cs Line: 134)

I managed to remove the second error by adding the following snippet in the Update method of my script, but that would be great if the Syphon plugin could handle it itself :

if(gameObject.GetComponent<Camera>().targetTexture == null){
    ResizeSyphonRenderTexture ();
}

Now my additional problem is that the player still crashes in the normal build mode, even without resizing the window, but it seems to be related to OpenGL2 (which I have to use or it doesn't work either, but the issue has been opened already).

Any thoughts ? Is it Syphon related or should I do something myself ?
Thanks !

@MatteoFantasy MatteoFantasy changed the title Crash when the player window is resized NullReferenceException when the player window is resized Feb 3, 2016
@Lyptik
Copy link

Lyptik commented Feb 5, 2016

Same here using Unity 5 and same config, any idea ?

@brianchasalow
Copy link
Member

Do you have a crash log?

@MatteoFantasy
Copy link
Author

Hi, I managed to narrow down the problem :

  • In "OpenGL Core" rendering mode, the Syphon output contains only random graphic card data. The output size is correct but the content is apparently never allocated/set. (issue troubles on unity 5.3 (OSX) #17)
  • In "OpenGL 2 (legacy)" rendering mode, starting the program with multiple displays plugged in provokes a crash. (issues n°742203 and n°742205 on the Unity3D issue tracker)

The only thing that's purely related to the window size change is the error I mentionned earlier :

NullReferenceException: Object reference not set to an instance of an object
(Filename: /Users/anakin/code/AugmentaUnity/Assets/Plugins/Syphon/SyphonTexture-AdvancedUsers/SyphonServerTextureCustomResolution.cs Line: 134)

You'll find attached a log of the error (happens on both OpenGL versions).
Syphon.log.zip
Note that I managed to hotfix it with the forementioned piece of code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants