Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 01 Mar 2011
Offline Last Active Nov 23 2015 09:44 PM

Topics I've Started

Blending problems on alpha enabled render target

27 December 2014 - 07:15 AM



I want to make a scene that is made of several layers. Every layer has it's own render target(frame buffer object) and textures are rendered on it. Obviously I need a FBO that can be cleared to (0,0,0,0), so at the end when I render it all to my final scene(backbuffer) they don't cover each other.




To be able to clear the FBO to (0,0,0,0) the texture that is bind to the FBO supports alpha channel glTexImage2D(GL_TEXTURE_2D,0,GL_RGBA,w,h,0,GL_RGBA,GL_UNSIGNED_BYTE,data). The problem is when I render something transparent(like a water bubble) on this type of FBO it makes the FBO transparent there, like in this picture:




This is what I want, a normal result using glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA). I don't know what is the problem here, the created texture for the FBO, blending mode... ?



Broken Mug Engine

07 June 2014 - 04:33 AM

I've written my own game engine called Broken Mug Engine. It is written in C++ and is based on OpenGL and SDL. I am going to post about it in this thread.

First video of my game engine shows some GUI features and font rendering. Most of the GUI layout is defined in external XML files. Two GUI themes are also defined in XML. Font rendering is based on files created using AngelCode's Bitmap Font Generator. To make the video more interesting I made a little preview of my map editor, Box2D physics and 2D model editor.


I also made a blog and written a bit more info about the GUI and font rendering there. You can check it out:

You can also find me on Facebook:


If Quake 2 was 2D

13 October 2012 - 10:12 AM

This is a little demonstration of my WIP engine and a tribute to id Software and Quake series.
The video was recorded at 17 FPS, my PC couldn't do better. Low frame rate broke the physics.
Youtube HD Video link : http://youtu.be/9k-N49P5N1I?hd=1

Posted Image

Posted Image

Posted Image

Some parts of the game are locked until someone finds the hidden Humble Indie Bundle 3 Steam key. The game includes a simple map and animation editor. I will write a tutorial for those later.

The core of the engine is/was the engine from the book Advanced 2D Game Development by J.S. Harbour.
I will be a bit rude and rename it to MUGEe because of all the changes I made:
- rewritten sound management
- texture management
- vector graphics
- new entity management
- basic collision handling and physics
- 2D skeletal animation
- 2D animation editor
- map editor
- generic joystick support
- simple GUI
- ...

System requirements:
- Windows XP, 7
- 2000 MHz processor
- 128 MB RAM
- 128 MB graphics card with shader model 2 support
- 40 MB free disc space

Download link:
MD5: 4B29177042C5CC0F49FA66D39497129D

Please report bugs. Only one guy was willing to test it, but there should be no problems. I mean, there are some bugs left, but nothing serious.


I don't own any of the textures and sounds used to make this demo.

QUAKE II © 1997-2001 Id Software, Inc. All Rights Reserved. QUAKE, QUAKE II, the QII logo, the Id Software name and the Id logo are either registered trademarks or
trademarks of Id Software, Inc. in the United States and/or other countries.

Rundiculous - 2D running game

03 March 2012 - 06:56 PM

There was a Game Programming Competition on Facepunch forums which I was taking part in. We had a month time to make an arcade style game.

Posted Image

Rundiculous is a running game that encompasses elements from VVVVVV and Bit.Trip Runner. The goal of the game is to reach the end of each level and collect as many blue crystals as possible to get the highest score and do it with as few fails possible. In each level player has to face many challenges to pass the level, from tricky terrain to malfunctioned robots. To do that he uses a set of skills; jumping, sliding, kicking and gravity flipping.

Unfortunately I didn't manage to finish it. Some features are also not fully implemented(kicking) and it only has four levels. Three levels are short and simple made mainly for the players to get used to the controls. The fourth level "First Encounter" is just a taste of what the game should have been if it was finished (thought the level is missing some terrain data).

The build I submitted to the Facepunch Game Programming Competition #5 can be downloaded here:

Other info:
- Made using a heavily modified Advanced2D engine (C++, DirectX9, FMOD)
- I did all the art myself (player is obviously a ripoff though)
- Configurable controls and screen settings via options menu
- DirectInput joystick support (I recommend playing with a joystick)
- Level highscores
- Three music tracks by Jaden "Mongo" Duchene https://www.facebook....38258232906581

Big thanks to Mischievous and Kristo for testing and support, and Mongo for his great music Posted Image

I hope you like it. I might finish it one day.

Different screen resolutions in a 2D game

27 January 2012 - 12:03 PM

My problem is handling different screen resolutions. I want to draw a scene of the same size(1024,768) on different screen resolutions. I don't know what technique is usually used for doing this in 2D games.

To see what I want to do look at the screenshots below from a game called Facewound. Here are screenshots when running the game in 640x480 and 1024x768 window size. It is obviously the same scene, and if we count the tiles (32x32), we see that the original scene is 1024 pixels wide and it is somehow rendered to fit on just 640x480 window.

In my game if I change the screen resolution, the size of the scene that will be rendered depends on the size of the bacbuffer.So if it is 640x480, it just renders the upper left corner of the size 640x480. But I want the whole 1024x768 be rendered on 640x480 and not just the upper left part.

I am using DirectX and ID3DXSprite object to render sprites. All, I need is the idea/principle how stuff like this are made, not the code.

Posted Image

Posted Image