Labels

Showing posts with label game technology. Show all posts
Showing posts with label game technology. Show all posts

2010-11-20

Starting out with 3D #5 (U - Z)

This is the final piece of  the 3D terminology. *Thank goodness*. If you followed all of these tutorials you should know the drill by now. If not, best read the other parts if you would like to know more!

The other parts can be found here:

Part 1: A - E
Part 2: F - L
Part 3: M - P
Part 4: Q - Z
UV Texture Co-ordinates
The co-ordinate system used for assigning textures. UV co-ordinates space is 2D, thus a projection method must be used to “unwrap” the UV’s from the model and then lay them on a flat plane. This plane can then be copied into a paint package to manipulate to finally add the model texture.

Viewport
The region of the 3D scene that is displayed to the artist. For example, from the top.

Volumetric
Volumetric lights are lights which can be view in the 3D space rather than on a flat surface. Just like that, volumetric textures are textures applied throughout a volume space rather than a surface.
 

Weighting
The process of determining which bone in a skeleton affects which part of the models surface. In a lot of cases, the influence is simply painted on the model.

Wireframe
A shading method in which lines are displayed to represent the models form.
 


Z-depth
The distance a point or surface lies in the scene. Z-depth is used to calculate where a light casts shadows and also which surfaces are actually visible.

If you know every single one of these terms, you are amazing! If you learnt new terms great! If you learnt so much and you are so pumped about these articles and you are going to tell all your friends to visit this website, best of all!

Let me just say, don’t feel like you should know all of this off by heart, as long as you have a basic idea of most of them you will do fine!

Thank you for reading, and as I promised, here is a downloadable PDF file of everything in the past 5 articles, for future references.
zSHARE
Note: Please excuse the messiness. The converter did a pretty bad job in converting the pages. At least the information is there right?

Starting out with 3D #4 (Q - T)

Picking up where we last stopped. Here are the words between Q and T.
The others can be found here:
Part 1: A - E
Part 2: F - L
Part 3: M - P

Quad View
A method of displaying 4 viewports for you to view your model. The standard viewports are usually top, front, side and perspective.

Raytracing
A technique for rendering scenes. Raytracing traces the path of every single light from its source until it leaves the scene or is to dim to be visible in the current image.

Reflection Map
An environment map used to simulate real world reflection effects. They render quicker than other methods such as raytracing.

Rendering
The process of converting the 3D data stored in a software package into the two-dimensional image “seen” by the camera within the scene. Rendering brings together the scene geometry, Z-depth, surface properties, lighting set-up and rendering method to create a finished frame.

Rigging
When preparing a 3D model for animation, you usually add in an underlying skeleton. This makes everything easier to animate. This skeleton is linked to the model. That process is known as rigging. When this process is completed, you refer to it as a rigged character.

Scene
A set of 3D objects. This includes the models themselves, lights, cameras etc.

Shading
The process of calculating how the model’s surface should react to light.

Skinning
When binding the surface of a model to the skeleton during character rigging.

Skeleton
A network of bones used to define and control the motion of a model during character animation. Moving a bone causes the mesh of the model to move and deform.

Snapping
The automatic alignment of one object to another or to a reference grid. This is used when extreme precision has to be taken into account.

Soft Body Dynamics
Simulates the behaviour of models that deforms when they collide with other objects. Such as a cloth on a table.

Secularity
A property which determines the way in how highlights appear on the specified surface.

Symmetry
A modeling option which duplicates the model across a specified axis. This is used a lot for organic modeling as only one half of the model has to be modeled.

Texture
An image that is applied to a 3D model to give it detail. They can be photographs or CGI. They can be applied to each of the material channels.

Trimming
The process by which NURBS surfaces are edited. This allows 3D artists to define areas that will be made invisible, and also not render them. Theoretically they still exist and you can also still edit them if you please. This is used to get rid of pieces in the model that will never be seen.

In the next part, I will finish up with the common 3D terms, I will also add a downloadable PDF document with all of these words if you wish to download them for future references.

Starting out with 3D #3 (M - P)

This is the follow up from #1, which can be found here, and #2, which can be found here
We are almost finished! Bare with me!


Material
Mathematical attributes that determines the ways in which the model will react upon light.

Mesh
The surface geometry of a 3D model.

Metalball modeling
A technique in which models are created using spheres that attract and cling to each other according to their proximity to one another and their field of influence. This technique is mostly used when creating organic models.

Model
As a verb it means to build a 3D object. As a noun it is referring to the end result of a 3D object.

