ParallaxDepthArtifacts.bv.lua 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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/ParallaxDepthArtifacts/')
  12. Print('Saving screenshots to ' .. NormalizePath(g_screenshotOutputFolder))
  13. OpenSample('Features/Parallax')
  14. ResizeViewport(512, 512)
  15. -- There have been several bugs related to inconsistent depth calculations causing unwanted clipping of pixels on parallax surfaces.
  16. -- We attempt to detect this by putting the camera at several angles that have been observed to reveal these artifacts in the past.
  17. -- All lights are turned off to avoid the sensitive platform differences we are used to seeing on parallax materials, which allows us to use a much
  18. -- tighter tolerance level than other parallax test cases, so that even small amounts of artifacts will be detected and fail the test. These
  19. -- artifacts were showing up as gray firefly pixels on the otherwise black parallax surface.
  20. -- Many camera angles are used because the noise seems to be platform- and/or driver-dependent, so having more angles increases the chances of detecting failures.
  21. SelectImageComparisonToleranceLevel("Level B")
  22. SetImguiValue('Lighting/Auto Rotation', false)
  23. SetImguiValue('Lighting/Direction', DegToRad(110))
  24. SetImguiValue('Parallax Setting/Heightmap Scale', 0.1)
  25. SetImguiValue('Parallax Setting/Enable Pdo', true)
  26. SetImguiValue('Lighting/No Light', true)
  27. ArcBallCameraController_SetDistance(3.000000)
  28. ArcBallCameraController_SetHeading(DegToRad(-38.356312))
  29. ArcBallCameraController_SetPitch(DegToRad(-2.705635))
  30. IdleFrames(1)
  31. CaptureScreenshot(g_screenshotOutputFolder .. '/screenshot_1.png')
  32. ArcBallCameraController_SetHeading(DegToRad(-66.861877))
  33. ArcBallCameraController_SetPitch(DegToRad(-4.933800))
  34. IdleFrames(1)
  35. CaptureScreenshot(g_screenshotOutputFolder .. '/screenshot_2.png')
  36. ArcBallCameraController_SetHeading(DegToRad(30.230936))
  37. ArcBallCameraController_SetPitch(DegToRad(-3.819724))
  38. IdleFrames(1)
  39. CaptureScreenshot(g_screenshotOutputFolder .. '/screenshot_3.png')
  40. ArcBallCameraController_SetHeading(DegToRad(-140.709763))
  41. ArcBallCameraController_SetPitch(DegToRad(-3.501410))
  42. IdleFrames(1)
  43. CaptureScreenshot(g_screenshotOutputFolder .. '/screenshot_4.png')
  44. ArcBallCameraController_SetHeading(DegToRad(135.264740))
  45. ArcBallCameraController_SetPitch(DegToRad(-2.387333))
  46. IdleFrames(1)
  47. CaptureScreenshot(g_screenshotOutputFolder .. '/screenshot_5.png')
  48. ArcBallCameraController_SetHeading(DegToRad(20.355005))
  49. ArcBallCameraController_SetPitch(DegToRad(-4.456343))
  50. IdleFrames(1)
  51. CaptureScreenshot(g_screenshotOutputFolder .. '/screenshot_6.png')
  52. OpenSample(nil)