浏览代码

Adding back sub graph support

/main
Tim Cooper 7 年前
当前提交
a494cc0c
共有 10 个文件被更改,包括 119 次插入48 次删除
  1. 2
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Presenters/MaterialGraphPresenter.cs
  2. 1
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Presenters/Nodes/SubgraphNodePresenter.cs
  3. 1
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Testing/IntegrationTests/Graphs/Add-Sub-Graph.ShaderSubGraph
  4. 9
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Testing/IntegrationTests/Graphs/Add-Sub-Graph.ShaderSubGraph.meta
  5. 1
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Testing/IntegrationTests/Graphs/AddSubGraph.ShaderGraph
  6. 11
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Testing/IntegrationTests/Graphs/AddSubGraph.ShaderGraph.meta
  7. 20
      ShaderTemplates/AddSubGraph.ShaderGraph.png
  8. 76
      ShaderTemplates/AddSubGraph.ShaderGraph.shader
  9. 36
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Testing/IntegrationTests/Graphs/graphs_Cracks.mat
  10. 10
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Testing/IntegrationTests/Graphs/graphs_Cracks.mat.meta

2
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Presenters/MaterialGraphPresenter.cs


typeMapper[typeof(SphericalIndentationNode)] = typeof(AnyNodePresenter); // anything derived from AnyNode should use the AnyNodePresenter
typeMapper[typeof(AACheckerboardNode)] = typeof(AnyNodePresenter); // anything derived from AnyNode should use the AnyNodePresenter
typeMapper[typeof(AACheckerboard3dNode)] = typeof(AnyNodePresenter); // anything derived from AnyNode should use the AnyNodePresenter*/
// typeMapper[typeof(SubGraphNode)] = typeof(SubgraphNodePresenter);
typeMapper[typeof(SubGraphNode)] = typeof(SubgraphNodePresenter);
// typeMapper[typeof(RemapMasterNode)] = typeof(RemapMasterNodePresenter);
// typeMapper[typeof(MasterRemapInputNode)] = typeof(RemapInputNodePresenter);
typeMapper[typeof(AbstractSubGraphIONode)] = typeof(SubgraphIONodePresenter);

1
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Presenters/Nodes/SubgraphNodePresenter.cs


using System;
using System.Collections.Generic;
using UnityEditor.Experimental.UIElements.GraphView;
using UnityEngine;
using UnityEngine.MaterialGraph;

1
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Testing/IntegrationTests/Graphs/Add-Sub-Graph.ShaderSubGraph
文件差异内容过多而无法显示
查看文件

9
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Testing/IntegrationTests/Graphs/Add-Sub-Graph.ShaderSubGraph.meta


fileFormatVersion: 2
guid: e8dfdb83d3043c7499b6cd1edd7b8f8d
timeCreated: 1503169600
licenseType: Pro
ScriptedImporter:
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 11500000, guid: 60072b568d64c40a485e0fc55012dc9f, type: 3}

1
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Testing/IntegrationTests/Graphs/AddSubGraph.ShaderGraph
文件差异内容过多而无法显示
查看文件

11
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Testing/IntegrationTests/Graphs/AddSubGraph.ShaderGraph.meta


fileFormatVersion: 2
guid: f20399762b45e564fbe7b65ab460a5b6
timeCreated: 1503218095
licenseType: Pro
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
userData:
assetBundleName:
assetBundleVariant:

20
ShaderTemplates/AddSubGraph.ShaderGraph.png

之前 之后
宽度: 256  |  高度: 256  |  大小: 12 KiB

76
ShaderTemplates/AddSubGraph.ShaderGraph.shader


Shader "AddSubGraph"
{
Properties
{
}
SubShader
{
Tags
{
"RenderType"="Opaque"
"Queue"="Geometry"
}
Blend One Zero
Cull Back
ZTest LEqual
ZWrite On
LOD 200
CGPROGRAM
#pragma target 3.0
#pragma surface surf Standard vertex:vert
#pragma glsl
#pragma debug
void Unity_Add_float(float4 first, float4 second, out float4 result)
{
result = first + second;
}
struct Input
{
float4 color : COLOR;
};
void vert (inout appdata_full v, out Input o)
{
UNITY_INITIALIZE_OUTPUT(Input,o);
}
void surf (Input IN, inout SurfaceOutputStandard o)
{
float4 Color_Color_FD942667_Uniform = float4 (1, 0, 0, 0);
float4 Color_Color_C568FE2A_Uniform = float4 (0.1586208, 1, 0, 0);
// Subgraph for node SubGraph_F6FDDDC0
float4 SubGraph_F6FDDDC0_Output1 = 0;
{
float4 SubGraphInputs_23A80546_Input1 = Color_Color_FD942667_Uniform;
float4 SubGraphInputs_23A80546_Input2 = Color_Color_C568FE2A_Uniform;
float4 Add_B9CA3569_result;
Unity_Add_float(SubGraphInputs_23A80546_Input1, SubGraphInputs_23A80546_Input2, Add_B9CA3569_result);
SubGraph_F6FDDDC0_Output1 = Add_B9CA3569_result;
}
// Subgraph ends
o.Emission = SubGraph_F6FDDDC0_Output1;
}
ENDCG
}
FallBack "Diffuse"
CustomEditor "LegacyIlluminShaderGUI"
}

36
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Testing/IntegrationTests/Graphs/graphs_Cracks.mat


%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: graphs_Cracks
m_Shader: {fileID: 4800000, guid: a8cb0d181b460aa4bac2693ce3bfc1ad, type: 3}
m_ShaderKeywords:
m_LightmapFlags: 0
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- Texture2D_Texture2D_CF0DB0B2_Uniform:
m_Texture: {fileID: 2800000, guid: 7296f51323ae9485a9c834c4e3d722ed, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- Texture2D_Texture2D_D8FD66BB_Uniform:
m_Texture: {fileID: 2800000, guid: cbf8f30fb344d2c48b8c6739b327ac7d, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- Texture2D_Texture2D_DF8FC6BF_Uniform:
m_Texture: {fileID: 2800000, guid: 9d64a9e7ca6864704ae6b8ca7afc9d85, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- Vector1_Vector1_2852A57B_Uniform: 2.75
m_Colors:
- Color_Color_B59542C3_Uniform: {r: 0, g: 0.201217, b: 0.9411765, a: 0}

10
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Testing/IntegrationTests/Graphs/graphs_Cracks.mat.meta


fileFormatVersion: 2
guid: 368cc6243361aa043933e1fc5a83edbf
timeCreated: 1503176184
licenseType: Pro
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:
正在加载...
取消
保存