Jump to content
  • Advertisement
  • entries
  • comments
  • views

Project B - More On The Update and Post-Processing Framework

Sign in to follow this  


Engine Post-Processing Framework

I feel really bad about my last post. I feel like I made it too quickly and I did a poor job of explaining things. Because of this, I'm going to try to explain things a little better.I want to give more details of what is in the demo that I posted earlier. Though I talk a lot about the GUI, actually the first thing that I worked on was the post-processing framework. What is post-processing, basically with it, you can achieve all sorts of effects by running the entire completed scene through another set of shaders. You can use it to achieve effects like glow, motion blur, and many other things.

Here's an example of glow being created as a post-processing effect. From Genesis SEED, out IGF entry last year


This was the first system that I worked on because I wanted to fix a bug in it. I also wanted to design a really robust framework capable of handling many different kinds of effects.

How to do Post-Processing

The basic idea of post-processing is first render the screen to an auxiliary buffer instead of the back buffer. This auxiliary buffer can then be set as a texture to a shader. Then render a full screen quad of the texture using some effect shader. To perform different effects, you may need more than one auxiliary buffer. This is shown below.


The demo that I included in my last post used a glow effect. To perform glow, it uses the alpha channel to determine which areas should glow. The scene is first rendered to an auxiliary buffer. Then I use a 1/4 size buffer and render the entire scene to that buffer using a filter to only write pixels whose alpha value is set. Then I perform a vertical blur and then a horizontal blur. The final blurred texture is combined with the original image and then rendered to the back buffer. If you download the demo from my last post, you can take a look at the HLSL shaders.

Making a good post-processing framework isn't that hard. There's a good article on the subject here.

Some Cons

You have to be careful though. As you will be rendering the entire screen multiple times, you can lose a lot of speed. One way to speed things up is by using 1/2, 1/4 or even 1/8 size intermediary auxiliary buffers.

I hope this was useful. Check out my previous post to download the demo and see this and my GUI in action.

Previous Post:
Here are some screen shots.



Sign in to follow this  


Recommended Comments

I like the information and screenshots, especially the space screenshot. Is that from your game or is it more of a test screen?

Share this comment

Link to comment

The space screenshot is from our IGF entry last year. I really want to finish that game, but it was put on hold by another team member. It's too big of a project for me to do on my own so it's in limbo now. Project B is a different game, but it'll use a lot of the same source code. Unfortunately, the project just started and I don't have any screen shots yet.

Share this comment

Link to comment

Did you make the GUI or did you use a library? Do you use FreeType or some bitmap font generator? How do you support unicode? Is it necessary to use the multi-byte character set or unicode character set option in Visual Studio?

Share this comment

Link to comment
I wrote the GUI by myself except for the system config that uses DXUT. I haven't finished all of the controlsyet, but it works fairly well. I forgot to add a credit, but the for fonts, I used the font bitmap generator from AngelCode.com. Internally, the code uses wide chars for most things except when connecting with other librarieslike rapidxml. The AngelCode bitmap font generator can make all sorts of fonts in many differentlanguages. I think the multibyte option in visual studio defines how TCHAR is treated and how the built in string functions work. If you only use wchar_t or char, I don't think it helps. You'll need to use TCHAR and it's respective functions for those compiler options to make a difference. That may also change which version of the win API functions are called. In win32, there are wide char and ascii versionsof everythin. For example, there is a SetWindowTextAand SetWindowTextW. Depending on the compiler settings,it will use to prepocessor to make SetWindowText be one of those.

Share this comment

Link to comment

wchar_t is 2 bytes on Windows, so doesn't that mean that not all Chinese characters are supported? Or are they just UTF-16 encoded using more than one character? Is it really ASCII or is it UTF8 encoded? I don't want to use wchar_t because it's a different size on Linux/Mac.

Share this comment

Link to comment
They may actually be using UTF-16, which will use multiplebytes if the value goes to high, but I'm not sure. The most common languages will all fit in 16bits including Chinese and Korean. Some less common chinese glyphs may need more bits, but the most common ones don't. Actually in USC2 which is 16bit unicode,the language that uses the most space is Korean. It's because of the special way they combineletters into syllable blocks. You bring up an interesting point. I've done most of my work on windows and am comfortable with it. I need to think about other platforms more though.

Share this comment

Link to comment
I also use my own string class that internally stores things as widw char but it can convert betweenchar and multibyte.

Share this comment

Link to comment

I primarily work on Apple computers and so I try to keep projects multi-platform. It is very tempting when developing on windows to only focus on windows because of the large installed user base.

Still there are gamers on a ton of different platforms.

Share this comment

Link to comment
You are right. I need to be more multi-platformminded.I've been trying to do that with my latest code.

Share this comment

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!