浏览代码

Fix current graphics tests

/main
Andrem 3 年前
当前提交
e2799f41
共有 14 个文件被更改,包括 2748 次插入574 次删除
  1. 1
      Assets/Objects/misc/Main Camera.prefab
  2. 988
      Assets/ReferenceImages/Linear/OSXEditor/Metal/None/benchmark_island-static.png
  3. 2
      Assets/ReferenceImages/Linear/OSXEditor/Metal/None/benchmark_island-static.png.meta
  4. 2
      Assets/Scripts/Environment/WindsurferManager.cs
  5. 12
      Assets/Scripts/GameSystem/AppSettings.cs
  6. 20
      Assets/Scripts/GameSystem/InputControls.cs
  7. 67
      Assets/Scripts/System/UnityGFXTests/BoatAttackGraphicsTests.cs
  8. 19
      Assets/Scripts/Utility/Utility.cs
  9. 2
      Packages/com.verasl.water-system/Scripts/Water.cs
  10. 15
      Packages/manifest.json
  11. 1001
      Assets/ReferenceImages/Linear/OSXEditor/Metal/None/level_Island.png
  12. 96
      Assets/ReferenceImages/Linear/OSXEditor/Metal/None/level_Island.png.meta
  13. 1001
      Assets/ReferenceImages/Linear/OSXEditor/Metal/None/main_menu.png
  14. 96
      Assets/ReferenceImages/Linear/OSXEditor/Metal/None/main_menu.png.meta

1
Assets/Objects/misc/Main Camera.prefab


m_StopNaN: 0
m_Dithering: 1
m_ClearDepth: 1
m_AllowXRRendering: 1
m_RequiresDepthTexture: 0
m_RequiresColorTexture: 0
m_Version: 2

988
Assets/ReferenceImages/Linear/OSXEditor/Metal/None/benchmark_island-static.png
文件差异内容过多而无法显示
查看文件

2
Assets/ReferenceImages/Linear/OSXEditor/Metal/None/benchmark_island-static.png.meta


fileFormatVersion: 2
guid: b31421e05305f414f8502b3dbf7c4cfa
guid: b69f7136667814ffdbd894572a55a96b
TextureImporter:
internalIDToNameTable: []
externalObjects: {}

2
Assets/Scripts/Environment/WindsurferManager.cs


_smoothPositions[i].y += Time.deltaTime;
else
_smoothPositions[i].y -= Time.deltaTime * 0.25f;
#if !STATIC_EVERYTHING
#endif
}
}
}

12
Assets/Scripts/GameSystem/AppSettings.cs


SetRenderScale();
SceneManager.sceneLoaded += LevelWasLoaded;
}
private void Initialize()
{
Instance = this;

#if STATIC_EVERYTHING
// Set the static flag if enabled
Shader.EnableKeyword("_STATIC_SHADER");
#else
Shader.DisableKeyword("_STATIC_SHADER");
#endif
}
private void OnDisable()

private static void LevelWasLoaded(Scene scene, LoadSceneMode mode)
{
CleanupCameras();
#if STATIC_EVERYTHING
Utility.StaticObjects();
#endif
Instance.Invoke(nameof(CleanupLoadingScreen), 0.5f);
}

20
Assets/Scripts/GameSystem/InputControls.cs


//------------------------------------------------------------------------------
// <auto-generated>
// This code was auto-generated by com.unity.inputsystem:InputActionCodeGenerator
// version 1.1.0
// version 1.1.1
// from Assets/Data/InputControls.inputactions
//
// Changes to this file may cause incorrect behavior and will be lost if

