• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
nbertoa

DirectCompute - CUDA - OpenCL are they used?

11 posts in this topic

Hi community.

 

My question is very simple. Are those technologies used in real time games?

 

I saw they are used to implement Blur effects, Particle Systems, Fluids simulation, physics, etc.

 

I want to know if they are used for AAA games in the game industry and to implement what kind of things?

 

Thanks in advance! I will appreciate this information

0

Share this post


Link to post
Share on other sites

PhysX has an option where if a CUDA-capable (i.e. nVidia) GPU is present, it is able to offload a lot of the work to the CUDA device.

They also used to have a clause in their license agreement where you promised to add a bunch of extra special effect particles if the user was running an nVidia GPU... so from that, I guess that a lot of games using PhysX probably make use of CUDA for particle/projectile/debris effects.

0

Share this post


Link to post
Share on other sites
D3D11 compute shaders have definitely been used in shipping games. For most part they are only used for purely graphical features, like full-screen effects and times deferred rendering (used in Battlefield 3). The reason for this is that graphics is typically the easiest and most obvious use-case for compute, since graphics operations are generally well-suited to the massively-parallel model used on GPU's. Graphics operations also don't have to be synchronized with the CPU and read back to system memory, which is expensive on a typical PC architecture. Another reason for this is that PC games still need to target sub-DX11 GPU's, so it probably doesn't make sense to require DX11 functionality for gameplay-centric features.

As for CUDA, several games have made use of PhysX to run various cosmetic physics simulations on the GPU. RAGE also supported using CUDA for run-time transcoding of texture data.

I'm not an expert on OpenCL, but I would suspect that it's not getting much use in games. From what I understand it currently has a lot of issues with regards to getting a OpenCL program to run consistently on a wide range of hardware/drivers.
0

Share this post


Link to post
Share on other sites

Can't say much about DirectCompute or CUDA, but I have been doing a lot of work on OpenCL lately. I have to say it is somewhat of a pain to get running, and the spec seems to be implemented slightly differently in some aspects by various vendors (probably due to the fact that the spec is horribly worded at times everywhere) but other than that, it does work, and is fairly nice to use once you get the hang of it. It requires quite a bit of engineering, though, so I am pretty sure nobody is using it in games. However, all three are capable of interop'ing with D3DX and GL, to some extent.

 

DirectCompute: neat integration with D3D10/11, so using it is really fun and easy. However, Windows only.

CUDA: simple to use, somewhat mature, NVIDIA only, and has lots of built-in libraries (for instance, I believe JC2 used the FFT library for generating water heightmaps in realtime, and other games like to run PhysX on it), cross-platform

OpenCL: the API is somewhat tedious, and is not very used nor very mature, but runs on many devices (with the caveat above), cross-platform

 

As you can see, they all have different advantages, weaknesses, and goals, but I believe that realistically only DirectCompute and CUDA are seeing any use in games due to maturity and easy integration. That said, you should keep in mind that OpenCL in particular was never meant for graphical work, but for general-purpose computation on various devices such as GPU's, FPGA's, etc... so while it's not being used in games, it is being used elsewhere (3D renderers like LuxMark, scientific applications, etc..)

0

Share this post


Link to post
Share on other sites

The Battlefield slides on DX11 discuss DirectCompute a fair bit, since they actually do their major shading in compute.

http://www.slideshare.net/DICEStudio/directx-11-rendering-in-battlefield-3

CUDA is used massively in a lot of industries for high speed computing, but I don't think it ever got much traction in games. OpenCL may have, but I think it'll probably be relegated to high speed computing. OpenGL Compute (new in 4.3) is a much more reasonable choice for games.

Edited by Promit
1

Share this post


Link to post
Share on other sites

The first time I saw DirectCompute being used in a game was in STALKER Call of Prypiat (2009 for Russia, 2010 for the rest of the world) for computing ambient occlusion (i think it was AO, it might have been something else), I believe the developers claimed it was faster than doing it without DirectCompute.

 

The DX11 render, which had more stuff to showoff, seemed to perform even better than the DX10 one in the benchmarks I saw.

Edited by TheChubu
0

Share this post


Link to post
Share on other sites

Thanks for all your detailed answers!

 

I asked because I want to focus on a more specific field on game development, and I think Direct Compute is a good choice. Also it will help me to improve my parallel algorithms design.

0

Share this post


Link to post
Share on other sites

I think the compute shader is a very good idea, I don't really understand why to use Direct Compute or the OpenGL Compute Shader instead of CUDA or OpenCL though,  I think the Battlefield 3 use of the Compute shader is the best example I have seen for how to integrate this into a pipeline. 

 

https://code.google.com/p/cudaraster/

 

