April 2010

Warning! Some information on this page is older than 3 years now. I keep it for reference, but it probably doesn't reflect my current knowledge and beliefs.

23:18
Thu
29
Apr 2010

DXGI Format Cheatsheet

Today I've prepared another small, single page cheat sheet related to DirectX 11:

DXGI_Format_Cheatsheet.pdf
DXGI_Format_Cheatsheet.odt

I've also solved my problem with Visual C++ 2010 Express that crashed every compilation on my computer. I've submitted this bug to Microsoft Connect, expecting that it may be because I have a 64-bit Windows 7 or because I also have Visual Studio 2008 Professional installed. But with the help from Microsoft I've figured out that it was just because of the AMD CodeAnalyst profiler. Uninstalling this program helped me so my VC2010 doesn't crash any more :D

Comments (0) | Tags: visual studio directx rendering | Author: Adam Sawicki | Share

22:22
Wed
28
Apr 2010

XNA Math Cheat Sheet

Today I've prepared a...

XNA Math Cheatsheet (PDF)
XNA Math Cheatsheet (ODT)

I'll post more information about the XNA Math Library tomorrow.

(NEW) Updated links to version 1.1 for DX SDK June 2010.

Comments (0) | Tags: math directx | Author: Adam Sawicki | Share

22:13
Tue
27
Apr 2010

My First Triangle in DirectX 11

Now as I have my new graphics card I've started learning Direct3D 11. I've been doing much coding in DirectX 9 before. I also looked at the DirectX 10 API but gained not much practical experience in it. I'm very excited about how the new API looks like and the possibilities it creates. The library interface looks better organized, more object-oriented and clear. It makes extensive use of descriptors - same concept I liked so much in PhysX.

But at the same time I must admit it's more difficult to get started than it was in DirectX 9. You have to create more objects to setup basic framework that could render anything. The so called Fixed Function Pipeline doesn't exist anymore, so you HAVE to write shaders to render anything. Better organization of all data forces you to pass shader constants in buffers instead one-by-one, fill descriptors, create and use state objects (like ID3D11DepthStencilState) instead of changing render states one-by-one, create views for resources (like ID3D11ShaderResourceView for ID3D11Texture2D) instead of using them directly, compile shaders from HLSL source to bytecode and then create the shader object with separate call etc.

There are also big changes in math support. They didn't provide new D3DX Math with DX11. You can still use the old one, but now it's recommended to make use of new, portable (to Xbox 360) and highly optimized XNA Math library. It's pretty but can be difficult for beginners. For example, now there is one universal type - XMVECTOR - that can represent a vector, color, plane, quaternion and more. It must be always aligned to 16 bytes (because it uses SSE). I suppose it's not easy to understand concepts like vector loading, storing or swizzling, which can be new for many DirectX programmers.

Where do learn DirectX 11 from? It looks like there are not many valuable sources online yet. The directx11tutorials.com website looks interesting, but it's just a blog with few pieces of code and the author tries to wrap everything into his own classes from the start, which makes no sense for me. The most valuable source of knowledge is the original documentation installed with DX SDK. It's far from being extensive because the chapter about DirectX 11 describes only new features, not everything about using DirectX like the documentation for version 9, but for somebody who already knows some graphics programming it should be OK.

What I want to show today is my first "Hello World" triangle made in Direct3D 11 and code that renders it. You can download whole source with project for Visual C++ 2008 from here: Dx11Test.zip. See also the code online: Dx11Test.cpp.

To code in DX11, you just need DirectX SDK - same as for DirectX 9 and 10, because it contains SDK for all of them. Programs that use DirectX 11 can run on Windows 7 as well as Vista, but not on XP. It's surprising that newest-generation graphics card is not needed - you can use DX11 API to code in different "feature levels" from D3D_FEATURE_LEVEL_9_1 to D3D_FEATURE_LEVEL_11_0, so you can write your code so it will run even on GPUs that support only Shader Model 2!

Read full entry > | Comments (3) | Tags: directx rendering | Author: Adam Sawicki | Share