""id"": ""591093b7-743c-42e6-b71e-bab02d178bd1"",
""expectedControlType"": ""Axis"",
""processors"": ""AxisDeadzone(min=0.1,max=1)"",
""interactions"": """"
""interactions"": """",
""initialStateCheck"": true
},
{
""name"": ""Steering"",

""processors"": ""AxisDeadzone(min=0.1,max=1)"",
""interactions"": """"
""interactions"": """",
""initialStateCheck"": true
},
{
""name"": ""Reset"",

""processors"": ""AxisDeadzone(min=0.1,max=1)"",
""interactions"": """"
""interactions"": """",
""initialStateCheck"": false
},
{
""name"": ""Pause"",

""processors"": ""AxisDeadzone(min=0.1,max=1)"",
""interactions"": """"
""interactions"": """",
""initialStateCheck"": false
}
],
""bindings"": [

""id"": ""c57759c4-f215-4fe9-bd6c-1c835c6074bd"",
""expectedControlType"": ""Button"",
""processors"": """",
""interactions"": """"
""interactions"": """",
""initialStateCheck"": false
},
{
""name"": ""TimeOfDay"",

""processors"": ""AxisDeadzone(min=0.1,max=1)"",
""interactions"": """"
""interactions"": """",
""initialStateCheck"": true
}
],
""bindings"": [

67
Assets/Scripts/System/UnityGFXTests/BoatAttackGraphicsTests.cs


using System.Collections;
using NUnit.Framework;
using UnityEditor.Compilation;
using UnityEngine;
using UnityEngine.TestTools;
using UnityEngine.TestTools.Graphics;
using UnityEngine.SceneManagement;
using UnityEngine;
using UnityEngine.TestTools;
using UnityEngine.TestTools.Graphics;
using UnityEngine.SceneManagement;
const string defineKey = "BoatAttackKey";
private const string DefineKey = "BoatAttack_Tests_ScriptingDefines";
private static float _oldTimeScale = 1.0f; // give default of 1 just in case
// save current scription defines and set both STATIC_EVERYTHING and LWRP_DEBUG_STATIC_POSTFX
EditorPrefs.SetString(defineKey, defines);
EditorPrefs.SetString(DefineKey, defines);
// store current timescale and set it to 0
_oldTimeScale = Time.timeScale;
Time.timeScale = 0f;
// run base graphics test setup
//[PrebuildSetup("SetupGraphicsTestCases")]
var ts = Time.timeScale;
// set time scale again just in case game have changed it
// set the static keyword
Shader.EnableKeyword("_STATIC_SHADER");
// grab the main camera
// add graphics settings if does not exist in the scene
settings = SetTestSettings(settings);
for (var i = 0; i < settings.WaitFrames; i++)
yield return new WaitForEndOfFrame();
ImageAssert.AreEqual(testCase.ReferenceImage, camera, settings.ImageComparisonSettings);
}
private static BoatAttackGraphicsTestsSettings SetTestSettings(BoatAttackGraphicsTestsSettings settings)
{
settings.ImageComparisonSettings.IncorrectPixelsThreshold = 0.001f;
settings.ImageComparisonSettings.IncorrectPixelsThreshold = 0.01f;
#if STATIC_EVERYTHING
Debug.Log("hello, this worked");
#endif
for (int i = 0; i < settings.WaitFrames; i++)
yield return new WaitForEndOfFrame();
ImageAssert.AreEqual(testCase.ReferenceImage, camera, settings.ImageComparisonSettings);
Time.timeScale = ts;
return settings;
UnityEditor.TestTools.Graphics.ResultsUtility.ExtractImagesFromTestProperties(TestContext.CurrentContext.Test);
ResultsUtility.ExtractImagesFromTestProperties(TestContext.CurrentContext.Test);
EditorApplication.delayCall += Call;
EditorApplication.delayCall += FinalCall;
Time.timeScale = _oldTimeScale;
Shader.DisableKeyword("_STATIC_SHADER");
static void Call()
private static void FinalCall()
PlayerSettings.SetScriptingDefineSymbolsForGroup(EditorUserBuildSettings.selectedBuildTargetGroup, EditorPrefs.GetString(defineKey));
PlayerSettings.SetScriptingDefineSymbolsForGroup(EditorUserBuildSettings.selectedBuildTargetGroup, EditorPrefs.GetString(DefineKey));
EditorPrefs.DeleteKey(DefineKey);
}
}

19
Assets/Scripts/Utility/Utility.cs


using System;
using System.Collections.Generic;
using System.Text.RegularExpressions;
using Cinemachine;
using UnityEngine;
using UnityEngine.Rendering.Universal;
using Object = UnityEngine.Object;

}
private static readonly List<string> QualityLevels = new List<string> {"Low", "Medium", "High"};
public static void StaticObjects()
{
// remove the noise on Cinemachine cameras
var cameras = GameObject.FindObjectsOfType<CinemachineVirtualCamera>();
foreach (var cam in cameras)
{
var comp = cam.GetCinemachineComponent<CinemachineBasicMultiChannelPerlin>();
if(comp)
comp.m_AmplitudeGain = 0.0f;
}
// make the cinemachine carts static
var carts = GameObject.FindObjectsOfType<CinemachineDollyCart>();
foreach (var cart in carts)
{
cart.m_Speed = 0.0f;
}
}
}
#if UNITY_EDITOR

2
Packages/com.verasl.water-system/Scripts/Water.cs


resources = Resources.Load("WaterResources") as WaterResources;
}
if(Application.platform != RuntimePlatform.WebGLPlayer) // TODO - bug with Opengl depth
Invoke(nameof(CaptureDepthMap), 1.0f);
CaptureDepthMap();
}
private void LateUpdate()

15
Packages/manifest.json


{
"dependencies": {
"com.unity.2d.sprite": "1.0.0",
"com.unity.addressables": "1.16.19",
"com.unity.addressables": "1.18.15",
"com.unity.burst": "1.4.8",
"com.unity.cinemachine": "2.6.5",
"com.unity.inputsystem": "1.1.0-preview.3",
"com.unity.burst": "1.4.11",
"com.unity.cinemachine": "2.6.10",
"com.unity.inputsystem": "1.1.1",
"com.unity.memoryprofiler": "0.2.9-preview.3",
"com.unity.render-pipelines.universal": "10.5.0",
"com.unity.test-framework": "1.1.27",
"com.unity.testframework.graphics": "7.8.12-preview",
"com.unity.memoryprofiler": "0.4.1-preview.1",
"com.unity.render-pipelines.universal": "10.6.0",
"com.unity.testframework.graphics": "7.8.16-preview",
"com.unity.textmeshpro": "3.0.6",
"com.unity.timeline": "1.4.8",
"com.unity.ugui": "1.0.0",

1001
Assets/ReferenceImages/Linear/OSXEditor/Metal/None/level_Island.png
文件差异内容过多而无法显示
查看文件

96
Assets/ReferenceImages/Linear/OSXEditor/Metal/None/level_Island.png.meta


fileFormatVersion: 2
guid: 5cd214bf7e19c4f83914139575476803
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 11
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 1
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 0
wrapV: 0
wrapW: 0
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 0
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

1001
Assets/ReferenceImages/Linear/OSXEditor/Metal/None/main_menu.png
文件差异内容过多而无法显示
查看文件

96
Assets/ReferenceImages/Linear/OSXEditor/Metal/None/main_menu.png.meta


fileFormatVersion: 2
guid: 8596ae1d516a74e09bba709f583564bd
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 11
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 1
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 0
wrapV: 0
wrapW: 0
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 0
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:
正在加载...
取消
保存