浏览代码

run reformat tool

/main
Tim Cooper 7 年前
当前提交
1eba56e9
共有 6 个文件被更改,包括 22 次插入25 次删除
  1. 2
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Graphs/SamplerShaderProperty.cs
  2. 1
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Nodes/Input/Scene/DepthTextureNode.cs
  3. 20
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Nodes/Input/Scene/FogNode.cs
  4. 3
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Nodes/Input/Scene/MotionVectorTextureNode.cs
  5. 3
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Nodes/Input/Scene/NormalsTextureNode.cs
  6. 18
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Nodes/Math/Vector/TransformNode.cs

2
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Graphs/SamplerShaderProperty.cs


public override Vector4 defaultValue
{
get { return new Vector4(value, value, value, value);}
get { return new Vector4(value, value, value, value); }
}
public override string GetPropertyBlockString()

1
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Nodes/Input/Scene/DepthTextureNode.cs


RemoveSlotsNameNotMatching(new[] { UVSlotId, OutputSlotId });
}
public override void CollectPreviewMaterialProperties(List<PreviewProperty> properties)
{
properties.Add(new PreviewProperty()

20
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Nodes/Input/Scene/FogNode.cs


string outputValue = GetSlotValue(OutputSlot1Id, generationMode);
visitor.AddShaderChunk(string.Format("{0} {1} = unity_FogColor;",
ConvertConcreteSlotValueTypeToString(precision, FindOutputSlot<MaterialSlot>(OutputSlotId).concreteValueType),
GetVariableNameForSlot(OutputSlotId)), true);
ConvertConcreteSlotValueTypeToString(precision, FindOutputSlot<MaterialSlot>(OutputSlotId).concreteValueType),
GetVariableNameForSlot(OutputSlotId)), true);
visitor.AddShaderChunk(string.Format("{0} clipZ_01 = UNITY_Z_0_FAR_FROM_CLIPSPACE(UnityObjectToClipPos(IN.ObjectSpacePosition).z);", precision), true);
visitor.AddShaderChunk("#if defined(FOG_LINEAR)", true);

ConvertConcreteSlotValueTypeToString(precision, FindOutputSlot<MaterialSlot>(OutputSlot1Id).concreteValueType),
GetVariableNameForSlot(OutputSlot1Id)), true);
ConvertConcreteSlotValueTypeToString(precision, FindOutputSlot<MaterialSlot>(OutputSlot1Id).concreteValueType),
GetVariableNameForSlot(OutputSlot1Id)), true);
ConvertConcreteSlotValueTypeToString(precision, FindOutputSlot<MaterialSlot>(OutputSlot1Id).concreteValueType),
GetVariableNameForSlot(OutputSlot1Id), precision), true);
ConvertConcreteSlotValueTypeToString(precision, FindOutputSlot<MaterialSlot>(OutputSlot1Id).concreteValueType),
GetVariableNameForSlot(OutputSlot1Id), precision), true);
ConvertConcreteSlotValueTypeToString(precision, FindOutputSlot<MaterialSlot>(OutputSlot1Id).concreteValueType),
GetVariableNameForSlot(OutputSlot1Id), precision), true);
ConvertConcreteSlotValueTypeToString(precision, FindOutputSlot<MaterialSlot>(OutputSlot1Id).concreteValueType),
GetVariableNameForSlot(OutputSlot1Id), precision), true);
ConvertConcreteSlotValueTypeToString(precision, FindOutputSlot<MaterialSlot>(OutputSlot1Id).concreteValueType),
GetVariableNameForSlot(OutputSlot1Id)), true);
ConvertConcreteSlotValueTypeToString(precision, FindOutputSlot<MaterialSlot>(OutputSlot1Id).concreteValueType),
GetVariableNameForSlot(OutputSlot1Id)), true);
visitor.Deindent();
visitor.AddShaderChunk("#endif", true);
}

3
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Nodes/Input/Scene/MotionVectorTextureNode.cs


