Blog Tags

Recommended Productions


Simple 3D game developed in Unity during Global Game Jam 2014.

Play Online

Date: 2014-01-26

Download: (8.78 MB) (20.49 MB)


Simple 2D game developed during Global Game Jam 2013, for Windows.

Date: 2013-01-27

Download: (6.1 MB)

FX Batch Compiler 1.1

This Windows application supports compilation of FX effect files and HLSL shader files using fxc command line compiler included in DirectX SDK. You can compile many files at time or one file with different settings.


  • Write compilation scripts in a simple language by specifying parameters for fxc.exe.
  • Compile multiple shaders at time.
  • Compile only shaders that need rebuild checked by file modification time.
  • Review success or failure, warning and error count and compiler output for every task.
  • Compile single HLSL source file with different parameters and preprocessor macros.

Date: 2011-02-09


Block Wizard

My first Flash game. Coded with FlashDevelop in ActionScript 3.

Date: 2010-04-06

CommonLib 9.0

Universal library for C++, created especially with game programmers in mind. Includes: math module (vectors, matrices, quaternions, planes, rich set of collision functions and more), string operations, conversions, smart pointers, configuration files handling, date and time module, exception class hierarchy for error handling, file system handling, stream class hierarchy, FreeList - free memory allocator, complex logger, profiler, library for threading and synchronization, tokenizer, wrappers for compression with zlib.

Language: C++. Platforms: Windows and Linux. License: GNU LGPL. Optional support for Unicode. Optional integration with D3DX. Documentation made with Doxygen.

Date: 2009-12-16

Download: (4.92 MB)

Aqua Fish 2

Game for children - clone of PacMan. Player swims as a fish and collects points, as well as special items. Player also have to run away from enemies or destroy them. 60 maps in 6 different titlesets. Low hardware requirements. See also YouTube videos: [1], [2]. Game was published by Play Publishing company.

GameDev Calc

Calculator for game programmers. Basic data unit is a vector of 1-4 floating point numbers, which can be treated as (x,y,z,w) vector or (r,g,b,a) color. Next to basic calculations like addition, multiplication or sinus, vector operations are also available, e.g. vector normalization, conversion between degrees and radians, color conversion between RGB and HSB, finding linear an quadratic function coefficients and much more. Instead of entering single number, here you can see all the history of your calculations in form of stack and all operations are performed on that stack. Data can be entered and retrieved in different formats, like "D3DXVECTOR4(0.0f, 0.5f, 0.752f, 1.0f)" or "0xFF0080C0". Platform: Windows. Language: C#. License: GNU GPL.

Download: (53.06 KB) (50.73 KB)


Aug 2014

DirectX 11 CheatSheet

I've created several cheatsheets: about DXGI Formats, XNA Math, floats, color names in .NET and Direct3D 9. You can see it in Download/Misc. Today I discovered that I didn't publish my DirectX 11 CheatSheet that I've prepared 3 years ago! So here it is:


On 15 pages, you will find:

  • Direct3D 11 enums
  • Direct3D 11 structures
  • HLSL input and output semantics
  • Parameters of fxc.exe - console shader compiler

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

Aug 2014

The End of Lag Magazine

In November 2012 a new paper magazine appeared in Poland called Lag (FB page). I didn't post about it here because I didn't want my little corner of the Internet to carry a negative opinion about this innovative project. But now, after two issues, they announced the end of the project. The editor-in-chief says that it's accounting, packaging, shipping and stuff like that what made it too difficult, so I don't know whether it was a success commercially or many people would share my opinion, but anyway... I think such magazine doesn't make much sense. Here is why:

Lag was an unusual magazine. It was about games, but without any news, game reviews or screenshots. It contained only journalism (plus some illustrations) - essays not even about a particular game, but about games in general and their place in our culture. It felt like being targeted at older, mature readers. Meanwhile, popular stereotype says that games are just for children and teenagers. Some people (and statistics) show something opposite - that they are for everyone. Where is the truth?

I still like games despite being 30, but I like them because I still feel young. I like chasing news, watching trailers and screenshots, sometimes being enthusiastic or even fanatic about some IP and buying a game in the day they release it to the shops. For me it's all part of gaming. All in all, games are entertainment, so it's about emotions and being amused. If I had only such intelectual and analytical approach as the magazine presented, I would rather abandon my interest in games completely.

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

Aug 2014

CPrintStream 1.1

2.5 years ago I wrote a piece of C++ code called CPrintStream - see CPrintStream - Polymorphic Printf for description. Now I updated it to version 1.1. Files to download:


What's new:

  • Now the code is self-contained - it depends only on standard C and C++ library + WinAPI for one function.
  • Added additional abstract class CBufferingPrintStream which formats message into a single string and passes it to another virtual function for clients that need this form.
  • Added class CDebugPrintStream derived from CBufferingPrintStream that prints message to OutputDebugString.

OutputDebugString is a WinAPI function for passing debug messages. If debugging in Visual Studio, these messages can be viewed in Output panel. If not, they can be captured using separate, simple and free program - DebugView.

