3D Model Glossary

From XentaxWiki
Revision as of 00:35, 14 June 2014 by imported>LindaRogers (minor updates)
Jump to navigation Jump to search

This page contains a list of (many) concepts related to 3D models (and computing).

Representation of 3D objects

GPU's main job is to process vertices. They are very good at it. It is possible to store and render 3d graphics using other methods than the ones described here, like voxels. But modern GPUs are only good for rendering 3d graphics from the data we described here and most games need the GPU to run, as CPU is too slow for rendering 3d graphics in realtime, both polygonal or voxel based. What this means is 99.9 % of games you encounter will use the methods we describe in this document.

Vertex

The building block of 3d data is the vertex. A vertex is a point in 3d space. So a vertex needs 3 values: x, y and z position. The position values are usually represented as 4 byte floats, though not always.

Face (Triangle, Tristrip, etc.)

Two vertices (“vertices” is the plural for “vertex”) can connect and form a line.

Three vertices can connect and form a triangle. Although more vertices can connect and form more complex polygons like quads (4 vertices), triangles are the most common. In fact, the GPU needs to break more complex polygons down to triangles before processing them, so 3d formats are likely to always use triangles. But how are triangles stored in files? Three vertices (3*3 position values) are enough to create a triangle. But this is not how triangles are always generated from the vertex data in the 3d files. Triangles can also be represented as what is called a “tristrip”, or triangle strip. In a triangle strip, the first three vertices form a triangle, then every new vertex creates a new triangle by connecting with the previous two. Tristrips are performance optimization for some GPUs.

There are other ways to connect vertices, like linestrips or trifans (short for “triangle fan”, each new vertex after the 1st one creates a new triangle, by connecting with the previous and the very 1st vertex). However these are less common.

Some 3d formats will use what is called an “index buffer” (index list), together with the “vertex buffer” (vertex list). Index buffer is basically a list of (usually integer) numbers which tells which vertices connect with each other by their index in the vertex buffer.

Vertex and Index Buffer

Vertex buffer is just a list of vertex datas. The vertex buffer can be interleaved or non-interleaved. Interleaved means each vertex data in the buffer contains vertex positions, normals, colors, uv maps, etc. one after another. Non-interleaved means there is a list (buffer) of positions, then buffer of vertex normals and so on.

As explained above, index buffer is basically a list of (usually integer) numbers which tells which vertices connect with each other by their index in the vertex buffer. Index buffers are easy to spot as they are usually a list of growing integer numbers. Simple formats might not use an index buffer.

Mesh

A collection of triangles or tristrips is called a “Mesh” or “Surface”. Each file you explore will likely have more than one of these.

Vertex color

Vertex colors are color values assigned to vertices. It's not hard to imagine a colored dot in 3d space, but what happens when vertices connect and form lines or triangles? It would be practically useless to have colored dots on your mesh. Luckily, that's not how they are rendered by OpenGL or DirectX when connected. The colors of the neighboring vertices are interpolated over the surface, so you get a nice gradient. This makes vertex colors very useful for things like skydomes because they take up far less memory than gradient textures. Vertex colors are also used on map models to simulate shadows. Some old games use vertex colors on characters instead of textures (usually only the face of the character will use a texture image).
Vertex colors are usually 4 float numbers or integers. The 4 values are in RGBA order (Red, Green, Blue, Alpha), or BGRA. Alpha might not be used depending on the game. It's easy to find out if the game uses BGR(A) or RGB(A) order. If after importing the model appears too blueish or too reddish, then you probably read it in the wrong order.

Vertex normal

Vertex normals are vectors which are used to calculate lightning during rendering. If you won't read them, your 3d tool might display your meshes as completely black or white. But usually most 3d modellers will silently regenerate normals during import and editing, or at least give you an option to regenerate normals. Normals are usually stored as 3 floats (x,y,z).

Vertex UV map

