浏览代码

Add missing node fixes

/main
Matt Dean 7 年前
当前提交
e11fa9b7
共有 4 个文件被更改,包括 15 次插入4 次删除
  1. 10
      com.unity.shadergraph/Editor/Data/Nodes/Channel/SwizzleNode.cs
  2. 3
      com.unity.shadergraph/Editor/Data/Nodes/Input/Matrix/TransformationMatrixNode.cs
  3. 3
      com.unity.shadergraph/Editor/Data/Nodes/Input/PBR/DielectricSpecularNode.cs
  4. 3
      com.unity.shadergraph/Editor/Data/Nodes/Input/PBR/MetalReflectanceNode.cs

10
com.unity.shadergraph/Editor/Data/Nodes/Channel/SwizzleNode.cs


using System;
using System.Collections.Generic;
using System.Globalization;
using UnityEditor.Graphing;
using UnityEditor.ShaderGraph.Drawing.Controls;
using UnityEngine;

if (inputValueType == ConcreteSlotValueType.Vector1)
visitor.AddShaderChunk(string.Format("{0} {1} = {2};", outputSlotType, outputName, inputValue), false);
else if (generationMode == GenerationMode.ForReals)
visitor.AddShaderChunk(string.Format("{0} {1} = {2}.{3}{4}{5}{6};", outputSlotType, outputName, inputValue, s_ComponentList[m_RedChannel], s_ComponentList[m_GreenChannel], s_ComponentList[m_BlueChannel], s_ComponentList[m_AlphaChannel]), false);
visitor.AddShaderChunk(string.Format("{0} {1} = {2}.{3}{4}{5}{6};",
outputSlotType,
outputName,
inputValue,
s_ComponentList[m_RedChannel].ToString(CultureInfo.InvariantCulture),
s_ComponentList[m_GreenChannel].ToString(CultureInfo.InvariantCulture),
s_ComponentList[m_BlueChannel].ToString(CultureInfo.InvariantCulture),
s_ComponentList[m_AlphaChannel].ToString(CultureInfo.InvariantCulture)), false);
else
visitor.AddShaderChunk(string.Format("{0} {1} = {0}({3}[((int){2} >> 0) & 3], {3}[((int){2} >> 2) & 3], {3}[((int){2} >> 4) & 3], {3}[((int){2} >> 6) & 3]);",
outputSlotType,

3
com.unity.shadergraph/Editor/Data/Nodes/Input/Matrix/TransformationMatrixNode.cs


using UnityEditor.Graphing;
using System.Collections.Generic;
using System.Globalization;
using UnityEditor.ShaderGraph.Drawing.Controls;
using UnityEngine;

public override string GetVariableNameForSlot(int slotId)
{
return m_matrixList[matrix];
return m_matrixList[matrix].ToString(CultureInfo.InvariantCulture);
}
public bool RequiresVertexColor()

3
com.unity.shadergraph/Editor/Data/Nodes/Input/PBR/DielectricSpecularNode.cs


using System;
using System.Collections.Generic;
using System.Globalization;
using UnityEditor.Graphing;
using UnityEditor.ShaderGraph.Drawing.Controls;
using UnityEngine;

sb.AppendLine("{0}3 {1} = pow(_{2}_IOR - 1, 2) / pow(_{2}_IOR + 1, 2);", precision, GetVariableNameForSlot(kOutputSlotId), GetVariableNameForNode());
break;
default:
sb.AppendLine("{0}3 {1} = {0}3{2};", precision, GetVariableNameForSlot(kOutputSlotId), m_MaterialList[material.type]);
sb.AppendLine("{0}3 {1} = {0}3{2};", precision, GetVariableNameForSlot(kOutputSlotId), m_MaterialList[material.type].ToString(CultureInfo.InvariantCulture));
break;
}
visitor.AddShaderChunk(sb.ToString(), false);

3
com.unity.shadergraph/Editor/Data/Nodes/Input/PBR/MetalReflectanceNode.cs


using System.Collections.Generic;
using System.Globalization;
using UnityEngine;
using UnityEditor.Graphing;
using UnityEditor.ShaderGraph.Drawing.Controls;

public void GenerateNodeCode(ShaderGenerator visitor, GenerationMode generationMode)
{
visitor.AddShaderChunk(string.Format("{0}3 {1} = {0}3{2};", precision, GetVariableNameForSlot(kOutputSlotId), m_MaterialList[material]), true);
visitor.AddShaderChunk(string.Format("{0}3 {1} = {0}3{2};", precision, GetVariableNameForSlot(kOutputSlotId), m_MaterialList[material].ToString(CultureInfo.InvariantCulture)), true);
}
}
}
正在加载...
取消
保存