22:00
Sun
25
Apr 2010

Radeon HD 5770

I'm not a hardware specialist, so every time I want to buy something, I do a quick research to see what's currently available in stores, what's already a standard and what's an expensive novelty. Next I imagine in my mind a power(price) function and find its inflection point to see what product is most reasonable to buy ;)

I've been fan of Intel and NVIDIA, but I must admit that now my PC is dominated by AMD. Some time ago I wanted to buy a 4-core CPU. It turned out that Intel i7 processors are very expensive and that's how I've bought AMD Phenom II.

Now it's the same with graphics cards. I thought it's a good time to buy one with DirectX 11 support. I've been waiting for some time for these new cards from NVIDIA 4xx series, but now as they are available in stores I see they are very expensive, while I can have a GPU with DX11 support from AMD for about 600 PLN. My choice is Radeon HD 5770. It is not the most powerful card available (it actually has its power cut by half comparing to its higher versions), so I can see it's the speed what costs most. While for me the capabilities are more improtant. I just wanted a card with DX11 support. Of course AMD cards don't have CUDA technology, but well, it's vendor specific anyway while DX11 has Compute Shaders.

BTW, anyone wants to buy GeForce 8800 GT? :)

Comments (1) | Tags: hardware shopping | Author: Adam Sawicki | Share

20:06
Tue
20
Apr 2010

My Impressions about SQLite

SQLite is a very strange library. It's a database engine that can store lots of data in a relational database and exposes API based on SQL language. On the other hand though, it's not a huge application that has to be installed in the system, work in the background and you have to connect to it via network interface, like MySQL or PostreSQL do. It's actually a lightweight library written in C that can be linked with your program and uses specified file as the database. It's fascinating that such a small library (there is even a preprocessed source version as a single 3.75 megabyte C file!) supports much of the SQL language.

The API of the SQLite library is similar to any other SQL-based database access API for any programming language. I've played with it a bit and here is my small sample code:

#include <sqlite3.h>

int main()
{
  sqlite3 *db;
  sqlite3_open_v2("D:\\tmp\\test.db", &db,
    SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE, NULL);

  sqlite3_exec(db, "begin", NULL, NULL, NULL);
  
  sqlite3_stmt *stmt;
  sqlite3_prepare_v2(db, "insert into table1 (id) values (?)",
    -1, &stmt, NULL);

  for (int i = 0; i < 10; i++)
  {
    sqlite3_reset(stmt);
    sqlite3_bind_int(stmt, 1, i);
    sqlite3_step(stmt);
  }

  sqlite3_exec(db, "commit", NULL, NULL, NULL);

  sqlite3_finalize(stmt);

  sqlite3_close(db);
}

It's hard for me to think of any application for such a strange library. It offers too much when you just want to design your file format and too few if you need a fully-featured database, like for a web server. So why did I decide to get to know this library? It's all because of an interesting gamedev tool called Echo Chamber. It's a free data mining program that can visualize data from SQLite database files as many different kinds of plots, even 3D ones. So when you integrate logging some numeric data from your engine into an SQLite database you can easily do performance analysis with it.

Comments (10) | Tags: tools libraries sql | Author: Adam Sawicki | Share

20:43
Thu
15
Apr 2010

Tower Offence - Compo Entry from IGK-7'2010

I've published the game we made at IGK-7'2010 conference for Compo. It was created by our 4-person team during 8 hours. It's a small PC game from "Tower Defence" genre but with a hero directly controller by player who have to approach a place to create a tower and can also shoot by itself.

» Tower Offence

Screenshot:

Psycho

Comments (1) | Tags: igk warsztat events productions games | Author: Adam Sawicki | Share

23:02
Wed
14
Apr 2010

IGK 2010 - Photos

I've uploaded more than one hundred of photos I've taken at IGK-7'2010 Conference. For the first time I've placed my photos on Picasa Web Album.

Comments (0) | Tags: igk gallery warsztat events gallery | Author: Adam Sawicki | Share