RemoveSlotsNameNotMatching(new[] { UVSlotId, OutputSlotId });
}
public override void CollectPreviewMaterialProperties(List<PreviewProperty> properties)
{
properties.Add(new PreviewProperty()

string outputValue = GetSlotValue(OutputSlotId, generationMode);
visitor.AddShaderChunk(string.Format("{0}3 _MotionVectorTexture = {0}3(tex2D(_CameraMotionVectorTexture, {1}).rg, 0);", precision, uvValue), true);
if(motionVectorTextureMode == MotionVectorTextureMode.Hue)
if (motionVectorTextureMode == MotionVectorTextureMode.Hue)
{
visitor.AddShaderChunk(string.Format("{0} hue = (atan2(_MotionVectorTexture.x, _MotionVectorTexture.y) / 3.14159265359 + 1.0) * 0.5;", precision), true);
visitor.AddShaderChunk(string.Format("_MotionVectorTexture = saturate({0}3(abs(hue * 6.0 - 3.0) - 1.0, 2.0 - abs(hue * 6.0 - 2.0), 2.0 - abs(hue * 6.0 - 4.0)));", precision), true);

3
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Nodes/Input/Scene/NormalsTextureNode.cs


RemoveSlotsNameNotMatching(new[] { UVSlotId, OutputSlotId });
}
public override void CollectPreviewMaterialProperties(List<PreviewProperty> properties)
{
properties.Add(new PreviewProperty()

outputString.AddShaderChunk(GetFunctionPrototype("Tex", "Out"), false);
outputString.AddShaderChunk("{", false);
outputString.Indent();
outputString.AddShaderChunk(string.Format("{0}3 nn = Tex.xyz * {0}3(2.0 * 1.7777, 2.0 * 1.7777, 0) + {0}3(-1.7777, -1.7777, 1);", precision), true);
outputString.AddShaderChunk(string.Format("{0} g = 2.0 / dot(nn.xyz, nn.xyz);", precision), true);
outputString.AddShaderChunk(string.Format("{0}3 n;", precision), true);

18
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Nodes/Math/Vector/TransformNode.cs


}
}
}
public override bool hasPreview
{
get { return true; }

{
NodeUtils.SlotConfigurationExceptionIfBadConfiguration(this, new[] { InputSlotId }, new[] { OutputSlotId });
string inputValue = GetSlotValue(InputSlotId, generationMode);
string targetTransformString = "tangentTransform_"+ spaceFrom.ToString();
string targetTransformString = "tangentTransform_" + spaceFrom.ToString();
string transformString = "";
bool requiresTangentTransform = false;

else if (spaceTo == CoordinateSpace.Tangent)
{
requiresTangentTransform = true;
transformString = "mul("+ targetTransformString +", " + inputValue + ").xyz";
transformString = "mul(" + targetTransformString + ", " + inputValue + ").xyz";
}
else if (spaceTo == CoordinateSpace.View)
{

else if (spaceTo == CoordinateSpace.Tangent)
{
requiresTangentTransform = true;
transformString = "mul( "+ targetTransformString +", mul( unity_ObjectToWorld, float4(" + inputValue + ", 0) ).xyz).xyz";
transformString = "mul( " + targetTransformString + ", mul( unity_ObjectToWorld, float4(" + inputValue + ", 0) ).xyz).xyz";
}
else if (spaceTo == CoordinateSpace.View)
{

requiresTangentTransform = true;
if (spaceTo == CoordinateSpace.World)
{
transformString = "mul( " + inputValue + ", "+ targetTransformString+ " ).xyz";
transformString = "mul( " + inputValue + ", " + targetTransformString + " ).xyz";
}
else if (spaceTo == CoordinateSpace.Object)
{

}
if (requiresTangentTransform)
visitor.AddShaderChunk("float3x3 " + targetTransformString + " = float3x3("+ spaceFrom.ToString() + "SpaceTangent, "+ spaceFrom.ToString() + "SpaceBiTangent, "+ spaceFrom.ToString() + "SpaceNormal);", true);
visitor.AddShaderChunk("float3x3 " + targetTransformString + " = float3x3(" + spaceFrom.ToString() + "SpaceTangent, " + spaceFrom.ToString() + "SpaceBiTangent, " + spaceFrom.ToString() + "SpaceNormal);", true);
ConvertConcreteSlotValueTypeToString(precision, FindOutputSlot<MaterialSlot>(OutputSlotId).concreteValueType),
GetVariableNameForSlot(OutputSlotId),
transformString), true);
ConvertConcreteSlotValueTypeToString(precision, FindOutputSlot<MaterialSlot>(OutputSlotId).concreteValueType),
GetVariableNameForSlot(OutputSlotId),
transformString), true);
}
public NeededCoordinateSpace RequiresTangent()

正在加载...
取消
保存