Download presentation
Presentation is loading. Please wait.
Published byJulian Sweeney Modified over 11 years ago
1
Go Parallel – Multicore Programming & Game Development The Importance of Multi-Core for Game Development at Crytek Martin Mittring Lead Graphics Programmer
2
One for all, and all for one 1894, Maurice Leloir (1851-1940) The three Musketeers Alexandre Dumas, published 1844
3
Crytek Main office located in Frankfurt 3 more studios (Kiev, Budapest, Sofia) English as company language 30+ nationalities CryEngine 1: PC CryEngine 2: PC, XBox360, PS3
4
Crytek Games Far Cry Shipped 2004 Ubisoft Platform: PC Shipped 2007 Electronic Arts Platform: PC Crysis* * Crysis, Crysis Wars and Crysis Warhead
5
Computer Game Business Production: –Game (game specific code) –Engine (reusable code, big, license business) –Tools (editor, resource compiler, plug-ins) –Art, Design (3D models, textures, levels) Milestones (CXP, demo, competitors, technology window) Real-time, Multiple platforms, Multiplayer, Cheating Technology is in flux: –CPU, Fixed Function, Shaders, …, CPU again? Marketing, Publisher, Most games dont make money Quality vs Performance A few % performance win costs more and more work Multithreading does not make it easier [Sutter05]
6
Challenges of future Engines Range of HW (x CPUs, GPU, Memory) Large world Production problems (Cost, Time, Deadline) Massive multiplayer Quality expectations (HDTV, Anti-aliasing, Stereo Displays, stable FPS, Uncanny Valley)
7
Multiprocessing in Game Engines I.CPU (e.g. Doom) II.+= Graphic cards (Fixed function) (e.g. Far Cry) III.+= GPU (Shaders) (e.g. Far Cry) IV.+= x CPU (MT performance critical parts) (e.g. Crysis) V.Job based? Distributed? Special language?
8
How graphic cards get their speed? OpenGL/DirectX = Most successful multiprocessing language? SIMD, VLIW (but not always) Optimized for that application (e.g. bilinear filter, swizzled memory layout) Latency hiding by processing multiple data packets in cyclic way
9
And now for something completely different
10
Triangle Rasterization Fixed function HW in GPU Fast SW version still useful (used in CryEngine to avoid rendering occluded objects) SW rasterization comes back (Larrabee) Good example how to parallelize … lets take a closer look
11
Triangle Given: 3 corners float2 2D array of pixels Rasterizer
12
Where to Rasterize A clear definition is crucial: center of the pixel is inside, pixels on the border depend on edge direction (Integer) => no holes => no edge overdraw
13
Classic Approach Scan-line algorithm Special cases Difficult to parallelize
14
Half- Space Convert three edges to half-spaces, inside the triangle becomes behind 3 the half-spaces Bounding rectangle as input Wastes performance outside
15
Half- Space Packets Packet of multiple pixels needs processing if partly inside the triangle Bounding rectangle as input
16
Three Packet Types Completely outside => drop Completely inside => process all pixels Partly inside => per pixel test required
17
Half- Space + Packets SIMD (Single Instruction Multiple Data) friendly Integer math (precise, fast) Less Branches Cache friendly [Nicolas04]
18
And now for something completely different
19
Three rendering methods Rasterization (no slide) Ray-tracing (four slides) REYES (three slides) Comparison (one slide) ( not a complete or fair comparison)
20
Ray-tracing Simple on CPU (stack recursion) Spatial Hierarchy to speed up ray-casts Computationally intensive Elegant solution Inherently parallel Not cache friendly Hard to get real-time [Hauser02a]
21
Ray-tracing generations 1/3 Recursive Ray-casting Hard shadows, Perfect Reflections, Refractions, Occlusion solved, Adaptive AA
22
Ray-tracing generations 2/3 Distributed Ray-tracing [Carp84] more samples per pixel to integrate: Motion Blur, blurry reflections, soft shadows, DOF, Lightprobes
23
Ray-tracing generations 3/3 Global Illumination more samples per pixel to integrate: Indirect lighting © GNU Free Documentation Licensee
24
REYES, Renderman Lucasfilm Computer Graphics (now Pixar) used in Pixar and many other movies: Wall-E, Ratatouille, Transformers, Cars, … [Pixar08] 1984
25
REYES Recursive split into dice-able primitives Visible ones become grids of micro-polygons (near pixel size) Shading is done at each grid point or quad (Color and position) Renderman shader language (C like syntax)
26
REYES: Sampling of the micro-polygons A pixel consists of multiple jittered samples DOF, Motion-blur, AA (cheap as all shading is done) A-Buffer for OIT Tiled rendering for memory locality, to use less memory, to process in parallel
27
The three methods compared Rasterization: eye-rays, triangles, opaque, GPU Ray-tracing: perfect reflections/refractions, triangles are limiting, less real-time: distributed Ray-tracing, global illumination REYES: displacement maps, Level of Detail, Anti-aliasing Shading/Lighting is orthogonal to the method [Hauser02b] Movie realism instead of physically correct Ambient Occlusion, Hybrid solutions
28
Conclusion The Importance of Multi-Core for Game Development at Crytek PS3 (1*2 PPU + 7 SPU) XBox360 (3*2 PowerPC) Intel/AMD (1/2/4/?) Multi / Many Cores? My plan was to motivate and I used my favorite topic: Graphics
30
References [Nicolas04] Advanced Rasterization, DevMaster.net www.devmaster.net/forums/showthread.php?t=1884 www.devmaster.net/forums/showthread.php?t=1884 [Carp84] Distributed Ray Tracing, Siggraph 1984 http://www.csie.ntu.edu.tw/~cyy/courses/rendering/05fall/assignments/pres/slides/DRT.ppt http://www.csie.ntu.edu.tw/~cyy/courses/rendering/05fall/assignments/pres/slides/DRT.ppt [Hauser02a] CGR4- Raytracing (German) http://www.vrvis.at/vr/cgr4/slides/CGR4-2002-RayTracing.pdf http://www.vrvis.at/vr/cgr4/slides/CGR4-2002-RayTracing.pdf [Hauser02b] CGR4- Beleuchtung (German) http://www.vrvis.at/vr/cgr4/slides/CGR4-2002-Beleuchtung.pdf http://www.vrvis.at/vr/cgr4/slides/CGR4-2002-Beleuchtung.pdf [Sutter05] Herb Sutter, The Free Lunch Is Over Dr. Dobb's Journal, 30(3), March 2005 http://www.gotw.ca/publications/concurrency-ddj.htm http://www.gotw.ca/publications/concurrency-ddj.htm [Pixar08] Renderman Movies https://renderman.pixar.com/products/whatsrenderman/movies.html https://renderman.pixar.com/products/whatsrenderman/movies.html www.crytek.com/inside/presentations
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.