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

#include <material_color_source_tests.h>

Inheritance diagram for MaterialColorSourceTests:
Collaboration diagram for MaterialColorSourceTests:

Public Types

enum  SourceMode { SOURCE_MATERIAL , SOURCE_DIFFUSE , SOURCE_SPECULAR }
 

Public Member Functions

 MaterialColorSourceTests (TestHost &host, std::string output_dir, const Config &config)
 
void Initialize () override
 Called to initialize the test suite.
 
- Public Member Functions inherited from TestSuite
 TestSuite (TestHost &host, std::string output_dir, std::string suite_name, const Config &config)
 
const std::string & Name () const
 
virtual void Deinitialize ()
 Called to tear down the test suite.
 
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)
 
void RunAll ()
 
void SetSavingAllowed (bool enable=true)
 

Additional Inherited Members

- 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.
 
- Protected Member Functions inherited from TestSuite
void SetDefaultTextureFormat () const
 
- Protected Attributes inherited from TestSuite
TestHosthost_
 
std::string output_dir_
 
std::string suite_name_
 
bool allow_saving_ {true}
 
std::map< std::string, std::function< void()> > tests_ {}
 
PGRAPHDiffToken pgraph_diff_
 
bool enable_progress_log_
 
bool enable_pgraph_region_diff_
 
uint32_t delay_milliseconds_between_tests_
 
std::shared_ptr< FTPLoggerftp_logger_
 

Detailed Description

Tests behavior when lighting is enabled and color components are requested from various sources. Also tests the behavior of non-zero NV097_SET_MATERIAL_EMISSION values.

A color legend is rendered along the left hand side: vD = vertex diffuse. vS = vertex specular. sA = scene ambient. mD = material diffuse. mS = material specular. mE = material emissive. mA = material ambient. A single directional light is used with ambient, diffuse, and specular multipliers all set to 1.0.

NV097_SET_SCENE_AMBIENT_COLOR is set to scene ambient + material emissive.

Constructor & Destructor Documentation

◆ MaterialColorSourceTests()

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

Initializes the test suite and creates test cases.

