浏览代码

Rename Texture2D and Cubemap nodes

/main
Matt Dean 7 年前
当前提交
0fca7431
共有 3 个文件被更改,包括 12 次插入12 次删除
  1. 8
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Nodes/Input/Texture/CubemapNode.cs
  2. 8
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Nodes/Input/Texture/Texture2DNode.cs
  3. 8
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Manipulators/GraphDropTarget.cs

8
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Nodes/Input/Texture/CubemapNode.cs


namespace UnityEditor.ShaderGraph
{
[Title("Input", "Texture", "Cubemap")]
public class CubemapNode : AbstractMaterialNode, IGeneratesBodyCode, IMayRequireViewDirection, IMayRequireNormal
[Title("Input", "Texture", "Sample Cubemap")]
public class SampleCubemapNode : AbstractMaterialNode, IGeneratesBodyCode, IMayRequireViewDirection, IMayRequireNormal
{
public const int OutputSlotId = 0;
public const int CubemapInputId = 1;

public override bool hasPreview { get { return true; } }
public CubemapNode()
public SampleCubemapNode()
name = "Cubemap";
name = "Sample Cubemap";
UpdateNodeAfterDeserialization();
}

8
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Nodes/Input/Texture/Texture2DNode.cs


Normal
};
[Title("Input", "Texture", "Texture 2D")]
public class Texture2DNode : AbstractMaterialNode, IGeneratesBodyCode, IMayRequireMeshUV
[Title("Input", "Texture", "Sample Texture 2D")]
public class SampleTexture2DNode : AbstractMaterialNode, IGeneratesBodyCode, IMayRequireMeshUV
{
public const int OutputSlotRGBAId = 0;
public const int OutputSlotRId = 4;

public override bool hasPreview { get { return true; } }
public Texture2DNode()
public SampleTexture2DNode()
name = "Texture 2D";
name = "Sample Texture 2D";
UpdateNodeAfterDeserialization();
}

8
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Manipulators/GraphDropTarget.cs


isNormalMap = importer.textureType == TextureImporterType.NormalMap;
}
var node = new Texture2DNode();
var node = new SampleTexture2DNode();
if (isNormalMap)
node.textureType = TextureType.Normal;

m_Graph.AddNode(node);
var inputslot = node.FindSlot<Texture2DInputMaterialSlot>(Texture2DNode.TextureInputId);
var inputslot = node.FindSlot<Texture2DInputMaterialSlot>(SampleTexture2DNode.TextureInputId);
if (inputslot != null)
inputslot.texture = texture2D;
}

m_Graph.owner.RegisterCompleteObjectUndo("Drag Cubemap");
var property = new CubemapShaderProperty { displayName = cubemap.name, value = { cubemap = cubemap } };
m_Graph.AddShaderProperty(property);
var node = new CubemapNode();
var node = new SampleCubemapNode();
var inputslot = node.FindSlot<CubemapInputMaterialSlot>(CubemapNode.CubemapInputId);
var inputslot = node.FindSlot<CubemapInputMaterialSlot>(SampleCubemapNode.CubemapInputId);
if (inputslot != null)
inputslot.cubemap = cubemap;
}

正在加载...
取消
保存