|
|
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
Expert
|
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
Expert
|
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]
#123335
04/13/07 06:39
04/13/07 06:39
|
Joined: Jan 2002
Posts: 1,276 trapped in a paper bag
Drew
Serious User
|
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
|
|
|
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
Expert
|
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
Expert
|
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?
|
|
|
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
OP
User
|
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 ^^).
|
|
|
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
Expert
|
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! 
|
|
|
|