Author Topic: Crysis 2 Tessellation & You  (Read 7622 times)

The following is from The Tech Report back in 2011, where you can find a much more indepth report.

In a couple of Discords I've been going around and showcasing this little...anomaly of design. Since Off Topic is currently a stuffhole, I thought I'd re-invoke something interesting to discuss.



Part Zero: The Vital Components

For those who aren't aware, DirectX is a series of libraries that make it really easy for developers to deal with hardware components on your PC. Rather than having to write code for every single GPU, Audio Card, Controller and so on, they can simply use the DirectX libraries which handle compatibility with device drivers for them. One of the main parts of DirectX is Direct3D, which handles "rendering" things that you see on screen by telling the GPU what objects, colours and so forth it needs to use. The way rendering works is with a very specific "pipeline", a series of stages where new data is processed and sent to the GPU.

Crysis 2 released as a DirectX9 game, but was later patched to be DirectX11 compatible. A major feature release in DirectX11's version of Direct3D was a new stage of the pipeline that allowed for something called "Dynamic Tessellation". Before we can learn what Tessellation is, we first need to know the basic properties of 3D Models:


An object is constructed of "polygons", a closed shape. Each polygon is made up of vertexes/vertices, which are points in space that define the shape, "edges", which are the border lines that connect the verts, and "faces", which is the filled in space between the edges. There are commonly two types of polygons that we use in 3D work; Quads (4 Verts, 4 Edges), which are very nice for modeling and animating, and Tris/Triangles (3 Verts, 3 Edges), which are used for gaming as they have less data and so its easier on the GPU.

Tessellation looks a little like this:


Tessellation works by splitting every Quad into 4 faces (or splitting Triangles into halves). The idea is that the more polys in your object, the higher quality your model will be as there's more shape to it. Prior to DirectX11, Tessellation at runtime was very rare; it was usually only used during the modeling stage when a modeler felt they needed more detail in whatever they were creating.

What Microsoft realised was that developers wanted to make higher quality water systems and better LoD scaling, and so the idea that a developer could dynamically choose to increase or decrease the amount of polys in an object became a must. When it came time to think about upgrading their rendering system for DX11, EA/CryTek decided that Crysis 2 should make use of the Tessellation system to really increase the quality of the world and make the game look just stunning.

Oh man, did they forget it up.



Part One: A Slab of Info.

Take a look at this concrete slab.


Looks like a standard concrete barrier. That's the DirectX9 variant. If you enable DirectX11 and Tessellation, here's what you'll see instead.


You know, I'm not really seeing much difference...let's get out our X-Ray and give this barrier a once over, maybe we'll find what's changed...


JESUS, MARY AND JOSEPH.

That is absolutely mental. Apparently somebody at CryTek thought that "Tessellation" stood for "Kill everybody's GPU". Here's some other views to really help you understand just how bad this is.




Notice how hard it is to see any single poly by itself...that's a pretty bad sign that you've gone overboard with the tessellation. Unfortunately, that's not the worst of Crysis 2's sins.



Part Two: Wet. Very, Very Wet.

I mentioned before that one of the massive goals of tessellation was for water systems. Good looking water in games involves distorting the shape of a plane (a flat surface made up of polygons), but prior to Dynamic Tessellation you had to make a choice; either sacrifice quality by having less polys in your water plane but gain performance if the player is far away from it, or increase polys in the water surface but decrease performance whenever the water is rendered.

Dynamic Tessellation guaranteed that the developer could instead scale the amount of polygons depending on how far away the player is, and also change the poly total based on how much distortion you needed to do to the water; very calm water won't shift as much as rapid waves, so you need far less polygons to make it look good. DirectX11 was kickass at making beautiful water, and so the guys at CryTek wanted to take advantage of that...

Here's a shot of the shoreline in Crysis 2.


Here's what the wireframe looks like:


Now, if you were paying attention to my notes, you'll know that isn't bad, at least on first glance. While it doesn't appear that Crysis 2 reduces the amount of polygons on the water at the horizon, it still looks pretty clean.

