Post Processing

Blitz3D Forums/Blitz3D Programming/Post Processing

xtremegamr(Posted 2010) [#1]
In some games (like Medal of Honor: Airborne) there are several post processing effects that add intensity (and eye candy) to the game. For example, in MOHA (and in many other games), the screen turns red as you take damage.

I've tried several different techniques to implement this effect in my games. My only problem is that all of these techniques KILL my frame rate; my FPS has never gone above 2FPS with post processing effects, even in fullscreen mode! Here's some code I cobbled together to demonstrate what I'm talking about.

Can anyone give me some pointers on how to speed this up? Or am I just going about this the wrong way?




puki(Posted 2010) [#2]
Based on what you have shown, just use an alpha mesh as a filter.


Seeing as you are interested in this path:

How many games have you seen that exhibit retina retention - ie when the player looks into a bright light and gets the 'light blobs' retina retention?

I don't ever recall seeing it in any game - but it is easy to reproduce.

The concept for implementing this is tucked away in a Blitz3D demo - it's just most people probably overlooked it.


Ian Caio(Posted 2010) [#3]
xtremegamr,

Those Post Processing effects are usually made using Pixel Shaders, and since Directx7 doesnt support shaders you cant make it exactly the same way with the same speed. But there are many ways to get cross that problem.

For example, that blood effect, you could put a sprite in front of the camera using pixel perfect math, paint it red, and maybe add a feel details with some texture, and then use entityalpha to make it fade away with the time.

If you use your imagination you can go far with this kind of effects :)

cya


xtremegamr(Posted 2010) [#4]

Those Post Processing effects are usually made using Pixel Shaders, and since Directx7 doesnt support shaders you cant make it exactly the same way with the same speed.



I was afraid you'd say that. :)


For example, that blood effect, you could put a sprite in front of the camera using pixel perfect math, paint it red, and maybe add a feel details with some texture, and then use entityalpha to make it fade away with the time.



That sounds like a good idea. I think I'll try it.

Thanks to both of you guys, I appreciate the help.


Ross C(Posted 2010) [#5]
or try the fast libs extention


Drak(Posted 2010) [#6]
Using the sprite method doesn't work too bad. I have used it previously and think it looks alright. This is a link to the worklog and theres a link there to download the demo for that game if you'd like to see it.

http://www.blitzbasic.com/Community/posts.php?topic=88817

Here there's actually 3 splatters on the screen at different rates of fading:



Ross C(Posted 2010) [#7]
Looks not bad actually :) I';lle xpand upon my comment i left last night about the fast libs. They will let you filter out everything, but red, green or blue, giving the whole screen, an only red, green or blue coloured appearance.


Matty(Posted 2010) [#8]
Without fastlibs (which I've never used) you can also filter out all of a particular set of colours simply using a (for instance) red (255,0,0) quad / sprite multiply blended with the scene (use entity order and place it in front of the camera so that it renders last)


Ross C(Posted 2010) [#9]
Ah, that's nice to know too :) Thanks!