Modifier
A modeling tool which deforms the structure of an entire object. Eg. Lathe

Multi-pass rendering
To render out the lighting or surface attributes of a scene as separate images, with the idea to put them together at a later stage. This technique can be used to speed up rendering or in order to develop the look of a scene by compositing the different passes together in various permutations.

Normal
An imaginary line drawn from the centre of a polygon at right angles to the surface.

Null
A point in a scene that does not render, but instead is used as a reference.

NURBS
Stands for Non-Uniform Rational B-Splines. NURBS curves are two-dimensional curves whose shape is determined by a series of control points between which they pass. When a series of such curves are joined together, they form a 3D NURBS surface.  NURBS are commonly used to model organic curved-surface objects.

Object
Anything that can be inserted and manipulated in a 3D scene. It can be lights, models, particles, cameras etc.

Patch
An area of a NURBS surface enclosed by a span square: the shape created by the intersection of four isoparms, two in the U direction, and two in the V direction.

Plane
A flat, 2D surface. This can be used for modeling or for references, depending on the final goal.

Point
A one-dimensional point in coordinate space. Points can be linked up to form polygons, used as control vertices for NURBS curves.

Polygon
Geometry formed by connecting 3 or more points. This is why in 2D you work with squares, but triangles in 3D.

Primitive
A simple 3D form often used as a basis when modeling something else. Examples include cubes, planes, spheres etc.

The next part goes from Q to T.

Starting out with 3D #2 (F - L)

This section builds on #1, which can be found here.

Face
Simply put, the shape of which a 3D object has been extruded. The front or back of an extruded object. Any of the polygons which makes up it’s boundaries.

Fall off
The way in which the intensity of a light diminishes with the distance from its source. In the real world, this is calculated by the inverse square law, which states that the intensity is inversely proportional to the square of the distance. In other words, the further the light, the darker the object. Real world examples would be the sun, a light, etc.

Forward Kinetics (FK)
A character animation technique for controlling the motion of bones in a chain. For example, the limbs. The opposite of this is inverse kinetics. (See further down)

Global Illumination
A type of rendering that computes all the possible light interactions between surfaces in a given scene.
Grime(Dirt) map
2D images applied to a particular channel of material. When the image is projected across the surface of an object, it breaks up the channels flat, even value, creating realistic variations.

Hard Body Dynamics
Also known as rigged body dynamics. It simulates the physical behaviour of rigged object that do not deform on collision.

Hardware Rendering
Renders a preview of a 3D scene providing real-time feedback. To make this possible it removes certain processor-intensive effects such as volumetrics, shadowing and realistic refraction.

Hierarchy
The relationship of the sub objects within a model or scene to one another. Sub-objects may exist as
parents, children or independents. A parent object controls the motion of all child objects linked to it. The motion of a child object does not affect its parent.

Interpolation
When a 3D package calculates the in between position between two keyframes.

Inverse Kinematics (IK)
Inverse Kinematics is a character animation technique in which the end bone of a chain is
assigned a goal object. When the goal object moves, the bone moves with it, dragging the rest of the chain behind it. For example, when moving a hand up, the whole arm moves up with it. The reverse is Forward Kinematics.

Joints
Points between the bones in a character rig.

Keyframe
An image used as a reference point for animation. An image is set up at a certain time in an animation and a later time and have the computer calculate all the frames between the two reference images. (See Interpolation)

Lathing
A modeling technique in which a two-dimensional profile is duplicated in rotation around a reference axis. The duplicates then join up to create a continuous three-dimensional
surface. Lathing is particularly useful for creating objects with rotational axes of symmetry, such as plates, glasses, vases or wheels.



Lofting
A technique in which a continuous three-dimensional surface is created by selecting and joining multiple two-dimensional cross sections or profiles. You basically have a “path” and an “object” the object will follow the path.


Low Poly Modeling
When creating a simplified model with a low polygon amount for realtime use, such as games. A few years ago anything with a polygon count of 512 and under was considered low poly. Today, anything well over a few thousand can still be rendered in realtime.

In part 3 I am going through the words between M and P.

Starting out with 3D #1 (A - E)

With each technological advancement a few new words are invented. For example a Hard drive, an Operating System, Application software, PDF, etc.  All those were words that you wouldn’t find anywhere a hundred years ago. 3D is no exception. There are hundreds of new words and terms you should learn before you can think of going into 3D.

First off, you should know that 3D is a space that has height, width and depth. 2D only has height and width.

Note: Not only should you know 3D terms before you can tackle 3D, make sure you know your 2D terms to! Such as channel, animation, co-ordinate system etc.

