Gamestudio Links
Zorro Links
Newest Posts
Newbie Questions
by fairtrader. 12/05/23 10:32
Zorro Trader GPT
by TipmyPip. 12/04/23 11:34
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
6 registered members (AndrewAMD, alibaba, fairtrader, ozgur, TipmyPip, Quad), 604 guests, and 1 spider.
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 4 1 2 3 4
Re: real Depth of Field Shader for A6 Com/Pro [Re: Drew] #123332
04/13/07 05:46
04/13/07 05:46
Joined: Mar 2006
Posts: 2,503
SC, United States
xXxGuitar511 Offline
Expert
xXxGuitar511  Offline
Expert

Joined: Mar 2006
Posts: 2,503
SC, United States
Without going through the code, how does it work?

Are you rendering the objects with a pixel-shader and rendering the distance per-pixel in one view, and then sending those results to a PP shader to be used in another?


xXxGuitar511
- Programmer
Re: real Depth of Field Shader for A6 Com/Pro [Re: xXxGuitar511] #123333
04/13/07 06:11
04/13/07 06:11
Joined: Mar 2006
Posts: 2,503
SC, United States
xXxGuitar511 Offline
Expert
xXxGuitar511  Offline
Expert

Joined: Mar 2006
Posts: 2,503
SC, United States
I like it, but it is WAY TOO SLOW...

I also think there's a better way for calculating depth. I'm gonna mess with it a bit...


EDIT:

You should be able to multiply the inPos by matWorld to get the world position, and then distance() from vecViewPos*matWorld

This should give you the distance from the camera to the pixel. But this method would also be slower...

Last edited by xXxGuitar511; 04/13/07 06:13.

xXxGuitar511
- Programmer
Re: real Depth of Field Shader for A6 Com/Pro [Re: xXxGuitar511] #123334
04/13/07 06:27
04/13/07 06:27
Joined: Jul 2001
Posts: 6,904
H
HeelX Offline
Senior Expert
HeelX  Offline
Senior Expert
H

Joined: Jul 2001
Posts: 6,904
I can't run this:

Quote:


engine version: V6.50.3 - Dec 6 2006
Malfunction W1523: SLX3Initialize not found in DLL...
Malfunction W1523: SLX3ViewRegister not found in DLL
Malfunction W1523: SLX3ViewSetRTT not found in DLL
Malfunction W1523: SLX3TexCreate not found in DLL
Malfunction W1523: SLX3TexSetFormat not found in DLL
Malfunction W1523: SLX3TexSetSize not found in DLL
Malfunction W1523: SLX3TexSetUsage not found in DLL
Malfunction W1523: SLX3TexSetViewID not found in DLL
...





It would be better if you could do a standalone version that runs without this sylex stuff (for pro) - or what should I do to run this?

Re: real Depth of Field Shader for A6 Com/Pro [Re: xXxGuitar511] #123335
04/13/07 06:39
04/13/07 06:39
Joined: Jan 2002
Posts: 1,276
trapped in a paper bag
Drew Offline
Serious User
Drew  Offline
Serious User

Joined: Jan 2002
Posts: 1,276
trapped in a paper bag
Quote:

I like it, but it is WAY TOO SLOW...

I also think there's a better way for calculating depth. I'm gonna mess with it a bit...


EDIT:

You should be able to multiply the inPos by matWorld to get the world position, and then distance() from vecViewPos*matWorld

This should give you the distance from the camera to the pixel. But this method would also be slower...



wow really? MIne is fast... unless I have more than one character casting a shadow...
I have a core duo wth a geforce Go 7900 GS


Drew Medina
Game Developer (Artist)
Personal & professional website
Deviant Art
My Blogspot
Re: real Depth of Field Shader for A6 Com/Pro [Re: Drew] #123336
04/13/07 06:51
04/13/07 06:51
Joined: Mar 2006
Posts: 2,503
SC, United States
xXxGuitar511 Offline
Expert
xXxGuitar511  Offline
Expert

Joined: Mar 2006
Posts: 2,503
SC, United States
I have an older NVidia 5700 LE

lol... it's not bad, but it ain't good either...


xXxGuitar511
- Programmer
Re: real Depth of Field Shader for A6 Com/Pro [Re: HeelX] #123337
04/13/07 09:20
04/13/07 09:20
Joined: Aug 2001
Posts: 2,320
Alberta, Canada
William Offline
Expert
William  Offline
Expert

Joined: Aug 2001
Posts: 2,320
Alberta, Canada
Thanks for this great DOF, it runs very fast!

If your having dll trouble, be sure that your sylex.dll is included in your acknex plugins folder.

