diff --git a/Assets/Examples/Subgraph Tests.meta b/Assets/Examples/Subgraph Tests.meta new file mode 100644 index 00000000..ee312373 --- /dev/null +++ b/Assets/Examples/Subgraph Tests.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 38ac833a995a69a48ae472b6f9910a2d +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Examples/Subgraph Tests/Main Graph.asset b/Assets/Examples/Subgraph Tests/Main Graph.asset new file mode 100644 index 00000000..cbf3cbf8 --- /dev/null +++ b/Assets/Examples/Subgraph Tests/Main Graph.asset @@ -0,0 +1,1768 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &-6861812596719011025 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 3 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Hidden/Mixture/Rectangles + m_Shader: {fileID: -6465566751694194690, guid: 92d8c97c0c0de6a41a986ea9d3291139, + type: 3} + m_ShaderKeywords: CRT_2D + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _UV_2D: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _UV_3D: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _UV_Cube: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - Vector1_80b6ea8c66f74c7b90cdad44939e757c: 1 + m_Colors: + - Color_69B370C1: {r: 0, g: 0, b: 0, a: 0} + - Color_BBDDEF19: {r: 1, g: 1, b: 1, a: 1} + - Vector3_12e00a45fc1743c0821269e658c4320f: {r: 0, g: 0, b: 0, a: 0} + - Vector3_90ab8e0cfccc42ff933ee0f553788f88: {r: 0.5, g: 0.5, b: 0.5, a: 0} + - Vector3_a3491b511b994ab49f51ac18605b5339: {r: 1, g: 1, b: 1, a: 0} + m_BuildTextureStacks: [] +--- !u!86 &-3635549179156555280 +CustomRenderTexture: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Color (1) + m_ImageContentsHash: + serializedVersion: 2 + Hash: 00000000000000000000000000000000 + m_ForcedFallbackFormat: 4 + m_DownscaleFallback: 0 + m_IsAlphaChannelOptional: 0 + serializedVersion: 3 + m_Width: 256 + m_Height: 256 + m_AntiAliasing: 1 + m_MipCount: -1 + m_DepthFormat: 0 + m_ColorFormat: 48 + m_MipMap: 0 + m_GenerateMips: 0 + m_SRGB: 0 + m_UseDynamicScale: 0 + m_BindMS: 0 + m_EnableCompatibleFormat: 1 + m_TextureSettings: + serializedVersion: 2 + m_FilterMode: 0 + m_Aniso: 1 + m_MipBias: 0 + m_WrapU: 0 + m_WrapV: 0 + m_WrapW: 0 + m_Dimension: 2 + m_VolumeDepth: 1 + m_Material: {fileID: 7133134556329247940} + m_InitSource: 0 + m_InitMaterial: {fileID: 0} + m_InitColor: {r: 1, g: 1, b: 1, a: 1} + m_InitTexture: {fileID: 0} + m_UpdateMode: 2 + m_InitializationMode: 2 + m_UpdateZoneSpace: 0 + m_CurrentUpdateZoneSpace: 0 + m_UpdateZones: [] + m_UpdatePeriod: 0 + m_ShaderPass: 0 + m_CubemapFaceMask: 4294967295 + m_DoubleBuffered: 0 + m_WrapUpdateZones: 0 +--- !u!86 &-1753224319336142041 +CustomRenderTexture: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Main Graph + m_ImageContentsHash: + serializedVersion: 2 + Hash: 00000000000000000000000000000000 + m_ForcedFallbackFormat: 4 + m_DownscaleFallback: 0 + m_IsAlphaChannelOptional: 0 + serializedVersion: 3 + m_Width: 256 + m_Height: 256 + m_AntiAliasing: 1 + m_MipCount: -1 + m_DepthFormat: 0 + m_ColorFormat: 48 + m_MipMap: 0 + m_GenerateMips: 0 + m_SRGB: 0 + m_UseDynamicScale: 0 + m_BindMS: 0 + m_EnableCompatibleFormat: 1 + m_TextureSettings: + serializedVersion: 2 + m_FilterMode: 0 + m_Aniso: 1 + m_MipBias: 0 + m_WrapU: 0 + m_WrapV: 0 + m_WrapW: 0 + m_Dimension: 2 + m_VolumeDepth: 1 + m_Material: {fileID: -769285802190462635} + m_InitSource: 0 + m_InitMaterial: {fileID: 0} + m_InitColor: {r: 1, g: 1, b: 1, a: 1} + m_InitTexture: {fileID: 0} + m_UpdateMode: 1 + m_InitializationMode: 2 + m_UpdateZoneSpace: 0 + m_CurrentUpdateZoneSpace: 0 + m_UpdateZones: [] + m_UpdatePeriod: 0 + m_ShaderPass: 0 + m_CubemapFaceMask: 4294967295 + m_DoubleBuffered: 0 + m_WrapUpdateZones: 0 +--- !u!86 &-996297582430166177 +CustomRenderTexture: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Color (2) + m_ImageContentsHash: + serializedVersion: 2 + Hash: 00000000000000000000000000000000 + m_ForcedFallbackFormat: 4 + m_DownscaleFallback: 0 + m_IsAlphaChannelOptional: 0 + serializedVersion: 3 + m_Width: 256 + m_Height: 256 + m_AntiAliasing: 1 + m_MipCount: -1 + m_DepthFormat: 0 + m_ColorFormat: 48 + m_MipMap: 0 + m_GenerateMips: 0 + m_SRGB: 0 + m_UseDynamicScale: 0 + m_BindMS: 0 + m_EnableCompatibleFormat: 1 + m_TextureSettings: + serializedVersion: 2 + m_FilterMode: 0 + m_Aniso: 1 + m_MipBias: 0 + m_WrapU: 0 + m_WrapV: 0 + m_WrapW: 0 + m_Dimension: 2 + m_VolumeDepth: 1 + m_Material: {fileID: 2850363556456381128} + m_InitSource: 0 + m_InitMaterial: {fileID: 0} + m_InitColor: {r: 1, g: 1, b: 1, a: 1} + m_InitTexture: {fileID: 0} + m_UpdateMode: 2 + m_InitializationMode: 2 + m_UpdateZoneSpace: 0 + m_CurrentUpdateZoneSpace: 0 + m_UpdateZones: [] + m_UpdatePeriod: 0 + m_ShaderPass: 0 + m_CubemapFaceMask: 4294967295 + m_DoubleBuffered: 0 + m_WrapUpdateZones: 0 +--- !u!21 &-769285802190462635 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 3 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Hidden/Mixture/FinalCopy + m_Shader: {fileID: 4800000, guid: 513c040fbfb854aebb92cf147e30125a, type: 3} + m_ShaderKeywords: CRT_2D + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _Source_2D: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Source_3D: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Source_Cube: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: [] + m_Colors: [] + m_BuildTextureStacks: [] +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 1 + 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: 3b113f958e0564f309164e29c24b042d, type: 3} + m_Name: Main Graph + m_EditorClassIdentifier: + serializedNodes: [] + nodes: + - id: 0 + - id: 1 + - id: 2 + - id: 3 + - id: 4 + - id: 5 + - id: 6 + - id: 7 + - id: 8 + - id: 9 + - id: 10 + - id: 11 + - id: 12 + - id: 13 + edges: + - GUID: 120116c2-f416-450f-a4c1-52fe9c36e13b + owner: {fileID: 11400000} + inputNodeGUID: f7a75289-1f47-4422-85c1-8f023251ad0a + outputNodeGUID: 786cd4f6-5269-4bba-9a34-1e7d1621ef9e + inputFieldName: subgraphInputs + outputFieldName: sinTime + inputPortIdentifier: 0 + outputPortIdentifier: + - GUID: b9d16070-fd7f-4bf3-8d38-53b566a7b287 + owner: {fileID: 11400000} + inputNodeGUID: f7a75289-1f47-4422-85c1-8f023251ad0a + outputNodeGUID: 786cd4f6-5269-4bba-9a34-1e7d1621ef9e + inputFieldName: subgraphInputs + outputFieldName: cosTime + inputPortIdentifier: 1 + outputPortIdentifier: + - GUID: e1d7264a-855e-4d38-b109-d7783300f546 + owner: {fileID: 11400000} + inputNodeGUID: a549b36d-0ec4-492f-a902-bf48aaf932f3 + outputNodeGUID: 786cd4f6-5269-4bba-9a34-1e7d1621ef9e + inputFieldName: subgraphInputs + outputFieldName: sinTime + inputPortIdentifier: 0 + outputPortIdentifier: + - GUID: 6b063917-fa97-491a-8871-961698e4ffc3 + owner: {fileID: 11400000} + inputNodeGUID: a549b36d-0ec4-492f-a902-bf48aaf932f3 + outputNodeGUID: 786cd4f6-5269-4bba-9a34-1e7d1621ef9e + inputFieldName: subgraphInputs + outputFieldName: cosTime + inputPortIdentifier: 1 + outputPortIdentifier: + - GUID: e9ad2f0a-f809-444b-b776-57ebb176a8de + owner: {fileID: 11400000} + inputNodeGUID: 695b3e10-b60a-468d-9b94-1a6f57af50f6 + outputNodeGUID: a549b36d-0ec4-492f-a902-bf48aaf932f3 + inputFieldName: materialInputs + outputFieldName: subgraphOutputs + inputPortIdentifier: _Source_2D + outputPortIdentifier: 0 + - GUID: 716e62e6-c99e-4e7a-b622-fc3437c703f8 + owner: {fileID: 11400000} + inputNodeGUID: 695b3e10-b60a-468d-9b94-1a6f57af50f6 + outputNodeGUID: f7a75289-1f47-4422-85c1-8f023251ad0a + inputFieldName: materialInputs + outputFieldName: subgraphOutputs + inputPortIdentifier: _Target_2D + outputPortIdentifier: 0 + - GUID: 2d87b781-7692-4246-bff0-2d79e89d3990 + owner: {fileID: 11400000} + inputNodeGUID: 695b3e10-b60a-468d-9b94-1a6f57af50f6 + outputNodeGUID: 1cd8f484-511a-4460-a989-b7017fbb31d9 + inputFieldName: materialInputs + outputFieldName: texture + inputPortIdentifier: _Mask_2D + outputPortIdentifier: + - GUID: e079b777-a42b-47fa-9e6a-88ed44f54f32 + owner: {fileID: 11400000} + inputNodeGUID: 691aa737-9a89-40dd-b56d-201a248e396d + outputNodeGUID: 695b3e10-b60a-468d-9b94-1a6f57af50f6 + inputFieldName: outputTextureSettings + outputFieldName: output + inputPortIdentifier: Main Texture + outputPortIdentifier: output + - GUID: 68f23e30-d02e-431c-9a29-204748124054 + owner: {fileID: 11400000} + inputNodeGUID: 69ce189d-f0d9-450d-a50f-3a9512b90694 + outputNodeGUID: 573c5abf-982a-4579-9f90-97b0067fdc16 + inputFieldName: a + outputFieldName: vector + inputPortIdentifier: + outputPortIdentifier: + - GUID: 1652dfa0-1898-4323-84d7-7088ceac1be6 + owner: {fileID: 11400000} + inputNodeGUID: 9869ddcd-dc2e-4ce1-a2bd-a7ba562be718 + outputNodeGUID: 69ce189d-f0d9-450d-a50f-3a9512b90694 + inputFieldName: subgraphInputs + outputFieldName: o + inputPortIdentifier: 0 + outputPortIdentifier: + - GUID: 6073f7ce-ab59-4b33-a7dd-af2cfe6a7f6a + owner: {fileID: 11400000} + inputNodeGUID: 573c5abf-982a-4579-9f90-97b0067fdc16 + outputNodeGUID: b132f5e1-d46c-4c70-9aba-d08c9092c141 + inputFieldName: X + outputFieldName: sinTime + inputPortIdentifier: + outputPortIdentifier: + - GUID: 352fcff4-95f0-4dac-afec-30f49e8a6bed + owner: {fileID: 11400000} + inputNodeGUID: 573c5abf-982a-4579-9f90-97b0067fdc16 + outputNodeGUID: b132f5e1-d46c-4c70-9aba-d08c9092c141 + inputFieldName: Y + outputFieldName: cosTime + inputPortIdentifier: + outputPortIdentifier: + - GUID: bf96348b-c449-4eef-ab07-d10cee7d1c4b + owner: {fileID: 11400000} + inputNodeGUID: 2934feac-d299-4f8a-8d24-bb15ef7b9ba3 + outputNodeGUID: 33a1aac5-bb6c-4cd4-9663-af4c6c95cf09 + inputFieldName: subgraphInputs + outputFieldName: output + inputPortIdentifier: 0 + outputPortIdentifier: output + - GUID: fd6efb85-0ac1-4872-bcbc-3a8933503d8f + owner: {fileID: 11400000} + inputNodeGUID: 691aa737-9a89-40dd-b56d-201a248e396d + outputNodeGUID: 9869ddcd-dc2e-4ce1-a2bd-a7ba562be718 + inputFieldName: outputTextureSettings + outputFieldName: subgraphOutputs + inputPortIdentifier: Color (2) + outputPortIdentifier: 0 + - GUID: aba9f9dc-df24-44a4-b6d4-e2239214538d + owner: {fileID: 11400000} + inputNodeGUID: 4b668907-ea29-4d54-ab04-e8f52921c3a6 + outputNodeGUID: b630fef7-7bfc-4aea-a082-f5fb2f443aed + inputFieldName: subgraphInputs + outputFieldName: output + inputPortIdentifier: 0 + outputPortIdentifier: output + - GUID: b9ac74ed-255b-454c-b641-6418358aaf29 + owner: {fileID: 11400000} + inputNodeGUID: 691aa737-9a89-40dd-b56d-201a248e396d + outputNodeGUID: 2934feac-d299-4f8a-8d24-bb15ef7b9ba3 + inputFieldName: outputTextureSettings + outputFieldName: subgraphOutputs + inputPortIdentifier: Color + outputPortIdentifier: 0 + - GUID: 69e08e03-f31f-4c14-87a0-eb42fc2474bf + owner: {fileID: 11400000} + inputNodeGUID: 691aa737-9a89-40dd-b56d-201a248e396d + outputNodeGUID: 4b668907-ea29-4d54-ab04-e8f52921c3a6 + inputFieldName: outputTextureSettings + outputFieldName: subgraphOutputs + inputPortIdentifier: Color (1) + outputPortIdentifier: 0 + groups: [] + stackNodes: [] + pinnedElements: + - position: + serializedVersion: 2 + x: 0 + y: 99 + width: 244 + height: 461 + opened: 0 + editorType: + serializedType: Mixture.MixtureParameterView, Unity.ShaderGraph.GraphicsTests, + Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + exposedParameters: [] + serializedParameterList: [] + stickyNotes: [] + nodeInspectorReference: {fileID: 0} + position: {x: 825, y: 89, z: 0} + scale: {x: 0.12289447, y: 0.12289447, z: 1} + version: 1 + type: 1 + realtimePreview: 0 + isRealtime: 0 + isParameterViewOpen: 0 + embedInBuild: 0 + defaultNodeInheritanceMode: -2 + objectReferences: + - {fileID: -769285802190462635} + - {fileID: 3771598539773622648} + - {fileID: 4647130873688671849} + - {fileID: -6861812596719011025} + - {fileID: 3296577972891407519} + - {fileID: 7133134556329247940} + - {fileID: 2850363556456381128} + variants: [] + _mainOutputTexture: {fileID: -1753224319336142041} + _outputTextures: + - {fileID: 6641087707738921690} + - {fileID: -1753224319336142041} + - {fileID: -3635549179156555280} + - {fileID: -1753224319336142041} + - {fileID: -996297582430166177} + settings: + widthScale: 1 + heightScale: 1 + depthScale: 1 + width: 256 + height: 256 + depth: 256 + potSize: 256 + sizeMode: 1 + dimension: 2 + outputChannels: 1 + outputPrecision: 3 + editFlags: 128 + doubleBuffered: 0 + wrapMode: 0 + filterMode: 0 + refreshMode: 1 + period: 17 + references: + version: 1 + 00000000: + type: {class: OutputNode, ns: Mixture, asm: Mixture.Runtime} + data: + nodeCustomName: + GUID: 691aa737-9a89-40dd-b56d-201a248e396d + computeOrder: 13 + position: + serializedVersion: 2 + x: 215.0908 + y: 1297 + width: 350 + height: 578 + expanded: 0 + debug: 0 + nodeLock: 0 + settings: + widthScale: 1 + heightScale: 1 + depthScale: 1 + width: 512 + height: 512 + depth: 1 + potSize: 512 + sizeMode: -2 + dimension: -2 + outputChannels: -2 + outputPrecision: -2 + editFlags: 471 + doubleBuffered: 0 + wrapMode: -2 + filterMode: -2 + refreshMode: 0 + period: 0 + rtSettings: + widthScale: 1 + heightScale: 1 + depthScale: 1 + width: 0 + height: 0 + depth: 0 + potSize: 0 + sizeMode: 0 + dimension: 0 + outputChannels: 0 + outputPrecision: 0 + editFlags: 0 + doubleBuffered: 0 + wrapMode: 0 + filterMode: 0 + refreshMode: 0 + period: 0 + isPreviewCollapsed: 0 + previewMode: 7 + previewSRGB: 0 + previewMip: 0 + previewVisible: 1 + previewEV100: 0 + previewSlice: 0 + isPinned: 0 + outputTextureSettings: + - inputTexture: {fileID: 0} + name: Main Texture + enableCompression: 1 + compressionFormat: 12 + compressionQuality: 100 + hasMipMaps: 0 + isMain: 1 + enableConversion: 0 + conversionFormat: 0 + sRGB: 0 + finalCopyMaterial: {fileID: -769285802190462635} + - inputTexture: {fileID: 0} + name: Color + enableCompression: 1 + compressionFormat: 25 + compressionQuality: 100 + hasMipMaps: 0 + isMain: 0 + enableConversion: 0 + conversionFormat: 0 + sRGB: 0 + finalCopyMaterial: {fileID: 4647130873688671849} + - inputTexture: {fileID: 0} + name: Color (1) + enableCompression: 1 + compressionFormat: 25 + compressionQuality: 100 + hasMipMaps: 0 + isMain: 0 + enableConversion: 0 + conversionFormat: 0 + sRGB: 0 + finalCopyMaterial: {fileID: 7133134556329247940} + - inputTexture: {fileID: 0} + name: Color (2) + enableCompression: 1 + compressionFormat: 25 + compressionQuality: 100 + hasMipMaps: 0 + isMain: 0 + enableConversion: 0 + conversionFormat: 0 + sRGB: 0 + finalCopyMaterial: {fileID: 2850363556456381128} + _selectedPreviewIndex: 0 + 00000001: + type: {class: TimeNode, ns: Mixture, asm: Mixture.Runtime} + data: + nodeCustomName: + GUID: 786cd4f6-5269-4bba-9a34-1e7d1621ef9e + computeOrder: 0 + position: + serializedVersion: 2 + x: -785.7692 + y: 193.99997 + width: 120 + height: 176 + expanded: 0 + debug: 0 + nodeLock: 0 + settings: + widthScale: 1 + heightScale: 1 + depthScale: 1 + width: 1024 + height: 1024 + depth: 1 + potSize: 0 + sizeMode: -2 + dimension: -2 + outputChannels: -2 + outputPrecision: -2 + editFlags: -257 + doubleBuffered: 0 + wrapMode: -2 + filterMode: -2 + refreshMode: 0 + period: 0 + rtSettings: + widthScale: 1 + heightScale: 1 + depthScale: 1 + width: 0 + height: 0 + depth: 0 + potSize: 0 + sizeMode: 0 + dimension: 0 + outputChannels: 0 + outputPrecision: 0 + editFlags: 0 + doubleBuffered: 0 + wrapMode: 0 + filterMode: 0 + refreshMode: 0 + period: 0 + isPreviewCollapsed: 0 + previewMode: 15 + previewSRGB: 0 + previewMip: 0 + previewVisible: 1 + previewEV100: 0 + previewSlice: 0 + isPinned: 0 + 00000002: + type: {class: SubgraphNode, ns: Mixture, asm: Mixture.Runtime} + data: + nodeCustomName: + GUID: f7a75289-1f47-4422-85c1-8f023251ad0a + computeOrder: 2 + position: + serializedVersion: 2 + x: -541.99976 + y: 372.99988 + width: 250 + height: 417 + expanded: 0 + debug: 0 + nodeLock: 0 + settings: + widthScale: 1 + heightScale: 1 + depthScale: 1 + width: 1024 + height: 1024 + depth: 1 + potSize: 0 + sizeMode: -2 + dimension: -2 + outputChannels: -2 + outputPrecision: -2 + editFlags: -257 + doubleBuffered: 0 + wrapMode: -2 + filterMode: -2 + refreshMode: 0 + period: 0 + rtSettings: + widthScale: 1 + heightScale: 1 + depthScale: 1 + width: 0 + height: 0 + depth: 0 + potSize: 0 + sizeMode: 0 + dimension: 0 + outputChannels: 0 + outputPrecision: 0 + editFlags: 0 + doubleBuffered: 0 + wrapMode: 0 + filterMode: 0 + refreshMode: 0 + period: 0 + isPreviewCollapsed: 0 + previewMode: 7 + previewSRGB: 0 + previewMip: 0 + previewVisible: 1 + previewEV100: 0 + previewSlice: 0 + isPinned: 0 + templateGraph: {fileID: 11400000, guid: d446ae005dee81646884ad1b8c344225, + type: 2} + templateGraphTexture: {fileID: 4256279983331766550, guid: d446ae005dee81646884ad1b8c344225, + type: 2} + previewOutputIndex: 0 + 00000003: + type: {class: GradientNode, ns: Mixture, asm: Mixture.Runtime} + data: + nodeCustomName: + GUID: 1cd8f484-511a-4460-a989-b7017fbb31d9 + computeOrder: 3 + position: + serializedVersion: 2 + x: -541.9999 + y: 790 + width: 250 + height: 114 + expanded: 0 + debug: 0 + nodeLock: 0 + settings: + widthScale: 1 + heightScale: 1 + depthScale: 1 + width: 1024 + height: 1024 + depth: 1 + potSize: 0 + sizeMode: -2 + dimension: -2 + outputChannels: -2 + outputPrecision: -2 + editFlags: -257 + doubleBuffered: 0 + wrapMode: -2 + filterMode: -2 + refreshMode: 0 + period: 0 + rtSettings: + widthScale: 1 + heightScale: 1 + depthScale: 1 + width: 0 + height: 0 + depth: 0 + potSize: 0 + sizeMode: 0 + dimension: 0 + outputChannels: 0 + outputPrecision: 0 + editFlags: 0 + doubleBuffered: 0 + wrapMode: 0 + filterMode: 0 + refreshMode: 0 + period: 0 + isPreviewCollapsed: 0 + previewMode: 15 + previewSRGB: 0 + previewMip: 0 + previewVisible: 1 + previewEV100: 0 + previewSlice: 0 + isPinned: 0 + texture: {fileID: 0} + gradient: + serializedVersion: 2 + key0: {r: 1, g: 1, b: 1, a: 0} + key1: {r: 1, g: 1, b: 1, a: 1} + key2: {r: 0, g: 0, b: 0, a: 1} + key3: {r: 0, g: 0, b: 0, a: 0} + key4: {r: 0, g: 0, b: 0, a: 0} + key5: {r: 0, g: 0, b: 0, a: 0} + key6: {r: 0, g: 0, b: 0, a: 0} + key7: {r: 0, g: 0, b: 0, a: 0} + ctime0: 0 + ctime1: 65535 + ctime2: 0 + ctime3: 0 + ctime4: 0 + ctime5: 0 + ctime6: 0 + ctime7: 0 + atime0: 0 + atime1: 65535 + atime2: 65535 + atime3: 0 + atime4: 0 + atime5: 0 + atime6: 0 + atime7: 0 + m_Mode: 0 + m_NumColorKeys: 2 + m_NumAlphaKeys: 2 + 00000004: + type: {class: SubgraphNode, ns: Mixture, asm: Mixture.Runtime} + data: + nodeCustomName: Subgraph 1 + GUID: a549b36d-0ec4-492f-a902-bf48aaf932f3 + computeOrder: 1 + position: + serializedVersion: 2 + x: -541.7157 + y: -46.999996 + width: 250 + height: 417 + expanded: 0 + debug: 0 + nodeLock: 0 + settings: + widthScale: 1 + heightScale: 1 + depthScale: 1 + width: 1024 + height: 1024 + depth: 1 + potSize: 0 + sizeMode: -2 + dimension: -2 + outputChannels: -2 + outputPrecision: -2 + editFlags: -257 + doubleBuffered: 0 + wrapMode: -2 + filterMode: -2 + refreshMode: 0 + period: 0 + rtSettings: + widthScale: 1 + heightScale: 1 + depthScale: 1 + width: 0 + height: 0 + depth: 0 + potSize: 0 + sizeMode: 0 + dimension: 0 + outputChannels: 0 + outputPrecision: 0 + editFlags: 0 + doubleBuffered: 0 + wrapMode: 0 + filterMode: 0 + refreshMode: 0 + period: 0 + isPreviewCollapsed: 0 + previewMode: 7 + previewSRGB: 0 + previewMip: 0 + previewVisible: 1 + previewEV100: 0 + previewSlice: 0 + isPinned: 0 + templateGraph: {fileID: 11400000, guid: dbb9d2756e8366c498caaa5c91d846f6, + type: 2} + templateGraphTexture: {fileID: 4256279983331766550, guid: dbb9d2756e8366c498caaa5c91d846f6, + type: 2} + previewOutputIndex: 0 + 00000005: + type: {class: BlendNode, ns: Mixture, asm: Mixture.Runtime} + data: + nodeCustomName: + GUID: 695b3e10-b60a-468d-9b94-1a6f57af50f6 + computeOrder: 4 + position: + serializedVersion: 2 + x: -193.35999 + y: 373 + width: 250 + height: 503 + expanded: 0 + debug: 0 + nodeLock: 0 + settings: + widthScale: 1 + heightScale: 1 + depthScale: 1 + width: 1024 + height: 1024 + depth: 1 + potSize: 0 + sizeMode: -2 + dimension: -2 + outputChannels: -2 + outputPrecision: -2 + editFlags: -257 + doubleBuffered: 0 + wrapMode: -2 + filterMode: -2 + refreshMode: 0 + period: 0 + rtSettings: + widthScale: 1 + heightScale: 1 + depthScale: 1 + width: 0 + height: 0 + depth: 0 + potSize: 0 + sizeMode: 0 + dimension: 0 + outputChannels: 0 + outputPrecision: 0 + editFlags: 0 + doubleBuffered: 0 + wrapMode: 0 + filterMode: 0 + refreshMode: 0 + period: 0 + isPreviewCollapsed: 0 + previewMode: 7 + previewSRGB: 0 + previewMip: 0 + previewVisible: 1 + previewEV100: 0 + previewSlice: 0 + isPinned: 0 + shader: {fileID: 4800000, guid: 5d69ff00d9a32944ea012824393d489a, type: 3} + material: {fileID: 3771598539773622648} + exposedProperties: + - displayName: Source + referenceName: _Source_2D + tooltip: + type: + serializedType: UnityEngine.Texture2D, UnityEngine.CoreModule, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + - displayName: Target + referenceName: _Target_2D + tooltip: + type: + serializedType: UnityEngine.Texture2D, UnityEngine.CoreModule, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + - displayName: Mask + referenceName: _Mask_2D + tooltip: + type: + serializedType: UnityEngine.Texture2D, UnityEngine.CoreModule, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + - displayName: Opacity + referenceName: _Opacity + tooltip: Opacity of the Blend, 0 means that only Source is visible and + 1 that only Target is visible + type: + serializedType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + - displayName: Blend Mode + referenceName: _BlendMode + tooltip: + type: + serializedType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + - displayName: Mask Mode + referenceName: _MaskMode + tooltip: Select which channel is used to sample the mask value + type: + serializedType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + - displayName: Clamp Negative + referenceName: _RemoveNegative + tooltip: Avoids having negative values in the output texture + type: + serializedType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + shaderGUID: 5d69ff00d9a32944ea012824393d489a + 00000006: + type: {class: SubgraphNode, ns: Mixture, asm: Mixture.Runtime} + data: + nodeCustomName: + GUID: 9869ddcd-dc2e-4ce1-a2bd-a7ba562be718 + computeOrder: 12 + position: + serializedVersion: 2 + x: -193.00003 + y: 2034 + width: 250 + height: 393 + expanded: 0 + debug: 0 + nodeLock: 0 + settings: + widthScale: 1 + heightScale: 1 + depthScale: 1 + width: 1024 + height: 1024 + depth: 1 + potSize: 0 + sizeMode: -2 + dimension: -2 + outputChannels: -2 + outputPrecision: -2 + editFlags: -257 + doubleBuffered: 0 + wrapMode: -2 + filterMode: -2 + refreshMode: 0 + period: 0 + rtSettings: + widthScale: 1 + heightScale: 1 + depthScale: 1 + width: 0 + height: 0 + depth: 0 + potSize: 0 + sizeMode: 0 + dimension: 0 + outputChannels: 0 + outputPrecision: 0 + editFlags: 0 + doubleBuffered: 0 + wrapMode: 0 + filterMode: 0 + refreshMode: 0 + period: 0 + isPreviewCollapsed: 0 + previewMode: 7 + previewSRGB: 0 + previewMip: 0 + previewVisible: 1 + previewEV100: 0 + previewSlice: 0 + isPinned: 0 + templateGraph: {fileID: 11400000, guid: b319517573a4a2649a269da0c8134b75, + type: 2} + templateGraphTexture: {fileID: -2543242029321980837, guid: b319517573a4a2649a269da0c8134b75, + type: 2} + previewOutputIndex: 0 + 00000007: + type: {class: MakeVectorNode, ns: Mixture, asm: Mixture.Runtime} + data: + nodeCustomName: + GUID: 573c5abf-982a-4579-9f90-97b0067fdc16 + computeOrder: 10 + position: + serializedVersion: 2 + x: -593 + y: 2034 + width: 150 + height: 152 + expanded: 0 + debug: 0 + nodeLock: 0 + settings: + widthScale: 1 + heightScale: 1 + depthScale: 1 + width: 1024 + height: 1024 + depth: 1 + potSize: 0 + sizeMode: -2 + dimension: -2 + outputChannels: -2 + outputPrecision: -2 + editFlags: -257 + doubleBuffered: 0 + wrapMode: -2 + filterMode: -2 + refreshMode: 0 + period: 0 + rtSettings: + widthScale: 1 + heightScale: 1 + depthScale: 1 + width: 0 + height: 0 + depth: 0 + potSize: 0 + sizeMode: 0 + dimension: 0 + outputChannels: 0 + outputPrecision: 0 + editFlags: 0 + doubleBuffered: 0 + wrapMode: 0 + filterMode: 0 + refreshMode: 0 + period: 0 + isPreviewCollapsed: 0 + previewMode: 15 + previewSRGB: 0 + previewMip: 0 + previewVisible: 1 + previewEV100: 0 + previewSlice: 0 + isPinned: 0 + X: -0.64733493 + Y: -0.76220566 + Z: 0 + W: 1 + vector: {x: -0.64733493, y: -0.76220566, z: 0, w: 1} + 00000008: + type: {class: VectorRemapNode, ns: Mixture, asm: Mixture.Runtime} + data: + nodeCustomName: + GUID: 69ce189d-f0d9-450d-a50f-3a9512b90694 + computeOrder: 11 + position: + serializedVersion: 2 + x: -443.00003 + y: 2034 + width: 250 + height: 164 + expanded: 0 + debug: 0 + nodeLock: 0 + settings: + widthScale: 1 + heightScale: 1 + depthScale: 1 + width: 1024 + height: 1024 + depth: 1 + potSize: 0 + sizeMode: -2 + dimension: -2 + outputChannels: -2 + outputPrecision: -2 + editFlags: -257 + doubleBuffered: 0 + wrapMode: -2 + filterMode: -2 + refreshMode: 0 + period: 0 + rtSettings: + widthScale: 1 + heightScale: 1 + depthScale: 1 + width: 0 + height: 0 + depth: 0 + potSize: 0 + sizeMode: 0 + dimension: 0 + outputChannels: 0 + outputPrecision: 0 + editFlags: 0 + doubleBuffered: 0 + wrapMode: 0 + filterMode: 0 + refreshMode: 0 + period: 0 + isPreviewCollapsed: 0 + previewMode: 15 + previewSRGB: 0 + previewMip: 0 + previewVisible: 1 + previewEV100: 0 + previewSlice: 0 + isPinned: 0 + a: {x: -0.64733493, y: -0.76220566, z: 0, w: 1} + o: {x: 0.17633253, y: 0.11889717, z: 0.5, w: 1} + inputMin: -1 + inputMax: 1 + outputMin: 0 + outputMax: 1 + 00000009: + type: {class: SubgraphNode, ns: Mixture, asm: Mixture.Runtime} + data: + nodeCustomName: + GUID: 2934feac-d299-4f8a-8d24-bb15ef7b9ba3 + computeOrder: 6 + position: + serializedVersion: 2 + x: -193.00005 + y: 904.0001 + width: 250 + height: 393 + expanded: 0 + debug: 0 + nodeLock: 0 + settings: + widthScale: 1 + heightScale: 1 + depthScale: 1 + width: 1024 + height: 1024 + depth: 1 + potSize: 0 + sizeMode: -2 + dimension: -2 + outputChannels: -2 + outputPrecision: -2 + editFlags: -257 + doubleBuffered: 0 + wrapMode: -2 + filterMode: -2 + refreshMode: 0 + period: 0 + rtSettings: + widthScale: 1 + heightScale: 1 + depthScale: 1 + width: 0 + height: 0 + depth: 0 + potSize: 0 + sizeMode: 0 + dimension: 0 + outputChannels: 0 + outputPrecision: 0 + editFlags: 0 + doubleBuffered: 0 + wrapMode: 0 + filterMode: 0 + refreshMode: 0 + period: 0 + isPreviewCollapsed: 0 + previewMode: 15 + previewSRGB: 0 + previewMip: 0 + previewVisible: 1 + previewEV100: 0 + previewSlice: 0 + isPinned: 0 + templateGraph: {fileID: 11400000, guid: 224e8eba73b5d5343b6dee7f060c30c8, + type: 2} + templateGraphTexture: {fileID: -7214020342286181161, guid: 224e8eba73b5d5343b6dee7f060c30c8, + type: 2} + previewOutputIndex: 0 + 0000000A: + type: {class: SubgraphNode, ns: Mixture, asm: Mixture.Runtime} + data: + nodeCustomName: + GUID: 4b668907-ea29-4d54-ab04-e8f52921c3a6 + computeOrder: 8 + position: + serializedVersion: 2 + x: -193.00006 + y: 1469 + width: 250 + height: 393 + expanded: 0 + debug: 0 + nodeLock: 0 + settings: + widthScale: 1 + heightScale: 1 + depthScale: 1 + width: 1024 + height: 1024 + depth: 1 + potSize: 0 + sizeMode: -2 + dimension: -2 + outputChannels: -2 + outputPrecision: -2 + editFlags: -257 + doubleBuffered: 0 + wrapMode: -2 + filterMode: -2 + refreshMode: 0 + period: 0 + rtSettings: + widthScale: 1 + heightScale: 1 + depthScale: 1 + width: 0 + height: 0 + depth: 0 + potSize: 0 + sizeMode: 0 + dimension: 0 + outputChannels: 0 + outputPrecision: 0 + editFlags: 0 + doubleBuffered: 0 + wrapMode: 0 + filterMode: 0 + refreshMode: 0 + period: 0 + isPreviewCollapsed: 0 + previewMode: 15 + previewSRGB: 0 + previewMip: 0 + previewVisible: 1 + previewEV100: 0 + previewSlice: 0 + isPinned: 0 + templateGraph: {fileID: 11400000, guid: 224e8eba73b5d5343b6dee7f060c30c8, + type: 2} + templateGraphTexture: {fileID: -7214020342286181161, guid: 224e8eba73b5d5343b6dee7f060c30c8, + type: 2} + previewOutputIndex: 0 + 0000000B: + type: {class: TimeNode, ns: Mixture, asm: Mixture.Runtime} + data: + nodeCustomName: + GUID: b132f5e1-d46c-4c70-9aba-d08c9092c141 + computeOrder: 9 + position: + serializedVersion: 2 + x: -713 + y: 2010 + width: 120 + height: 176 + expanded: 0 + debug: 0 + nodeLock: 0 + settings: + widthScale: 1 + heightScale: 1 + depthScale: 1 + width: 1024 + height: 1024 + depth: 1 + potSize: 0 + sizeMode: -2 + dimension: -2 + outputChannels: -2 + outputPrecision: -2 + editFlags: -257 + doubleBuffered: 0 + wrapMode: -2 + filterMode: -2 + refreshMode: 0 + period: 0 + rtSettings: + widthScale: 1 + heightScale: 1 + depthScale: 1 + width: 0 + height: 0 + depth: 0 + potSize: 0 + sizeMode: 0 + dimension: 0 + outputChannels: 0 + outputPrecision: 0 + editFlags: 0 + doubleBuffered: 0 + wrapMode: 0 + filterMode: 0 + refreshMode: 0 + period: 0 + isPreviewCollapsed: 0 + previewMode: 15 + previewSRGB: 0 + previewMip: 0 + previewVisible: 1 + previewEV100: 0 + previewSlice: 0 + isPinned: 0 + 0000000C: + type: {class: RectanglesNode, ns: Mixture, asm: Mixture.Runtime} + data: + nodeCustomName: + GUID: 33a1aac5-bb6c-4cd4-9663-af4c6c95cf09 + computeOrder: 5 + position: + serializedVersion: 2 + x: -542 + y: 904.0001 + width: 250 + height: 565 + expanded: 0 + debug: 0 + nodeLock: 0 + settings: + widthScale: 1 + heightScale: 1 + depthScale: 1 + width: 1024 + height: 1024 + depth: 1 + potSize: 0 + sizeMode: -2 + dimension: -2 + outputChannels: -2 + outputPrecision: -2 + editFlags: -257 + doubleBuffered: 0 + wrapMode: -2 + filterMode: -2 + refreshMode: 0 + period: 0 + rtSettings: + widthScale: 1 + heightScale: 1 + depthScale: 1 + width: 0 + height: 0 + depth: 0 + potSize: 0 + sizeMode: 0 + dimension: 0 + outputChannels: 0 + outputPrecision: 0 + editFlags: 0 + doubleBuffered: 0 + wrapMode: 0 + filterMode: 0 + refreshMode: 0 + period: 0 + isPreviewCollapsed: 0 + previewMode: 15 + previewSRGB: 0 + previewMip: 0 + previewVisible: 1 + previewEV100: 0 + previewSlice: 0 + isPinned: 0 + shader: {fileID: -6465566751694194690, guid: 92d8c97c0c0de6a41a986ea9d3291139, + type: 3} + material: {fileID: -6861812596719011025} + exposedProperties: + - displayName: UV + referenceName: _UV_2D + tooltip: + type: + serializedType: UnityEngine.Texture2D, UnityEngine.CoreModule, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + - displayName: InnerColor + referenceName: Color_BBDDEF19 + tooltip: + type: + serializedType: UnityEngine.Color, UnityEngine.CoreModule, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + - displayName: OuterColor + referenceName: Color_69B370C1 + tooltip: + type: + serializedType: UnityEngine.Color, UnityEngine.CoreModule, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + - displayName: InnerSize + referenceName: Vector3_90ab8e0cfccc42ff933ee0f553788f88 + tooltip: + type: + serializedType: UnityEngine.Vector4, UnityEngine.CoreModule, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + - displayName: Smooth + referenceName: Vector1_80b6ea8c66f74c7b90cdad44939e757c + tooltip: + type: + serializedType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + shaderGUID: 92d8c97c0c0de6a41a986ea9d3291139 + 0000000D: + type: {class: Circles, ns: Mixture, asm: Mixture.Runtime} + data: + nodeCustomName: + GUID: b630fef7-7bfc-4aea-a082-f5fb2f443aed + computeOrder: 7 + position: + serializedVersion: 2 + x: -542 + y: 1469 + width: 250 + height: 565 + expanded: 0 + debug: 0 + nodeLock: 0 + settings: + widthScale: 1 + heightScale: 1 + depthScale: 1 + width: 1024 + height: 1024 + depth: 1 + potSize: 0 + sizeMode: -2 + dimension: -2 + outputChannels: -2 + outputPrecision: -2 + editFlags: -257 + doubleBuffered: 0 + wrapMode: -2 + filterMode: -2 + refreshMode: 0 + period: 0 + rtSettings: + widthScale: 1 + heightScale: 1 + depthScale: 1 + width: 0 + height: 0 + depth: 0 + potSize: 0 + sizeMode: 0 + dimension: 0 + outputChannels: 0 + outputPrecision: 0 + editFlags: 0 + doubleBuffered: 0 + wrapMode: 0 + filterMode: 0 + refreshMode: 0 + period: 0 + isPreviewCollapsed: 0 + previewMode: 15 + previewSRGB: 0 + previewMip: 0 + previewVisible: 1 + previewEV100: 0 + previewSlice: 0 + isPinned: 0 + shader: {fileID: -6465566751694194690, guid: d5d8cf3f4ee4f2d4283ca198b776e3af, + type: 3} + material: {fileID: 3296577972891407519} + exposedProperties: + - displayName: UV + referenceName: _UV_2D + tooltip: + type: + serializedType: UnityEngine.Texture2D, UnityEngine.CoreModule, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + - displayName: SphereColor + referenceName: Color_520A6CBD + tooltip: + type: + serializedType: UnityEngine.Color, UnityEngine.CoreModule, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + - displayName: OuterColor + referenceName: Color_2B645451 + tooltip: + type: + serializedType: UnityEngine.Color, UnityEngine.CoreModule, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + - displayName: Inner Size + referenceName: Vector3_e2b97f2ef6be4d4dbba34b9653cb3d6a + tooltip: + type: + serializedType: UnityEngine.Vector4, UnityEngine.CoreModule, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + - displayName: Smooth + referenceName: Vector1_1de7270f58eb414aa356b032360b0735 + tooltip: + type: + serializedType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + shaderGUID: d5d8cf3f4ee4f2d4283ca198b776e3af +--- !u!21 &2850363556456381128 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 3 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Hidden/Mixture/FinalCopy + m_Shader: {fileID: 4800000, guid: 513c040fbfb854aebb92cf147e30125a, type: 3} + m_ShaderKeywords: CRT_2D + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _Source_2D: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Source_3D: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Source_Cube: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: [] + m_Colors: [] + m_BuildTextureStacks: [] +--- !u!21 &3296577972891407519 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 3 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Hidden/Mixture/Circles + m_Shader: {fileID: -6465566751694194690, guid: d5d8cf3f4ee4f2d4283ca198b776e3af, + type: 3} + m_ShaderKeywords: CRT_2D + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _UV_2D: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _UV_3D: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _UV_Cube: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - Vector1_1de7270f58eb414aa356b032360b0735: 1 + m_Colors: + - Color_2B645451: {r: 0, g: 0, b: 0, a: 0} + - Color_520A6CBD: {r: 1, g: 1, b: 1, a: 1} + - Vector3_e2b97f2ef6be4d4dbba34b9653cb3d6a: {r: 0.5, g: 0.5, b: 0.5, a: 0} + - _Offset: {r: 0, g: 0, b: 0, a: 0} + - _Tile: {r: 1, g: 1, b: 1, a: 0} + m_BuildTextureStacks: [] +--- !u!21 &3771598539773622648 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 3 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Hidden/Mixture/Blend + m_Shader: {fileID: 4800000, guid: 5d69ff00d9a32944ea012824393d489a, type: 3} + m_ShaderKeywords: CRT_2D _REMOVENEGATIVE_ON + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _Mask_2D: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Mask_3D: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Mask_Cube: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Source_2D: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Source_3D: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Source_Cube: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Target_2D: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Target_3D: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Target_Cube: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _BlendMode: 0 + - _MaskMode: 4 + - _Opacity: 1 + - _RemoveNegative: 1 + m_Colors: [] + m_BuildTextureStacks: [] +--- !u!21 &4647130873688671849 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 3 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Hidden/Mixture/FinalCopy + m_Shader: {fileID: 4800000, guid: 513c040fbfb854aebb92cf147e30125a, type: 3} + m_ShaderKeywords: CRT_2D + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _Source_2D: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Source_3D: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Source_Cube: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: [] + m_Colors: [] + m_BuildTextureStacks: [] +--- !u!86 &6641087707738921690 +CustomRenderTexture: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Color + m_ImageContentsHash: + serializedVersion: 2 + Hash: 00000000000000000000000000000000 + m_ForcedFallbackFormat: 4 + m_DownscaleFallback: 0 + m_IsAlphaChannelOptional: 0 + serializedVersion: 3 + m_Width: 256 + m_Height: 256 + m_AntiAliasing: 1 + m_MipCount: -1 + m_DepthFormat: 0 + m_ColorFormat: 48 + m_MipMap: 0 + m_GenerateMips: 0 + m_SRGB: 0 + m_UseDynamicScale: 0 + m_BindMS: 0 + m_EnableCompatibleFormat: 1 + m_TextureSettings: + serializedVersion: 2 + m_FilterMode: 0 + m_Aniso: 1 + m_MipBias: 0 + m_WrapU: 0 + m_WrapV: 0 + m_WrapW: 0 + m_Dimension: 2 + m_VolumeDepth: 1 + m_Material: {fileID: 4647130873688671849} + m_InitSource: 0 + m_InitMaterial: {fileID: 0} + m_InitColor: {r: 1, g: 1, b: 1, a: 1} + m_InitTexture: {fileID: 0} + m_UpdateMode: 2 + m_InitializationMode: 2 + m_UpdateZoneSpace: 0 + m_CurrentUpdateZoneSpace: 0 + m_UpdateZones: [] + m_UpdatePeriod: 0 + m_ShaderPass: 0 + m_CubemapFaceMask: 4294967295 + m_DoubleBuffered: 0 + m_WrapUpdateZones: 0 +--- !u!21 &7133134556329247940 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 3 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Hidden/Mixture/FinalCopy + m_Shader: {fileID: 4800000, guid: 513c040fbfb854aebb92cf147e30125a, type: 3} + m_ShaderKeywords: CRT_2D + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _Source_2D: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Source_3D: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Source_Cube: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: [] + m_Colors: [] + m_BuildTextureStacks: [] diff --git a/Assets/Examples/Subgraph Tests/Main Graph.asset.meta b/Assets/Examples/Subgraph Tests/Main Graph.asset.meta new file mode 100644 index 00000000..5bc02119 --- /dev/null +++ b/Assets/Examples/Subgraph Tests/Main Graph.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: e6d79df5c728a0e498b847cfc07825e2 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: -1753224319336142041 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Examples/Subgraph Tests/Subgraph 1.asset b/Assets/Examples/Subgraph Tests/Subgraph 1.asset new file mode 100644 index 00000000..ea068053 --- /dev/null +++ b/Assets/Examples/Subgraph Tests/Subgraph 1.asset @@ -0,0 +1,729 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &-3045375437598217104 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 3 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Hidden/Mixture/RidgedCellularNoise + m_Shader: {fileID: 4800000, guid: 709dbd2e7ab678c4cb23bcf7fcf6fb2f, type: 3} + m_ShaderKeywords: CRT_2D USE_CUSTOM_UV _TILINGMODE_TILED + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _UV_2D: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _UV_3D: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _UV_Cube: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _CellSize: 1 + - _CellsModeA: 0 + - _CellsModeB: 0 + - _CellsModeG: 0 + - _CellsModeR: 0 + - _Channels: 0 + - _DistanceMode: 0 + - _Frequency: 1 + - _Lacunarity: 1.5 + - _Octaves: 4 + - _Persistance: 1 + - _Seed: 42 + - _TilingMode: 1 + - _UVMode: 0 + m_Colors: + - _OutputRange: {r: -1, g: 1, b: 0, a: 0} + m_BuildTextureStacks: [] +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 1 + 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: 3b113f958e0564f309164e29c24b042d, type: 3} + m_Name: Subgraph 2 + m_EditorClassIdentifier: + serializedNodes: [] + nodes: + - id: 0 + - id: 1 + - id: 2 + - id: 3 + - id: 4 + - id: 5 + edges: + - GUID: 764e4ba9-77d2-4e01-a3db-23202ddb4507 + owner: {fileID: 11400000} + inputNodeGUID: fa002829-debb-4c60-8046-d99e4d4ea4b2 + outputNodeGUID: 85d5714d-9337-4353-969a-58eb527c69ab + inputFieldName: X + outputFieldName: output + inputPortIdentifier: + outputPortIdentifier: output + - GUID: adce2bca-64cc-4cc0-9421-5e1058787651 + owner: {fileID: 11400000} + inputNodeGUID: fa002829-debb-4c60-8046-d99e4d4ea4b2 + outputNodeGUID: f00f78ea-136b-48bd-9ee7-20db0071266e + inputFieldName: Y + outputFieldName: output + inputPortIdentifier: + outputPortIdentifier: output + - GUID: dcb839b3-dde9-4974-b7eb-d46ef77ec85c + owner: {fileID: 11400000} + inputNodeGUID: 3de26369-3ab3-4da4-8025-5953a99e2ead + outputNodeGUID: fa002829-debb-4c60-8046-d99e4d4ea4b2 + inputFieldName: materialInputs + outputFieldName: vector + inputPortIdentifier: _Bias + outputPortIdentifier: + - GUID: 11e53d75-2e33-4b10-97b5-af2d54973889 + owner: {fileID: 11400000} + inputNodeGUID: 691aa737-9a89-40dd-b56d-201a248e396d + outputNodeGUID: ae29c9a7-27ea-4147-8b68-00e682037f56 + inputFieldName: outputTextureSettings + outputFieldName: output + inputPortIdentifier: Main Texture + outputPortIdentifier: output + - GUID: fe6f4d63-f704-41be-b3c5-3077455bd5ee + owner: {fileID: 11400000} + inputNodeGUID: ae29c9a7-27ea-4147-8b68-00e682037f56 + outputNodeGUID: 3de26369-3ab3-4da4-8025-5953a99e2ead + inputFieldName: materialInputs + outputFieldName: output + inputPortIdentifier: _UV_2D + outputPortIdentifier: output + groups: [] + stackNodes: [] + pinnedElements: + - position: + serializedVersion: 2 + x: 0 + y: 99 + width: 244 + height: 461 + opened: 1 + editorType: + serializedType: Mixture.MixtureParameterView, Unity.ShaderGraph.GraphicsTests, + Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + exposedParameters: + - id: 6 + - id: 7 + serializedParameterList: [] + stickyNotes: [] + nodeInspectorReference: {fileID: 0} + position: {x: 791, y: 166, z: 0} + scale: {x: 0.43232757, y: 0.43232757, z: 1} + version: 1 + type: 1 + realtimePreview: 0 + isRealtime: 0 + isParameterViewOpen: 1 + embedInBuild: 0 + defaultNodeInheritanceMode: -2 + objectReferences: + - {fileID: 4652733402955201651} + - {fileID: 8054274073769734054} + - {fileID: -3045375437598217104} + variants: [] + _mainOutputTexture: {fileID: 4256279983331766550} + _outputTextures: + - {fileID: 4256279983331766550} + - {fileID: 4256279983331766550} + settings: + widthScale: 1 + heightScale: 1 + depthScale: 1 + width: 256 + height: 256 + depth: 256 + potSize: 256 + sizeMode: 1 + dimension: 2 + outputChannels: 1 + outputPrecision: 3 + editFlags: 128 + doubleBuffered: 0 + wrapMode: 0 + filterMode: 0 + refreshMode: 1 + period: 17 + references: + version: 1 + 00000000: + type: {class: OutputNode, ns: Mixture, asm: Mixture.Runtime} + data: + nodeCustomName: + GUID: 691aa737-9a89-40dd-b56d-201a248e396d + computeOrder: 5 + position: + serializedVersion: 2 + x: -93.99999 + y: -43.999958 + width: 350 + height: 500 + expanded: 0 + debug: 0 + nodeLock: 0 + settings: + widthScale: 1 + heightScale: 1 + depthScale: 1 + width: 512 + height: 512 + depth: 1 + potSize: 512 + sizeMode: -2 + dimension: -2 + outputChannels: -2 + outputPrecision: -2 + editFlags: 471 + doubleBuffered: 0 + wrapMode: -2 + filterMode: -2 + refreshMode: 0 + period: 0 + rtSettings: + widthScale: 1 + heightScale: 1 + depthScale: 1 + width: 0 + height: 0 + depth: 0 + potSize: 0 + sizeMode: 0 + dimension: 0 + outputChannels: 0 + outputPrecision: 0 + editFlags: 0 + doubleBuffered: 0 + wrapMode: 0 + filterMode: 0 + refreshMode: 0 + period: 0 + isPreviewCollapsed: 0 + previewMode: 7 + previewSRGB: 0 + previewMip: 0 + previewVisible: 1 + previewEV100: 0 + previewSlice: 0 + isPinned: 0 + outputTextureSettings: + - inputTexture: {fileID: 0} + name: Main Texture + enableCompression: 1 + compressionFormat: 12 + compressionQuality: 100 + hasMipMaps: 0 + isMain: 1 + enableConversion: 0 + conversionFormat: 0 + sRGB: 0 + finalCopyMaterial: {fileID: 4652733402955201651} + _selectedPreviewIndex: 0 + 00000001: + type: {class: UVNode, ns: Mixture, asm: Mixture.Runtime} + data: + nodeCustomName: + GUID: 3de26369-3ab3-4da4-8025-5953a99e2ead + computeOrder: 3 + position: + serializedVersion: 2 + x: -594 + y: -44 + width: 250 + height: 435 + expanded: 0 + debug: 0 + nodeLock: 0 + settings: + widthScale: 1 + heightScale: 1 + depthScale: 1 + width: 1024 + height: 1024 + depth: 1 + potSize: 0 + sizeMode: -2 + dimension: -2 + outputChannels: -2 + outputPrecision: -2 + editFlags: -257 + doubleBuffered: 0 + wrapMode: -2 + filterMode: -2 + refreshMode: 0 + period: 0 + rtSettings: + widthScale: 1 + heightScale: 1 + depthScale: 1 + width: 0 + height: 0 + depth: 0 + potSize: 0 + sizeMode: 0 + dimension: 0 + outputChannels: 0 + outputPrecision: 0 + editFlags: 0 + doubleBuffered: 0 + wrapMode: 0 + filterMode: 0 + refreshMode: 0 + period: 0 + isPreviewCollapsed: 0 + previewMode: 15 + previewSRGB: 0 + previewMip: 0 + previewVisible: 1 + previewEV100: 0 + previewSlice: 0 + isPinned: 0 + shader: {fileID: 4800000, guid: 0e57459cc2eca8e4eb3e062b8ed60321, type: 3} + material: {fileID: 8054274073769734054} + exposedProperties: + - displayName: UV Scale + referenceName: _Scale + tooltip: + type: + serializedType: UnityEngine.Vector4, UnityEngine.CoreModule, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + - displayName: UV Bias + referenceName: _Bias + tooltip: + type: + serializedType: UnityEngine.Vector4, UnityEngine.CoreModule, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + shaderGUID: 0e57459cc2eca8e4eb3e062b8ed60321 + 00000002: + type: {class: ParameterNode, ns: GraphProcessor, asm: com.alelievr.NodeGraphProcessor.Runtime} + data: + nodeCustomName: + GUID: 85d5714d-9337-4353-969a-58eb527c69ab + computeOrder: 1 + position: + serializedVersion: 2 + x: -928.95 + y: -44 + width: 97 + height: 37 + expanded: 0 + debug: 0 + nodeLock: 0 + parameterGUID: c32cb7cc-0913-4e8d-89e1-d86ccfcc8c4b + accessor: 0 + 00000003: + type: {class: MakeVectorNode, ns: Mixture, asm: Mixture.Runtime} + data: + nodeCustomName: + GUID: fa002829-debb-4c60-8046-d99e4d4ea4b2 + computeOrder: 2 + position: + serializedVersion: 2 + x: -786.85 + y: -44 + width: 150 + height: 152 + expanded: 0 + debug: 0 + nodeLock: 0 + settings: + widthScale: 1 + heightScale: 1 + depthScale: 1 + width: 1024 + height: 1024 + depth: 1 + potSize: 0 + sizeMode: -2 + dimension: -2 + outputChannels: -2 + outputPrecision: -2 + editFlags: -257 + doubleBuffered: 0 + wrapMode: -2 + filterMode: -2 + refreshMode: 0 + period: 0 + rtSettings: + widthScale: 1 + heightScale: 1 + depthScale: 1 + width: 0 + height: 0 + depth: 0 + potSize: 0 + sizeMode: 0 + dimension: 0 + outputChannels: 0 + outputPrecision: 0 + editFlags: 0 + doubleBuffered: 0 + wrapMode: 0 + filterMode: 0 + refreshMode: 0 + period: 0 + isPreviewCollapsed: 0 + previewMode: 15 + previewSRGB: 0 + previewMip: 0 + previewVisible: 1 + previewEV100: 0 + previewSlice: 0 + isPinned: 0 + X: 0 + Y: 0 + Z: 0 + W: 0 + vector: {x: 0, y: 0, z: 0, w: 0} + 00000004: + type: {class: ParameterNode, ns: GraphProcessor, asm: com.alelievr.NodeGraphProcessor.Runtime} + data: + nodeCustomName: + GUID: f00f78ea-136b-48bd-9ee7-20db0071266e + computeOrder: 0 + position: + serializedVersion: 2 + x: -928.95 + y: -7.000007 + width: 97 + height: 37 + expanded: 0 + debug: 0 + nodeLock: 0 + parameterGUID: 99f9dc46-ccf9-47fd-aa97-db0ca86ce21a + accessor: 0 + 00000005: + type: {class: RidgedCellularNoise, ns: Mixture, asm: Mixture.Runtime} + data: + nodeCustomName: + GUID: ae29c9a7-27ea-4147-8b68-00e682037f56 + computeOrder: 4 + position: + serializedVersion: 2 + x: -343.99997 + y: -44 + width: 250 + height: 567 + expanded: 0 + debug: 0 + nodeLock: 0 + settings: + widthScale: 1 + heightScale: 1 + depthScale: 1 + width: 1024 + height: 1024 + depth: 1 + potSize: 0 + sizeMode: -2 + dimension: -2 + outputChannels: -2 + outputPrecision: -2 + editFlags: -257 + doubleBuffered: 0 + wrapMode: -2 + filterMode: -2 + refreshMode: 0 + period: 0 + rtSettings: + widthScale: 1 + heightScale: 1 + depthScale: 1 + width: 0 + height: 0 + depth: 0 + potSize: 0 + sizeMode: 0 + dimension: 0 + outputChannels: 0 + outputPrecision: 0 + editFlags: 0 + doubleBuffered: 0 + wrapMode: 0 + filterMode: 0 + refreshMode: 0 + period: 0 + isPreviewCollapsed: 0 + previewMode: 7 + previewSRGB: 0 + previewMip: 0 + previewVisible: 1 + previewEV100: 0 + previewSlice: 0 + isPinned: 0 + shader: {fileID: 4800000, guid: 709dbd2e7ab678c4cb23bcf7fcf6fb2f, type: 3} + material: {fileID: -3045375437598217104} + exposedProperties: + - displayName: UVs + referenceName: _UV_2D + tooltip: + type: + serializedType: UnityEngine.Texture2D, UnityEngine.CoreModule, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + - displayName: Tiling Mode + referenceName: _TilingMode + tooltip: + type: + serializedType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + - displayName: UV Mode + referenceName: _UVMode + tooltip: + type: + serializedType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + - displayName: Distance Mode + referenceName: _DistanceMode + tooltip: + type: + serializedType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + - displayName: Output Range + referenceName: _OutputRange + tooltip: + type: + serializedType: UnityEngine.Vector4, UnityEngine.CoreModule, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + - displayName: Lacunarity + referenceName: _Lacunarity + tooltip: + type: + serializedType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + - displayName: Frequency + referenceName: _Frequency + tooltip: + type: + serializedType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + - displayName: Persistance + referenceName: _Persistance + tooltip: + type: + serializedType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + - displayName: Octaves + referenceName: _Octaves + tooltip: + type: + serializedType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + - displayName: Cell Size + referenceName: _CellSize + tooltip: Act as a multiplier for the distance function + type: + serializedType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + - displayName: Seed + referenceName: _Seed + tooltip: + type: + serializedType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + - displayName: Channels + referenceName: _Channels + tooltip: Select how many noise to genereate and on which channel. The more + different channel you use the more expensive it is (max 4 noise evaluation). + type: + serializedType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + - displayName: Cells Mode R + referenceName: _CellsModeR + tooltip: + type: + serializedType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + - displayName: Cells Mode G + referenceName: _CellsModeG + tooltip: + type: + serializedType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + - displayName: Cells Mode B + referenceName: _CellsModeB + tooltip: + type: + serializedType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + - displayName: Cells Mode A + referenceName: _CellsModeA + tooltip: + type: + serializedType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + shaderGUID: 709dbd2e7ab678c4cb23bcf7fcf6fb2f + 00000006: + type: {class: FloatParameter, ns: GraphProcessor, asm: com.alelievr.NodeGraphProcessor.Runtime} + data: + guid: c32cb7cc-0913-4e8d-89e1-d86ccfcc8c4b + name: Translate X + type: + serializedValue: + serializedType: + serializedName: + serializedValue: + input: 1 + settings: + id: 8 + val: 0 + 00000007: + type: {class: FloatParameter, ns: GraphProcessor, asm: com.alelievr.NodeGraphProcessor.Runtime} + data: + guid: 99f9dc46-ccf9-47fd-aa97-db0ca86ce21a + name: Translate Y + type: + serializedValue: + serializedType: + serializedName: + serializedValue: + input: 1 + settings: + id: 9 + val: 0 + 00000008: + type: {class: FloatParameter/FloatSettings, ns: GraphProcessor, asm: com.alelievr.NodeGraphProcessor.Runtime} + data: + isHidden: 0 + expanded: 1 + guid: c32cb7cc-0913-4e8d-89e1-d86ccfcc8c4b + mode: 0 + min: 0 + max: 1 + 00000009: + type: {class: FloatParameter/FloatSettings, ns: GraphProcessor, asm: com.alelievr.NodeGraphProcessor.Runtime} + data: + isHidden: 0 + expanded: 1 + guid: 99f9dc46-ccf9-47fd-aa97-db0ca86ce21a + mode: 0 + min: 0 + max: 1 +--- !u!86 &4256279983331766550 +CustomRenderTexture: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Subgraph 1 + m_ImageContentsHash: + serializedVersion: 2 + Hash: 00000000000000000000000000000000 + m_ForcedFallbackFormat: 4 + m_DownscaleFallback: 0 + m_IsAlphaChannelOptional: 0 + serializedVersion: 3 + m_Width: 256 + m_Height: 256 + m_AntiAliasing: 1 + m_MipCount: -1 + m_DepthFormat: 0 + m_ColorFormat: 48 + m_MipMap: 0 + m_GenerateMips: 0 + m_SRGB: 0 + m_UseDynamicScale: 0 + m_BindMS: 0 + m_EnableCompatibleFormat: 1 + m_TextureSettings: + serializedVersion: 2 + m_FilterMode: 0 + m_Aniso: 1 + m_MipBias: 0 + m_WrapU: 0 + m_WrapV: 0 + m_WrapW: 0 + m_Dimension: 2 + m_VolumeDepth: 1 + m_Material: {fileID: 4652733402955201651} + m_InitSource: 0 + m_InitMaterial: {fileID: 0} + m_InitColor: {r: 1, g: 1, b: 1, a: 1} + m_InitTexture: {fileID: 0} + m_UpdateMode: 1 + m_InitializationMode: 2 + m_UpdateZoneSpace: 0 + m_CurrentUpdateZoneSpace: 0 + m_UpdateZones: [] + m_UpdatePeriod: 0 + m_ShaderPass: 0 + m_CubemapFaceMask: 4294967295 + m_DoubleBuffered: 0 + m_WrapUpdateZones: 0 +--- !u!21 &4652733402955201651 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 3 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Hidden/Mixture/FinalCopy + m_Shader: {fileID: 4800000, guid: 513c040fbfb854aebb92cf147e30125a, type: 3} + m_ShaderKeywords: CRT_2D + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _Source_2D: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Source_3D: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Source_Cube: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: [] + m_Colors: [] + m_BuildTextureStacks: [] +--- !u!21 &8054274073769734054 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 3 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Hidden/Mixture/UV + m_Shader: {fileID: 4800000, guid: 0e57459cc2eca8e4eb3e062b8ed60321, type: 3} + m_ShaderKeywords: CRT_2D + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: [] + m_Floats: [] + m_Colors: + - _Bias: {r: 0, g: 0, b: 0, a: 0} + - _Scale: {r: 2, g: 2, b: 1, a: 0} + m_BuildTextureStacks: [] diff --git a/Assets/Examples/Subgraph Tests/Subgraph 1.asset.meta b/Assets/Examples/Subgraph Tests/Subgraph 1.asset.meta new file mode 100644 index 00000000..8329a825 --- /dev/null +++ b/Assets/Examples/Subgraph Tests/Subgraph 1.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: dbb9d2756e8366c498caaa5c91d846f6 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 4256279983331766550 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Examples/Subgraph Tests/Subgraph 2.asset b/Assets/Examples/Subgraph Tests/Subgraph 2.asset new file mode 100644 index 00000000..a2a616f9 --- /dev/null +++ b/Assets/Examples/Subgraph Tests/Subgraph 2.asset @@ -0,0 +1,687 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 1 + 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: 3b113f958e0564f309164e29c24b042d, type: 3} + m_Name: Subgraph 2 + m_EditorClassIdentifier: + serializedNodes: [] + nodes: + - id: 0 + - id: 1 + - id: 2 + - id: 3 + - id: 4 + - id: 5 + edges: + - GUID: 0d196eb0-5c4c-4c50-a338-e78cebc405c4 + owner: {fileID: 11400000} + inputNodeGUID: 691aa737-9a89-40dd-b56d-201a248e396d + outputNodeGUID: 45b55e43-50ed-49df-b940-105b197c4bb0 + inputFieldName: outputTextureSettings + outputFieldName: output + inputPortIdentifier: Main Texture + outputPortIdentifier: output + - GUID: 784e3fa9-773d-4752-b438-affcaad95ab5 + owner: {fileID: 11400000} + inputNodeGUID: 45b55e43-50ed-49df-b940-105b197c4bb0 + outputNodeGUID: 3de26369-3ab3-4da4-8025-5953a99e2ead + inputFieldName: materialInputs + outputFieldName: output + inputPortIdentifier: _UV_2D + outputPortIdentifier: output + - GUID: 764e4ba9-77d2-4e01-a3db-23202ddb4507 + owner: {fileID: 11400000} + inputNodeGUID: fa002829-debb-4c60-8046-d99e4d4ea4b2 + outputNodeGUID: 85d5714d-9337-4353-969a-58eb527c69ab + inputFieldName: X + outputFieldName: output + inputPortIdentifier: + outputPortIdentifier: output + - GUID: adce2bca-64cc-4cc0-9421-5e1058787651 + owner: {fileID: 11400000} + inputNodeGUID: fa002829-debb-4c60-8046-d99e4d4ea4b2 + outputNodeGUID: f00f78ea-136b-48bd-9ee7-20db0071266e + inputFieldName: Y + outputFieldName: output + inputPortIdentifier: + outputPortIdentifier: output + - GUID: dcb839b3-dde9-4974-b7eb-d46ef77ec85c + owner: {fileID: 11400000} + inputNodeGUID: 3de26369-3ab3-4da4-8025-5953a99e2ead + outputNodeGUID: fa002829-debb-4c60-8046-d99e4d4ea4b2 + inputFieldName: materialInputs + outputFieldName: vector + inputPortIdentifier: _Bias + outputPortIdentifier: + groups: [] + stackNodes: [] + pinnedElements: + - position: + serializedVersion: 2 + x: 0 + y: 99 + width: 244 + height: 461 + opened: 1 + editorType: + serializedType: Mixture.MixtureParameterView, Unity.ShaderGraph.GraphicsTests, + Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + exposedParameters: + - id: 6 + - id: 7 + serializedParameterList: [] + stickyNotes: [] + nodeInspectorReference: {fileID: 0} + position: {x: 980, y: 66, z: 0} + scale: {x: 0.8148148, y: 0.8148148, z: 1} + version: 1 + type: 1 + realtimePreview: 0 + isRealtime: 0 + isParameterViewOpen: 1 + embedInBuild: 0 + defaultNodeInheritanceMode: -2 + objectReferences: + - {fileID: 4652733402955201651} + - {fileID: 5249714637275404893} + - {fileID: 8054274073769734054} + variants: [] + _mainOutputTexture: {fileID: 4256279983331766550} + _outputTextures: + - {fileID: 4256279983331766550} + - {fileID: 4256279983331766550} + settings: + widthScale: 1 + heightScale: 1 + depthScale: 1 + width: 256 + height: 256 + depth: 256 + potSize: 256 + sizeMode: 1 + dimension: 2 + outputChannels: 1 + outputPrecision: 3 + editFlags: 128 + doubleBuffered: 0 + wrapMode: 0 + filterMode: 0 + refreshMode: 1 + period: 17 + references: + version: 1 + 00000000: + type: {class: OutputNode, ns: Mixture, asm: Mixture.Runtime} + data: + nodeCustomName: + GUID: 691aa737-9a89-40dd-b56d-201a248e396d + computeOrder: 5 + position: + serializedVersion: 2 + x: -94.00001 + y: -44.000004 + width: 350 + height: 500 + expanded: 0 + debug: 0 + nodeLock: 0 + settings: + widthScale: 1 + heightScale: 1 + depthScale: 1 + width: 512 + height: 512 + depth: 1 + potSize: 512 + sizeMode: -2 + dimension: -2 + outputChannels: -2 + outputPrecision: -2 + editFlags: 471 + doubleBuffered: 0 + wrapMode: -2 + filterMode: -2 + refreshMode: 0 + period: 0 + rtSettings: + widthScale: 1 + heightScale: 1 + depthScale: 1 + width: 0 + height: 0 + depth: 0 + potSize: 0 + sizeMode: 0 + dimension: 0 + outputChannels: 0 + outputPrecision: 0 + editFlags: 0 + doubleBuffered: 0 + wrapMode: 0 + filterMode: 0 + refreshMode: 0 + period: 0 + isPreviewCollapsed: 0 + previewMode: 7 + previewSRGB: 0 + previewMip: 0 + previewVisible: 1 + previewEV100: 0 + previewSlice: 0 + isPinned: 0 + outputTextureSettings: + - inputTexture: {fileID: 0} + name: Main Texture + enableCompression: 1 + compressionFormat: 12 + compressionQuality: 100 + hasMipMaps: 0 + isMain: 1 + enableConversion: 0 + conversionFormat: 0 + sRGB: 0 + finalCopyMaterial: {fileID: 4652733402955201651} + _selectedPreviewIndex: 0 + 00000001: + type: {class: RidgedPerlinNoise, ns: Mixture, asm: Mixture.Runtime} + data: + nodeCustomName: + GUID: 45b55e43-50ed-49df-b940-105b197c4bb0 + computeOrder: 4 + position: + serializedVersion: 2 + x: -344.00003 + y: -43.999958 + width: 250 + height: 567 + expanded: 0 + debug: 0 + nodeLock: 0 + settings: + widthScale: 1 + heightScale: 1 + depthScale: 1 + width: 512 + height: 512 + depth: 1 + potSize: 0 + sizeMode: -2 + dimension: -2 + outputChannels: -2 + outputPrecision: -2 + editFlags: 255 + doubleBuffered: 0 + wrapMode: -2 + filterMode: -2 + refreshMode: 0 + period: 0 + rtSettings: + widthScale: 1 + heightScale: 1 + depthScale: 1 + width: 0 + height: 0 + depth: 0 + potSize: 0 + sizeMode: 0 + dimension: 0 + outputChannels: 0 + outputPrecision: 0 + editFlags: 0 + doubleBuffered: 0 + wrapMode: 0 + filterMode: 0 + refreshMode: 0 + period: 0 + isPreviewCollapsed: 0 + previewMode: 7 + previewSRGB: 0 + previewMip: 0 + previewVisible: 1 + previewEV100: 0 + previewSlice: 0 + isPinned: 0 + shader: {fileID: 4800000, guid: 49eed0c8b6dca3949a7864570e424043, type: 3} + material: {fileID: 5249714637275404893} + exposedProperties: + - displayName: UVs + referenceName: _UV_2D + tooltip: + type: + serializedType: UnityEngine.Texture2D, UnityEngine.CoreModule, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + - displayName: Tiling Mode + referenceName: _TilingMode + tooltip: + type: + serializedType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + - displayName: UV Mode + referenceName: _UVMode + tooltip: + type: + serializedType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + - displayName: Output Range + referenceName: _OutputRange + tooltip: + type: + serializedType: UnityEngine.Vector4, UnityEngine.CoreModule, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + - displayName: Lacunarity + referenceName: _Lacunarity + tooltip: + type: + serializedType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + - displayName: Frequency + referenceName: _Frequency + tooltip: + type: + serializedType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + - displayName: Persistance + referenceName: _Persistance + tooltip: + type: + serializedType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + - displayName: Octaves + referenceName: _Octaves + tooltip: + type: + serializedType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + - displayName: Seed + referenceName: _Seed + tooltip: + type: + serializedType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + - displayName: Channels + referenceName: _Channels + tooltip: Select how many noise to genereate and on which channel. The more + different channel you use the more expensive it is (max 4 noise evaluation). + type: + serializedType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + shaderGUID: 49eed0c8b6dca3949a7864570e424043 + 00000002: + type: {class: UVNode, ns: Mixture, asm: Mixture.Runtime} + data: + nodeCustomName: + GUID: 3de26369-3ab3-4da4-8025-5953a99e2ead + computeOrder: 3 + position: + serializedVersion: 2 + x: -594 + y: -44 + width: 250 + height: 435 + expanded: 0 + debug: 0 + nodeLock: 0 + settings: + widthScale: 1 + heightScale: 1 + depthScale: 1 + width: 1024 + height: 1024 + depth: 1 + potSize: 0 + sizeMode: -2 + dimension: -2 + outputChannels: -2 + outputPrecision: -2 + editFlags: -257 + doubleBuffered: 0 + wrapMode: -2 + filterMode: -2 + refreshMode: 0 + period: 0 + rtSettings: + widthScale: 1 + heightScale: 1 + depthScale: 1 + width: 0 + height: 0 + depth: 0 + potSize: 0 + sizeMode: 0 + dimension: 0 + outputChannels: 0 + outputPrecision: 0 + editFlags: 0 + doubleBuffered: 0 + wrapMode: 0 + filterMode: 0 + refreshMode: 0 + period: 0 + isPreviewCollapsed: 0 + previewMode: 15 + previewSRGB: 0 + previewMip: 0 + previewVisible: 1 + previewEV100: 0 + previewSlice: 0 + isPinned: 0 + shader: {fileID: 4800000, guid: 0e57459cc2eca8e4eb3e062b8ed60321, type: 3} + material: {fileID: 8054274073769734054} + exposedProperties: + - displayName: UV Scale + referenceName: _Scale + tooltip: + type: + serializedType: UnityEngine.Vector4, UnityEngine.CoreModule, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + - displayName: UV Bias + referenceName: _Bias + tooltip: + type: + serializedType: UnityEngine.Vector4, UnityEngine.CoreModule, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + shaderGUID: 0e57459cc2eca8e4eb3e062b8ed60321 + 00000003: + type: {class: ParameterNode, ns: GraphProcessor, asm: com.alelievr.NodeGraphProcessor.Runtime} + data: + nodeCustomName: + GUID: 85d5714d-9337-4353-969a-58eb527c69ab + computeOrder: 1 + position: + serializedVersion: 2 + x: -928.95 + y: -44 + width: 97 + height: 37 + expanded: 0 + debug: 0 + nodeLock: 0 + parameterGUID: c32cb7cc-0913-4e8d-89e1-d86ccfcc8c4b + accessor: 0 + 00000004: + type: {class: MakeVectorNode, ns: Mixture, asm: Mixture.Runtime} + data: + nodeCustomName: + GUID: fa002829-debb-4c60-8046-d99e4d4ea4b2 + computeOrder: 2 + position: + serializedVersion: 2 + x: -786.85 + y: -44 + width: 150 + height: 152 + expanded: 0 + debug: 0 + nodeLock: 0 + settings: + widthScale: 1 + heightScale: 1 + depthScale: 1 + width: 1024 + height: 1024 + depth: 1 + potSize: 0 + sizeMode: -2 + dimension: -2 + outputChannels: -2 + outputPrecision: -2 + editFlags: -257 + doubleBuffered: 0 + wrapMode: -2 + filterMode: -2 + refreshMode: 0 + period: 0 + rtSettings: + widthScale: 1 + heightScale: 1 + depthScale: 1 + width: 0 + height: 0 + depth: 0 + potSize: 0 + sizeMode: 0 + dimension: 0 + outputChannels: 0 + outputPrecision: 0 + editFlags: 0 + doubleBuffered: 0 + wrapMode: 0 + filterMode: 0 + refreshMode: 0 + period: 0 + isPreviewCollapsed: 0 + previewMode: 15 + previewSRGB: 0 + previewMip: 0 + previewVisible: 1 + previewEV100: 0 + previewSlice: 0 + isPinned: 0 + X: 0 + Y: 0 + Z: 0 + W: 0 + vector: {x: 0, y: 0, z: 0, w: 0} + 00000005: + type: {class: ParameterNode, ns: GraphProcessor, asm: com.alelievr.NodeGraphProcessor.Runtime} + data: + nodeCustomName: + GUID: f00f78ea-136b-48bd-9ee7-20db0071266e + computeOrder: 0 + position: + serializedVersion: 2 + x: -928.95 + y: -7.000007 + width: 97 + height: 37 + expanded: 0 + debug: 0 + nodeLock: 0 + parameterGUID: 99f9dc46-ccf9-47fd-aa97-db0ca86ce21a + accessor: 0 + 00000006: + type: {class: FloatParameter, ns: GraphProcessor, asm: com.alelievr.NodeGraphProcessor.Runtime} + data: + guid: c32cb7cc-0913-4e8d-89e1-d86ccfcc8c4b + name: Translate X + type: + serializedValue: + serializedType: + serializedName: + serializedValue: + input: 1 + settings: + id: 8 + val: 0 + 00000007: + type: {class: FloatParameter, ns: GraphProcessor, asm: com.alelievr.NodeGraphProcessor.Runtime} + data: + guid: 99f9dc46-ccf9-47fd-aa97-db0ca86ce21a + name: Translate Y + type: + serializedValue: + serializedType: + serializedName: + serializedValue: + input: 1 + settings: + id: 9 + val: 0 + 00000008: + type: {class: FloatParameter/FloatSettings, ns: GraphProcessor, asm: com.alelievr.NodeGraphProcessor.Runtime} + data: + isHidden: 0 + expanded: 1 + guid: c32cb7cc-0913-4e8d-89e1-d86ccfcc8c4b + mode: 0 + min: 0 + max: 1 + 00000009: + type: {class: FloatParameter/FloatSettings, ns: GraphProcessor, asm: com.alelievr.NodeGraphProcessor.Runtime} + data: + isHidden: 0 + expanded: 1 + guid: 99f9dc46-ccf9-47fd-aa97-db0ca86ce21a + mode: 0 + min: 0 + max: 1 +--- !u!86 &4256279983331766550 +CustomRenderTexture: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Subgraph 2 + m_ImageContentsHash: + serializedVersion: 2 + Hash: 00000000000000000000000000000000 + m_ForcedFallbackFormat: 4 + m_DownscaleFallback: 0 + m_IsAlphaChannelOptional: 0 + serializedVersion: 3 + m_Width: 256 + m_Height: 256 + m_AntiAliasing: 1 + m_MipCount: -1 + m_DepthFormat: 0 + m_ColorFormat: 48 + m_MipMap: 0 + m_GenerateMips: 0 + m_SRGB: 0 + m_UseDynamicScale: 0 + m_BindMS: 0 + m_EnableCompatibleFormat: 1 + m_TextureSettings: + serializedVersion: 2 + m_FilterMode: 0 + m_Aniso: 1 + m_MipBias: 0 + m_WrapU: 0 + m_WrapV: 0 + m_WrapW: 0 + m_Dimension: 2 + m_VolumeDepth: 1 + m_Material: {fileID: 4652733402955201651} + m_InitSource: 0 + m_InitMaterial: {fileID: 0} + m_InitColor: {r: 1, g: 1, b: 1, a: 1} + m_InitTexture: {fileID: 0} + m_UpdateMode: 1 + m_InitializationMode: 2 + m_UpdateZoneSpace: 0 + m_CurrentUpdateZoneSpace: 0 + m_UpdateZones: [] + m_UpdatePeriod: 0 + m_ShaderPass: 0 + m_CubemapFaceMask: 4294967295 + m_DoubleBuffered: 0 + m_WrapUpdateZones: 0 +--- !u!21 &4652733402955201651 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 3 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Hidden/Mixture/FinalCopy + m_Shader: {fileID: 4800000, guid: 513c040fbfb854aebb92cf147e30125a, type: 3} + m_ShaderKeywords: CRT_2D + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _Source_2D: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Source_3D: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Source_Cube: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: [] + m_Colors: [] + m_BuildTextureStacks: [] +--- !u!21 &5249714637275404893 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 3 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Hidden/Mixture/RidgedPerlinNoise + m_Shader: {fileID: 4800000, guid: 49eed0c8b6dca3949a7864570e424043, type: 3} + m_ShaderKeywords: CRT_2D USE_CUSTOM_UV _TILINGMODE_TILED + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _UV_2D: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _UV_3D: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _UV_Cube: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Channels: 0 + - _Frequency: 1 + - _Lacunarity: 2 + - _Octaves: 4 + - _Persistance: 1 + - _Seed: 42 + - _TilingMode: 1 + - _UVMode: 0 + m_Colors: + - _OutputRange: {r: 0, g: 1, b: 0, a: 0} + m_BuildTextureStacks: [] +--- !u!21 &8054274073769734054 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 3 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Hidden/Mixture/UV + m_Shader: {fileID: 4800000, guid: 0e57459cc2eca8e4eb3e062b8ed60321, type: 3} + m_ShaderKeywords: CRT_2D + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: [] + m_Floats: [] + m_Colors: + - _Bias: {r: 0, g: 0, b: 0, a: 0} + - _Scale: {r: 2, g: 2, b: 1, a: 0} + m_BuildTextureStacks: [] diff --git a/Assets/Examples/Subgraph Tests/Subgraph 2.asset.meta b/Assets/Examples/Subgraph Tests/Subgraph 2.asset.meta new file mode 100644 index 00000000..9752e929 --- /dev/null +++ b/Assets/Examples/Subgraph Tests/Subgraph 2.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: d446ae005dee81646884ad1b8c344225 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 4256279983331766550 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Examples/Subgraph Tests/Subgraph 3.asset b/Assets/Examples/Subgraph Tests/Subgraph 3.asset new file mode 100644 index 00000000..674f2598 --- /dev/null +++ b/Assets/Examples/Subgraph Tests/Subgraph 3.asset @@ -0,0 +1,1287 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &-7829020773977133606 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 3 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Hidden/Mixture/FinalCopy + m_Shader: {fileID: 4800000, guid: 513c040fbfb854aebb92cf147e30125a, type: 3} + m_ShaderKeywords: CRT_2D + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _Source_2D: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Source_3D: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Source_Cube: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: [] + m_Colors: [] + m_BuildTextureStacks: [] +--- !u!86 &-7214020342286181161 +CustomRenderTexture: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Subgraph 3 + m_ImageContentsHash: + serializedVersion: 2 + Hash: 00000000000000000000000000000000 + m_ForcedFallbackFormat: 4 + m_DownscaleFallback: 0 + m_IsAlphaChannelOptional: 0 + serializedVersion: 3 + m_Width: 256 + m_Height: 256 + m_AntiAliasing: 1 + m_MipCount: -1 + m_DepthFormat: 0 + m_ColorFormat: 48 + m_MipMap: 0 + m_GenerateMips: 0 + m_SRGB: 0 + m_UseDynamicScale: 0 + m_BindMS: 0 + m_EnableCompatibleFormat: 1 + m_TextureSettings: + serializedVersion: 2 + m_FilterMode: 0 + m_Aniso: 1 + m_MipBias: 0 + m_WrapU: 0 + m_WrapV: 0 + m_WrapW: 0 + m_Dimension: 2 + m_VolumeDepth: 1 + m_Material: {fileID: -7829020773977133606} + m_InitSource: 0 + m_InitMaterial: {fileID: 0} + m_InitColor: {r: 1, g: 1, b: 1, a: 1} + m_InitTexture: {fileID: 0} + m_UpdateMode: 1 + m_InitializationMode: 2 + m_UpdateZoneSpace: 0 + m_CurrentUpdateZoneSpace: 0 + m_UpdateZones: [] + m_UpdatePeriod: 0 + m_ShaderPass: 0 + m_CubemapFaceMask: 4294967295 + m_DoubleBuffered: 0 + m_WrapUpdateZones: 0 +--- !u!21 &-6116595179352468947 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 3 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Hidden/Mixture/Sub + m_Shader: {fileID: 4800000, guid: 47633e2c0f07a004eae77b0445ed0bd5, type: 3} + m_ShaderKeywords: CRT_2D + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _SourceA_2D: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _SourceA_3D: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _SourceA_Cube: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _SourceB_2D: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _SourceB_3D: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _SourceB_Cube: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: [] + m_Colors: + - _Value: {r: 0.01084185, g: 0.01084185, b: 0.01084185, a: 0.01084185} + m_BuildTextureStacks: [] +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 1 + 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: 3b113f958e0564f309164e29c24b042d, type: 3} + m_Name: Subgraph 3 + m_EditorClassIdentifier: + serializedNodes: [] + nodes: + - id: 0 + - id: 1 + - id: 2 + - id: 3 + - id: 4 + - id: 5 + - id: 6 + - id: 7 + - id: 8 + - id: 9 + - id: 10 + - id: 11 + edges: + - GUID: 159401e8-1072-4191-82f6-deee2e398791 + owner: {fileID: 11400000} + inputNodeGUID: 4afd5539-a7b7-4fff-9189-87e6d02fa1b9 + outputNodeGUID: 17cd7fc6-d54d-4b18-aed6-bb876d6f4466 + inputFieldName: input + outputFieldName: sinTime + inputPortIdentifier: + outputPortIdentifier: + - GUID: 8d39be88-ae46-4b91-b591-64b9bb802718 + owner: {fileID: 11400000} + inputNodeGUID: cd3efb66-9972-47bc-80e7-d654da2c6326 + outputNodeGUID: 4afd5539-a7b7-4fff-9189-87e6d02fa1b9 + inputFieldName: materialInputs + outputFieldName: output + inputPortIdentifier: _Source_2D + outputPortIdentifier: output + - GUID: 2133fde1-8ba3-4b45-932a-3523e6ecfb3e + owner: {fileID: 11400000} + inputNodeGUID: 91583c65-ed48-4ddc-bbb1-442b0f8d4967 + outputNodeGUID: 5d04dfd0-0707-4e4f-9d83-9b0474054a7d + inputFieldName: materialInputs + outputFieldName: output + inputPortIdentifier: _SourceA_2D + outputPortIdentifier: output + - GUID: 59da1edc-61e3-4f3c-87cc-9175aaa13661 + owner: {fileID: 11400000} + inputNodeGUID: 1e221c90-df28-4607-9232-74f922296031 + outputNodeGUID: adc47a89-10db-40c9-a853-93d9fd66be47 + inputFieldName: materialInputs + outputFieldName: output + inputPortIdentifier: _Source_2D + outputPortIdentifier: output + - GUID: c884befd-b8c2-4f09-96c1-a8123750c8a2 + owner: {fileID: 11400000} + inputNodeGUID: 1e221c90-df28-4607-9232-74f922296031 + outputNodeGUID: 91583c65-ed48-4ddc-bbb1-442b0f8d4967 + inputFieldName: materialInputs + outputFieldName: output + inputPortIdentifier: _Target_2D + outputPortIdentifier: output + - GUID: c941c258-7167-4d3d-95f5-d312f5b6f72a + owner: {fileID: 11400000} + inputNodeGUID: 691aa737-9a89-40dd-b56d-201a248e396d + outputNodeGUID: 1e221c90-df28-4607-9232-74f922296031 + inputFieldName: outputTextureSettings + outputFieldName: output + inputPortIdentifier: Main Texture + outputPortIdentifier: output + - GUID: df787340-7ee9-44dd-935c-7ed3485ac0e9 + owner: {fileID: 11400000} + inputNodeGUID: f5e51340-10c3-44a0-9450-80c5619e8fd5 + outputNodeGUID: 73f7bc5e-6b3e-4517-b00e-010923fc64ef + inputFieldName: b + outputFieldName: deltaTime + inputPortIdentifier: + outputPortIdentifier: + - GUID: adf937b9-ef04-4e37-b0be-630b4c72c923 + owner: {fileID: 11400000} + inputNodeGUID: f5e51340-10c3-44a0-9450-80c5619e8fd5 + outputNodeGUID: 7f9cf94a-87db-4c6f-9038-f7a3f31d8abf + inputFieldName: a + outputFieldName: Float + inputPortIdentifier: + outputPortIdentifier: + - GUID: d7d41d04-e53f-42fd-a001-83413ac9052e + owner: {fileID: 11400000} + inputNodeGUID: 91583c65-ed48-4ddc-bbb1-442b0f8d4967 + outputNodeGUID: f5e51340-10c3-44a0-9450-80c5619e8fd5 + inputFieldName: materialInputs + outputFieldName: o + inputPortIdentifier: _Value + outputPortIdentifier: + - GUID: ec80f740-8ba9-4605-876a-895ba1d34622 + owner: {fileID: 11400000} + inputNodeGUID: adc47a89-10db-40c9-a853-93d9fd66be47 + outputNodeGUID: cd3efb66-9972-47bc-80e7-d654da2c6326 + inputFieldName: materialInputs + outputFieldName: output + inputPortIdentifier: _SourceB_2D + outputPortIdentifier: output + - GUID: 2a2a59bc-5cd8-4729-b12e-97c7e5b4e437 + owner: {fileID: 11400000} + inputNodeGUID: adc47a89-10db-40c9-a853-93d9fd66be47 + outputNodeGUID: 2f9de894-ad72-4078-9d70-c276b906e5c0 + inputFieldName: materialInputs + outputFieldName: output + inputPortIdentifier: _SourceA_2D + outputPortIdentifier: output + groups: [] + stackNodes: [] + pinnedElements: + - position: + serializedVersion: 2 + x: 0 + y: 99 + width: 244 + height: 461 + opened: 1 + editorType: + serializedType: Mixture.MixtureParameterView, Unity.ShaderGraph.GraphicsTests, + Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + exposedParameters: + - id: 12 + serializedParameterList: [] + stickyNotes: [] + nodeInspectorReference: {fileID: 0} + position: {x: 1015, y: 114, z: 0} + scale: {x: 0.29610196, y: 0.29610196, z: 1} + version: 1 + type: 1 + realtimePreview: 0 + isRealtime: 0 + isParameterViewOpen: 1 + embedInBuild: 0 + defaultNodeInheritanceMode: -2 + objectReferences: + - {fileID: -7829020773977133606} + - {fileID: 3025132363452573466} + - {fileID: 2388753320272876202} + - {fileID: -6116595179352468947} + - {fileID: 1566850635384400703} + variants: [] + _mainOutputTexture: {fileID: -7214020342286181161} + _outputTextures: + - {fileID: -7214020342286181161} + - {fileID: -7214020342286181161} + settings: + widthScale: 1 + heightScale: 1 + depthScale: 1 + width: 256 + height: 256 + depth: 256 + potSize: 256 + sizeMode: 1 + dimension: 2 + outputChannels: 1 + outputPrecision: 3 + editFlags: 128 + doubleBuffered: 0 + wrapMode: 0 + filterMode: 0 + refreshMode: 1 + period: 50 + references: + version: 1 + 00000000: + type: {class: OutputNode, ns: Mixture, asm: Mixture.Runtime} + data: + nodeCustomName: + GUID: 691aa737-9a89-40dd-b56d-201a248e396d + computeOrder: 11 + position: + serializedVersion: 2 + x: -590.9999 + y: -246.99998 + width: 350 + height: 500 + expanded: 0 + debug: 0 + nodeLock: 0 + settings: + widthScale: 1 + heightScale: 1 + depthScale: 1 + width: 512 + height: 512 + depth: 1 + potSize: 512 + sizeMode: -2 + dimension: -2 + outputChannels: -2 + outputPrecision: -2 + editFlags: 471 + doubleBuffered: 0 + wrapMode: -2 + filterMode: -2 + refreshMode: 0 + period: 0 + rtSettings: + widthScale: 1 + heightScale: 1 + depthScale: 1 + width: 0 + height: 0 + depth: 0 + potSize: 0 + sizeMode: 0 + dimension: 0 + outputChannels: 0 + outputPrecision: 0 + editFlags: 0 + doubleBuffered: 0 + wrapMode: 0 + filterMode: 0 + refreshMode: 0 + period: 0 + isPreviewCollapsed: 0 + previewMode: 15 + previewSRGB: 0 + previewMip: 0 + previewVisible: 1 + previewEV100: 0 + previewSlice: 0 + isPinned: 0 + outputTextureSettings: + - inputTexture: {fileID: 0} + name: Main Texture + enableCompression: 1 + compressionFormat: 12 + compressionQuality: 100 + hasMipMaps: 0 + isMain: 1 + enableConversion: 0 + conversionFormat: 0 + sRGB: 0 + finalCopyMaterial: {fileID: -7829020773977133606} + _selectedPreviewIndex: 0 + 00000001: + type: {class: SelfNode, ns: Mixture, asm: Mixture.Runtime} + data: + nodeCustomName: + GUID: 5d04dfd0-0707-4e4f-9d83-9b0474054a7d + computeOrder: 5 + position: + serializedVersion: 2 + x: -1454.0002 + y: 318 + width: 250 + height: 440 + expanded: 0 + debug: 0 + nodeLock: 0 + settings: + widthScale: 1 + heightScale: 1 + depthScale: 1 + width: 1024 + height: 1024 + depth: 1 + potSize: 0 + sizeMode: -2 + dimension: -2 + outputChannels: -2 + outputPrecision: -2 + editFlags: -257 + doubleBuffered: 0 + wrapMode: -2 + filterMode: -2 + refreshMode: 0 + period: 0 + rtSettings: + widthScale: 1 + heightScale: 1 + depthScale: 1 + width: 0 + height: 0 + depth: 0 + potSize: 0 + sizeMode: 0 + dimension: 0 + outputChannels: 0 + outputPrecision: 0 + editFlags: 0 + doubleBuffered: 0 + wrapMode: 0 + filterMode: 0 + refreshMode: 0 + period: 0 + isPreviewCollapsed: 0 + previewMode: 15 + previewSRGB: 0 + previewMip: 0 + previewVisible: 1 + previewEV100: 0 + previewSlice: 0 + isPinned: 0 + initialTexture: {fileID: 0} + initialColor: {r: 0, g: 0, b: 0, a: 0} + _outputIndex: 0 + 00000002: + type: {class: TimeNode, ns: Mixture, asm: Mixture.Runtime} + data: + nodeCustomName: + GUID: 17cd7fc6-d54d-4b18-aed6-bb876d6f4466 + computeOrder: 1 + position: + serializedVersion: 2 + x: -1852.9995 + y: -247 + width: 120 + height: 176 + expanded: 0 + debug: 0 + nodeLock: 0 + settings: + widthScale: 1 + heightScale: 1 + depthScale: 1 + width: 1024 + height: 1024 + depth: 1 + potSize: 0 + sizeMode: -2 + dimension: -2 + outputChannels: -2 + outputPrecision: -2 + editFlags: -257 + doubleBuffered: 0 + wrapMode: -2 + filterMode: -2 + refreshMode: 0 + period: 0 + rtSettings: + widthScale: 1 + heightScale: 1 + depthScale: 1 + width: 0 + height: 0 + depth: 0 + potSize: 0 + sizeMode: 0 + dimension: 0 + outputChannels: 0 + outputPrecision: 0 + editFlags: 0 + doubleBuffered: 0 + wrapMode: 0 + filterMode: 0 + refreshMode: 0 + period: 0 + isPreviewCollapsed: 0 + previewMode: 15 + previewSRGB: 0 + previewMip: 0 + previewVisible: 1 + previewEV100: 0 + previewSlice: 0 + isPinned: 0 + 00000003: + type: {class: ThresholdNode, ns: Mixture, asm: Mixture.Runtime} + data: + nodeCustomName: + GUID: cd3efb66-9972-47bc-80e7-d654da2c6326 + computeOrder: 3 + position: + serializedVersion: 2 + x: -1453.9995 + y: -247 + width: 250 + height: 523 + expanded: 0 + debug: 0 + nodeLock: 0 + settings: + widthScale: 1 + heightScale: 1 + depthScale: 1 + width: 1024 + height: 1024 + depth: 1 + potSize: 0 + sizeMode: -2 + dimension: -2 + outputChannels: -2 + outputPrecision: -2 + editFlags: -257 + doubleBuffered: 0 + wrapMode: -2 + filterMode: -2 + refreshMode: 0 + period: 0 + rtSettings: + widthScale: 1 + heightScale: 1 + depthScale: 1 + width: 0 + height: 0 + depth: 0 + potSize: 0 + sizeMode: 0 + dimension: 0 + outputChannels: 0 + outputPrecision: 0 + editFlags: 0 + doubleBuffered: 0 + wrapMode: 0 + filterMode: 0 + refreshMode: 0 + period: 0 + isPreviewCollapsed: 0 + previewMode: 15 + previewSRGB: 0 + previewMip: 0 + previewVisible: 1 + previewEV100: 0 + previewSlice: 0 + isPinned: 0 + shader: {fileID: 4800000, guid: bd0e9b179d9b69e4f9a0f98d347bee62, type: 3} + material: {fileID: 3025132363452573466} + exposedProperties: + - displayName: Input + referenceName: _Source_2D + tooltip: + type: + serializedType: UnityEngine.Texture2D, UnityEngine.CoreModule, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + - displayName: Channel + referenceName: _Channel + tooltip: + type: + serializedType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + - displayName: Threshold + referenceName: _Threshold + tooltip: + type: + serializedType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + - displayName: Feather + referenceName: _Feather + tooltip: Smooth the treshold step + type: + serializedType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + - displayName: Invert + referenceName: _Invert + tooltip: + type: + serializedType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + shaderGUID: bd0e9b179d9b69e4f9a0f98d347bee62 + 00000004: + type: {class: VectorToTexture, ns: Mixture, asm: Mixture.Runtime} + data: + nodeCustomName: + GUID: 4afd5539-a7b7-4fff-9189-87e6d02fa1b9 + computeOrder: 2 + position: + serializedVersion: 2 + x: -1703.9995 + y: -247 + width: 250 + height: 80 + expanded: 0 + debug: 0 + nodeLock: 0 + settings: + widthScale: 1 + heightScale: 1 + depthScale: 1 + width: 1024 + height: 1024 + depth: 1 + potSize: 0 + sizeMode: -2 + dimension: -2 + outputChannels: -2 + outputPrecision: -2 + editFlags: -257 + doubleBuffered: 0 + wrapMode: -2 + filterMode: -2 + refreshMode: 0 + period: 0 + rtSettings: + widthScale: 1 + heightScale: 1 + depthScale: 1 + width: 0 + height: 0 + depth: 0 + potSize: 0 + sizeMode: 0 + dimension: 0 + outputChannels: 0 + outputPrecision: 0 + editFlags: 0 + doubleBuffered: 0 + wrapMode: 0 + filterMode: 0 + refreshMode: 0 + period: 0 + isPreviewCollapsed: 0 + previewMode: 15 + previewSRGB: 0 + previewMip: 0 + previewVisible: 1 + previewEV100: 0 + previewSlice: 0 + isPinned: 0 + input: {x: -0.64733493, y: -0.64733493, z: -0.64733493, w: -0.64733493} + output: {fileID: 0} + 00000005: + type: {class: MulNode, ns: Mixture, asm: Mixture.Runtime} + data: + nodeCustomName: + GUID: adc47a89-10db-40c9-a853-93d9fd66be47 + computeOrder: 4 + position: + serializedVersion: 2 + x: -1148 + y: -246.99997 + width: 250 + height: 457 + expanded: 0 + debug: 0 + nodeLock: 0 + settings: + widthScale: 1 + heightScale: 1 + depthScale: 1 + width: 1024 + height: 1024 + depth: 1 + potSize: 0 + sizeMode: -2 + dimension: -2 + outputChannels: -2 + outputPrecision: -2 + editFlags: -257 + doubleBuffered: 0 + wrapMode: -2 + filterMode: -2 + refreshMode: 0 + period: 0 + rtSettings: + widthScale: 1 + heightScale: 1 + depthScale: 1 + width: 0 + height: 0 + depth: 0 + potSize: 0 + sizeMode: 0 + dimension: 0 + outputChannels: 0 + outputPrecision: 0 + editFlags: 0 + doubleBuffered: 0 + wrapMode: 0 + filterMode: 0 + refreshMode: 0 + period: 0 + isPreviewCollapsed: 0 + previewMode: 15 + previewSRGB: 0 + previewMip: 0 + previewVisible: 1 + previewEV100: 0 + previewSlice: 0 + isPinned: 0 + shader: {fileID: 4800000, guid: 535eef2511f2f5540b6c9cc7430067f4, type: 3} + material: {fileID: 2388753320272876202} + exposedProperties: + - displayName: Source A + referenceName: _SourceA_2D + tooltip: + type: + serializedType: UnityEngine.Texture2D, UnityEngine.CoreModule, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + - displayName: Source B + referenceName: _SourceB_2D + tooltip: + type: + serializedType: UnityEngine.Texture2D, UnityEngine.CoreModule, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + - displayName: Value + referenceName: _Value + tooltip: + type: + serializedType: UnityEngine.Vector4, UnityEngine.CoreModule, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + shaderGUID: 535eef2511f2f5540b6c9cc7430067f4 + 00000006: + type: {class: SubNode, ns: Mixture, asm: Mixture.Runtime} + data: + nodeCustomName: + GUID: 91583c65-ed48-4ddc-bbb1-442b0f8d4967 + computeOrder: 9 + position: + serializedVersion: 2 + x: -1148 + y: 318 + width: 250 + height: 421 + expanded: 0 + debug: 0 + nodeLock: 0 + settings: + widthScale: 1 + heightScale: 1 + depthScale: 1 + width: 1024 + height: 1024 + depth: 1 + potSize: 0 + sizeMode: -2 + dimension: -2 + outputChannels: -2 + outputPrecision: -2 + editFlags: -257 + doubleBuffered: 0 + wrapMode: -2 + filterMode: -2 + refreshMode: 0 + period: 0 + rtSettings: + widthScale: 1 + heightScale: 1 + depthScale: 1 + width: 0 + height: 0 + depth: 0 + potSize: 0 + sizeMode: 0 + dimension: 0 + outputChannels: 0 + outputPrecision: 0 + editFlags: 0 + doubleBuffered: 0 + wrapMode: 0 + filterMode: 0 + refreshMode: 0 + period: 0 + isPreviewCollapsed: 0 + previewMode: 15 + previewSRGB: 0 + previewMip: 0 + previewVisible: 1 + previewEV100: 0 + previewSlice: 0 + isPinned: 0 + shader: {fileID: 4800000, guid: 47633e2c0f07a004eae77b0445ed0bd5, type: 3} + material: {fileID: -6116595179352468947} + exposedProperties: + - displayName: Source A + referenceName: _SourceA_2D + tooltip: + type: + serializedType: UnityEngine.Texture2D, UnityEngine.CoreModule, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + - displayName: Source B + referenceName: _SourceB_2D + tooltip: + type: + serializedType: UnityEngine.Texture2D, UnityEngine.CoreModule, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + - displayName: Value + referenceName: _Value + tooltip: + type: + serializedType: UnityEngine.Vector4, UnityEngine.CoreModule, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + shaderGUID: 47633e2c0f07a004eae77b0445ed0bd5 + 00000007: + type: {class: BlendNode, ns: Mixture, asm: Mixture.Runtime} + data: + nodeCustomName: + GUID: 1e221c90-df28-4607-9232-74f922296031 + computeOrder: 10 + position: + serializedVersion: 2 + x: -840.9205 + y: -246.99997 + width: 250 + height: 503 + expanded: 0 + debug: 0 + nodeLock: 0 + settings: + widthScale: 1 + heightScale: 1 + depthScale: 1 + width: 1024 + height: 1024 + depth: 1 + potSize: 0 + sizeMode: -2 + dimension: -2 + outputChannels: -2 + outputPrecision: -2 + editFlags: -257 + doubleBuffered: 0 + wrapMode: -2 + filterMode: -2 + refreshMode: 0 + period: 0 + rtSettings: + widthScale: 1 + heightScale: 1 + depthScale: 1 + width: 0 + height: 0 + depth: 0 + potSize: 0 + sizeMode: 0 + dimension: 0 + outputChannels: 0 + outputPrecision: 0 + editFlags: 0 + doubleBuffered: 0 + wrapMode: 0 + filterMode: 0 + refreshMode: 0 + period: 0 + isPreviewCollapsed: 0 + previewMode: 15 + previewSRGB: 0 + previewMip: 0 + previewVisible: 1 + previewEV100: 0 + previewSlice: 0 + isPinned: 0 + shader: {fileID: 4800000, guid: 5d69ff00d9a32944ea012824393d489a, type: 3} + material: {fileID: 1566850635384400703} + exposedProperties: + - displayName: Source + referenceName: _Source_2D + tooltip: + type: + serializedType: UnityEngine.Texture2D, UnityEngine.CoreModule, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + - displayName: Target + referenceName: _Target_2D + tooltip: + type: + serializedType: UnityEngine.Texture2D, UnityEngine.CoreModule, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + - displayName: Mask + referenceName: _Mask_2D + tooltip: + type: + serializedType: UnityEngine.Texture2D, UnityEngine.CoreModule, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + - displayName: Opacity + referenceName: _Opacity + tooltip: Opacity of the Blend, 0 means that only Source is visible and + 1 that only Target is visible + type: + serializedType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + - displayName: Blend Mode + referenceName: _BlendMode + tooltip: + type: + serializedType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + - displayName: Mask Mode + referenceName: _MaskMode + tooltip: Select which channel is used to sample the mask value + type: + serializedType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + - displayName: Clamp Negative + referenceName: _RemoveNegative + tooltip: Avoids having negative values in the output texture + type: + serializedType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + shaderGUID: 5d69ff00d9a32944ea012824393d489a + 00000008: + type: {class: FloatMulNode, ns: Mixture, asm: Mixture.Runtime} + data: + nodeCustomName: + GUID: f5e51340-10c3-44a0-9450-80c5619e8fd5 + computeOrder: 8 + position: + serializedVersion: 2 + x: -1304 + y: 773 + width: 100 + height: 104 + expanded: 0 + debug: 0 + nodeLock: 0 + settings: + widthScale: 1 + heightScale: 1 + depthScale: 1 + width: 1024 + height: 1024 + depth: 1 + potSize: 0 + sizeMode: -2 + dimension: -2 + outputChannels: -2 + outputPrecision: -2 + editFlags: -257 + doubleBuffered: 0 + wrapMode: -2 + filterMode: -2 + refreshMode: 0 + period: 0 + rtSettings: + widthScale: 1 + heightScale: 1 + depthScale: 1 + width: 0 + height: 0 + depth: 0 + potSize: 0 + sizeMode: 0 + dimension: 0 + outputChannels: 0 + outputPrecision: 0 + editFlags: 0 + doubleBuffered: 0 + wrapMode: 0 + filterMode: 0 + refreshMode: 0 + period: 0 + isPreviewCollapsed: 0 + previewMode: 15 + previewSRGB: 0 + previewMip: 0 + previewVisible: 1 + previewEV100: 0 + previewSlice: 0 + isPinned: 0 + a: 0.5 + b: 0.0216837 + o: 0.01084185 + 00000009: + type: {class: TimeNode, ns: Mixture, asm: Mixture.Runtime} + data: + nodeCustomName: + GUID: 73f7bc5e-6b3e-4517-b00e-010923fc64ef + computeOrder: 6 + position: + serializedVersion: 2 + x: -1574 + y: 874 + width: 120 + height: 176 + expanded: 0 + debug: 0 + nodeLock: 0 + settings: + widthScale: 1 + heightScale: 1 + depthScale: 1 + width: 1024 + height: 1024 + depth: 1 + potSize: 0 + sizeMode: -2 + dimension: -2 + outputChannels: -2 + outputPrecision: -2 + editFlags: -257 + doubleBuffered: 0 + wrapMode: -2 + filterMode: -2 + refreshMode: 0 + period: 0 + rtSettings: + widthScale: 1 + heightScale: 1 + depthScale: 1 + width: 0 + height: 0 + depth: 0 + potSize: 0 + sizeMode: 0 + dimension: 0 + outputChannels: 0 + outputPrecision: 0 + editFlags: 0 + doubleBuffered: 0 + wrapMode: 0 + filterMode: 0 + refreshMode: 0 + period: 0 + isPreviewCollapsed: 0 + previewMode: 15 + previewSRGB: 0 + previewMip: 0 + previewVisible: 1 + previewEV100: 0 + previewSlice: 0 + isPinned: 0 + 0000000A: + type: {class: FloatNode, ns: Mixture, asm: Mixture.Runtime} + data: + nodeCustomName: + GUID: 7f9cf94a-87db-4c6f-9038-f7a3f31d8abf + computeOrder: 7 + position: + serializedVersion: 2 + x: -1604 + y: 773 + width: 150 + height: 101 + expanded: 0 + debug: 0 + nodeLock: 0 + settings: + widthScale: 1 + heightScale: 1 + depthScale: 1 + width: 1024 + height: 1024 + depth: 1 + potSize: 0 + sizeMode: -2 + dimension: -2 + outputChannels: -2 + outputPrecision: -2 + editFlags: -257 + doubleBuffered: 0 + wrapMode: -2 + filterMode: -2 + refreshMode: 0 + period: 0 + rtSettings: + widthScale: 1 + heightScale: 1 + depthScale: 1 + width: 0 + height: 0 + depth: 0 + potSize: 0 + sizeMode: 0 + dimension: 0 + outputChannels: 0 + outputPrecision: 0 + editFlags: 0 + doubleBuffered: 0 + wrapMode: 0 + filterMode: 0 + refreshMode: 0 + period: 0 + isPreviewCollapsed: 0 + previewMode: 15 + previewSRGB: 0 + previewMip: 0 + previewVisible: 1 + previewEV100: 0 + previewSlice: 0 + isPinned: 0 + Float: 0.5 + 0000000B: + type: {class: ParameterNode, ns: GraphProcessor, asm: com.alelievr.NodeGraphProcessor.Runtime} + data: + nodeCustomName: + GUID: 2f9de894-ad72-4078-9d70-c276b906e5c0 + computeOrder: 0 + position: + serializedVersion: 2 + x: -1282 + y: -284 + width: 78 + height: 37 + expanded: 0 + debug: 0 + nodeLock: 0 + parameterGUID: 30a9d428-d073-472e-904c-b0a1072d0b5a + accessor: 0 + 0000000C: + type: {class: TextureParameter, ns: Mixture, asm: Unity.ShaderGraph.GraphicsTests} + data: + guid: 30a9d428-d073-472e-904c-b0a1072d0b5a + name: Shapes + type: + serializedValue: + serializedType: + serializedName: + serializedValue: + input: 1 + settings: + id: 13 + val: {fileID: 0} + 0000000D: + type: {class: ExposedParameter/Settings, ns: GraphProcessor, asm: com.alelievr.NodeGraphProcessor.Runtime} + data: + isHidden: 0 + expanded: 1 + guid: 30a9d428-d073-472e-904c-b0a1072d0b5a +--- !u!21 &1566850635384400703 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 3 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Hidden/Mixture/Blend + m_Shader: {fileID: 4800000, guid: 5d69ff00d9a32944ea012824393d489a, type: 3} + m_ShaderKeywords: CRT_2D _REMOVENEGATIVE_ON + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _Mask_2D: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Mask_3D: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Mask_Cube: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Source_2D: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Source_3D: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Source_Cube: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Target_2D: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Target_3D: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Target_Cube: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _BlendMode: 2 + - _MaskMode: 1 + - _Opacity: 1 + - _RemoveNegative: 1 + m_Colors: [] + m_BuildTextureStacks: [] +--- !u!21 &2388753320272876202 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 3 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Hidden/Mixture/Mul + m_Shader: {fileID: 4800000, guid: 535eef2511f2f5540b6c9cc7430067f4, type: 3} + m_ShaderKeywords: CRT_2D + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _SourceA_2D: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _SourceA_3D: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _SourceA_Cube: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _SourceB_2D: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _SourceB_3D: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _SourceB_Cube: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: [] + m_Colors: + - _Value: {r: 1, g: 1, b: 1, a: 1} + m_BuildTextureStacks: [] +--- !u!21 &3025132363452573466 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 3 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Hidden/Mixture/Threshold + m_Shader: {fileID: 4800000, guid: bd0e9b179d9b69e4f9a0f98d347bee62, type: 3} + m_ShaderKeywords: CRT_2D + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _Source_2D: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Source_3D: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Source_Cube: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Channel: 0 + - _Feather: 0 + - _Invert: 0 + - _Threshold: 0.95 + m_Colors: [] + m_BuildTextureStacks: [] diff --git a/Assets/Examples/Subgraph Tests/Subgraph 3.asset.meta b/Assets/Examples/Subgraph Tests/Subgraph 3.asset.meta new file mode 100644 index 00000000..2f06a443 --- /dev/null +++ b/Assets/Examples/Subgraph Tests/Subgraph 3.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 224e8eba73b5d5343b6dee7f060c30c8 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: -7214020342286181161 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Examples/Subgraph Tests/Subgraph 4.asset b/Assets/Examples/Subgraph Tests/Subgraph 4.asset new file mode 100644 index 00000000..3423e081 --- /dev/null +++ b/Assets/Examples/Subgraph Tests/Subgraph 4.asset @@ -0,0 +1,393 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!86 &-2543242029321980837 +CustomRenderTexture: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Subgraph 4 + m_ImageContentsHash: + serializedVersion: 2 + Hash: 00000000000000000000000000000000 + m_ForcedFallbackFormat: 4 + m_DownscaleFallback: 0 + m_IsAlphaChannelOptional: 0 + serializedVersion: 3 + m_Width: 256 + m_Height: 256 + m_AntiAliasing: 1 + m_MipCount: -1 + m_DepthFormat: 0 + m_ColorFormat: 48 + m_MipMap: 0 + m_GenerateMips: 0 + m_SRGB: 0 + m_UseDynamicScale: 0 + m_BindMS: 0 + m_EnableCompatibleFormat: 1 + m_TextureSettings: + serializedVersion: 2 + m_FilterMode: 0 + m_Aniso: 1 + m_MipBias: 0 + m_WrapU: 0 + m_WrapV: 0 + m_WrapW: 0 + m_Dimension: 2 + m_VolumeDepth: 1 + m_Material: {fileID: -1324138349505637682} + m_InitSource: 0 + m_InitMaterial: {fileID: 0} + m_InitColor: {r: 1, g: 1, b: 1, a: 1} + m_InitTexture: {fileID: 0} + m_UpdateMode: 0 + m_InitializationMode: 2 + m_UpdateZoneSpace: 0 + m_CurrentUpdateZoneSpace: 0 + m_UpdateZones: [] + m_UpdatePeriod: 0 + m_ShaderPass: 0 + m_CubemapFaceMask: 4294967295 + m_DoubleBuffered: 0 + m_WrapUpdateZones: 0 +--- !u!21 &-1324138349505637682 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 3 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Hidden/Mixture/FinalCopy + m_Shader: {fileID: 4800000, guid: 513c040fbfb854aebb92cf147e30125a, type: 3} + m_ShaderKeywords: CRT_2D + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _Source_2D: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Source_3D: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Source_Cube: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: [] + m_Colors: [] + m_BuildTextureStacks: [] +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 1 + 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: 3b113f958e0564f309164e29c24b042d, type: 3} + m_Name: Subgraph 4 + m_EditorClassIdentifier: + serializedNodes: [] + nodes: + - id: 0 + - id: 1 + - id: 2 + edges: + - GUID: 4e7fc6da-8aee-4fad-be4d-183233f74c33 + owner: {fileID: 11400000} + inputNodeGUID: 691aa737-9a89-40dd-b56d-201a248e396d + outputNodeGUID: 27464fde-d534-4fe2-a600-0b3453b9e6ed + inputFieldName: outputTextureSettings + outputFieldName: output + inputPortIdentifier: Main Texture + outputPortIdentifier: output + - GUID: 5ba48861-cb54-4a0e-a06b-8e993eb086df + owner: {fileID: 11400000} + inputNodeGUID: 27464fde-d534-4fe2-a600-0b3453b9e6ed + outputNodeGUID: 1da41d33-dfbc-4f22-801e-5ead80ddc742 + inputFieldName: input + outputFieldName: output + inputPortIdentifier: + outputPortIdentifier: output + groups: [] + stackNodes: [] + pinnedElements: + - position: + serializedVersion: 2 + x: 12 + y: 31 + width: 244 + height: 461 + opened: 1 + editorType: + serializedType: Mixture.MixtureParameterView, Unity.ShaderGraph.GraphicsTests, + Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + exposedParameters: + - id: 3 + serializedParameterList: [] + stickyNotes: [] + nodeInspectorReference: {fileID: 0} + position: {x: 766, y: 137, z: 0} + scale: {x: 0.65751624, y: 0.65751624, z: 1} + version: 1 + type: 1 + realtimePreview: 0 + isRealtime: 0 + isParameterViewOpen: 1 + embedInBuild: 0 + defaultNodeInheritanceMode: -2 + objectReferences: + - {fileID: -1324138349505637682} + variants: [] + _mainOutputTexture: {fileID: -2543242029321980837} + _outputTextures: + - {fileID: -2543242029321980837} + - {fileID: -2543242029321980837} + settings: + widthScale: 1 + heightScale: 1 + depthScale: 1 + width: 256 + height: 256 + depth: 256 + potSize: 256 + sizeMode: 1 + dimension: 2 + outputChannels: 1 + outputPrecision: 3 + editFlags: 128 + doubleBuffered: 0 + wrapMode: 0 + filterMode: 0 + refreshMode: 0 + period: 17 + references: + version: 1 + 00000000: + type: {class: OutputNode, ns: Mixture, asm: Mixture.Runtime} + data: + nodeCustomName: + GUID: 691aa737-9a89-40dd-b56d-201a248e396d + computeOrder: 2 + position: + serializedVersion: 2 + x: -309.47586 + y: -53.75296 + width: 350 + height: 500 + expanded: 0 + debug: 0 + nodeLock: 0 + settings: + widthScale: 1 + heightScale: 1 + depthScale: 1 + width: 512 + height: 512 + depth: 1 + potSize: 512 + sizeMode: -2 + dimension: -2 + outputChannels: -2 + outputPrecision: -2 + editFlags: 471 + doubleBuffered: 0 + wrapMode: -2 + filterMode: -2 + refreshMode: 0 + period: 0 + rtSettings: + widthScale: 1 + heightScale: 1 + depthScale: 1 + width: 0 + height: 0 + depth: 0 + potSize: 0 + sizeMode: 0 + dimension: 0 + outputChannels: 0 + outputPrecision: 0 + editFlags: 0 + doubleBuffered: 0 + wrapMode: 0 + filterMode: 0 + refreshMode: 0 + period: 0 + isPreviewCollapsed: 0 + previewMode: 7 + previewSRGB: 0 + previewMip: 0 + previewVisible: 1 + previewEV100: 0 + previewSlice: 0 + isPinned: 0 + outputTextureSettings: + - inputTexture: {fileID: 0} + name: Main Texture + enableCompression: 1 + compressionFormat: 12 + compressionQuality: 100 + hasMipMaps: 0 + isMain: 1 + enableConversion: 0 + conversionFormat: 0 + sRGB: 0 + finalCopyMaterial: {fileID: -1324138349505637682} + _selectedPreviewIndex: 0 + 00000001: + type: {class: VectorToTexture, ns: Mixture, asm: Mixture.Runtime} + data: + nodeCustomName: + GUID: 27464fde-d534-4fe2-a600-0b3453b9e6ed + computeOrder: 1 + position: + serializedVersion: 2 + x: -559 + y: -50.999996 + width: 250 + height: 80 + expanded: 0 + debug: 0 + nodeLock: 0 + settings: + widthScale: 1 + heightScale: 1 + depthScale: 1 + width: 1024 + height: 1024 + depth: 1 + potSize: 0 + sizeMode: -2 + dimension: -2 + outputChannels: -2 + outputPrecision: -2 + editFlags: -257 + doubleBuffered: 0 + wrapMode: -2 + filterMode: -2 + refreshMode: 0 + period: 0 + rtSettings: + widthScale: 1 + heightScale: 1 + depthScale: 1 + width: 0 + height: 0 + depth: 0 + potSize: 0 + sizeMode: 0 + dimension: 0 + outputChannels: 0 + outputPrecision: 0 + editFlags: 0 + doubleBuffered: 0 + wrapMode: 0 + filterMode: 0 + refreshMode: 0 + period: 0 + isPreviewCollapsed: 0 + previewMode: 15 + previewSRGB: 0 + previewMip: 0 + previewVisible: 1 + previewEV100: 0 + previewSlice: 0 + isPinned: 0 + input: {x: 0, y: 0, z: 0, w: 0} + output: {fileID: 0} + 00000002: + type: {class: ParameterNode, ns: GraphProcessor, asm: com.alelievr.NodeGraphProcessor.Runtime} + data: + nodeCustomName: + GUID: 1da41d33-dfbc-4f22-801e-5ead80ddc742 + computeOrder: 0 + position: + serializedVersion: 2 + x: -632.0001 + y: -11.000023 + width: 73 + height: 37 + expanded: 0 + debug: 0 + nodeLock: 0 + parameterGUID: ae4b8816-5a03-4ced-affd-c1164b71f33f + accessor: 0 + 00000003: + type: {class: Vector4Parameter, ns: GraphProcessor, asm: com.alelievr.NodeGraphProcessor.Runtime} + data: + guid: ae4b8816-5a03-4ced-affd-c1164b71f33f + name: Vector + type: + serializedValue: + serializedType: + serializedName: + serializedValue: + input: 1 + settings: + id: 4 + val: {x: 0, y: 0, z: 0, w: 0} + 00000004: + type: {class: ExposedParameter/Settings, ns: GraphProcessor, asm: com.alelievr.NodeGraphProcessor.Runtime} + data: + isHidden: 0 + expanded: 1 + guid: ae4b8816-5a03-4ced-affd-c1164b71f33f +--- !u!21 &6588020537133174002 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 3 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Hidden/Mixture/PreviewNode + m_Shader: {fileID: 4800000, guid: f53ca163880a74a4cb8940c1893f071f, type: 3} + m_ShaderKeywords: CRT_2D + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _Source_2D: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Source_3D: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Source_Cube: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _ArrowCount: 9 + - _ArrowSize: 1 + - _Gamma: 0 + - _HeightChannel: 0 + - _HeightColorSet: 0 + - _HeightMax: 1 + - _HeightMin: 0 + - _Mode: 0 + - _NormalMode: 0 + - _Tiling: 1 + - _VectorScale: 1 + m_Colors: + - _ColorMax: {r: 1, g: 1, b: 1, a: 1} + - _ColorMin: {r: 0, g: 0, b: 0, a: 0} + - _LightPosition: {r: 0, g: 0, b: 0.2, a: 0} + m_BuildTextureStacks: [] diff --git a/Assets/Examples/Subgraph Tests/Subgraph 4.asset.meta b/Assets/Examples/Subgraph Tests/Subgraph 4.asset.meta new file mode 100644 index 00000000..f6c94921 --- /dev/null +++ b/Assets/Examples/Subgraph Tests/Subgraph 4.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b319517573a4a2649a269da0c8134b75 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: -2543242029321980837 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.alelievr.mixture/Editor/Utils/MixtureDebugWindow.cs b/Packages/com.alelievr.mixture/Editor/Utils/MixtureDebugWindow.cs index 111757f2..77b21e79 100644 --- a/Packages/com.alelievr.mixture/Editor/Utils/MixtureDebugWindow.cs +++ b/Packages/com.alelievr.mixture/Editor/Utils/MixtureDebugWindow.cs @@ -74,9 +74,13 @@ public void OnGUI() EditorGUILayout.LabelField(path); if (GUILayout.Button("Select")) { - var mainAsset = AssetDatabase.LoadAssetAtPath(path); - EditorGUIUtility.PingObject(mainAsset); - Selection.activeObject = mainAsset; + if (graph.isCloned) { + Selection.activeObject = graph; + } else { + var mainAsset = AssetDatabase.LoadAssetAtPath(path); + EditorGUIUtility.PingObject(mainAsset); + Selection.activeObject = mainAsset; + } } } } diff --git a/Packages/com.alelievr.mixture/Editor/Views/MixtureNodeView.cs b/Packages/com.alelievr.mixture/Editor/Views/MixtureNodeView.cs index 458fa806..84f8aa90 100644 --- a/Packages/com.alelievr.mixture/Editor/Views/MixtureNodeView.cs +++ b/Packages/com.alelievr.mixture/Editor/Views/MixtureNodeView.cs @@ -596,8 +596,6 @@ protected Vector2 GetPreviewMousePositionBetween01(Vector2 mousePosition) protected virtual void DrawImGUIPreview(MixtureNode node, Rect previewRect, float currentSlice) { - var outputNode = node as OutputNode; - switch (node.previewTexture.dimension) { case TextureDimension.Tex2D: diff --git a/Packages/com.alelievr.mixture/Editor/Views/SubgraphNodeView.cs b/Packages/com.alelievr.mixture/Editor/Views/SubgraphNodeView.cs new file mode 100644 index 00000000..e07c9d33 --- /dev/null +++ b/Packages/com.alelievr.mixture/Editor/Views/SubgraphNodeView.cs @@ -0,0 +1,136 @@ +using GraphProcessor; +using System.Linq; +using UnityEditor; +using UnityEditor.UIElements; +using UnityEngine; +using UnityEngine.UIElements; + +namespace Mixture +{ + [NodeCustomEditor(typeof(SubgraphNode))] + public class SubgraphNodeView : MixtureNodeView + { + SubgraphNode _node; + + protected override void DrawPreviewToolbar(Texture texture) + { + base.DrawPreviewToolbar(texture); + + var settings = _node.templateGraph.outputNode.outputTextureSettings; + + _node.previewOutputIndex = EditorGUILayout.Popup( + Mathf.Clamp(_node.previewOutputIndex, 0, settings.Count - 1), + settings.Select(setting => setting.name).ToArray(), + EditorStyles.toolbarDropDown, + GUILayout.Width(150) + ); + } + + public override void Enable(bool fromInspector) + { + base.Enable(fromInspector); + + _node = nodeTarget as SubgraphNode; + + var templateGraphTextureField = new ObjectField("Graph") + { + value = _node.templateGraphTexture, + objectType = typeof(CustomRenderTexture) + }; + templateGraphTextureField.RegisterValueChangedCallback(e => + { + _node.templateGraphTexture = e.newValue as CustomRenderTexture; + UpdateSubgraph(); + title = _node.name; + }); + + controlsContainer.Add(templateGraphTextureField); + + UpdateSubgraph(); + } + + public override void Disable() + { + base.Disable(); + } + + void UpdateSubgraph() + { + if (_node.templateGraph != null) + { + _node.templateGraph.onGraphChanges -= UpdateClonedGraph; + _node.templateGraph.onExposedParameterModified -= UpdateInputs; + _node.templateGraph.onExposedParameterListChanged -= UpdateInputs; + _node.templateGraph.outputNode.onPortsUpdated -= UpdateOutputs; + } + + _node.templateGraph = MixtureDatabase.GetGraphFromTexture(_node.templateGraphTexture); + + if (ValidateSubgraph()) + { + _node.templateGraph.onGraphChanges += UpdateClonedGraph; + _node.templateGraph.onExposedParameterModified += UpdateInputs; + _node.templateGraph.onExposedParameterListChanged += UpdateInputs; + _node.templateGraph.outputNode.onPortsUpdated += UpdateOutputs; + + _node.previewOutputIndex = Mathf.Clamp(_node.previewOutputIndex, 0, _node.templateGraph.outputNode.outputTextureSettings.Count - 1); + _node.UpdateClonedGraph(); + _node.UpdateOutputTextures(); + } + else + { + _node.previewOutputIndex = -1; + _node.DestroyClonedGraph(); + _node.ReleaseOutputTextures(); + } + + ForceUpdatePorts(); + NotifyNodeChanged(); + } + + void UpdateClonedGraph(GraphChanges _) => _node.UpdateClonedGraph(); + + void UpdateInputs() + { + _node.UpdateClonedGraph(); + ForceUpdatePorts(); + NotifyNodeChanged(); + } + + void UpdateInputs(ExposedParameter _) => UpdateInputs(); + + void UpdateOutputs() + { + _node.UpdateClonedGraph(); + _node.UpdateOutputTextures(); + ForceUpdatePorts(); + NotifyNodeChanged(); + } + + void UpdateOutputs(string _) => UpdateOutputs(); + + bool ValidateSubgraph() + { + _node.ClearMessages(); + + if (_node.templateGraphTexture == null) + { + return false; + } + + if (_node.templateGraph == null) + { + _node.AddMessage($"Cannot find Mixture graph for texture: {_node.templateGraphTexture.name}", NodeMessageType.Error); + return false; + } + + if (_node.templateGraph == _node.graph) + { + _node.AddMessage($"Cannot execute graph recursively!", NodeMessageType.Error); + return false; + } + + return true; + } + } +} diff --git a/Packages/com.alelievr.mixture/Editor/Views/SubgraphNodeView.cs.meta b/Packages/com.alelievr.mixture/Editor/Views/SubgraphNodeView.cs.meta new file mode 100644 index 00000000..416c9b5b --- /dev/null +++ b/Packages/com.alelievr.mixture/Editor/Views/SubgraphNodeView.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 089cce484dd09d44bb16d9ef8c704de3 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.alelievr.mixture/Runtime/Graph/MixtureConversions.cs b/Packages/com.alelievr.mixture/Runtime/Graph/MixtureConversions.cs index 9533aa7a..d31e5357 100644 --- a/Packages/com.alelievr.mixture/Runtime/Graph/MixtureConversions.cs +++ b/Packages/com.alelievr.mixture/Runtime/Graph/MixtureConversions.cs @@ -52,6 +52,8 @@ public static Vector4 ConvertObjectToVector4(object o) { case float f: return ConvertFloatToVector4(f); case Color c: return ConvertColorToVector4(c); + case Vector2 v: return v; + case Vector3 v: return v; case Vector4 v: return v; default: return default(Vector4); } diff --git a/Packages/com.alelievr.mixture/Runtime/Graph/MixtureGraph.cs b/Packages/com.alelievr.mixture/Runtime/Graph/MixtureGraph.cs index 15ddaade..fe182f13 100644 --- a/Packages/com.alelievr.mixture/Runtime/Graph/MixtureGraph.cs +++ b/Packages/com.alelievr.mixture/Runtime/Graph/MixtureGraph.cs @@ -129,6 +129,9 @@ public string mainAssetPath } } + public MixtureGraph originalGraph { get; private set; } + public bool isCloned => originalGraph != null; + public event Action onOutputTextureUpdated; public event Action afterCommandBufferExecuted; @@ -181,6 +184,19 @@ void Enabled() #endif } + protected override void OnDisable() + { + if (isCloned) { + _outputTextures.ForEach(CoreUtils.Destroy); + + foreach (var setting in outputNode.outputTextureSettings) { + CoreUtils.Destroy(setting.finalCopyMaterial); + } + } + + base.OnDisable(); + } + void MigrateGraph() { #pragma warning disable CS0618 @@ -1017,5 +1033,29 @@ public override void OnAssetDeleted() } } } + + /// + /// The cloned graph doesn't share ExposedParameter, Texture or Material references with the original graph. + /// This ensures the cloned graph process doesn't affect the original graph. + /// + public MixtureGraph Clone() { + var subgraph = Instantiate(this); + subgraph.originalGraph = this; + subgraph.exposedParameters = exposedParameters.Select(p => p.Clone()).ToList(); + subgraph._outputTextures = outputTextures.Select(texture => { + var clonedTexture = Instantiate(texture); + // Cloned texture has "(clone)" suffix attached to its name. + // Preserve the original name because the texture is looked up by name. + clonedTexture.name = texture.name; + return clonedTexture; + }).ToList(); + subgraph._mainOutputTexture = subgraph._outputTextures[outputTextures.IndexOf(mainOutputTexture)]; + + foreach (var setting in subgraph.outputNode.outputTextureSettings) { + setting.finalCopyMaterial = Instantiate(setting.finalCopyMaterial); + } + + return subgraph; + } } -} \ No newline at end of file +} diff --git a/Packages/com.alelievr.mixture/Runtime/Nodes/ComplexSystems/CellularAutomata/CA1D/HistoryStackCA1DNode.cs b/Packages/com.alelievr.mixture/Runtime/Nodes/ComplexSystems/CellularAutomata/CA1D/HistoryStackCA1DNode.cs index e6f2643a..6925fd3c 100644 --- a/Packages/com.alelievr.mixture/Runtime/Nodes/ComplexSystems/CellularAutomata/CA1D/HistoryStackCA1DNode.cs +++ b/Packages/com.alelievr.mixture/Runtime/Nodes/ComplexSystems/CellularAutomata/CA1D/HistoryStackCA1DNode.cs @@ -34,7 +34,7 @@ public enum TimeMode [Input("Initial State")] public Texture input; [Input("Rules")] public ComputeBuffer rules; [Input("State Count")] public int stateCount; - [Output] public CustomRenderTexture output; + [Output, NonSerialized] public CustomRenderTexture output; public TimeMode timeMode; public RuleEvaluationMethod evaluationMethod; diff --git a/Packages/com.alelievr.mixture/Runtime/Nodes/ComplexSystems/CellularAutomata/CA1D/InitialConditionsCA1DNode.cs b/Packages/com.alelievr.mixture/Runtime/Nodes/ComplexSystems/CellularAutomata/CA1D/InitialConditionsCA1DNode.cs index 6a9e3f76..c158f0f5 100644 --- a/Packages/com.alelievr.mixture/Runtime/Nodes/ComplexSystems/CellularAutomata/CA1D/InitialConditionsCA1DNode.cs +++ b/Packages/com.alelievr.mixture/Runtime/Nodes/ComplexSystems/CellularAutomata/CA1D/InitialConditionsCA1DNode.cs @@ -24,7 +24,7 @@ public enum Mode public Mode mode; public int seed; - [Output] public CustomRenderTexture output; + [Output, NonSerialized] public CustomRenderTexture output; public override string name => "Initial Conditions CA1D"; public override bool showDefaultInspector => true; diff --git a/Packages/com.alelievr.mixture/Runtime/Nodes/MixtureNode.cs b/Packages/com.alelievr.mixture/Runtime/Nodes/MixtureNode.cs index e1d29301..9656d2bf 100644 --- a/Packages/com.alelievr.mixture/Runtime/Nodes/MixtureNode.cs +++ b/Packages/com.alelievr.mixture/Runtime/Nodes/MixtureNode.cs @@ -478,11 +478,15 @@ protected void AssignMaterialPropertiesFromEdges(List< SerializableEdge > edges, case ShaderPropertyType.Texture: // TODO: texture scale and offset // Check texture dim before assigning: - if (edge.passThroughBuffer is Texture t && t != null) + if (edge.passThroughBuffer is Texture t) { - if (material.shader.GetPropertyTextureDimension(propertyIndex) == t.dimension) - material.SetTexture(propName, (Texture)edge.passThroughBuffer); + if (t == null || t.dimension == material.shader.GetPropertyTextureDimension(propertyIndex)) + material.SetTexture(propName, t); } + else if (edge.passThroughBuffer == null) + { + material.SetTexture(propName, null); + } break; case ShaderPropertyType.Float: case ShaderPropertyType.Range: diff --git a/Packages/com.alelievr.mixture/Runtime/Nodes/Operators/Distance.cs b/Packages/com.alelievr.mixture/Runtime/Nodes/Operators/Distance.cs index df01a1e2..96eebd68 100644 --- a/Packages/com.alelievr.mixture/Runtime/Nodes/Operators/Distance.cs +++ b/Packages/com.alelievr.mixture/Runtime/Nodes/Operators/Distance.cs @@ -1,8 +1,7 @@ -using System.Collections; +using System; using System.Collections.Generic; using UnityEngine; using GraphProcessor; -using System.Linq; using UnityEngine.Rendering; namespace Mixture @@ -45,7 +44,7 @@ public enum ThresholdMode [Input] public Texture input; - [Output] + [Output, NonSerialized] public CustomRenderTexture output; [Tooltip("Output mode of the distance, by default a blend with the distance is performed")] diff --git a/Packages/com.alelievr.mixture/Runtime/Nodes/Operators/MeshToUDF.cs b/Packages/com.alelievr.mixture/Runtime/Nodes/Operators/MeshToUDF.cs index e3610448..aee59545 100644 --- a/Packages/com.alelievr.mixture/Runtime/Nodes/Operators/MeshToUDF.cs +++ b/Packages/com.alelievr.mixture/Runtime/Nodes/Operators/MeshToUDF.cs @@ -27,7 +27,7 @@ public enum Mode [Input("Input Mesh"), ShowAsDrawer] public MixtureMesh inputMesh = new MixtureMesh(); - [Output("Volume")] + [Output("Volume"), NonSerialized] public CustomRenderTexture outputVolume; [Tooltip("Unsigned distance fields are faster to compute")] diff --git a/Packages/com.alelievr.mixture/Runtime/Nodes/Operators/VectorToTexture.cs b/Packages/com.alelievr.mixture/Runtime/Nodes/Operators/VectorToTexture.cs index e8fe068a..9c2df7d2 100644 --- a/Packages/com.alelievr.mixture/Runtime/Nodes/Operators/VectorToTexture.cs +++ b/Packages/com.alelievr.mixture/Runtime/Nodes/Operators/VectorToTexture.cs @@ -18,14 +18,16 @@ public class VectorToTexture : MixtureNode public override bool showDefaultInspector => true; public override Texture previewTexture => null; + protected override void Enable() + { + output = new RenderTexture(1, 1, 0, GraphicsFormat.R16G16B16A16_SFloat, 0); + } + protected override bool ProcessNode(CommandBuffer cmd) { if (!base.ProcessNode(cmd)) return false; - if (output == null) - output = new RenderTexture(1, 1, 0, GraphicsFormat.R16G16B16A16_SFloat, 0); - cmd.SetRenderTarget(output); cmd.ClearRenderTarget(false, true, (Color)input, 0); @@ -34,7 +36,7 @@ protected override bool ProcessNode(CommandBuffer cmd) protected override void Disable() { - output?.Release(); + CoreUtils.Destroy(output); base.Disable(); } } diff --git a/Packages/com.alelievr.mixture/Runtime/Nodes/ShaderNode.cs b/Packages/com.alelievr.mixture/Runtime/Nodes/ShaderNode.cs index 768edbe3..cb0fbaca 100644 --- a/Packages/com.alelievr.mixture/Runtime/Nodes/ShaderNode.cs +++ b/Packages/com.alelievr.mixture/Runtime/Nodes/ShaderNode.cs @@ -37,13 +37,14 @@ public struct ShaderProperty [Input(name = "In")] public List< object > materialInputs; - [Output(name = "Out"), Tooltip("Output Texture")] + [Output(name = "Out"), Tooltip("Output Texture"), NonSerialized] public CustomRenderTexture output = null; [HideInInspector] public Shader shader; [HideInInspector] public Material material; + bool _materialIsCloned; // We keep internally a list of ports generated from the material exposed properties so when // there is an error in the shader or we can't import it, the connections still remains on the node. @@ -111,6 +112,10 @@ protected override void Disable() { base.Disable(); CoreUtils.Destroy(output); + + if (graph != null && graph.isCloned && _materialIsCloned) { + CoreUtils.Destroy(material); + } } public bool InitializeNodeFromObject(Shader value) @@ -253,6 +258,14 @@ protected override bool ProcessNode(CommandBuffer cmd) if (output == null) return false; + // Cannot place this in `Enable()` because `graph.isCloned` + // is not set to true by the time the graph is instantiated + // (it is set to true after all the enable callbacks are called) + if (graph.isCloned && !_materialIsCloned) { + material = Material.Instantiate(material); + _materialIsCloned = true; + } + var outputDimension = settings.GetResolvedTextureDimension(graph); MixtureUtils.SetupDimensionKeyword(material, outputDimension); diff --git a/Packages/com.alelievr.mixture/Runtime/Nodes/SubgraphNode.cs b/Packages/com.alelievr.mixture/Runtime/Nodes/SubgraphNode.cs new file mode 100644 index 00000000..43d20be7 --- /dev/null +++ b/Packages/com.alelievr.mixture/Runtime/Nodes/SubgraphNode.cs @@ -0,0 +1,236 @@ +using GraphProcessor; +using System.Collections.Generic; +using UnityEngine; +using UnityEngine.Rendering; + +namespace Mixture +{ + [System.Serializable, NodeMenuItem("Subgraph")] + public class SubgraphNode : MixtureNode, ICreateNodeFrom, IRealtimeReset + { + // Placeholders for custom port behaviours + [Input, System.NonSerialized] public int subgraphInputs; + [Output, System.NonSerialized] public int subgraphOutputs; + + public MixtureGraph templateGraph; + public CustomRenderTexture templateGraphTexture; + public int previewOutputIndex = -1; + + List _outputTextures = new List(); + MixtureGraph _clonedGraph; + MixtureGraphProcessor _processor; + + public override string name => templateGraph?.name ?? "Subgraph"; + public override bool isRenamable => true; + public override bool hasPreview => -1 < previewOutputIndex && previewOutputIndex < _outputTextures.Count; + public override bool canEditPreviewSRGB => false; + public override Texture previewTexture => hasPreview ? _outputTextures[previewOutputIndex] : null; + + public bool InitializeNodeFromObject(CustomRenderTexture texture) + { + templateGraph = MixtureDatabase.GetGraphFromTexture(texture); + + if (templateGraph == null) return false; + + templateGraphTexture = texture; + previewOutputIndex = Mathf.Clamp(previewOutputIndex, 0, templateGraph.outputNode.outputTextureSettings.Count - 1); + + return true; + } + + public void RealtimeReset() + { + UpdateClonedGraph(); + + if (_clonedGraph?.type == MixtureGraphType.Realtime) + { + _clonedGraph.RestartRealtime(); + } + } + + [CustomPortBehavior(nameof(subgraphInputs))] + public IEnumerable ListGraphInputs(List edges) + { + if (templateGraph == null || templateGraph == graph) yield break; + + for (var i = 0; i < templateGraph.exposedParameters.Count; i++) + { + var parameter = templateGraph.exposedParameters[i]; + + yield return new PortData + { + identifier = System.Convert.ToString(i), + displayName = parameter.name, + displayType = parameter.GetValueType(), + acceptMultipleEdges = false, + }; + } + } + + [CustomPortBehavior(nameof(subgraphOutputs))] + public IEnumerable ListGraphOutputs(List edges) + { + if (templateGraph == null || templateGraph == graph) yield break; + + var settings = templateGraph.outputNode.outputTextureSettings; + var textureType = GetSubgraphTextureType(); + + for (var i = 0; i < settings.Count; i++) + { + yield return new PortData + { + identifier = System.Convert.ToString(i), + displayName = settings[i].name, + displayType = textureType, + acceptMultipleEdges = true, + }; + } + } + + [CustomPortInput(nameof(subgraphInputs), typeof(object))] + public void AssignGraphInputs(List edges) + { + foreach (var edge in edges) + { + var index = System.Convert.ToInt32(edge.inputPortIdentifier); + var parameter = _clonedGraph.exposedParameters[index]; + + switch (edge.passThroughBuffer) + { + // Manually convert between float, Vector2, Vector3 and Vector4 + case float v: parameter.value = CoerceVectorValue(parameter, new Vector4(v, v, v, v)); break; + case Vector2 v: parameter.value = CoerceVectorValue(parameter, v); break; + case Vector3 v: parameter.value = CoerceVectorValue(parameter, v); break; + case Vector4 v: parameter.value = CoerceVectorValue(parameter, v); break; + default: parameter.value = edge.passThroughBuffer; break; + } + } + } + + [CustomPortOutput(nameof(subgraphOutputs), typeof(object))] + public void AssignGraphOutputs(List edges) + { + foreach (var edge in edges) + { + var index = System.Convert.ToInt32(edge.outputPortIdentifier); + edge.passThroughBuffer = _outputTextures[index]; + } + } + + public void UpdateClonedGraph() + { + DestroyClonedGraph(); + + if (templateGraph != null && templateGraph != graph) + { + _clonedGraph = templateGraph.Clone(); + _processor = new MixtureGraphProcessor(_clonedGraph); + } + } + + public void DestroyClonedGraph() + { + _processor?.Dispose(); + _processor = null; + CoreUtils.Destroy(_clonedGraph); + _clonedGraph = null; + } + + public void UpdateOutputTextures() + { + ReleaseOutputTextures(); + + if (templateGraph != null && templateGraph != graph) GenerateOutputTextures(); + } + + public void GenerateOutputTextures() + { + var settings = templateGraph.outputNode.outputTextureSettings; + + _outputTextures.Capacity = Mathf.Max(_outputTextures.Capacity, settings.Count); + + foreach (var setting in settings) + { + CustomRenderTexture outputTexture = null; + UpdateTempRenderTexture(ref outputTexture); + _outputTextures.Add(outputTexture); + } + } + + public void ReleaseOutputTextures() + { + _outputTextures.ForEach(CoreUtils.Destroy); + _outputTextures.Clear(); + } + + protected override void Enable() + { + base.Enable(); + + UpdateClonedGraph(); + UpdateOutputTextures(); + } + + protected override void Disable() + { + base.Disable(); + + DestroyClonedGraph(); + ReleaseOutputTextures(); + } + + public override bool canProcess => base.canProcess && templateGraph != null && templateGraph != graph; + + protected override bool ProcessNode(CommandBuffer cmd) + { + if (!base.ProcessNode(cmd)) return false; + + // _clonedGraph equals to null when stopping Play Mode + if (_clonedGraph == null) UpdateClonedGraph(); + + _processor.Run(); + + using (var copyCmd = new CommandBuffer { name = $"{graph.name}/{_clonedGraph.name}-{GUID.Substring(0, 6)}/Copy" }) + { + for (int i = 0; i < _outputTextures.Count; i++) + { + var inputTexture = _clonedGraph.outputNode.outputTextureSettings[i].inputTexture; + + if (inputTexture != null) + { + TextureUtils.CopyTexture(copyCmd, inputTexture, _outputTextures[i]); + } + } + + Graphics.ExecuteCommandBuffer(copyCmd); + } + + return true; + } + + System.Type GetSubgraphTextureType() + { + var textureDimension = templateGraph.settings.GetResolvedTextureDimension(templateGraph); + + switch (textureDimension) + { + case UnityEngine.Rendering.TextureDimension.Tex2D: return typeof(Texture2D); + case UnityEngine.Rendering.TextureDimension.Tex3D: return typeof(Texture3D); + case UnityEngine.Rendering.TextureDimension.Cube: return typeof(Cubemap); + default: throw new System.Exception($"Texture dimension not supported: {textureDimension}"); + } + } + + object CoerceVectorValue(ExposedParameter parameter, Vector4 vector) + { + switch (parameter.value) + { + case float _: return vector.x; + case Vector2 _: return (Vector2)vector; + case Vector3 _: return (Vector3)vector; + case Vector4 _: return vector; + default: throw new System.Exception($"Cannot cast vector to {parameter.GetValueType()}"); + } + } + } +} diff --git a/Packages/com.alelievr.mixture/Runtime/Nodes/SubgraphNode.cs.meta b/Packages/com.alelievr.mixture/Runtime/Nodes/SubgraphNode.cs.meta new file mode 100644 index 00000000..5d5b660a --- /dev/null +++ b/Packages/com.alelievr.mixture/Runtime/Nodes/SubgraphNode.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: af92575172ca01046abd9c33bf5d217a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.alelievr.mixture/Runtime/Nodes/TerrainTopology/TerrainFlowMap.cs b/Packages/com.alelievr.mixture/Runtime/Nodes/TerrainTopology/TerrainFlowMap.cs index 292e4889..fceccd8e 100644 --- a/Packages/com.alelievr.mixture/Runtime/Nodes/TerrainTopology/TerrainFlowMap.cs +++ b/Packages/com.alelievr.mixture/Runtime/Nodes/TerrainTopology/TerrainFlowMap.cs @@ -1,8 +1,6 @@ -using System.Runtime.InteropServices; -using System.Xml; +using System; using GraphProcessor; using UnityEngine; -using UnityEngine.Experimental.Rendering; using UnityEngine.Rendering; namespace Mixture @@ -19,7 +17,7 @@ public class TerrainFlowMap : TerrainTopologyNode public override string name => "Terrain Flow Map"; [Input("Iteration")][ShowInInspector(true)] public int iteration = 5; - [Output("Vector Field")]public CustomRenderTexture vectorField; + [Output("Vector Field"), NonSerialized]public CustomRenderTexture vectorField; protected override string KernelName => "FillWaterMap"; public override bool showDefaultInspector => true; public override Texture previewTexture => output; diff --git a/Packages/com.alelievr.mixture/Runtime/Nodes/TerrainTopology/TerrainTopologyNode.cs b/Packages/com.alelievr.mixture/Runtime/Nodes/TerrainTopology/TerrainTopologyNode.cs index 701020c2..10b95cd6 100644 --- a/Packages/com.alelievr.mixture/Runtime/Nodes/TerrainTopology/TerrainTopologyNode.cs +++ b/Packages/com.alelievr.mixture/Runtime/Nodes/TerrainTopology/TerrainTopologyNode.cs @@ -27,7 +27,7 @@ public enum VisualizeMode public virtual bool DoSmoothPass => false; //public float terrainHeight; - [Output("Output")] public CustomRenderTexture output; + [Output("Output"), NonSerialized] public CustomRenderTexture output; [HideInInspector] public Texture2D m_gradient; [HideInInspector] public Texture2D m_posGradient; diff --git a/Packages/com.alelievr.mixture/Runtime/Nodes/Utils/DebugLogNode.cs b/Packages/com.alelievr.mixture/Runtime/Nodes/Utils/DebugLogNode.cs index 2f37efc0..7edd3da3 100644 --- a/Packages/com.alelievr.mixture/Runtime/Nodes/Utils/DebugLogNode.cs +++ b/Packages/com.alelievr.mixture/Runtime/Nodes/Utils/DebugLogNode.cs @@ -1,8 +1,5 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; +using UnityEngine; using GraphProcessor; -using System.Linq; using UnityEngine.Rendering; namespace Mixture @@ -21,8 +18,13 @@ public class DebugLogNode : MixtureNode protected override bool ProcessNode(CommandBuffer cmd) { - Debug.Log(input); + if (input is Object o) { + Debug.Log(input, o); + } else { + Debug.Log(input); + } + return true; } } -} \ No newline at end of file +} diff --git a/Packages/com.alelievr.mixture/Runtime/Nodes/Utils/MeshToMaps.cs b/Packages/com.alelievr.mixture/Runtime/Nodes/Utils/MeshToMaps.cs index 2661fe96..79ea0693 100644 --- a/Packages/com.alelievr.mixture/Runtime/Nodes/Utils/MeshToMaps.cs +++ b/Packages/com.alelievr.mixture/Runtime/Nodes/Utils/MeshToMaps.cs @@ -1,8 +1,7 @@ -using System.Collections; +using System; using System.Collections.Generic; using UnityEngine; using GraphProcessor; -using System.Linq; using UnityEngine.Rendering; namespace Mixture @@ -39,7 +38,7 @@ public enum MapType [ShowInInspector, Tooltip("Enable Conservative rasterization when rendering the mesh. It can help to keep small details in the mesh.")] public bool conservative = false; - [Output] + [Output, NonSerialized] public CustomRenderTexture output; public override string name => "Mesh To Maps"; diff --git a/Packages/com.alelievr.mixture/Runtime/Nodes/Utils/Rasterize3D.cs b/Packages/com.alelievr.mixture/Runtime/Nodes/Utils/Rasterize3D.cs index 551dfaad..0bd97ef7 100644 --- a/Packages/com.alelievr.mixture/Runtime/Nodes/Utils/Rasterize3D.cs +++ b/Packages/com.alelievr.mixture/Runtime/Nodes/Utils/Rasterize3D.cs @@ -1,3 +1,4 @@ +using System; using UnityEngine; using GraphProcessor; using UnityEngine.Rendering; @@ -16,7 +17,7 @@ public class Rasterize3D : ComputeShaderNode [Input("Input Mesh"), ShowAsDrawer] public MixtureMesh inputMesh; - [Output("Volume")] + [Output("Volume"), NonSerialized] public CustomRenderTexture outputVolume; [ShowInInspector, Tooltip("Enable Conservative rasterization when rendering the mesh. It can help to keep small details in the mesh.")] diff --git a/Packages/com.alelievr.mixture/Runtime/Nodes/Utils/RenderMesh.cs b/Packages/com.alelievr.mixture/Runtime/Nodes/Utils/RenderMesh.cs index 1b52eb0e..42371fad 100644 --- a/Packages/com.alelievr.mixture/Runtime/Nodes/Utils/RenderMesh.cs +++ b/Packages/com.alelievr.mixture/Runtime/Nodes/Utils/RenderMesh.cs @@ -1,8 +1,7 @@ -using System.Collections; +using System; using System.Collections.Generic; using UnityEngine; using GraphProcessor; -using System.Linq; using UnityEngine.Rendering; namespace Mixture @@ -34,7 +33,7 @@ public enum MapType [ShowInInspector, Tooltip("In case the mesh has multiple sub-meshes, you can select which one to render with this field")] public int submeshIndex; - [Output] + [Output, NonSerialized] public CustomRenderTexture output; public override string name => "Render Mesh"; diff --git a/Packages/com.alelievr.mixture/Runtime/Nodes/Utils/SelfNode.cs b/Packages/com.alelievr.mixture/Runtime/Nodes/Utils/SelfNode.cs index 68217452..c0e9739f 100644 --- a/Packages/com.alelievr.mixture/Runtime/Nodes/Utils/SelfNode.cs +++ b/Packages/com.alelievr.mixture/Runtime/Nodes/Utils/SelfNode.cs @@ -1,5 +1,3 @@ -using System.Collections; -using System.Collections.Generic; using UnityEngine; using UnityEngine.Rendering; using GraphProcessor; diff --git a/Packages/com.alelievr.mixture/Runtime/Nodes/Utils/Separate.cs b/Packages/com.alelievr.mixture/Runtime/Nodes/Utils/Separate.cs index 0b378406..ab1cbbc5 100644 --- a/Packages/com.alelievr.mixture/Runtime/Nodes/Utils/Separate.cs +++ b/Packages/com.alelievr.mixture/Runtime/Nodes/Utils/Separate.cs @@ -1,3 +1,4 @@ +using System; using UnityEngine; using GraphProcessor; using UnityEngine.Rendering; @@ -23,13 +24,13 @@ public enum Mode [Input] public Texture input; - [Output("R")] + [Output("R"), NonSerialized] public CustomRenderTexture outputR; - [Output("G")] + [Output("G"), NonSerialized] public CustomRenderTexture outputG; - [Output("B")] + [Output("B"), NonSerialized] public CustomRenderTexture outputB; - [Output("A")] + [Output("A"), NonSerialized] public CustomRenderTexture outputA; [Tooltip("Select the output mode for the render texture. The R Channel Only mode uses 4 times less memory.")]