Page 1 of 1

Post effects in CableRacer: DoF and Thingie

Posted: Sun Oct 01, 2006 1:14 pm
by Oogst
For a long time now I have been working on a game with the working title Cableracer. There is no art yet and many things still need doing, but I do feel like I am actually getting somewhere. I am not putting an executable online yet, because I do not consider the game finished enough for playtesting.

What I think is fun to show right now, is the post effects that I have been implementing lately. The main problem with the game as it was, is that it is difficult to see how far you are from an object. Therefore I implemented depth of field-blur, but in an altered form: the closer, the sharper and the further, the blurrier, so there is no focal distance to set. It works quite fine and looks like this right now:

Image

Image

I tried some different techniques and in the end I settled with a mix of what I read in a presentation by Ati ("Advanced depth of field" by Thorsten Scheuermann), my own thoughts and some improvements by Thomas/Thamas (who rarely posts here). I have two versions now for different graphics settings, which are the first two images in the image below. On 1024*768 my Geforce 6600 GT pulled 43fps on high settings and 135 on medium setting. I also implemented the exact Ati-algorithm, but bombs, does that look ugly! Close objects smear out way too much on a far background.

Image

I also had a very useless day experimenting with nice effects for the credits-screen. This is by far the most stupid feature in the game and the credits-screen now also has a worse framerate than the game on medium setting (70fps in the credits), but hey, I had good fun! The great benefit of hobby projects over professional projects is that I can actually waste my time on fun things without use. :twisted:

Image

Image

I hope to have an executable available in a couple of weeks, but in the meanwhile I am also onto crowd AI programming for one school project and image retrieval for another, so I doubt I will get the time.

Posted: Sun Oct 01, 2006 1:53 pm
by Kezzer
Very, very nice! Awesome work

Posted: Sun Oct 01, 2006 2:34 pm
by Kencho
Looks cool, reminds me to Uniracer. Definitely adds a nice depth feeling to it :)

Posted: Sun Oct 01, 2006 2:51 pm
by Oogst
Uniracer? Never heard of that. Do you mean this game?

http://www.mobygames.com/game/snes/unir ... tId,46728/
http://www.mobygames.com/game/snes/unir ... tId,46727/
http://www.mobygames.com/game/snes/unir ... tId,46726/

How does it play? In only see straight road in the screenshots.

Posted: Sun Oct 01, 2006 3:07 pm
by SuprChikn
Yeah, that's the Uniracers game I know. It was a 2D game, so no flipping around the track like in yours :)

The track did do loops and jumps, etc, and there were hazards to avoid. You could also do a whole bunch of tricks (flips, spins, etc), and the more you did of these without screwing up, the faster you could go.

There were also levels were you basically had a half-pipe, and had to do a certain number of tricks in a given time limit.

Anyway, back to Cableracer: looking very nice so far. Keep up the good work.

Posted: Sun Oct 01, 2006 3:16 pm
by sinbad
Nice, a pragmatic form of DoF is good - after all it's the effect we want, not necessarily scientific accuracy :) If you're willing to share the shaders / compositors, I'm sure the Wiki would love to host them :)

The concept reminds me a little of some of the FZero GX levels:
ImageImage

Great game, even though you did have to be on amphetemines to beat it on the hardest modes :shock:

Posted: Sun Oct 01, 2006 9:11 pm
by Oogst
When things are a bit more final, I will have a look at the Wiki. In the meanwhile, two screenshots that look a lot less ugly than the ones above:

Image

Image

Posted: Sun Oct 01, 2006 9:28 pm
by Kezzer
The source is strong with this one :o

Posted: Sun Oct 01, 2006 9:33 pm
by jacmoe
Awesome, Oogst! :)

Posted: Sun Oct 01, 2006 10:09 pm
by B_Lizzard
The last screen really gives me nausea... That means you're doing your job really well!

A nicely modelled vehicle, some pretty textures and you're done! :lol:

Posted: Mon Oct 02, 2006 8:49 am
by Vectrex
great! I think a highly geometric art style would suit this, as it looks good now, but fzero has way too much 'stuff' in it :)

Re: Post effects in CableRacer: DoF and Thingie

Posted: Tue Sep 08, 2009 8:05 pm
by Oogst
Wow, it has really been a very long time since I worked on this project! I finally graduated recently, so now I finally have the time to work on this game again. Actually, I am aiming to have a nice version to send in for IGF (deadline end of October), but we'll see how far I get.

Anyway, since depth of field (DoF) blur is incredibly important for the gameplay of this game (it helps seeing distance), I want a more prominent role for it. So I increased the strength, but then I noticed that the DoF does not look good enough for that. So I have been experimenting with that:

Increasing the strength of the blur, new result to the right does not look smooth enough:
Image

The main goal is not to get the ugly bleeding that most modern games have when they do DoF: sharp edges bleed over a blurry background, like here (notice the glow around the sharp objects at the bottom right corner of the image):
Image

I tried getting a smoother image using noise in the DoF sampling. That is how most modern games solve anything that they cannot sample enough. But I think the noise interferes with the geometric style I want for the game, and it costs 20% performance with how I implemented it:
Image

My latest results is that I found a number of bugs that made the sharp image too strong over the blur. Fixing these bugs results in this blur, which is already a lot smoother than the version before:
Image

I am still experimenting with how to get this to look smoother, but I think this might be good enough for now. Especially since I am also going to implement motion blur, so when moving fast these two blurs together will, well, blur the image enough already, I hope.

Motion blur to come next week, if I am lucky! :)

Re: Post effects in CableRacer: DoF and Thingie

Posted: Tue Sep 08, 2009 8:52 pm
by trnrez
:shock: Looks really good. Keep at it :D

Re: Post effects in CableRacer: DoF and Thingie

Posted: Tue Sep 08, 2009 9:06 pm
by metaldev
really really cool. cant wait to see how this develops.

Re: Post effects in CableRacer: DoF and Thingie

Posted: Sun Nov 15, 2009 1:50 pm
by Danoli3
Very nice DOF!!
I would love to see this source posted of the DOF and Motion blur :D!

I tested out your new game.. works really well!

Re: Post effects in CableRacer: DoF and Thingie

Posted: Sun Nov 15, 2009 2:22 pm
by jacmoe

Re: Post effects in CableRacer: DoF and Thingie

Posted: Sun Nov 15, 2009 3:31 pm
by Oogst
Indeed, the source for the DoF shaders comes with the download for the game, since it is just Cg files. You can find the download somewhere in this topic:

http://www.ogre3d.org/forums/viewtopic. ... 1&start=50

There is no motion blur there, though: I removed it after experimenting with the visual effect in 3dsmax, so I never even fully implemented motion blur in the game.

Re: Post effects in CableRacer: DoF and Thingie

Posted: Mon Nov 16, 2009 4:49 am
by Danoli3
Awesome, I have the files.
Just wondering how I would actually implement this CG to the camera?

Love just a few lines of code example :D!
Thanks, so excited!

Re: Post effects in CableRacer: DoF and Thingie

Posted: Mon Nov 16, 2009 9:09 am
by Oogst
It's pretty complicated. You need to set up your materials so that every object stores its depth in the alpha. This means you cannot use alpha blending. The shaders called "Depth_" are for this.

Then you need to render the scene to a RenderTexture and then render a quad to the screen that has the depth of field blur pixel shader (DoF_SM3_50samples_FP) and that RenderTexture.

The usual way to do this in Ogre would be through the compositor framework, which I guess can do a lot of these steps for you. However, I did not use this, which means that you have to build this yourself.