Comments (1) | Tags: c++ | Author: Adam Sawicki | Share

Jul 2014

Making Tilt-Shift Photo in GIMP

There is an interesting photographic effect called Tilt-Shift. It makes a photo of city panorama looking like a miniature due to small depth of field. Wikipedia says it can be obtained optically with some advanced techniques, but it can also be approximated with postprocessing.

Yesterday I visited St. Dominic's Fair in Gdańsk, where I had an opportunity to enter a Ferris wheel and take a photo of my city from some height. Here is my experiment with tilt-shift. I've made it GIMP.

Gdańsk Tilt-Shift

To do it, top and bottom of the photo needs to be blurred. But an out of focus photo is not the same thing as standard Gaussian blur. That's why a special kind of blur is needed. There is a GIMP plugin for it: Focus Blur (Windows binary can be found HERE). In Photoshop, the effect is available as Lens Blur.

Image needs to be blurred more the closer a pixel is to the top or bottom edge of the image. But I have no idea how to do blur (or any other effect) with intensity varying over image location, so here is the trick: We can use only two layers - normal and heavily blurred - and blend between them using layer mask.

So to add tilt-shift effect to your photo using GIMP:

  1. Choose a photo of a city panorama. Open it in GIMP.
  2. Use Crop Tool to crop it so no horizon line or sky is visible, only ground.
  3. In Layers panel, click appropriate button to duplicate layer.
  4. Make sure the top layer ("copy") is selected. Select Filters > Blur > Focus Blur. Change radius to some higher value (I used something around 10-16 for image in Full HD resolution). Confirm with OK.
  5. Now right-click on the top layer and select Add Layer Mask. Mask is created for this layer and selected so now drawing will change layer transparency instead of color.
  6. Select Blend Tool (the one for drawing gradients).
  7. In Tool Options panel, select gradient "FG to BG (RGB)" and change Shape to Bi-linear. Make sure current colors are: foreground = black, background = white.
  8. Draw the gradient by pressing left mouse button in the center of the image, dragging cursor to the top or bottom (hold Ctrl to draw perfect vertical line) and releasing it there.

If you've done everything right, you should now already have blending between layers applied so that top and bottom of the image looks like out of focus. Now you can:

  1. Flatten image by right-clicking on top layer and selecting Merge Down.
  2. Enhance colors. You can, for example, increase saturation and contrast.
  3. Export image with File > Export As.

Comments (1) | Tags: photography | Author: Adam Sawicki | Share

Jun 2014

Rendering Video Special Effects in GLSL

Rendering real-time, hardware accelerated 3D graphics is one aspect of computer graphics, but there are others too. Recently I became interested in video editing. I wanted to add some special effects to a video and was looking for a technology to do that. Of course video editing software usually has some effects built-in, like different filters or transition effects, some borders or gradients. But I wanted something different. If I had and I knew how to use software like Adobe After Effects, I'm sure that would be the best and easiest way to make any effect imaginable. But as I don't, I decided to use what I already know - to write a shader :)

