MultiRenderPipeline.bv.lua 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  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/MultiRenderPipeline/')
  12. Print('Saving screenshots to ' .. NormalizePath(g_screenshotOutputFolder))
  13. function TakeScreenShotForWindow1(fileName)
  14. IdleFrames(1)
  15. CaptureScreenshot(g_screenshotOutputFolder .. fileName)
  16. end
  17. function TakeScreenShotForWindow2(fileName)
  18. IdleFrames(1)
  19. SetShowImGui(false)
  20. CapturePassAttachment({"SecondPipeline", "CopyToSwapChain"}, "Output", g_screenshotOutputFolder .. fileName)
  21. SetShowImGui(true)
  22. end
  23. function WaitForDepthOfFieldFocus()
  24. -- dof requires some time to focus
  25. IdleSeconds(2)
  26. end
  27. OpenSample('RPI/MultiRenderPipeline')
  28. ResizeViewport(800, 600)
  29. NoClipCameraController_SetFov(DegToRad(21.358959))
  30. NoClipCameraController_SetPosition(Vector3(-7.576071, 13.286152, 2.185254))
  31. NoClipCameraController_SetHeading(DegToRad(-149.923874))
  32. NoClipCameraController_SetPitch(DegToRad(-4.615502))
  33. SelectImageComparisonToleranceLevel("Level E")
  34. -- start window
  35. WaitForDepthOfFieldFocus()
  36. TakeScreenShotForWindow1('Start_window1.png')
  37. TakeScreenShotForWindow2('Start_window2.png')
  38. -- use second camera for second window.
  39. -- Wait for DOF stablized every time camera changes
  40. SetImguiValue('Use second camera', true)
  41. WaitForDepthOfFieldFocus()
  42. TakeScreenShotForWindow1('TwoCameras_window1.png')
  43. TakeScreenShotForWindow2('TwoCameras_window2.png')
  44. -- Disable DOF only
  45. SetImguiValue('Enable Depth of Field', false)
  46. WaitForDepthOfFieldFocus()
  47. TakeScreenShotForWindow1('NoDOF_window1.png')
  48. TakeScreenShotForWindow2('NoDOF_window2.png')
  49. -- Disable DOF only
  50. SetImguiValue('Enable Depth of Field', true)
  51. WaitForDepthOfFieldFocus()
  52. TakeScreenShotForWindow1('WithDOF_window1.png')
  53. TakeScreenShotForWindow2('WithDOF_window2.png')
  54. -- disable all the features
  55. SetImguiValue('Enable Depth of Field', false)
  56. SetImguiValue('Add/Remove Directional Light', false)
  57. SetImguiValue('Add/Remove Spot Light', false)
  58. SetImguiValue('Enable Skybox', false)
  59. SetImguiValue('Add/Remove IBL', false)
  60. TakeScreenShotForWindow1('NoFeatures_window1.png')
  61. TakeScreenShotForWindow2('NoFeatures_window2.png')
  62. -- Relax for NVIDIA Titan X (DX12)
  63. SelectImageComparisonToleranceLevel("Level F")
  64. -- IBL only
  65. SetImguiValue('Add/Remove IBL', true)
  66. -- IBL takes 2 frames to apply
  67. IdleFrames(2)
  68. TakeScreenShotForWindow1('IBL_window1.png')
  69. TakeScreenShotForWindow2('IBL_window2.png')
  70. -- Set the level back to E because NVIDIA Titan X passes with E
  71. SelectImageComparisonToleranceLevel("Level E")
  72. -- Add skybox
  73. SetImguiValue('Enable Skybox', true)
  74. TakeScreenShotForWindow1('IBL_Skybox_window1.png')
  75. TakeScreenShotForWindow2('IBL_Skybox_window2.png')
  76. -- Add spot light
  77. SetImguiValue('Add/Remove Spot Light', true)
  78. TakeScreenShotForWindow1('IBL_Skybox_Spot_window1.png')
  79. TakeScreenShotForWindow2('IBL_Skybox_Spot_window2.png')
  80. -- Add directional light
  81. SetImguiValue('Add/Remove Directional Light', true)
  82. TakeScreenShotForWindow1('IBL_Skybox_Spot_Dir_window1.png')
  83. TakeScreenShotForWindow2('IBL_Skybox_Spot_Dir_window2.png')
  84. -- Enable DOF
  85. SetImguiValue('Enable Depth of Field', true)
  86. WaitForDepthOfFieldFocus()
  87. TakeScreenShotForWindow1('IBL_Skybox_Spot_Dir_DOF_window1.png')
  88. TakeScreenShotForWindow2('IBL_Skybox_Spot_Dir_DOF_window2.png')
  89. OpenSample(nil)