Escolar Documentos
Profissional Documentos
Cultura Documentos
Overview
Civ 5 is a big game, covers 6000 years of
history
The entire map can be populated/ polluted
with all sorts of things the user creates
Need to be able to render a huge amount
of possibly disparate types
Early Goals
Build brand new Engine for Civilization V
Like the game, we wanted graphics engine
to be able to stand the test of time
Decided while D3D11 was in Alpha to build
the engine natively for D3D11 architecture,
and map backwards to DX9
CPP / H
Template Code
Packetized Rendering
COMMAND_GENERATE_MIPS
COMMAND_RESOLVE_RENDERTEXTURE
COMMAND_COPY_RENDERTEXTURE
COMMAND_COPY_RESOURCE
Packetized Rendering
Rendering System
Rendering Engine
D3D/Driver
Step 3: Threading
Job
Job
Job
Job
Job
Job
Job
Job
Job
Job
Job
Manager
Job
Job
Job
Rendering System
Implementation advantages
Once stateless concept grasped, code
maintaince easy
Next to no state-leaking (flickering alpha,
textures etc)
Because rendering is packetized, individual jobs
need little or no communication between each
other
NO THREADING BUGS
Threaded D3D11
submission
Top issues:
Generally High driver overhead for batch
submission
But: D3D11 has multithreaded submission
Command Streams not necessarily map 1:1 to
CommandLists
Civilization V can change how it submits via
settings the config files
1686*
931
Landmarks
1152*
673
Lategame
3616*
2052
Conclusions
High throughput rendering is possible: IF:
care taken to reduce application overhead
Job based, pay-load based rendering
Redundant state and calls filtered
Use D3D11 command lists
Engine can peg 12 threads at 97% (sans
driver)
D3D11 Features:
Tessellation
Major addition
to D3D11 API
[Screenshot]
Terrain
Civ5 contains one of the most complex
terrain systems ever made
Complete procedural process
Use GPU to raytrace and anti-alias shadows
Caching system to deal with cases where
terrain is too big
Tessellation
Terrain very high detail, roughly
64x64 heightmap data per hex
Triangle count, when zoomed out,
can be in the millions
Used Tessellation as a drop-in
Tessellation Cont
Simple Bicupic Beta Spline patches
Adjusted global tessellation as camera moved
in and out
A strict performance increase : 10%-40% faster,
on both AMD and Nvidia hardware.
More Adapative techinques would work even
better, but didnt have time to implement them
Leaders
Leader Rendering
Largely done with DX10.1 rendering tech
New Variable bit rate compression technology
implemented for D3D11.
2.5 GBs of texture data reduced to 150mbs,
can be decompressed on the GPU
Details forthcoming, research is in publication
submission process extensive use of UAVs
Future Stuff, NO AO
Q&A