- Home /
screen tearing, on windowed mode, with VSync on
Hi,
Using Unity 5.0.1 I'm getting vsync related screen tearing when I launch in windowed mode or DX11. The only working mode for me is DX9 Fullscreen Exclusive, any other modes show tearing (vsync seems to be failing).
The machine I'm working on has an GeForce GTX 970 (350.12 driver version) and there isn't any other software installed.
Have you experienced anything similar?
Thank you!
I tested that DX11 exclusive mode also works fine, but I'm trying to build a non-exclusive application. I'll keep trying...
hello how to solve this error error for BCE0019: 'position' is not a member of 'System.Type'.
Answer by fractalbear · Jul 23, 2015 at 01:29 AM
I was having the same problem. Only exclusive mode didn't have screen tearing. I solved the problem! It was happening because I starting using the Classic windows theme on Windows 7. I changed back to the Aero theme and now the problem has gone. Hope this is helpful.
That's very interesting. I usually disable the Aero theme so I have to check how it was when I was having these problems. Thanks!
That is nuts indeed! I did disable the Classic windows theme and the $$anonymous$$ring stopped.
Wow this is unexpexted. I was having the same problem but in both, windowed and fullscreen mode with Unity 5.3.4f1 (64-bit) and windows 7 classic design. I Changed to aero and now it is working.
Thanks alot! :)
By the way: this not only fixed the vSync for unity, it also fixed my vSync problems in Blender Game Engine for me :)
This is NOT a solution. You cannot force someone to use aero just to make sure that there is no screen $$anonymous$$ring. This is definitely a bug occuring only in newer unity versions which I experienced myself (GTX960 / Win7) in many newer video games. Since I am user and no developer I am not able to file a bug report maybe some devs could do this?
Normally, I would agree that forcing the user to activate a feature of the OS shouldn't be a solution, but in the case of Aero, that's actually one of the rare exceptions. The problem isn't with Unity, but with the OS Windows itself since Aero was added to it back at Windows XP. To put it bluntly, $$anonymous$$icrosoft did a BIG blunder when they developed Aero... They put some of the essential parts of Windows' display system directly within the Aero plugin itself. For example, without Aero, Windows XP or later OS's display drivers are unable to render opacity on any frames.
The best way to describe the problem is that, when Aero is turned off, Windows is unable to use the GPU anymore to render its frame-related content and relies solely on the CPU. It wouldn't be a problem if it was ending there, but here comes the next problem... What happens if you have a screen that has a part that is rendered solely with the CPU and one that is rendering with either the GPU or a mix of CPU and GPU? Ping-pong! The do$$anonymous$$ating software render both in row and not at the same time! The screen-$$anonymous$$ring that comes around when you try the game in windowed mode without Aero is caused by the fact that Windows let the applications render their frame, then render the "outer" frame (rest of the screen) through the CPU... and through that comes the possibility that the second rendering produce a screen-$$anonymous$$ring.
If you still don't get it, another more simplistic way of explaining it is this : 1) You turn off Aero. Now Windows is unable to use the GPU to render any frame and solely relies on the CPU. 2) You run an application in Windows mode. 3) Windows can't do its own rendering with the GPU, but the application (which has priority) can so Windows wait for the application to finish rendering its frame. 4) Then Windows take the rendered frame save it into its memory bandwidth. 5) Windows renders its own frames through the CPU (which exclude any application that runs on the GPU). 6) Windows fuse both the GPU rendered frame with the CPU rendered frame. 7) Sometimes, when Windows fuse both frames, it does a sloppy job (like any software running purely on CPU) and a screen-$$anonymous$$ring appears with the positioning of the memorized GPU-based frame being 1 or half a pixel off.
The reason why it only appears in newer Unity version is because of a change in how the software is handled CPU-wise... which without Areo also affect how much memory bandwidth Windows can handle for rendering its content.
So you are telling me that I will have to use a theme I absolutely despite (because I find it extremely distracting no matter if I chose transparent or non transparent) just to get rid of the screen $$anonymous$$ring and this is not a bug at all? Even though EVERY other engine works fine with or without Aero? I guess then I will have to hope that not that many developers will use Unity in the future.
Answer by snlehton · Apr 22, 2015 at 04:21 PM
I had same kind of problems. I was able to get vblank working in non exclusive mode, but with noticeable jitter in framerate. With DX11 exclusive mode it was smooth.
Any of the NVIDIA control panel settings didn't help (vsync & triple buffering)
Answer by GXMark · Dec 21, 2016 at 12:41 AM
I'm currently using unity 5.5 in exclusive mode with vsync enabled and its working fine.
Answer by Jonesy19 · Feb 27, 2017 at 03:05 PM
This actually worked for me, thanks @fractalbear, but my Windows was not set up to use Windows Classic. It was in Windows 7 Basic mode, yet I was still having the issue. When I set it to "Windows 7", however, it started working... I have to agree with @MarkoH01, however...This is not a good solution in my eyes. Maybe it's the only one currently and I may have to deal with it, but telling the user to tweak something outside of the developed application is NEVER optimal... Anyone have any thoughts?
As I previously wrote a while ago to another who says "it's not a good solution", the problem is with how Windows manage its windows and not how the engine manage the screen $$anonymous$$ring.
Basically, when you run "any" application in windows mode (borderless or not), Windows is managing each "windows" as a something like a player with its own rendering pipeline. As bad in design as it might sound, back in the days, Windows Classic and Windows 7 Basic doesn't use any kind of opacity nor rendering effect and that's why the Unity has screen $$anonymous$$ring even if the best anti-screen-$$anonymous$$ring options are used. It was only introduced with Windows 7.
I did some research and found out that, in the case of Unity, one reason why it happens more frequently is due to the Nvidia Drivers. This can still happens with Unreal or Cry Engine, but when I looked up, I found out that, in the 1-2 recent years, Nvidia implemented some changes in their drivers aimed directly toward application that uses those 2 engines and yet I haven't seen the same changes aimed toward Unity.
To put it bluntly and simple, Nvidia has added some "default" forced method when either Unreal or Cry Engine is run. $$anonymous$$inda like when you set some "default" values to games within the Nvidia Control Panel, they added some distinct parameters that force windowed Unreal and Cry Engine apps to use some of its "special" after-effect rendering methods through the GPU driver itself. In other words, U4 and CE5, if recognized by the Nvidia GPU's driver, force some effect onto the WIndows' window which assist well against the screen $$anonymous$$ring.
Why wasn't this added for Unity is a mystery, but one thing is certain, Unity itself can't do much against it as it's a problem from the users' side and how the PC systems themselves works. Complains about it should be directed toward $$anonymous$$icrosoft so that they can apply some $$anonymous$$or changes to the modes... but that would simply be useless considering it has abandoned Windows 7 for a while now.
@$$anonymous$$ax_Bol: Thank you for the detailed explanation. However there is one thing still puzzling me and that is why EARLIER versions of Unity never had any problems running on the same OS with the same drivers (even now) without Aero enabled. Today I am glad whenever devs have used old versions of Unity because then I know that I don't have to enable Aero. I wished I could enable Aero without actually seeing this distracting theme - but since this obviously never was $$anonymous$$icrosoft's intention for now I can only activate Aero before starting any new Unity game. By far not the ideal solution.