浏览代码
Merge branch 'master' of https://github.com/Unity-Technologies/ScriptableRenderLoop into Branch_SkySettingsVolume
Merge branch 'master' of https://github.com/Unity-Technologies/ScriptableRenderLoop into Branch_SkySettingsVolume
# Conflicts: # ScriptableRenderPipeline/HDRenderPipeline/HDRenderPipeline.cs/main
Julien Ignace
7 年前
当前提交
256c35aa
共有 127 个文件被更改,包括 4059 次插入 和 2005 次删除
-
45ImageTemplates/HDRenderPipeline/Scenes/1xxx_Materials/1101_Unlit.unity.png.meta
-
45ImageTemplates/HDRenderPipeline/Scenes/1xxx_Materials/1102_Unlit_Distortion.unity.png.meta
-
45ImageTemplates/HDRenderPipeline/Scenes/1xxx_Materials/1103_Unlit_Distortion_DepthTest.unity.png.meta
-
45ImageTemplates/HDRenderPipeline/Scenes/1xxx_Materials/1201_Lit_Features.unity.png.meta
-
45ImageTemplates/HDRenderPipeline/Scenes/1xxx_Materials/1202_Lit_DoubleSideNormalMode.unity.png.meta
-
45ImageTemplates/HDRenderPipeline/Scenes/1xxx_Materials/1203_Lit_Transparent.unity.png.meta
-
45ImageTemplates/HDRenderPipeline/Scenes/1xxx_Materials/1204_Lit_Transparent_Fog.unity.png.meta
-
45ImageTemplates/HDRenderPipeline/Scenes/1xxx_Materials/1205_Lit_Transparent_Refraction.unity.png.meta
-
45ImageTemplates/HDRenderPipeline/Scenes/1xxx_Materials/1206_Lit_Transparent_Distortion.unity.png.meta
-
45ImageTemplates/HDRenderPipeline/Scenes/1xxx_Materials/1207_Lit_Displacement.unity.png.meta
-
45ImageTemplates/HDRenderPipeline/Scenes/1xxx_Materials/1208_Lit_Displacement_POM.unity.png.meta
-
45ImageTemplates/HDRenderPipeline/Scenes/1xxx_Materials/1209_Lit_Displacement_Vertex.unity.png.meta
-
45ImageTemplates/HDRenderPipeline/Scenes/1xxx_Materials/1210_Lit_BentNormal.unity.png.meta
-
45ImageTemplates/HDRenderPipeline/Scenes/1xxx_Materials/1211_Lit_Details.unity.png.meta
-
45ImageTemplates/HDRenderPipeline/Scenes/1xxx_Materials/1212_Lit_Emission.unity.png.meta
-
999ImageTemplates/LightweightPipeline/Scenes/007_LitShaderMaps.unity.png
-
14ImageTemplates/LightweightPipeline/Scenes/007_LitShaderMaps.unity.png.meta
-
6ScriptableRenderPipeline/Core/Resources/BlitCubeTextureFace.shader
-
8ScriptableRenderPipeline/Core/Resources/EncodeBC6H.compute
-
2ScriptableRenderPipeline/Core/Resources/GPUCopy.compute
-
6ScriptableRenderPipeline/Core/ShaderLibrary/CommonLighting.hlsl
-
68ScriptableRenderPipeline/Core/ShaderLibrary/CommonMaterial.hlsl
-
2ScriptableRenderPipeline/Core/ShaderLibrary/Packing.hlsl
-
2ScriptableRenderPipeline/Core/Volume/Editor/VolumeEditor.cs
-
2ScriptableRenderPipeline/Core/Volume/Volume.cs
-
223ScriptableRenderPipeline/Core/Volume/VolumeManager.cs
-
473ScriptableRenderPipeline/Core/Volume/VolumeParameter.cs
-
14ScriptableRenderPipeline/HDRenderPipeline/Camera/HDCamera.cs
-
1ScriptableRenderPipeline/HDRenderPipeline/Debug/DebugDisplay.cs
-
1ScriptableRenderPipeline/HDRenderPipeline/Debug/RenderingDebug.cs
-
1ScriptableRenderPipeline/HDRenderPipeline/Editor/HDRenderPipelineInspector.Styles.cs
-
15ScriptableRenderPipeline/HDRenderPipeline/Editor/HDRenderPipelineInspector.cs
-
4ScriptableRenderPipeline/HDRenderPipeline/HDCustomSamplerId.cs
-
221ScriptableRenderPipeline/HDRenderPipeline/HDRenderPipeline.cs
-
3ScriptableRenderPipeline/HDRenderPipeline/HDRenderPipelineAsset.asset
-
2ScriptableRenderPipeline/HDRenderPipeline/HDRenderPipelineAsset.cs
-
13ScriptableRenderPipeline/HDRenderPipeline/HDStringConstants.cs
-
90ScriptableRenderPipeline/HDRenderPipeline/Lighting/LightLoop/LightLoop.cs
-
4ScriptableRenderPipeline/HDRenderPipeline/Lighting/LightLoop/materialflags.compute
-
19ScriptableRenderPipeline/HDRenderPipeline/Material/LayeredLit/LayeredLit.shader
-
19ScriptableRenderPipeline/HDRenderPipeline/Material/LayeredLit/LayeredLitTessellation.shader
-
219ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/Lit.hlsl
-
19ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/Lit.shader
-
19ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/LitTessellation.shader
-
120ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/Resources/CopyStencilBuffer.shader
-
27ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/Resources/SubsurfaceScattering.compute
-
21ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/Resources/SubsurfaceScattering.shader
-
2ScriptableRenderPipeline/HDRenderPipeline/SceneSettings/Resources/DrawSssProfile.shader
-
1ScriptableRenderPipeline/HDRenderPipeline/SceneSettings/Resources/DrawTransmittanceGraph.shader
-
29ScriptableRenderPipeline/HDRenderPipeline/ShaderPass/ShaderPassForward.hlsl
-
8ScriptableRenderPipeline/LightweightPipeline/Editor/LightweightAssetEditor.cs
-
258ScriptableRenderPipeline/LightweightPipeline/Editor/LightweightCameraEditor.cs
-
262ScriptableRenderPipeline/LightweightPipeline/Editor/LightweightLightEditor.cs
-
64ScriptableRenderPipeline/LightweightPipeline/Editor/ShaderGUI/LightweightStandardGUI.cs
-
47ScriptableRenderPipeline/LightweightPipeline/Editor/ShaderGUI/LightweightStandardParticlesShaderGUI.cs
-
30ScriptableRenderPipeline/LightweightPipeline/Editor/ShaderGUI/LightweightStandardSimpleLightingGUI.cs
-
78ScriptableRenderPipeline/LightweightPipeline/Editor/ShaderGUI/LightweightUnlitGUI.cs
-
5ScriptableRenderPipeline/LightweightPipeline/Editor/StandardToLightweightMaterialUpgrader.cs.meta
-
6ScriptableRenderPipeline/LightweightPipeline/LightweightPipeline.cs
-
39ScriptableRenderPipeline/LightweightPipeline/Shaders/LightweightCore.cginc
-
3ScriptableRenderPipeline/LightweightPipeline/Shaders/LightweightInput.cginc
-
79ScriptableRenderPipeline/LightweightPipeline/Shaders/LightweightPassLit.cginc
-
33ScriptableRenderPipeline/LightweightPipeline/Shaders/LightweightStandard.shader
-
71ScriptableRenderPipeline/LightweightPipeline/Shaders/LightweightUnlit.shader
-
6ScriptableRenderPipeline/LightweightPipeline/Data/LightweightPipelineAsset.cs
-
33Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Scenes/007_LitShaderMaps.unity
-
5Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Scenes/007_LitShaderMaps/007_LitShaderMaps_UnlitMatTexture_08.mat
-
3Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Scenes/007_LitShaderMaps/007_LitShaderMaps_UnlitMat_07.mat
-
5Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Scenes/007_LitShaderMaps/LightingData.asset
-
2Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Scenes/007_LitShaderMaps/LightingData.asset.meta
-
3ScriptableRenderPipeline/HDRenderPipeline/Material/SubsurfaceScattering/SSSProfile.meta
-
4ScriptableRenderPipeline/HDRenderPipeline/Material/SubsurfaceScattering/SSSProfile/SSS Settings.asset.meta
-
82ScriptableRenderPipeline/HDRenderPipeline/Material/SubsurfaceScattering/SSSProfile/SSS Settings.asset
-
144ScriptableRenderPipeline/Core/Volume/Editor/Drawers/FloatParameterDrawer.cs
-
107ScriptableRenderPipeline/Core/Volume/Editor/Drawers/IntParameterDrawer.cs
-
8ScriptableRenderPipeline/HDRenderPipeline/Material/SubsurfaceScattering.meta
-
114Tests/GraphicsTests/Framework/Editor/PlayModeTestFramework.cs
-
11Tests/GraphicsTests/Framework/Editor/PlayModeTestFramework.cs.meta
-
8Tests/GraphicsTests/RenderPipeline/HDRenderPipeline/PlayModeTest.meta
-
61ScriptableRenderPipeline/HDRenderPipeline/Material/SubsurfaceScattering/CommonSubsurfaceScattering.hlsl
-
9ScriptableRenderPipeline/HDRenderPipeline/Material/SubsurfaceScattering/CommonSubsurfaceScattering.hlsl.meta
-
8ScriptableRenderPipeline/HDRenderPipeline/Material/SubsurfaceScattering/Editor.meta
-
11ScriptableRenderPipeline/HDRenderPipeline/Material/SubsurfaceScattering/Editor/SubsurfaceScatteringSettingsEditor.Styles.cs.meta
-
11ScriptableRenderPipeline/HDRenderPipeline/Material/SubsurfaceScattering/Editor/SubsurfaceScatteringSettingsEditor.cs.meta
-
99ScriptableRenderPipeline/HDRenderPipeline/Material/SubsurfaceScattering/SubsurfaceScattering.hlsl
-
9ScriptableRenderPipeline/HDRenderPipeline/Material/SubsurfaceScattering/SubsurfaceScattering.hlsl.meta
-
47ScriptableRenderPipeline/HDRenderPipeline/Material/SubsurfaceScattering/SubsurfaceScatteringManager.cs
-
11ScriptableRenderPipeline/HDRenderPipeline/Material/SubsurfaceScattering/SubsurfaceScatteringManager.cs.meta
-
9ScriptableRenderPipeline/HDRenderPipeline/Material/SubsurfaceScattering/SubsurfaceScatteringSettings.cs.hlsl.meta
-
11ScriptableRenderPipeline/HDRenderPipeline/Material/SubsurfaceScattering/SubsurfaceScatteringSettings.cs.meta
-
196Tests/GraphicsTests/RenderPipeline/HDRenderPipeline/PlayModeTest/ComparerMaterial.mat
-
8Tests/GraphicsTests/RenderPipeline/HDRenderPipeline/PlayModeTest/ComparerMaterial.mat.meta
-
114Tests/GraphicsTests/RenderPipeline/HDRenderPipeline/PlayModeTest/ComparerShader.shader
-
9Tests/GraphicsTests/RenderPipeline/HDRenderPipeline/PlayModeTest/ComparerShader.shader.meta
-
236Tests/GraphicsTests/RenderPipeline/HDRenderPipeline/PlayModeTest/Comparer_Template.png
-
116Tests/GraphicsTests/RenderPipeline/HDRenderPipeline/PlayModeTest/Comparer_Template.png.meta
-
237Tests/GraphicsTests/RenderPipeline/HDRenderPipeline/PlayModeTest/Comparer_Test.png
999
ImageTemplates/LightweightPipeline/Scenes/007_LitShaderMaps.unity.png
文件差异内容过多而无法显示
查看文件
文件差异内容过多而无法显示
查看文件
5
Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Scenes/007_LitShaderMaps/LightingData.asset
文件差异内容过多而无法显示
查看文件
文件差异内容过多而无法显示
查看文件
|
|||
fileFormatVersion: 2 |
|||
guid: a0ba759eadcfdcc44bc08adad4960ed0 |
|||
folderAsset: yes |
|||
timeCreated: 1493162006 |
|||
licenseType: Pro |
|||
externalObjects: {} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
using UnityEngine; |
|||
using UnityEngine.Experimental.Rendering; |
|||
|
|||
namespace UnityEditor.Experimental.Rendering |
|||
{ |
|||
[VolumeParameterDrawer(typeof(MinFloatParameter))] |
|||
sealed class MinFloatParameterDrawer : VolumeParameterDrawer |
|||
{ |
|||
public override bool OnGUI(SerializedDataParameter parameter, GUIContent title) |
|||
{ |
|||
var value = parameter.value; |
|||
|
|||
if (value.propertyType != SerializedPropertyType.Float) |
|||
return false; |
|||
|
|||
var o = parameter.GetObjectRef<MinFloatParameter>(); |
|||
float v = EditorGUILayout.FloatField(title, value.floatValue); |
|||
value.floatValue = Mathf.Max(v, o.min); |
|||
return true; |
|||
} |
|||
} |
|||
|
|||
[VolumeParameterDrawer(typeof(NoInterpMinFloatParameter))] |
|||
sealed class NoInterpMinFloatParameterDrawer : VolumeParameterDrawer |
|||
{ |
|||
public override bool OnGUI(SerializedDataParameter parameter, GUIContent title) |
|||
{ |
|||
var value = parameter.value; |
|||
|
|||
if (value.propertyType != SerializedPropertyType.Float) |
|||
return false; |
|||
|
|||
var o = parameter.GetObjectRef<NoInterpMinFloatParameter>(); |
|||
float v = EditorGUILayout.FloatField(title, value.floatValue); |
|||
value.floatValue = Mathf.Max(v, o.min); |
|||
return true; |
|||
} |
|||
} |
|||
|
|||
[VolumeParameterDrawer(typeof(MaxFloatParameter))] |
|||
sealed class MaxFloatParameterDrawer : VolumeParameterDrawer |
|||
{ |
|||
public override bool OnGUI(SerializedDataParameter parameter, GUIContent title) |
|||
{ |
|||
var value = parameter.value; |
|||
|
|||
if (value.propertyType != SerializedPropertyType.Float) |
|||
return false; |
|||
|
|||
var o = parameter.GetObjectRef<MaxFloatParameter>(); |
|||
float v = EditorGUILayout.FloatField(title, value.floatValue); |
|||
value.floatValue = Mathf.Min(v, o.max); |
|||
return true; |
|||
} |
|||
} |
|||
|
|||
[VolumeParameterDrawer(typeof(NoInterpMaxFloatParameter))] |
|||
sealed class NoInterpMaxFloatParameterDrawer : VolumeParameterDrawer |
|||
{ |
|||
public override bool OnGUI(SerializedDataParameter parameter, GUIContent title) |
|||
{ |
|||
var value = parameter.value; |
|||
|
|||
if (value.propertyType != SerializedPropertyType.Float) |
|||
return false; |
|||
|
|||
var o = parameter.GetObjectRef<NoInterpMaxFloatParameter>(); |
|||
float v = EditorGUILayout.FloatField(title, value.floatValue); |
|||
value.floatValue = Mathf.Min(v, o.max); |
|||
return true; |
|||
} |
|||
} |
|||
|
|||
[VolumeParameterDrawer(typeof(ClampedFloatParameter))] |
|||
sealed class ClampedFloatParameterDrawer : VolumeParameterDrawer |
|||
{ |
|||
public override bool OnGUI(SerializedDataParameter parameter, GUIContent title) |
|||
{ |
|||
var value = parameter.value; |
|||
|
|||
if (value.propertyType != SerializedPropertyType.Float) |
|||
return false; |
|||
|
|||
var o = parameter.GetObjectRef<ClampedFloatParameter>(); |
|||
EditorGUILayout.Slider(value, o.min, o.max, title); |
|||
value.floatValue = Mathf.Clamp(value.floatValue, o.min, o.max); |
|||
return true; |
|||
} |
|||
} |
|||
|
|||
[VolumeParameterDrawer(typeof(NoInterpClampedFloatParameter))] |
|||
sealed class NoInterpClampedFloatParameterDrawer : VolumeParameterDrawer |
|||
{ |
|||
public override bool OnGUI(SerializedDataParameter parameter, GUIContent title) |
|||
{ |
|||
var value = parameter.value; |
|||
|
|||
if (value.propertyType != SerializedPropertyType.Float) |
|||
return false; |
|||
|
|||
var o = parameter.GetObjectRef<NoInterpClampedFloatParameter>(); |
|||
EditorGUILayout.Slider(value, o.min, o.max, title); |
|||
value.floatValue = Mathf.Clamp(value.floatValue, o.min, o.max); |
|||
return true; |
|||
} |
|||
} |
|||
|
|||
[VolumeParameterDrawer(typeof(FloatRangeParameter))] |
|||
sealed class FloatRangeParameterDrawer : VolumeParameterDrawer |
|||
{ |
|||
public override bool OnGUI(SerializedDataParameter parameter, GUIContent title) |
|||
{ |
|||
var value = parameter.value; |
|||
|
|||
if (value.propertyType != SerializedPropertyType.Vector2) |
|||
return false; |
|||
|
|||
var o = parameter.GetObjectRef<FloatRangeParameter>(); |
|||
var v = value.vector2Value; |
|||
|
|||
// The layout system breaks alignement when mixing inspector fields with custom layouted
|
|||
// fields as soon as a scrollbar is needed in the inspector, so we'll do the layout
|
|||
// manually instead
|
|||
const int kFloatFieldWidth = 50; |
|||
const int kSeparatorWidth = 5; |
|||
float indentOffset = EditorGUI.indentLevel * 15f; |
|||
var lineRect = GUILayoutUtility.GetRect(1, EditorGUIUtility.singleLineHeight); |
|||
lineRect.xMin += 4f; |
|||
lineRect.y += 2f; |
|||
var labelRect = new Rect(lineRect.x, lineRect.y, EditorGUIUtility.labelWidth - indentOffset, lineRect.height); |
|||
var floatFieldLeft = new Rect(labelRect.xMax, lineRect.y, kFloatFieldWidth + indentOffset, lineRect.height); |
|||
var sliderRect = new Rect(floatFieldLeft.xMax + kSeparatorWidth - indentOffset, lineRect.y, lineRect.width - labelRect.width - kFloatFieldWidth * 2 - kSeparatorWidth * 2, lineRect.height); |
|||
var floatFieldRight = new Rect(sliderRect.xMax + kSeparatorWidth - indentOffset, lineRect.y, kFloatFieldWidth + indentOffset, lineRect.height); |
|||
|
|||
EditorGUI.PrefixLabel(labelRect, title); |
|||
v.x = EditorGUI.FloatField(floatFieldLeft, v.x); |
|||
EditorGUI.MinMaxSlider(sliderRect, ref v.x, ref v.y, o.min, o.max); |
|||
v.y = EditorGUI.FloatField(floatFieldRight, v.y); |
|||
|
|||
value.vector2Value = v; |
|||
return true; |
|||
} |
|||
} |
|||
} |
|
|||
using UnityEngine; |
|||
using UnityEngine.Experimental.Rendering; |
|||
|
|||
namespace UnityEditor.Experimental.Rendering |
|||
{ |
|||
[VolumeParameterDrawer(typeof(MinIntParameter))] |
|||
sealed class MinIntParameterDrawer : VolumeParameterDrawer |
|||
{ |
|||
public override bool OnGUI(SerializedDataParameter parameter, GUIContent title) |
|||
{ |
|||
var value = parameter.value; |
|||
|
|||
if (value.propertyType != SerializedPropertyType.Integer) |
|||
return false; |
|||
|
|||
var o = parameter.GetObjectRef<MinIntParameter>(); |
|||
int v = EditorGUILayout.IntField(title, value.intValue); |
|||
value.intValue = Mathf.Max(v, o.min); |
|||
return true; |
|||
} |
|||
} |
|||
|
|||
[VolumeParameterDrawer(typeof(NoInterpMinIntParameter))] |
|||
sealed class NoInterpMinIntParameterDrawer : VolumeParameterDrawer |
|||
{ |
|||
public override bool OnGUI(SerializedDataParameter parameter, GUIContent title) |
|||
{ |
|||
var value = parameter.value; |
|||
|
|||
if (value.propertyType != SerializedPropertyType.Integer) |
|||
return false; |
|||
|
|||
var o = parameter.GetObjectRef<NoInterpMinIntParameter>(); |
|||
int v = EditorGUILayout.IntField(title, value.intValue); |
|||
value.intValue = Mathf.Max(v, o.min); |
|||
return true; |
|||
} |
|||
} |
|||
|
|||
[VolumeParameterDrawer(typeof(MaxIntParameter))] |
|||
sealed class MaxIntParameterDrawer : VolumeParameterDrawer |
|||
{ |
|||
public override bool OnGUI(SerializedDataParameter parameter, GUIContent title) |
|||
{ |
|||
var value = parameter.value; |
|||
|
|||
if (value.propertyType != SerializedPropertyType.Integer) |
|||
return false; |
|||
|
|||
var o = parameter.GetObjectRef<MaxIntParameter>(); |
|||
int v = EditorGUILayout.IntField(title, value.intValue); |
|||
value.intValue = Mathf.Min(v, o.max); |
|||
return true; |
|||
} |
|||
} |
|||
|
|||
[VolumeParameterDrawer(typeof(NoInterpMaxIntParameter))] |
|||
sealed class NoInterpMaxIntParameterDrawer : VolumeParameterDrawer |
|||
{ |
|||
public override bool OnGUI(SerializedDataParameter parameter, GUIContent title) |
|||
{ |
|||
var value = parameter.value; |
|||
|
|||
if (value.propertyType != SerializedPropertyType.Integer) |
|||
return false; |
|||
|
|||
var o = parameter.GetObjectRef<NoInterpMaxIntParameter>(); |
|||
int v = EditorGUILayout.IntField(title, value.intValue); |
|||
value.intValue = Mathf.Min(v, o.max); |
|||
return true; |
|||
} |
|||
} |
|||
|
|||
[VolumeParameterDrawer(typeof(ClampedIntParameter))] |
|||
sealed class ClampedIntParameterDrawer : VolumeParameterDrawer |
|||
{ |
|||
public override bool OnGUI(SerializedDataParameter parameter, GUIContent title) |
|||
{ |
|||
var value = parameter.value; |
|||
|
|||
if (value.propertyType != SerializedPropertyType.Integer) |
|||
return false; |
|||
|
|||
var o = parameter.GetObjectRef<ClampedIntParameter>(); |
|||
EditorGUILayout.IntSlider(value, o.min, o.max, title); |
|||
value.intValue = Mathf.Clamp(value.intValue, o.min, o.max); |
|||
return true; |
|||
} |
|||
} |
|||
|
|||
[VolumeParameterDrawer(typeof(NoInterpClampedIntParameter))] |
|||
sealed class NoInterpClampedIntParameterDrawer : VolumeParameterDrawer |
|||
{ |
|||
public override bool OnGUI(SerializedDataParameter parameter, GUIContent title) |
|||
{ |
|||
var value = parameter.value; |
|||
|
|||
if (value.propertyType != SerializedPropertyType.Integer) |
|||
return false; |
|||
|
|||
var o = parameter.GetObjectRef<NoInterpClampedIntParameter>(); |
|||
EditorGUILayout.IntSlider(value, o.min, o.max, title); |
|||
value.intValue = Mathf.Clamp(value.intValue, o.min, o.max); |
|||
return true; |
|||
} |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: 25455a79ee8c96d4fb3ca2e64d8092e1 |
|||
folderAsset: yes |
|||
DefaultImporter: |
|||
externalObjects: {} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
using System.Collections; |
|||
using System.Collections.Generic; |
|||
using UnityEngine; |
|||
using UnityEditor; |
|||
|
|||
public class PlayModeTestFramework : EditorWindow |
|||
{ |
|||
static string scenesRootPath = "/Tests/GraphicsTests/RenderPipeline/HDRenderPipeline/Scenes"; |
|||
|
|||
enum Platforms { PC, PS4}; |
|||
Platforms platform = Platforms.PC; |
|||
|
|||
bool developmentBuild = false; |
|||
bool buildAndRun = true; |
|||
|
|||
[MenuItem("Internal/GraphicTest Tools/PlayMode Test Window")] |
|||
public static void OpenPlayModeTestWindow() |
|||
{ |
|||
PlayModeTestFramework window = GetWindow<PlayModeTestFramework>(); |
|||
|
|||
// find all the scenes
|
|||
window.allPaths = System.IO.Directory.GetFiles(Application.dataPath+scenesRootPath, "*.unity", System.IO.SearchOption.AllDirectories); |
|||
|
|||
for (int i = 0; i < window.allPaths.Length; ++i) |
|||
{ |
|||
window.allPaths[i] = "Assets" + window.allPaths[i].Replace(Application.dataPath, ""); |
|||
} |
|||
|
|||
//Debug.Log("Scenes found : " + window.allPaths.Length);
|
|||
|
|||
for (int i = 0; i < window.allPaths.Length; ++i) |
|||
{ |
|||
Debug.Log(window.allPaths[i]); |
|||
} |
|||
} |
|||
|
|||
string[] allPaths; |
|||
|
|||
private void OnGUI() |
|||
{ |
|||
scenesRootPath = EditorGUILayout.TextField(scenesRootPath); |
|||
|
|||
for (int i = 0; i < allPaths.Length; ++i) |
|||
{ |
|||
GUILayout.Label(allPaths[i]); |
|||
} |
|||
|
|||
platform = (Platforms)EditorGUILayout.EnumPopup("Target Platform ", platform); |
|||
|
|||
developmentBuild = EditorGUILayout.Toggle("Development Build", developmentBuild); |
|||
|
|||
buildAndRun = EditorGUILayout.Toggle("Build and Run", buildAndRun); |
|||
|
|||
if (GUILayout.Button("Build Player")) |
|||
{ |
|||
EditorBuildSettingsScene[] prevScenes = EditorBuildSettings.scenes; |
|||
|
|||
EditorBuildSettingsScene[] testScenes = new EditorBuildSettingsScene[allPaths.Length+1]; |
|||
|
|||
testScenes[0] = new EditorBuildSettingsScene(Application.dataPath+ "/Tests/GraphicsTests/RenderPipeline/HDRenderPipeline/PlayModeTest/PlayModeTests.unity", true); |
|||
|
|||
for (int i=0; i<allPaths.Length;++i) |
|||
{ |
|||
testScenes[i+1] = new EditorBuildSettingsScene(allPaths[i], true); |
|||
} |
|||
|
|||
Debug.Log("Do build in : " + Application.dataPath + "/../Builds/GraphicTests/GraphicTestBuildPC.exe"); |
|||
|
|||
// Move all templates to a Resources folder for build
|
|||
string[] templates = AssetDatabase.FindAssets("t:Texture2D" , new string[] { "Assets/ImageTemplates/HDRenderPipeline" }); |
|||
|
|||
Debug.Log("Found " + templates.Length + " template images."); |
|||
|
|||
string[] oldPaths = new string[templates.Length]; |
|||
string[] newPaths = new string[templates.Length]; |
|||
|
|||
if (!AssetDatabase.IsValidFolder("Assets/Resources")) AssetDatabase.CreateFolder("Assets", "Resources"); |
|||
|
|||
for (int i=0; i<templates.Length;++i) |
|||
{ |
|||
oldPaths[i] = AssetDatabase.GUIDToAssetPath(templates[i]); |
|||
newPaths[i] = "Assets/Resources/" + System.IO.Path.GetFileName( oldPaths[i] ); |
|||
|
|||
//Debug.Log("Move " + oldPaths[i] + " to " + newPaths[i]);
|
|||
|
|||
AssetDatabase.MoveAsset(oldPaths[i], newPaths[i]); |
|||
} |
|||
|
|||
//string[] templates = System.IO.Directory.GetFiles(Application.dataPath + scenesRootPath, "*.unity", System.IO.SearchOption.AllDirectories);
|
|||
|
|||
//System.IO.Directory.Move(Application.dataPath + "/ImageTemplates/HDRenderPipeline", Application.dataPath + "/ImageTemplates/Resources/HDRenderPipeline");
|
|||
|
|||
BuildOptions options = BuildOptions.None; |
|||
if (developmentBuild) options |= BuildOptions.Development; |
|||
if (buildAndRun) options |= BuildOptions.AutoRunPlayer; |
|||
|
|||
switch (platform) |
|||
{ |
|||
case Platforms.PC: |
|||
BuildPipeline.BuildPlayer(testScenes, Application.dataPath + "/../Builds/GraphicTests/PC/GraphicTestBuildPC.exe", BuildTarget.StandaloneWindows64, options); |
|||
break; |
|||
case Platforms.PS4: |
|||
BuildPipeline.BuildPlayer(testScenes, Application.dataPath + "/../Builds/GraphicTests/PS4/GraphicTestBuildPS4.self", BuildTarget.PS4, options); |
|||
break; |
|||
} |
|||
|
|||
// Move back Templates to their folder
|
|||
for (int i = 0; i < templates.Length; ++i) |
|||
{ |
|||
AssetDatabase.MoveAsset(newPaths[i], oldPaths[i]); |
|||
} |
|||
} |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: 6346510ae1ab8d346b76631a3152ecf1 |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
fileFormatVersion: 2 |
|||
guid: 8a6a52a0337d590469d021015e0af4ce |
|||
folderAsset: yes |
|||
DefaultImporter: |
|||
externalObjects: {} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
// ---------------------------------------------------------------------------- |
|||
// SSS/Transmittance helper |
|||
// ---------------------------------------------------------------------------- |
|||
|
|||
// Computes the fraction of light passing through the object. |
|||
// Evaluate Int{0, inf}{2 * Pi * r * R(sqrt(r^2 + d^2))}, where R is the diffusion profile. |
|||
// Note: 'volumeAlbedo' should be premultiplied by 0.25. |
|||
// Ref: Approximate Reflectance Profiles for Efficient Subsurface Scattering by Pixar (BSSRDF only). |
|||
float3 ComputeTransmittanceDisney(float3 S, float3 volumeAlbedo, float thickness, float radiusScale) |
|||
{ |
|||
// Thickness and SSS radius are decoupled for artists. |
|||
// In theory, we should modify the thickness by the inverse of the radius scale of the profile. |
|||
// thickness /= radiusScale; |
|||
|
|||
#if 0 |
|||
float3 expOneThird = exp(((-1.0 / 3.0) * thickness) * S); |
|||
#else |
|||
// Help the compiler. |
|||
float k = (-1.0 / 3.0) * LOG2_E; |
|||
float3 p = (k * thickness) * S; |
|||
float3 expOneThird = exp2(p); |
|||
#endif |
|||
|
|||
// Premultiply & optimize: T = (1/4 * A) * (e^(-t * S) + 3 * e^(-1/3 * t * S)) |
|||
return volumeAlbedo * (expOneThird * expOneThird * expOneThird + 3 * expOneThird); |
|||
} |
|||
|
|||
// Evaluates transmittance for a linear combination of two normalized 2D Gaussians. |
|||
// Ref: Real-Time Realistic Skin Translucency (2010), equation 9 (modified). |
|||
// Note: 'volumeAlbedo' should be premultiplied by 0.25, correspondingly 'lerpWeight' by 4, |
|||
// and 'halfRcpVariance1' should be prescaled by (0.1 * SssConstants.SSS_BASIC_DISTANCE_SCALE)^2. |
|||
float3 ComputeTransmittanceJimenez(float3 halfRcpVariance1, float lerpWeight1, |
|||
float3 halfRcpVariance2, float lerpWeight2, |
|||
float3 volumeAlbedo, float thickness, float radiusScale) |
|||
{ |
|||
// Thickness and SSS radius are decoupled for artists. |
|||
// In theory, we should modify the thickness by the inverse of the radius scale of the profile. |
|||
// thickness /= radiusScale; |
|||
|
|||
float t2 = thickness * thickness; |
|||
|
|||
// T = A * lerp(exp(-t2 * halfRcpVariance1), exp(-t2 * halfRcpVariance2), lerpWeight2) |
|||
return volumeAlbedo * (exp(-t2 * halfRcpVariance1) * lerpWeight1 + exp(-t2 * halfRcpVariance2) * lerpWeight2); |
|||
} |
|||
|
|||
// In order to support subsurface scattering, we need to know which pixels have an SSS material. |
|||
// It can be accomplished by reading the stencil buffer. |
|||
// A faster solution (which avoids an extra texture fetch) is to simply make sure that |
|||
// all pixels which belong to an SSS material are not black (those that don't always are). |
|||
// We choose the blue color channel since it's perceptually the least noticeable. |
|||
float3 TagLightingForSSS(float3 subsurfaceLighting) |
|||
{ |
|||
subsurfaceLighting.b = max(subsurfaceLighting.b, HALF_MIN); |
|||
return subsurfaceLighting; |
|||
} |
|||
|
|||
// See TagLightingForSSS() for details. |
|||
bool TestLightingForSSS(float3 subsurfaceLighting) |
|||
{ |
|||
return subsurfaceLighting.b > 0; |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: 36fe3aa095067a7488fddbb64cde2e3c |
|||
ShaderImporter: |
|||
externalObjects: {} |
|||
defaultTextures: [] |
|||
nonModifiableTextures: [] |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
fileFormatVersion: 2 |
|||
guid: fb3f658c087068440b2c5063fc3abaed |
|||
folderAsset: yes |
|||
DefaultImporter: |
|||
externalObjects: {} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
fileFormatVersion: 2 |
|||
guid: 4073853f945109f47901ba54281a18af |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
fileFormatVersion: 2 |
|||
guid: 5fbf42188568d5247aae2304fc8c805e |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
#include "SubsurfaceScatteringSettings.cs.hlsl" |
|||
#include "ShaderLibrary\Packing.hlsl" |
|||
#include "CommonSubsurfaceScattering.hlsl" |
|||
|
|||
// Subsurface scattering constant |
|||
#define SSS_WRAP_ANGLE (PI/12) // 15 degrees |
|||
#define SSS_WRAP_LIGHT cos(PI/2 - SSS_WRAP_ANGLE) |
|||
|
|||
CBUFFER_START(UnitySSSParameters) |
|||
// Warning: Unity is not able to losslessly transfer integers larger than 2^24 to the shader system. |
|||
// Therefore, we bitcast uint to float in C#, and bitcast back to uint in the shader. |
|||
uint _EnableSSSAndTransmission; // Globally toggles subsurface and transmission scattering on/off |
|||
float _TexturingModeFlags; // 1 bit/profile; 0 = PreAndPostScatter, 1 = PostScatter |
|||
float _TransmissionFlags; // 2 bit/profile; 0 = inf. thick, 1 = thin, 2 = regular |
|||
// Old SSS Model >>> |
|||
uint _UseDisneySSS; |
|||
float4 _HalfRcpVariancesAndWeights[SSS_N_PROFILES][2]; // 2x Gaussians in RGB, A is interpolation weights |
|||
// <<< Old SSS Model |
|||
// Use float4 to avoid any packing issue between compute and pixel shaders |
|||
float4 _ThicknessRemaps[SSS_N_PROFILES]; // R: start, G = end - start, BA unused |
|||
float4 _ShapeParams[SSS_N_PROFILES]; // RGB = S = 1 / D, A = filter radius |
|||
float4 _TransmissionTints[SSS_N_PROFILES]; // RGB = 1/4 * color, A = unused |
|||
float4 _WorldScales[SSS_N_PROFILES]; // X = meters per world unit; Y = world units per meter |
|||
CBUFFER_END |
|||
|
|||
// ---------------------------------------------------------------------------- |
|||
// helper functions |
|||
// ---------------------------------------------------------------------------- |
|||
|
|||
// Returns the modified albedo (diffuse color) for materials with subsurface scattering. |
|||
// Ref: Advanced Techniques for Realistic Real-Time Skin Rendering. |
|||
float3 ApplyDiffuseTexturingMode(float3 color, int subsurfaceProfile) |
|||
{ |
|||
#if defined(SHADERPASS) && (SHADERPASS == SHADERPASS_SUBSURFACE_SCATTERING) |
|||
// If the SSS pass is executed, we know we have SSS enabled. |
|||
bool enableSssAndTransmission = true; |
|||
#else |
|||
bool enableSssAndTransmission = _EnableSSSAndTransmission != 0; |
|||
#endif |
|||
|
|||
if (enableSssAndTransmission) |
|||
{ |
|||
bool performPostScatterTexturing = IsBitSet(asuint(_TexturingModeFlags), subsurfaceProfile); |
|||
|
|||
if (performPostScatterTexturing) |
|||
{ |
|||
// Post-scatter texturing mode: the albedo is only applied during the SSS pass. |
|||
#if !defined(SHADERPASS) || (SHADERPASS != SHADERPASS_SUBSURFACE_SCATTERING) |
|||
color = float3(1, 1, 1); |
|||
#endif |
|||
} |
|||
else |
|||
{ |
|||
// Pre- and post- scatter texturing mode. |
|||
color = sqrt(color); |
|||
} |
|||
} |
|||
|
|||
return color; |
|||
} |
|||
|
|||
// ---------------------------------------------------------------------------- |
|||
// Encoding/decoding SSS buffer functions |
|||
// ---------------------------------------------------------------------------- |
|||
|
|||
struct SSSData |
|||
{ |
|||
float3 diffuseColor; |
|||
float subsurfaceRadius; |
|||
int subsurfaceProfile; |
|||
}; |
|||
|
|||
#define SSSBufferType0 float4 |
|||
|
|||
// SSSBuffer texture declaration |
|||
TEXTURE2D(_SSSBufferTexture0); |
|||
|
|||
void EncodeIntoSSSBuffer(SSSData sssData, uint2 positionSS, out SSSBufferType0 outSSSBuffer0) |
|||
{ |
|||
outSSSBuffer0 = float4(sssData.diffuseColor, PackFloatInt8bit(sssData.subsurfaceRadius, sssData.subsurfaceProfile, 16.0)); |
|||
} |
|||
|
|||
void DecodeFromSSSBuffer(float4 sssBuffer, uint2 positionSS, out SSSData sssData) |
|||
{ |
|||
sssData.diffuseColor = sssBuffer.rgb; |
|||
UnpackFloatInt8bit(sssBuffer.a, 16.0, sssData.subsurfaceRadius, sssData.subsurfaceProfile); |
|||
} |
|||
|
|||
void DecodeFromSSSBuffer(uint2 positionSS, out SSSData sssData) |
|||
{ |
|||
float4 sssBuffer = LOAD_TEXTURE2D(_SSSBufferTexture0, positionSS); |
|||
DecodeFromSSSBuffer(sssBuffer, positionSS, sssData); |
|||
} |
|||
|
|||
// OUTPUT_SSSBUFFER start from SV_Target2 as SV_Target0 and SV_Target1 are used for lighting buffer |
|||
#define OUTPUT_SSSBUFFER(NAME) out GBufferType0 MERGE_NAME(NAME, 0) : SV_Target2 |
|||
#define ENCODE_INTO_SSSBUFFER(SURFACE_DATA, UNPOSITIONSS, NAME) EncodeIntoSSSBuffer(ConvertSurfaceDataToSSSData(SURFACE_DATA), UNPOSITIONSS, MERGE_NAME(NAME, 0)) |
|||
|
|||
#define DECODE_FROM_SSSBUFFER(UNPOSITIONSS, SSS_DATA) DecodeFromSSSBuffer(UNPOSITIONSS, SSS_DATA) |
|
|||
fileFormatVersion: 2 |
|||
guid: a9f89d53a380e274590d02ddfabce53e |
|||
ShaderImporter: |
|||
externalObjects: {} |
|||
defaultTextures: [] |
|||
nonModifiableTextures: [] |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
using UnityEngine.Rendering; |
|||
using System; |
|||
|
|||
namespace UnityEngine.Experimental.Rendering.HDPipeline |
|||
{ |
|||
public class SubsurfaceScatteringManager |
|||
{ |
|||
// Currently we only support SSSBuffer with one buffer. If the shader code change, it may require to update the shader manager
|
|||
public const int k_MaxSSSBuffer = 1; |
|||
|
|||
readonly int m_SSSBuffer0; |
|||
readonly RenderTargetIdentifier m_SSSBuffer0RT; |
|||
|
|||
public int sssBufferCount { get { return k_MaxSSSBuffer; } } |
|||
|
|||
RenderTargetIdentifier[] m_ColorMRTs; |
|||
RenderTargetIdentifier[] m_RTIDs = new RenderTargetIdentifier[k_MaxSSSBuffer]; |
|||
|
|||
public SubsurfaceScatteringManager() |
|||
{ |
|||
m_SSSBuffer0RT = new RenderTargetIdentifier(m_SSSBuffer0); |
|||
} |
|||
|
|||
// In case of deferred, we must be in sync with SubsurfaceScattering.hlsl and lit.hlsl files and setup the correct buffers
|
|||
// for SSS
|
|||
public void InitGBuffers(int width, int height, GBufferManager gbufferManager, CommandBuffer cmd) |
|||
{ |
|||
m_RTIDs[0] = gbufferManager.GetGBuffers()[0]; |
|||
} |
|||
|
|||
// In case of full forward we must allocate the render target for forward SSS (or reuse one already existing)
|
|||
// TODO: Provide a way to reuse a render target
|
|||
public void InitGBuffers(int width, int height, CommandBuffer cmd) |
|||
{ |
|||
m_RTIDs[0] = m_SSSBuffer0RT; |
|||
|
|||
cmd.ReleaseTemporaryRT(m_SSSBuffer0); |
|||
cmd.GetTemporaryRT(m_SSSBuffer0, width, height, 0, FilterMode.Point, RenderTextureFormat.ARGB32, RenderTextureReadWrite.Linear); |
|||
} |
|||
|
|||
public RenderTargetIdentifier GetSSSBuffers(int index) |
|||
{ |
|||
Debug.Assert(index < sssBufferCount); |
|||
return m_RTIDs[index]; |
|||
} |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: 3cc1ef76b6eee1248b23ec5f6dee0bae |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
fileFormatVersion: 2 |
|||
guid: a68623b64163f324da6b52463c8a8aa7 |
|||
ShaderImporter: |
|||
externalObjects: {} |
|||
defaultTextures: [] |
|||
nonModifiableTextures: [] |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
fileFormatVersion: 2 |
|||
guid: b2686e09ec7aef44bad2843e4416f057 |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
%YAML 1.1 |
|||
%TAG !u! tag:unity3d.com,2011: |
|||
--- !u!21 &2100000 |
|||
Material: |
|||
serializedVersion: 6 |
|||
m_ObjectHideFlags: 0 |
|||
m_PrefabParentObject: {fileID: 0} |
|||
m_PrefabInternal: {fileID: 0} |
|||
m_Name: ComparerMaterial |
|||
m_Shader: {fileID: 4800000, guid: 4030519dc1af1174eaec0971fdec6372, type: 3} |
|||
m_ShaderKeywords: _ALBEDOAFFECTEMISSIVE_OFF _ALPHACUTOFFENABLE_OFF _DEPTHOFFSETENABLE_OFF |
|||
_DISTORTIONENABLE_OFF _DOUBLESIDEDENABLE_OFF _ENABLESPECULAROCCLUSION_OFF _ENABLEWIND_OFF |
|||
_PREREFRACTIONPASS_OFF |
|||
m_LightmapFlags: 4 |
|||
m_EnableInstancingVariants: 0 |
|||
m_DoubleSidedGI: 0 |
|||
m_CustomRenderQueue: -1 |
|||
stringTagMap: {} |
|||
disabledShaderPasses: [] |
|||
m_SavedProperties: |
|||
serializedVersion: 3 |
|||
m_TexEnvs: |
|||
- _AnisotropyMap: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _BaseColorMap: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _BentNormalMap: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _BentNormalMapOS: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _CompareTex: |
|||
m_Texture: {fileID: 2800000, guid: 1c8d92d1059378247a61bde39017c642, type: 3} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _DetailMap: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _DistortionVectorMap: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _EmissiveColorMap: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _HeightMap: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _MainTex: |
|||
m_Texture: {fileID: 2800000, guid: 7d7a53c4266976c4c9934572a37ca369, type: 3} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _MaskMap: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _NormalMap: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _NormalMapOS: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _SpecularColorMap: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _SubsurfaceRadiusMap: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _TangentMap: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _TangentMapOS: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _ThicknessMap: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _TransmittanceColorMap: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
m_Floats: |
|||
- _AORemapMax: 1 |
|||
- _AORemapMin: 0 |
|||
- _ATDistance: 1 |
|||
- _AlbedoAffectEmissive: 0 |
|||
- _AlphaCutoff: 0.5 |
|||
- _AlphaCutoffEnable: 0 |
|||
- _Anisotropy: 0 |
|||
- _BlendMode: 0 |
|||
- _CoatCoverage: 1 |
|||
- _CoatIOR: 0.5 |
|||
- _CullMode: 2 |
|||
- _Cutoff: 0.5 |
|||
- _DepthOffsetEnable: 0 |
|||
- _DetailAlbedoScale: 1 |
|||
- _DetailNormalScale: 1 |
|||
- _DetailSmoothnessScale: 1 |
|||
- _DisplacementLockObjectScale: 1 |
|||
- _DisplacementLockTilingScale: 1 |
|||
- _DisplacementMode: 0 |
|||
- _DistortionBlendMode: 0 |
|||
- _DistortionBlurBlendMode: 0 |
|||
- _DistortionBlurDstBlend: 0 |
|||
- _DistortionBlurRemapMax: 1 |
|||
- _DistortionBlurRemapMin: 0 |
|||
- _DistortionBlurScale: 1 |
|||
- _DistortionBlurSrcBlend: 0 |
|||
- _DistortionDepthTest: 1 |
|||
- _DistortionDstBlend: 0 |
|||
- _DistortionEnable: 0 |
|||
- _DistortionScale: 1 |
|||
- _DistortionSrcBlend: 0 |
|||
- _DistortionVectorBias: -1 |
|||
- _DistortionVectorScale: 2 |
|||
- _DoubleSidedEnable: 0 |
|||
- _DoubleSidedNormalMode: 1 |
|||
- _Drag: 1 |
|||
- _DstBlend: 0 |
|||
- _EmissiveColorMode: 1 |
|||
- _EmissiveIntensity: 0 |
|||
- _EnableBlendModePreserveSpecularLighting: 1 |
|||
- _EnableFogOnTransparent: 1 |
|||
- _EnableSpecularOcclusion: 0 |
|||
- _EnableWind: 0 |
|||
- _HeightAmplitude: 0.02 |
|||
- _HeightCenter: 0.5 |
|||
- _HeightMax: 1 |
|||
- _HeightMin: -1 |
|||
- _IOR: 1 |
|||
- _InitialBend: 1 |
|||
- _InvTilingScale: 1 |
|||
- _LineWidth: 0.001 |
|||
- _LinkDetailsWithBase: 1 |
|||
- _MaterialID: 1 |
|||
- _MaxMode: 0 |
|||
- _Metallic: 0 |
|||
- _Mode: 4 |
|||
- _NormalMapSpace: 0 |
|||
- _NormalScale: 1 |
|||
- _PPDLodThreshold: 5 |
|||
- _PPDMaxSamples: 15 |
|||
- _PPDMinSamples: 5 |
|||
- _PPDPrimitiveLength: 1 |
|||
- _PPDPrimitiveWidth: 1 |
|||
- _PreRefractionPass: 0 |
|||
- _RefractionMode: 0 |
|||
- _ResultSplit: 0.261993 |
|||
- _ShiverDirectionality: 0.5 |
|||
- _ShiverDrag: 0.2 |
|||
- _Smoothness: 1 |
|||
- _SmoothnessRemapMax: 1 |
|||
- _SmoothnessRemapMin: 0 |
|||
- _Split: 0.42501768 |
|||
- _SrcBlend: 1 |
|||
- _StencilRef: 2 |
|||
- _Stiffness: 1 |
|||
- _SubsurfaceProfile: 0 |
|||
- _SubsurfaceRadius: 1 |
|||
- _SurfaceType: 0 |
|||
- _TexWorldScale: 1 |
|||
- _Thickness: 1 |
|||
- _ThicknessMultiplier: 1 |
|||
- _UVBase: 0 |
|||
- _UVDetail: 0 |
|||
- _ZTestMode: 8 |
|||
- _ZWrite: 1 |
|||
m_Colors: |
|||
- _BaseColor: {r: 1, g: 1, b: 1, a: 1} |
|||
- _Color: {r: 1, g: 1, b: 1, a: 1} |
|||
- _DoubleSidedConstants: {r: 1, g: 1, b: -1, a: 0} |
|||
- _EmissionColor: {r: 1, g: 1, b: 1, a: 1} |
|||
- _EmissiveColor: {r: 1, g: 1, b: 1, a: 1} |
|||
- _InvPrimScale: {r: 1, g: 1, b: 0, a: 0} |
|||
- _SpecularColor: {r: 1, g: 1, b: 1, a: 1} |
|||
- _ThicknessRemap: {r: 0, g: 1, b: 0, a: 0} |
|||
- _TransmittanceColor: {r: 1, g: 1, b: 1, a: 1} |
|||
- _UVDetailsMappingMask: {r: 1, g: 0, b: 0, a: 0} |
|||
- _UVMappingMask: {r: 1, g: 0, b: 0, a: 0} |
|
|||
fileFormatVersion: 2 |
|||
guid: 52c77b86de47cf043a0140cdd2f021e9 |
|||
NativeFormatImporter: |
|||
externalObjects: {} |
|||
mainObjectFileID: 2100000 |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
Shader "GraphicTests/ComparerShader" |
|||
{ |
|||
Properties |
|||
{ |
|||
_MainTex("Texture", 2D) = "white" {} |
|||
_CompareTex("Texture", 2D) = "white" {} |
|||
[Enum(Red, 0, Green, 1, Blue, 2, Color, 3, Greyscale, 4, Heatmap, 5)] |
|||
_Mode("Mode", int) = 5 |
|||
[Toggle] _MaxMode("Max Mode", int)=0 |
|||
_Split("Split", Range(0,1)) = 0.5 |
|||
_ResultSplit ("Result Split", Range(0,1)) = 0.1 |
|||
_LineWidth("Line Width", float) = 0.001 |
|||
} |
|||
SubShader |
|||
{ |
|||
Tags { "RenderType"="Opaque" } |
|||
LOD 100 |
|||
|
|||
Pass |
|||
{ |
|||
CGPROGRAM |
|||
#pragma vertex vert |
|||
#pragma fragment frag |
|||
|
|||
#include "UnityCG.cginc" |
|||
|
|||
struct appdata |
|||
{ |
|||
float4 vertex : POSITION; |
|||
float2 uv : TEXCOORD0; |
|||
}; |
|||
|
|||
struct v2f |
|||
{ |
|||
float2 uv : TEXCOORD0; |
|||
float4 vertex : SV_POSITION; |
|||
}; |
|||
|
|||
sampler2D _MainTex; |
|||
sampler2D _CompareTex; |
|||
int _Mode, _MaxMode; |
|||
|
|||
float _Split, _ResultSplit, _LineWidth; |
|||
|
|||
v2f vert (appdata v) |
|||
{ |
|||
v2f o; |
|||
o.vertex = UnityObjectToClipPos(v.vertex); |
|||
o.uv = v.uv; |
|||
return o; |
|||
} |
|||
|
|||
fixed4 frag (v2f i) : SV_Target |
|||
{ |
|||
fixed4 c1 = tex2D(_MainTex, i.uv); |
|||
float2 uv2 = float2(i.uv.x, 1-i.uv.y); |
|||
fixed4 c2 = tex2D(_CompareTex, uv2); |
|||
|
|||
fixed4 o = c1 - c2; |
|||
o.a = 1; |
|||
o = abs(o); |
|||
|
|||
float f = (o.r + o.g + o.b) / 3; |
|||
|
|||
if (_MaxMode == 1) |
|||
f = max(o.r, max(o.g, o.b)); |
|||
|
|||
if (_Mode == 0) |
|||
o.gb = 0; |
|||
if (_Mode == 1) |
|||
o.rb = 0; |
|||
if (_Mode == 2) |
|||
o.rg = 0; |
|||
if (_Mode == 4) // Greyscale view |
|||
o.rgb = f; |
|||
if (_Mode == 5) // Heat view |
|||
{ |
|||
f = f * 3; |
|||
|
|||
o.b = 1-abs( clamp(f, 0, 2)-1) ; |
|||
o.g = 1-abs( clamp(f, 1, 3)-2 ); |
|||
o.r = clamp(f, 2, 3) - 2; |
|||
} |
|||
|
|||
_Split = lerp(_Split, 0.5, _ResultSplit); |
|||
|
|||
float a1 = saturate(_Split - _ResultSplit * 0.5 - _LineWidth); |
|||
float a2 = saturate(_Split - _ResultSplit * 0.5); |
|||
float b1 = saturate(_Split + _ResultSplit * 0.5); |
|||
float b2 = saturate(_Split + _ResultSplit * 0.5 + _LineWidth); |
|||
|
|||
if (i.uv.x < a1) |
|||
{ |
|||
o.rgb = c1.rgb; |
|||
} |
|||
else if (i.uv.x < a2) |
|||
{ |
|||
o.rgb = 0; |
|||
} |
|||
else if (i.uv.x > b2) |
|||
{ |
|||
o.rgb = c2.rgb; |
|||
} |
|||
else if (i.uv.x > b1) |
|||
{ |
|||
o.rgb = 0; |
|||
} |
|||
|
|||
return o; |
|||
} |
|||
ENDCG |
|||
} |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: 4030519dc1af1174eaec0971fdec6372 |
|||
ShaderImporter: |
|||
externalObjects: {} |
|||
defaultTextures: [] |
|||
nonModifiableTextures: [] |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
fileFormatVersion: 2 |
|||
guid: 7d7a53c4266976c4c9934572a37ca369 |
|||
TextureImporter: |
|||
fileIDToRecycleName: {} |
|||
externalObjects: {} |
|||
serializedVersion: 5 |
|||
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: 0 |
|||
grayScaleToAlpha: 0 |
|||
generateCubemap: 6 |
|||
cubemapConvolution: 0 |
|||
seamlessCubemap: 0 |
|||
textureFormat: 1 |
|||
maxTextureSize: 2048 |
|||
textureSettings: |
|||
serializedVersion: 2 |
|||
filterMode: 0 |
|||
aniso: -1 |
|||
mipBias: -1 |
|||
wrapU: -1 |
|||
wrapV: -1 |
|||
wrapW: -1 |
|||
nPOTScale: 1 |
|||
lightmap: 0 |
|||
compressionQuality: 50 |
|||
spriteMode: 0 |
|||
spriteExtrude: 1 |
|||
spriteMeshType: 1 |
|||
alignment: 0 |
|||
spritePivot: {x: 0.5, y: 0.5} |
|||
spriteBorder: {x: 0, y: 0, z: 0, w: 0} |
|||
spritePixelsToUnits: 100 |
|||
alphaUsage: 1 |
|||
alphaIsTransparency: 0 |
|||
spriteTessellationDetail: -1 |
|||
textureType: 0 |
|||
textureShape: 1 |
|||
singleChannelComponent: 0 |
|||
maxTextureSizeSet: 0 |
|||
compressionQualitySet: 0 |
|||
textureFormatSet: 0 |
|||
platformSettings: |
|||
- serializedVersion: 2 |
|||
buildTarget: DefaultTexturePlatform |
|||
maxTextureSize: 2048 |
|||
resizeAlgorithm: 0 |
|||
textureFormat: -1 |
|||
textureCompression: 0 |
|||
compressionQuality: 50 |
|||
crunchedCompression: 0 |
|||
allowsAlphaSplitting: 0 |
|||
overridden: 0 |
|||
androidETC2FallbackOverride: 0 |
|||
- serializedVersion: 2 |
|||
buildTarget: Standalone |
|||
maxTextureSize: 2048 |
|||
resizeAlgorithm: 0 |
|||
textureFormat: -1 |
|||
textureCompression: 0 |
|||
compressionQuality: 50 |
|||
crunchedCompression: 0 |
|||
allowsAlphaSplitting: 0 |
|||
overridden: 0 |
|||
androidETC2FallbackOverride: 0 |
|||
- serializedVersion: 2 |
|||
buildTarget: iPhone |
|||
maxTextureSize: 2048 |
|||
resizeAlgorithm: 0 |
|||
textureFormat: -1 |
|||
textureCompression: 0 |
|||
compressionQuality: 50 |
|||
crunchedCompression: 0 |
|||
allowsAlphaSplitting: 0 |
|||
overridden: 0 |
|||
androidETC2FallbackOverride: 0 |
|||
- serializedVersion: 2 |
|||
buildTarget: Windows Store Apps |
|||
maxTextureSize: 2048 |
|||
resizeAlgorithm: 0 |
|||
textureFormat: -1 |
|||
textureCompression: 0 |
|||
compressionQuality: 50 |
|||
crunchedCompression: 0 |
|||
allowsAlphaSplitting: 0 |
|||
overridden: 0 |
|||
androidETC2FallbackOverride: 0 |
|||
spriteSheet: |
|||
serializedVersion: 2 |
|||
sprites: [] |
|||
outline: [] |
|||
physicsShape: [] |
|||
bones: [] |
|||
spriteID: |
|||
vertices: [] |
|||
indices: |
|||
edges: [] |
|||
weights: [] |
|||
spritePackingTag: |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
部分文件因为文件数量过多而无法显示
撰写
预览
正在加载...
取消
保存
Reference in new issue