#include <specular_back_tests.h>
Public Member Functions | |
SpecularBackTests (TestHost &host, std::string output_dir, const Config &config) | |
void | Initialize () override |
Called to initialize the test suite. | |
void | Deinitialize () override |
Called to tear down the test suite. | |
![]() | |
TestSuite (TestHost &host, std::string output_dir, std::string suite_name, const Config &config) | |
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) |
void | RunAll () |
void | SetSavingAllowed (bool enable=true) |
Additional Inherited Members | |
![]() | |
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. | |
![]() | |
void | SetDefaultTextureFormat () const |
![]() | |
TestHost & | host_ |
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< FTPLogger > | ftp_logger_ |
Tests handling of back specular color with interesting combinations of lighting settings and specular params.
SpecularBackTests::SpecularBackTests | ( | TestHost & | host, |
std::string | output_dir, | ||
const Config & | config | ||
) |
Initializes the test suite and creates test cases.
Demonstrates that setting NV097_SET_LIGHT_TWO_SIDE_ENABLE will cause specular and diffuse channels to be {0, 0, 0, 1} for back facing polygons even with lighting disbled.
Renders two groups of two rows of 4 quads each with the fixed function pipeline. The first row is the specular component, the second is the diffuse. Lighting is disabled.
Each quad has back specular and back diffuse colors of:
UL: {1.f, 0.f, 0.0f, 0.15f}, {0.5f, 0.f, 0.f, 1.f} UR: {1.f, 0.f, 0.0f, 0.75f}, {0.75f, 0.f, 0.f, 1.f} LR: {0.f, 1.f, 0.0f, 1.f}, {1.f, 0.f, 0.f, 1.f} LL: {0.f, 1.f, 0.0f, 0.20f}, {0.25f, 0.f, 0.f, 1.f}
Front specular is set to {0.f, 0.f, 1.f, 0.33f} and diffuse {0.0f, 1.0f, 0.5f, 1.0f}.
The upper two rows have SET_SPECULAR_ENABLE = false. The lower rows have it true. The first column has SET_LIGHT_CONTROL = SEPARATE_SPECULAR + ALPHA_FROM_MATERIAL_SPECULAR The second has SET_LIGHT_CONTROL = SEPARATE_SPECULAR The third has SET_LIGHT_CONTROL = ALPHA_FROM_MATERIAL_SPECULAR The fourth has SET_LIGHT_CONTROL = 0
Demonstrates that SET_SPECULAR_ENABLE = false forces back specular values to {0, 0, 0, 1}. Also demonstrates that failing to set ALPHA_FROM_MATERIAL_SPECULAR will cause the specular alpha to be set to 1. The vertex shader back color outputs are applied directly.
Renders two groups of two rows of 4 quads each with the fixed function pipeline. The first row is the specular component, the second is the diffuse. Lighting is disabled.
Each quad has back specular and back diffuse colors of:
UL: {1.f, 0.f, 0.0f, 0.15f}, {0.5f, 0.f, 0.f, 1.f} UR: {1.f, 0.f, 0.0f, 0.75f}, {0.75f, 0.f, 0.f, 1.f} LR: {0.f, 1.f, 0.0f, 1.f}, {1.f, 0.f, 0.f, 1.f} LL: {0.f, 1.f, 0.0f, 0.20f}, {0.25f, 0.f, 0.f, 1.f}
Front specular is set to {0.f, 0.f, 1.f, 0.33f} and diffuse {0.0f, 1.0f, 0.5f, 1.0f}.
The upper row has SET_SPECULAR_ENABLE = false. The lower row has it true. The first column has SET_LIGHT_CONTROL = SEPARATE_SPECULAR + ALPHA_FROM_MATERIAL_SPECULAR The second has SET_LIGHT_CONTROL = SEPARATE_SPECULAR The third has SET_LIGHT_CONTROL = ALPHA_FROM_MATERIAL_SPECULAR The fourth has SET_LIGHT_CONTROL = 0
Demonstrates that SET_SPECULAR_ENABLE = false forces specular values to {0, 0, 0, 1}. Also demonstrates that failing to set ALPHA_FROM_MATERIAL_SPECULAR will cause the specular alpha to be set to 1 and failing to set SEPARATE_SPECULAR will pass through vertex front specular RGB in the specular channel instead of performing the light calculation (which is black due to lack of light). Diffuse alpha is defined via SET_MATERIAL_ALPHA_BACK.
Renders two groups of two rows of 4 quads each with the fixed function pipeline. The first row is the specular component, the second is the diffuse. Lighting is enabled but no light exists.
Each quad has back specular and back diffuse colors of:
UL: {1.f, 0.f, 0.0f, 0.15f}, {0.5f, 0.f, 0.f, 1.f} UR: {1.f, 0.f, 0.0f, 0.75f}, {0.75f, 0.f, 0.f, 1.f} LR: {0.f, 1.f, 0.0f, 1.f}, {1.f, 0.f, 0.f, 1.f} LL: {0.f, 1.f, 0.0f, 0.20f}, {0.25f, 0.f, 0.f, 1.f}
Front specular is set to {0.f, 0.f, 1.f, 0.33f} and diffuse {0.0f, 1.0f, 0.5f, 1.0f}.
The upper row has SET_SPECULAR_ENABLE = false. The lower row has it true. The first column has SET_LIGHT_CONTROL = SEPARATE_SPECULAR + ALPHA_FROM_MATERIAL_SPECULAR The second has SET_LIGHT_CONTROL = SEPARATE_SPECULAR The third has SET_LIGHT_CONTROL = ALPHA_FROM_MATERIAL_SPECULAR The fourth has SET_LIGHT_CONTROL = 0
Because lighting is enabled, the diffuse alpha is entirely dictated by SET_MATERIAL_ALPHA, and RGB is entirely set by the lighting calculations.
Demonstrates that SET_SPECULAR_ENABLE = false forces specular values to {0, 0, 0, 1}. Also demonstrates that failing to set ALPHA_FROM_MATERIAL_SPECULAR will cause the back specular alpha to be set to 1 and failing to set SEPARATE_SPECULAR will pass through vertex back specular RGB in the specular channel instead of performing the light calculation (which is black due to lack of light). Diffuse alpha is defined via SET_MATERIAL_ALPHA_BACK.
Renders two groups of two rows of 4 quads each with the fixed function pipeline. The first row is the specular component, the second is the diffuse. Lighting is enabled but no light exists.
Each quad has back specular and back diffuse colors of:
UL: {1.f, 0.f, 0.0f, 0.15f}, {0.5f, 0.f, 0.f, 1.f} UR: {1.f, 0.f, 0.0f, 0.75f}, {0.75f, 0.f, 0.f, 1.f} LR: {0.f, 1.f, 0.0f, 1.f}, {1.f, 0.f, 0.f, 1.f} LL: {0.f, 1.f, 0.0f, 0.20f}, {0.25f, 0.f, 0.f, 1.f}
Front specular is set to {0.f, 0.f, 1.f, 0.33f} and diffuse {0.0f, 1.0f, 0.5f, 1.0f}.
The upper row has SET_SPECULAR_ENABLE = false. The lower row has it true. The first column has SET_LIGHT_CONTROL = SEPARATE_SPECULAR + ALPHA_FROM_MATERIAL_SPECULAR The second has SET_LIGHT_CONTROL = SEPARATE_SPECULAR The third has SET_LIGHT_CONTROL = ALPHA_FROM_MATERIAL_SPECULAR The fourth has SET_LIGHT_CONTROL = 0
Because lighting is enabled, the diffuse alpha is entirely dictated by SET_MATERIAL_ALPHA, and RGB is entirely set by the lighting calculations.
Demonstrates that SET_SPECULAR_ENABLE = false forces specular values to {0, 0, 0, 1}. Also demonstrates that failing to set ALPHA_FROM_MATERIAL_SPECULAR will cause the specular alpha to be set to 1 and failing to set SEPARATE_SPECULAR will pass through vertex front specular RGB in the specular channel instead of performing the light calculation. Diffuse alpha is defined via SET_MATERIAL_ALPHA_BACK.
Renders two groups of two rows of 4 quads each with the fixed function pipeline. The first row is the specular component, the second is the diffuse. Lighting is enabled but with a directional light pointing at {1, 0, 1}.
Each quad has back specular and back diffuse colors of:
UL: {1.f, 0.f, 0.0f, 0.15f}, {0.5f, 0.f, 0.f, 1.f} UR: {1.f, 0.f, 0.0f, 0.75f}, {0.75f, 0.f, 0.f, 1.f} LR: {0.f, 1.f, 0.0f, 1.f}, {1.f, 0.f, 0.f, 1.f} LL: {0.f, 1.f, 0.0f, 0.20f}, {0.25f, 0.f, 0.f, 1.f}
Front specular is set to {0.f, 0.f, 1.f, 0.33f} and diffuse {0.0f, 1.0f, 0.5f, 1.0f}.
The upper row has SET_SPECULAR_ENABLE = false. The lower row has it true. The first column has SET_LIGHT_CONTROL = SEPARATE_SPECULAR + ALPHA_FROM_MATERIAL_SPECULAR The second has SET_LIGHT_CONTROL = SEPARATE_SPECULAR The third has SET_LIGHT_CONTROL = ALPHA_FROM_MATERIAL_SPECULAR The fourth has SET_LIGHT_CONTROL = 0
Because lighting is enabled, the diffuse alpha is entirely dictated by SET_MATERIAL_ALPHA, and RGB is entirely set by the lighting calculations.
Demonstrates that SET_SPECULAR_ENABLE = false forces specular values to {0, 0, 0, 1}. Also demonstrates that failing to set ALPHA_FROM_MATERIAL_SPECULAR will cause the specular alpha to be set to 1 and failing to set SEPARATE_SPECULAR will pass through vertex back specular RGB instead of performing the light calculation.
Renders two groups of two rows of 4 quads each with the fixed function pipeline. The first row is the specular component, the second is the diffuse. Lighting is enabled but with a directional light pointing at {1, 0, 1}.
Each quad has back specular and back diffuse colors of:
UL: {1.f, 0.f, 0.0f, 0.15f}, {0.5f, 0.f, 0.f, 1.f} UR: {1.f, 0.f, 0.0f, 0.75f}, {0.75f, 0.f, 0.f, 1.f} LR: {0.f, 1.f, 0.0f, 1.f}, {1.f, 0.f, 0.f, 1.f} LL: {0.f, 1.f, 0.0f, 0.20f}, {0.25f, 0.f, 0.f, 1.f}
Front specular is set to {0.f, 0.f, 1.f, 0.33f} and diffuse {0.0f, 1.0f, 0.5f, 1.0f}.
The upper row has SET_SPECULAR_ENABLE = false. The lower row has it true. The first column has SET_LIGHT_CONTROL = SEPARATE_SPECULAR + ALPHA_FROM_MATERIAL_SPECULAR The second has SET_LIGHT_CONTROL = SEPARATE_SPECULAR The third has SET_LIGHT_CONTROL = ALPHA_FROM_MATERIAL_SPECULAR The fourth has SET_LIGHT_CONTROL = 0
Because lighting is enabled, the diffuse alpha is entirely dictated by SET_MATERIAL_ALPHA, and RGB is entirely set by the lighting calculations.
|
overridevirtual |
Called to tear down the test suite.
Reimplemented from TestSuite.
|
overridevirtual |
Called to initialize the test suite.
Reimplemented from TestSuite.