Although it works great in the demo, when I try applying it to my project, I noticed that it doesn't work with Sphere. If I initialize Spheres render loop, the DOF won't work. I use Sphere for bloom. If I turn off Sphere, it works great.

Is Sylex causing this? Would the usage of render-to-texture fix it?


Check out Silas. www.kartsilas.com

Hear my band Finding Fire - www.myspace.com/findingfire

Daily dev updates - http://kartsilas.blogspot.com/
Re: real Depth of Field Shader for A6 Com/Pro [Re: William] #123338
04/13/07 09:40
04/13/07 09:40
Joined: Jul 2003
Posts: 893
Melbourne, Australia
Matt_Coles Offline

User
Matt_Coles  Offline

User

Joined: Jul 2003
Posts: 893
Melbourne, Australia
You're my hero lol. 5 stars, I've been dying for this effect for 2 years and have almost swapped engines 4 times because of it

Re: real Depth of Field Shader for A6 Com/Pro [Re: Matt_Coles] #123339
04/13/07 11:27
04/13/07 11:27
Joined: Jun 2004
Posts: 655
to your left
BoH_Havoc Offline OP
User
BoH_Havoc  Offline OP
User

Joined: Jun 2004
Posts: 655
to your left
Quote:

Are you rendering the objects with a pixel-shader and rendering the distance per-pixel in one view, and then sending those results to a PP shader to be used in another?




Aye, that's the way it's done. A depthmap of the entities get rendered to a 2nd view which is then passed to the DoF shader.

As for the shader being slow: Well....yes. Thats because all objects get rendered twice. However, i have another DoF shader laying around here which uses only one rendertarget and gaussian blur. That one might be faster (it's definately prettier that's for sure ^^). However I am still in the process of converting it to work with 3dgs. Until i get this shader done, you could try to reduce the number of taps in real_DoF.fx from 8 to 4 or 2:

Code:
 
float2 tap[8]; ---> float2 tap[4];
float4 Color[8]; ---> float4 Color[4];
float2 Depth[8]; ---> float2 Depth[4];
.
.
.
for(int i=0; i<8; i++) ---> for(int i=0; i<4; i++)



That should increase the speed, i think.



As for Sylex and Sphere: No, they don't work together. Xexes and Matt had some argues about this in the past if i remember correctly
To use it in A6 Pro...i don't know...in the shaders you have to change effTex1 and postTex1 to the A6 Pro equivalents and also do some c-script stuff to create rendertargets. I don't have Pro, so i ca't figure this out. I'm sorry


[edit] I got a plus of ~20 frames by removing fps_max and fps_min in vars.wdl. Try that, too. I also noticed that there is a lot of junk which is of no use for you in vars.wdl. You can delete everything after "var mouse_range = 10000;" (and you can also delete that line,too ^^).


Shade-C EVO Lite-C Shader Framework
Re: real Depth of Field Shader for A6 Com/Pro [Re: BoH_Havoc] #123340
04/13/07 12:29
04/13/07 12:29
Joined: Aug 2001
Posts: 2,320
Alberta, Canada
William Offline
Expert
William  Offline
Expert

Joined: Aug 2001
Posts: 2,320
Alberta, Canada
Quote:


As for Sylex and Sphere: No, they don't work together. Xexes and Matt had some argues about this in the past if i remember correctly
To use it in A6 Pro...i don't know...in the shaders you have to change effTex1 and postTex1 to the A6 Pro equivalents and also do some c-script stuff to create rendertargets. I don't have Pro, so i ca't figure this out.




This should work with A6pro/Sphere though, cause all you need is the render-to-textures? Maybe that's why Sphere doesn't work(conflicting render targets perhaps). Though, I don't know a whole lot about this.

Also, I think there seems to be a problem with the distance when using shader model 3.0. With these values -

float front = 16100; // play with this
float back = 62100; // play with this

It seems to fade fine a first, but sometimes it doesn't work when you keep moving back with the camera and the such(blur dissapears or suddenly appears). And wow... beyond that, does the 3.0 version ever make a big quality difference!


Check out Silas. www.kartsilas.com

Hear my band Finding Fire - www.myspace.com/findingfire

Daily dev updates - http://kartsilas.blogspot.com/
Re: real Depth of Field Shader for A6 Com/Pro [Re: William] #123341
04/13/07 13:01
04/13/07 13:01
Joined: Jul 2001
Posts: 6,904
H
HeelX Offline
Senior Expert
HeelX  Offline
Senior Expert
H

Joined: Jul 2001
Posts: 6,904
I tested it now on 2 different computers and I can't get it to run. Would you please compile a demo with an .exe and not uncompiled stuff .. ?

Thanks a lot.

Page 2 of 4 1 2 3 4

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