Game Development Community

T3D 1.2 - Weapon Zoom Bug - Depth of Field Problem? - NOT A BUG

by Joe Melton · in Torque 3D Professional · 11/30/2011 (11:18 pm) · 4 replies

I noticed this when playing around with the weapon zoom. This is a new project, default settings. Nothing has been changed yet.

As the barrel of the weapon approaches the horizon, the image becomes blurred. However, when I look back down, the image becomes clear again.

Edit: Also noticed that if I'm in third person and rotate the camera so it looks above the horizon, the same effect happens to the visible player.




#1
12/01/2011 (12:54 am)
This is just the game's DOF, focusing on objects that the crosshair is set upon.

It may be that the DOF system focuses based off whatever the crosshair is on's position, and not the crosshair's collision point.

look for "function DOFPostEffect::autoFocus( %this )"

It shows that when the raycast hits nothing, it sets the focus to "farDist", which is effectively setting your focus to an object 20 KM away.

The horizon is much closer than that.

The "fardist" is based upon the camera's farclipplane.

line 769 of postEffect.cpp : Con::setFloatVariable( "$Param::FarDist", state->getFarPlane() );

I suppose a fix can be that you change that so it sources "fardist" from a pref, rather than the farclipplane.
#2
12/01/2011 (9:50 am)
This is not a bug, this is how the zoom with the post effect enabled has always worked. The post effect requires that an object be there for you to focus on. No object, no focus and the sky is not an object.
#3
12/01/2011 (11:19 pm)
So won't that mean that in games where you might have to focus on objects that are in the sky, but those objects are moving making it hard to focus on them, that the blur will then become a problem? At that point, wouldn't adjustments to the engine code have to be made to resolve that problem? If those adjustments had to be made to make the problem go away, would that not constitute a bug?

Not trying to be annoying; I'm just trying to make sure I am understanding. =D
#4
12/02/2011 (7:45 am)
I agree with Joe; I reckon it would make sense for the default behaviour (no object targeted) would be not to blur everything nearby.