Thursday, February 5, 2015

Bloom post filter


People ask me questions about support for various post-processing effects. In general, post processing of resulting image is simple thing: take the image and render it again as texture with post filter shader enabled. The first post filter was CRT shader, but here I had unsolved problem with shader itself. Recently I requested to make bloom filter. I found a simple open source bloom shader, which implements some custom algorithm. It works like this:

The shader has no controls, blurs almost everything and produces very strong bloom effect. Demo video:

The shader is good for demonstration, but practically unusable due to highly overexposed result. I started to dig deeply. I found that theoretical article explaining how bloom should work. Proper bloom post-filter is multi-pass; cite: "Take the input image and create a thresholded version of it, setting pixels below a specific threshold to black. Then blur the result and add it to the original image". Practical implementation for blur and blend is taken from devmaster.net. The result is much softer and the colors are much more natural than with the previous variant:

It also has lots of settings to adjust the result for your taste. Demo video will be available later.


  1. People actually want bloom? To me it was one of those effects meant to fake better lighting in games. And it did so very poorly. The first thing I do in any game that uses bloom is to find a way to disable it. If that means digging into ini files or whatever, it's worth the time spent, just so I don't have to look at it.

    You're working on this - a silly addon - when there's games that can't even be played. For instance, as far as I know, no emulator or plugin can run Winback: Covert Operations properly. There's these stupid floating grey (and other colored) boxes that literally get in the way of gameplay.

    1. People actually want bloom, blur, scanlines and other things which you may dislike. People are different.

      Regarding Winback: there is hundred of known issues besides it. That isn't a relevant point.

    2. The point is that you're spending time working on these superfluous features when there's still a lot that's broken that you could be working on instead. N64 emulation, in general, is nowhere near where it should be. Most people are satisfied just as long a handful of core Nintendo franchise games run properly, everything else be damned. Your plugin is partly my hope for that to change. I'm not saying it's up to you to fix everything. But accepting our Indiegogo dollars says to me that you seem to think you're capable of a lot. So my hope at this point lies with you. Seeing something like this is disappointing when there's so much work that needs doing just to get games to run properly with STOCK settings.

    3. Ok, I got your point. As I said, people are different. And people who donated to that project also have different requests. Some wish to see Zelda at maximum possible quality, others want to see progress in badly emulated games. I'm trying to work in all directions, because it would not be fair to ignore requests of people who supported the project. You may check list of closed bugs in the bug tracker. There are lots of fixes in games, which are not in "core Nintendo franchise" list.

    4. There is an emulator that can run Winback: Covert Operations but its the PS2 version on the PCSX2 emulator(fully playable). I was hoping there would be a fix for the N64 version too, I can still wait though...

    5. Of all the things ever to complain about - an option that you can CHOOSE to enable or disable is being picked on. GG gonetz I appreciate your work and the options you're giving us via just one plugin. To your success!

  2. I've always wondered this but, Gonetz, is it possible to expose only 3D geometry to the effect and not 2d? i only ask because my only issue with post processing is that it effects HUD elements which is a no no for me.

    Another solution (that has worked well with other emulators) is simply allow for 3rd party shaders to be used, let the community make one, It's how PCSX2 got it's amazing shader.

  3. There are various approaches to make bloom effect, e.g. use special textures. If you use post-processing, you have no 3D or 2D geometry. The only input data is your 2D image. Post filter will expose all bright pixels on it. If your HUD brightness is below threshold level, it will not be affected.

    3rd party shaders are possible of course. But they will not help here because all post filters use that operating principle.

  4. Here are some examples of great looking bloom (from a shader ported from an injector by Boulotaurs for the ReShade injector - Gaussian Blur / Bloom / Unsharpmask):


  5. @37a22: Why play that game on N64 when there are way better versions on other systems?

    Also, it's a graphics plugin. It's supposed to make games look better.

    You should talk better than that to this guy for he is doing a great job.

  6. Este plugin está genial, pero, ¿Cuándo estará disponible para descarcarlo?

  7. This plugin is great! But, when will be available for download?

  8. Perfect then be available to add to Project64?

    1. It will be released for all N64 emulators for Windows, including Project64.

  9. This is amazing work you are doing. This looks really nice. I imagine you might be familiar with this?:


    I cant find video of this in action ANYWHERE. I think he posted some of the code on there.

    But, imagine playing something like Majora's Mask with a shader like that and Djipi's textures.

    I've only recently gotten back into emulation and have played Kingdom hearts BBS on PPSSPP with their basic built in cartoon shader. https://www.youtube.com/watch?v=lDdLMUrnpy8

    Even though it's n64, i bet it would look even better than this, especially with some of the texture packs. Like I said I have not been into emulating for a long time, and now I guess I was just surprised to see that the n64 emulators don't seem have stuff like that which I just assumed would have caught on and been standard or something, among many other options. Seems like the n64 scene is behind? But I guess that's what your project is all about! Any chance on implementing something like this?

  10. As I said, image post processing is relatively simple thing and GLideN64 can support variety of post filters. This just needs time, time is money, money were donated for particular functionality which have to be implemented first.