22:22
Tue
13
Apr 2010

IGK 2010 - Coverage [pl]

VII Ogólnopolska Konferencja Inżynierii Gier Komputerowych, czyli IGK-7'2010, odbyła się 9-11 kwietnia 2010 (piątek-niedziela) w Akademii Podlaskiej w Siedlcach. Organizowana jest tam co roku przez koło naukowe informatyków "GENBIT". Oficjalna strona wydarzenia to igk.ap.siedlce.pl. W tegorocznej edycji wzięło udział ponad 60 osób.

Garść podstawowych informacji należałoby zacząć od wzmianki, że jest to impreza związana z tematyką tworzenia gier (przede wszystkim programowania), która co roku łączy przedstawicieli polskich firm z tej branży z młodymi pasjonatami (zwłaszcza bywalcami Warsztatu, czyli portalu i forum gamedev.pl) oraz innymi zainteresowanymi tym tematem (jak studenci, środowiska akademickie i osoby zajmujące się różnymi dziedzinami pokrewnymi do tworzenia gier). Na jej część oficjalną składa się sesja referatów oraz konkurs Compo, podczas którego 4-osobowe drużyny muszą w ciągu 8 godzin stworzyć grę na zadany temat. Część nieoficjalna natomiast to wieczorne imprezy, na których dominuje granie w gry sieciowe (jak Quake III czy Starcraft) oraz szeroko pojęte aspekty towarzyskie służące integracji na żywo ludzi, którzy na co dzień kontaktują się przez Internet.

Dalszy ciąg tego artykułu to moja relacja z siódmej edycji konferencji (rok 2010). Jest siłą rzeczy subiektywna - opisująca te wydarzenia, w których akurat wziąłem udział i moje odczucia z nimi związane. Zapraszam do lektury szczególnie tych, którym nieobca jest konferencja IGK albo ogólnie społeczność Warsztatu i chcą dowiedzieć się w szczegółach, jak ta edycja wyglądała. Pozostałym, mam nadzieję, relacja pomoże przynajmniej wczuć się w "klimat" tego wydarzenia.

Read full entry > | Comments (2) | Tags: igk events warsztat | Author: Adam Sawicki | Share

20:15
Thu
08
Apr 2010

ActionScript 3 Standard Library Primer

I've recently blogged about the syntax of ActionScript 3 language. Today I'd like to present what I've learned about the Flash standard library, especially in terms of displaying graphics. The official documentation to this is avaiable as ActionScript 3.0 Language and Components Reference (offline version for download - multipage HTML packed in ZIP).

Main package for graphics-related classes is flash.graphics. When programming in Flash, you do not redraw whole screen every frame like you do in DirectX or OpenGL. Instead you create a persistent hierarchy of objects, change their parameters and they are automatically drawn and updated. Base class of all objects that can be placed in this hierarchy is flash.graphics.DisplayObject and the class that can have children (the composite design pattern appears here) is DisplayObjectContainer. DisplayObjectContainer has methods such as addChild or removeChild to manage subobject.

For example, knowing that Sprite class that is the base class of our Main class inherits from DisplayObjectContainer and the TextField class we use here inherits from DisplayObject, the simplest Flash application that shows anything may look like below. The display object hierarchy here is: main object of the Main class with the tf object of TextField class inside, added as a child.

Read full entry > | Comments (0) | Tags: flash rendering | Author: Adam Sawicki | Share

17:36
Tue
06
Apr 2010

Block Wizard - My First Flash Game

Just like tourists visit new places and see new cultures, programmers like to learn new languages and API-s. I've been recently coding in Flash and here is my first game made in this technology. As most of the Flash productions, it is available for free and can be played online via web browser.

Screenshot:

Discuss @ forum.gamedev.pl [pl].

Comments (0) | Tags: flash productions games | Author: Adam Sawicki | Share

STAT NO AD [Stat] [Admin] [STAT NO AD] [pub] [Mirror] Copyright © 2004-2017 Adam Sawicki
Copyright © 2004-2017 Adam Sawicki