Crash Course for Dummies : 3D Models in Video games!
Even gods are made of polygons in videogames. (Source : Vimeo)

Crash Course for Dummies : 3D Models in Video games!

What are 3D Models?

Its 1981.

Up till now, all the gamers around the world are blissfully playing their Pac Man and Asteroids. These games were fine. Not just fine, but these are the cult-classics in videogames that would go on to define an era of gaming. But, even their fantastic gameplay and graphics did not have one thing : the 3rd Dimension, the 3D!

Until 1980, gamers had to be satisfied with bland 2D images on the screen. But, ever since the 3D Monster Maze was released in 1981, 3D games have taken the video gaming world by storm. And rightfully so!

From the rudimentary black and white 3D graphics seen in the 3D Monster maze, 3D games have come a long way. They are now dominant on every AAA game titles from the most serious of game creators.

And in the heart and soul of it all, 3D models or 3D objects are what add the extra dimension to the videogame.

Remember that shiny car in GTA, or the realistic players in FIFA and that shiny explosive loot crate? Those are all 3D models. 3D models are the objects that fill up your game’s world and make it enjoyable, and fun. One of the most favourite 3D model for every game can be seen as:

Now, take a look at this:

What would you answer, if I asked you what was she made of? If this was Biology 101, you’re answer would’ve been bones, nerves, organs, and all. But, this is a 3D model of course, and not a real human. So our answer is going to be a little more mathematical.

A 3D model is essentially a mathematical object, made up of vertices connected together with edges, forming a mesh of polygons and are modified visually via materials and textures.

Whew! Let me break it down for you:

A 3D model has two elements: Its Construction and its Appearance.

What’s on the Inside : The Construction

A 3D model is constructed of:

1. Vertices :

Vertices are mathematical lingo for points. As we are talking about 3D models, we need to define their 3 properties : Length, height and depth.This is acheived by using the 3 coordinate system : X for length (and is horizontal), Y is height (and vertical), and Z is the depth, like this:


So, Vertices denote the X,Y,Z coordinates on a screen. They define a point in a 3D Space. They are the smallest parts of any 3D model.

2. Edges:

Edges are what connect the vertices. They help to define the shape of the 3D model. And, by modifying the edges, one can also perform different transformations on a 3D model.

3. Faces:

The area within multiple connected vertices are called faces. Faces fill up the area within the edges and make it visible.

Here are these 3 concepts, in a picture:


And, on a 3D model it can be seen as :

4. Polygons:

When you have multiple vertices, connect the edges to get a shape and get a face to make it visible, you have got a polygon.

So, Basically : Polygons = vertices +edges + faces

Now, polygons are of great importance in 3D games, as they are the most basic construction units of every 3D model. A similar analogy would be the cells that make up our bodies. Ergo, Polygons are the cells (the building blocks) of most 3D models in video games.

Thus, examining a 3D model of a videogame, will let you know that it is infact, made up of lots of polygons which are kind of “glued together”.

Here, like this:

And, another thing you need to know about Polygons is that they are normally 3 sided, or 4 sided.

The 3 sided are called Trigs (after Triangles) and have 3 vertices and 3 edges, and are generally simpler and easier to color.

And, the 4 sided are called Quads (after Quadrilaterals), and you guessed it, they have 4 vertices and edges. They are a bit more complex, but give good results.

And finally, we have the poly-count. As you guessed it, it is the number of polygons a 3D model has. The higher this number, the higher the quality and higher the system resources needed to draw this on the screen.

5. Meshes:

A mesh is a collection of vertices, edges, and faces that describe the geometrical shape (note: shape only, not the color) of the 3D object.

i.e,

Mesh = collection of Polygons = collection of (vertices + edges + faces)

So the mesh is pretty much what describes the structure of the 3D object in itself.

So, to recap:

Lookin’ Good : The Appearance

Now that we have covered what a 3D model is made of, let’s see how they are depicted visually.

The looks of a 3D model in a videogame are controlled by what Material it has, which applies the texture and the shader into your model. Let’s examine each one of them:

1. Material:

A Material is essentially, what defines how to draw the surface (or a face of the polygon) of the 3D model, on the screen. It does so by applying the information that is present in the Shaders and the textures that can be attached to the materials.

According to the Official Unity Documentation, a Material defines:

a) Which shader to use for rendering(i.e drawing on the screen) the material.
b) The specific values for the shader’s parameters — such as which texture maps, the colour and numeric values to use.

So, we can loosely say that:

Materials = Properties of (Shader) + 2D Textures

Materials play an essential part in defining how your object is displayed.

If you closely look at a Material in Unity, you can see that it has a whole range of options to choose from (which it gets from the Shader) to affect the display of your 3D model in the game.


2. Texture:

Imagine a gift you’re buying for someone. Now, you want to wrap it. Would it be easier to draw and make a piece of the wrapping paper individually for each side, or would you just rather get a wrapping paper and wrap the whole gift at once?

And unless you’re into performing painstaking and meaningless tasks, you’ll probably say the 2nd one, right?

And, similar is the case with our 3D Model. We have a 3D model(its mesh). And, textures are the flat images that are applied over the mesh surface to give it more details. A texture has appropriate information in it, about where should it apply itself on a 3D object so that it fits in the right place, and this whole process is called UV Mapping. (More on this later !)

Just think of texture as some good old wrapping paper for your 3D model.

This should make it more clear, which shows a texture being applied to a 3D model.

3. Shader:

The Shader is comprised of some instructions to the GPU that tells it how to make each pixel look. The instructions are programs, that are written in CG/HLSL (Computer Graphics/ High Level Shader Language) and run on the GPU.

In this context, let’s refer to Unity Documentation and look at what it says about Shaders:

A Shader defines:
a) The method to render an object. This includes code and mathematical calculations that may include the angles of light sources, the viewing angle, and any other relevant calculations. Shaders can also specify different methods depending on the graphics hardware of the end user.
b) The parameters that can be customised in the material inspector, such as texture maps, colours and numeric values.

Simply, it means that the shader is the one, who is telling the GPU how to exactly draw the object on the screen and it also defines all the calculations related to it. And, the things that the Shader defines can be customized through the Material, on which it is attached to, through the inspector.

The Grand Picture : Bringing it all together

Take a look at this image below. It shows how a 3D model, its materials and textures along with the shaders are related, and how they work together:

So, a 3D model is made up of vertices and other mathematical data (like Normals, UV data, etc.) The 3D model has a material, which implements the textures and the shader to define the look of the model. And, the shader is made up of code. The coding of a shader is done in either CG (Computer Graphics) language or HLSL (High Level Shader Language).

Well then, that was frankly quite a lot. But, this is not all. There are still UV Maps, animation rigs and other topics you would need to learn to master 3D models. But, this is a good start. From here on, you are now equipped with the basics of a 3D model and can now start to make your own or use them in your game!

Note : This is a modified version of an article I wrote, which was published on Medium at here.

#IndiaStudents #StudentVoices #Unity3D

To view or add a comment, sign in

More articles by Binigya D.

Insights from the community

Others also viewed

Explore topics