XNA for C#
DirectX 9 for C#
DirectX 9 for C++
DirectX 9 for VB
Forum
   
My XNA Book
      
       Go to section on this site

Additional info


Latest Forum posts

 Tutorial 3 for Windows Phone 7
  Posted by: Anonymous
  When: 20/05/2013 at 02:30:13

 No download link for 2d series: shooter
  Posted by: zaboleq
  When: 07/05/2013 at 15:46:28

 Collision Class?
  Posted by: Anonymous
  When: 05/05/2013 at 19:03:59

 stack overflow
  Posted by: cityguy
  When: 07/04/2013 at 01:58:38

 Meshes looks strange.
  Posted by: ab_saratov
  When: 01/04/2013 at 04:31:08

 Lamppost Not loaded
  Posted by: Anonymous
  When: 22/03/2013 at 06:43:52

 Collision Class?
  Posted by: Da_Boom
  When: 21/03/2013 at 01:23:09

 Math boggles me
  Posted by: cityguy
  When: 17/03/2013 at 03:44:48

 Collision Class?
  Posted by: Da_Boom
  When: 16/03/2013 at 03:44:42

 Tree update
  Posted by: Anonymous
  When: 15/03/2013 at 21:11:22


Ads

Adding normals – Triangle Strip revisited

Before we can start defining our own lights, we need to add normals to every vertex. If you’re wondering why, take a quick look at the “DirectX Light Basics” chapter of Series 1.

The normal has to be included in the vertex stream, so let’s first redefine the myownvertexformat structure:

 struct myownvertexformat
 {
     public Vector3 Pos;
     public Vector3 Normal;
     public Vector2 TexCoord;
 
     public myownvertexformat(Vector3 _Pos, Vector3 _Normal, float texx, float texy)
     {
         Pos = _Pos;
         Normal = _Normal;
         TexCoord.X = texx;
         TexCoord.Y = texy;
     }
 }

Now it’s time to expand our vertices with normal data. It’s very easy: the normals of the horizontal quads (such as the street) are pointing upward, and the normals of the vertical quads (such as the wall) are pointing to the left, this is in the positive X direction in our case.

However, because we’re using a triangle strip, some vertices are shared by 2 triangles that should have a different normal! This is a problem of a triangle strip, and because sooner or later you’ll run into problems like this, I’ll cover it here.

One solution would be to give the shared vertices the interpolated normal. This would however give bad results, as we want to clearly see the edges.

A better approach would be to add ‘ghost triangles’. Here we simply add 2 new vertices at the places where 2 triangles with different normals share a side. In the image below, these sides are indicated by a red line, and the extra vertices are also red. Note that vertices 4 and 5 should also be drawn in red, but they didn’t fit into the image :). Note that the coordinates of the red vertices are exactly the same as those of the previous blue vertices, only the normals should be different.



As you can see, we’ll be defining 18 vertices, defining 10 normal triangles and 6 ghost triangles. Even in this almost-worst-case example, we still have to store 12 vertices less than when we would have stored them in a Triangle List.

First update your Vertex Buffer so it can store 18 vertices:

 vb = new VertexBuffer(typeof(myownvertexformat), 18, device, Usage.WriteOnly, VertexFormats.Position | VertexFormats.Normal | VertexFormats.Texture0, Pool.Managed);

