private static HashSet <string> GetActiveFieldsFromMasterNode(AbstractMaterialNode iMasterNode, Pass pass) { HashSet <string> activeFields = new HashSet <string>(); DecalMasterNode masterNode = iMasterNode as DecalMasterNode; if (masterNode == null) { return(activeFields); } if (masterNode.affectsAlbedo.isOn) { activeFields.Add("Material.AffectsAlbedo"); } if (masterNode.affectsNormal.isOn) { activeFields.Add("Material.AffectsNormal"); } if (masterNode.affectsEmission.isOn) { activeFields.Add("Material.AffectsEmission"); } if (masterNode.affectsSmoothness.isOn || masterNode.affectsMetal.isOn || masterNode.affectsAO.isOn) { activeFields.Add("Material.AffectsMaskMap"); } return(activeFields); }
private static HashSet <string> GetActiveFieldsFromMasterNode(INode iMasterNode, Pass pass) { HashSet <string> activeFields = new HashSet <string>(); DecalMasterNode masterNode = iMasterNode as DecalMasterNode; if (masterNode == null) { return(activeFields); } return(activeFields); }
private static bool GenerateShaderPass(DecalMasterNode masterNode, Pass pass, GenerationMode mode, ShaderGenerator result, List <string> sourceAssetDependencyPaths) { if (mode == GenerationMode.ForReals || pass.UseInPreview) { pass.OnGeneratePass(masterNode); // apply master node options to active fields HashSet <string> activeFields = GetActiveFieldsFromMasterNode(masterNode, pass); // use standard shader pass generation bool vertexActive = masterNode.IsSlotConnected(DecalMasterNode.PositionSlotId); return(HDSubShaderUtilities.GenerateShaderPass(masterNode, pass, mode, activeFields, result, sourceAssetDependencyPaths, vertexActive)); } else { return(false); } }