Quantcast

Results 1 to 12 of 12

Thread: DirectDraw Tearing

  1. #1
    Raging in the Streets Blades's Avatar
    Join Date
    Dec 2006
    Posts
    3,250
    Rep Power
    81

    Default DirectDraw Tearing

    Most DirectDraw PC games I played in the '90s had screen tearing, especially those that didn't use the 3D card. A good example is Sonic R, which worked fine with Direct3D, but tore excessively with DirectDraw. Croc also.

    Why was that? Was something not set up correctly? Console ports of the same game at the time didn't have this.

  2. #2
    Rogue Master of Shinobi Pulstar's Avatar
    Join Date
    Sep 2008
    Posts
    2,384
    Rep Power
    41

    Default

    When you code for PCs, which have a wide range of hardware despite running on the same standard of runtimes, you'll run into performance issues. Tearing happens because the frame rate of the game doesn't play nice with the monitor refresh rate. There are solutions to this, be it in software or hardware. I reckon Direct3D handles VSync (vertical synchronisation) issues better because the 3D driver is better than the 2D driver. There used to be a tool that forced VSync for DirectDraw but no idea if it works for modern Windows.

    Heck if you play enough modern games you'll notice tearing on consoles too.. Simply because of poor coding. A game running at a smooth 30 frames per second will not display tearing because it syncs nicely with the TV's 60Hz refresh rate. Perhaps a wall of text could explain this in more detail by one of our more technically-inclined members.

    http://en.wikipedia.org/wiki/Screen_tearing

  3. #3
    ESWAT Veteran Chilly Willy's Avatar
    Join Date
    Feb 2009
    Posts
    6,744
    Rep Power
    77

    Default

    Screen tearing occured on many old games because they were written for video cards that didn't have a vblank interrupt. Believe it or not, the vast majority of PC video cards didn't have a vblank int until PCI became standard. All you had was a bit in the VDP status register that you polled to find the vblank. So you either wasted a ton of CPU time polling for the vblank, or you ignored it and just redrew the buffer or flipped buffers if the card had enough ram for two buffers.

    And that was another thing - many cards had only enough vram for one buffer. So you either drew to an offscreen buffer and transferred the result to the card, or you drew directly to the displayed buffer if your game could draw fast enough. Early SVGA cards with high res screens were particularly bad about that. Early Color Macs were particularly bad about having only one buffer, too.

  4. #4
    Rogue Master of Shinobi Pulstar's Avatar
    Join Date
    Sep 2008
    Posts
    2,384
    Rep Power
    41

    Default

    Chilly Willy, is there a tool to enforce vsync on Win7/8+ for 2D applications?

  5. #5
    ESWAT Veteran Chilly Willy's Avatar
    Join Date
    Feb 2009
    Posts
    6,744
    Rep Power
    77

    Default

    Quote Originally Posted by Pulstar View Post
    Chilly Willy, is there a tool to enforce vsync on Win7/8+ for 2D applications?
    No idea. I don't use Windows beyond XP.

    Vista killed Windows for me, but lately I've been thinking about trying Windows 7. Certainly not going to use that abortion called 8.

  6. #6
    Raging in the Streets Blades's Avatar
    Join Date
    Dec 2006
    Posts
    3,250
    Rep Power
    81

    Default

    Screen tearing occured on many old games because they were written for video cards that didn't have a vblank interrupt. Believe it or not, the vast majority of PC video cards didn't have a vblank int until PCI became standard. All you had was a bit in the VDP status register that you polled to find the vblank. So you either wasted a ton of CPU time polling for the vblank, or you ignored it and just redrew the buffer or flipped buffers if the card had enough ram for two buffers.
    So how did the programmers expect to avoid screen tearing? Our computer back then ('97 or '98) had a Voodoo3 card that I'm sure had vsync. Even then Sonic 3D Blast, Croc and numerous others all tore when they didn't use Direct3D on the old CRT. It was a big reason why I wanted a video game console.

    Yet others that were made before hardware acceleration even existed (Descent and Microsoft Flight Simulator) didn't tear. Was it the specific combination of my video card, computer and CRT that induced tearing in those games?

    In fact, I dug out the old Win98 laptop and it runs those same games with the same tearing issues I remember.

    Quote Originally Posted by Chilly Willy View Post
    No idea. I don't use Windows beyond XP.

    Vista killed Windows for me, but lately I've been thinking about trying Windows 7. Certainly not going to use that abortion called 8.
    XP is extremely outdated and next to useless except for running old applications. I continued using it after support ended on my dualboot MacBook but ended up going to 8.1 last month because nothing supported XP anymore. I don't understand why everyone hates it. The performance advantage is significant and now I can use all 16GB. Windows 7 was a patched Vista and OK but had all the same problems, startup times etc. 8 blows it out of the water imo.

    Microsoft also finally got sleep working correctly so I can close my lid without fear. Sleep has been an annoying Windoze issue since 95. The biggest problem was Apple really didn't want 8.1 on my 5 year old MBP so setting up drivers, color profiles etc. took forever.

    I know a guy on the Windows team working on 10 and he says 10 is essentially ditching everything 8 was about. Oh well.

    Chilly Willy, is there a tool to enforce vsync on Win7/8+ for 2D applications?
    There are some. Somebody mentioned this to me, supposedly it does that. It works on XP too.

  7. #7
    ding-doaw Raging in the Streets tomaitheous's Avatar
    Join Date
    Sep 2007
    Location
    Sonoran Desert
    Age
    43
    Posts
    3,981
    Rep Power
    76

    Default

    Quote Originally Posted by Blades View Post
    XP is extremely outdated and next to useless except for running old applications. I continued using it after support ended on my dualboot MacBook but ended up going to 8.1 last month because nothing supported XP anymore. I don't understand why everyone hates it. The performance advantage is significant and now I can use all 16GB. Windows 7 was a patched Vista and OK but had all the same problems, startup times etc. 8 blows it out of the water imo.

    Microsoft also finally got sleep working correctly so I can close my lid without fear. Sleep has been an annoying Windoze issue since 95. The biggest problem was Apple really didn't want 8.1 on my 5 year old MBP so setting up drivers, color profiles etc. took forever.
    I stayed away from Vista, but Windows 7 has been awesome. The only reason I have installed 8.x, is because there are compatibility issues with older XP (and Vista) programs that I still use. Not that Windows 7 didn't have some issues with some progs, but they were fixable for the most part (and not for Win8). I'm not a fan of the UI for Win8, but I'm sure I could easily get used to it. So the UI isn't the problem for me.

    Windows 10 intrigues me, and I'll probably wait for that. Skipping Vista didn't hurt me, so skipping Win8 probably won't either.

    As to the original posters question, it really depends on the age of the game and the drivers for the card. Vblank interrupt was mandatory for all direct-x compatible cards AFAIRC. At least, this is what I remember for Windows 98 and beyond. Whether a game used it or not, is something else entirely. Some drivers allowed you to force vblank on frame updates, as well as triple buffering. I ran windows 95 (and dos+win3.1 before that), but I do remember vsync (non tearing) being used in some games. Unless they used a finer system timer instead and resynced a software counter or something.

    But yeah, I remember coding for DOS stuff back in the day and polling for that vblank flag. Fine for games (console games do this as well), but not so great if you're running a multitasking OS though.

  8. #8
    Raging in the Streets Blades's Avatar
    Join Date
    Dec 2006
    Posts
    3,250
    Rep Power
    81

    Default

    So then why would Sonic 3D Blast, R and Croc all tear with DirectDraw (and not Direct3D)? Those are late '90s games running on a late '90s PC with capable hardware. Why would they leave vblank interrupt off there and not on the Direct3D or console ports?

    I can't imagine why.

  9. #9
    Road Rasher
    Join Date
    Jul 2012
    Age
    40
    Posts
    423
    Rep Power
    10

    Default

    From what I remember directdraw was for 2d and not for 3d, while it can do 3d it would just be slow at it (no hardware acceleration), which is probably why it tears with directdraw in those games cause its basically using software rendering with a API for 2d. I could be wrong.
    Last edited by madmax2069; 01-08-2015 at 04:33 AM.

  10. #10
    ding-doaw Raging in the Streets tomaitheous's Avatar
    Join Date
    Sep 2007
    Location
    Sonoran Desert
    Age
    43
    Posts
    3,981
    Rep Power
    76

    Default

    Quote Originally Posted by madmax2069 View Post
    From what I remember directdraw was for 2d and not for 3d, while it can do 3d it would just be slow at it (no hardware acceleration), which is probably why it tears with directdraw in those games cause its basically using software rendering with a API for 2d. I could be wrong.
    I think you might be confusing DirectDraw with the standard graphic API of windows (which is something like 100 lines of code to plot a single pixel). They way I remember it, for both D3D and DDraw, is that whatever wasn't supported in hardware - was substituted in software on the driver side (to be Direct-X compatible). DirectDraw definitely had 2D acceleration (hell, 'windows' accelerators were around during windows 3.1), but it depended on whether a video card support that in hardware or software (almost all PCI video cards specifically for windows 95 and up, had at least 2D hardware acceleration. That's what I remember from being a PC tech back them). But yeah, I don't see why a specific card would have non tearing in D3D but not in DDraw mode. Maybe it was a fullscreen vs windowed mode thing? Dunno. Maybe you had bad drivers/driver issues or maybe you had a weird card where it only supported D3D? If it's a 3D game, and you're using DDraw, then it's doing software 3D - no hardware acceleration. That would possibly account for Sonic-R.

    Without looking into the game code (a mess up on their end?), I'd say that it's driver or card issue. Especially if it's late 90's.

  11. #11
    ESWAT Veteran Chilly Willy's Avatar
    Join Date
    Feb 2009
    Posts
    6,744
    Rep Power
    77

    Default

    Here's MS's page on DirectDraw flip timing, and how much a pain it can be to avoid tearing: http://msdn.microsoft.com/en-us/libr...=vs.85%29.aspx

    You might read through that whole section. It's a real blast from the past.

  12. #12
    Raging in the Streets Blades's Avatar
    Join Date
    Dec 2006
    Posts
    3,250
    Rep Power
    81

    Default

    So R and 3D Blast were broken when they shipped?

    The impression I'm getting is these PC ports were afterthoughts to the console versions (3D Blast's crippled special stages and R's strange lighting) so it makes sense they have mistakes like bad vsync.

    Interestingly Sonic CD and Sonic & Knuckles Collection, both earlier games, don't tear.

    My only working hypothesis is the CPU and GPU are too fast for the games (2GHz stepped down to 1.2 on 98). But if I remember right, our old Pentium & Voodoo3 machine had the same issues with these games. 3D Blast and R tear on any XP machine I try them on (again, only in software rendering).

    In fact, R chugs in certain places at 1.2.

    EDIT: Or maybe not. Our old CRT refreshed at 85Hz, not 60, so perhaps that mitigated the issue.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •