public override void CollectShaderProperties(PropertyCollector properties, GenerationMode generationMode) { if (!generationMode.IsPreview()) { return; } base.CollectShaderProperties(properties, generationMode); GradientUtils.GetGradientPropertiesForPreview(properties, GetVariableNameForNode(), gradient); }
public void CollectShaderProperties(PropertyCollector collector, GenerationMode generationMode) { foreach (var prop in properties) { if (generationMode == GenerationMode.Preview && prop.propertyType == PropertyType.Gradient) { GradientShaderProperty gradientProperty = prop as GradientShaderProperty; GradientUtils.GetGradientPropertiesForPreview(collector, gradientProperty.referenceName, gradientProperty.value); continue; } collector.AddShaderProperty(prop); } }
public override void AddDefaultProperty(PropertyCollector properties, GenerationMode generationMode) { var matOwner = owner as AbstractMaterialNode; if (matOwner == null) { throw new Exception(string.Format("Slot {0} either has no owner, or the owner is not a {1}", this, typeof(AbstractMaterialNode))); } if (generationMode != GenerationMode.Preview) { return; } GradientUtils.GetGradientPropertiesForPreview(properties, matOwner.GetVariableNameForSlot(id), value); }