Depth of Field ...

Post those lines of code you feel like sharing or find what you require for your project here; or simply use them as tutorials.
posttool
Posts: 13
Joined: Thu Dec 07, 2006 5:40 pm
Location: San Francisco
Contact:

Depth of Field ...

Post by posttool »

Hi

I love irrlicht and now (finally) I love shaders...

I have posted a depth of field implementation based on Omer's work and some RenderMonkey examples.

Image
Image
Image

here:
http://posttool.com/drop/02depth.zip

I also have an update to Omer's HDR effects... I had to modify them significantly to get them working for my ATI card, but now they should be more generic. Also, I have updated his code for Irrlicht 1.2. Write me if you want this...
posttool
Posts: 13
Joined: Thu Dec 07, 2006 5:40 pm
Location: San Francisco
Contact:

...

Post by posttool »

use the function keys to modify the range, focus, blur & distance values..
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Yes, we want all :D Looks nice, indeed 8)
BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Post by BlindSide »

WOW :shock: That looks very impressive.
posttool
Posts: 13
Joined: Thu Dec 07, 2006 5:40 pm
Location: San Francisco
Contact:

updates to irr|cinema omeremad

Post by posttool »

Prott
Posts: 104
Joined: Sun Jan 14, 2007 12:01 pm

Post by Prott »

Hello, I must say that it is impressive work. Looks like NFS:Carbon`s DOF, but for PS and VS 2.0 (Carbon needs 3.0 lvl shaders for that). Keep up the good work :wink: .
Last edited by Prott on Tue Jan 16, 2007 3:23 pm, edited 1 time in total.
BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Post by BlindSide »

Is this achievable with PS1.4?
Halan
Posts: 447
Joined: Tue Oct 04, 2005 8:17 pm
Location: Germany, Freak City
Contact:

Post by Halan »

when trying to use your class in my project the consols says something liek

HLSL shader compilation failed...
unexpected token 'vec 2'

also your demo crashes when closed :(
but it looks great btw 8)
sio2
Competition winner
Posts: 1003
Joined: Thu Sep 21, 2006 5:33 pm
Location: UK

Post by sio2 »

Halan wrote:when trying to use your class in my project the consols says something liek

HLSL shader compilation failed...
unexpected token 'vec 2'

also your demo crashes when closed :(
but it looks great btw 8)
"vec" is a GLSL datatype (is there really a space between "vec" and "2"?). HLSL equivalent for "vec2" is "float2".

I guess you've tried loading GLSL into the Direct3D driver - no go. :wink:

I've been for converting this demo to D3D9 for a while, but I've been busy on other demos. I'll take another look when I get chance.
Halan
Posts: 447
Joined: Tue Oct 04, 2005 8:17 pm
Location: Germany, Freak City
Contact:

Post by Halan »

vec2... thought it was a HSGL shader because that was wirtten in the console ;)

ill try open gl
sio2
Competition winner
Posts: 1003
Joined: Thu Sep 21, 2006 5:33 pm
Location: UK

Post by sio2 »

02depth crashed for me too on exit.

I compiled a debug version of the irrlicht dll and found that the callback was being shared without callback->grab() and when it's dropped multiple times the pointer becomes invalid.

I fixed shadermaterial.cpp, ShaderMaterial::init():

Code: Select all

    if (!callback) {
               callback = new ShaderCallBack();
		} else {
			callback->grab();
		}
Doesn't crash on exit now.
Halan
Posts: 447
Joined: Tue Oct 04, 2005 8:17 pm
Location: Germany, Freak City
Contact:

Post by Halan »

thanks 8)

please contact me if youve converted this to hsgl

greets,
halan

btw: this shader looks similiar to the rainbox 6 : vegas shader :D
sio2
Competition winner
Posts: 1003
Joined: Thu Sep 21, 2006 5:33 pm
Location: UK

Post by sio2 »

OK, I've now converted this demo so that you can now choose between OpenGL and Direct3D9 at startup. I've also fixed the crash-on-exit bug.

I'll clean out my debugging junk and post the code+demo on my website tomorrow. It's currently PS2.0, but I'll have a look at whether PS3.0 adds any performance (if host card supports it). I'll also see if it will fit into 1.x.

I'm not happy with performance, but it's a good starting point. [GL and D3D are same speed, before you ask :wink:]

A big thanks to posttool and omar - I'll make sure credits are given in the readme. :wink:
sio2
Competition winner
Posts: 1003
Joined: Thu Sep 21, 2006 5:33 pm
Location: UK

Post by sio2 »

Beta version available here:
http://sio2.g0dsoft.com/DepthOfField.zip

If a few of you could test it out for me I would be grateful. If all is OK I can then upload the Release version and post it on my main page.

You can now choose between OpenGL and Direct3D9 at startup.
sio2
Competition winner
Posts: 1003
Joined: Thu Sep 21, 2006 5:33 pm
Location: UK

Post by sio2 »

The official demo is now up at my website, with source code.
Post Reply