|
|
|
|
|
|
PBRMasterNode.MetallicSlotId, |
|
|
|
PBRMasterNode.SmoothnessSlotId, |
|
|
|
PBRMasterNode.OcclusionSlotId, |
|
|
|
PBRMasterNode.AlphaSlotId |
|
|
|
PBRMasterNode.AlphaSlotId, |
|
|
|
PBRMasterNode.AlphaThresholdSlotId |
|
|
|
} |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
PBRMasterNode.SpecularSlotId, |
|
|
|
PBRMasterNode.SmoothnessSlotId, |
|
|
|
PBRMasterNode.OcclusionSlotId, |
|
|
|
PBRMasterNode.AlphaSlotId |
|
|
|
PBRMasterNode.AlphaSlotId, |
|
|
|
PBRMasterNode.AlphaThresholdSlotId |
|
|
|
} |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
case PBRMasterNode.AlphaMode.AdditiveBlend: |
|
|
|
defines.AddShaderChunk("#define _AlphaOut 1", true); |
|
|
|
break; |
|
|
|
case PBRMasterNode.AlphaMode.Clip: |
|
|
|
defines.AddShaderChunk("#define _AlphaClip 1", true); |
|
|
|
break; |
|
|
|
if (masterNode.IsSlotConnected(PBRMasterNode.AlphaThresholdSlotId)) |
|
|
|
defines.AddShaderChunk("#define _AlphaClip 1", true); |
|
|
|
|
|
|
|
surfaceOutputRemap.AddShaderChunk(slot.shaderOutputName |
|
|
|
+ " = surf." |
|
|
|
+ slot.shaderOutputName + ";", true); |
|
|
|
surfaceOutputRemap.AddShaderChunk(string.Format("{0} = surf.{0};", slot.shaderOutputName), true); |
|
|
|
} |
|
|
|
|
|
|
|
if (!File.Exists(templateLocation)) |
|
|
|
|
|
|
var materialOptions = new SurfaceMaterialOptions(); |
|
|
|
switch (masterNode.alphaMode) |
|
|
|
{ |
|
|
|
case PBRMasterNode.AlphaMode.Overwrite: |
|
|
|
case PBRMasterNode.AlphaMode.Clip: |
|
|
|
case PBRMasterNode.AlphaMode.Opaque: |
|
|
|
materialOptions.srcBlend = SurfaceMaterialOptions.BlendMode.One; |
|
|
|
materialOptions.dstBlend = SurfaceMaterialOptions.BlendMode.Zero; |
|
|
|
materialOptions.cullMode = SurfaceMaterialOptions.CullMode.Back; |
|
|
|