protected override void CommonInit(int uniqueId) { base.CommonInit(uniqueId); AddInputPort(WirePortDataType.SAMPLER2D, false, "Tex", -1, MasterNodePortCategory.Fragment, 2); m_texPort = m_inputPorts[m_inputPorts.Count - 1]; m_texPort.CreatePortRestrictions(WirePortDataType.SAMPLER1D, WirePortDataType.SAMPLER2D, WirePortDataType.SAMPLER3D, WirePortDataType.SAMPLERCUBE, WirePortDataType.SAMPLER2DARRAY, WirePortDataType.OBJECT); AddInputPort(WirePortDataType.FLOAT2, false, "Tiling", -1, MasterNodePortCategory.Fragment, 0); m_tilingPort = m_inputPorts[m_inputPorts.Count - 1]; m_tilingPort.Vector2InternalData = new Vector2(1, 1); AddInputPort(WirePortDataType.FLOAT2, false, "Offset", -1, MasterNodePortCategory.Fragment, 1); m_offsetPort = m_inputPorts[m_inputPorts.Count - 1]; AddOutputVectorPorts(WirePortDataType.FLOAT2, "UV"); m_outputPorts[1].Name = "U"; m_outputPorts[2].Name = "V"; AddOutputPort(WirePortDataType.FLOAT, "W"); AddOutputPort(WirePortDataType.FLOAT, "T"); m_textLabelWidth = 90; m_useInternalPortData = true; m_autoWrapProperties = true; m_tilingPort.Category = MasterNodePortCategory.Vertex; m_offsetPort.Category = MasterNodePortCategory.Vertex; UpdateOutput(); m_previewShaderGUID = "085e462b2de441a42949be0e666cf5d2"; }
protected override void CommonInit(int uniqueId) { base.CommonInit(uniqueId); AddInputPort(WirePortDataType.FLOAT2, false, "UV", -1, MasterNodePortCategory.Fragment, 0); AddInputPort(WirePortDataType.SAMPLER2D, false, "Tex", -1, MasterNodePortCategory.Fragment, 1); AddInputPort(WirePortDataType.SAMPLERSTATE, false, "SS", -1, MasterNodePortCategory.Fragment, 7); AddInputPort(WirePortDataType.FLOAT, false, "Scale", -1, MasterNodePortCategory.Fragment, 2); AddInputPort(WirePortDataType.FLOAT3, false, "ViewDir (tan)", -1, MasterNodePortCategory.Fragment, 3); AddInputPort(WirePortDataType.FLOAT, false, "Ref Plane", -1, MasterNodePortCategory.Fragment, 4); AddInputPort(WirePortDataType.FLOAT2, false, "Curvature", -1, MasterNodePortCategory.Fragment, 5); AddInputPort(WirePortDataType.FLOAT, false, ArrayIndexStr, -1, MasterNodePortCategory.Fragment, 6); AddOutputPort(WirePortDataType.FLOAT2, "Out"); m_uvPort = GetInputPortByUniqueId(0); m_texPort = GetInputPortByUniqueId(1); m_texPort.CreatePortRestrictions(WirePortDataType.SAMPLER2D, WirePortDataType.SAMPLER3D, WirePortDataType.SAMPLER2DARRAY); m_ssPort = GetInputPortByUniqueId(7); m_ssPort.CreatePortRestrictions(WirePortDataType.SAMPLERSTATE); m_scalePort = GetInputPortByUniqueId(2); m_viewdirTanPort = GetInputPortByUniqueId(3); m_refPlanePort = GetInputPortByUniqueId(4); m_pomUVPort = m_outputPorts[0]; m_curvaturePort = GetInputPortByUniqueId(5); m_arrayIndexPort = GetInputPortByUniqueId(6); m_scalePort.FloatInternalData = 0.02f; m_useInternalPortData = false; m_textLabelWidth = 130; m_autoWrapProperties = true; m_curvaturePort.Visible = false; m_arrayIndexPort.Visible = false; UpdateSampler(); }