RenderTargetTexture.bv.lua 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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 = 'RenderTargetTexture'
  13. Print('Saving screenshots to ' .. NormalizePath(g_screenshotOutputFolder .. g_testCaseFolder))
  14. OpenSample('RPI/RenderTargetTexture')
  15. SelectImageComparisonToleranceLevel("Level F")
  16. -- hide preview before resize since it may clean the cached image copy
  17. SetImguiValue('Show Preview', false)
  18. IdleFrames(1)
  19. ResizeViewport(800, 500)
  20. -- manully hide ImGui since CaptureScreenshotWithPreview won't hide it automatically
  21. SetShowImGui(false)
  22. -- enable preview after resize
  23. SetImguiValue('Show Preview', true)
  24. SetImguiValue('Next Frame', true)
  25. IdleFrames(1)
  26. CaptureScreenshotWithPreview(g_testCaseFolder .. '/screenshot_1.png')
  27. SetImguiValue('Next Frame', true)
  28. IdleFrames(2)
  29. CaptureScreenshotWithPreview(g_testCaseFolder .. '/screenshot_2.png')
  30. SetShowImGui(false)
  31. OpenSample(nil)