Remarks
FromMaterial Draws 9 quads with all colors taken from the material settings. Each quad is divided into rows: the top is just diffuse, the center is just specular, the bottom is both. It is also divided into columns: the left column retains material alpha, the right forces alpha to 1.0.
FromVertexDiffuse Draws 9 quads with some colors taken from the vertex diffuse color {0.f, 0.25f, 0.5f, 0.25f}. Each quad is divided into rows: the top is just diffuse, the center is just specular, the bottom is both. It is also divided into columns: the left column retains material alpha, the right forces alpha to 1.0.
FromVertexSpecular Draws 9 quads with some colors taken from the vertex specular color {0.5f, 0.25f, 0.f, 0.25f}. Each quad is divided into rows: the top is just diffuse, the center is just specular, the bottom is both. It is also divided into columns: the left column retains material alpha, the right forces alpha to 1.0.
FromMaterial_me0_15 Draws 9 quads with all colors taken from the material settings. Each quad is divided into rows: the top is just diffuse, the center is just specular, the bottom is both. It is also divided into columns: the left column retains material alpha, the right forces alpha to 1.0. NV097_SET_MATERIAL_EMISSION is set to (0.15, 0.15, 0.15).
FromVertexDiffuse_me0_15 Draws 9 quads with some colors taken from the vertex diffuse color {0.f, 0.25f, 0.5f, 0.25f}. Each quad is divided into rows: the top is just diffuse, the center is just specular, the bottom is both. It is also divided into columns: the left column retains material alpha, the right forces alpha to 1.0. NV097_SET_MATERIAL_EMISSION is set to (0.15, 0.15, 0.15).
FromVertexSpecular_me0_15 Draws 9 quads with some colors taken from the vertex specular color {0.5f, 0.25f, 0.f, 0.25f}. Each quad is divided into rows: the top is just diffuse, the center is just specular, the bottom is both. It is also divided into columns: the left column retains material alpha, the right forces alpha to 1.0. NV097_SET_MATERIAL_EMISSION is set to (0.15, 0.15, 0.15).
FromMaterial_me0_5 Draws 9 quads with all colors taken from the material settings. Each quad is divided into rows: the top is just diffuse, the center is just specular, the bottom is both. It is also divided into columns: the left column retains material alpha, the right forces alpha to 1.0. NV097_SET_MATERIAL_EMISSION is set to (0.5, 0.5, 0.5).
FromVertexDiffuse_me0_5 Draws 9 quads with some colors taken from the vertex diffuse color {0.f, 0.25f, 0.5f, 0.25f}. Each quad is divided into rows: the top is just diffuse, the center is just specular, the bottom is both. It is also divided into columns: the left column retains material alpha, the right forces alpha to 1.0. NV097_SET_MATERIAL_EMISSION is set to (0.5, 0.5, 0.5).
FromVertexSpecular_me0_5 Draws 9 quads with some colors taken from the vertex specular color {0.5f, 0.25f, 0.f, 0.25f}. Each quad is divided into rows: the top is just diffuse, the center is just specular, the bottom is both. It is also divided into columns: the left column retains material alpha, the right forces alpha to 1.0. NV097_SET_MATERIAL_EMISSION is set to (0.5, 0.5, 0.5).
FromMaterial_me1_0 Draws 9 quads with all colors taken from the material settings. Each quad is divided into rows: the top is just diffuse, the center is just specular, the bottom is both. It is also divided into columns: the left column retains material alpha, the right forces alpha to 1.0. Each quad is broken into thirds: the top is just diffuse, the center is just specular, the bottom is both. NV097_SET_MATERIAL_EMISSION is set to (1, 1, 1).
FromVertexDiffuse_me1_0 Draws 9 quads with some colors taken from the vertex diffuse color {0.f, 0.25f, 0.5f, 0.25f}. Each quad is divided into rows: the top is just diffuse, the center is just specular, the bottom is both. It is also divided into columns: the left column retains material alpha, the right forces alpha to 1.0. NV097_SET_MATERIAL_EMISSION is set to (1, 1, 1).
FromVertexSpecular_me1_0 Draws 9 quads with some colors taken from the vertex specular color {0.5f, 0.25f, 0.f, 0.25f}. Each quad is divided into rows: the top is just diffuse, the center is just specular, the bottom is both. It is also divided into columns: the left column retains material alpha, the right forces alpha to 1.0. NV097_SET_MATERIAL_EMISSION is set to (1, 1, 1).
FromMaterial_2light Draws 9 quads with all colors taken from the material settings. Each quad is divided into rows: the top is just diffuse, the center is just specular, the bottom is both. It is also divided into columns: the left column retains material alpha, the right forces alpha to 1.0. There are two lights with all colors set to (0.25, 0.25, 0.25).
FromVertexDiffuse_2light Draws 9 quads with some colors taken from the vertex diffuse color {0.f, 0.25f, 0.5f, 0.25f}. Each quad is divided into rows: the top is just diffuse, the center is just specular, the bottom is both. It is also divided into columns: the left column retains material alpha, the right forces alpha to 1.0. There are two lights with all colors set to (0.25, 0.25, 0.25).
FromVertexSpecular_2light Draws 9 quads with some colors taken from the vertex specular color {0.5f, 0.25f, 0.f, 0.25f}. Each quad is divided into rows: the top is just diffuse, the center is just specular, the bottom is both. It is also divided into columns: the left column retains material alpha, the right forces alpha to 1.0. There are two lights with all colors set to (0.25, 0.25, 0.25).
FromMaterial_me0_15_2light Draws 9 quads with all colors taken from the material settings. Each quad is divided into rows: the top is just diffuse, the center is just specular, the bottom is both. It is also divided into columns: the left column retains material alpha, the right forces alpha to 1.0. NV097_SET_MATERIAL_EMISSION is set to (0.15, 0.15, 0.15). There are two lights with all colors set to (0.25, 0.25, 0.25).
FromVertexDiffuse_me0_15_2light Draws 9 quads with some colors taken from the vertex diffuse color {0.f, 0.25f, 0.5f, 0.25f}. Each quad is divided into rows: the top is just diffuse, the center is just specular, the bottom is both. It is also divided into columns: the left column retains material alpha, the right forces alpha to 1.0. NV097_SET_MATERIAL_EMISSION is set to (0.15, 0.15, 0.15). There are two lights with all colors set to (0.25, 0.25, 0.25).
FromVertexSpecular_me0_15_2light Draws 9 quads with some colors taken from the vertex specular color {0.5f, 0.25f, 0.f, 0.25f}. Each quad is divided into rows: the top is just diffuse, the center is just specular, the bottom is both. It is also divided into columns: the left column retains material alpha, the right forces alpha to 1.0. NV097_SET_MATERIAL_EMISSION is set to (0.15, 0.15, 0.15). There are two lights with all colors set to (0.25, 0.25, 0.25).
FromMaterial_me0_5_2light Draws 9 quads with all colors taken from the material settings. Each quad is divided into rows: the top is just diffuse, the center is just specular, the bottom is both. It is also divided into columns: the left column retains material alpha, the right forces alpha to 1.0. NV097_SET_MATERIAL_EMISSION is set to (0.5, 0.5, 0.5). There are two lights with all colors set to (0.25, 0.25, 0.25).
FromVertexDiffuse_me0_5_2light Draws 9 quads with some colors taken from the vertex diffuse color {0.f, 0.25f, 0.5f, 0.25f}. Each quad is divided into rows: the top is just diffuse, the center is just specular, the bottom is both. It is also divided into columns: the left column retains material alpha, the right forces alpha to 1.0. NV097_SET_MATERIAL_EMISSION is set to (0.5, 0.5, 0.5). There are two lights with all colors set to (0.25, 0.25, 0.25).
FromVertexSpecular_me0_5_2light Draws 9 quads with some colors taken from the vertex specular color {0.5f, 0.25f, 0.f, 0.25f}. Each quad is divided into rows: the top is just diffuse, the center is just specular, the bottom is both. It is also divided into columns: the left column retains material alpha, the right forces alpha to 1.0. NV097_SET_MATERIAL_EMISSION is set to (0.5, 0.5, 0.5). There are two lights with all colors set to (0.25, 0.25, 0.25).
FromMaterial_me1_0_2light Draws 9 quads with all colors taken from the material settings. Each quad is divided into rows: the top is just diffuse, the center is just specular, the bottom is both. It is also divided into columns: the left column retains material alpha, the right forces alpha to 1.0. Each quad is broken into thirds: the top is just diffuse, the center is just specular, the bottom is both. NV097_SET_MATERIAL_EMISSION is set to (1, 1, 1). There are two lights with all colors set to (0.25, 0.25, 0.25).
FromVertexDiffuse_me1_0_2light Draws 9 quads with some colors taken from the vertex diffuse color {0.f, 0.25f, 0.5f, 0.25f}. Each quad is divided into rows: the top is just diffuse, the center is just specular, the bottom is both. It is also divided into columns: the left column retains material alpha, the right forces alpha to 1.0. NV097_SET_MATERIAL_EMISSION is set to (1, 1, 1). There are two lights with all colors set to (0.25, 0.25, 0.25).
FromVertexSpecular_me1_0_2light Draws 9 quads with some colors taken from the vertex specular color {0.5f, 0.25f, 0.f, 0.25f}. Each quad is divided into rows: the top is just diffuse, the center is just specular, the bottom is both. It is also divided into columns: the left column retains material alpha, the right forces alpha to 1.0. NV097_SET_MATERIAL_EMISSION is set to (1, 1, 1). There are two lights with all colors set to (0.25, 0.25, 0.25).
Emissive_me0 Draws 9 quads with combinations of emissive and ambient color taken from vertex diffuse and specular. The combinations in (emissive_src, ambient_src) format are: (D, D), (S, D), (D, S), (S, S), (M, S), (S, M), (M, D), (D, M), (M, M). Each quad is divided into rows: the top is just diffuse, the center is just specular, the bottom is both. It is also divided into columns: the left column retains material alpha, the right forces alpha to 1.0. NV097_SET_MATERIAL_EMISSION is set to (0, 0, 0).

Member Function Documentation

◆ Initialize()

void MaterialColorSourceTests::Initialize ( )
overridevirtual

Called to initialize the test suite.

Reimplemented from TestSuite.


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