|
|
|
|
|
|
switch (convertFromType) |
|
|
|
{ |
|
|
|
case ConcreteSlotValueType.Vector1: |
|
|
|
return string.Format("({0}{1})", rawOutput, textureSampleUVHack ? ".xx" : string.Empty); |
|
|
|
return string.Format("({0}{1})", rawOutput, ".xx"); |
|
|
|
case ConcreteSlotValueType.Vector3: |
|
|
|
case ConcreteSlotValueType.Vector4: |
|
|
|
return string.Format("({0}.xy)", rawOutput); |
|
|
|
|
|
|
switch (convertFromType) |
|
|
|
{ |
|
|
|
case ConcreteSlotValueType.Vector1: |
|
|
|
return string.Format("({0}{1})", rawOutput, textureSampleUVHack ? ".xxx" : string.Empty); |
|
|
|
return string.Format("({0}{1})", rawOutput, ".xxx"); |
|
|
|
case ConcreteSlotValueType.Vector4: |
|
|
|
return string.Format("({0}.xyz)", rawOutput); |
|
|
|
default: |
|
|
|
|
|
|
switch (convertFromType) |
|
|
|
{ |
|
|
|
case ConcreteSlotValueType.Vector1: |
|
|
|
return string.Format("({0}{1})", rawOutput, textureSampleUVHack ? ".xxxx" : string.Empty); |
|
|
|
return string.Format("({0}{1})", rawOutput, ".xxxx"); |
|
|
|
default: |
|
|
|
return kErrorString; |
|
|
|
} |
|
|
|
|
|
|
if (requiresViewDir || requiresViewDirTangentSpace) |
|
|
|
{ |
|
|
|
shaderBodyVisitor.AddShaderChunk( |
|
|
|
"float3 " |
|
|
|
+ ShaderGeneratorNames.WorldSpaceViewDirection |
|
|
|
+ " = normalize(UnityWorldSpaceViewDir(" |
|
|
|
+ ShaderGeneratorNames.WorldSpacePosition |
|
|
|
"float3 " |
|
|
|
+ ShaderGeneratorNames.WorldSpaceViewDirection |
|
|
|
+ " = normalize(UnityWorldSpaceViewDir(" |
|
|
|
+ ShaderGeneratorNames.WorldSpacePosition |
|
|
|
+ "));", true); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
(activeNode as IGeneratesFunction).GenerateNodeFunction(shaderFunctionVisitor, generationMode); |
|
|
|
if (activeNode is IGeneratesBodyCode) |
|
|
|
(activeNode as IGeneratesBodyCode).GenerateNodeCode(shaderBodyVisitor, generationMode); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
template = template.Replace("${ShaderName}", shaderName); |
|
|
|
template = template.Replace("${ShaderPropertiesHeader}", shaderPropertiesVisitor.GetShaderString(2)); |
|
|
|
template = template.Replace("${ShaderPropertyUsages}", shaderPropertyUsagesVisitor.GetShaderString(3)); |
|
|
|