Main > Software Forum
So What Cause's The Stuttering Sound Problem With DirectDraw??
<< < (4/10) > >>
headkaze:

--- Quote from: RandyT on August 10, 2007, 09:48:38 pm ---Understand that I am not a D3D programmer, but I am assuming based on my experience with 3D rendering programs that the game "screen" is a polygon (or two) which is mapped in real-time with the images generated by the graphics engine within MAME.  If this is the case, why not allow the user to define the extents of the screen object in order to allow one to shrink or expand the game screen beyond the edges of the display in order to maintain a non-artifacting image.

If I'm all wet on the concept, I'm curious to know why.  Otherwise, it seems like simple way to get rid of DirectDraw once and for all.  And as a side note, Aaron seems too imply that DirectDraw is faster, particularly on less capable video cards, than D3D.  I think the reason it's still around revolves as much on the minimalist hardware approach to machine building as anything else.
--- End quote ---

I have written part of a 2d engine in Direct 3D but I never bothered trying to get per pixel precision so I probably know as much as you do about it. From what I've heard people say there are ways to get that precision. Probably not in every resolution that Mame has to pull off though. Mame would bascially work one of two ways, rendering directly to a surface (most likely) which is locked and the pixels are written directly to video memory or as you say a quad with a texture and locked/written to like the surface. It's never an ideal scenario as Direct3D was never meant to work with pixels, so it wouldn't suprise me if it is slower than DirectDraw in some circumstances. Depends a whole lot on the video card though. Perhaps the future of Mame is to use more of the GPU (pixel shaders) to get the accuracy you mention.

DirectDraw has no future as far as Microsoft is concerned. Even the Vista WPF is based around Direct3D so there is no getting away from it. RIP Real 2d and the pixel?
lettuce:

--- Quote from: Howard_Casto on August 10, 2007, 05:56:03 pm ---Ok I've got a dumb question we probably should have asked earlier.  Are you using a classic Avga card (based on the 7000) or the newer one?  The reason I ask is the 7000 had really bad directdraw/direct 3d support but the newer ones perform much better.  You'd have to ask around the ultimarc forums to see if it is a noticable boost though.

--- End quote ---

Im not 100% sure, i take it it will say it i look in device manager, i got it about a year before Andy bought out the PCI-E version, with the PCI-E and AGP being based on the same GFX card??

In regards to not being able to stop D3D from doing some sort of scaling, have people tried the GDI rendering option within MAME, this seem to give a almost 100% display as DirectDraw, but takes up a bit of GFX and CPU power
ahofle:
If I'm not mistaken, isn't Aaron Giles building a MAME cabinet?  If so, I think we should all pitch in to buy him a really nice arcade monitor.  I would guess we would then start seeing some serious improvements in pixel accuracy on arcade monitors in MAME.  ;D
Howard_Casto:

--- Quote from: headkaze on August 11, 2007, 06:12:10 am ---
--- Quote from: RandyT on August 10, 2007, 09:48:38 pm ---Understand that I am not a D3D programmer, but I am assuming based on my experience with 3D rendering programs that the game "screen" is a polygon (or two) which is mapped in real-time with the images generated by the graphics engine within MAME.  If this is the case, why not allow the user to define the extents of the screen object in order to allow one to shrink or expand the game screen beyond the edges of the display in order to maintain a non-artifacting image.

If I'm all wet on the concept, I'm curious to know why.  Otherwise, it seems like simple way to get rid of DirectDraw once and for all.  And as a side note, Aaron seems too imply that DirectDraw is faster, particularly on less capable video cards, than D3D.  I think the reason it's still around revolves as much on the minimalist hardware approach to machine building as anything else.
--- End quote ---

I have written part of a 2d engine in Direct 3D but I never bothered trying to get per pixel precision so I probably know as much as you do about it. From what I've heard people say there are ways to get that precision. Probably not in every resolution that Mame has to pull off though. Mame would bascially work one of two ways, rendering directly to a surface (most likely) which is locked and the pixels are written directly to video memory or as you say a quad with a texture and locked/written to like the surface. It's never an ideal scenario as Direct3D was never meant to work with pixels, so it wouldn't suprise me if it is slower than DirectDraw in some circumstances. Depends a whole lot on the video card though. Perhaps the future of Mame is to use more of the GPU (pixel shaders) to get the accuracy you mention.

DirectDraw has no future as far as Microsoft is concerned. Even the Vista WPF is based around Direct3D so there is no getting away from it. RIP Real 2d and the pixel?

--- End quote ---

I've tried em both (dd and direct3d) when writing dk and I can tell you that direct3d is waaaay faster.  It does depend upon the video card of course but with directdraw most blending effects have to be done at the software level while d3d does it via hardware.  A few newer games in mame need alpha blending of sprites, which d3d helps with.  Also newer cards have built in geometry buffers (not sure if that is the right term to use, but that's how I explain it) which gives a significant speed boost even though it's really only using textures. Believe it or not, at least with my tests, direct surface mapping is actually a lot slower.  Also it's hard to scale and blend multiple textures with it.  This is probably because it's the last remnant of direct draw. 

As for the pixel accuracy, it's really not as bad as it sounds.  Due to the before mentioned floating point variables and a nasty glitch caused by overlapping polys the position can be off by as much as one pixel.  That's right, a whole pixel!  Whoopty do!  It can even be compensated for by adjusting the texture offset and only scaling to exact multiples of the base resolution.  Of course mame does both of these except when hwstretch is turned on and the resolution selected is NOT an even multiple.  In other words, in theory at least when running in d3d mode on an arcade monitor, mame should look pretty darn accurate.

I can't even begin to completely understand what is going on in mame but I guess what I'm trying to say is that if mame isn't doing pixel perfect  (or pretty darn close, which is actually what dd does too) d3d rendering, it should be and is quite possible. 

I'm going to have to go with the peanut gallery on this one... dd is dead.  It needs to be phased out of this community as eventually new hardware and m$ will phase it out for us. 
headkaze:

--- Quote from: Howard_Casto on August 11, 2007, 09:10:43 pm ---I've tried em both (dd and direct3d) when writing dk and I can tell you that direct3d is waaaay faster.

--- End quote ---

We are talking about an emulator here. So you have to write the pixels to emulate the real hardware. That is slow in both DirectDraw and Direct3D. It's hard to say which is faster without doing tests, but they both work the same when it comes to writing pixels, and that's locking the surface and writing raw pixel data. Direct3D is faster at moving polys and textures around but locking a surface to write pixel information is slow. It's the only way Mame could possibly work in Direct3D. I'm not arguing with you here, but even writing a FE in DirectDraw or Direct3D dosn't necessarily mean you have experience writing pixel data to a surface. It's not something you need to do for most things, but with emulation you do. If you've done non-hardware accelerated video in DK you probably have though.

But yeah I think the idea of "being off by a pixel" is pretty much laughable. Who cares? Are arcade nuts really that anal about getting the accuracy. Has anyone tried the Arcade VGA card with Direct3D, how different is it really? And what is the hardware acceleration on the card like? I remember hearing earlier versions of the card didn't have it. I have the newer PCIE version of the card but havn't checked it out yet.
Navigation
Message Index
Next page
Previous page

Go to full version