浏览代码

Input Part 5

Fixed sampler state
/main
Matt Dean 7 年前
当前提交
c86f6166
共有 2 个文件被更改,包括 6 次插入9 次删除
  1. 6
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Graphs/SamplerStateShaderProperty.cs
  2. 9
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Nodes/Input/Texture/SamplerStateNode.cs

6
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Graphs/SamplerStateShaderProperty.cs


public override string GetPropertyDeclarationString()
{
string ss = referenceName + "_"
+ Enum.GetName(typeof(TextureSamplerState.FilterMode), value.filter) + "_"
+ Enum.GetName(typeof(TextureSamplerState.WrapMode), value.wrap) + "_sampler;";
#endif", ss);
#endif", referenceName);
}
public override PreviewProperty GetPreviewMaterialProperty()

9
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Nodes/Input/Texture/SamplerStateNode.cs


public SamplerStateNode()
{
name = "SamplerState";
name = "Sampler State";
UpdateNodeAfterDeserialization();
}

private const string kOutputSlotName = "Sampler Output";
private const string kOutputSlotName = "Out";
public sealed override void UpdateNodeAfterDeserialization()
{

{
overrideReferenceName = GetVariableNameForNode(),
generatePropertyBlock = false,
value = new TextureSamplerState()
{
filter = m_filter,

public override string GetVariableNameForNode()
{
string ss = name + "_"
+ Enum.GetName(typeof(TextureSamplerState.FilterMode), filter) + "_"
+ Enum.GetName(typeof(TextureSamplerState.WrapMode), wrap) + "_sampler;";
+ Enum.GetName(typeof(TextureSamplerState.FilterMode), filter) + "_"
+ Enum.GetName(typeof(TextureSamplerState.WrapMode), wrap) + "_sampler";
return ss;
}
}
正在加载...
取消
保存