Stories from July 21st, 2011

Demo of Geometry Buffer Anti-Aliasing

Click for Fullsize

I just found this interesting example (with Source Code) of a new anti-aliasing technique called “GBAA”, or Geometry Buffer Anti Aliasing.  It uses a separate buffer to store geometry information as two-channel edge distance data , then uses a pixel buffer to select which pixel to show at rendertime.

The advantage of GBAA over GPAA is that it gets rid of the second geometry pass. It also does not require any line drawing, something that consumer level GPUs generally suck at. Additionally, having geometry information in a buffer allows us to anti-alias other edges than just geometric ones, most notably alpha-tested edges. The shader just needs to output the distance to the alpha-edge, something that’s easily approximated using gradient instructions. This is also demonstrated in the demo. On the down side it requires additional memory for the geometry buffer, but does not balloon up in the same way as MSAA does.

I’ve got to admit, the results are impressive.  You can get the Windows Executable and source code at the site.  DirectX10 required (Sorry XP’ers).

via Humus – 3D.

Science ,

 
Stories from March 25th, 2011

AMD: DirectX Comments Taken Out of Context

AMD is backpedaling on their earlier statements about DirectX and graphics API’s, stating that they were taken out of context.  As I originally suspected, the number of developers eager (or willing?) to code to bare metal is a startling minority.

The previous interview claimed that developers want the API to “go away,” that it’s getting in the way of creating some truly amazing graphics. Huddy himself was even quoted saying that developers have admitted this in conversations. But in this latest interview, he said that only a handful of high-end gaming developers were looking to bypass DirectX and code directly to hardware.

“It’s not something most developers want,” he said. “If you held a vote among developers, they would go for DirectX or OpenGL, because it’s a great platform. It’s hard to crash a machine with Direct X, as there’s lots of protection to make sure the game isn’t taking down the machine, which is certainly rare especially compared to ten or fifteen years ago. Stability is the reason why you wouldn’t want to move away from Direct X, and differentiation is why you might want to.”

I’m sure some people want that kind of access to the hardware, but they’re predominantly in the research world.  Most developers would happily trade away that tiny bit of performance for the ease of development and portability of a good api.  I just don’t think DirectX is a particularly good API.

via AMD: DirectX Comments Taken Out of Context.

Science , ,

 
Stories from March 21st, 2011

AMD says Farewell to DirectX?

A somewhat controversial piece over on Bit-Tech mentions a comment from AMD’s developer relations manager where he says that many game developers just want the API to go away.

‘It’s funny,’ says AMD’s worldwide developer relations manager of its GPU division, Richard Huddy. ‘We often have at least ten times as much horsepower as an Xbox 360 or a PS3 in a high-end graphics card, yet it’s very clear that the games don’t look ten times as good. To a significant extent, that’s because, one way or another, for good reasons and bad – mostly good, DirectX is getting in the way.’ Huddy says that one of the most common requests he gets from game developers is: ‘Make the API go away.’

Now, I think there’s a bit of a miscommunication here.  I sincerely doubt many game designers want to go back to the old days of IRQ21 and manually mapping pixels to memory spaces.  I suspect the real comment is that ‘DirectX is a pain to deal with’ and ‘I want a more transparent & easy to use API’.  Not that OpenGL is any better, but many developers want to be rid of the classis glTransform & rasterization commands and move to a new generation of API’s, as evidenced by the success of things like Unity and Ogre.

What do you think?

via Farewell to DirectX? | bit-tech.net.

Hardware, Science , ,

 
Stories from March 11th, 2011

Carmack: Direct3D is now better than OpenGL

John Carmack, long time creator of such gamign classics as Wolfenstein, Doom, and Quake, dropped a bombshell on the graphics community in an interview with bit-tech where the announced his newly found favor for Direct3D over OpenGL.

Speaking to bit-tech for a forthcoming Custom PC feature about the future of OpenGL in PC gaming, Carmack said ‘I actually think that Direct3D is a rather better API today.’ He also added that ‘Microsoft had the courage to continue making significant incompatible changes to improve the API, while OpenGL has been held back by compatibility concerns. Direct3D handles multi-threading better, and newer versions manage state better.’

Carmack has long been a supporter of OpenGL, using it in most of his games and being somewhat of a champion for cross-platform gaming in the process (Fat chance getting DirectX games on Linux, for example).

