From 2f409b3606716f60c9ee0638551d30cb48bd9228 Mon Sep 17 00:00:00 2001 From: _Redstone_c_ Date: Sun, 31 Jan 2021 14:03:48 +0800 Subject: [PATCH] Procedural Drawing --- Assets/Point/Point GPU.hlsl | 24 ++++ Assets/Point/Point GPU.hlsl.meta | 9 ++ Assets/Point/Point Surface GPU.mat | 78 ++++++++++++ Assets/Point/Point Surface GPU.mat.meta | 8 ++ Assets/Point/Point Surface GPU.shader | 35 ++++++ Assets/Point/Point Surface GPU.shader.meta | 9 ++ Assets/Point/Point URP GPU.mat | 90 ++++++++++++++ Assets/Point/Point URP GPU.mat.meta | 8 ++ Assets/Point/Point URP GPU.shadergraph | 128 ++++++++++++++++++++ Assets/Point/Point URP GPU.shadergraph.meta | 10 ++ Assets/Scenes/SampleScene.unity | 27 +---- Assets/Script/GPUGraph.cs | 17 ++- 12 files changed, 419 insertions(+), 24 deletions(-) create mode 100644 Assets/Point/Point GPU.hlsl create mode 100644 Assets/Point/Point GPU.hlsl.meta create mode 100644 Assets/Point/Point Surface GPU.mat create mode 100644 Assets/Point/Point Surface GPU.mat.meta create mode 100644 Assets/Point/Point Surface GPU.shader create mode 100644 Assets/Point/Point Surface GPU.shader.meta create mode 100644 Assets/Point/Point URP GPU.mat create mode 100644 Assets/Point/Point URP GPU.mat.meta create mode 100644 Assets/Point/Point URP GPU.shadergraph create mode 100644 Assets/Point/Point URP GPU.shadergraph.meta diff --git a/Assets/Point/Point GPU.hlsl b/Assets/Point/Point GPU.hlsl new file mode 100644 index 0000000..8020281 --- /dev/null +++ b/Assets/Point/Point GPU.hlsl @@ -0,0 +1,24 @@ +#if defined(UNITY_PROCEDURAL_INSTANCING_ENABLED) + StructuredBuffer _Positions; +#endif + +float _Step; + +void ConfigureProcedural() +{ + #if defined(UNITY_PROCEDURAL_INSTANCING_ENABLED) + float3 position = _Positions[unity_InstanceID]; + + unity_ObjectToWorld = 0.0; + unity_ObjectToWorld._m03_m13_m23_m33 = float4(position, 1.0); + unity_ObjectToWorld._m00_m11_m22 = _Step; + #endif +} + +void ShaderGraphFunction_float (float3 In, out float3 Out) { + Out = In; +} + +void ShaderGraphFunction_half (half3 In, out half3 Out) { + Out = In; +} diff --git a/Assets/Point/Point GPU.hlsl.meta b/Assets/Point/Point GPU.hlsl.meta new file mode 100644 index 0000000..a86df02 --- /dev/null +++ b/Assets/Point/Point GPU.hlsl.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 52ba3338a3c5fd040985e2d7cd13ae29 +ShaderImporter: + externalObjects: {} + defaultTextures: [] + nonModifiableTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Point/Point Surface GPU.mat b/Assets/Point/Point Surface GPU.mat new file mode 100644 index 0000000..9dc0d6e --- /dev/null +++ b/Assets/Point/Point Surface GPU.mat @@ -0,0 +1,78 @@ +%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: Point Surface GPU + m_Shader: {fileID: 4800000, guid: 777e5d31099aed84eab73d2aff7dcfca, type: 3} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + 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} + - _MetallicGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _BumpScale: 1 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 0 + - _GlossMapScale: 1 + - _Glossiness: 0.5 + - _GlossyReflections: 1 + - _Metallic: 0 + - _Mode: 0 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _Smoothness: 0.5 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _UVSec: 0 + - _ZWrite: 1 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} diff --git a/Assets/Point/Point Surface GPU.mat.meta b/Assets/Point/Point Surface GPU.mat.meta new file mode 100644 index 0000000..ed09a55 --- /dev/null +++ b/Assets/Point/Point Surface GPU.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 584eab0d393b59e40ac387043a54b24f +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Point/Point Surface GPU.shader b/Assets/Point/Point Surface GPU.shader new file mode 100644 index 0000000..876a0c8 --- /dev/null +++ b/Assets/Point/Point Surface GPU.shader @@ -0,0 +1,35 @@ +Shader "Graph/Point Surface GPU" +{ + Properties + { + _Smoothness("Smoothness", Range(0, 1)) = 0.5 + } + + SubShader + { + CGPROGRAM + #pragma surface ConfigureSurface Standard fullforwardshadows addshadow + #pragma instancing_options assumeuniformscaling procedural:ConfigureProcedural + #pragma editor_sync_compilation + #pragma target 4.5 + + #include "Point GPU.hlsl" + + struct Input + { + float3 worldPos; + }; + + float _Smoothness; + + void ConfigureSurface(Input input, inout SurfaceOutputStandard surface) + { + surface.Albedo = saturate(input.worldPos * 0.5 + 0.5); + surface.Smoothness = _Smoothness; + } + + ENDCG + } + + FallBack "Diffuse" +} diff --git a/Assets/Point/Point Surface GPU.shader.meta b/Assets/Point/Point Surface GPU.shader.meta new file mode 100644 index 0000000..8f07a8b --- /dev/null +++ b/Assets/Point/Point Surface GPU.shader.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 777e5d31099aed84eab73d2aff7dcfca +ShaderImporter: + externalObjects: {} + defaultTextures: [] + nonModifiableTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Point/Point URP GPU.mat b/Assets/Point/Point URP GPU.mat new file mode 100644 index 0000000..1baf7ff --- /dev/null +++ b/Assets/Point/Point URP GPU.mat @@ -0,0 +1,90 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &-3089080242542461839 +MonoBehaviour: + m_ObjectHideFlags: 11 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 2 +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Point URP GPU + m_Shader: {fileID: -6465566751694194690, guid: edb00fc61da38e141a5047af96ae1a0a, + type: 3} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BaseMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + 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} + - _MetallicGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _SpecGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _AlphaClip: 0 + - _Blend: 0 + - _BumpScale: 1 + - _Cull: 2 + - _Cutoff: 0.5 + - _DstBlend: 0 + - _EnvironmentReflections: 1 + - _GlossMapScale: 0 + - _Glossiness: 0 + - _GlossyReflections: 0 + - _Metallic: 0 + - _OcclusionStrength: 1 + - _QueueOffset: 0 + - _ReceiveShadows: 1 + - _Smoothness: 0.5 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _Surface: 0 + - _WorkflowMode: 1 + - _ZWrite: 1 + m_Colors: + - _BaseColor: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} + - _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1} diff --git a/Assets/Point/Point URP GPU.mat.meta b/Assets/Point/Point URP GPU.mat.meta new file mode 100644 index 0000000..786c96f --- /dev/null +++ b/Assets/Point/Point URP GPU.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: e470d4aed9c37a448b5bccf749811b9d +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Point/Point URP GPU.shadergraph b/Assets/Point/Point URP GPU.shadergraph new file mode 100644 index 0000000..6964106 --- /dev/null +++ b/Assets/Point/Point URP GPU.shadergraph @@ -0,0 +1,128 @@ +{ + "m_SerializedProperties": [ + { + "typeInfo": { + "fullName": "UnityEditor.ShaderGraph.Internal.Vector1ShaderProperty" + }, + "JSONnodeData": "{\n \"m_Guid\": {\n \"m_GuidSerialized\": \"8ed742a3-3f74-471c-a1a5-16af63ef5b0e\"\n },\n \"m_Name\": \"Smoothness\",\n \"m_DefaultReferenceName\": \"Vector1_5FB73066\",\n \"m_OverrideReferenceName\": \"\",\n \"m_GeneratePropertyBlock\": true,\n \"m_Precision\": 0,\n \"m_GPUInstanced\": false,\n \"m_Hidden\": false,\n \"m_Value\": 0.5,\n \"m_FloatType\": 1,\n \"m_RangeValues\": {\n \"x\": 0.0,\n \"y\": 1.0\n }\n}" + } + ], + "m_SerializedKeywords": [], + "m_SerializableNodes": [ + { + "typeInfo": { + "fullName": "UnityEditor.ShaderGraph.PBRMasterNode" + }, + "JSONnodeData": "{\n \"m_GuidSerialized\": \"37ad4730-8096-4fd1-858f-994f2a0a4afb\",\n \"m_GroupGuidSerialized\": \"00000000-0000-0000-0000-000000000000\",\n \"m_Name\": \"PBR Master\",\n \"m_NodeVersion\": 0,\n \"m_DrawState\": {\n \"m_Expanded\": false,\n \"m_Position\": {\n \"serializedVersion\": \"2\",\n \"x\": -77.0,\n \"y\": -18.0,\n \"width\": 200.0,\n \"height\": 125.0\n }\n },\n \"m_SerializableSlots\": [\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.PositionMaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 9,\\n \\\"m_DisplayName\\\": \\\"Vertex Position\\\",\\n \\\"m_SlotType\\\": 0,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"Vertex 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.NormalMaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 10,\\n \\\"m_DisplayName\\\": \\\"Vertex Normal\\\",\\n \\\"m_SlotType\\\": 0,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"Vertex Normal\\\",\\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.TangentMaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 11,\\n \\\"m_DisplayName\\\": \\\"Vertex Tangent\\\",\\n \\\"m_SlotType\\\": 0,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"Vertex Tangent\\\",\\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\\\": \\\"Albedo\\\",\\n \\\"m_SlotType\\\": 0,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"Albedo\\\",\\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.NormalMaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 1,\\n \\\"m_DisplayName\\\": \\\"Normal\\\",\\n \\\"m_SlotType\\\": 0,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"Normal\\\",\\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_Space\\\": 3\\n}\"\n },\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.ColorRGBMaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 4,\\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\\\": 0\\n}\"\n },\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.Vector1MaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 2,\\n \\\"m_DisplayName\\\": \\\"Metallic\\\",\\n \\\"m_SlotType\\\": 0,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"Metallic\\\",\\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\\\": \\\"Smoothness\\\",\\n \\\"m_SlotType\\\": 0,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"Smoothness\\\",\\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.Vector1MaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 6,\\n \\\"m_DisplayName\\\": \\\"Occlusion\\\",\\n \\\"m_SlotType\\\": 0,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"Occlusion\\\",\\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\\\": 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.0,\\n \\\"m_DefaultValue\\\": 0.0,\\n \\\"m_Labels\\\": [\\n \\\"X\\\"\\n ]\\n}\"\n }\n ],\n \"m_Precision\": 0,\n \"m_PreviewExpanded\": true,\n \"m_CustomColors\": {\n \"m_SerializableColors\": []\n },\n \"m_DOTSInstancing\": false,\n \"m_SerializableSubShaders\": [\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.Rendering.Universal.UniversalPBRSubShader\"\n },\n \"JSONnodeData\": \"{}\"\n }\n ],\n \"m_ShaderGUIOverride\": \"\",\n \"m_OverrideEnabled\": false,\n \"m_Model\": 1,\n \"m_SurfaceType\": 0,\n \"m_AlphaMode\": 0,\n \"m_TwoSided\": false,\n \"m_NormalDropOffSpace\": 0\n}" + }, + { + "typeInfo": { + "fullName": "UnityEditor.ShaderGraph.PropertyNode" + }, + "JSONnodeData": "{\n \"m_GuidSerialized\": \"0b3c1510-7eb1-4a70-b16a-1c9b6d8e2e94\",\n \"m_GroupGuidSerialized\": \"00000000-0000-0000-0000-000000000000\",\n \"m_Name\": \"Property\",\n \"m_NodeVersion\": 0,\n \"m_DrawState\": {\n \"m_Expanded\": true,\n \"m_Position\": {\n \"serializedVersion\": \"2\",\n \"x\": -401.0,\n \"y\": 161.0,\n \"width\": 149.0,\n \"height\": 34.0\n }\n },\n \"m_SerializableSlots\": [\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.Vector1MaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 0,\\n \\\"m_DisplayName\\\": \\\"Smoothness\\\",\\n \\\"m_SlotType\\\": 1,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"Out\\\",\\n \\\"m_StageCapability\\\": 3,\\n \\\"m_Value\\\": 0.0,\\n \\\"m_DefaultValue\\\": 0.0,\\n \\\"m_Labels\\\": [\\n \\\"X\\\"\\n ]\\n}\"\n }\n ],\n \"m_Precision\": 0,\n \"m_PreviewExpanded\": true,\n \"m_CustomColors\": {\n \"m_SerializableColors\": []\n },\n \"m_PropertyGuidSerialized\": \"8ed742a3-3f74-471c-a1a5-16af63ef5b0e\"\n}" + }, + { + "typeInfo": { + "fullName": "UnityEditor.ShaderGraph.PositionNode" + }, + "JSONnodeData": "{\n \"m_GuidSerialized\": \"3941bc28-9a90-4cef-baef-cb93dcd31e2e\",\n \"m_GroupGuidSerialized\": \"00000000-0000-0000-0000-000000000000\",\n \"m_Name\": \"Position\",\n \"m_NodeVersion\": 1,\n \"m_DrawState\": {\n \"m_Expanded\": true,\n \"m_Position\": {\n \"serializedVersion\": \"2\",\n \"x\": -913.0,\n \"y\": 32.0,\n \"width\": 206.0,\n \"height\": 130.0\n }\n },\n \"m_SerializableSlots\": [\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.Vector3MaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 0,\\n \\\"m_DisplayName\\\": \\\"Out\\\",\\n \\\"m_SlotType\\\": 1,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"Out\\\",\\n \\\"m_StageCapability\\\": 3,\\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}\"\n }\n ],\n \"m_Precision\": 1,\n \"m_PreviewExpanded\": false,\n \"m_CustomColors\": {\n \"m_SerializableColors\": []\n },\n \"m_Space\": 2\n}" + }, + { + "typeInfo": { + "fullName": "UnityEditor.ShaderGraph.MultiplyNode" + }, + "JSONnodeData": "{\n \"m_GuidSerialized\": \"835eec7d-379d-4954-90eb-69a5832644fa\",\n \"m_GroupGuidSerialized\": \"00000000-0000-0000-0000-000000000000\",\n \"m_Name\": \"Multiply\",\n \"m_NodeVersion\": 0,\n \"m_DrawState\": {\n \"m_Expanded\": false,\n \"m_Position\": {\n \"serializedVersion\": \"2\",\n \"x\": -684.0,\n \"y\": 34.0,\n \"width\": 135.0,\n \"height\": 94.0\n }\n },\n \"m_SerializableSlots\": [\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.DynamicValueMaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 0,\\n \\\"m_DisplayName\\\": \\\"A\\\",\\n \\\"m_SlotType\\\": 0,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"A\\\",\\n \\\"m_StageCapability\\\": 3,\\n \\\"m_Value\\\": {\\n \\\"e00\\\": 0.0,\\n \\\"e01\\\": 0.0,\\n \\\"e02\\\": 0.0,\\n \\\"e03\\\": 0.0,\\n \\\"e10\\\": 0.0,\\n \\\"e11\\\": 0.0,\\n \\\"e12\\\": 0.0,\\n \\\"e13\\\": 0.0,\\n \\\"e20\\\": 0.0,\\n \\\"e21\\\": 0.0,\\n \\\"e22\\\": 0.0,\\n \\\"e23\\\": 0.0,\\n \\\"e30\\\": 0.0,\\n \\\"e31\\\": 0.0,\\n \\\"e32\\\": 0.0,\\n \\\"e33\\\": 0.0\\n },\\n \\\"m_DefaultValue\\\": {\\n \\\"e00\\\": 1.0,\\n \\\"e01\\\": 0.0,\\n \\\"e02\\\": 0.0,\\n \\\"e03\\\": 0.0,\\n \\\"e10\\\": 0.0,\\n \\\"e11\\\": 1.0,\\n \\\"e12\\\": 0.0,\\n \\\"e13\\\": 0.0,\\n \\\"e20\\\": 0.0,\\n \\\"e21\\\": 0.0,\\n \\\"e22\\\": 1.0,\\n \\\"e23\\\": 0.0,\\n \\\"e30\\\": 0.0,\\n \\\"e31\\\": 0.0,\\n \\\"e32\\\": 0.0,\\n \\\"e33\\\": 1.0\\n }\\n}\"\n },\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.DynamicValueMaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 1,\\n \\\"m_DisplayName\\\": \\\"B\\\",\\n \\\"m_SlotType\\\": 0,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"B\\\",\\n \\\"m_StageCapability\\\": 3,\\n \\\"m_Value\\\": {\\n \\\"e00\\\": 0.5,\\n \\\"e01\\\": 0.5,\\n \\\"e02\\\": 0.5,\\n \\\"e03\\\": 2.0,\\n \\\"e10\\\": 2.0,\\n \\\"e11\\\": 2.0,\\n \\\"e12\\\": 2.0,\\n \\\"e13\\\": 2.0,\\n \\\"e20\\\": 2.0,\\n \\\"e21\\\": 2.0,\\n \\\"e22\\\": 2.0,\\n \\\"e23\\\": 2.0,\\n \\\"e30\\\": 2.0,\\n \\\"e31\\\": 2.0,\\n \\\"e32\\\": 2.0,\\n \\\"e33\\\": 2.0\\n },\\n \\\"m_DefaultValue\\\": {\\n \\\"e00\\\": 1.0,\\n \\\"e01\\\": 0.0,\\n \\\"e02\\\": 0.0,\\n \\\"e03\\\": 0.0,\\n \\\"e10\\\": 0.0,\\n \\\"e11\\\": 1.0,\\n \\\"e12\\\": 0.0,\\n \\\"e13\\\": 0.0,\\n \\\"e20\\\": 0.0,\\n \\\"e21\\\": 0.0,\\n \\\"e22\\\": 1.0,\\n \\\"e23\\\": 0.0,\\n \\\"e30\\\": 0.0,\\n \\\"e31\\\": 0.0,\\n \\\"e32\\\": 0.0,\\n \\\"e33\\\": 1.0\\n }\\n}\"\n },\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.DynamicValueMaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 2,\\n \\\"m_DisplayName\\\": \\\"Out\\\",\\n \\\"m_SlotType\\\": 1,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"Out\\\",\\n \\\"m_StageCapability\\\": 3,\\n \\\"m_Value\\\": {\\n \\\"e00\\\": 0.0,\\n \\\"e01\\\": 0.0,\\n \\\"e02\\\": 0.0,\\n \\\"e03\\\": 0.0,\\n \\\"e10\\\": 0.0,\\n \\\"e11\\\": 0.0,\\n \\\"e12\\\": 0.0,\\n \\\"e13\\\": 0.0,\\n \\\"e20\\\": 0.0,\\n \\\"e21\\\": 0.0,\\n \\\"e22\\\": 0.0,\\n \\\"e23\\\": 0.0,\\n \\\"e30\\\": 0.0,\\n \\\"e31\\\": 0.0,\\n \\\"e32\\\": 0.0,\\n \\\"e33\\\": 0.0\\n },\\n \\\"m_DefaultValue\\\": {\\n \\\"e00\\\": 1.0,\\n \\\"e01\\\": 0.0,\\n \\\"e02\\\": 0.0,\\n \\\"e03\\\": 0.0,\\n \\\"e10\\\": 0.0,\\n \\\"e11\\\": 1.0,\\n \\\"e12\\\": 0.0,\\n \\\"e13\\\": 0.0,\\n \\\"e20\\\": 0.0,\\n \\\"e21\\\": 0.0,\\n \\\"e22\\\": 1.0,\\n \\\"e23\\\": 0.0,\\n \\\"e30\\\": 0.0,\\n \\\"e31\\\": 0.0,\\n \\\"e32\\\": 0.0,\\n \\\"e33\\\": 1.0\\n }\\n}\"\n }\n ],\n \"m_Precision\": 0,\n \"m_PreviewExpanded\": false,\n \"m_CustomColors\": {\n \"m_SerializableColors\": []\n }\n}" + }, + { + "typeInfo": { + "fullName": "UnityEditor.ShaderGraph.AddNode" + }, + "JSONnodeData": "{\n \"m_GuidSerialized\": \"5136b7d0-bfa6-4617-bdcc-ea98f3621582\",\n \"m_GroupGuidSerialized\": \"00000000-0000-0000-0000-000000000000\",\n \"m_Name\": \"Add\",\n \"m_NodeVersion\": 0,\n \"m_DrawState\": {\n \"m_Expanded\": false,\n \"m_Position\": {\n \"serializedVersion\": \"2\",\n \"x\": -541.0,\n \"y\": 35.0,\n \"width\": 135.0,\n \"height\": 94.0\n }\n },\n \"m_SerializableSlots\": [\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.DynamicVectorMaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 0,\\n \\\"m_DisplayName\\\": \\\"A\\\",\\n \\\"m_SlotType\\\": 0,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"A\\\",\\n \\\"m_StageCapability\\\": 3,\\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.DynamicVectorMaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 1,\\n \\\"m_DisplayName\\\": \\\"B\\\",\\n \\\"m_SlotType\\\": 0,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"B\\\",\\n \\\"m_StageCapability\\\": 3,\\n \\\"m_Value\\\": {\\n \\\"x\\\": 0.5,\\n \\\"y\\\": 0.5,\\n \\\"z\\\": 0.5,\\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.DynamicVectorMaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 2,\\n \\\"m_DisplayName\\\": \\\"Out\\\",\\n \\\"m_SlotType\\\": 1,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"Out\\\",\\n \\\"m_StageCapability\\\": 3,\\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 \"m_Precision\": 0,\n \"m_PreviewExpanded\": false,\n \"m_CustomColors\": {\n \"m_SerializableColors\": []\n }\n}" + }, + { + "typeInfo": { + "fullName": "UnityEditor.ShaderGraph.SaturateNode" + }, + "JSONnodeData": "{\n \"m_GuidSerialized\": \"0f359e01-5605-4c78-9135-ea639500982e\",\n \"m_GroupGuidSerialized\": \"00000000-0000-0000-0000-000000000000\",\n \"m_Name\": \"Saturate\",\n \"m_NodeVersion\": 0,\n \"m_DrawState\": {\n \"m_Expanded\": true,\n \"m_Position\": {\n \"serializedVersion\": \"2\",\n \"x\": -389.0,\n \"y\": 34.0,\n \"width\": 139.0,\n \"height\": 94.0\n }\n },\n \"m_SerializableSlots\": [\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.DynamicVectorMaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 0,\\n \\\"m_DisplayName\\\": \\\"In\\\",\\n \\\"m_SlotType\\\": 0,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"In\\\",\\n \\\"m_StageCapability\\\": 3,\\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.DynamicVectorMaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 1,\\n \\\"m_DisplayName\\\": \\\"Out\\\",\\n \\\"m_SlotType\\\": 1,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"Out\\\",\\n \\\"m_StageCapability\\\": 3,\\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 \"m_Precision\": 1,\n \"m_PreviewExpanded\": false,\n \"m_CustomColors\": {\n \"m_SerializableColors\": []\n }\n}" + }, + { + "typeInfo": { + "fullName": "UnityEditor.ShaderGraph.CustomFunctionNode" + }, + "JSONnodeData": "{\n \"m_GuidSerialized\": \"c83162c3-2039-4dc0-841e-bf7b79ecb928\",\n \"m_GroupGuidSerialized\": \"00000000-0000-0000-0000-000000000000\",\n \"m_Name\": \"Custom Function\",\n \"m_NodeVersion\": 0,\n \"m_DrawState\": {\n \"m_Expanded\": true,\n \"m_Position\": {\n \"serializedVersion\": \"2\",\n \"x\": -673.0,\n \"y\": -143.0,\n \"width\": 164.0,\n \"height\": 94.0\n }\n },\n \"m_SerializableSlots\": [\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.Vector3MaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 0,\\n \\\"m_DisplayName\\\": \\\"In\\\",\\n \\\"m_SlotType\\\": 0,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"In\\\",\\n \\\"m_StageCapability\\\": 3,\\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}\"\n },\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.Vector3MaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 1,\\n \\\"m_DisplayName\\\": \\\"Out\\\",\\n \\\"m_SlotType\\\": 1,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"Out\\\",\\n \\\"m_StageCapability\\\": 3,\\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}\"\n }\n ],\n \"m_Precision\": 0,\n \"m_PreviewExpanded\": false,\n \"m_CustomColors\": {\n \"m_SerializableColors\": []\n },\n \"m_SourceType\": 0,\n \"m_FunctionName\": \"ShaderGraphFunction\",\n \"m_FunctionSource\": \"52ba3338a3c5fd040985e2d7cd13ae29\",\n \"m_FunctionBody\": \"#pragma instancing_options assumeuniformscaling procedural:ConfigureProcedural\\r\\n#pragma editor_sync_compilation\\r\\n\\r\\nOut = In;\"\n}" + }, + { + "typeInfo": { + "fullName": "UnityEditor.ShaderGraph.PositionNode" + }, + "JSONnodeData": "{\n \"m_GuidSerialized\": \"87e3be23-835f-466c-a7aa-6e3163d0e35d\",\n \"m_GroupGuidSerialized\": \"00000000-0000-0000-0000-000000000000\",\n \"m_Name\": \"Position\",\n \"m_NodeVersion\": 1,\n \"m_DrawState\": {\n \"m_Expanded\": true,\n \"m_Position\": {\n \"serializedVersion\": \"2\",\n \"x\": -910.0,\n \"y\": -143.0,\n \"width\": 206.0,\n \"height\": 130.0\n }\n },\n \"m_SerializableSlots\": [\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.Vector3MaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 0,\\n \\\"m_DisplayName\\\": \\\"Out\\\",\\n \\\"m_SlotType\\\": 1,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"Out\\\",\\n \\\"m_StageCapability\\\": 3,\\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}\"\n }\n ],\n \"m_Precision\": 1,\n \"m_PreviewExpanded\": false,\n \"m_CustomColors\": {\n \"m_SerializableColors\": []\n },\n \"m_Space\": 0\n}" + }, + { + "typeInfo": { + "fullName": "UnityEditor.ShaderGraph.CustomFunctionNode" + }, + "JSONnodeData": "{\n \"m_GuidSerialized\": \"7c90289c-03c0-467a-8ca6-408a8d6f383e\",\n \"m_GroupGuidSerialized\": \"00000000-0000-0000-0000-000000000000\",\n \"m_Name\": \"Custom Function\",\n \"m_NodeVersion\": 0,\n \"m_DrawState\": {\n \"m_Expanded\": true,\n \"m_Position\": {\n \"serializedVersion\": \"2\",\n \"x\": -497.0,\n \"y\": -143.0,\n \"width\": 164.0,\n \"height\": 94.0\n }\n },\n \"m_SerializableSlots\": [\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.Vector3MaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 0,\\n \\\"m_DisplayName\\\": \\\"In\\\",\\n \\\"m_SlotType\\\": 0,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"In\\\",\\n \\\"m_StageCapability\\\": 3,\\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}\"\n },\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.Vector3MaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 1,\\n \\\"m_DisplayName\\\": \\\"Out\\\",\\n \\\"m_SlotType\\\": 1,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"Out\\\",\\n \\\"m_StageCapability\\\": 3,\\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}\"\n }\n ],\n \"m_Precision\": 0,\n \"m_PreviewExpanded\": false,\n \"m_CustomColors\": {\n \"m_SerializableColors\": []\n },\n \"m_SourceType\": 1,\n \"m_FunctionName\": \"InjectPragmas\",\n \"m_FunctionSource\": \"\",\n \"m_FunctionBody\": \"#pragma instancing_options assumeuniformscaling procedural:ConfigureProcedural\\r\\n#pragma editor_sync_compilation\\r\\n\\r\\nOut = In;\"\n}" + } + ], + "m_Groups": [], + "m_StickyNotes": [], + "m_SerializableEdges": [ + { + "typeInfo": { + "fullName": "UnityEditor.Graphing.Edge" + }, + "JSONnodeData": "{\n \"m_OutputSlot\": {\n \"m_SlotId\": 0,\n \"m_NodeGUIDSerialized\": \"3941bc28-9a90-4cef-baef-cb93dcd31e2e\"\n },\n \"m_InputSlot\": {\n \"m_SlotId\": 0,\n \"m_NodeGUIDSerialized\": \"835eec7d-379d-4954-90eb-69a5832644fa\"\n }\n}" + }, + { + "typeInfo": { + "fullName": "UnityEditor.Graphing.Edge" + }, + "JSONnodeData": "{\n \"m_OutputSlot\": {\n \"m_SlotId\": 2,\n \"m_NodeGUIDSerialized\": \"835eec7d-379d-4954-90eb-69a5832644fa\"\n },\n \"m_InputSlot\": {\n \"m_SlotId\": 0,\n \"m_NodeGUIDSerialized\": \"5136b7d0-bfa6-4617-bdcc-ea98f3621582\"\n }\n}" + }, + { + "typeInfo": { + "fullName": "UnityEditor.Graphing.Edge" + }, + "JSONnodeData": "{\n \"m_OutputSlot\": {\n \"m_SlotId\": 2,\n \"m_NodeGUIDSerialized\": \"5136b7d0-bfa6-4617-bdcc-ea98f3621582\"\n },\n \"m_InputSlot\": {\n \"m_SlotId\": 0,\n \"m_NodeGUIDSerialized\": \"0f359e01-5605-4c78-9135-ea639500982e\"\n }\n}" + }, + { + "typeInfo": { + "fullName": "UnityEditor.Graphing.Edge" + }, + "JSONnodeData": "{\n \"m_OutputSlot\": {\n \"m_SlotId\": 1,\n \"m_NodeGUIDSerialized\": \"0f359e01-5605-4c78-9135-ea639500982e\"\n },\n \"m_InputSlot\": {\n \"m_SlotId\": 0,\n \"m_NodeGUIDSerialized\": \"37ad4730-8096-4fd1-858f-994f2a0a4afb\"\n }\n}" + }, + { + "typeInfo": { + "fullName": "UnityEditor.Graphing.Edge" + }, + "JSONnodeData": "{\n \"m_OutputSlot\": {\n \"m_SlotId\": 0,\n \"m_NodeGUIDSerialized\": \"0b3c1510-7eb1-4a70-b16a-1c9b6d8e2e94\"\n },\n \"m_InputSlot\": {\n \"m_SlotId\": 5,\n \"m_NodeGUIDSerialized\": \"37ad4730-8096-4fd1-858f-994f2a0a4afb\"\n }\n}" + }, + { + "typeInfo": { + "fullName": "UnityEditor.Graphing.Edge" + }, + "JSONnodeData": "{\n \"m_OutputSlot\": {\n \"m_SlotId\": 0,\n \"m_NodeGUIDSerialized\": \"87e3be23-835f-466c-a7aa-6e3163d0e35d\"\n },\n \"m_InputSlot\": {\n \"m_SlotId\": 0,\n \"m_NodeGUIDSerialized\": \"c83162c3-2039-4dc0-841e-bf7b79ecb928\"\n }\n}" + }, + { + "typeInfo": { + "fullName": "UnityEditor.Graphing.Edge" + }, + "JSONnodeData": "{\n \"m_OutputSlot\": {\n \"m_SlotId\": 1,\n \"m_NodeGUIDSerialized\": \"c83162c3-2039-4dc0-841e-bf7b79ecb928\"\n },\n \"m_InputSlot\": {\n \"m_SlotId\": 0,\n \"m_NodeGUIDSerialized\": \"7c90289c-03c0-467a-8ca6-408a8d6f383e\"\n }\n}" + }, + { + "typeInfo": { + "fullName": "UnityEditor.Graphing.Edge" + }, + "JSONnodeData": "{\n \"m_OutputSlot\": {\n \"m_SlotId\": 1,\n \"m_NodeGUIDSerialized\": \"7c90289c-03c0-467a-8ca6-408a8d6f383e\"\n },\n \"m_InputSlot\": {\n \"m_SlotId\": 9,\n \"m_NodeGUIDSerialized\": \"37ad4730-8096-4fd1-858f-994f2a0a4afb\"\n }\n}" + } + ], + "m_PreviewData": { + "serializedMesh": { + "m_SerializedMesh": "{\"mesh\":{\"instanceID\":0}}", + "m_Guid": "" + } + }, + "m_Path": "Shader Graphs", + "m_ConcretePrecision": 0, + "m_ActiveOutputNodeGuidSerialized": "37ad4730-8096-4fd1-858f-994f2a0a4afb" +} \ No newline at end of file diff --git a/Assets/Point/Point URP GPU.shadergraph.meta b/Assets/Point/Point URP GPU.shadergraph.meta new file mode 100644 index 0000000..ebcc2b4 --- /dev/null +++ b/Assets/Point/Point URP GPU.shadergraph.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: edb00fc61da38e141a5047af96ae1a0a +ScriptedImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 2 + userData: + assetBundleName: + assetBundleVariant: + script: {fileID: 11500000, guid: 625f186215c104763be7675aa2d941aa, type: 3} diff --git a/Assets/Scenes/SampleScene.unity b/Assets/Scenes/SampleScene.unity index 7d551d6..43b781f 100644 --- a/Assets/Scenes/SampleScene.unity +++ b/Assets/Scenes/SampleScene.unity @@ -98,7 +98,7 @@ LightmapSettings: m_TrainingDataDestination: TrainingData m_LightProbeSampleCountMultiplier: 4 m_LightingDataAsset: {fileID: 0} - m_UseShadowmask: 0 + m_UseShadowmask: 1 --- !u!196 &4 NavMeshSettings: serializedVersion: 2 @@ -130,7 +130,6 @@ GameObject: serializedVersion: 6 m_Component: - component: {fileID: 75389716} - - component: {fileID: 75389715} - component: {fileID: 75389717} m_Layer: 0 m_Name: Graph @@ -139,25 +138,6 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!114 &75389715 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 75389714} - m_Enabled: 0 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 14cd06bfa92d53e4ebc0cde4a0e39db8, type: 3} - m_Name: - m_EditorClassIdentifier: - pointPrefab: {fileID: 5221897554875366738, guid: d73a635284aa0ca4eb9cc40879b3267d, - type: 3} - resolution: 200 - function: 4 - transitionMode: 2 - functionDuration: 1 - transitionDuration: 1 --- !u!4 &75389716 Transform: m_ObjectHideFlags: 0 @@ -184,7 +164,10 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 4e99d61420a0d1f459f961121d6fbe77, type: 3} m_Name: m_EditorClassIdentifier: - resolution: 200 + computeShader: {fileID: 7200000, guid: c7f7fcb3b4a90614b80aa341489318e7, type: 3} + material: {fileID: 2100000, guid: e470d4aed9c37a448b5bccf749811b9d, type: 2} + mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} + resolution: 1000 function: 4 transitionMode: 1 functionDuration: 1 diff --git a/Assets/Script/GPUGraph.cs b/Assets/Script/GPUGraph.cs index 42afbc5..1c6fbee 100644 --- a/Assets/Script/GPUGraph.cs +++ b/Assets/Script/GPUGraph.cs @@ -5,7 +5,15 @@ public class GPUGraph : MonoBehaviour [SerializeField] ComputeShader computeShader = default; - [SerializeField, Range(10, 200)] + [SerializeField] + Material material = default; + + [SerializeField] + Mesh mesh = default; + + const int maxResolution = 1000; + + [SerializeField, Range(10, maxResolution)] int resolution = 10; [SerializeField] @@ -37,7 +45,7 @@ public class GPUGraph : MonoBehaviour private void OnEnable() { - positionsBuffer = new ComputeBuffer(resolution * resolution, 3 * 4); + positionsBuffer = new ComputeBuffer(maxResolution * maxResolution, 3 * 4); } private void OnDisable() @@ -86,5 +94,10 @@ public class GPUGraph : MonoBehaviour var groups = Mathf.CeilToInt(resolution / 8f); computeShader.Dispatch(0, groups, groups, 1); + + material.SetBuffer(positionsId, positionsBuffer); + material.SetFloat(stepId, step); + var bounds = new Bounds(Vector3.zero, Vector3.one * (2f + 2f / resolution)); + Graphics.DrawMeshInstancedProcedural(mesh, 0, material, bounds, resolution * resolution); } }