Gamestudio Links
Zorro Links
Newest Posts
Zorro Trader GPT
by TipmyPip. 12/04/23 11:34
Newbie Questions
by AndrewAMD. 12/04/23 11:14
Square root rule
by Smallz. 12/02/23 09:15
RTest not found error
by TipmyPip. 12/01/23 21:43
neural function for Python to [Train]
by TipmyPip. 12/01/23 14:47
Xor Memory Problem.
by TipmyPip. 11/28/23 14:23
Training with command line parameters
by TipmyPip. 11/26/23 08:42
Combine USD & BTC Pairs In Asset Loop
by TipmyPip. 11/26/23 08:30
AUM Magazine
Latest Screens
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Who's Online Now
2 registered members (TipmyPip, izorro), 556 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
fairtrader, hus, Vurtis, Harry5, KelvinC
19019 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 3 1 2 3
Re: Ha I finally have achieved DOF, without pro! [Re: lostclimate] #93902
10/11/06 19:36
10/11/06 19:36
Joined: May 2002
Posts: 2,541
Berlin
EX Citer Offline
Expert
EX Citer  Offline
Expert

Joined: May 2002
Posts: 2,541
Berlin
Thatīs not correct. A depth blur has always a focus. The way you say it lostclimate the focus is always the camera, but that is wrong. I am making photos, and the blur goes around a spot called the focus. You cann adjust the position of that spot, by zooming in and out and adjust the range of the blur by changing the blend(?). Not only things more far aways get blurred more, also objects closer to the camera/eye as the focus get blurred more and more.

And thatīs the weak spot of the fur shader. The closer it gets to the camera the slower the fur shader is, but the more you have to blur. Thatīs a big problem. The other problem you get is you canīt blur the inline of the model. That means close objects outline will get only to the outside blurred. The inside wonīt get partially transparent.


:L
Re: Ha I finally have achieved DOF, without pro! [Re: EX Citer] #93903
10/11/06 19:57
10/11/06 19:57
Joined: Dec 2000
Posts: 4,608
mk_1 Offline

Expert
mk_1  Offline

Expert

Joined: Dec 2000
Posts: 4,608
Depth of field is a camera effect. Pixel or dots are bigger if they're far away from the focus plane. Those circles overlap and cause the blur. You can do that with render to texture + depth map.


Follow me on twitter
Re: Ha I finally have achieved DOF, without pro! [Re: mk_1] #93904
10/11/06 21:17
10/11/06 21:17
Joined: Oct 2003
Posts: 4,131
M
Matt_Aufderheide Offline
Expert
Matt_Aufderheide  Offline
Expert
M

Joined: Oct 2003
Posts: 4,131
Lost Climate's method here is so wrong I cant begin to explain. It will never look right, and will be incredibly slow, because you are fake-blurring the objects by rendering multiple passes.. this is about the worst idea i have ever seen.

Seriously, you cant do this kind of effect properly without depth buffer info and render to texture and so on.


Sphere Engine--the premier A6 graphics plugin.
Re: Ha I finally have achieved DOF, without pro! [Re: EX Citer] #93905
10/11/06 22:07
10/11/06 22:07
Joined: Sep 2002
Posts: 8,177
Netherlands
PHeMoX Offline
Senior Expert
PHeMoX  Offline
Senior Expert

Joined: Sep 2002
Posts: 8,177
Netherlands
Quote:

What do you mean by fixed? Nothing is fixed. I am not sure if you understand how it works. I can focus what I want, and blur far/less far as I want.




Try your code near two wall sections, one wall up close and one wall further away and a couple of entities in between those walls. Like a hallway kinda thing with two obstacles, except it's outside. (Usually DoF isn't used inside buildings as you definately know.) Now, you will see everything sharper in the focus area (eventhough you can change it and it's stufenlos), however the two walls will look equally blurred eventhough the distance of both are quite different. This is not what happens with DoF, infact if you look at Half-life 2 then you'll see the blur technique is different too, like said by mk1, it's a scale blur, based on depth distance. Very very hard to fake, if not impossible without depth buffer.

Anyways, you did make me curious, would it be possible to make a little movie showing your progress on this till now?

Perhaps indeed your effect works better in real-time than what I've seen on the screenshots. You did a pretty good job on the blur effect, but theoretically it's simply not possible to fake DoF correctly. Off course theory and practise are not always what they seem to be.

Quote:

You can do that with render to texture + depth map.




Yes, except that this would only work for scenes in which the camera doesn't move, right? Unless you know a very clever method on how to make this depth map 'realtime', which is where the depth buffer comes into play .. I'm no pro, so I'll be gladly proven wrong in all this, but I think you'll agree.

Edit: Btw, we can do this effect in 2D though ... as a post-processing effect, that's where the fixed or almost fixed focus doesn't matter that much .. If you're a real die hard you could go mad on making depth maps for the entire 2D level ..

Edit: This is the result of some of my tests ... perhaps it's not so impossible .. I'll give a direct link because of the very big image otherwise on this forum;

Screenshot 1 Slipstream fighter project
Slipstream fighter project test 2

Cheers

Last edited by PHeMoX; 10/11/06 22:32.

PHeMoX, Innervision Software (c) 1995-2008

For more info visit: Innervision Software
Re: Ha I finally have achieved DOF, without pro! [Re: PHeMoX] #93906
10/11/06 22:28
10/11/06 22:28
Joined: Jan 2002
Posts: 4,225
Germany / Essen
Uhrwerk Offline
Expert
Uhrwerk  Offline
Expert

Joined: Jan 2002
Posts: 4,225
Germany / Essen
This is absolutely not necessary. You just have to access the Z-Buffer information, where ever they are. The Z-Buffer information is of course updated every frame. No need to calculate anything.


Always learn from history, to be sure you make the same mistakes again...
Re: Ha I finally have achieved DOF, without pro! [Re: Uhrwerk] #93907
10/11/06 22:30
10/11/06 22:30
Joined: Sep 2002
Posts: 8,177
Netherlands
PHeMoX Offline
Senior Expert
PHeMoX  Offline
Senior Expert

Joined: Sep 2002
Posts: 8,177
Netherlands
Quote:

This is absolutely not necessary. You just have to access the Z-Buffer information, where ever they are. The Z-Buffer information is of course updated every frame. No need to calculate anything.




Yes, but we don't have access to it, that's the problem, unless, like you've asked elsewhere, it's possible to get the depth buffer info through a dll ...

Cheers


PHeMoX, Innervision Software (c) 1995-2008

For more info visit: Innervision Software
Re: Ha I finally have achieved DOF, without pro! [Re: PHeMoX] #93908
10/12/06 00:35
10/12/06 00:35
Joined: Oct 2003
Posts: 4,131
M
Matt_Aufderheide Offline
Expert
Matt_Aufderheide  Offline
Expert
M

Joined: Oct 2003
Posts: 4,131
No, no, you cant get access to the Z-buffer directly... you have to render every object using a shader that outputs the depth..for DOF you really dont want the complete depth range anyway.. here is a basic procedure I think would work:

1) For every object, use a vertex shader that outputs
distance(vertexpos, viewpos)-focus_dist, and
1-(distance(vertexpos, viewpos)+focus_dist)

