| | 1 | | using System.Collections; |
| | 2 | | using DCL; |
| | 3 | | using DCL.Components; |
| | 4 | | using DCL.Helpers; |
| | 5 | | using DCL.Models; |
| | 6 | | using NUnit.Framework; |
| | 7 | | using UnityEngine; |
| | 8 | | using UnityEngine.TestTools; |
| | 9 | |
|
| | 10 | | public class PBRMaterialVisualTests : VisualTestsBase |
| | 11 | | { |
| | 12 | | [UnityTest] |
| | 13 | | [VisualTest] |
| | 14 | | [Explicit] |
| | 15 | | [Category("Explicit")] |
| 0 | 16 | | public IEnumerator AlphaTextureShouldWork_Generate() { yield return VisualTestHelpers.GenerateBaselineForTest(AlphaT |
| | 17 | |
|
| | 18 | | [UnityTest] |
| | 19 | | [VisualTest] |
| | 20 | | [Category("Explicit")] |
| | 21 | | [Explicit] |
| | 22 | | public IEnumerator AlphaTextureShouldWork() |
| | 23 | | { |
| 0 | 24 | | yield return InitVisualTestsScene("PBRMaterialVisualTests_AlphaTextureShouldWork"); |
| 0 | 25 | | DCLTexture texture = TestHelpers.CreateDCLTexture(scene, TestAssetsUtils.GetPath() + "/Images/alphaTexture.png") |
| 0 | 26 | | yield return texture.routine; |
| 0 | 27 | | Vector3 camTarget = new Vector3(5, 2, 5); |
| 0 | 28 | | VisualTestHelpers.RepositionVisualTestsCamera(VisualTestController.i.camera, camTarget - new Vector3(2, -1, 2), |
| | 29 | |
|
| 0 | 30 | | PBRMaterial matPBR = TestHelpers.CreateEntityWithPBRMaterial(scene, new PBRMaterial.Model |
| | 31 | | { |
| | 32 | | albedoTexture = texture.id, |
| | 33 | | transparencyMode = 2, |
| | 34 | | albedoColor = Color.blue |
| | 35 | | }, camTarget, out IDCLEntity entity); |
| 0 | 36 | | yield return matPBR.routine; |
| | 37 | |
|
| | 38 | |
|
| 0 | 39 | | yield return new WaitForAllMessagesProcessed(); |
| | 40 | |
|
| 0 | 41 | | yield return VisualTestHelpers.TakeSnapshot(); |
| 0 | 42 | | } |
| | 43 | | } |