ReadbackTest.bv.lua 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. ----------------------------------------------------------------------------------------------------
  2. --
  3. -- Copyright (c) Contributors to the Open 3D Engine Project.
  4. -- For complete copyright and license terms please see the LICENSE at the root of this distribution.
  5. --
  6. -- SPDX-License-Identifier: Apache-2.0 OR MIT
  7. --
  8. --
  9. --
  10. ----------------------------------------------------------------------------------------------------
  11. RunScript("scripts/TestEnvironment.luac")
  12. g_testCaseFolder = 'Readback'
  13. Print('Saving screenshots to ' .. NormalizePath(g_screenshotOutputFolder .. g_testCaseFolder))
  14. OpenSample('RPI/Readback')
  15. SelectImageComparisonToleranceLevel("Level H")
  16. SetShowImGui(false)
  17. -- First capture at 512x512
  18. ResizeViewport(512, 512)
  19. SetImguiValue('Width', 512)
  20. SetImguiValue('Height', 512)
  21. IdleFrames(3)
  22. SetImguiValue('Readback', true)
  23. IdleFrames(5)
  24. CaptureScreenshot(g_testCaseFolder .. '/screenshot_1.png')
  25. IdleFrames(1)
  26. -- Then at 1024x1024
  27. ResizeViewport(1024, 1024)
  28. SetImguiValue('Width', 1024)
  29. SetImguiValue('Height', 1024)
  30. IdleFrames(1)
  31. SetImguiValue('Readback', true)
  32. IdleFrames(5)
  33. CaptureScreenshot(g_testCaseFolder .. '/screenshot_2.png')
  34. IdleFrames(1)
  35. SetShowImGui(true)
  36. OpenSample(nil)