How does a GPU work
[40 mn of reading - published 5/18/2006 11:25:30 PM - Target : Débutant]
|
   
|
Author
2 - Vertices and primitives
2.1 - Vertices
Définition : : “Summits of a polygon, used in modeling, to calculate synthesised images in 3D. The singular form is vertex”.
There is a very simple concept behind this definition: the vertices are basically the geometrical forms displayed on the screen. Coordinates are the only information necessary for a vertex. Please note that in mathematics, a vector is defined by its 2 or 3 coordinates (X-coordinates, ordinate and depth); the coordinates of a vertex are similar, but with the addition of a component: the homogeneous coordinate. To explain quickly, the first 2 or 3 coordinates are – like in mathematics – that of a vector in space, and the 4th coordinate influes on the other coordinates.
As explained above, the vertices contain other information:
- “Diffuse and specular Colour”: that piece of information ensures that the geometrical form constituted by the vertices is coloured. Red, green, blue and also alpha are used.
- “Perpendicular”: just like in mathematics, a plane surface is defined by one single vector only, called the perpendicular. It is often used.
- “Size of the point”: rather than displaying a geometrical form, it is sometimes more powerful to use a point, defined by a vertex and the size of the point (less common).
- “Weight of the vertex”: Very complicated concept. Basically allows to obtain a fluid movement of the vertices during animation.
Obviously, the vertices require a large place in memory (for instance, 12 bytes for the normal). The memory containing information of vertices can be compared to a mask. Most suitably, the size of the mask should be quite as large as that of the vertex used, so that the “memory hiding place” is variable depending on graphics boards (64 bytes, 128 bytes, 256 bytes).
2.2 - Primitives
As mentioned above, displaying is done through geometrical forms such as a point or a polygon: they are primitives.
There are several types of primitives, and the main ones are:
- “Points”: in the case of a point, only one vertex will correspond by primitive.
- “lines”: for a line, 2 vertices are needed for the primitive.
- “triangles”: a triangle being made of 3 tops, 3 vertices are thus needed to make the primitive. But the “triangle strip” can also be used: it requires 3 vertices for the 1st triangle, and then 1 vertex for each following triangle, which reduces data in the transfer.
A kind of database is created, so that when a pattern - a primitive - is repeated several times, instead of storing it each time, a kind of number is alloted to it; then that number is used to take less space.
After the building of primitives, a new technology intervenes: Tesselation. It consists in multiplying the number of patterns on a surface, thus giving an impression of sharpness and fineness. And the higher the level of tesselation, the closer to realism the sharpness of the surface approaches. Algorithms define the tesselation.
|