浏览代码
Merge branch 'hackweek2017' of https://github.com/stramit/MaterialGraph into hackweek2017
/main
Merge branch 'hackweek2017' of https://github.com/stramit/MaterialGraph into hackweek2017
/main
Florent Guinier
8 年前
当前提交
6edcd801
共有 164 个文件被更改,包括 1887 次插入 和 145 次删除
-
128MaterialGraphProject/Assets/GraphFramework/SerializableGraph/Editor/Drawing/AbstractGraphEditWindow.cs
-
2MaterialGraphProject/Assets/GraphFramework/SerializableGraph/Editor/Drawing/AbstractGraphInspector.cs
-
8MaterialGraphProject/Assets/GraphFramework/SerializableGraph/Editor/Drawing/AbstractGraphPresenter.cs
-
2MaterialGraphProject/Assets/GraphFramework/SerializableGraph/Editor/Drawing/GraphEditWindow.cs
-
88MaterialGraphProject/Assets/GraphFramework/SerializableGraph/Editor/Drawing/Presenters/TitleBarPresenter.cs
-
6MaterialGraphProject/Assets/UnityShaderEditor/Editor/AssetCallbacks/CreateShaderGraph.cs
-
2MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/MaterialGraphEditWindow.cs
-
2MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Presenters/MaterialGraphPresenter.cs
-
67MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Graphs/MaterialGraphAsset.cs
-
8MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/Function3Input.cs
-
1MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/PreviewProperty.cs
-
1MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/PropertyType.cs
-
10MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/TimeNode.cs
-
9MaterialGraphProject/Assets/Brandon.meta
-
9MaterialGraphProject/Assets/Matt&Andre.meta
-
9MaterialGraphProject/Assets/Matt.meta
-
1MaterialGraphProject/Assets/New Shader Graph.ShaderGraph
-
9MaterialGraphProject/Assets/New Shader Graph.ShaderGraph.meta
-
9MaterialGraphProject/Assets/TestAssets.meta
-
52MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Presenters/CubemapNodePresenter.cs
-
12MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Presenters/CubemapNodePresenter.cs.meta
-
52MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Presenters/TextureLODNodePresenter.cs
-
12MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Presenters/TextureLODNodePresenter.cs.meta
-
58MaterialGraphProject/Assets/UnityShaderEditor/Editor/HelperShader.shader
-
12MaterialGraphProject/Assets/UnityShaderEditor/Editor/HelperShader.shader.meta
-
9MaterialGraphProject/Assets/UnityShaderEditor/Editor/Importers.meta
-
56MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Util/CubemapPropertyChunk.cs
-
12MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Util/CubemapPropertyChunk.cs.meta
-
9MaterialGraphProject/Assets/Vlad.meta
-
13MaterialGraphProject/Assets/Brandon/ATan2Node.cs
-
12MaterialGraphProject/Assets/Brandon/ATan2Node.cs.meta
-
13MaterialGraphProject/Assets/Brandon/ArcCosNode.cs
-
12MaterialGraphProject/Assets/Brandon/ArcCosNode.cs.meta
-
13MaterialGraphProject/Assets/Brandon/ArcSinNode.cs
-
12MaterialGraphProject/Assets/Brandon/ArcSinNode.cs.meta
-
13MaterialGraphProject/Assets/Brandon/ArcTanNode.cs
-
12MaterialGraphProject/Assets/Brandon/ArcTanNode.cs.meta
-
65MaterialGraphProject/Assets/Brandon/CartesianToPolarNode.cs
-
12MaterialGraphProject/Assets/Brandon/CartesianToPolarNode.cs.meta
-
63MaterialGraphProject/Assets/Brandon/CheckerboardNode.cs
-
12MaterialGraphProject/Assets/Brandon/CheckerboardNode.cs.meta
-
13MaterialGraphProject/Assets/Brandon/CosNode.cs
-
12MaterialGraphProject/Assets/Brandon/CosNode.cs.meta
-
13MaterialGraphProject/Assets/Brandon/CrossNode.cs
-
12MaterialGraphProject/Assets/Brandon/CrossNode.cs.meta
-
13MaterialGraphProject/Assets/Brandon/DegreesToRadiansNode.cs
-
12MaterialGraphProject/Assets/Brandon/DegreesToRadiansNode.cs.meta
-
58MaterialGraphProject/Assets/Brandon/GradientRampNode.cs
-
12MaterialGraphProject/Assets/Brandon/GradientRampNode.cs.meta
-
58MaterialGraphProject/Assets/Brandon/HexNode.cs
-
12MaterialGraphProject/Assets/Brandon/HexNode.cs.meta
-
57MaterialGraphProject/Assets/Brandon/ParticleNode.cs
-
12MaterialGraphProject/Assets/Brandon/ParticleNode.cs.meta
-
13MaterialGraphProject/Assets/Brandon/RadiansToDegreesNode.cs
-
12MaterialGraphProject/Assets/Brandon/RadiansToDegreesNode.cs.meta
-
29MaterialGraphProject/Assets/Brandon/ReciprocalNode.cs
-
12MaterialGraphProject/Assets/Brandon/ReciprocalNode.cs.meta
-
13MaterialGraphProject/Assets/Brandon/SinCosNode.cs
-
12MaterialGraphProject/Assets/Brandon/SinCosNode.cs.meta
-
13MaterialGraphProject/Assets/Brandon/TanNode.cs
-
12MaterialGraphProject/Assets/Brandon/TanNode.cs.meta
-
56MaterialGraphProject/Assets/Brandon/UVTileNode.cs
-
12MaterialGraphProject/Assets/Brandon/UVTileNode.cs.meta
-
183MaterialGraphProject/Assets/Matt&Andre/RemapNode.cs
-
13MaterialGraphProject/Assets/Matt&Andre/CeilNode.cs
-
12MaterialGraphProject/Assets/Matt&Andre/CeilNode.cs.meta
-
14MaterialGraphProject/Assets/Matt&Andre/FloorNode.cs
-
12MaterialGraphProject/Assets/Matt&Andre/FloorNode.cs.meta
-
15MaterialGraphProject/Assets/Matt&Andre/FractionNode.cs
-
12MaterialGraphProject/Assets/Matt&Andre/FractionNode.cs.meta
-
13MaterialGraphProject/Assets/Matt&Andre/RoundNode.cs
-
12MaterialGraphProject/Assets/Matt&Andre/RoundNode.cs.meta
-
13MaterialGraphProject/Assets/Matt&Andre/SignNode.cs
-
12MaterialGraphProject/Assets/Matt&Andre/SignNode.cs.meta
-
12MaterialGraphProject/Assets/Matt&Andre/SquareRootNode.cs.meta
-
15MaterialGraphProject/Assets/Matt&Andre/StepNode.cs
-
12MaterialGraphProject/Assets/Matt&Andre/StepNode.cs.meta
-
15MaterialGraphProject/Assets/Matt&Andre/TruncNode.cs
-
12MaterialGraphProject/Assets/Matt&Andre/TruncNode.cs.meta
-
12MaterialGraphProject/Assets/Matt&Andre/ComponentSplitNode.cs.meta
-
17MaterialGraphProject/Assets/Matt&Andre/FmodNode.cs
-
12MaterialGraphProject/Assets/Matt&Andre/FmodNode.cs.meta
-
14MaterialGraphProject/Assets/Matt&Andre/LogNode.cs
-
12MaterialGraphProject/Assets/Matt&Andre/LogNode.cs.meta
-
17MaterialGraphProject/Assets/Matt&Andre/ExponentialNode.cs
-
12MaterialGraphProject/Assets/Matt&Andre/ExponentialNode.cs.meta
-
45MaterialGraphProject/Assets/Matt&Andre/HSVtoRGBNode.cs
-
12MaterialGraphProject/Assets/Matt&Andre/HSVtoRGBNode.cs.meta
-
45MaterialGraphProject/Assets/Matt&Andre/HueNode.cs
-
12MaterialGraphProject/Assets/Matt&Andre/HueNode.cs.meta
-
29MaterialGraphProject/Assets/Matt&Andre/InverseLerpNode.cs
-
12MaterialGraphProject/Assets/Matt&Andre/InverseLerpNode.cs.meta
-
29MaterialGraphProject/Assets/Matt&Andre/OneMinus.cs
|
|||
fileFormatVersion: 2 |
|||
guid: fa558cffd4da3284094239ece7c77127 |
|||
folderAsset: yes |
|||
timeCreated: 1495479460 |
|||
licenseType: Pro |
|||
DefaultImporter: |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
fileFormatVersion: 2 |
|||
guid: 07096cbe059c94e42b244abc3e875ccf |
|||
folderAsset: yes |
|||
timeCreated: 1495475979 |
|||
licenseType: Pro |
|||
DefaultImporter: |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
fileFormatVersion: 2 |
|||
guid: d44a270dca2589e4bb89c277d87ac0d9 |
|||
folderAsset: yes |
|||
timeCreated: 1495475979 |
|||
licenseType: Pro |
|||
DefaultImporter: |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
{"m_SerializableNodes":[],"m_SerializableEdges":[],"m_ActiveMasterNodeGUIDSerialized":"49382d1d-b29d-4bfa-ab55-3526be874cd8"} |
|
|||
fileFormatVersion: 2 |
|||
guid: 0e5edf7e3bc2bbc47bdb6b74107cc104 |
|||
timeCreated: 1495479560 |
|||
licenseType: Pro |
|||
NativeFormatImporter: |
|||
mainObjectFileID: 0 |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
fileFormatVersion: 2 |
|||
guid: f65c08d6acb9e794699bb04e8db778f3 |
|||
folderAsset: yes |
|||
timeCreated: 1490784346 |
|||
licenseType: Pro |
|||
DefaultImporter: |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
using System; |
|||
using System.Collections.Generic; |
|||
using RMGUI.GraphView; |
|||
using UnityEditor.Graphing.Drawing; |
|||
using UnityEngine; |
|||
using UnityEngine.MaterialGraph; |
|||
|
|||
namespace UnityEditor.MaterialGraph.Drawing |
|||
{ |
|||
class CubeContolPresenter : GraphControlPresenter |
|||
{ |
|||
//private string[] m_TextureTypeNames;
|
|||
//private string[] textureTypeNames
|
|||
/* { |
|||
get |
|||
{ |
|||
if (m_TextureTypeNames == null) |
|||
m_TextureTypeNames = Enum.GetNames(typeof(TextureType)); |
|||
return m_TextureTypeNames; |
|||
} |
|||
}*/ |
|||
|
|||
public override void OnGUIHandler() |
|||
{ |
|||
base.OnGUIHandler(); |
|||
|
|||
var tNode = node as UnityEngine.MaterialGraph.CubemapNode; |
|||
if (tNode == null) |
|||
return; |
|||
|
|||
tNode.exposedState = (PropertyNode.ExposedState)EditorGUILayout.EnumPopup(new GUIContent("Exposed"), tNode.exposedState); |
|||
tNode.defaultCube = EditorGUILayout.MiniThumbnailObjectField(new GUIContent("Cubemap"), tNode.defaultCube, typeof(Cubemap), null) as Cubemap; |
|||
//tNode.textureType = (TextureType)EditorGUILayout.Popup((int)tNode.textureType, textureTypeNames, EditorStyles.popup);
|
|||
} |
|||
|
|||
public override float GetHeight() |
|||
{ |
|||
return 3 * (EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing) + EditorGUIUtility.standardVerticalSpacing; |
|||
} |
|||
} |
|||
|
|||
[Serializable] |
|||
public class CubeNodePresenter : MaterialNodePresenter |
|||
{ |
|||
protected override IEnumerable<GraphElementPresenter> GetControlData() |
|||
{ |
|||
var instance = CreateInstance<CubeContolPresenter>(); |
|||
instance.Initialize(node); |
|||
return new List<GraphElementPresenter> { instance }; |
|||
} |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: fc62d7d14c85243dca60985fa3d87d64 |
|||
timeCreated: 1476707366 |
|||
licenseType: Pro |
|||
MonoImporter: |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
using System; |
|||
using System.Collections.Generic; |
|||
using RMGUI.GraphView; |
|||
using UnityEditor.Graphing.Drawing; |
|||
using UnityEngine; |
|||
using UnityEngine.MaterialGraph; |
|||
|
|||
namespace UnityEditor.MaterialGraph.Drawing |
|||
{ |
|||
class TextureLODContolPresenter : GraphControlPresenter |
|||
{ |
|||
private string[] m_TextureTypeNames; |
|||
private string[] textureTypeNames |
|||
{ |
|||
get |
|||
{ |
|||
if (m_TextureTypeNames == null) |
|||
m_TextureTypeNames = Enum.GetNames(typeof(TextureType)); |
|||
return m_TextureTypeNames; |
|||
} |
|||
} |
|||
|
|||
public override void OnGUIHandler() |
|||
{ |
|||
base.OnGUIHandler(); |
|||
|
|||
var tNode = node as UnityEngine.MaterialGraph.TextureLODNode; |
|||
if (tNode == null) |
|||
return; |
|||
|
|||
tNode.exposedState = (PropertyNode.ExposedState)EditorGUILayout.EnumPopup(new GUIContent("Exposed"), tNode.exposedState); |
|||
tNode.defaultTexture = EditorGUILayout.MiniThumbnailObjectField(new GUIContent("Texture"), tNode.defaultTexture, typeof(Texture2D), null) as Texture2D; |
|||
tNode.textureType = (TextureType)EditorGUILayout.Popup((int)tNode.textureType, textureTypeNames, EditorStyles.popup); |
|||
} |
|||
|
|||
public override float GetHeight() |
|||
{ |
|||
return 3 * (EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing) + EditorGUIUtility.standardVerticalSpacing; |
|||
} |
|||
} |
|||
|
|||
[Serializable] |
|||
public class TextureLODNodePresenter : MaterialNodePresenter |
|||
{ |
|||
protected override IEnumerable<GraphElementPresenter> GetControlData() |
|||
{ |
|||
var instance = CreateInstance<TextureLODContolPresenter>(); |
|||
instance.Initialize(node); |
|||
return new List<GraphElementPresenter> { instance }; |
|||
} |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: b88516d1f6b67f04a829309466d6aa50 |
|||
timeCreated: 1495479478 |
|||
licenseType: Pro |
|||
MonoImporter: |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
Shader "Unlit/NewUnlitShader" |
|||
{ |
|||
Properties |
|||
{ |
|||
_MainTex ("Texture", 2D) = "white" {} |
|||
} |
|||
SubShader |
|||
{ |
|||
Tags { "RenderType"="Opaque" } |
|||
LOD 100 |
|||
|
|||
Pass |
|||
{ |
|||
CGPROGRAM |
|||
#pragma vertex vert |
|||
#pragma fragment frag |
|||
// make fog work |
|||
#pragma multi_compile_fog |
|||
|
|||
#include "UnityCG.cginc" |
|||
|
|||
struct appdata |
|||
{ |
|||
float4 vertex : POSITION; |
|||
float2 uv : TEXCOORD0; |
|||
}; |
|||
|
|||
struct v2f |
|||
{ |
|||
float2 uv : TEXCOORD0; |
|||
UNITY_FOG_COORDS(1) |
|||
float4 vertex : SV_POSITION; |
|||
}; |
|||
|
|||
sampler2D _MainTex; |
|||
float4 _MainTex_ST; |
|||
|
|||
v2f vert (appdata v) |
|||
{ |
|||
v2f o; |
|||
o.vertex = UnityObjectToClipPos(v.vertex); |
|||
o.uv = TRANSFORM_TEX(v.uv, _MainTex); |
|||
UNITY_TRANSFER_FOG(o,o.vertex); |
|||
return o; |
|||
} |
|||
|
|||
fixed4 frag (v2f i) : SV_Target |
|||
{ |
|||
// sample the texture |
|||
fixed4 col = tex2D(_MainTex, i.uv); |
|||
// apply fog |
|||
UNITY_APPLY_FOG(i.fogCoord, col); |
|||
return col; |
|||
} |
|||
ENDCG |
|||
} |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: 9ab5e16c2083a4fe689209a8c1ae425e |
|||
timeCreated: 1495436993 |
|||
licenseType: Pro |
|||
ShaderImporter: |
|||
defaultTextures: [] |
|||
nonModifiableTextures: |
|||
- Texture_2ad4e61d_d44e_4e70_b3d0_540eae630bdf_Uniform: {fileID: 2800000, guid: 76c3d794167d8524481195736f067518, |
|||
type: 3} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
fileFormatVersion: 2 |
|||
guid: a1485bce8acd0428fae1525629b9ed8b |
|||
folderAsset: yes |
|||
timeCreated: 1495357309 |
|||
licenseType: Pro |
|||
DefaultImporter: |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
using System; |
|||
using System.Text; |
|||
|
|||
namespace UnityEngine.MaterialGraph |
|||
{ |
|||
public class CubemapPropertyChunk : PropertyChunk |
|||
{ |
|||
public enum ModifiableState |
|||
{ |
|||
Modifiable, |
|||
NonModifiable |
|||
} |
|||
|
|||
private readonly Cubemap m_DefaultCube; |
|||
private readonly ModifiableState m_Modifiable; |
|||
|
|||
public CubemapPropertyChunk(string propertyName, string propertyDescription, Cubemap defaultTexture, HideState hidden, ModifiableState modifiableState) |
|||
: base(propertyName, propertyDescription, hidden) |
|||
{ |
|||
m_DefaultCube = defaultTexture; |
|||
m_Modifiable = modifiableState; |
|||
} |
|||
|
|||
public override string GetPropertyString() |
|||
{ |
|||
var result = new StringBuilder(); |
|||
if (hideState == HideState.Hidden) |
|||
result.Append("[HideInInspector] "); |
|||
if (m_Modifiable == ModifiableState.NonModifiable) |
|||
result.Append("[NonModifiableTextureData] "); |
|||
|
|||
result.Append(propertyName); |
|||
result.Append("(\""); |
|||
result.Append(propertyDescription); |
|||
result.Append("\", Cube) = \""); |
|||
result.Append(""); |
|||
result.Append("\" {}"); |
|||
return result.ToString(); |
|||
} |
|||
|
|||
public Texture defaultCube |
|||
{ |
|||
get |
|||
{ |
|||
return m_DefaultCube; |
|||
} |
|||
} |
|||
public ModifiableState modifiableState |
|||
{ |
|||
get |
|||
{ |
|||
return m_Modifiable; |
|||
} |
|||
} |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: acd2330628610436abee804f8846e725 |
|||
timeCreated: 1469695793 |
|||
licenseType: Pro |
|||
MonoImporter: |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
fileFormatVersion: 2 |
|||
guid: ea5b5394ff8b04146abae74a39fd167a |
|||
folderAsset: yes |
|||
timeCreated: 1495479460 |
|||
licenseType: Pro |
|||
DefaultImporter: |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
namespace UnityEngine.MaterialGraph |
|||
{ |
|||
[Title("Math/Trigonometry/ArcTan2 Node")] |
|||
public class ATan2Node : Function2Input |
|||
{ |
|||
public ATan2Node() |
|||
{ |
|||
name = "ATan2Node"; |
|||
} |
|||
|
|||
protected override string GetFunctionName() { return "atan2"; } |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: fdd3de2442c50d74da35552bdbe0be74 |
|||
timeCreated: 1495459701 |
|||
licenseType: Pro |
|||
MonoImporter: |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
namespace UnityEngine.MaterialGraph |
|||
{ |
|||
[Title("Math/Trigonometry/ArcCos Node")] |
|||
public class ACosNode : Function1Input |
|||
{ |
|||
public ACosNode() |
|||
{ |
|||
name = "ACosNode"; |
|||
} |
|||
|
|||
protected override string GetFunctionName() { return "acos"; } |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: 455566eec6487b04e92c32110f05073a |
|||
timeCreated: 1495459453 |
|||
licenseType: Pro |
|||
MonoImporter: |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
namespace UnityEngine.MaterialGraph |
|||
{ |
|||
[Title("Math/Trigonometry/ArcSin Node")] |
|||
public class ASinNode : Function1Input |
|||
{ |
|||
public ASinNode() |
|||
{ |
|||
name = "ASinNode"; |
|||
} |
|||
|
|||
protected override string GetFunctionName() { return "asin"; } |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: e0bd4c0099ef82240b5e91e77990628e |
|||
timeCreated: 1495459543 |
|||
licenseType: Pro |
|||
MonoImporter: |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
namespace UnityEngine.MaterialGraph |
|||
{ |
|||
[Title("Math/Trigonometry/ArcTan Node")] |
|||
public class ATanNode : Function1Input |
|||
{ |
|||
public ATanNode() |
|||
{ |
|||
name = "ATanNode"; |
|||
} |
|||
|
|||
protected override string GetFunctionName() { return "atan"; } |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: 9db0fbefda58761488455432f3133271 |
|||
timeCreated: 1495459625 |
|||
licenseType: Pro |
|||
MonoImporter: |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
namespace UnityEngine.MaterialGraph |
|||
{ |
|||
[Title("UV/Cartesian To Polar Node")] |
|||
public class CartesianToPolarNode : Function3Input, IGeneratesFunction |
|||
{ |
|||
public CartesianToPolarNode() |
|||
{ |
|||
name = "CartesianToPolarNode"; |
|||
} |
|||
|
|||
protected override string GetFunctionName() |
|||
{ |
|||
return "unity_cartesiantopolar_" + precision; |
|||
} |
|||
|
|||
protected override string GetInputSlot1Name() |
|||
{ |
|||
return "UV"; |
|||
} |
|||
|
|||
protected override string GetInputSlot2Name() |
|||
{ |
|||
return "HorizontalTileScale"; |
|||
} |
|||
|
|||
protected override string GetInputSlot3Name() |
|||
{ |
|||
return "VerticalTileScale"; |
|||
} |
|||
|
|||
protected override MaterialSlot GetInputSlot1() |
|||
{ |
|||
return new MaterialSlot(InputSlot1Id, GetInputSlot1Name(), kInputSlot1ShaderName, UnityEngine.Graphing.SlotType.Input, SlotValueType.Vector2, Vector2.zero); |
|||
} |
|||
|
|||
protected override MaterialSlot GetInputSlot2() |
|||
{ |
|||
return new MaterialSlot(InputSlot2Id, GetInputSlot2Name(), kInputSlot2ShaderName, UnityEngine.Graphing.SlotType.Input, SlotValueType.Vector1, Vector4.zero); |
|||
} |
|||
|
|||
protected override MaterialSlot GetInputSlot3() |
|||
{ |
|||
return new MaterialSlot(InputSlot3Id, GetInputSlot3Name(), kInputSlot3ShaderName, UnityEngine.Graphing.SlotType.Input, SlotValueType.Vector1, Vector4.zero); |
|||
} |
|||
protected override MaterialSlot GetOutputSlot() |
|||
{ |
|||
return new MaterialSlot(OutputSlotId, GetOutputSlotName(), kOutputSlotShaderName, UnityEngine.Graphing.SlotType.Output, SlotValueType.Vector2, Vector2.zero); |
|||
} |
|||
|
|||
public void GenerateNodeFunction(ShaderGenerator visitor, GenerationMode generationMode) |
|||
{ |
|||
var outputString = new ShaderGenerator(); |
|||
outputString.AddShaderChunk(GetFunctionPrototype("uv", "horizontalTileScale", "verticalTileScale"), false); |
|||
outputString.AddShaderChunk("{", false); |
|||
outputString.Indent(); |
|||
outputString.AddShaderChunk("float radius = length(uv);", false); |
|||
outputString.AddShaderChunk("float angle = atan2(uv.x, uv.y);", false); |
|||
outputString.AddShaderChunk("return float2(radius, angle);", false); |
|||
outputString.Deindent(); |
|||
outputString.AddShaderChunk("}", false); |
|||
|
|||
visitor.AddShaderChunk(outputString.GetShaderString(0), true); |
|||
} |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: 254f958f2febf5e42811f813c866bb2e |
|||
timeCreated: 1495464810 |
|||
licenseType: Pro |
|||
MonoImporter: |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
namespace UnityEngine.MaterialGraph |
|||
{ |
|||
[Title("Procedural/Checkerboard Node")] |
|||
public class CheckerboardNode : Function3Input, IGeneratesFunction |
|||
{ |
|||
public CheckerboardNode() |
|||
{ |
|||
name = "CheckerboardNode"; |
|||
} |
|||
|
|||
protected override string GetFunctionName() |
|||
{ |
|||
return "unity_checkerboard_" + precision; |
|||
} |
|||
|
|||
protected override string GetInputSlot1Name() |
|||
{ |
|||
return "UV"; |
|||
} |
|||
|
|||
protected override string GetInputSlot2Name() |
|||
{ |
|||
return "HorizontalTileScale"; |
|||
} |
|||
|
|||
protected override string GetInputSlot3Name() |
|||
{ |
|||
return "VerticalTileScale"; |
|||
} |
|||
|
|||
protected override MaterialSlot GetInputSlot1() |
|||
{ |
|||
return new MaterialSlot(InputSlot1Id, GetInputSlot1Name(), kInputSlot1ShaderName, UnityEngine.Graphing.SlotType.Input, SlotValueType.Vector2, Vector2.zero); |
|||
} |
|||
|
|||
protected override MaterialSlot GetInputSlot2() |
|||
{ |
|||
return new MaterialSlot(InputSlot2Id, GetInputSlot2Name(), kInputSlot2ShaderName, UnityEngine.Graphing.SlotType.Input, SlotValueType.Vector1, Vector4.zero); |
|||
} |
|||
|
|||
protected override MaterialSlot GetInputSlot3() |
|||
{ |
|||
return new MaterialSlot(InputSlot3Id, GetInputSlot3Name(), kInputSlot3ShaderName, UnityEngine.Graphing.SlotType.Input, SlotValueType.Vector1, Vector4.zero); |
|||
} |
|||
protected override MaterialSlot GetOutputSlot() |
|||
{ |
|||
return new MaterialSlot(OutputSlotId, GetOutputSlotName(), kOutputSlotShaderName, UnityEngine.Graphing.SlotType.Output, SlotValueType.Vector1, Vector2.zero); |
|||
} |
|||
|
|||
public void GenerateNodeFunction(ShaderGenerator visitor, GenerationMode generationMode) |
|||
{ |
|||
var outputString = new ShaderGenerator(); |
|||
outputString.AddShaderChunk(GetFunctionPrototype("uv", "horizontalTileScale", "verticalTileScale"), false); |
|||
outputString.AddShaderChunk("{", false); |
|||
outputString.Indent(); |
|||
outputString.AddShaderChunk("return floor(fmod(floor(uv.x * horizontalTileScale) + floor(uv.y * verticalTileScale), 2.0)) * float4(1.0, 1.0, 1.0, 1.0);", false); |
|||
outputString.Deindent(); |
|||
outputString.AddShaderChunk("}", false); |
|||
|
|||
visitor.AddShaderChunk(outputString.GetShaderString(0), true); |
|||
} |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: 33d3c277f991d6749b4a8ace52c6d7b9 |
|||
timeCreated: 1495448360 |
|||
licenseType: Pro |
|||
MonoImporter: |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
namespace UnityEngine.MaterialGraph |
|||
{ |
|||
[Title("Math/Trigonometry/Cos Node")] |
|||
public class CosNode : Function1Input |
|||
{ |
|||
public CosNode() |
|||
{ |
|||
name = "CosNode"; |
|||
} |
|||
|
|||
protected override string GetFunctionName() { return "cos"; } |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: 27c8eab8410ea16418392d646ec92572 |
|||
timeCreated: 1495446924 |
|||
licenseType: Pro |
|||
MonoImporter: |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
namespace UnityEngine.MaterialGraph |
|||
{ |
|||
[Title("Math/Vector/Cross Node")] |
|||
public class CrossNode : Function2Input |
|||
{ |
|||
public CrossNode() |
|||
{ |
|||
name = "CrossNode"; |
|||
} |
|||
|
|||
protected override string GetFunctionName() { return "cross"; } |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: 6a69c68bb4c22d840b464885246650a3 |
|||
timeCreated: 1495446521 |
|||
licenseType: Pro |
|||
MonoImporter: |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
namespace UnityEngine.MaterialGraph |
|||
{ |
|||
[Title("Math/Trigonometry/Degrees To Radians Node")] |
|||
public class DegreesToRadiansNode : Function1Input |
|||
{ |
|||
public DegreesToRadiansNode() |
|||
{ |
|||
name = "DegreesToRadians"; |
|||
} |
|||
|
|||
protected override string GetFunctionName() { return "radians"; } |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: 30f44257fb54ebf48908aef7ecc9b285 |
|||
timeCreated: 1495459878 |
|||
licenseType: Pro |
|||
MonoImporter: |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
namespace UnityEngine.MaterialGraph |
|||
{ |
|||
[Title("Procedural/Gradient Ramp Node")] |
|||
public class GradientRampNode : Function2Input, IGeneratesFunction |
|||
{ |
|||
public GradientRampNode() |
|||
{ |
|||
name = "GradientRampNode"; |
|||
} |
|||
|
|||
protected override string GetFunctionName() |
|||
{ |
|||
return "unitygGradientramp_" + precision; |
|||
} |
|||
|
|||
protected override string GetInputSlot1Name() |
|||
{ |
|||
return "UV"; |
|||
} |
|||
|
|||
protected override string GetInputSlot2Name() |
|||
{ |
|||
return "Stripe Count"; |
|||
} |
|||
|
|||
protected override MaterialSlot GetInputSlot1() |
|||
{ |
|||
return new MaterialSlot(InputSlot1Id, GetInputSlot1Name(), kInputSlot1ShaderName, UnityEngine.Graphing.SlotType.Input, SlotValueType.Vector2, Vector4.zero); |
|||
} |
|||
|
|||
protected override MaterialSlot GetInputSlot2() |
|||
{ |
|||
return new MaterialSlot(InputSlot2Id, GetInputSlot2Name(), kInputSlot2ShaderName, UnityEngine.Graphing.SlotType.Input, SlotValueType.Vector1, Vector4.zero); |
|||
} |
|||
|
|||
protected override MaterialSlot GetOutputSlot() |
|||
{ |
|||
return new MaterialSlot(OutputSlotId, GetOutputSlotName(), kOutputSlotShaderName, UnityEngine.Graphing.SlotType.Output, SlotValueType.Vector1, Vector2.zero); |
|||
} |
|||
|
|||
public void GenerateNodeFunction(ShaderGenerator visitor, GenerationMode generationMode) |
|||
{ |
|||
var outputString = new ShaderGenerator(); |
|||
outputString.AddShaderChunk(GetFunctionPrototype("uv", "stripeCount"), false); |
|||
outputString.AddShaderChunk("{", false); |
|||
outputString.Indent(); |
|||
|
|||
outputString.AddShaderChunk("float widthOfEachStripe = 1.0 / stripeCount;", false); |
|||
outputString.AddShaderChunk("float t = fmod(floor(uv.x / widthOfEachStripe), stripeCount);", false); |
|||
outputString.AddShaderChunk("return lerp(0.0, 1.0, t / (stripeCount - 1.0));", false); |
|||
|
|||
outputString.Deindent(); |
|||
outputString.AddShaderChunk("}", false); |
|||
|
|||
visitor.AddShaderChunk(outputString.GetShaderString(0), true); |
|||
} |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: b7f3879f9309ee2439c68a734792dc73 |
|||
timeCreated: 1495449448 |
|||
licenseType: Pro |
|||
MonoImporter: |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
namespace UnityEngine.MaterialGraph |
|||
{ |
|||
[Title("Procedural/Hex Node")] |
|||
public class HexNode : Function2Input, IGeneratesFunction |
|||
{ |
|||
public HexNode() |
|||
{ |
|||
name = "HexNode"; |
|||
} |
|||
|
|||
protected override string GetFunctionName() |
|||
{ |
|||
return "unity_hex_" + precision; |
|||
} |
|||
|
|||
protected override string GetInputSlot1Name() |
|||
{ |
|||
return "UV"; |
|||
} |
|||
|
|||
protected override MaterialSlot GetInputSlot1() |
|||
{ |
|||
return new MaterialSlot(InputSlot1Id, GetInputSlot1Name(), kInputSlot1ShaderName, UnityEngine.Graphing.SlotType.Input, SlotValueType.Dynamic, Vector4.zero); |
|||
} |
|||
|
|||
protected override string GetInputSlot2Name() |
|||
{ |
|||
return "Thickness"; |
|||
} |
|||
|
|||
protected override MaterialSlot GetInputSlot2() |
|||
{ |
|||
return new MaterialSlot(InputSlot2Id, GetInputSlot2Name(), kInputSlot2ShaderName, UnityEngine.Graphing.SlotType.Input, SlotValueType.Vector1, Vector4.zero); |
|||
} |
|||
|
|||
protected override MaterialSlot GetOutputSlot() |
|||
{ |
|||
return new MaterialSlot(OutputSlotId, GetOutputSlotName(), kOutputSlotShaderName, UnityEngine.Graphing.SlotType.Output, SlotValueType.Vector1, Vector2.zero); |
|||
} |
|||
|
|||
public void GenerateNodeFunction(ShaderGenerator visitor, GenerationMode generationMode) |
|||
{ |
|||
var outputString = new ShaderGenerator(); |
|||
outputString.AddShaderChunk(GetFunctionPrototype("uv", "thickness"), false); |
|||
outputString.AddShaderChunk("{", false); |
|||
outputString.Indent(); |
|||
|
|||
outputString.AddShaderChunk("uv.y += fmod(floor(uv.x), 2.0) * 0.5;", false); |
|||
outputString.AddShaderChunk("uv = abs(frac(uv) - 0.5);", false); |
|||
outputString.AddShaderChunk("return step(thickness, abs(max(uv.x * 1.5 + uv.y, uv.y * 2.0) - 1.0));", false); |
|||
|
|||
outputString.Deindent(); |
|||
outputString.AddShaderChunk("}", false); |
|||
|
|||
visitor.AddShaderChunk(outputString.GetShaderString(0), true); |
|||
} |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: 98787001c1c5ac14588e5d2eb427aea8 |
|||
timeCreated: 1495456895 |
|||
licenseType: Pro |
|||
MonoImporter: |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
namespace UnityEngine.MaterialGraph |
|||
{ |
|||
[Title("Procedural/Particle Node")] |
|||
public class ParticleNode : Function2Input, IGeneratesFunction |
|||
{ |
|||
public ParticleNode() |
|||
{ |
|||
name = "ParticleNode"; |
|||
} |
|||
|
|||
protected override string GetFunctionName() |
|||
{ |
|||
return "unity_particle_" + precision; |
|||
} |
|||
|
|||
protected override string GetInputSlot1Name() |
|||
{ |
|||
return "UV"; |
|||
} |
|||
|
|||
protected override string GetInputSlot2Name() |
|||
{ |
|||
return "ScaleFactor"; |
|||
} |
|||
|
|||
protected override MaterialSlot GetInputSlot1() |
|||
{ |
|||
return new MaterialSlot(InputSlot1Id, GetInputSlot1Name(), kInputSlot1ShaderName, UnityEngine.Graphing.SlotType.Input, SlotValueType.Vector2, Vector2.zero); |
|||
} |
|||
|
|||
protected override MaterialSlot GetInputSlot2() |
|||
{ |
|||
return new MaterialSlot(InputSlot2Id, GetInputSlot2Name(), kInputSlot2ShaderName, UnityEngine.Graphing.SlotType.Input, SlotValueType.Vector1, Vector2.zero); |
|||
} |
|||
|
|||
protected override MaterialSlot GetOutputSlot() |
|||
{ |
|||
return new MaterialSlot(OutputSlotId, GetOutputSlotName(), kOutputSlotShaderName, UnityEngine.Graphing.SlotType.Output, SlotValueType.Vector1, Vector2.zero); |
|||
} |
|||
|
|||
public void GenerateNodeFunction(ShaderGenerator visitor, GenerationMode generationMode) |
|||
{ |
|||
var outputString = new ShaderGenerator(); |
|||
outputString.AddShaderChunk(GetFunctionPrototype("uv", "scaleFactor"), false); |
|||
outputString.AddShaderChunk("{", false); |
|||
outputString.Indent(); |
|||
|
|||
outputString.AddShaderChunk("uv = uv * 2.0 - 1.0;", false); |
|||
outputString.AddShaderChunk("return abs(1.0/length(uv * scaleFactor));", false); |
|||
|
|||
outputString.Deindent(); |
|||
outputString.AddShaderChunk("}", false); |
|||
|
|||
visitor.AddShaderChunk(outputString.GetShaderString(0), true); |
|||
} |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: 445f6145066270045930268f04f7f296 |
|||
timeCreated: 1495470132 |
|||
licenseType: Pro |
|||
MonoImporter: |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
namespace UnityEngine.MaterialGraph |
|||
{ |
|||
[Title("Math/Trigonometry/Radians To Degrees Node")] |
|||
public class RadiansToDegreesNode : Function1Input |
|||
{ |
|||
public RadiansToDegreesNode() |
|||
{ |
|||
name = "RadiansToDegrees"; |
|||
} |
|||
|
|||
protected override string GetFunctionName() { return "degrees"; } |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: 3673593934a8a544294ca6398a7cc6cb |
|||
timeCreated: 1495460178 |
|||
licenseType: Pro |
|||
MonoImporter: |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
namespace UnityEngine.MaterialGraph |
|||
{ |
|||
[Title("Math/Advanced/Reciprocal Node")] |
|||
public class ReciprocalNode : Function1Input, IGeneratesFunction |
|||
{ |
|||
public ReciprocalNode() |
|||
{ |
|||
name = "ReciprocalNode"; |
|||
} |
|||
|
|||
protected override string GetFunctionName() |
|||
{ |
|||
return "unity_reciprocal_" + precision; |
|||
} |
|||
|
|||
public void GenerateNodeFunction(ShaderGenerator visitor, GenerationMode generationMode) |
|||
{ |
|||
var outputString = new ShaderGenerator(); |
|||
outputString.AddShaderChunk(GetFunctionPrototype("arg1"), false); |
|||
outputString.AddShaderChunk("{", false); |
|||
outputString.Indent(); |
|||
outputString.AddShaderChunk("return 1.0/arg1;", false); |
|||
outputString.Deindent(); |
|||
outputString.AddShaderChunk("}", false); |
|||
|
|||
visitor.AddShaderChunk(outputString.GetShaderString(0), true); |
|||
} |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: 2b52706eb67bd8445b13f43ae287c679 |
|||
timeCreated: 1495445608 |
|||
licenseType: Pro |
|||
MonoImporter: |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
namespace UnityEngine.MaterialGraph |
|||
{ |
|||
[Title("Math/SinCos Node")] |
|||
public class SinCosNode : Function1Input |
|||
{ |
|||
public SinCosNode() |
|||
{ |
|||
name = "SinCosNode"; |
|||
} |
|||
|
|||
protected override string GetFunctionName() { return "cos"; } |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: 61e8adbfbb5cd244fa9bb6dcc900b2bc |
|||
timeCreated: 1495447065 |
|||
licenseType: Pro |
|||
MonoImporter: |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
namespace UnityEngine.MaterialGraph |
|||
{ |
|||
[Title("Math/Trigonometry/Tan Node")] |
|||
public class TanNode : Function1Input |
|||
{ |
|||
public TanNode() |
|||
{ |
|||
name = "TanNode"; |
|||
} |
|||
|
|||
protected override string GetFunctionName() { return "tan"; } |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: 217bab274e1af304daceecaf52863882 |
|||
timeCreated: 1495446976 |
|||
licenseType: Pro |
|||
MonoImporter: |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
namespace UnityEngine.MaterialGraph |
|||
{ |
|||
[Title("UV/Tile Node")] |
|||
public class UVTileNode : Function2Input, IGeneratesFunction |
|||
{ |
|||
public UVTileNode() |
|||
{ |
|||
name = "UVTileNode"; |
|||
} |
|||
|
|||
protected override string GetFunctionName() |
|||
{ |
|||
return "unity_uvtile_" + precision; |
|||
} |
|||
|
|||
protected override string GetInputSlot1Name() |
|||
{ |
|||
return "UV"; |
|||
} |
|||
|
|||
protected override MaterialSlot GetInputSlot1() |
|||
{ |
|||
return new MaterialSlot(InputSlot1Id, GetInputSlot1Name(), kInputSlot1ShaderName, UnityEngine.Graphing.SlotType.Input, SlotValueType.Vector2, Vector2.zero); |
|||
} |
|||
|
|||
protected override string GetInputSlot2Name() |
|||
{ |
|||
return "Tile Factor (X,Y)"; |
|||
} |
|||
|
|||
protected override MaterialSlot GetInputSlot2() |
|||
{ |
|||
return new MaterialSlot(InputSlot2Id, GetInputSlot2Name(), kInputSlot2ShaderName, UnityEngine.Graphing.SlotType.Input, SlotValueType.Vector2, Vector2.zero); |
|||
} |
|||
|
|||
protected override MaterialSlot GetOutputSlot() |
|||
{ |
|||
return new MaterialSlot(OutputSlotId, GetOutputSlotName(), kOutputSlotShaderName, UnityEngine.Graphing.SlotType.Output, SlotValueType.Vector2, Vector2.zero); |
|||
} |
|||
|
|||
public void GenerateNodeFunction(ShaderGenerator visitor, GenerationMode generationMode) |
|||
{ |
|||
var outputString = new ShaderGenerator(); |
|||
outputString.AddShaderChunk(GetFunctionPrototype("uv", "tileFactor"), false); |
|||
outputString.AddShaderChunk("{", false); |
|||
outputString.Indent(); |
|||
|
|||
outputString.AddShaderChunk("return uv * tileFactor;", false); |
|||
|
|||
outputString.Deindent(); |
|||
outputString.AddShaderChunk("}", false); |
|||
|
|||
visitor.AddShaderChunk(outputString.GetShaderString(0), true); |
|||
} |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: 9de1e3a9c41ab2e4d9547aa844abb327 |
|||
timeCreated: 1495462112 |
|||
licenseType: Pro |
|||
MonoImporter: |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
using UnityEngine.Graphing; |
|||
|
|||
namespace UnityEngine.MaterialGraph |
|||
{ |
|||
[Title ("Math/Range/Remap")] |
|||
public class RemapNode : Function2Input, IGeneratesFunction |
|||
{ |
|||
/*protected const string kInputSlot1ShaderName = "Input1"; |
|||
protected const string kInputSlot2ShaderName = "Input2"; |
|||
protected const string kOutputSlotShaderName = "Output"; |
|||
|
|||
public const int InputSlot1Id = 0; |
|||
public const int InputSlot2Id = 1; |
|||
public const int OutputSlotId = 2; |
|||
|
|||
[SerializeField] |
|||
private Vector4 m_Value; |
|||
*/ |
|||
|
|||
public RemapNode () |
|||
{ |
|||
name = "RemapNode"; |
|||
//UpdateNodeAfterDeserialization ();
|
|||
} |
|||
|
|||
protected override string GetFunctionName () |
|||
{ |
|||
return "unity_remap_" + precision; |
|||
} |
|||
|
|||
//need to override the type of slot two somehow///////////////////////////////////////////////////
|
|||
/*override MaterialSlot GetInputSlot2 () |
|||
{ |
|||
return new MaterialSlot (InputSlot2Id, GetInputSlot2Name (), kInputSlot2ShaderName, SlotType.Input, SlotValueType.Vector4, Vector4.zero); |
|||
}*/ |
|||
|
|||
public void GenerateNodeFunction (ShaderGenerator visitor, GenerationMode generationMode) |
|||
{ |
|||
var outputString = new ShaderGenerator (); |
|||
outputString.AddShaderChunk (GetFunctionPrototype ("arg1", "arg2"), false); |
|||
outputString.AddShaderChunk ("{", false); |
|||
outputString.Indent (); |
|||
outputString.AddShaderChunk ("return ((arg1 * (arg2.y - arg2.x)) * (arg2.w - arg2.z))+arg2.z;", false); |
|||
outputString.Deindent (); |
|||
outputString.AddShaderChunk ("}", false); |
|||
|
|||
visitor.AddShaderChunk (outputString.GetShaderString (0), true); |
|||
} |
|||
|
|||
/* |
|||
public sealed override void UpdateNodeAfterDeserialization () |
|||
{ |
|||
AddSlot (GetInputSlot1 ()); |
|||
AddSlot (GetInputSlot2 ()); |
|||
AddSlot (GetOutputSlot ()); |
|||
RemoveSlotsNameNotMatching (validSlots); |
|||
} |
|||
|
|||
protected int[] validSlots { |
|||
get { return new[] { InputSlot1Id, InputSlot2Id, OutputSlotId }; } |
|||
} |
|||
|
|||
protected virtual MaterialSlot GetInputSlot1 () |
|||
{ |
|||
return new MaterialSlot (InputSlot1Id, GetInputSlot1Name (), kInputSlot1ShaderName, SlotType.Input, SlotValueType.Dynamic, Vector4.zero); |
|||
} |
|||
|
|||
protected virtual MaterialSlot GetInputSlot2 () |
|||
{ |
|||
return new MaterialSlot (InputSlot2Id, GetInputSlot2Name (), kInputSlot2ShaderName, SlotType.Input, SlotValueType.Vector4, Vector4.zero); |
|||
} |
|||
|
|||
protected virtual MaterialSlot GetOutputSlot () |
|||
{ |
|||
return new MaterialSlot (OutputSlotId, GetOutputSlotName (), kOutputSlotShaderName, SlotType.Output, SlotValueType.Dynamic, Vector4.zero); |
|||
} |
|||
|
|||
protected virtual string GetInputSlot1Name () |
|||
{ |
|||
return "Input1"; |
|||
} |
|||
|
|||
protected virtual string GetInputSlot2Name () |
|||
{ |
|||
return "RemapVector"; |
|||
} |
|||
|
|||
protected virtual string GetOutputSlotName () |
|||
{ |
|||
return "Output"; |
|||
} |
|||
|
|||
//protected abstract string GetFunctionName ();
|
|||
|
|||
/*protected virtual string GetFunctionPrototype (string arg1Name, string arg2Name) |
|||
{ |
|||
return "inline " + precision + outputDimension + " " + GetFunctionName () + " (" |
|||
+ precision + input1Dimension + " " + arg1Name + ", " |
|||
+ precision + input2Dimension + " " + arg2Name + ")"; |
|||
} |
|||
|
|||
public void GenerateNodeCode (ShaderGenerator visitor, GenerationMode generationMode) |
|||
{ |
|||
NodeUtils.SlotConfigurationExceptionIfBadConfiguration (this, new[] { InputSlot1Id, InputSlot2Id }, new[] { OutputSlotId }); |
|||
string input1Value = GetSlotValue (InputSlot1Id, generationMode); |
|||
string input2Value = GetSlotValue (InputSlot2Id, generationMode); |
|||
visitor.AddShaderChunk (precision + outputDimension + " " + GetVariableNameForSlot (OutputSlotId) + " = " + GetFunctionCallBody (input1Value, input2Value) + ";", true); |
|||
} |
|||
|
|||
protected virtual string GetFunctionCallBody (string input1Value, string input2Value) |
|||
{ |
|||
return GetFunctionName () + " (" + input1Value + ", " + input2Value + ")"; |
|||
}*/ |
|||
|
|||
/*public string outputDimension { |
|||
get { return ConvertConcreteSlotValueTypeToString (FindOutputSlot<MaterialSlot> (OutputSlotId).concreteValueType); } |
|||
} |
|||
|
|||
private string input1Dimension { |
|||
get { return ConvertConcreteSlotValueTypeToString (FindInputSlot<MaterialSlot> (InputSlot1Id).concreteValueType); } |
|||
} |
|||
|
|||
private string input2Dimension { |
|||
get { return ConvertConcreteSlotValueTypeToString (FindInputSlot<MaterialSlot> (InputSlot2Id).concreteValueType); } |
|||
}*/ |
|||
|
|||
/// <summary>
|
|||
/// Gets the type of the property.*/
|
|||
/// </summary>
|
|||
/// <value>The type of the property.</value>
|
|||
|
|||
/*public override PropertyType propertyType { |
|||
get { return PropertyType.Vector4; } |
|||
} |
|||
|
|||
public Vector4 value { |
|||
get { return m_Value; } |
|||
set { |
|||
if (m_Value == value) |
|||
return; |
|||
|
|||
m_Value = value; |
|||
|
|||
if (onModified != null) |
|||
onModified (this, ModificationScope.Node); |
|||
} |
|||
}*/ |
|||
|
|||
/*public override void GeneratePropertyBlock (PropertyGenerator visitor, GenerationMode generationMode) |
|||
{ |
|||
if (exposedState == ExposedState.Exposed) |
|||
visitor.AddShaderProperty (new VectorPropertyChunk (propertyName, description, m_Value, PropertyChunk.HideState.Visible)); |
|||
} |
|||
|
|||
public override void GeneratePropertyUsages (ShaderGenerator visitor, GenerationMode generationMode) |
|||
{ |
|||
if (exposedState == ExposedState.Exposed || generationMode.IsPreview ()) |
|||
visitor.AddShaderChunk (precision + "3 " + propertyName + ";", false); |
|||
}*/ |
|||
|
|||
/*public void GenerateNodeCode (ShaderGenerator visitor, GenerationMode generationMode) |
|||
{ |
|||
if (exposedState == ExposedState.Exposed || generationMode.IsPreview ()) |
|||
return; |
|||
var input1Value = GetSlotValue (InputSlot1Id, generationMode); |
|||
var input2Value = GetSlotValue (InputSlot2Id, generationMode); |
|||
visitor.AddShaderChunk (precision + "4 " + propertyName + " = " + input1Value + " * ((" + input2Value + ".w - " + input2Value + ".z) + " + input2Value + ".z);", false); |
|||
} |
|||
|
|||
public override bool hasPreview { |
|||
get { return true; } |
|||
} |
|||
|
|||
public override PreviewProperty GetPreviewProperty () |
|||
{ |
|||
return new PreviewProperty { |
|||
m_Name = propertyName, |
|||
m_PropType = PropertyType.Vector4, |
|||
m_Vector4 = m_Value |
|||
}; |
|||
}*/ |
|||
} |
|||
} |
|
|||
namespace UnityEngine.MaterialGraph |
|||
{ |
|||
[Title("Math/Round/Ceil")] |
|||
public class CeilNode : Function1Input |
|||
{ |
|||
public CeilNode() |
|||
{ |
|||
name = "Ceil"; |
|||
} |
|||
|
|||
protected override string GetFunctionName() { return "ceil"; } |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: ab2601bf38a580a46945e707fecb7943 |
|||
timeCreated: 1490744931 |
|||
licenseType: Pro |
|||
MonoImporter: |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
namespace UnityEngine.MaterialGraph |
|||
{ |
|||
[Title("Math/Round/Floor")] |
|||
public class FloorNode : Function1Input |
|||
{ |
|||
public FloorNode() |
|||
{ |
|||
name = "Floor"; |
|||
} |
|||
|
|||
protected override string GetFunctionName() { return "floor"; } |
|||
} |
|||
} |
|||
|
|
|||
fileFormatVersion: 2 |
|||
guid: 8d1b4bf99b86c474f8a0bcb2015cf3da |
|||
timeCreated: 1490745697 |
|||
licenseType: Pro |
|||
MonoImporter: |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
namespace UnityEngine.MaterialGraph |
|||
{ |
|||
[Title("Math/Range/Fraction")] |
|||
public class FractionNode : Function1Input |
|||
{ |
|||
public FractionNode() |
|||
{ |
|||
name = "Fraction"; |
|||
} |
|||
|
|||
protected override string GetFunctionName() { return "frac"; } |
|||
} |
|||
} |
|||
|
|||
|
|
|||
fileFormatVersion: 2 |
|||
guid: 4229c656c10cc1c43aa631f8f6357764 |
|||
timeCreated: 1490780593 |
|||
licenseType: Pro |
|||
MonoImporter: |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
namespace UnityEngine.MaterialGraph |
|||
{ |
|||
[Title("Math/Round/Round")] |
|||
public class RoundNode : Function1Input |
|||
{ |
|||
public RoundNode() |
|||
{ |
|||
name = "Round"; |
|||
} |
|||
|
|||
protected override string GetFunctionName() { return "round"; } |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: 03c297b39ff293f4ebc923eb7e60a565 |
|||
timeCreated: 1490745167 |
|||
licenseType: Pro |
|||
MonoImporter: |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
namespace UnityEngine.MaterialGraph |
|||
{ |
|||
[Title("Math/Round/Sign")] |
|||
public class SignNode : Function1Input |
|||
{ |
|||
public SignNode() |
|||
{ |
|||
name = "Sign"; |
|||
} |
|||
|
|||
protected override string GetFunctionName() { return "sign"; } |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: 670ee9966f3a13d4e91477e4fb3ff1dd |
|||
timeCreated: 1490741386 |
|||
licenseType: Pro |
|||
MonoImporter: |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
fileFormatVersion: 2 |
|||
guid: de49bddaf105fe34483c97b6546e54d7 |
|||
timeCreated: 1490740146 |
|||
licenseType: Pro |
|||
MonoImporter: |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
namespace UnityEngine.MaterialGraph |
|||
{ |
|||
[Title("Math/Round/Step")] |
|||
public class StepNode : Function2Input |
|||
{ |
|||
public StepNode() |
|||
{ |
|||
name = "Step"; |
|||
} |
|||
|
|||
protected override string GetFunctionName() { return "step"; } |
|||
} |
|||
} |
|||
|
|||
|
|
|||
fileFormatVersion: 2 |
|||
guid: af47cc48edd11514ba0c965aae166f2f |
|||
timeCreated: 1490780593 |
|||
licenseType: Pro |
|||
MonoImporter: |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
namespace UnityEngine.MaterialGraph |
|||
{ |
|||
[Title("Math/Round/Truncate")] |
|||
public class TruncateNode : Function1Input |
|||
{ |
|||
public TruncateNode() |
|||
{ |
|||
name = "Truncate"; |
|||
} |
|||
|
|||
protected override string GetFunctionName() { return "truncate"; } |
|||
} |
|||
} |
|||
|
|||
|
|
|||
fileFormatVersion: 2 |
|||
guid: b9b4b0e1cbbca934a8bb06144cf84730 |
|||
timeCreated: 1490745905 |
|||
licenseType: Pro |
|||
MonoImporter: |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
fileFormatVersion: 2 |
|||
guid: 892fc353b154d0347854e3bebf1b49e7 |
|||
timeCreated: 1490896965 |
|||
licenseType: Pro |
|||
MonoImporter: |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
namespace UnityEngine.MaterialGraph |
|||
{ |
|||
[Title ("Math/Advanced/Fmod")] |
|||
public class FmodNode : Function2Input |
|||
{ |
|||
public FmodNode () |
|||
{ |
|||
name = "Fmod"; |
|||
} |
|||
|
|||
protected override string GetFunctionName () |
|||
{ |
|||
return "fmod"; |
|||
} |
|||
} |
|||
} |
|||
|
|
|||
fileFormatVersion: 2 |
|||
guid: 058897be65bcd42f6ba05a4918c46629 |
|||
timeCreated: 1490745697 |
|||
licenseType: Pro |
|||
MonoImporter: |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
namespace UnityEngine.MaterialGraph |
|||
{ |
|||
[Title("Math/Advanced/Log")] |
|||
public class LogNode : Function1Input |
|||
{ |
|||
public LogNode() |
|||
{ |
|||
name = "Log"; |
|||
} |
|||
|
|||
protected override string GetFunctionName() { return "log"; } |
|||
} |
|||
} |
|||
|
|
|||
fileFormatVersion: 2 |
|||
guid: a8880ad54646f8b469de662f4f0785c9 |
|||
timeCreated: 1490740341 |
|||
licenseType: Pro |
|||
MonoImporter: |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
namespace UnityEngine.MaterialGraph |
|||
{ |
|||
[Title ("Math/Basic/Exponential")] |
|||
public class ExponentialNode : Function1Input |
|||
{ |
|||
public ExponentialNode () |
|||
{ |
|||
name = "Exponential"; |
|||
} |
|||
|
|||
protected override string GetFunctionName () |
|||
{ |
|||
return "exp"; |
|||
} |
|||
} |
|||
} |
|||
|
|
|||
fileFormatVersion: 2 |
|||
guid: 2caea2ece6d6b4cbebf8bd122b11258a |
|||
timeCreated: 1490745697 |
|||
licenseType: Pro |
|||
MonoImporter: |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
using UnityEngine.Graphing; |
|||
|
|||
namespace UnityEngine.MaterialGraph |
|||
{ |
|||
[Title ("Math/Color/HSVtoRGB")] |
|||
public class HSVtoRGBNode : Function1Input, IGeneratesFunction |
|||
{ |
|||
public HSVtoRGBNode () |
|||
{ |
|||
name = "HSVtoRGB"; |
|||
} |
|||
|
|||
protected override string GetFunctionName () |
|||
{ |
|||
return "unity_hsvtorgb_" + precision; |
|||
} |
|||
|
|||
protected override MaterialSlot GetInputSlot () |
|||
{ |
|||
return new MaterialSlot (InputSlotId, GetInputSlotName (), kInputSlotShaderName, SlotType.Input, SlotValueType.Vector3, Vector4.zero); |
|||
} |
|||
|
|||
protected override MaterialSlot GetOutputSlot () |
|||
{ |
|||
return new MaterialSlot (OutputSlotId, GetOutputSlotName (), kOutputSlotShaderName, SlotType.Output, SlotValueType.Vector3, Vector4.zero); |
|||
} |
|||
|
|||
//TODO:Externalize
|
|||
//Reference code from:https://github.com/Unity-Technologies/PostProcessing/blob/master/PostProcessing/Resources/Shaders/ColorGrading.cginc#L175
|
|||
public void GenerateNodeFunction (ShaderGenerator visitor, GenerationMode generationMode) |
|||
{ |
|||
var outputString = new ShaderGenerator (); |
|||
outputString.AddShaderChunk (GetFunctionPrototype ("arg1"), false); |
|||
outputString.AddShaderChunk ("{", false); |
|||
outputString.Indent (); |
|||
outputString.AddShaderChunk (precision + "4 K = " + precision + "4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);", false); |
|||
outputString.AddShaderChunk (precision + "3 P = abs(frac(arg1.xxx + K.xyz) * 6.0 - K.www);", false); |
|||
outputString.AddShaderChunk ("return arg1.z * lerp(K.xxx, saturate(P - K.xxx), arg1.y);", false); |
|||
outputString.Deindent (); |
|||
outputString.AddShaderChunk ("}", false); |
|||
|
|||
visitor.AddShaderChunk (outputString.GetShaderString (0), true); |
|||
} |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: e3b0a3eacac60414c9f7594fc5286799 |
|||
timeCreated: 1444218016 |
|||
licenseType: Pro |
|||
MonoImporter: |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
using UnityEngine.Graphing; |
|||
|
|||
namespace UnityEngine.MaterialGraph |
|||
{ |
|||
[Title("Math/Color/Hue")] |
|||
public class HueNode : Function1Input, IGeneratesFunction |
|||
{ |
|||
public HueNode() |
|||
{ |
|||
name = "Hue"; |
|||
} |
|||
|
|||
protected override string GetFunctionName() |
|||
{ |
|||
return "unity_hue_" + precision; |
|||
} |
|||
|
|||
protected override MaterialSlot GetInputSlot() |
|||
{ |
|||
return new MaterialSlot(InputSlotId, GetInputSlotName(), kInputSlotShaderName, SlotType.Input, SlotValueType.Vector1, Vector4.zero); |
|||
} |
|||
|
|||
protected override MaterialSlot GetOutputSlot() |
|||
{ |
|||
return new MaterialSlot(OutputSlotId, GetOutputSlotName(), kOutputSlotShaderName, SlotType.Output, SlotValueType.Vector3, Vector4.zero); |
|||
} |
|||
|
|||
//TODO:Externalize
|
|||
//Reference code from:https://github.com/Unity-Technologies/PostProcessing/blob/master/PostProcessing/Resources/Shaders/ColorGrading.cginc#L175
|
|||
public void GenerateNodeFunction(ShaderGenerator visitor, GenerationMode generationMode) |
|||
{ |
|||
var outputString = new ShaderGenerator(); |
|||
outputString.AddShaderChunk(GetFunctionPrototype("arg1"), false); |
|||
outputString.AddShaderChunk("{", false); |
|||
outputString.Indent(); |
|||
outputString.AddShaderChunk(precision + "4 K = " + precision + "4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);", false); |
|||
outputString.AddShaderChunk(precision + "3 P = abs(frac(arg1.xxx + K.xyz) * 6.0 - K.www);", false); |
|||
outputString.AddShaderChunk("return 1 * lerp(K.xxx, saturate(P - K.xxx), 1);", false); |
|||
outputString.Deindent(); |
|||
outputString.AddShaderChunk("}", false); |
|||
|
|||
visitor.AddShaderChunk(outputString.GetShaderString(0), true); |
|||
} |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: 083caf0fe7ff62f438e121e934355461 |
|||
timeCreated: 1490973460 |
|||
licenseType: Pro |
|||
MonoImporter: |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
namespace UnityEngine.MaterialGraph |
|||
{ |
|||
[Title ("Math/Interpolation/InverseLerp")] |
|||
public class InverseLerpNode : Function3Input, IGeneratesFunction |
|||
{ |
|||
public InverseLerpNode () |
|||
{ |
|||
name = "InverseLerp"; |
|||
} |
|||
|
|||
protected override string GetFunctionName () |
|||
{ |
|||
return "unity_inverselerp_" + precision; |
|||
} |
|||
|
|||
public void GenerateNodeFunction (ShaderGenerator visitor, GenerationMode generationMode) |
|||
{ |
|||
var outputString = new ShaderGenerator (); |
|||
outputString.AddShaderChunk (GetFunctionPrototype ("arg1", "arg2", "arg3"), false); |
|||
outputString.AddShaderChunk ("{", false); |
|||
outputString.Indent (); |
|||
outputString.AddShaderChunk ("return (arg3 - arg1)/(arg2 - arg1);", false); |
|||
outputString.Deindent (); |
|||
outputString.AddShaderChunk ("}", false); |
|||
|
|||
visitor.AddShaderChunk (outputString.GetShaderString (0), true); |
|||
} |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: 25857c1c6903f40f382b8857bba28668 |
|||
timeCreated: 1444218016 |
|||
licenseType: Pro |
|||
MonoImporter: |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
namespace UnityEngine.MaterialGraph |
|||
{ |
|||
[Title ("Math/Range/OneMinus")] |
|||
public class OneMinusNode : Function1Input, IGeneratesFunction |
|||
{ |
|||
public OneMinusNode () |
|||
{ |
|||
name = "OneMinus"; |
|||
} |
|||
|
|||
protected override string GetFunctionName () |
|||
{ |
|||
return "unity_oneminus_" + precision; |
|||
} |
|||
|
|||
public void GenerateNodeFunction (ShaderGenerator visitor, GenerationMode generationMode) |
|||
{ |
|||
var outputString = new ShaderGenerator (); |
|||
outputString.AddShaderChunk (GetFunctionPrototype ("arg1"), false); |
|||
outputString.AddShaderChunk ("{", false); |
|||
outputString.Indent (); |
|||
outputString.AddShaderChunk ("return arg1 * -1 + 1;", false); |
|||
outputString.Deindent (); |
|||
outputString.AddShaderChunk ("}", false); |
|||
|
|||
visitor.AddShaderChunk (outputString.GetShaderString (0), true); |
|||
} |
|||
} |
|||
} |
部分文件因为文件数量过多而无法显示
撰写
预览
正在加载...
取消
保存
Reference in new issue