public void GenerateNodeCode(ShaderGenerator visitor, GraphContext graphContext, GenerationMode generationMode) { if (generationMode.IsPreview()) { visitor.AddShaderChunk(string.Format("Gradient {0} = {1};", GetVariableNameForSlot(outputSlotId), GradientUtils.GetGradientForPreview(GetVariableNameForNode()))); } else { visitor.AddShaderChunk(string.Format("Gradient {0} = {1}", GetVariableNameForSlot(outputSlotId), GradientUtils.GetGradientValue(gradient, precision, true, ";"))); } }
public void GenerateNodeCode(ShaderStringBuilder sb, GraphContext graphContext, GenerationMode generationMode) { if (generationMode.IsPreview()) { sb.AppendLine("Gradient {0} = {1};", GetVariableNameForSlot(outputSlotId), GradientUtils.GetGradientForPreview(GetVariableNameForNode())); } else { sb.AppendLine("Gradient {0} = {1}", GetVariableNameForSlot(outputSlotId), GradientUtils.GetGradientValue(gradient, true, ";")); } }
protected override string ConcreteSlotValueAsVariable() { return(GradientUtils.GetGradientValue(value, true, "")); }
protected override string ConcreteSlotValueAsVariable(AbstractMaterialNode.OutputPrecision precision) { return(GradientUtils.GetGradientValue(value, precision, true, "")); }