Archive for category DirectX Programming

The SDX SpriteTextRenderer now supports SharpDX

As already mentioned in several posts, I’ve been developing a library for rendering sprites and text with DirectX 11. Up to now this library was available exclusively for SlimDX applications. Up to now. With the help of the newest member of the STR team, Lior Lahav, the library was able to evolve to a framework, […]

, , , , ,

Leave a comment

SlimDX SpriteTextRenderer Release 1.1

The SpriteTextRenderer is a library that aids in the creation of 2D elements in DirectX 11 (SlimDX) appplications. Thanks to some user posts I was able to improve the SlimDX SpriteTextRenderer. Topmost, some bugs in the font layouting system could be fixed. If you’re still looking for a sprite and text renderer for DirectX 11, […]

, , , ,

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 […]

, ,

8 Comments

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

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 row-major matrix with float components that can be visualized as a table: Note that matrices are column-major in OpenGL. While the general content of this article also applies to OpenGL, both vectors and matrices are transposed, which results in a reversed multiplication order. Keep […]

, ,

2 Comments

HLSL 4 – Calls to user defined functions will crash

In one of my current projects I have been confronted with a weird problem of the Effect framework: A syntactically and semantically valid shader would not render anything. But let’s start at the beginning. The application I have been working on is a DirectX 11 program written in C++ that uses HLSL 4.0 shaders. My […]

, , ,

4 Comments