MultiScene.bv.lua 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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 = 'MultiScene'
  13. Print('Saving screenshots to ' .. NormalizePath(g_screenshotOutputFolder .. g_testCaseFolder))
  14. function TakeScreenShotFromPrimaryWindow(fileName)
  15. IdleFrames(1)
  16. CaptureScreenshot(g_testCaseFolder .. '/' .. fileName)
  17. end
  18. function TakeScreenShotFromSecondaryWindow(fileName)
  19. IdleFrames(1)
  20. CapturePassAttachment({"SecondPipeline", "CopyToSwapChain"}, "Output", g_testCaseFolder .. '/' .. fileName)
  21. end
  22. function WaitForDepthOfFieldFocus()
  23. -- DoF requires some time to focus
  24. IdleSeconds(1)
  25. end
  26. OpenSample('RPI/MultiScene')
  27. ResizeViewport(800, 600)
  28. SelectImageComparisonToleranceLevel("Level F")
  29. -- Start window
  30. WaitForDepthOfFieldFocus()
  31. TakeScreenShotFromPrimaryWindow('Start_MultiScene1.png')
  32. TakeScreenShotFromSecondaryWindow('Start_MultiScene2.png')
  33. -- Go back to the base scene
  34. OpenSample(nil)