then scale this value by some number like 0.001.. and multiply them together in the pixel shader. This give you your DOF map.

Now in your final effect, you want a copy of your framebuffer to which you apply a gausian blur. You can either: blur the whole thing and use the depth map to as an inverse alpha map... or actually use the depth map to determine how many gaussian samples you do.. this might be faster if you use PS 3.0 .. however this assumes you use a full size blur map.. i think just using the depth map as an alpha on a reduced blur map is best.

I havent tried this, so it may need some work, but I think the general idea is valid. This could all be done in Pro, albeit probably non-optimally. I would reccomend a dll implementation.. may i will work on this at some point.

Last edited by Matt_Aufderheide; 10/12/06 00:52.

Sphere Engine--the premier A6 graphics plugin.
Re: Ha I finally have achieved DOF, without pro! [Re: Matt_Aufderheide] #93909
10/12/06 05:36
10/12/06 05:36
Joined: Oct 2005
Posts: 4,771
Bay City, MI
lostclimate Offline OP
Expert
lostclimate  Offline OP
Expert

Joined: Oct 2005
Posts: 4,771
Bay City, MI
here is what i hear everyone saying tho..... its slow, or if you have pro and we had access to the z-buffer well


-its slow: actully it ran pretty good on my fx 5200 and thats saying something, yes i realise that its not a complex scene, but then again... fx 5200.... i get like 5fps with sphere also what is your alternative without pro or a dll??? nothing... or at least yet... thats like saying i want mirrored surfaces, but i dont have pro and dont want shaders or a plugin, cuz its slower and uses something not all users have... well.... you dont always get what you want.

-You'd need pro, and access to the z-buffer: well ill answer this in two parts since its kinda a 2-part statement. first off, its meant for comm. users, as for the latter.... you dont have access to it, there is no point talking about it, and if you do, talk about it in a thread in "The Future" or "Ask Conitec" forums.

Re: Ha I finally have achieved DOF, without pro! [Re: lostclimate] #93910
10/12/06 06:08
10/12/06 06:08
Joined: Oct 2003
Posts: 4,131
M
Matt_Aufderheide Offline
Expert
Matt_Aufderheide  Offline
Expert
M

Joined: Oct 2003
Posts: 4,131
OK heres the deal.. it will be very slow when you have it applied to everything in a real application.. get some terrain or whatever.. basically make a real level, and you will see .. the reason is becasue of all the overdraw.

Really.. you are actually rendering every object like 15 times or whatever using that shader.. this is not a good idea. And DOF needs to be applied to every object, not just a few models.. like sky, grass, walls, whatever.

Some effects arent worth doing unless they can be done right..

Last edited by Matt_Aufderheide; 10/12/06 06:11.

Sphere Engine--the premier A6 graphics plugin.
Re: Ha I finally have achieved DOF, without pro! [Re: Matt_Aufderheide] #93911
10/12/06 06:31
10/12/06 06:31
Joined: Oct 2005
Posts: 4,771
Bay City, MI
lostclimate Offline OP
Expert
lostclimate  Offline OP
Expert

Joined: Oct 2005
Posts: 4,771
Bay City, MI
well the passes can be lowered depending how far aways the character has to be before being blurred and still look ok so it currently has 10 passes which makes 10 time the render time right? i think i could get it to five so if you have a game that is not incredibly filled with entities then it could be entirely possible in that aspect as fare as the fact everything has to be done... welll... im working on one thing at the moment that may fix that problem. I doubt it will work tho.

also with the many pass thing the other thing is when an object is blurred the abilitly for a high decrease in polygons and texture is increase greatly, remember the shader is only applied to the far away objects anyways, in fact as far as texture size goes the stretching of a smaller one will only make the blur look better

Page 2 of 3 1 2 3

Moderated by  Blink, Hummel, Superku 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1