DoF not dynamically adjusting

Posted By: Metal_Thrasher

DoF not dynamically adjusting - 09/14/08 15:30

I think this is right forum to post this in, maybe not. If not I hope a mod will move this.
I'm using a DoF code by Slin. And I'm trying to have it dynamicaly adjust according to what the player is looking at. I do this through a c_trace. It's been a while, and long while, since I've used 3DGS. So maybe somebody could explain to me why this code dosen't work
Code:
 void calc_dof()
{
	PP_DoF_init(camera,500,1000,1000,30,2);
	while(1)
	{
		c_trace(camera.x, vector(camera.x, camera.y, camera.z-1000),0);
		
		PP_DoF_SetValues(target.x,target.x+500,1000,30,2);
		//beep();
		wait(1);
	} 


When I had the beep uncommented it was beeping, so I know the code is working to that extent, but the focus is not adjusting.

By the way the parameters for the DoF are this in Slin's code:
Code:
 		PP_DoF_SetValues(NearPlaneDist,FarPlaneDist,FarFadeoutDist,BlurRadius,DownsampleFaktor); 

Posted By: TWO

Re: DoF not dynamically adjusting - 09/14/08 15:57

You trace directly at the bottom under the camera.

Code:
VECTOR target;
target.x = 1000;
target.y = 0;
target.z = 0;
vec_rotate( target, camera.pan );
vec_add( target, camera.x );

c_trace(camera.x, target,0);

Posted By: Metal_Thrasher

Re: DoF not dynamically adjusting - 09/14/08 16:02

Oh damn, thanks. That was stupid mistake. But still it isnt giving the effect I thought it would. The screen is blurry like it should be. But if I understand this right. By adjusting the near and far plane in the DoF parameters shouldn't it by all rights focus on the area between?
Posted By: Slin

Re: DoF not dynamically adjusting - 09/16/08 18:56

It seems as if there is a problem with some hardware which causes this not to wok properly...
Posted By: Metal_Thrasher

Re: DoF not dynamically adjusting - 09/18/08 13:08

I have a really nice nvidia card. Like I said I get the blurry screen...but no appearent "depth". Was it just poorly designed code? I mean as far as different video cards go?
© 2024 lite-C Forums