DirectX Visualizer
3D Solutions
01 April 2009
©2005-2009 Philips Electronics Ne erlan B.V. 17 of 26
Z-buffer values within the range of interest. Any values outsi e the range of interest are clippe to the
closest extreme of the range of interest.
Option name
Option nameOption name
Option name
Possible values
Possible valuesPossible values
Possible values
Default value
Default valueDefault value
Default value
Description
DescriptionDescription
Description
ZNearInterest floating point value
between 0.0 an
1.0
0.0 Smallest Z-buffer value of interest
ZNearInterestDownKey key isable Key that ecreases ZNearInterest
ZNearInterestUpKey key isable Key that increases ZNearInterest
ZFarInterest floating point value
between 0.0 an
1.0
1.0 Largest Z-buffer value of interest
ZFarInterestDownKey key isable Key that ecreases ZFarInterest
ZFarInterestUpKey key isable Key that increases ZFarInterest
6.12
6.126.12
6.12 Inverse pro ection calculation
By efault the Visualizer will use the inverse of the Direct3D projection matrix to calculate the Z
coor inates from the value in the Z-buffer. If the projection matrix cannot be inverte , an
approximation will be use instea . The Visualizer will write a warning message about this to the log if
logging is enable (see Figure 6). It is recommen e to test the application at least once with logging
enable to see if this warning is given.
En of InitSha ers
Warning: inverse projection matrix not valid; using approximation.
DllMain DLL_THREAD_ATTACH
Warning: Switched back to using inverse projection matrix.
DllMain DLL_THREAD_DETACH
Figure 6: log file fragment including warning
If this warning is generate while the application is showing a 3D scene, then the approximation nee s
to be tune to still result in an acceptable 3D effect. For this purpose DynamicZtoD can be set to 0,
which will force the Visualizer to always use the approximation an allow you to etermine an
acceptable FarNearRatio. The value of FarNearRatio only influences the approximation an has no
effect if the inverse projection matrix is use .
To etermine the appropriate value for FarNearRatio it is recommen e to:
1. run the application with EnableLogging=1, DynamicZtoD=0, EnableDepthTuningHelp=1 an
ZRange keys efine to usable values
2. change the FarNearRatio using the ZRangeUpKey an ZRangeDownKey to fin a satisfactory
value
3. rea the last use FarNearRatio value from the log file
4. set the chosen FarNearRatio value in the configuration file