Ejemplo n.º 1
0
        public override string GenerateShaderForOutput(int outputId, ref MasterNodeDataCollector dataCollector, bool ignoreLocalVar)
        {
            string vertexTangent = string.Empty;

            if (dataCollector.MasterNodeCategory == AvailableShaderTypes.Template)
            {
                vertexTangent = dataCollector.TemplateDataCollectorInstance.GetVertexTangent(WirePortDataType.FLOAT4, CurrentPrecisionType);
                if (m_sizeOption == 0)
                {
                    vertexTangent += ".xyz";
                }

                return(GetOutputVectorItem(0, outputId, vertexTangent));
            }

            if (dataCollector.PortCategory == MasterNodePortCategory.Fragment || dataCollector.PortCategory == MasterNodePortCategory.Debug)
            {
                dataCollector.ForceNormal = true;
                dataCollector.AddToInput(UniqueId, SurfaceInputs.WORLD_NORMAL, CurrentPrecisionType);
                dataCollector.AddToInput(UniqueId, SurfaceInputs.INTERNALDATA, addSemiColon: false);
            }

            WirePortDataType sizeType = m_sizeOption == 0 ? WirePortDataType.FLOAT3 : WirePortDataType.FLOAT4;

            vertexTangent = GeneratorUtils.GenerateVertexTangent(ref dataCollector, UniqueId, CurrentPrecisionType, sizeType);
            return(GetOutputVectorItem(0, outputId, vertexTangent));
        }