1#include <catch2/catch_test_macros.hpp>
3#include <Engine/Data/EnvironmentTexture.hpp>
4#include <Engine/RadiumEngine.hpp>
8TEST_CASE(
"Engine/Data/EnvironmentTexture/Equirectangular",
9 "[unittests][Engine][Engine/Data][EnvironmentTexture][equirectangular]" ) {
10 SECTION(
"Create environment texture" ) {
13 REQUIRE( tex.getImageType() == EnvironmentTexture::EnvMapType::ENVMAP_LATLON );
14 REQUIRE( tex.isSkybox() );
16 auto& redShCoefs = tex.getShMatrix( 0 );
17 Ra::Core::Matrix4 refCoefs = ( Ra::Core::Matrix4() << -0.514535,
34 auto diff = redShCoefs - refCoefs;
35 REQUIRE( diff.norm() <= 1e-3 );
39TEST_CASE(
"Engine/Data/EnvironmentTexture/PFM",
40 "[unittests][Engine][Engine/Data][EnvironmentTexture][PFM]" ) {
41 SECTION(
"Create environment texture" ) {
44 REQUIRE( tex.getImageType() == EnvironmentTexture::EnvMapType::ENVMAP_PFM );
45 REQUIRE( !tex.isSkybox() );
47 auto& greenShCoefs = tex.getShMatrix( 1 );
48 Ra::Core::Matrix4 refCoefs = ( Ra::Core::Matrix4() << -1.53315_ra,
65 auto diff = greenShCoefs - refCoefs;
66 REQUIRE( diff.norm() <= 1e-3 );
69TEST_CASE(
"Engine/Data/EnvironmentTexture/CubeMap",
70 "[unittests][Engine][Engine/Data][EnvironmentTexture][CubeMap]" ) {
71 SECTION(
"Create environment texture" ) {
73 "data/smallpark/negx.jpg;data/smallpark/negy.jpg;data/smallpark/negz.jpg;"
74 "data/smallpark/posx.jpg;data/smallpark/posy.jpg;data/smallpark/posz.jpg" };
76 REQUIRE( tex.getImageType() == EnvironmentTexture::EnvMapType::ENVMAP_CUBE );
77 REQUIRE( !tex.isSkybox() );
79 auto& blueShCoefs = tex.getShMatrix( 2 );
80 Ra::Core::Matrix4 refCoefs = ( Ra::Core::Matrix4() << -0.0150307_ra,
97 auto diff = blueShCoefs - refCoefs;
98 REQUIRE( diff.norm() <= 1e-3 );
Defines a spherical, infinite light sources and, optionally, sky boxes. An operator to convert an Env...
(GPU) Data representation, along with manager