Category: C++➕

  • 2006 Shader effects 💫

    2006 Shader effects 💫

    ⏱️Overview

    This is a result of me learning bump shaders with also implemented reflection and refraction (just from cube skybox).
    There wasn’t really a goal here, just to learn and show what could be achieved with my GPU (ATI Radeon 9800 I think) at the time.

    📷Gallery

    Link to more screenshots.

    🔍Implementation

    My code was using WinAPI for window creation and messages. Then Direct3D9 calls for rendering and HLSL 2.0 for vertex and pixel shaders. Also D3DX for anything else like 3D matrix and vector operations, compiling shaders, and loading 3D models (meshes) from X files. Lastly a sprite font, for screen texts (with parameters to adjust by keys) using my bitmap fonts.

    To get mouse and keyboard events I was using DirectInput. I made a camera system to move around the scene, rotate and zoom. There was also 1 point light here.
    I wrote a Timer (based on precise QueryPerformanceCounter) for checking intervals and computing current frame rate (Fps).

    I think I made most of the basic models. I would use Blender for this now. The skull model and all textures were gathered from other demos and games.

    ⏳Conclusions

    Professional made textures made the demos look quite good, already with simple 3D objects.
    But those were just demos. In a bad looking, low level written code.

    I continued using just C++ and Direct3D9 for a while in next project’s forks with terrain and water. And after that moved to using OGRE 3D engine.
    All that was too tied to DirectX and would need major rewrites every time I wanted to use new DirectX interface. Another good reason for using an engine, it can have different rendering systems also OpenGL based.

    Still, this experience was good learning for future, as I was developing shaders in Stunt Rally too, years later.

  • 2005-06 Crystal Font 🔤

    2005-06 Crystal Font 🔤

    ⏱️Overview

    This is one of my oldest Windows programs in C++.
    It can generate colorized bitmap fonts from true type fonts with glow effect.

    Done on college as hobby around 2005-2006.
    I used bitmap fonts from it in most of my programs, until about 2010. Additionally it made the text for my logo, and lastly the speed and gear digits in our game.

    📜History

    I had a small font tool without GUI, earlier when I was programming in Delphi. This one evolved to be a full featured program with medium size code.

    I presented the program at college, during scientific circles session, for 15 minutes. The presentation was also a good experience to have.

    It was a nice, useful program for me. Probably difficult to use for others due to only keyboard navigation and value changing. It had a help screen with shortcuts though.

    📂Sources

    Later I’ve uploaded it to Source Forge and thus it became my first FOSS program. Then I moved to Google Code and when it shut down, moved to GitHub.

    Available here.

    There were several programs done called bitmap font creator, maker or editor. It was (or still is) a popular thing to do. Both using bitmap fonts and making a program for it.

    📊Features

    Among other features it allowed quick loading and saving project files and coloring schemes. Also browsing them in its own lists with previews. One could easily pick a scheme for font color and quickly match another for glow.

    Glow was computed on CPU and thus rather slow, especially for big font sizes and large textures. I didn’t develop it further after realizing that all this could probably be done with a GPU shader in real time, even with animations, at least for small to medium fonts.

  • 2003 Shooter 🚀

    2003 Shooter 🚀

    ⏱️Overview

    This is my first game in C++. Done as a project on college, subject was C++ Programming, I think.
    It was a top down space shooter and had just 1 level. Without game end, just no more enemies.

    🔍Implementation

    It was using purely Direct3D9 calls for rendering and WinAPI for Window.
    I drew the textures myself, not many.

    Player ship had 4 weapons, auto gained with game progress: main 2 dots, small lasers, main thick lasers and side dots.
    There were 6 enemy types and the layout with their movement paths was already quite nice. Enemy weapons were actually just 1 type of orange dot. One ship fired a dot, auto directed at player. Others fired 2 to 4 dots in certain directions.

    ➡️Comments

    I’m glad I managed to create a game (2nd actually) at college, where the major was basically Industrial Software for Metallurgy. It was still my main hobby back then. Since I had experience in games I wanted more to use it and develop. Was also quicker, easier and more fun to make a project for that subject.
    Code looked cryptic, I was still coding in my own way of not doing a single space if not required, and using 1 letter abbreviations for keywords and types.