|
|
|
|
|
|
[SerializeField] |
|
|
|
private float m_DefaultValue; |
|
|
|
|
|
|
|
public Vector1MaterialSlot() |
|
|
|
{ |
|
|
|
} |
|
|
|
|
|
|
|
public Vector1MaterialSlot( |
|
|
|
int slotId, |
|
|
|
string displayName, |
|
|
|
|
|
|
|
|
|
|
[SerializeField] |
|
|
|
private Vector2 m_DefaultValue; |
|
|
|
|
|
|
|
public Vector2MaterialSlot() |
|
|
|
{ |
|
|
|
} |
|
|
|
|
|
|
|
public Vector2MaterialSlot( |
|
|
|
int slotId, |
|
|
|
|
|
|
|
|
|
|
[SerializeField] |
|
|
|
private Vector3 m_DefaultValue; |
|
|
|
|
|
|
|
public Vector3MaterialSlot() |
|
|
|
{ |
|
|
|
} |
|
|
|
|
|
|
|
public Vector3MaterialSlot( |
|
|
|
int slotId, |
|
|
|
|
|
|
|
|
|
|
[SerializeField] |
|
|
|
private Vector4 m_DefaultValue; |
|
|
|
|
|
|
|
public Vector4MaterialSlot() |
|
|
|
{ |
|
|
|
} |
|
|
|
|
|
|
|
public Vector4MaterialSlot( |
|
|
|
int slotId, |
|
|
|
|
|
|
[Serializable] |
|
|
|
public class Matrix2MaterialSlot : MaterialSlot |
|
|
|
{ |
|
|
|
|
|
|
|
public Matrix2MaterialSlot() |
|
|
|
{ |
|
|
|
} |
|
|
|
|
|
|
|
public Matrix2MaterialSlot( |
|
|
|
int slotId, |
|
|
|
string displayName, |
|
|
|
|
|
|
[Serializable] |
|
|
|
public class Matrix3MaterialSlot : MaterialSlot |
|
|
|
{ |
|
|
|
|
|
|
|
public Matrix3MaterialSlot() |
|
|
|
{ |
|
|
|
} |
|
|
|
|
|
|
|
public Matrix3MaterialSlot( |
|
|
|
int slotId, |
|
|
|
string displayName, |
|
|
|
|
|
|
[Serializable] |
|
|
|
public class Matrix4MaterialSlot : MaterialSlot |
|
|
|
{ |
|
|
|
public Matrix4MaterialSlot() |
|
|
|
{ |
|
|
|
} |
|
|
|
|
|
|
|
public Matrix4MaterialSlot( |
|
|
|
int slotId, |
|
|
|
string displayName, |
|
|
|
|
|
|
[Serializable] |
|
|
|
public class Texture2DMaterialSlot : MaterialSlot |
|
|
|
{ |
|
|
|
public Texture2DMaterialSlot() |
|
|
|
{ |
|
|
|
} |
|
|
|
|
|
|
|
public Texture2DMaterialSlot( |
|
|
|
int slotId, |
|
|
|
string displayName, |
|
|
|
|
|
|
[Serializable] |
|
|
|
public class SamplerStateMaterialSlot : MaterialSlot |
|
|
|
{ |
|
|
|
public SamplerStateMaterialSlot() |
|
|
|
{ |
|
|
|
} |
|
|
|
|
|
|
|
public SamplerStateMaterialSlot( |
|
|
|
int slotId, |
|
|
|
string displayName, |
|
|
|
|
|
|
|
|
|
|
private ConcreteSlotValueType m_ConcreteValueType = ConcreteSlotValueType.Vector4; |
|
|
|
|
|
|
|
public DynamicVectorMaterialSlot() |
|
|
|
{ |
|
|
|
} |
|
|
|
|
|
|
|
public DynamicVectorMaterialSlot( |
|
|
|
int slotId, |
|
|
|
string displayName, |
|
|
|
|
|
|
{ |
|
|
|
m_ConcreteValueType = valueType; |
|
|
|
} |
|
|
|
|
|
|
|
public override PreviewProperty GetPreviewProperty(string name) |
|
|
|
{ |
|
|
|
var pp = new PreviewProperty |
|
|
|
{ |
|
|
|
m_Name = name, |
|
|
|
m_PropType = ConvertConcreteSlotValueTypeToPropertyType(concreteValueType), |
|
|
|
m_Vector4 = new Vector4(value.x, value.y, value.z, value.w), |
|
|
|
m_Float = value.x, |
|
|
|
m_Color = new Vector4(value.x, value.x, value.z, value.w), |
|
|
|
}; |
|
|
|
return pp; |
|
|
|
} |
|
|
|
|
|
|
|
protected override string ConcreteSlotValueAsVariable(AbstractMaterialNode.OutputPrecision precision) |
|
|
|
{ |
|
|
|
return precision + "4 (" + value.x + "," + value.y + "," + value.z + "," + value.w + ")"; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
[Serializable] |
|
|
|
|
|
|
case SlotValueType.Dynamic: |
|
|
|
return new DynamicVectorMaterialSlot(slotId, displayName, shaderOutputName, slotType, defaultValue, shaderStage, hidden); |
|
|
|
case SlotValueType.Vector4: |
|
|
|
return new Vector3MaterialSlot(slotId, displayName, shaderOutputName, slotType, defaultValue, shaderStage, hidden); |
|
|
|
return new Vector4MaterialSlot(slotId, displayName, shaderOutputName, slotType, defaultValue, shaderStage, hidden); |
|
|
|
case SlotValueType.Vector3: |
|
|
|
return new Vector3MaterialSlot(slotId, displayName, shaderOutputName, slotType, defaultValue, shaderStage, hidden); |
|
|
|
case SlotValueType.Vector2: |
|
|
|