nxdk_pgraph_tests
A collection of tests for the Xbox nv2a graphics processor
 
Loading...
Searching...
No Matches
FogPlanarVertexShaderTests Class Reference

#include <fog_tests.h>

Inheritance diagram for FogPlanarVertexShaderTests:
Collaboration diagram for FogPlanarVertexShaderTests:

Public Member Functions

 FogPlanarVertexShaderTests (TestHost &host, std::string output_dir, const Config &config)
 
- Public Member Functions inherited from FogCustomShaderTests
 FogCustomShaderTests (TestHost &host, std::string output_dir, const Config &config, std::string suite_name="Fog vsh")
 
void Initialize () override
 Called to initialize the test suite.
 
- Public Member Functions inherited from FogTests
 FogTests (TestHost &host, std::string output_dir, const Config &config, std::string suite_name="Fog")
 
void Initialize () override
 Called to initialize the test suite.
 
void Deinitialize () override
 Called to tear down the test suite.
 
- Public Member Functions inherited from TestSuite
 TestSuite (TestHost &host, std::string output_dir, std::string suite_name, const Config &config, bool interactive_only=false)
 
const std::string & Name () const
 
virtual void SetupTest ()
 Called before running an individual test within this suite.
 
virtual void TearDownTest ()
 Called after running an individual test within this suite.
 
void DisableTests (const std::set< std::string > &tests_to_skip)
 
std::vector< std::string > TestNames () const
 
bool HasEnabledTests () const
 
void Run (const std::string &test_name, uint32_t test_index=0, uint32_t total_tests=0)
 
void RunAll (bool include_interactive)
 
bool IsInteractiveOnly () const
 
void SetSavingAllowed (bool enable=true)
 

Protected Member Functions

void CreateGeometry () override
 
- Protected Member Functions inherited from FogTests
void Test (FogMode fog_mode, FogGenMode gen_mode, uint32_t fog_alpha)
 
- Protected Member Functions inherited from TestSuite
void SetDefaultTextureFormat () const
 
void FinishDraw (const std::string &name, bool save_zbuffer=false)
 
void FinishDrawNoSave (const std::string &name, bool save_zbuffer=false)
 

Additional Inherited Members

- Public Types inherited from FogTests
enum  FogMode {
  FOG_LINEAR = NV097_SET_FOG_MODE_V_LINEAR , FOG_EXP = NV097_SET_FOG_MODE_V_EXP , FOG_EXP2 = NV097_SET_FOG_MODE_V_EXP2 , FOG_EXP_ABS = NV097_SET_FOG_MODE_V_EXP_ABS ,
  FOG_EXP2_ABS = NV097_SET_FOG_MODE_V_EXP2_ABS , FOG_LINEAR_ABS = NV097_SET_FOG_MODE_V_LINEAR_ABS
}
 
enum  FogGenMode {
  FOG_GEN_SPEC_ALPHA = NV097_SET_FOG_GEN_MODE_V_SPEC_ALPHA , FOG_GEN_RADIAL = NV097_SET_FOG_GEN_MODE_V_RADIAL , FOG_GEN_PLANAR = NV097_SET_FOG_GEN_MODE_V_PLANAR , FOG_GEN_ABS_PLANAR = NV097_SET_FOG_GEN_MODE_V_ABS_PLANAR ,
  FOG_GEN_FOG_X = NV097_SET_FOG_GEN_MODE_V_FOG_X
}
 
- Static Public Member Functions inherited from TestSuite
static void TagNV2ATrace (uint32_t num_nops)
 Inserts a pattern of NV097_NO_OPERATION's into the pushbuffer to allow identification when viewing nv2a traces.
 
- Static Protected Member Functions inherited from FogTests
static std::string MakeTestName (FogMode fog_mode, FogGenMode gen_mode, uint32_t fog_alpha)
 
- Protected Attributes inherited from FogTests
std::shared_ptr< VertexBuffer > vertex_buffer_
 
- Protected Attributes inherited from TestSuite
TestHost & host_
 
std::string output_dir_
 
std::string suite_name_
 
bool interactive_only_
 
bool allow_saving_ {true}
 
std::map< std::string, std::function< void()> > tests_ {}
 
std::set< std::string > interactive_only_tests_ {}
 
PGRAPHDiffToken pgraph_diff_
 
bool enable_progress_log_
 
bool enable_pgraph_region_diff_
 
uint32_t delay_milliseconds_between_tests_
 
std::shared_ptr< FTPLogger > ftp_logger_
 

Detailed Description

Tests planar fog coordinate generation and evaluation when using a programmable vertex shader.

Reproduces the planar fog configuration used in Tron 2.0 loading screen / glow blur passes, verifying whether NV2A hardware clamps Fog.a to [0, 1] when linear fog parameters yield a factor > 1.0, whether FOG_GEN_MODE_V_PLANAR vs V_FOG_X alters vertex shader fog coordinate evaluation, and how oFog values map to Fog.a under linear fogging.

Constructor & Destructor Documentation

◆ FogPlanarVertexShaderTests()

FogPlanarVertexShaderTests::FogPlanarVertexShaderTests ( TestHost &  host,
std::string  output_dir,
const Config &  config 
)

Constructs the test suite and creates test cases reproducing the planar fog configuration used during the Tron 2.0 loading screen / glow blur passes.

Remarks
ZeroPlane_RCP1_Planar Reproduces the exact Tron 2.0 glow accumulation pass fog setup: linear fog mode, planar gen mode with a zero plane (0,0,0,0), parameters bias = 2.48148155, multiplier = -0.0007407407, and vertex shader setting oFog via rcp oFog, 1.0. Tests whether hardware clamps Fog.a to 1.0 or evaluates planar fog differently.
ZeroPlane_RCP1_FogX Same as ZeroPlane_RCP1_Planar but using FOG_GEN_MODE_V_FOG_X, testing whether planar vs fog_x generation mode alters vertex shader fog coordinate handling.
ZeroPlane_MOV1_Planar Same as ZeroPlane_RCP1_Planar but using mov oFog, 1.0 instead of rcp, verifying that the instruction opcode does not affect the fog unit.
ZeroPlane_RCP0_Planar Tests planar fog with zero plane when the vertex shader sets oFog via rcp oFog, 0.0 (+inf), verifying saturation to full fog.
Sweep_Planar Displays Fog.a directly as grayscale across a sweep of oFog values (0.0, 1.0, 650.0, 1000.0, 1325.0, 1650.0, 2000.0, 2500.0) under Tron 2.0 linear fog parameters using FOG_GEN_MODE_V_PLANAR.
Sweep_FogX Displays Fog.a directly as grayscale across the same oFog sweep using FOG_GEN_MODE_V_FOG_X for comparison with planar mode.

Member Function Documentation

◆ CreateGeometry()

void FogPlanarVertexShaderTests::CreateGeometry ( )
overrideprotectedvirtual

Reimplemented from FogTests.


The documentation for this class was generated from the following files: