public override string Evaluate(OutChannel channel = OutChannel.All) { UpdateCompCount(); if (varDefined) { return(GetVariableName()); } bool useLOD = GetInputIsConnected("MIP") || (SF_Evaluator.inVert || SF_Evaluator.inTess); string uvStr = GetInputIsConnected("UVIN") ? GetInputCon("UVIN").Evaluate() : SF_Evaluator.WithProgramPrefix(SF_Evaluator.inFrag ? "uv0" : "texcoord0"); string func = useLOD ? "tex2Dlod" : "tex2D"; string mip = GetInputIsConnected("MIP") ? GetInputCon("MIP").Evaluate() : "0"; string variableName = this["TEX"].IsConnected() ? GetInputCon("TEX").node.property.GetVariable() : property.GetVariable(); bool useTilingLocally = IsProperty() && !property.tagNoScaleOffset; bool useTilingByAsset = this["TEX"].IsConnected() && !this["TEX"].inputCon.node.property.tagNoScaleOffset; if (useTilingLocally || useTilingByAsset) { uvStr = "TRANSFORM_TEX(" + uvStr + ", " + variableName + ")"; } if (useLOD) { uvStr = "float4(" + uvStr + ",0.0," + mip + ")"; } string s = func + "(" + variableName + "," + uvStr + ")"; if (IsNormalMap()) { s = "UnpackNormal(" + s + ")"; } return(s); }
public override string Evaluate(OutChannel channel = OutChannel.All) { return(SF_Evaluator.WithProgramPrefix("bitangentDir")); }
public override string Evaluate(OutChannel channel = OutChannel.All) { string s = SF_Evaluator.inTess ? "texcoord" + (int)currentUV : currentUV.ToString(); return(SF_Evaluator.WithProgramPrefix(s)); }
public override string Evaluate(OutChannel channel = OutChannel.All) { return(SF_Evaluator.WithProgramPrefix("vertexLocal")); }