And finally your vertex buffer:

 myownvertexformat[] vertices = new myownvertexformat[18];
 
 vertices[0] = new myownvertexformat(new Vector3(20, -10, 0), new Vector3(0, 0, 1), -0.25f, 25.0f);
 vertices[1] = new myownvertexformat(new Vector3(20, 100, 0), new Vector3(0, 0, 1), -0.25f, 0.0f);
 vertices[2] = new myownvertexformat(new Vector3(-2, -10, 0), new Vector3(0, 0, 1), 0.25f, 25.0f);
 vertices[3] = new myownvertexformat(new Vector3(-2, 100, 0), new Vector3(0, 0, 1), 0.25f, 0.0f);
 vertices[4] = new myownvertexformat(new Vector3(-2, -10, 0), new Vector3(1, 0, 0), 0.25f, 25.0f);
 vertices[5] = new myownvertexformat(new Vector3(-2, 100, 0), new Vector3(1, 0, 0), 0.25f, 0.0f);
 vertices[6] = new myownvertexformat(new Vector3(-2, -10, 1), new Vector3(1, 0, 0), 0.375f, 25.0f);
 vertices[7] = new myownvertexformat(new Vector3(-2, 100, 1), new Vector3(1, 0, 0), 0.375f, 0.0f);
 vertices[8] = new myownvertexformat(new Vector3(-2, -10, 1), new Vector3(0, 0, 1), 0.375f, 25.0f);
 vertices[9] = new myownvertexformat(new Vector3(-2, 100, 1), new Vector3(0, 0, 1), 0.375f, 0.0f);
 vertices[10] = new myownvertexformat(new Vector3(-3, -10, 1), new Vector3(0, 0, 1), 0.5f, 25.0f);
 vertices[11] = new myownvertexformat(new Vector3(-3, 100, 1), new Vector3(0, 0, 1), 0.5f, 0.0f);
 vertices[12] = new myownvertexformat(new Vector3(-13, -10, 1), new Vector3(0, 0, 1), 0.75f, 25.0f);
 vertices[13] = new myownvertexformat(new Vector3(-13, 100, 1), new Vector3(0, 0, 1), 0.75f, 0.0f);
 vertices[14] = new myownvertexformat(new Vector3(-13, -10, 1), new Vector3(1, 0, 0), 0.75f, 25.0f);
 vertices[15] = new myownvertexformat(new Vector3(-13, 100, 1), new Vector3(1, 0, 0), 0.75f, 0.0f);
 vertices[16] = new myownvertexformat(new Vector3(-13, -10, 21), new Vector3(1, 0, 0), 1.25f, 25.0f);
 vertices[17] = new myownvertexformat(new Vector3(-13, 100, 21), new Vector3(1, 0, 0), 1.25f, 0.0f);
             
 vb.SetData(vertices, 0, LockFlags.None);

Where you should notice the 6 added vertices, as well as the normal data. Don’t forget to update the number of triangles you’re about to draw:

 device.DrawPrimitives(PrimitiveType.TriangleStrip, 0, 16);

Now run this code! You see something rather strange: although the shape of your scene is correct, the textures have disappeared! Before reading the next paragraph, try to find out yourself what’s wrong.

What happened? We added normal data, and put it after the 3D position and before the texture coordinates. Because we haven’t yet updated our VertexDeclaration, our HLSL uses the normal data as its texture coordinates!

So we need to update our VertexDeclaration. Replace it by this code:

 VertexElement[] velements = new VertexElement[]
 {
     new VertexElement(0, 0, DeclarationType.Float3, DeclarationMethod.Default, DeclarationUsage.Position, 0),
     new VertexElement(0, 12, DeclarationType.Float3, DeclarationMethod.Default, DeclarationUsage.Normal, 0),
     new VertexElement(0, 24, DeclarationType.Float2, DeclarationMethod.Default, DeclarationUsage.TextureCoordinate, 0),
     VertexElement.VertexDeclarationEnd
 };

You see we’ve included an entry for the normal data. This normal data follows after the 12 bytes of the 3D position. Because our normal data also occupies 12 bytes, the texture data will start at byte 24.

When you run this code, you should see the same image as last chapter. This time, however, our vertex stream includes the correct normal data, so we’re finally ready to define our first light!




DirectX Tutorial 9 - Adding normals

If you appreciate the amount of time I spend creating and updating
these pages, feel free to donate -- any amount is welcome !



Click here to go to the forum on this chapter!



So far in the Series, you’ve seen 3 types of self-made vertex formats, and you’ve changed your VertexDeclaration 3 times as well. By now, I hope you get the importance of these concepts, and understand how the vertex buffer is linked to your vertex shader using the VertexDeclaration.

The HLSL hasn’t been changed this chapter:

struct VertexToPixel
{
    float4 Position     : POSITION;
    float2 TexCoords    : TEXCOORD0;
};

struct PixelToFrame
{
    float4 Color : COLOR0;
};

float4x4 xWorldViewProjection;

Texture xColoredTexture;

sampler ColoredTextureSampler = sampler_state { texture = <xColoredTexture> ; magfilter = LINEAR; minfilter = LINEAR; mipfilter=LINEAR; AddressU = mirror; AddressV = mirror;};
VertexToPixel SimplestVertexShader( float4 inPos : POSITION, float2 inTexCoords : TEXCOORD0)
{
    VertexToPixel Output = (VertexToPixel)0;
    
    Output.Position = mul(inPos, xWorldViewProjection);
    Output.TexCoords = inTexCoords;
    
    return Output;    
}