Due to the massive amount of words that was invented for 3D, this topic was split into several parts, I also only included the important ones, things you will be using a lot, or things I think will be much more popular in the future. At the end of the series, you can find a downloadable PDF file with all the words neatly summed up.

#1 (A – E)
#2 (F – L)
#3 (M – P)
#4 (Q – T)
#5 (U – Z)

Bone
Much like a human bone organ, a bone in a 3D scene is placed “inside” of the skeleton of the model. When the bone in the skeleton is moved, it reacts on the mesh, making the mesh move, thus deforming the model to fit into the skeleton.

Boolean
In 3D, a Boolean is an object that is created by merging two new objects via mathematical operators. The two objects may be subtracted, merged or intersected to form a new object. See screenshot below of me using the Boolean technique on two cubes.


Bounding Box
The smallest possible regular shaped block that encloses an object.
 

Why would this be useful? This really does speed up a lot of maths, for example with collision detection. Instead of checking collision with hundreds of points on the model, a simple box is created.

This is also a rendering technique (See DirectX article), in which programmers check if the bounding box has any effect on the final image. If not, the object is not rendered. This saves your computer a lot of trouble and speeds up gameplay.

Bump Map
Bump mapping is a technique used to modify a 3D object based on a 2D, black and white image. When projected on the surface of a model, parts of the surface which has lighter, or white colors are raised, darker colors are lowered. This is simply a rendering effect and can make a big difference on the end effect. The actual model is not actually edited. (See Displacement map).


A clean sphere on the left, with a bump map in the middle, placed over the sphere will generate the result on the right.

Camera
A virtual viewpoint in 3D space. A camera represents the viewers eye. Everything you see on the screen of a game, is making use of a camera. A camera can move, rotate, zoom, etc. Whatever to suit the programmers need.

Camera Mapping

A technique by which geometry matching the size and perspective of objects shown within a still image is constructed, and the original image mapped back onto those objects. This permits limited camera movement around the picture, giving the illusion of a 3D environment from a 2D image.

Camera Path
The given path in 3D space in which the camera will move in a 3D scene. For example, when starting a game, some games give you a quick preview of the level. That preview you see is the image from a camera which is moving in a path.

Camera Tracking
A visual-effects technique that allows the insertion of computer graphics into other footage with correct position, scale, orientation, and motion relative to the photographed objects in the shot.

Caustics
A piece of intense illumination caused by the refraction of light through a transparent object or the
reflection of light from a reflective surface. This is not easy to achieve, in mathematics, this effect would have a formula similar to this:
 
Luckily none of us have to worry about that. The 3D package worries about that. It does all you need. Only recently have computers be able to create this effect in a 3D environment. A common example is that reflective shine on a swimming pool on a hot sunny day.

CGI
CGI stands for computer generated imagery. This is really simple. An image created or manipulated with the help of a computer. This is used in a lot of forms, but mostly in 3D. Probably because 3D is created from scratch and not like photographs being manipulated.

Character Animation
A sub section of animation that deals with the simulation of movements of living creatures. Usually before this can be done the model has to be rigged. (See part 4).

CV
CV stands for control vertex(See part 5). Which is a control point used to manipulate a NURBS(See part 3) curve.

Displacement Map
Similar to a Bump map, but a Displacement map modifies the actual underlining geometry and is not just a rendering effect.

DoF
Stands for Depth of Field. The depth of field of a specific lens is the range of acceptable focus in front of and behind the primary focus setting. It is a function not only of the specific lens used but
also of the distance from the lens to the primary focal plane, and of the chosen aperture. Larger apertures will narrow the depth of field, smaller apertures will increase it.


Extrusion
A modeling technique in which a 2D outline is duplicated outwards along a linear path. Example of extruding a flat plane.


This concludes the first section of our 3D terminology. Stay tuned, number 2 is coming soon!

2010-11-18

DirectX 9 vs. DirectX 10

Today, most computers can run DirectX 9. We are slowly starting to move to DirectX 10. We would have been there long ago, but people aren’t very satisfied about Windows Vista and Windows 7, so it’s taking a little longer than expected. I would recommend you upgrade to DirectX 10 if your hardware and software can handle it. If not, stay with DirectX 9, wait until we advance a bit more! I wouldn’t upgrade just for DirectX 10. Anyway, DirectX 10 is the API currently used on the Xbox 360. So this article is comparing DirectX 9 with DirectX 10 from both a gamers and developers point of view. For those of you interested, here are some comparison shots of DirectX 9 and DirectX 10.

