Preserving the context of an operation

In game programming you often have certain parts in your code where you need to change some variables and reset them back afterwards (e.g. render states). This can be necessary in “regular” programs, too. Usually you save the context in some variables, perform the changes you need and revert the changes. In this post I […]

, ,

Leave a Comment

Simulating a day’s sky

A nice sky is very important for most games. However, creating a good-looking one is not that easy. Researchers of the University of Utah have found a good approximation for the sky during a day (Paper). In this article I am going to explain the fundamentals of this algorithm. The complete project can be downloaded […]

, ,

Leave a Comment

Managing input layouts

In my last post I showed how to use .Net attributes to define shader variables. This post will be about the management of input layouts. Input layouts define how the graphics card should interpret vertex data and how to map fields to the shader’s variables. Usually you send vertices in form of arrays of structs […]

, ,

Leave a Comment

Conveniently managing shader variables

If you use DirectX 11, particularly SlimDX, you have the choice to use the Effect Framework to manage your shaders. Then, instead of setting constant buffers you can set shader settings with the help of EffectVariables. Here is a sample for using those variables: However, setting up these variables can be pretty annoying because mostly […]

, ,

Leave a Comment

Allow native C++ components to raise CLR events

Recently I was working on a project that was based on a native C++ library. The project’s GUI was a WPF application that communicated with the native lib via a managed C++/CLI bridge library that contained CLR wrapper classes for the native ones. One major concern was the ability of the native classes to raise […]

, , , , , ,

Leave a Comment

Rendering sprites and text with SlimDX / DX 11

Up to versions 9 of DirectX, the API contained quite broad support for 2D rendering. However, in DirectX 10 this has become less and in DirectX 11 there is virtually no support for drawing sprites and text on the screen. However, most DirectX applications need some kind of 2D rendering to display a graphical user […]

, , , ,

Leave a Comment

DirectX and Matrices

Fundamentals In DirectX, in most cases a matrix is a 4×4 matrix with float components that can be visualized as a table: The whole matrix is transposed (i.e. rows and columns are swapped). That’s why the components’ names do not match the mathematical notation. Matrices can be used to transform vectors. More Details on that […]

, ,

Leave a Comment

Follow

Get every new post delivered to your Inbox.