浏览代码

New sampler2D type for the cases when users require a texture reference, but don't care about using a separate sampler state.

/main
vlad 8 年前
当前提交
953f009f
共有 3 个文件被更改,包括 15 次插入0 次删除
  1. 4
      MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/AbstractMaterialNode.cs
  2. 9
      MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/MaterialSlot.cs
  3. 2
      MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/SlotValue.cs

4
MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/AbstractMaterialNode.cs


return "4x4";
case ConcreteSlotValueType.SamplerState:
return "SamplerState";
case ConcreteSlotValueType.Sampler2D:
return "sampler2D";
default:
return "Error";
}

return PropertyType.Matrix4;
case ConcreteSlotValueType.SamplerState:
return PropertyType.SamplerState;
case ConcreteSlotValueType.Sampler2D:
return PropertyType.Texture;
default:
return PropertyType.Vector4;
}

9
MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/MaterialSlot.cs


return "(3x3)";
case ConcreteSlotValueType.Matrix4:
return "(4x4)";
case ConcreteSlotValueType.SamplerState:
return "(SS)";
case ConcreteSlotValueType.Texture2D:
return "(T)";
case ConcreteSlotValueType.Sampler2D:
return "(S)";
default:
return "(E)";
}

break;
case SlotValueType.SamplerState:
concreteValueType = ConcreteSlotValueType.SamplerState;
break;
case SlotValueType.Sampler2D:
concreteValueType = ConcreteSlotValueType.Sampler2D;
break;
default:
concreteValueType = ConcreteSlotValueType.Vector4;

2
MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/SlotValue.cs


[Serializable]
public enum SlotValueType
{
Sampler2D,
SamplerState,
Matrix4,
Matrix3,

public enum ConcreteSlotValueType
{
Sampler2D = 10,
SamplerState = 9,
Matrix4 = 8,
Matrix3 = 7,

正在加载...
取消
保存