DirectX 9

DirectX 10



Microsoft’s flight emulator


Call of Juarez
It’s pretty clear who the winner is in each category. DirectX 10 not only looks better, but also performs faster and makes everything a heck of a lot easier for developers! If you don’t think DirectX 10 is that much better than DirectX 9, just stay with DirectX 9 for a while, it’s still mostly used. Even the newest games support DirectX 9.

So why use DirectX10?
From a gamers point of view. It looks better and performs better. From a technical point of view... There are a lot of reasons.

1. DirectX 10 features a highly optimized runtime, powerful geometry shaders, texture arrays and numerous other features.
A big problem with DirectX is that is uses up a lot of CPU power. DirectX 10 really did a wonderful job in using much less CPU power.
For example:
DirectX 9 validates resources for every use. So it is validated several times at the end of the day. DirectX 10 only validates resources once. Not millions of times like DirectX 9, only once.

2. Switching between multiple textures incurred a high state-change cost.
What artist done was stitched together several small textures in one huge texture, this is known as a texture atlas. This allowed developers to use multiple textures without paying the cost of creating and managing multiple textures. The problem was that DirectX 9 only permitted a texture whose size was no bigger than 4048 x 4048. So this made that approach fairly limited. DirectX 10 has a solution for this problem. It has a new construct called a texture array. It allows up to 512 textures to be stored in an array structure. Included is an instruction that allows a shader program to dynamically index into the texture array.

3. Predicated draw no longer requires CPU intervention.
In most 3D scenes, many objects are entirely overlapped by other objects. This will mean that while the object is still calculated and drawn, it will have no effect on what you see on the screen. This is defiantly a huge waste! Advanced GPU’s have methods to detect and avoid processing of those pixels, but, like most things in life, it does not always work so great. So to avoid such a big waste, developers use a technique called predicated draw. With this technique, complex objects are drawn using a simple box approximation. If drawing this simple box has no effect on the final image, that object is simply not drawn. Previously, this was done using the CPU and the GPU. Now with DirectX 10 this process is done entirely on the GPU. Meaning less strain on the CPU.

4. More than 100 times the amount of resources available
In previous versions of DirectX, Developers had to carefully manage register resources. Thanks to the Shader Model 4.0, DirectX 10 provides much much more resources.

The amount of temporary registers has increased from 32 to 4096.
Constant registers from 256 to 65 536.
Textures from 16 to 128.
Render targets from 4 to 8.
Maximum texture size from 4048 x 4048 to 8096 x 8096.
Now what does this mean? It means better graphics ofcourse! With much less trouble!

5. Speed is also greatly increased.
Some features could be more than 10, or even 100 times faster. And I’m not exaggerating!

This chart shows the tests done by Nvidia, not me or some other amateur.

6. New High Dynamic-range rendering formats
HDR became popular thanks to the support of floating point color formats in DirectX 9. This however, does take up more space than integer representation. DirectX 10 has two new HDR formats that offers this at half the storage! Won’t go into that too much, that’s getting way to technical!

High Dynamic Range formats, new algorithms and many many more which is sure to make the programmers life much easier and the result hundreds of times better.

I think I said enough to make you consider using DirectX 10 over DirectX 9!

The Future
With technology growing as fast as it is, there might not be that much more of a future. Research shows that computers average speed doubles every 12 – 18 months. We are only a few years away from photorealistic real time graphics. We are pretty damn close to it! Photorealistic images can be rendered in less than half a second on professionals PC. Actually, it is speculated, that there might only be nine generations of consoles. We are currently in the eight. Technology is growing so fast that at this rate, in 5 or 6 years when new console models are released, the technology will be so good that there will be no need for upgrading! That would be really interesting to see!

I think that’s too far in the future! The above is 5 – 8 years in the future. 1 – 3 years in the future, we have, bigger, better, faster games. DirectX 11 is already released! Though it is not that popular, I think we are still migrating to that. I won’t go in detail with DirectX 11 though. Maby in a later article I might talk about DirectX 11.

As far as I have heard, DirectX 12 isn’t even in development yet. So it looks like we are going to have to wait a while to see what the future holds.

Conclusion
In the previous article I have explained to you what DirectX is, it’s main components and it’s history. In this article I gave you a technical brief of DirectX from a developers point of view, comparison shots and finally some information about DirectX 11. You now have a wealth of information, so go out there and show off your superior smartitude!

References:
Microsoft.com
Wikipedia.org
DirectX 10 Technical brief from Nvida
Several professional game programmers
Winmatric.com
IGN.com

