Sign in with
Sign up | Sign in

AMD APU13: AMD Talks DirectCompute in Gaming

By - Source: Tom's Hardware US | B 31 comments

AMD explains why DirectCompute is needed in PC gaming.

Why do programmers need Microsoft's DirectCompute in gaming? This was one of many topics covered during AMD's developer summit last week, explaining the need for this API, which supports general-purpose computing on GPUs in Windows Vista, Windows 7 and Windows 8. This API was released as part of DirectX 11, but it also works on GPUs that use DirectX 10 as well.

"If you have things that can run on a GPU – you have a really powerful GPU that's massively parallel, and you're bottlenecked on the CPU, a lot of times you want to move things over to the GPU from the CPU for better performance," explained AMD's Bill Bilodeau. "And there are some algorithms that are just made more for a GPU: they're data parallel, they can take advantage of all the parallelism on the GPU. Things like post-processing techniques, in particular, where you can do the same thing for every pixel. Also things like physics are really well adapted to compute."

One example is AMD's TressFX, which uses the DirectCompute programming language to unlock "the massively-parallel processing capabilities of the Graphics Core Next architecture." Building on Order Independent Transparency (OIT), TressFX "makes use of Per-Pixel Linked-List (PPLL) data structures to manage rendering complexity and memory usage." The end result is in-game hair that was previously only available in pre-rendered images.

"Besides looking good in terms of the rendering, it also reacts really well too," Bilodeau said during his presentation, "because with every individual hair strand, the physics is simulated and that's what really gives it its natural look when it's moving. It also supports things like wind and other forces, collision with the body, and it is artist friendly. There's a lot of little tweaks you can do to it, modern constraints to allow for different effects like water, being wet. A great part of the entire simulation is done on a GPU with compute shaders so there's no going back and forth between the CPU and GPU."

Back in February, AMD updated its blog with news that TressFX treats each strand of hair as a chain with dozens of links, permitting for forces like gravity, wind and movement of the head to move and curl Lara's hair in a realistic fashion in Tomb Raider, which was released earlier this year. The blog also said that collision detection is performed to ensure that strands do not pass through one another, or other solid surfaces such as Lara's head, clothing and body. Hair styles, according to the blog, are simulated by gradually pulling the strands back towards their original shape after they have moved in response to an external force.

Bilodeau explained that raw vertex data starts on the CPU memory, is copied over to the GPU and then stored into the UAV, thus when doing the physics simulation, all that data on the GPU is available to use. The first step is to do integration (calculating movement and reaction to gravity) and global shape constraints (maintaining hairstyle), then local shape constraints, which calculates the finer aspects like curliness or straightness of the hair, then length constraints, meaning calculations that keep the hair vertices and overall strands from lengthening or shortening improperly; the force of wind is also calculated in this step. Finally, there's collision, the final step.

"All this stuff gets calculated and put back into the UAV," he said. "And then the next stage is rendering, so for our hair rendering, we just get it from that same place. So the great thing is this vertex data only needs to be copied over once the entire life of the program. So that slow connection between the CPU and GPU going over the PCI bus that you usually associate with physics is not a problem anymore because all of this is moved over to the GPU. And then we can use that data later for rendering so it stays on the GPU. This isn't done once per frame so it's really one of the good ways of doing physics.”

In a nutshell, DirectCompute gives developers access to tons of parallelism with the high-performance GPUs. The results that devs have computed with DirectCompute can later be used in the graphics pipeline. DirectCompute also has good interoperability, he said. There are existing algorithms that can be used in games such as air physics, which can be accessed from AMD directly here.

