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