via Carmack: Direct3D is now better than OpenGL | bit-gamer.net.

Graphics, Science , ,

 
Stories from December 20th, 2010

Conservative Depth Output and Other Lesser-Known D3D11 Features

Microsoft’s DirectX11 came with big fanfare for tesselation, compute shaders, and several other features, however there are many more tiny features that have gone largely unnoticed by the larger community.  Over at the Danger Zone they take a look at some of these like Conservative Depth Output and Programmable Interpolation that even the simplest of applications can benefit from.

1. Conservative depth output: this is something you use for pixel shaders that manually output a depth value. Basically rather than using SV_Depth, you use a variant that also specifiea an inequality. For instance SV_DepthGreater, or SV_DepthLessEqual. The depth you output from the shader must then satisfy the inequality relative to the interpolated depth of the rasterized triangle (if you don’t, the depth value is clamped for you). This allows the GPU to still use early-z cull, since it can still trivially reject pixels for cases where the depth test will always fail for the specified upper/lower bound. So for instance if you render a quad and output DepthGreaterEqual, the GPU can cull pixels where the quad’s depth is greater than the depth buffer value. Don’t bother looking for this one in the documentation…it’s not in there.

via Conservative Depth Output (and Other Lesser-Known D3D11 Features) « The Danger Zone.

Science ,

 
Stories from September 27th, 2010

Direct3D 10/11 Now Natively Coming To Linux!

Some major news on the Linux Graphics front this weekend coming from some developers on the Gallium3D project.  Over the weekend, Luca Barbieri committed code adding a DirectX 10 and 11 “state tracker” to the project, offering some basic DX10 and DX11 support.  It’s far from feature-complete, but its’ the first steps toward bring the popular Windows-based gaming API to Linux.

Unlike other options integrated into tools like Wine, this new code does not merely translate between DirectX and OpenGL, but rather goes from DirectX direct to the hardware, making it much faster than the alternatives.  I would think such a solution would be less portable, but they claim it makes it ‘essentially free to All Linux Drivers’.

For those thinking that Direct3D 10/11 on Linux will be sub-par, “Finally, a mature Direct3D 10/11 implementation is intrinsically going to be faster and more reliable than an OpenGL implementation, thanks to the dramatically smaller API and the segregation of all nontrivial work to object creation that the application must perform ahead of time.”

via [Phoronix] Direct3D 10/11 Is Now Natively Implemented On Linux!.

Science , , ,

 
Stories from September 7th, 2010

Rebuilding DirectDraw with OpenGL

One enterprising programmer came into possession of some classic windows games, the original 4-part Wing Commander saga, but found himself unable to play them as they were all based on the (now deprecated) DirectDraw API. While many would whine about the dangers of proprietary API’s (I would be one of them), he took it upon himself to resolve the problem.

It all started about a month ago, when one friend of mine had decided to follow his dreams and was moving to the states, and he had to get rid of a lot of stuff. Among his discard pile was a bunch of Wing Commander games, which I bought off him, figuring they might be interesting research material, as I’m planning on a game with similar game play structure (as in story combined with game play, not a 3d space shooter).

So, I found myself in the possession of Wing Commanders 1, 2, 3 and 4, all Windows versions – the Kilrathi Saga and WC4CD to be specific. I installed the first and tried it out. My Win7 switched to 256 colors at a 640×480 resolution, but the game ran.. with completely wrong palette.

His solution was to completely re-implement the DirectDraw DLL (ddraw.dll) with OpenGL calls, turning it into a simple translation layer, with remarkable results.  His source code and binaries are available for download (and extension), along with a list of features to add next:

Next up would have been WC4DVD version, but that adds MCI, DirectShow, mpeg2, DirectDraw7, and all sorts of headaches to the mix, so I figured it’s time for this project to end. I’m releasing the sources, so anyone who wants to pick them up and continue hacking can feel free to do so; with Wing Commanders or other old DirectDraw games.

I love how he’s managed to “fix” some of the ugliness of DirectDraw and adding in improved antialiasing and sync technologies to his implementation.  The fact that on Windows7, OpenGL is actually a translation layer to DirectX, isn’t lost on him either.

