|
|
|
|
|
|
namespace UnityEngine.MaterialGraph |
|
|
|
{ |
|
|
|
[Serializable] |
|
|
|
[Title("Math/Add Node")] |
|
|
|
public abstract class AbstractSurfaceMasterNode : AbstractMasterNode |
|
|
|
{ |
|
|
|
public const string AlbedoSlotName = "Albedo"; |
|
|
|
|
|
|
public const int OcclusionSlotId = 5; |
|
|
|
public const int AlphaSlotId = 6; |
|
|
|
|
|
|
|
[SerializeField] |
|
|
|
private SurfaceMaterialOptions m_MaterialOptions = new SurfaceMaterialOptions(); |
|
|
|
|
|
|
|
public SurfaceMaterialOptions options |
|
|
|
{ |
|
|
|
get { return m_MaterialOptions; } |
|
|
|
} |
|
|
|
|
|
|
|
MaterialOptions options, |
|
|
|
GenerationMode mode, |
|
|
|
out List<PropertyGenerator.TextureInfo> configuredTextures) |
|
|
|
{ |
|
|
|
|
|
|
var zTestVisitor = new ShaderGenerator(); |
|
|
|
var zWriteVisitor = new ShaderGenerator(); |
|
|
|
|
|
|
|
options.GetTags(tagsVisitor); |
|
|
|
options.GetBlend(blendingVisitor); |
|
|
|
options.GetCull(cullingVisitor); |
|
|
|
options.GetDepthTest(zTestVisitor); |
|
|
|
options.GetDepthWrite(zWriteVisitor); |
|
|
|
m_MaterialOptions.GetTags(tagsVisitor); |
|
|
|
m_MaterialOptions.GetBlend(blendingVisitor); |
|
|
|
m_MaterialOptions.GetCull(cullingVisitor); |
|
|
|
m_MaterialOptions.GetDepthTest(zTestVisitor); |
|
|
|
m_MaterialOptions.GetDepthWrite(zWriteVisitor); |
|
|
|
|
|
|
|
var resultShader = templateText.Replace("${ShaderName}", GetType() + guid.ToString()); |
|
|
|
resultShader = resultShader.Replace("${ShaderPropertiesHeader}", shaderPropertiesVisitor.GetShaderString(2)); |
|
|
|