float4x4

Computer graphics and stuff

Hardware instancing for PC in XNA 4, with textures!

No Comments »

Over a year ago, I posted a tutorial on hardware instancing in XNA 3.1. Version 4 of XNA works a bit different and the code will no longer compile. This is not necessarily a bad thing though. XNA 4 really improves on 3.1 in a lot of ways, including hardware instancing. In the following tutorial, we’ll see how to get it running in XNA 4 and use textures rather than colours.

Read the rest of this entry »

For loops and lambda’s

No Comments »

Last month I went to the Microsoft TechDays 2011 in Antwerp and there were two presentations I really wanted to see. One of those was Rob Miles‘ presentation on XNA for the Windows Phone. A great presentation that made me wish I had this guy as professor when I was at university. Go see him if you ever have the chance, just don’t expect too much from his jokes!

The other presentation was one on C++11 by Boris Jabes. Strangely, few people seemed interested in the topic. The room was pretty empty compared to other presentations. Nevertheless Boris really gave an awesome talk and really made me think twice about C#’s using statements. Especially if you’re a SharePoint developer, these things are a dime a dozen. Check out the video, I really enjoyed it.

There was something very specific about that presentation that got me in a rush to get home. One of his slides showed this piece of C# code:


List<Action> actions = new List<Action>();

for (int counter=0; counter < 10; counter++)
{
actions.Add(() => Console.WriteLine(counter));
}

foreach(Action action in actions)
{
action();
}

He asked the audience what the result would be…

Read the rest of this entry »

XNA After Effects

No Comments »

There are a lot of ways to make the final image of your graphics application look significantly better. A lot of developers have grown very fond of bloom filters, film grain and more. In this tutorial I will show you the basics of how to create some simple after effect shaders. All of them are simple and static for now, perhaps in a part two we’ll go a step further. The implementation uses XNA 4.0.

Read the rest of this entry »

Texture Synthesis Results

No Comments »

Solid texture synthesis really is a much more difficult problem to tackle than 2D texture synthesis. I’ve not really been able to get the same amazing results as Yue Dong did. Here are some pictures of my synthesized volumes. I think the computation time and the memory requirements do not make it very useful in real time graphics programs at the moment but with GPU’s becoming more powerful every day who knows what can be done in the future. I am thinking of making a 2D synthesis implementation for XNA sometime soon.

Hardware Instancing in XNA

4 Comments »

Drawing large quantities of objects that are (mostly) identical is something that every graphics programmer will have to do sooner or later. I haven’t been able to find much information regarding the subject, most of it is either outdated or very specialized and thus hard to learn from. With this tutorial I’m going to try to show you how to do hardware instancing for windows in a general step-by-step way.

Read the rest of this entry »

Generating realistic and playable terrain height-maps

8 Comments »

One of the most important aspects of outdoor virtual environments is the terrain. There are several tutorials for graphics programmers to create good looking terrains such as Riemer’s Advanced Terrain in XNA. Mostly, these terrains are built from height maps and usually the writer of the tutorial provides the reader with a good height-map to test on. Other tutorials will implement a Perlin noise generator but this doesn’t really give realistic results. In this tutorial I will show you how to create a height-map that looks good and is usable for virtual worlds.

Read the rest of this entry »

Lazy Solid Texture Synthesis

No Comments »

Recently I have been working on implementing an interesting texture synthesis paper called Lazy Solid Texture Synthesis. Here are some results of the initialization slabs:

Read the rest of this entry »