So... Here is depth of field

This only works with the 2.46 SVN builds since last week. sample blender file available here.

FAQ:
How do I run this? Use a recent blender build such as this one on graphicall
Is this…? Yes the shader is completely realtime, in-game, and runs on the BGE natively.
Why diagonal blur? I chose 2 pass diagonal blur over horizontal/vertical blur because diagonal is more interesting, and it also simulates a camera aperture opening slight better.
System requirement: A modern graphics card with OpenGL 2.0 support is required (Geforce 6+), ATI card not supported at the moment.

http://mpan3.homeip.net/content/blog/img/0807091339_Depth_of_Field_shader_in_Blender.jpg

Next up: screenspace ambient occlusion.

Woah, that is in-game?

How did you get that ambient lighting similar to COD 4 in the video? In the video, the 3d view has only basic lighting and textures, but when you enter the game engine §, the world had great lighting!
Also, screenspace ambient occlusion sound great! And it will be for realtime use? Are you going to be using nodes, like in this link http://mpan3.homeip.net/ssaowcn ?

What browncow said… the question i mean.

what build is this? where can i get it? This looks brilliant

holy crap thank you sir. me rove you rong time

Really good looking. I’m really glad to see these new features, and can’t wait to use them.
GameBlender is really becoming a perfect rapid game development platform, and with these features, GameBlender is looking far more attractive. I’m sure these new features will bring a wave of new users.

Very nice texturing! the dof effect doesn’t work on my computer (Neither do 2d filters) but the texturing is superior to anything I’ve seen on blender to date. Great Job. I will be dissecting this…

Hmm, so far no comment on the depth of field shader?

I am surprised how many people liked the level. I had to reduce the size of the texture to keep the file size down, there is a much higher quality version of the same file (no DOF, just higher quality texture) here: http://mpan3.homeip.net/matrix

the shader’s great although intense at times, and it runs a little slower then id like buts not your fault :slight_smile: i cant wait for the screen space ambient occlusion shader next!

Brother, that’s impressive!
Nice one, mpan3!

It doesn’t work with apricot build, but it does an interesting effect (It looks like gloom with pencil sketch)

PS : Sorry it works perfectly on apricot rev 15500

wow nice shader… me want desperately… interested in knowing how to do that. I think your pic should be used to show off the new features!!!

Oh! This is incredible!
Thank you!!!

some shots from my doom-like game level with your DoF:
(On every object I use color+normal+spec+detail color+detail normal+detail spec+fresnel maps.)

http://www.etyekfilm.hu/boom_dof1.jpg
http://www.etyekfilm.hu/boom_dof2.jpg
http://www.etyekfilm.hu/boom_dof3.jpg
http://www.etyekfilm.hu/boom_dof4.jpg

Hi mpan. Thank for this amazing script.A simple question.What is the use fot the luminance button next to the depth button in the 2d custom panel, is it for hdr? Thank.

Great work mpan3, i had fun messing around with the demo.

Can you set the focus point to be a certain distance, instead of the auto focus?

I got a good frame rate to, only dropped to 20fps when i did the ‘heavier’ setting.

WOOOOWWW #$&_#@&*(#& *&@&*(#$ :eek::eek::eek::eek:
oh maaan.
mpan3 FoReVeR !!!
:slight_smile:

Hey,
This really looks great! The only thing that looks a bit off is when switching from really near to really far objects, the accomodation is a bit too fast. Maybe it’s an idea to make it happen more gradually (since the human eye can’t do it that fast) ?

A tip: try to blur zbuffer. With this I can make better result for internal render with nodes:
http://www.etyekfilm.hu/nodesetup_littlewarrior.jpg

Endi, that’s some beautiful images! All the material is done with the new Apricot branch right? I’ll play around with what you suggested.

kamaro, yes i believe so, but i haven’t really played around with HDR yet.

4Daniel, Yes you can set the focus manually in the GLSL script. But idealy, it should be a value (like rasterizer.focus) that can be set with a simple python script and changed every frame.

Now only if I can figure out a way to do bokeh:frowning: