Was testing a game over network with my co-worker when suddenly I got a crash which, while it didn’t kill the Unity IDE or even end execution of the game, it threw the error reporter box. The strangest part, was it seemed like everything in the scene got multiplied by -1 ! All of my normals on everything in the scene was reversed, the heightmap on the terrain inverted - everything! SO WEIRD! And it dumped out to the console 11 times the same message: “Flushing Culler but we havent completed rendering. Are you setting material.shader inside of a Render call?”
All I can think of that is in our project was at one point(Which is when the error occured) my co-worker toggled his character’s appearance, which internally just takes one set of renderers and disables them and the others it enables on his player object. The first time he did it, everything worked, the second time(To switch back to his first appearance) was when this happened.
The other cause I guess could be that in an OnPreCull and OnPostRender I am setting the layer of a couple SkinnedMeshRenderer’s gameObjects, but no code exists in any OnRender calls itself.
Regarding setting shaders(Mentioned in the error), we have done the font shader fix to actually have 3d text appear behind or in front of other objects(depth tested) but that was done at design time, not run time, and has been working for awhile so I doubt that would have anything to do with it.
Could this be a thread issue? We are using a thread in our network code to service it, and the appearance toggle does have to be sent over the net so the other players can have the appearance change as well - how much of Unity is thread safe and how much of it will we have to specially code for?
Any feedback would be appreciated.