Let's turn around and get a quick shot of the scene behind us.


Seems to be a fairly standard enemy camp for the Crysis 2 campaign. Unfortunately, there's something lurking out there...let's get out our tools and give it a quick peek...


MOTHER OF GOD.

In most video games, as you'll notice if you've seen any videos of people falling out of the world, the developers usually have a system that fills the entire bottom layer of the world with water, and then the world gets built over it. It's easier to have one giant plane  rather than have to place hundreds of little planes wherever you see ocean. In most games, however, the water is "culled out" (that is, not rendered because it is behind another object) which prevents it from reducing performance. Apparently, Crysis 2's implementation of Tessellation means that the highly tessellated water is always rendered whenever you're close to a water source. Nice.



Part Three: Bricked.

While we could go on about the terrain forever, I instead want to focus on the more insignificant things that really ought to not be tessellated. In this scene, look at the bricks on the very left side;


Now, a sane and rational human being would think that something so minuscule shouldn't need high detail. Unfortunately, the people at CryTek aren't sane or rational.


Hey, do I see water off in the distance?


HOLY stuff.

Seeing even the tinniest amount of water means the entire scene gets bathed in it. forget me.



Part Four: What the forget.

Here's a good looking shot of Crysis 2.


Let's focus on those floorboards; in most games, those would be a flat plane with some normal mapping, which essentially modifies the way light bounces off those objects, giving them the appearance of being 3D when they're actually just flat.


I imagine the conversation went like this;

Quote from: The Boss
JENKINS! You don't get a Christmas bonus unless you figure out a way to make our game really utilise that DirectX11 stuff the fans have been crying about.
Quote from: Jenkins
Well, sir, I could apply tessellation to every single object in the world.
Quote from: The Boss
THAT'S PERFECT! You get twice your salary!
Quote from: Sane Individual
But sir, wouldn't that decrease performance for little benefit? It would take a lot of work to make tessellation scale properly so the game's framerate doesn't suffer horr-
Quote from: The Boss
You're fired. Jenkins, you have 10 minutes to get everything tessellated else I'm going to feed your entrails to my dog! Hah-ha!

Hey, I wonder what that brick wall looks like...


You know, in the scale of things, that isn't so bad, at least until you remember that there's other tessellated objects in the world, such as these logs.


If we hold up for one second, we can actually view those logs in a closer detail and see if it's really worth it.


By the way, that solid red bit? That's really densely packed polygons, to the point that you can't even distinguish them any more.

Also, the water is here as well.


JESUS WEPT.



That's Crysis 2's implementation of DirectX11 for you. Shoddy, unnecessary and absolutely loving hilarious. Hopefully today you've learnt something about the game development process and playing it smart.
« Last Edit: August 29, 2016, 09:01:18 PM by McJob »

there's two part twos in the op

Wow, this is some really, really awful coding on part of the designers. Is there some way to enable DirectX 11 tessellation, but also impose a cap on how far down the tessellation can go?



I'm still looking for the hidden anti-feminist message.


Here's an AMD card attempting to run Crysis 2 at Ultra.


this is pretty incredible to be honest

quick question how good does the game run with all that

that's just overkill.

Is there some way to enable DirectX 11 tessellation, but also impose a cap on how far down the tessellation can go?
Unfortunately not; you would need the source code so you could modify the algorithm they've used to tessellate objects.

quick question how good does the game run with all that
Surprisingly decent on most modern machines, although you're likely to run into a lot of stuttering whenever tessellated object appear. Keep in mind that the DirectX11 upgrade introduced a lot of other effects which also drain performance, such as higher resolution textures and Depth of Field.



NVIDIA cards attempt to run Crysis 2 Ultra:


Remember when vidya games had a low polygon limit?

I'm starting to miss that tbh.


[imghttp://i.imgur.com/lJh3zxH.jpg[/img]
omg where tf have you been


And even after all these HD textures and tesselation it still looks like a video game.