RenderTargetTexture.bv.lua 1.3 KB

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