PixelToFrame OurFirstPixelShader(VertexToPixel PSIn)
{
    PixelToFrame Output = (PixelToFrame)0;

    Output.Color = tex2D(ColoredTextureSampler, PSIn.TexCoords);

    return Output;
}

technique Simplest
{
    pass Pass0
    {
        VertexShader = compile vs_1_1 SimplestVertexShader();
        PixelShader = compile ps_1_1 OurFirstPixelShader();
    }
}

The DirectX code:

 using System;
 using System.Drawing;
 using System.Collections;
 using System.ComponentModel;
 using System.Windows.Forms;
 using System.Data;
 using Microsoft.DirectX;
 using Microsoft.DirectX.Direct3D;
 using D3D = Microsoft.DirectX.Direct3D;
 
 namespace DirectX_Tutorial
 {
     struct myownvertexformat
     {
         public Vector3 Pos;
         public Vector3 Normal;
         public Vector2 TexCoord;
 
 
         public myownvertexformat(Vector3 _Pos, Vector3 _Normal, float texx, float texy)
         {
             Pos = _Pos;
             Normal = _Normal;
             TexCoord.X = texx;
             TexCoord.Y = texy;
         }
     }
 
     public class WinForm : System.Windows.Forms.Form
     {        
         private System.ComponentModel.Container components = null;
         private D3D.Device device;        
         private VertexBuffer vb;
         private Vector3 CameraPos;
         private VertexDeclaration vd;
         private Effect effect;
 
         private Texture StreetTexture;
         private Mesh Lamppost;
         private Material[] LamppostMaterials;
         private Texture[] LamppostTextures;
         private Mesh Car;
         private Material[] CarMaterials;
         private Texture[] CarTextures;
 
         private Matrix matView;
         private Matrix matProjection;
 
         private int LastTickCount = 1;
         private int Frames = 0;
         private float LastFrameRate = 0;
         private D3D.Font text;
 
         public WinForm()
         {
             InitializeComponent();
             this.SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.Opaque, true);
         }
 
         public void InitializeDevice()
         {
             PresentParameters presentParams = new PresentParameters();
             presentParams.Windowed = true;
             presentParams.SwapEffect = SwapEffect.Discard;
             presentParams.AutoDepthStencilFormat = DepthFormat.D16;
             presentParams.EnableAutoDepthStencil = true;
 
             Caps DevCaps = D3D.Manager.GetDeviceCaps(0, D3D.DeviceType.Hardware);
             D3D.DeviceType DevType = D3D.DeviceType.Reference;
             CreateFlags DevFlags = CreateFlags.SoftwareVertexProcessing;
             if ((DevCaps.VertexShaderVersion >= new Version(2, 0)) && (DevCaps.PixelShaderVersion >= new Version(2, 0)))
             {
                 DevType = D3D.DeviceType.Hardware;                
                 if (DevCaps.DeviceCaps.SupportsHardwareTransformAndLight)
                 {
                     DevFlags = CreateFlags.HardwareVertexProcessing;
                     if (DevCaps.DeviceCaps.SupportsPureDevice)
                     {
                         DevFlags |= CreateFlags.PureDevice;
                     }
                 }                
             }
 
             device = new D3D.Device(0, DevType, this, DevFlags, presentParams);
             device.DeviceReset += new EventHandler(this.HandleDeviceReset);            
         }
 
         private void HandleDeviceReset(object sender, EventArgs e)
         {
             FillResources();        
         }
 
         private void AllocateResources()
         {
             vb = new VertexBuffer(typeof(myownvertexformat), 18, device, Usage.WriteOnly, VertexFormats.Position | VertexFormats.Normal | VertexFormats.Texture0, Pool.Managed);                        
             InitializeFont();
             effect = D3D.Effect.FromFile(device, @"../../OurHLSLFile.fx", null, null, ShaderFlags.None, null);
         }
 
         private void FillResources()
         {
             myownvertexformat[] vertices = new myownvertexformat[18];
 
             vertices[0] = new myownvertexformat(new Vector3(20, -10, 0), new Vector3(0, 0, 1), -0.25f, 25.0f);
             vertices[1] = new myownvertexformat(new Vector3(20, 100, 0), new Vector3(0, 0, 1), -0.25f, 0.0f);
             vertices[2] = new myownvertexformat(new Vector3(-2, -10, 0), new Vector3(0, 0, 1), 0.25f, 25.0f);                        
             vertices[3] = new myownvertexformat(new Vector3(-2, 100, 0), new Vector3(0, 0, 1), 0.25f, 0.0f);
             vertices[4] = new myownvertexformat(new Vector3(-2, -10, 0), new Vector3(1, 0, 0), 0.25f, 25.0f);                        
             vertices[5] = new myownvertexformat(new Vector3(-2, 100, 0), new Vector3(1, 0, 0), 0.25f, 0.0f);
             vertices[6] = new myownvertexformat(new Vector3(-2, -10, 1), new Vector3(1, 0, 0), 0.375f, 25.0f);
             vertices[7] = new myownvertexformat(new Vector3(-2, 100, 1), new Vector3(1, 0, 0), 0.375f, 0.0f);
             vertices[8] = new myownvertexformat(new Vector3(-2, -10, 1), new Vector3(0, 0, 1), 0.375f, 25.0f);
             vertices[9] = new myownvertexformat(new Vector3(-2, 100, 1), new Vector3(0, 0, 1), 0.375f, 0.0f);
             vertices[10] = new myownvertexformat(new Vector3(-3, -10, 1), new Vector3(0, 0, 1), 0.5f, 25.0f);
             vertices[11] = new myownvertexformat(new Vector3(-3, 100, 1), new Vector3(0, 0, 1), 0.5f, 0.0f);
             vertices[12] = new myownvertexformat(new Vector3(-13, -10, 1), new Vector3(0, 0, 1), 0.75f, 25.0f);
             vertices[13] = new myownvertexformat(new Vector3(-13, 100, 1), new Vector3(0, 0, 1), 0.75f, 0.0f);
             vertices[14] = new myownvertexformat(new Vector3(-13, -10, 1), new Vector3(1, 0, 0), 0.75f, 25.0f);
             vertices[15] = new myownvertexformat(new Vector3(-13, 100, 1), new Vector3(1, 0, 0), 0.75f, 0.0f);
             vertices[16] = new myownvertexformat(new Vector3(-13, -10, 21), new Vector3(1, 0, 0), 1.25f, 25.0f);
             vertices[17] = new myownvertexformat(new Vector3(-13, 100, 21), new Vector3(1, 0, 0), 1.25f, 0.0f);
             
             vb.SetData(vertices, 0, LockFlags.None);
 
             SetUpCamera();
 
             VertexElement[] velements = new VertexElement[]
             {
                 new VertexElement(0, 0, DeclarationType.Float3, DeclarationMethod.Default, DeclarationUsage.Position, 0),
                 new VertexElement(0, 12, DeclarationType.Float3, DeclarationMethod.Default, DeclarationUsage.Normal, 0),
                 new VertexElement(0, 24, DeclarationType.Float2, DeclarationMethod.Default, DeclarationUsage.TextureCoordinate, 0),
                 VertexElement.VertexDeclarationEnd
             };
             vd = new VertexDeclaration(device, velements);
 
             StreetTexture = TextureLoader.FromFile(device, "streettexture.jpg");
 
             LoadMesh("lamppost.x", ref Lamppost, ref LamppostMaterials, ref LamppostTextures);
             LoadMesh("car.x", ref Car, ref CarMaterials, ref CarTextures);
         }
 
         private void InitializeFont()
         {
             System.Drawing.Font systemfont = new System.Drawing.Font("Arial", 12f, FontStyle.Regular);
             text = new D3D.Font(device, systemfont);
         }
 
         private void DrawMesh(Mesh mesh, Material[] meshmaterials, Texture[] meshtextures)
         {
             for (int i = 0; i < meshmaterials.Length; i++)
             {
                 if (meshtextures.Length > 3) effect.SetValue("xColoredTexture", meshtextures[i]);
                 effect.CommitChanges();
                 mesh.DrawSubset(i);
             }
         }
 
         protected override void OnPaint(System.Windows.Forms.PaintEventArgs e)
         {
             device.Clear(ClearFlags.Target | ClearFlags.ZBuffer, Color.Black, 1.0f, 0);
             device.BeginScene();
 
             device.SetStreamSource(0, vb, 0);            
             device.VertexDeclaration = vd;
             effect.Technique = "Simplest";
             effect.SetValue("xWorldViewProjection", Matrix.Identity * matView * matProjection);
             effect.SetValue("xColoredTexture", StreetTexture);
             int numpasses = effect.Begin(0);
             for (int i = 0; i < numpasses; i++)
             {
                 effect.BeginPass(i);
 
                 device.DrawPrimitives(PrimitiveType.TriangleStrip, 0, 16);
 
                 Matrix LamppostWorld = Matrix.Scaling(0.05f, 0.05f, 0.05f) * Matrix.RotationX((float)Math.PI / 2) * Matrix.Translation(-4.0f, 5, 1);
                 effect.SetValue("xWorldViewProjection", LamppostWorld * matView * matProjection);
                 DrawMesh(Lamppost, LamppostMaterials, LamppostTextures);
 
                 LamppostWorld = Matrix.Scaling(0.05f, 0.05f, 0.05f) * Matrix.RotationX((float)Math.PI / 2) * Matrix.Translation(-4.0f, 35, 1);
                 effect.SetValue("xWorldViewProjection", LamppostWorld * matView * matProjection);
                 DrawMesh(Lamppost, LamppostMaterials, LamppostTextures);
 
                 Matrix CarWorld = Matrix.Scaling(4f, 4f, 4f) * Matrix.RotationYawPitchRoll((float)Math.PI / 2, (float)Math.PI / 2, (float)Math.PI / 2) * Matrix.Translation(3, 15, 0f);
                 effect.SetValue("xWorldViewProjection", CarWorld * matView * matProjection);
                 DrawMesh(Car, CarMaterials, CarTextures);
 
                 CarWorld = Matrix.Scaling(4f, 4f, 4f) * Matrix.RotationYawPitchRoll((float)Math.PI / 2, (float)Math.PI / 8, (float)Math.PI / 2) * Matrix.Translation(28, -1.9f, 0f);
                 effect.SetValue("xWorldViewProjection", CarWorld * matView * matProjection);
                 DrawMesh(Car, CarMaterials, CarTextures);
 
                 effect.EndPass();
             }
             effect.End();
 
             UpdateFramerate();
 
             device.EndScene();
             device.Present();
             this.Invalidate();    
         }
 
         private void UpdateFramerate()
         {
             Frames++;
             if (Math.Abs(Environment.TickCount - LastTickCount) > 1000)
             {
                 LastFrameRate = (float)Frames * 1000 / Math.Abs(Environment.TickCount - LastTickCount);
                 LastTickCount = Environment.TickCount;
                 Frames = 0;
             }
             text.DrawText(null, string.Format("Framerate : {0:0.00} fps", LastFrameRate), new Point(10, 430), Color.Red);
         }
 
         private void SetUpCamera()
         {
             CameraPos = new Vector3(25, -18, 13);
             matProjection = Matrix.PerspectiveFovLH((float)Math.PI / 4, this.Width / this.Height, 0.3f, 200f);
             matView = Matrix.LookAtLH(CameraPos, new Vector3(0, 12, 2), new Vector3(0, 0, 1));
         }
 
         private void LoadMesh(string filename, ref Mesh mesh, ref Material[] meshmaterials, ref Texture[] meshtextures)
         {
             ExtendedMaterial[] materialarray;
             GraphicsStream adj = null;
 
             mesh = Mesh.FromFile(filename, MeshFlags.Managed, device, out adj, out materialarray);
 
             if ((materialarray != null) && (materialarray.Length > 0))
             {
                 meshmaterials = new Material[materialarray.Length];
                 meshtextures = new Texture[materialarray.Length];
 
                 for (int i = 0; i < materialarray.Length; i++)
                 {
                     meshmaterials[i] = materialarray[i].Material3D;
                     meshmaterials[i].Ambient = meshmaterials[i].Diffuse;
 
                     if ((materialarray[i].TextureFilename != null) && (materialarray[i].TextureFilename != string.Empty))
                     {
                         meshtextures[i] = TextureLoader.FromFile(device, materialarray[i].TextureFilename);
                     }
                 }                
             }
 
             mesh = mesh.Clone(mesh.Options.Value, CustomVertex.PositionNormalTextured.Format, device);
             mesh.ComputeNormals();
         }
 
         protected override void Dispose(bool disposing)
         {
             if (disposing)
             {
                 if (components != null)
                 {
                     components.Dispose();
                 }
             }
             base.Dispose(disposing);
         }
 
         private void InitializeComponent()
         {
             this.components = new System.ComponentModel.Container();
             this.Size = new System.Drawing.Size(500, 500);
             this.Text = "Riemer's DirectX & HLSL Tutorial using C# -- Season 3";
         }
 
         static void Main()
         {
             using (WinForm our_directx_form = new WinForm())
             {
                 our_directx_form.InitializeDevice();                
                 our_directx_form.AllocateResources();
                 our_directx_form.FillResources();
                 Application.Run(our_directx_form);
             }
         }
     }
 }


