|
|
|
|
|
|
node.GeneratePropertyUsages(propertyUsages, mode); |
|
|
|
} |
|
|
|
|
|
|
|
int vertInputIndex = 1; |
|
|
|
// Need these for lighting
|
|
|
|
// always add everything because why not.
|
|
|
|
shaderInputVisitor.AddShaderChunk("float4 normal : NORMAL;", true); |
|
|
|
shaderInputVisitor.AddShaderChunk("float2 lightmapUV : TEXCOORD0;", true); |
|
|
|
// always add color because why not.
|
|
|
|
shaderInputVisitor.AddShaderChunk("float4 color : COLOR;", true); |
|
|
|
shaderInputVisitor.AddShaderChunk("half3 normal : NORMAL;", true); |
|
|
|
shaderInputVisitor.AddShaderChunk("half4 texcoord0 : TEXCOORD0;", true); |
|
|
|
shaderInputVisitor.AddShaderChunk("float2 lightmapUV : TEXCOORD1;", true); |
|
|
|
shaderInputVisitor.AddShaderChunk("half4 tangent : TEXCOORD2;", true); |
|
|
|
shaderInputVisitor.AddShaderChunk("half4 color : COLOR;", true); |
|
|
|
|
|
|
|
// Need these for lighting
|
|
|
|
shaderOutputVisitor.AddShaderChunk("float4 posWS : TEXCOORD0;", true); |
|
|
|
|
|
|
var channel = (UVChannel)uvIndex; |
|
|
|
if (activeNodeList.OfType<IMayRequireMeshUV>().Any(x => x.RequiresMeshUV(channel))) |
|
|
|
{ |
|
|
|
shaderInputVisitor.AddShaderChunk(string.Format("half4 texcoord{0} : TEXCOORD{1};", uvIndex, vertInputIndex), true); |
|
|
|
if(uvIndex != 0) |
|
|
|
{ |
|
|
|
shaderInputVisitor.AddShaderChunk(string.Format("half4 texcoord{0} : TEXCOORD{1};", uvIndex, vertInputIndex), true); |
|
|
|
vertInputIndex++; |
|
|
|
} |
|
|
|
vertInputIndex++; |
|
|
|
vertOutputIndex++; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
if (requiresScreenPosition) |
|
|
|
{ |
|
|
|
shaderInputVisitor.AddShaderChunk(string.Format("half4 screenPos : TEXCOORD{0};", vertInputIndex), true); |
|
|
|
vertexShaderBlock.AddShaderChunk("o.screenPos = v.screenPos;", true); |
|
|
|
vertexShaderBlock.AddShaderChunk("o.screenPos = ComputeScreenPos(v.vertex);", true); |
|
|
|
vertInputIndex++; |
|
|
|
shaderInputVisitor.AddShaderChunk(string.Format("half4 tangent : TEXCOORD{0};", vertInputIndex), true); |
|
|
|
vertInputIndex++; |
|
|
|
vertOutputIndex++; |
|
|
|
} |
|
|
|
|
|
|
|