- Home /
How can I make a switch occur every frame?
I'm making a stereoscopic camera rig and need to switch which camera I'm using every frame. In function Awake, I've set the fps to 60, in function Update, I created a simple if true, then false and vice versa. I also added a frame and second counter to double check that it's switching every frame @ 60fps. This is where the problem comes in, It's returning uneven increments which is leading to problems in the 3d display im using. I understand that "Application.targetFrameRate = 60;" isn't perfect but I was thinking that the switch in the Update would solve this. Any ideas what to do? Maybe use Fixed Update to keep the actual change of camera independent of frame rate?
Answer by Mold · Jul 26, 2012 at 11:24 AM
You shouldn't use fixedupdate because the camera may switch twize before the next frame, = fail.
Btw it maybe not have 60 fps, even if you want it to (atleast I think so)
It does have to run at exactly 60fps as the projector that I am using runs at 60Hz and if I am even half a frame off, the screen will start to $$anonymous$$r. Vsync is see$$anonymous$$g to be the best option but it's still $$anonymous$$ring every half second or so...
Answer by Seth-Bergman · Jul 27, 2012 at 10:37 AM
Hmmm. Is it really necessary to make a virtual stereoscopic setup? Unity games support 3d, all you should need is the proper driver to do 3d out of the box
I believe IZ3D would do it
IZ3D won't work as I am working with a very different kind of 3D system. I am working with a group of engineers at a university and they have created a kind of hand held 3D projector running at 60 fps, this is why most common, already-made solutions won't work and why I am trying to create this rig from the ground up