Browse Source

Shaders: update DistanceFieldVector test files with fixed SDFs.

The output is now *much* closer to the Vector shader output (mean
difference went from ~6 to 1.79), and in the multi-draw case it's
clearly visible that it's no longer slightly weirdly uneven.

The test files are now also much smaller as the originals were created
before RLE was implemented in TgaImageConverter.
pull/168/head
Vladimír Vondruš 3 years ago
parent
commit
3497985526
  1. 14
      src/Magnum/Shaders/Test/DistanceFieldVectorGLTest.cpp
  2. BIN
      src/Magnum/Shaders/Test/TestFiles/vector-distancefield.tga
  3. BIN
      src/Magnum/Shaders/Test/VectorTestFiles/defaults-distancefield.tga
  4. BIN
      src/Magnum/Shaders/Test/VectorTestFiles/multidraw2D-distancefield.tga
  5. BIN
      src/Magnum/Shaders/Test/VectorTestFiles/multidraw3D-distancefield.tga
  6. BIN
      src/Magnum/Shaders/Test/VectorTestFiles/outline2D.tga
  7. BIN
      src/Magnum/Shaders/Test/VectorTestFiles/outline3D.tga
  8. BIN
      src/Magnum/Shaders/Test/VectorTestFiles/smooth0.1-2D.tga
  9. BIN
      src/Magnum/Shaders/Test/VectorTestFiles/smooth0.1-3D.tga
  10. BIN
      src/Magnum/Shaders/Test/VectorTestFiles/smooth0.2-2D.tga
  11. BIN
      src/Magnum/Shaders/Test/VectorTestFiles/smooth0.2-3D.tga

14
src/Magnum/Shaders/Test/DistanceFieldVectorGLTest.cpp

@ -869,14 +869,13 @@ template<DistanceFieldVectorGL2D::Flag flag> void DistanceFieldVectorGLTest::ren
MAGNUM_VERIFY_NO_GL_ERROR();
/* Should be almost the same as Shaders::Vector output, but due to various
differences in the SDF output and too sharp default shininess it can't
be exact */
/* Should be almost the same as Shaders::Vector output, but due to too
sharp default shininess it can't be exact */
CORRADE_COMPARE_WITH(
/* Dropping the alpha channel, as it's always 1.0 */
Containers::arrayCast<Color3ub>(_framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels<Color4ub>()),
Utility::Path::join(_testDir, "VectorTestFiles/defaults.tga"),
(DebugTools::CompareImageToFile{_manager, 201.0f, 6.1f}));
(DebugTools::CompareImageToFile{_manager, 131.0f, 1.83f}));
#if !(defined(MAGNUM_TARGET_GLES2) && defined(MAGNUM_TARGET_WEBGL))
/* SwiftShader has off-by-one differences on edges, ARM Mali off-by-one in
@ -980,14 +979,13 @@ template<DistanceFieldVectorGL3D::Flag flag> void DistanceFieldVectorGLTest::ren
MAGNUM_VERIFY_NO_GL_ERROR();
/* Should be almost the same as Shaders::Vector output, but due to various
differences in the SDF output and too sharp default shininess it can't
be exact */
/* Should be almost the same as Shaders::Vector output, but due to too
sharp default shininess it can't be exact */
CORRADE_COMPARE_WITH(
/* Dropping the alpha channel, as it's always 1.0 */
Containers::arrayCast<Color3ub>(_framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels<Color4ub>()),
Utility::Path::join(_testDir, "VectorTestFiles/defaults.tga"),
(DebugTools::CompareImageToFile{_manager, 201.0f, 6.1f}));
(DebugTools::CompareImageToFile{_manager, 131.0f, 1.83f}));
#if !(defined(MAGNUM_TARGET_GLES2) && defined(MAGNUM_TARGET_WEBGL))
/* SwiftShader has off-by-one differences on edges, ARM Mali off-by-one in

BIN
src/Magnum/Shaders/Test/TestFiles/vector-distancefield.tga

Binary file not shown.

BIN
src/Magnum/Shaders/Test/VectorTestFiles/defaults-distancefield.tga

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

BIN
src/Magnum/Shaders/Test/VectorTestFiles/multidraw2D-distancefield.tga

Binary file not shown.

BIN
src/Magnum/Shaders/Test/VectorTestFiles/multidraw3D-distancefield.tga

Binary file not shown.

BIN
src/Magnum/Shaders/Test/VectorTestFiles/outline2D.tga

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 5.6 KiB

BIN
src/Magnum/Shaders/Test/VectorTestFiles/outline3D.tga

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 5.1 KiB

BIN
src/Magnum/Shaders/Test/VectorTestFiles/smooth0.1-2D.tga

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 4.8 KiB

BIN
src/Magnum/Shaders/Test/VectorTestFiles/smooth0.1-3D.tga

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 4.4 KiB

BIN
src/Magnum/Shaders/Test/VectorTestFiles/smooth0.2-2D.tga

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 7.6 KiB

BIN
src/Magnum/Shaders/Test/VectorTestFiles/smooth0.2-3D.tga

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 6.9 KiB

Loading…
Cancel
Save