Google
 
Webwww.riemers.net


If you appreciate the amount of time I spend creating and updating
these pages, feel free to donate -- any amount is welcome !



- Website design & XNA + DirectX code : Riemer Grootjans -
©2003 - 2011 Riemer Grootjans
Translations

This site in English
This site in Korean
This site in Czech

Microsoft MVP Award



2007 - 2011 MVP Award
DirectX - XNA

Contents

News
Home
Forum
XNA 2.0 Recipes Book (8)
Chapter 1
Chapter 2
Chapter 3
Chapter 4
Chapter 5
Chapter 6
Chapter 7
Chapter 8
XNA 3.0 Recipes Book (8)
Chapter 1
Chapter 2
Chapter 3
Chapter 4
Chapter 5
Chapter 6
Chapter 7
Chapter 8
Downloads
Extra Reading (3)
Matrices: geometrical
Matrix Mathematics
Homogenous matrices
Community Projects (1)
Team Project (1)
News
Tutorials (160)
XNA 4.0 using C# (89)
2D Series: Shooters (22)
Starting a project
Drawing fullscreen images
Positioning images
SpriteBatch.Draw()
Rotation
Keyboard input
Writing text
Angle to Direction
Direction to Angle
Smoke trail
Manual texture creation
Random terrain
Texture to Colors
Coll Detection Overview
Coll Detection Matrices
Putting CD into practice
Particles
Additive alpha blending
Particle engine
Adding craters
Sound in XNA
Resolution independency
3D Series 1: Terrain (13)
Starting a project
The effect file
The first triangle
World space
Rotation - translation
Indices
Terrain basics
Terrain from file
Keyboard
Adding colors
Lighting basics
Terrain lighting
VertexBuffer & IndexBuffer
3D Series 2: Flightsim (14)
Starting point
Textures
Loading the floorplan
Creating the 3D city
Loading a Model
Ambient and diffuse
Quaternion camera
Flight kinematics
Collision detection
Adding targets
Point sprites
Alpha blending
Skybox
Camera delay
3D Series 3: HLSL (18)
Starting point
HLSL introduction
Vertex format
Vertex shader
Pixel shader
Per-pixel colors
Textured triangle
Triangle strip
World transform
World normals
Per-pixel lighting
Shadow map
Render to texture
Projective texturing
Real shadow
Shaping the light
Preshaders
3D Series 4: Adv. terrain (19)
Starting code
Mouse camera
Textured terrain
Multitexturing
Adding detail
Skydome
The water technique
Refraction map
Reflection map
Perfect mirror
Ripples
The Fresnel term
Moving water
Specular highlights
Billboarding
Region growing
Billboarding renderstates
Perlin noise
Gradient skybox
Short Tuts (3)
Run XNA on older pcs
MessageBox in XNA
Normal generation
DirectX using C# (54)
Series 1:Terrain (14)
Opening a window
Linking to the Device
Drawing a triangle
Camera
Rotation - Translation
Indices
Terrain creation
Terrain from file
DirectInput
Importing bmp files
Colored vertices
DirectX Light basics
Mesh creation
Mesh lighting
Series 2: Flightsim (19)
Starting code
Textures
The floorplan
Creating the 3D City
Meshloading from file
Ambient light
Action
Flight kinematics
Collision detection
Skybox
Texture filtering
Adding targets
Point sprites
Alpha blending
DirectSound
Sounds in 3D
Playing MP3 files
Displaying text
Going fullscreen
Series 3: HLSL (19)
Starting point
HLSL Introduction
Vertex Shader
Shaded triangle
Pixel Shader
Textured Triangle
Triangle Strip
World transform
Adding normals
The first light
Shadow mapping
Render To Texture
Projective texturing
The first shadow
Shaping the light
Preshaders
Multiple lights
Adjusting Z values
Finishing touch
Short Tuts (2)
Resizing problem
Checking Device caps
DirectX using C++ (15)
Series 1: Terrain (15)
Opening a window
Ending the game loop
Linking to the Device
Clearing your window
Drawing a triangle
Culling
Camera
Rotation - Translation
Indices
Terrain creation
Terrain from file
DirectInput
Importing .bmp files
Adding colors
DirectX Light basics
DirectX using VB (2)
Series 1: Intro (2)
The first triangle
Rotation - translation
-- Tree view --


Thank you!

Support this site --
any amount is welcome !

Stay up-to-date

I don't have the time to keep a News section, so stay informed about the updates by clicking on this RSS file!