An introduction to DirectX technology

In this article, I am going to explain to you what DirectX is, how it came to existence, and why.

DirectX is an API, or a collection of API’s which mainly focuses on multimedia on the Windows operating system.

DirectX has several components, as the user of DirectX, you don’t have to worry about these that much. The components you should worry about are as follows:
  • DirectDraw, or more popular, Direct2D (a newer model), which is used for 2D graphics.
  • Direct3D, for drawing 3D graphics
  • DirectInput, for interacting with input devices such as keyboards, mice and joysticks. DirectInput is becoming less popular because of it’s “newer model” known as XInput, which is simpler to use and allows you to use Xbox 360 controllers in your games as well as standard WMINPUT window messaging for keyboard or mouse input.
  • DirectSound, for the playback and recording of waveform sounds. Also DirectSound3D, which simply plays back 3D sound.
Those are all you have to worry about for now, of course it has other components to, but we don’t worry to much about them. Now a days, C# programmers tend to use XNA, which is pretty much a simplified version of DirectX. XNA was built on top of DirectX.

History
In 1994 Microsoft was just about to release their “newest” operating system, Windows 95. Windows future would be determined by the software created for it. Back then, programmers found it easier and better to use their previous operating system, known as MS-DOS, to create games. That would mean that a very little amount of games would be created for the “most advanced” operating system. Seriously, how many of you would use an older operating system if you know it has 10 times more good games? Most of us right? That was just the logical choice. DOS allowed access to component in the operating system. This was the problem, as from Windows 95 restricted access to those parts of the computer, for obvious reasons. Now Microsoft had a problem on their hands. They had no choice, but to give the programmers what they wanted. So DirectX was born. The first version of DirectX was released in late 1995, at that time it was partners with OpenGL as OpenGL was used with the “high end” hardware. More on that later.

DirectX continued to be updated, but the programmers were still unhappy with it. It had messy code, it was hard to work with and wasn’t very popular. So programmers continued using OpenGL. This continued until DirectX 8 was released. According to programmers, DirectX 8 was much more “clean” and “understandable” than DirectX 7. It was not until then that DirectX became more and more popular. DirectX 8 was also the main API for use on the Xbox.

That’s about it for me. I assume after reading this article you have a little general knowledge with DirectX. Though if you feel you want to read up some more on it, check out Microsoft.com and Wikipedia.org

If you enjoyed this article, wait until you see the next one!

DirectX 9 vs. DirectX 10

The Future Flash: HTML

How much of a shock to your system is that title?

It very well could turn out to be true. For years, Adobe Flash has given us rich Internet applications, bloated browser plug-ins, and long-lingering security exploits. It doesn't work on important systems such as iOS (iPhone, iPod Touch, iPad), and 64-bit Linux support is abysmal.

So, leave it up to the people who write Web standards to take a proprietary, sloppy, but widely utilized Web technology and make it work.

The new HTML5 spec is currently being adopted by Web browsers. What does this mean for the game developer?

Flash without Flash
You can get pretty much every bit of functionality out of new HTML5 elements that you could from Flash. Whether you want to embed video, audio, or - yes, even games - into a Web site, it is now possible without Flash.

To prove this theory, I have written a game using only HTML5 and basic JavaScript. It is a space shoot-'em-up, with sprites that scale and rotate, and can be faded in and out with an alpha setting.

Uh oh, ship go boom.


It's payback time!

Of course, not all is flowers and butterflies, yet. The game works great in Firefox 3.6+, but has a few bugs in the WebKit (Safari, Opera) browsers. It won't work at all in Internet Explorer 8!

Make no mistake - HTML5 is the future. The standard is still going through its share of growing pains, so to speak. However, at present, its status of adoption by current browsers may leave a bit to be desired.

If you have Firefox 3.6+, in the meantime, give my game a try. Head on over to my Web games site and give Spacite a whirl. While doing so, remember that this was all done using standard HTML5 and JavaScript.

In the next few years, as implementation of the HTML5 standard grows, we will see some great leaps and bounds in rich Internet applications and Web games. WebGL, which is an OpenGL implementation designed for Web sites, will be enabled in your browser by default in releases coming in the near future. Until then, the HTML5 Canvas element can do pretty much anything that Flash can. You can even write HTML5 applications for the iPhone and other iDevices - something you can't do with Flash.

Keep it tuned here for future articles that will teach you how to implement this rising technology, and without software costing nearly $1000US or the finicky Flex SDK.

With development this easy, HTML5 is truly poised to become the future Flash.