Browse by Tags

All Tags » Tutorials (RSS)
Sorry, but there are no more tags available to filter with.

Tutorial 7 - Render to Texture

[ Download the source ] Have you ever seen water reflecting the environment? This can be done with a technique called render to texture. Let's look at what it involves. What is render to texture? Render to texture describes the operation of "saving/capturing" a render target (surface)to a texture. Let's take an example: The top left hand corner is a sprite rendered with the textured that we have "saved/captured" from a render target (surface). The steps to follow the render to...
Posted by pieterg | 3 comment(s)
Filed under:

Tutorial 6 - Alpha Blending

[ Download the source ] Today we are going to discuss a very interesting topic, Alpha blending. What is alpha blending? "The real world is composed of transparent, translucent, and opaque objects. Alpha blending is a technique for adding transparency information for translucent objects. It is implemented by rendering polygons through a stipple mask whose on-off density is proportional to the transparency of the object. The resultant color of a pixel is a combination of the foreground and background...
Posted by pieterg | 1 comment(s)
Filed under:

Handling Lost Devices (Managed DirectX and C#)

[ Download the source ] Hi there again, twice in 1 week. Something must be going on here. How is everyone doing? Today we are going to handle some lost devices. What is a lost device? "A Microsoft Direct3D device can be in either an operational state or a lost state. The operational state is the normal state of the device, in which the device runs and presents all rendering as expected. The device makes a transition to the lost state when an event, such as the loss of keyboard focus in a full...
Posted by pieterg | 16 comment(s)
Filed under:

Tutorial 5 - Lights and Materials

[ Download the source ] Long time no see, How has everyone been doing? Today we are going to look at a very interesting and exciting topic. But you are probably thinking hey, why does this screenshot look exactly like the previous tutorial's shot? It's cause today we are going to enable light and material and this screenshot has light in it. Let's get into the theory. We are going to introduce 3 new components today. They are Normals, Lights and Materials. Let's see what the definition is for each...
Posted by pieterg | with no comments
Filed under:

HLSL Tutorial - Normal mapping (Bump mapping technique)

Normal mapping. What an interesting and exciting topic to talk about. What we are going to be looking at is an implementation normal mapping which is basically a technique where we tell the light how to behave according to the map. The map is encoded with 3 channels, one each for red, green, and blue, where if we take a point on the map we can get the normal vector of that point. So how does that work? Well your red channel defines the X coordinates, 100% red being left. The green channel defines...
Posted by pieterg | 20 comment(s)
Filed under:

Tutorial 4 - Texturing a quad

[ Download the source ] Hi there again everyone. How did you enjoy those spinning triangles? Today we are going to be looking at how to texture a quad (2 triangles form a quad). We are going to build the quad in the order given in the image below. Texturing quads is a really easy method. It involves placing what they call UV coordinates (Texture coordinates). UV coordinates (Texure coordinates) are used to tell direct3d how to map the texture points to the object. Look at the image below. It shows...
Posted by pieterg | 5 comment(s)
Filed under:

Tutorial 3 - Spinning a triangle

[ Download the source ] Welcome back. I hope you had some fun drawing/rendering some triangles. Well hopefully after today you will know a little more about moving things around. Yep, that's it. Moving/Rotating. In the Graphic development world we have a 2 dimensional array known as matrices that will help us in Translating (The term for moving things)/Rotating objects around. So what do we need to know? Well let's start off with an explanation of what really happens when you create an object. This...
Posted by pieterg | with no comments
Filed under:

Tutorial 2 - Rendering a triangle

[ Download the source ] Here we are again. Ready for another tutorial? That's good. Let's get started then. Today we are going to discuss quite a few things. This will be a very huge step so buckle up. Firstly. Let us assume that you know a little about 3d coordinate spaces. If not, the DirectX API documentation has a nice section on them. I really thought about this and decided to start from the very beginning. an Atom (Vertex). This is your building block very much like it's the building block...
Posted by pieterg | 13 comment(s)
Filed under:

Tutorial 1 - Initializing DirectX

[ Download the source ] This tutorial will be the base for every other tutorial. Creating a window and initializing direct3d is the most important task to get you going. The reason we have bundled the 2 are because it's less than 30 lines of real code and so that we can head over to actually drawing something on the screen. (And that's where we want to be isn't it?). First we need to tell c# what classes we will be using. using System; //Contains fundamental classes and base classes using System...
Posted by pieterg | with no comments
Filed under: