From 17b4217ce445668c971712c90587c7ba4bf394aa Mon Sep 17 00:00:00 2001 From: Chikashi Miyama Date: Thu, 12 Dec 2019 17:48:03 +0100 Subject: [PATCH] implement #136 --- UnityProject/Assembly-CSharp.csproj | 1 + UnityProject/Assets/Materials/Difference.mat | 259 ++++++++++++++++++ .../Assets/Materials/Difference.mat.meta | 8 + .../Resources/Shader/Difference.compute | 8 +- .../Scenes/Examples/Azure/AzureDemo.unity | 102 ++++++- .../Examples/Azure/AzureDemo.unity.meta | 5 - .../Kinect/MovementBakerRenderTexture.cs | 48 ++++ .../Kinect/MovementBakerRenderTexture.cs.meta | 11 + .../ShaderGraph/ApplyTexture.shadergraph | 54 ++++ .../ShaderGraph/ApplyTexture.shadergraph.meta | 10 + 10 files changed, 494 insertions(+), 12 deletions(-) create mode 100644 UnityProject/Assets/Materials/Difference.mat create mode 100644 UnityProject/Assets/Materials/Difference.mat.meta create mode 100644 UnityProject/Assets/Scripts/Kinect/MovementBakerRenderTexture.cs create mode 100644 UnityProject/Assets/Scripts/Kinect/MovementBakerRenderTexture.cs.meta create mode 100644 UnityProject/Assets/ShaderGraph/ApplyTexture.shadergraph create mode 100644 UnityProject/Assets/ShaderGraph/ApplyTexture.shadergraph.meta diff --git a/UnityProject/Assembly-CSharp.csproj b/UnityProject/Assembly-CSharp.csproj index 9a15eea..be20f64 100644 --- a/UnityProject/Assembly-CSharp.csproj +++ b/UnityProject/Assembly-CSharp.csproj @@ -103,6 +103,7 @@ + diff --git a/UnityProject/Assets/Materials/Difference.mat b/UnityProject/Assets/Materials/Difference.mat new file mode 100644 index 0000000..9f5f8f2 --- /dev/null +++ b/UnityProject/Assets/Materials/Difference.mat @@ -0,0 +1,259 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Difference + m_Shader: {fileID: -6465566751694194690, guid: b5bf8137947871e429240f7781018331, + type: 3} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: 2000 + stringTagMap: + MotionVector: User + disabledShaderPasses: + - DistortionVectors + - MOTIONVECTORS + - TransparentDepthPrepass + - TransparentDepthPostpass + - TransparentBackface + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - Texture2D_527D374F: + m_Texture: {fileID: 8400000, guid: f235609b825377142ab45895e91b6839, type: 2} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - Texture2D_C0B45AA6: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _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} + - _CoatMaskMap: + m_Texture: {fileID: 0} + 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} + - _IridescenceMaskMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _IridescenceThicknessMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 0} + 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} + - _SubsurfaceMaskMap: + 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 + - _AlphaCutoffPostpass: 0.5 + - _AlphaCutoffPrepass: 0.5 + - _AlphaCutoffShadow: 0.5 + - _AlphaDstBlend: 0 + - _AlphaSrcBlend: 1 + - _Anisotropy: 0 + - _BlendMode: 0 + - _CoatMask: 0 + - _CullMode: 2 + - _CullModeForward: 2 + - _Cutoff: 0.5 + - _DepthOffsetEnable: 0 + - _DetailAlbedoScale: 1 + - _DetailNormalScale: 1 + - _DetailSmoothnessScale: 1 + - _DiffusionProfile: 0 + - _DiffusionProfileHash: 0 + - _DisplacementLockObjectScale: 1 + - _DisplacementLockTilingScale: 1 + - _DisplacementMode: 0 + - _DistortionBlendMode: 0 + - _DistortionBlurBlendMode: 0 + - _DistortionBlurDstBlend: 1 + - _DistortionBlurRemapMax: 1 + - _DistortionBlurRemapMin: 0 + - _DistortionBlurScale: 1 + - _DistortionBlurSrcBlend: 1 + - _DistortionDepthTest: 1 + - _DistortionDstBlend: 1 + - _DistortionEnable: 0 + - _DistortionScale: 1 + - _DistortionSrcBlend: 1 + - _DistortionVectorBias: -1 + - _DistortionVectorScale: 2 + - _DoubleSidedEnable: 0 + - _DoubleSidedNormalMode: 1 + - _DstBlend: 0 + - _EmissiveColorMode: 1 + - _EmissiveExposureWeight: 1 + - _EmissiveIntensity: 1 + - _EmissiveIntensityUnit: 0 + - _EnableBlendModePreserveSpecularLighting: 1 + - _EnableFogOnTransparent: 1 + - _EnableGeometricSpecularAA: 0 + - _EnableSpecularOcclusion: 0 + - _EnergyConservingSpecularColor: 1 + - _HdrpVersion: 2 + - _HeightAmplitude: 0.02 + - _HeightCenter: 0.5 + - _HeightMapParametrization: 0 + - _HeightMax: 1 + - _HeightMin: -1 + - _HeightOffset: 0 + - _HeightPoMAmplitude: 2 + - _HeightTessAmplitude: 2 + - _HeightTessCenter: 0.5 + - _InvTilingScale: 1 + - _Ior: 1 + - _IridescenceMask: 1 + - _IridescenceThickness: 1 + - _LinkDetailsWithBase: 1 + - _MaterialID: 1 + - _Metallic: 0 + - _NormalMapSpace: 0 + - _NormalScale: 1 + - _PPDLodThreshold: 5 + - _PPDMaxSamples: 15 + - _PPDMinSamples: 5 + - _PPDPrimitiveLength: 1 + - _PPDPrimitiveWidth: 1 + - _ReceivesSSR: 0 + - _RefractionModel: 0 + - _RenderQueueType: 1 + - _RequireSplitLighting: 0 + - _SSRefractionProjectionModel: 0 + - _Smoothness: 0.5 + - _SmoothnessRemapMax: 1 + - _SmoothnessRemapMin: 0 + - _SpecularAAScreenSpaceVariance: 0.1 + - _SpecularAAThreshold: 0.2 + - _SrcBlend: 1 + - _StencilRef: 0 + - _StencilRefDepth: 32 + - _StencilRefDistortionVec: 64 + - _StencilRefGBuffer: 2 + - _StencilRefMV: 160 + - _StencilWriteMask: 3 + - _StencilWriteMaskDepth: 48 + - _StencilWriteMaskDistortionVec: 64 + - _StencilWriteMaskGBuffer: 51 + - _StencilWriteMaskMV: 176 + - _SubsurfaceMask: 1 + - _SupportDecals: 1 + - _SurfaceType: 0 + - _TexWorldScale: 1 + - _TexWorldScaleEmissive: 1 + - _Thickness: 1 + - _ThicknessMultiplier: 1 + - _TransmissionEnable: 1 + - _TransparentBackfaceEnable: 0 + - _TransparentCullMode: 2 + - _TransparentDepthPostpassEnable: 0 + - _TransparentDepthPrepassEnable: 0 + - _TransparentSortPriority: 0 + - _TransparentWritingMotionVec: 0 + - _UVBase: 0 + - _UVDetail: 0 + - _UVEmissive: 0 + - _UseEmissiveIntensity: 0 + - _UseShadowThreshold: 0 + - _ZTestDepthEqualForOpaque: 3 + - _ZTestGBuffer: 4 + - _ZTestModeDistortion: 4 + - _ZTestTransparent: 4 + - _ZWrite: 1 + m_Colors: + - _BaseColor: {r: 1, g: 1, b: 1, a: 1} + - _BaseColorMap_MipInfo: {r: 0, g: 0, b: 0, a: 0} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _DiffusionProfileAsset: {r: 0, g: 0, b: 0, a: 0} + - _DoubleSidedConstants: {r: 1, g: 1, b: -1, a: 0} + - _EmissionColor: {r: 1, g: 1, b: 1, a: 1} + - _EmissiveColor: {r: 0, g: 0, b: 0, a: 1} + - _EmissiveColorLDR: {r: 0, g: 0, b: 0, a: 1} + - _InvPrimScale: {r: 1, g: 1, b: 0, a: 0} + - _IridescenceThicknessRemap: {r: 0, 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} + - _UVMappingMaskEmissive: {r: 1, g: 0, b: 0, a: 0} diff --git a/UnityProject/Assets/Materials/Difference.mat.meta b/UnityProject/Assets/Materials/Difference.mat.meta new file mode 100644 index 0000000..1eba5d5 --- /dev/null +++ b/UnityProject/Assets/Materials/Difference.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 312d9549de079824294680133ce5530a +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityProject/Assets/Resources/Shader/Difference.compute b/UnityProject/Assets/Resources/Shader/Difference.compute index 65956a1..622e227 100644 --- a/UnityProject/Assets/Resources/Shader/Difference.compute +++ b/UnityProject/Assets/Resources/Shader/Difference.compute @@ -8,12 +8,12 @@ float Factor; [numthreads(8,8,1)] void CSMain (uint3 id : SV_DispatchThreadID) { - int xOffset = id.x * 64; - int yOffset = id.y * 53; + int xOffset = id.x * 256; // 2048 / 8 + int yOffset = id.y * 192; // 1536 / 8 - for(int localY = 0; localY < 53; ++localY) + for(int localY = 0; localY < 192; ++localY) { - for(int localX = 0; localX < 64; ++localX) + for(int localX = 0; localX < 256; ++localX) { uint2 coordinate = uint2(xOffset + localX, yOffset + localY); float inputValue = (float)Input[coordinate]; diff --git a/UnityProject/Assets/Scenes/Examples/Azure/AzureDemo.unity b/UnityProject/Assets/Scenes/Examples/Azure/AzureDemo.unity index 626d591..da05c91 100644 --- a/UnityProject/Assets/Scenes/Examples/Azure/AzureDemo.unity +++ b/UnityProject/Assets/Scenes/Examples/Azure/AzureDemo.unity @@ -332,7 +332,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 48e1b0f548fe9b74c90eb10da5cffd13, type: 3} m_Name: m_EditorClassIdentifier: - _deviceSettings: {fileID: 11400000, guid: f8122729f4736dd4ab99617ee19feec3, type: 2} + _deviceSettings: {fileID: 11400000, guid: c681badc1a8be8243af1e0c53d337b50, type: 2} _colorTexture: {fileID: 8400000, guid: 046aa26a9af8e164eb0b20672983a11f, type: 2} _positionTexture: {fileID: 8400000, guid: f235609b825377142ab45895e91b6839, type: 2} _shader: {fileID: 4800000, guid: c2bfd9668998b6848ac60594704c344c, type: 3} @@ -350,6 +350,7 @@ Transform: - {fileID: 1154359618} - {fileID: 1845254192} - {fileID: 1831436208} + - {fileID: 1484861665} m_Father: {fileID: 0} m_RootOrder: 2 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} @@ -549,7 +550,7 @@ Transform: m_GameObject: {fileID: 1331773691} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalScale: {x: 1, y: 1, z: 0} m_Children: [] m_Father: {fileID: 1785581067} m_RootOrder: 0 @@ -632,6 +633,101 @@ VisualEffect: m_Overridden: 1 m_Bool: m_Array: [] +--- !u!1 &1484861664 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1484861665} + - component: {fileID: 1484861668} + - component: {fileID: 1484861667} + - component: {fileID: 1484861666} + m_Layer: 0 + m_Name: Movement + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1484861665 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1484861664} + m_LocalRotation: {x: -0.7071068, y: 0, z: 0, w: 0.7071068} + m_LocalPosition: {x: 6, y: -6, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 646155286} + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: -90, y: 0, z: 0} +--- !u!114 &1484861666 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1484861664} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f128963a36eb50343881d16cb76cdc89, type: 3} + m_Name: + m_EditorClassIdentifier: + source: {fileID: 8400000, guid: f235609b825377142ab45895e91b6839, type: 2} + result: {fileID: 8400000, guid: 47d2c97bffd32844a8e61b250da6b7e5, type: 2} + computeShader: {fileID: 7200000, guid: 603dbf231b79f4245b124e6f915e3bd5, type: 3} + factor: 1 +--- !u!23 &1484861667 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1484861664} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 312d9549de079824294680133ce5530a, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!33 &1484861668 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1484861664} + m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0} --- !u!1 &1785581066 GameObject: m_ObjectHideFlags: 0 @@ -656,7 +752,7 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1785581066} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 6, y: -6, z: 0} + m_LocalPosition: {x: 0, y: 0, z: 5} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: - {fileID: 1331773692} diff --git a/UnityProject/Assets/Scenes/Examples/Azure/AzureDemo.unity.meta b/UnityProject/Assets/Scenes/Examples/Azure/AzureDemo.unity.meta index 2fea0e8..c2c33ce 100644 --- a/UnityProject/Assets/Scenes/Examples/Azure/AzureDemo.unity.meta +++ b/UnityProject/Assets/Scenes/Examples/Azure/AzureDemo.unity.meta @@ -1,10 +1,5 @@ fileFormatVersion: 2 -<<<<<<< HEAD:UnityProject/Assets/Scenes/Examples/Azure/AzureDemo.unity.meta guid: d2b605d5e6f33cb43a6b49852af3bc24 -======= -guid: df11262fc1b053a488b5cfbf724e4cda -folderAsset: yes ->>>>>>> refs/heads/master:UnityProject/Assets/Scenes/Examples/Azure.meta DefaultImporter: externalObjects: {} userData: diff --git a/UnityProject/Assets/Scripts/Kinect/MovementBakerRenderTexture.cs b/UnityProject/Assets/Scripts/Kinect/MovementBakerRenderTexture.cs new file mode 100644 index 0000000..753ddba --- /dev/null +++ b/UnityProject/Assets/Scripts/Kinect/MovementBakerRenderTexture.cs @@ -0,0 +1,48 @@ +using System; +using UnityEngine; +using UnityEngine.Events; + +namespace cylvester +{ + + public class MovementBakerRenderTexture : MonoBehaviour + { + [SerializeField] private RenderTexture input; + [SerializeField] private ComputeShader computeShader; + [SerializeField] private float factor = 1; + + private RenderTexture resultTexture_; + private RenderTexture previousFrameTexture_; + private int kernelHandle_; + private Renderer renderer_; + + private void Start() + { + resultTexture_ = new RenderTexture(input.width, input.height, 0, input.graphicsFormat) { enableRandomWrite = true }; + resultTexture_.Create(); + + previousFrameTexture_ = new RenderTexture(input.width, input.height, 0, input.graphicsFormat) { enableRandomWrite = true }; + previousFrameTexture_.Create(); + + kernelHandle_ = computeShader.FindKernel("CSMain"); + + renderer_ = GetComponent(); + } + + private void Update() + { + computeShader.SetTexture(kernelHandle_, "Input", input); + computeShader.SetTexture(kernelHandle_, "Previous", previousFrameTexture_); + computeShader.SetTexture(kernelHandle_, "Result", resultTexture_); + computeShader.SetFloat("Factor", factor); + + computeShader.Dispatch(kernelHandle_, 1, 1, 1); + + renderer_.material.SetTexture("_differenceTexture", resultTexture_); + + } + } + +} + + diff --git a/UnityProject/Assets/Scripts/Kinect/MovementBakerRenderTexture.cs.meta b/UnityProject/Assets/Scripts/Kinect/MovementBakerRenderTexture.cs.meta new file mode 100644 index 0000000..973ec03 --- /dev/null +++ b/UnityProject/Assets/Scripts/Kinect/MovementBakerRenderTexture.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f128963a36eb50343881d16cb76cdc89 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityProject/Assets/ShaderGraph/ApplyTexture.shadergraph b/UnityProject/Assets/ShaderGraph/ApplyTexture.shadergraph new file mode 100644 index 0000000..0101219 --- /dev/null +++ b/UnityProject/Assets/ShaderGraph/ApplyTexture.shadergraph @@ -0,0 +1,54 @@ +{ + "m_SerializedProperties": [ + { + "typeInfo": { + "fullName": "UnityEditor.ShaderGraph.TextureShaderProperty" + }, + "JSONnodeData": "{\n \"m_Name\": \"input\",\n \"m_GeneratePropertyBlock\": true,\n \"m_Guid\": {\n \"m_GuidSerialized\": \"eb8b82c4-a73e-486e-b918-e2a168ab542b\"\n },\n \"m_DefaultReferenceName\": \"Texture2D_527D374F\",\n \"m_OverrideReferenceName\": \"_differenceTexture\",\n \"m_Precision\": 0,\n \"m_Value\": {\n \"m_SerializedTexture\": \"{\\\"texture\\\":{\\\"instanceID\\\":0}}\",\n \"m_Guid\": \"\"\n },\n \"m_Modifiable\": true,\n \"m_DefaultType\": 0\n}" + } + ], + "m_SerializableNodes": [ + { + "typeInfo": { + "fullName": "UnityEditor.ShaderGraph.SampleTexture2DNode" + }, + "JSONnodeData": "{\n \"m_GuidSerialized\": \"7a73a08a-1852-429a-9f8d-7db24fbb2ee4\",\n \"m_GroupGuidSerialized\": \"00000000-0000-0000-0000-000000000000\",\n \"m_Name\": \"Sample Texture 2D\",\n \"m_DrawState\": {\n \"m_Expanded\": true,\n \"m_Position\": {\n \"serializedVersion\": \"2\",\n \"x\": -183.0,\n \"y\": -492.0,\n \"width\": 208.0,\n \"height\": 437.0\n }\n },\n \"m_SerializableSlots\": [\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.Vector4MaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 0,\\n \\\"m_DisplayName\\\": \\\"RGBA\\\",\\n \\\"m_SlotType\\\": 1,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"RGBA\\\",\\n \\\"m_StageCapability\\\": 2,\\n \\\"m_Value\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0,\\n \\\"w\\\": 0.0\\n },\\n \\\"m_DefaultValue\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0,\\n \\\"w\\\": 0.0\\n }\\n}\"\n },\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.Vector1MaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 4,\\n \\\"m_DisplayName\\\": \\\"R\\\",\\n \\\"m_SlotType\\\": 1,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"R\\\",\\n \\\"m_StageCapability\\\": 2,\\n \\\"m_Value\\\": 0.0,\\n \\\"m_DefaultValue\\\": 0.0,\\n \\\"m_Labels\\\": [\\n \\\"X\\\"\\n ]\\n}\"\n },\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.Vector1MaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 5,\\n \\\"m_DisplayName\\\": \\\"G\\\",\\n \\\"m_SlotType\\\": 1,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"G\\\",\\n \\\"m_StageCapability\\\": 2,\\n \\\"m_Value\\\": 0.0,\\n \\\"m_DefaultValue\\\": 0.0,\\n \\\"m_Labels\\\": [\\n \\\"X\\\"\\n ]\\n}\"\n },\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.Vector1MaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 6,\\n \\\"m_DisplayName\\\": \\\"B\\\",\\n \\\"m_SlotType\\\": 1,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"B\\\",\\n \\\"m_StageCapability\\\": 2,\\n \\\"m_Value\\\": 0.0,\\n \\\"m_DefaultValue\\\": 0.0,\\n \\\"m_Labels\\\": [\\n \\\"X\\\"\\n ]\\n}\"\n },\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.Vector1MaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 7,\\n \\\"m_DisplayName\\\": \\\"A\\\",\\n \\\"m_SlotType\\\": 1,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"A\\\",\\n \\\"m_StageCapability\\\": 2,\\n \\\"m_Value\\\": 0.0,\\n \\\"m_DefaultValue\\\": 0.0,\\n \\\"m_Labels\\\": [\\n \\\"X\\\"\\n ]\\n}\"\n },\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.Texture2DInputMaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 1,\\n \\\"m_DisplayName\\\": \\\"Texture\\\",\\n \\\"m_SlotType\\\": 0,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"Texture\\\",\\n \\\"m_StageCapability\\\": 3,\\n \\\"m_Texture\\\": {\\n \\\"m_SerializedTexture\\\": \\\"{\\\\\\\"texture\\\\\\\":{\\\\\\\"instanceID\\\\\\\":0}}\\\",\\n \\\"m_Guid\\\": \\\"\\\"\\n },\\n \\\"m_DefaultType\\\": 0\\n}\"\n },\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.UVMaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 2,\\n \\\"m_DisplayName\\\": \\\"UV\\\",\\n \\\"m_SlotType\\\": 0,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"UV\\\",\\n \\\"m_StageCapability\\\": 3,\\n \\\"m_Value\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0\\n },\\n \\\"m_DefaultValue\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0\\n },\\n \\\"m_Labels\\\": [\\n \\\"X\\\",\\n \\\"Y\\\"\\n ],\\n \\\"m_Channel\\\": 0\\n}\"\n },\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.SamplerStateMaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 3,\\n \\\"m_DisplayName\\\": \\\"Sampler\\\",\\n \\\"m_SlotType\\\": 0,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"Sampler\\\",\\n \\\"m_StageCapability\\\": 3\\n}\"\n }\n ],\n \"m_Precision\": 0,\n \"m_PreviewExpanded\": true,\n \"m_CustomColors\": {\n \"m_SerializableColors\": []\n },\n \"m_TextureType\": 0,\n \"m_NormalMapSpace\": 0\n}" + }, + { + "typeInfo": { + "fullName": "UnityEditor.ShaderGraph.PropertyNode" + }, + "JSONnodeData": "{\n \"m_GuidSerialized\": \"f237c037-81a8-48d6-a5f8-ee37a58d3eea\",\n \"m_GroupGuidSerialized\": \"00000000-0000-0000-0000-000000000000\",\n \"m_Name\": \"Property\",\n \"m_DrawState\": {\n \"m_Expanded\": true,\n \"m_Position\": {\n \"serializedVersion\": \"2\",\n \"x\": -399.0,\n \"y\": -452.0,\n \"width\": 105.0,\n \"height\": 34.0\n }\n },\n \"m_SerializableSlots\": [\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.Texture2DMaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 0,\\n \\\"m_DisplayName\\\": \\\"input\\\",\\n \\\"m_SlotType\\\": 1,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"Out\\\",\\n \\\"m_StageCapability\\\": 3\\n}\"\n }\n ],\n \"m_Precision\": 0,\n \"m_PreviewExpanded\": true,\n \"m_CustomColors\": {\n \"m_SerializableColors\": []\n },\n \"m_PropertyGuidSerialized\": \"eb8b82c4-a73e-486e-b918-e2a168ab542b\"\n}" + }, + { + "typeInfo": { + "fullName": "UnityEditor.Experimental.Rendering.HDPipeline.HDUnlitMasterNode" + }, + "JSONnodeData": "{\n \"m_GuidSerialized\": \"c4aa48ff-9408-4046-b9f2-6be85b2b1390\",\n \"m_GroupGuidSerialized\": \"00000000-0000-0000-0000-000000000000\",\n \"m_Name\": \"Unlit Master\",\n \"m_DrawState\": {\n \"m_Expanded\": true,\n \"m_Position\": {\n \"serializedVersion\": \"2\",\n \"x\": 296.0,\n \"y\": -511.0,\n \"width\": 200.0,\n \"height\": 173.0\n }\n },\n \"m_SerializableSlots\": [\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.PositionMaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 9,\\n \\\"m_DisplayName\\\": \\\"Position\\\",\\n \\\"m_SlotType\\\": 0,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"Position\\\",\\n \\\"m_StageCapability\\\": 1,\\n \\\"m_Value\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0\\n },\\n \\\"m_DefaultValue\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0\\n },\\n \\\"m_Labels\\\": [\\n \\\"X\\\",\\n \\\"Y\\\",\\n \\\"Z\\\"\\n ],\\n \\\"m_Space\\\": 0\\n}\"\n },\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.ColorRGBMaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 0,\\n \\\"m_DisplayName\\\": \\\"Color\\\",\\n \\\"m_SlotType\\\": 0,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"Color\\\",\\n \\\"m_StageCapability\\\": 2,\\n \\\"m_Value\\\": {\\n \\\"x\\\": 0.7353569269180298,\\n \\\"y\\\": 0.7353569269180298,\\n \\\"z\\\": 0.7353569269180298\\n },\\n \\\"m_DefaultValue\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0\\n },\\n \\\"m_Labels\\\": [\\n \\\"X\\\",\\n \\\"Y\\\",\\n \\\"Z\\\"\\n ],\\n \\\"m_ColorMode\\\": 0\\n}\"\n },\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.Vector1MaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 7,\\n \\\"m_DisplayName\\\": \\\"Alpha\\\",\\n \\\"m_SlotType\\\": 0,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"Alpha\\\",\\n \\\"m_StageCapability\\\": 2,\\n \\\"m_Value\\\": 1.0,\\n \\\"m_DefaultValue\\\": 1.0,\\n \\\"m_Labels\\\": [\\n \\\"X\\\"\\n ]\\n}\"\n },\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.Vector1MaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 8,\\n \\\"m_DisplayName\\\": \\\"AlphaClipThreshold\\\",\\n \\\"m_SlotType\\\": 0,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"AlphaClipThreshold\\\",\\n \\\"m_StageCapability\\\": 2,\\n \\\"m_Value\\\": 0.5,\\n \\\"m_DefaultValue\\\": 0.5,\\n \\\"m_Labels\\\": [\\n \\\"X\\\"\\n ]\\n}\"\n },\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.ColorRGBMaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 12,\\n \\\"m_DisplayName\\\": \\\"Emission\\\",\\n \\\"m_SlotType\\\": 0,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"Emission\\\",\\n \\\"m_StageCapability\\\": 2,\\n \\\"m_Value\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0\\n },\\n \\\"m_DefaultValue\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0\\n },\\n \\\"m_Labels\\\": [\\n \\\"X\\\",\\n \\\"Y\\\",\\n \\\"Z\\\"\\n ],\\n \\\"m_ColorMode\\\": 1\\n}\"\n }\n ],\n \"m_Precision\": 0,\n \"m_PreviewExpanded\": true,\n \"m_CustomColors\": {\n \"m_SerializableColors\": []\n },\n \"m_SerializableSubShaders\": [\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.Experimental.Rendering.HDPipeline.HDUnlitSubShader\"\n },\n \"JSONnodeData\": \"{}\"\n }\n ],\n \"m_SurfaceType\": 0,\n \"m_AlphaMode\": 0,\n \"m_RenderingPass\": 1,\n \"m_TransparencyFog\": true,\n \"m_DrawBeforeRefraction\": false,\n \"m_Distortion\": false,\n \"m_DistortionMode\": 0,\n \"m_DistortionOnly\": true,\n \"m_DistortionDepthTest\": true,\n \"m_AlphaTest\": false,\n \"m_SortPriority\": 0,\n \"m_DoubleSided\": false,\n \"m_ZWrite\": true,\n \"m_transparentCullMode\": 2,\n \"m_ZTest\": 4\n}" + } + ], + "m_Groups": [], + "m_SerializableEdges": [ + { + "typeInfo": { + "fullName": "UnityEditor.Graphing.Edge" + }, + "JSONnodeData": "{\n \"m_OutputSlot\": {\n \"m_SlotId\": 0,\n \"m_NodeGUIDSerialized\": \"f237c037-81a8-48d6-a5f8-ee37a58d3eea\"\n },\n \"m_InputSlot\": {\n \"m_SlotId\": 1,\n \"m_NodeGUIDSerialized\": \"7a73a08a-1852-429a-9f8d-7db24fbb2ee4\"\n }\n}" + }, + { + "typeInfo": { + "fullName": "UnityEditor.Graphing.Edge" + }, + "JSONnodeData": "{\n \"m_OutputSlot\": {\n \"m_SlotId\": 0,\n \"m_NodeGUIDSerialized\": \"7a73a08a-1852-429a-9f8d-7db24fbb2ee4\"\n },\n \"m_InputSlot\": {\n \"m_SlotId\": 0,\n \"m_NodeGUIDSerialized\": \"c4aa48ff-9408-4046-b9f2-6be85b2b1390\"\n }\n}" + } + ], + "m_PreviewData": { + "serializedMesh": { + "m_SerializedMesh": "{\"mesh\":{\"instanceID\":0}}", + "m_Guid": "" + } + }, + "m_Path": "Shader Graphs", + "m_ConcretePrecision": 0, + "m_ActiveOutputNodeGuidSerialized": "c4aa48ff-9408-4046-b9f2-6be85b2b1390" +} \ No newline at end of file diff --git a/UnityProject/Assets/ShaderGraph/ApplyTexture.shadergraph.meta b/UnityProject/Assets/ShaderGraph/ApplyTexture.shadergraph.meta new file mode 100644 index 0000000..263187c --- /dev/null +++ b/UnityProject/Assets/ShaderGraph/ApplyTexture.shadergraph.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: b5bf8137947871e429240f7781018331 +ScriptedImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 2 + userData: + assetBundleName: + assetBundleVariant: + script: {fileID: 11500000, guid: 625f186215c104763be7675aa2d941aa, type: 3}