Display all 31 comments.
This thread is closed for comments
  • 3 Hide
    clonazepam , November 18, 2013 11:11 AM
    "collision detection is performed to ensure that strands do not pass through one another, or other solid surfaces such as Lara's head, clothing and body"

    Sure, but it will go straight through the seams, so Lara's TressFX hair is constantly decapitating her, going right through the seam where the head connects to the body. I turned it off.
  • 7 Hide
    doron , November 18, 2013 11:29 AM
    a waste of compute power to model hair - games don't really need this

    The same can be said about any other eye candy.

    Also, considering the fact that human characters are probably the most unrealistic thing in a game currently, this is a good step forward visually-wise.
  • -4 Hide
    bharatwd , November 18, 2013 11:36 AM
    Next time give me a Bald Lara Croft...will you!!!
  • 3 Hide
    Hashwagon , November 18, 2013 11:52 AM
    "We don't need ragdoll physics in games" You guys that say we don't need this are afraid to be happy. Why not innovate games? Some of us like to be as immersed as possible and I guess you others can stick with black and white monitors with 2D games.
  • 5 Hide
    itheral , November 18, 2013 12:01 PM
    I'm honestly surprised the reaction to this stuff isn't better. In the last 5 years or so graphics have improved a huge amount, but we've been stuck with hair that's barely changed in the last 15 years. Even if it seems like a minor thing, this is a big step, and could be applied to other things as well
  • 2 Hide
    ohim , November 18, 2013 12:17 PM
    @bharatwd like it or not everything evolves, hair might be a small thing, but add it to realistic shadows, specular light etc etc that evolved with every iteration of DirectX or graphics cards and we will eventually enjoy great visuals and maybe great content... otherwise why the hell did you got a 4870 when VGA graphics was enough for decent visuals and game content. Don`t be a hypocrite about it.
  • 2 Hide
    derekullo , November 18, 2013 12:20 PM
    Even with a bald Lara Croft, Dave Croft, they are still going to have to ray trace the ideal shine his or her head would reflect.
  • 3 Hide
    Kewlx25 , November 18, 2013 1:16 PM
    Tech moves forward small steps at a time, until there is some critical mass for bunch of related features.

    You don't go from the Earth to the Moon in a single jump, you get there a little bit at a time, but you don't realize how far you have come until you look back and see the small orb you call Earth.
  • 0 Hide
    coolitic , November 18, 2013 1:28 PM
    How is tressfx revolutionary? Crytek made great and mostly-efficient physics for clothing, grass, etc. and that was long ago.
  • 1 Hide
    monkeycmonkeydu , November 18, 2013 2:36 PM
    This will come in handy when they finally are ready for the sex games on the oculus rift. :) 
  • 1 Hide
    ohim , November 18, 2013 2:46 PM
    @coolitic clothing and grass =/= hair. Till Tomb Raider i never saw good looking hair on characters in game. And there isn`t any word about revolutionary in this article but everything adds up to great graphics so chill and enjoy eye candy in future games.
  • 0 Hide
    doron , November 18, 2013 3:15 PM
    How is tressfx revolutionary? Crytek made great and mostly-efficient physics for clothing, grass, etc. and that was long ago.

    Do you have a tool to quantify specific elements' efficiency in Crytek's graphics engine? Because their games (especially the first one) don't seem very efficient.
  • 2 Hide
    doron , November 18, 2013 3:23 PM
    For crying out lout just ignore the marketing term. No one complains about stuff like dynamic global illumination and lighting, high-res textures, tesselation etc.

    The hair looks better, it works on all new gpus, it's an improvements, and it's optional.

    Is it over-hyped? Yes. Is it a good thing? Absolutely.
  • 1 Hide
    childofthekorn , November 18, 2013 4:04 PM
    "We don't need ragdoll physics in games" You guys that say we don't need this are afraid to be happy. Why not innovate games? Some of us like to be as immersed as possible and I guess you others can stick with black and white monitors with 2D games.

    There's more to innovation than eye candy (this includes ragdoll physics). I remember playing COD 2 (the last call of duty I actually enjoyed) and you were able to actually climb over objects, it was the best thing to happen since Iron Sights. Now that its the norm people look for the next best.

    Considering the "next best" for a game that cries "destructibility" and in a city of sky scrapers everyone cheers when only 1 building falls. Reset your expectations and hold developers to a higher standard than considering anything eye candy being an overall innovation.

    I didn't intend to rant but I find peoples definition of Innovation has drifted towards prettier graphics than gameplay mechanics far too long ago.
  • 1 Hide
    m32 , November 18, 2013 4:23 PM
    We need this on grass. I'm just saying...
  • 1 Hide
    sonofliberty08 , November 18, 2013 6:01 PM
    this is the answer for physx, for the one who no need this, can stick with the atari games
  • 0 Hide
    ohim , November 19, 2013 12:11 AM
    @childofthekorn when you say about only 1 building collapsing you clearly talk about Battlefield 4, well they could easy make every building collapse but that would make the map a big field of ruble ... after all a game is a game and the limitations are in place to make the game have maps that after 30 mins of gameplay they don`t all look the same like a giant ruble. If you talk about realism then why do you need a crosshair on your screen , why do you have a health bar , why do you know exactly how many bullets are in your magazine, and why the hell are your opponents have blue or red markers ...(BF4 removes all of these in hardcore mode) but if you talk about realism how do you calculate 1% HP relative to real life... let`s be reasonable..some things are bound not to be real life like.
  • 0 Hide
    Duckhunt , November 19, 2013 1:42 AM
    We need more rubble in BF4. Hopefully in BF5 there is a map just of rubble.
Display more comments