is a good and relevant open source project that uses a sophisticated tile system in two phases, coarse and fine, these are covered by the paper. This isn't the same as what Battlefield 3 does because the entire Rasterising technology is implemented in Cudaraster, and the Texture units are not used (the Tex Chip for the texturing, interpolation and texgen hardware).

0

Share this post


Link to post
Share on other sites

Hm... seems like there isn't much of OpenCL users here.

 

Basically OpenCL is wide-used in ray tracing, path tracing (Luxrender, PovRay, ...), also some real time ray tracing/path tracing is done in OpenCL (mostly hobby projects). Bullet physics also uses OpenCL, and as mentioned - a LOT of sceintific applications also use it (note. that also a LOT of scientific apps use CUDA) -> so I have to oppose, the api is quite commonly used.

 

I'd though oppose to Bacterius. OpenCL api is definitely mature (it's been out for few years). As for the spec, it isn't as horrible (as it was - when I first saw the first spec I was like "WTF? You don't really mean that some1 will bother to use this") ... but well I think they should really work on it. On the other hand, who creates OpenCL api? Khronos - thats NVidia, AMD, Intel, etc. In my opinion it's even miracle that these companies created some kind of specifications that in the end it's actually usable.

 

Also to MJP - I haven't got a single problem with running my OpenCL programs on several kinds hardware (different NV cards, different AMD cards, several CPUs - both Intel and AMD). They're mostly ray-tracers/path-tracers (so not entirely simple piece of code). It's not being used in games, because you can use GL compute shader and don't need to bother with cl-gl interops (it sometimes seems like scratching on right ear with your left foot).

 

As for your choice, DirectCompute is (if you're using D3D) probably best choice for games.

Edited by Vilem Otte
0

Share this post


Link to post
Share on other sites

As for your choice, DirectCompute is (if you're using D3D) probably best choice for games.

 

I'd agree with this point, unless you have invested a lot of work into CUDA or OpenCL, using Direct Compute with D3D and the OpenGL compute shader with OpenGL should simplify the code a bit. There access functions and data handling can be intuitive and easier to understand.

 

On the other hand, you might want to create a cross API engine, and then the two compute shader implementations might actually be better as pure OpenCL or CUDA with some kind of wrapper, since the Compute architecture (s) might be using CUDA and OpenCL on a low level.

 

However, since CUDA and OpenCL need to keep evolving, using a Compute shader would allow you to use the feature on a stable level without having to worry about updating libraries and shipping with DLL's etc.

Edited by ray_intellect
0

Share this post


Link to post
Share on other sites

I also found the following:

 

http://www.tomshardware.com/reviews/directcompute-opencl-gpu-acceleration,3146-5.html

 

"Civilization 5
Civilization 5 uses DirectX 11 and DirectCompute to leverage a variable bit rate texture codec algorithm. The algorithm is so efficient that 2 GB of leader textures compress down to less than 150 MB of disk storage.

DiRT 3
DiRT 3 employs DirectCompute for its high-definition ambient occlusion (HDAO) effect. Unfortunately, there is no equivalent effect in the game based on pixel shading, so we can’t compare the two directly.

Metro 2033
The advanced depth of field (DOF) effect in Metro 2033 needs three rendering passes. Two of these employ pixel shading, while the third uses DirectCompute."

1

Share this post


Link to post
Share on other sites

D3D11 compute shaders have definitely been used in shipping games. For most part they are only used for purely graphical features, like full-screen effects and times deferred rendering (used in Battlefield 3). The reason for this is that graphics is typically the easiest and most obvious use-case for compute, since graphics operations are generally well-suited to the massively-parallel model used on GPU's. Graphics operations also don't have to be synchronized with the CPU and read back to system memory, which is expensive on a typical PC architecture. Another reason for this is that PC games still need to target sub-DX11 GPU's, so it probably doesn't make sense to require DX11 functionality for gameplay-centric features.

As for CUDA, several games have made use of PhysX to run various cosmetic physics simulations on the GPU. RAGE also supported using CUDA for run-time transcoding of texture data.

I'm not an expert on OpenCL, but I would suspect that it's not getting much use in games. From what I understand it currently has a lot of issues with regards to getting a OpenCL program to run consistently on a wide range of hardware/drivers.

You can easily get away with DX10 as a minimum requirement today, that will at least give you compute shaders, though limited.

 

One of the reasons I suspect that graphical niceties have been the primary use is consoles, the gameplay needs to run on consoles too, which obviously don't have Compute Shaders. So sticking with a few graphical extras on the PC version doesn't hinder anything.

 

Still, I wonder what you could use it for, besides some physics acceleration ala PhysX. Regardless, I don't doubt we'll see DX11 cards as the new minimum, so compute shaders should be relevant to look into.

0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0