UV maps are (x,y) position values which specify how a 2d texture image is “wrapped” over your 3d mesh. The game or 3d modeller treats your texture image as a grid where the bottom-left corner is the position (0.0, 0.0) and the top-right corner is the position (1.0, 1.0). Then your vertices, and therefore also the faces which they form are positioned on that grid and the GPU can easily tell what pixel to assign where on your mesh. So you can tell that your vertices have two positions: one in the 3d space, one in the 2d space of your texture grid. UV maps are usually represented as two (x,y) float numbers. Do note that although the grid has positions in the range of (0.0,1.0), the vertex positions might go beyond this range. Depending on the format, or a flag somewhere in the file, the vertex falling outside of that range will either not get any pixel assigned (black or transparent), will get assigned the closest pixel in the grid, or the UV grid will be treated as infinitely repeating (in other words, position 2.0 will be the same as 1.0 and so on).
Some games use what is called “multitexturing”, which means multiple textures are applied on top of each other like layers in Photoshop or GIMP. In such case each vertex can have a different UV map for every texture image it is assigned to. Multitexturing is often used for terrain models for texture splatting effect. Multitexturing is also present when the game uses normal maps or specular maps, though the vertex will not always use different UV maps for them.

Material

Materials specify how a Mesh is shaded, or how it appears when lit with OpenGL or DirectX lights. Usually each Mesh will have one material for it, in other games you may be given two indexes: starting face and face count/or ending face index, which will tell which faces of the Mesh are assigned which Material.
Some games might not use materials at all because they don't use realtime lightning, or they might have materials for characters, but no materials for levels, as lightning can be simulated by vertex colors or shadow textures.
Materials are pretty standard, there are usually RGBA/RGB or BGRA/BGR values for each material component. The material “components” are ambient color, diffuse color, specular color, emissive color. There is also a single integer or float for ? ... \n

Study Finds Monsantos Pesticide Chemical to Produce Cancer-Causing Fungi

Elizabeth Renter Prison Planet.com October 26, 2013 One of the many reasons we (and so many others) speak out against genetically modified organisms and foods is because their impact is understudied and largely unknown. With each piece of research, however, we learn more and more about how genetically modified foods are having a negative impact on our health and our ...
[Study Finds Monsantos Pesticide Chemical to Produce Cancer-Causing Fungi ]

['.GetDomainName().' - news, stories, articles]

Study: Safe Levels of Food Contaminants Contribute to Chronic Disease Risk

Elizabeth Renter Prison Planet.com November 27, 2013 We are exposed to countless pollutants on a daily basis in our food, air, water, clothing, and homes. And while many of them are known to be toxic, the consequences of low-level exposure are largely unknown.Despite the FDA and EPA claiming safety for the small amounts of contaminants were exposed to,a recent study...
[Study: Safe Levels of Food Contaminants Contribute to Chronic Disease Risk ]

['.GetDomainName().' - news, stories, articles]

Why Is The US Building A Secret $100 Million Underground Facility Outside Tel Aviv?

Leave it to legendary Walter Pincus from the Washington Post to flesh out a Request for Proposal construction project planned for Israel called Site 911.The oddly named project will cost up to $100 million, take more than two years to complete, and can only be built by workers from specific countries with proper security clearances. Palestinians need not apply.

[Why Is The US Building A Secret $100 Million Underground Facility Outside Tel Aviv?]

['.GetDomainName().' - news, stories, articles]

6 Simple Ways to Reduce Your Risk of Cancer

Elizabeth Renter Prison Planet.com September 30, 2013 Big Pharma would make tens of thousands of dollars off of your cancer diagnosis. They wouldnt give you a real solution, but would merely prolong your illness so you can continue to spend your savings (and beyond) on their toxic cancer drugs. What the medical industry doesnt seem to want to discuss (in addition to ...
[6 Simple Ways to Reduce Your Risk of Cancer ]

['.GetDomainName().' - news, stories, articles]

Obama Justifies NSA Spying: Paul Revere Did It First

Argues US has always defended freedom through surveillance Steve Watson Prison Planet.com January 17, 2014 In a speech that was billed as an announcement of reforms to the NSAs mass spying practices, the president argued that the US has a long history of defending liberty by conducting surveillance. Obama even cited Paul Revere, in remarks clearly designed to ...
[Obama Justifies NSA Spying: Paul Revere Did It First ]

['.GetDomainName().' - news, stories, articles]