Yes, I know, I’m using OpenGL to fix a DirectX problem. Some find this rather ironic. To make things even more fun, vista and Win7 solve OpenGL problems by rendering OpenGL with DirectX. That is, if you’re not using ATI or Nvidia drivers..

via www.iki.fi/sol – Code – DirectDraw Hack.

Science , ,

 
Stories from August 17th, 2010

NVTagToggle: NVidia Compensating for DirectX Shortcomings

An interesting quirk I was unaware of, Microsoft has publicly acknowledged an error in the DirectX API that in certain situations (Having over 1GB of Video Memory and over 4GB of System Memory), the API to return total memory mail return erroneously small numbers.  Like so:

On a system with 1GB of video memory, the following values are returned with the associated system memory:

System Memory     Reported Approximate Total Memory
4GB                       3496MB
6GB                       454MB
8GB                       1259MB

NVidia has built a driver workaround to fix this for some of their cards, and provides a little application called NVTagToggle.

On Windows Vista and Windows 7, NVIDIA provides GPU driver support to work-around this issue for GPUs with less than 3GB of memory. The workaround forces the video memory to the maximum amount these DirectX APIs can report, sacrificing some of the total memory. This is called “Compatibility Mode”.The application “NvTagToggle.exe” linked below can help you detect this scenario and configure this workaround, as well as reset the GPU driver to its default behavior. The application is only supported on Windows Vista and Windows 7, for NVIDIA GPUs with less than 3GB of memory.

So if you’ve experienced this before, check it out and let us know your results in the comments.

via Direct-X diagnostics tool (DXDIAG) may report an unexpected value for the display adapters memory..

Science ,

 
Stories from June 30th, 2010

DirectCompute Lecture Series

While I’m personally a fan of CUDA & OpenCL, you can’t deny Microsoft’s powerful impact on the GPGPU space with DirectX’s new DirectCompute capabilities.  Spend your lunch break brushing up on the capabilities of this, complete with examples and source code, in a series of Lectures available on MSDN.

DirectCompute Lecture Series | Tags | Channel 9.

Science , ,

 
Stories from June 11th, 2010

Microsoft on DirectX 11 Hardware Vendor Differences

Now that NVidia finally has DX11 hardware available, Microsoft has the chance to compare how well the ATI RadeonHD cards stand up to the new GTX480/470.  Specifically, they were looking for oddities in the DirectX11 implementation, and found one particularly interesting one in NVidia’s use of the “Feature Level” concept.

The ATI Radeon HD 5000 Series only provides one quality level per sample count, while the NVIDIA GeForce GTX 470/480 exposes a number of fine-grain quality levels per sample count. This highlighted a few UI bugs in some of the samples as well as DXUT/DXUT11 that were corrected in the June 2010 release. Be sure to test the behavior of any MSAA settings and quality levels in your DX10.x and DX11 programs on both vendor's hardware.

The guys at Geeks3d took both cards for a spin to get the actual results from the ‘CheckMultisampleQualityLevels’ Microsoft mentions, and sees the obvious difference.

Here are the details for a GTX 480 (with R257.15 drivers – Win7 64-bit):

Direct3D 10 - Adapter 0 - Description: NVIDIA GeForce GTX 480
Direct3D 10 - Adapter 0 - Dedicated video memory: 1503MB
Direct3D 10 - Adapter 0 - vendorId: 10DE, deviceId: 06C0, revision: 00A3
Direct3D 10 - MSAA 2X supported with 3 quality levels
Direct3D 10 - MSAA 4X supported with 17 quality levels
Direct3D 10 - MSAA 8X supported with 33 quality levels

And here are the details for a HD 5870 (with Catalyst 10.5 – Win7 64-bit):

Direct3D 10 - Adapter 0 - Description: ATI Radeon HD 5800 Series
Direct3D 10 - Adapter 0 - Dedicated video memory: 1014MB
Direct3D 10 - Adapter 0 - vendorId: 1002, deviceId: 6898, revision: 0000
Direct3D 10 - MSAA 2X supported with 1 quality levels
Direct3D 10 - MSAA 4X supported with 1 quality levels
Direct3D 10 - MSAA 8X supported with 1 quality levels

via DirectX 11 Hardware Vendor Differences – Games for Windows and the DirectX SDK – Site Home – MSDN Blogs.

Hardware , , , ,

VizWorld.com is a production of VizWorld, LLC © 2009