1. To run a shader, some hosting app is needed. Of course I could write one in C++, but for the purpose of this work it was enough to use Live Coding Compo Framework (a demoscene tool created by bonzaj, which was used during last year's WeCan demoparty). This simple and free package contains rendering application and preconfigured Visual Studio solution. Having VS installed (it works with Express version as well), all I needed to do was to edit "Run.bat" file to point to directory with VS installation in my system. Next, I just executed "Run.bat", and two programs were launched. On the left monitor I had fullscreen "Live Coding Preview", on the right: Visual Studio with special solution opened. I could then edit any of the GLSL fragment shaders contained in the solution. Every time I hit Compile (Ctrl+F7), the shader was compiled and displayed in the preview.

2. Being able to render my effect in real-time, next I needed to capture it to a video. Probably the most popular app for this is FRAPS. I ran it, set Video Capture Settings to frame rate that I was going to use in my final video (which was 29.97 fps) and then captured appropriate period of time of rendering my effect, starting and stopping recording with F9 hotkey.

3. Video captured by FRAPS is in full, original resolution and encoded with some strange codec, so next I needed to convert it to desired format. To do this, I used VLC media player. Some may think that it's just a video player, but in fact it's incredibly powerful and flexible video transmitting and processing software. (I once had an opportunity to work with libVLC - its features exposed as C library.) Its greatest advantage is that it has its own collection of codecs, so it doesn't care whether you have appropriate codecs installed in your system. To convert a video file, I selected: Media > Convert / Save..., selected my AVI file captured by FRAPS, pressed "Convert / Save" button, selected Profile: "Video - H.264 + MP3 (MP4)", customized it using "Edit selected profile" image button, selecting: Encapsulation = MP4/MOV, Video codec = MPEG-4 (on Resolution tab, I could also set new resolution to scale the content, my choice was 1280px x 720px), Audio disabled, Subtitles disabled. Then after pressing "Save", selecting path to destination file, pressing "Start" and waiting some time, I had my video converted to more standard MPEG-4 format (and more than 5 times smaller than the original one recorded by FRAPS).

4. Finally I could insert this video onto a new track in my video editing software and enable blending with underlying layer to achieve desired effect (I used "Overlay" blending mode and 50% opacity).

There are some details that I intentionally skipped here (like video bitrate) not to make this post even longer, but I hope you learned something new from it. My effect looked like this, and here is the source code: Low freq fx.glsl

By the way, here is another tutorial about how to make GIF like this from a video (using only free tools this time):

1. To capture video frames as images, use VLC media player:

  • Go to: Tools > Preferences > Video > Video snapshots > Directory and select destination directory for snapshot images.
  • Open your video.
  • While playing, press and hold Shift+s (default hotkey for "Take video snapshot", can also be configured in Preferences).
  • A numbered sequence of images is created in selected directory.

 2. To merge images into animated GIF, use GIMP:

  • Create new, empty image.
  • To import all captured images as layers, drop these files onto the image.
  • Delete background layer.
  • To switch to indexed colors and apply dithering, select: Image > Mode > Indexed..., select Generate optimum palette, Maximum number of colors = 255 and Color dithering = Floyd-Steinberg (normal)
  • Select File > Export. Enter some file name with ".gif" extension. Press "Export". In next window, check "As animation", enter delay between frames, check "Use delay entered above for all frames" and press "Export".

Comments (1) | Tags: rendering video tools | Author: Adam Sawicki | Share

Jun 2014

Pixel Heaven 2014 - My Photos

Here is the gallery of my photos from Pixel Heaven 2014:

Pixel Heaven 2014

Comments (1) | Tags: gallery events demoscene atari | Author: Adam Sawicki | Share

Jun 2014

Pixel Heaven 2014 - My Impressions

31 May - 1 June I've been in Warsaw on Pixel Heaven. As I haven't been on previous edition, I didn't really know what to expect. Timetable was full of various activities - lectures, competitions or just opportunities to play some games. Would it be only about retro games, or also modern games? Only about indie games, or AAA games too? Is it more for gamers, or for professional game developers? What about demoscene? Either way, I decided to go there.

I'm not really into these retro platforms, so I planned to go listen to lectures about indie game development. I've seen and heard many interesting stuff there, like Adrian Chmielarz from The Astronauts presenting their game - The Vanishing of Ethan Carter - for the first time!

But as it turned out, I met so many interesting people there (some of them I haven't seen for years) that I've spent most of the time talking with someone :) It's a coincidence that just recently I've heard stories of several people who work for many (some more than 10) years in just one company. Very often that's their first job after graduating university. They speak with confidence like they know a lot about doing career. Surely after all these years they were promoted many times. But at same time, I think sometimes such people preceive possibilities and limitations of their job as something obvious, its rules as something critically important, like it was whole world. I don't think it's good attitude and I want to avoid that.

On the other hand, noone can try in his life every possibility in terms of work and career. For example, someone who already has a house and spouse and children and mortgage many not be willing to move to different city or country or try to make his living from doing a startup or indie gamedev studio. That's why I think it's so important to talk to many different people and hear their stories. Knowing how working for some other company looks like, whether your competition or in completely different business, or how totally different may someone's work and lifestyle be (e.g. freelancing, working from home, being a consultant, traveling to different countries to do different projects, making a startup) is mind-expanding because it makes you think about your own career with all its pros and cons in the context of bigger picture of what's possible.

Back to the Pixel Heaven, I recommend this party to anyone who is interested in either retro games or indie games. There is a lot of things to do all the time so noone should be bored.

Comments (1) | Tags: career atari demoscene events | Author: Adam Sawicki | Share

May 2014

Offensive Programming :)

Generally, defensive programming is a very good idea. But many times I've seen this following C++ code explained as an example of defensive programming:

if(pointer != NULL) {
   // Some other things with pointer.

If the pointer here is expected to always point to a valid object and not NULL, otherwise it's a programmer's bug somewhere else in the code, then I believe such practice is very, very bad. I think there should be an assertion instead, like this:

assert(pointer != NULL);
// Some other things with pointer.

First of all, assertion is compiled only in debug configuration, while condition would be additional code executed in all builds, unnecessarily impacting performance. Second and more important argument is that when there is a bug and the pointer is NULL, we should know about it as soon as possible and be able to debug this particular place. That's easy when we put an assert. That's also easy when we dereference NULL pointer, because then the application would crash, which is also possible to catch in the debugger. On the other hand, when there is a condition around code using this pointer and the pointer is NULL, the code inside is just not executed, which may somehow corrupt or just propagate corrupted state of the program, hide the bug or defer its appearance for later time and to different place of the code, making it harder to find. Recommending to crash the app could sound radical, so let's call this "offensive programming" :)

Comments (6) | Tags: c++ | Author: Adam Sawicki | Share

Older entries >

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