浏览代码

Fixed output to sampler2D when that node is being used.

/main
vlad 8 年前
当前提交
2750742f
共有 1 个文件被更改,包括 5 次插入5 次删除
  1. 10
      MaterialGraphProject/Assets/Vlad/TextureAssetNode.cs

10
MaterialGraphProject/Assets/Vlad/TextureAssetNode.cs


public override void GeneratePropertyUsages(ShaderGenerator visitor, GenerationMode generationMode)
{
var slotTexture2D = FindInputSlot<MaterialSlot>(0);
var slotTexture2D = FindOutputSlot<MaterialSlot>(0);
if (slotTexture2D != null)
{
var edgesTexture2D = owner.GetEdges(slotTexture2D.slotReference).ToList();

visitor.AddShaderChunk("Texture2D " + propertyName + "_T2D;", true);
visitor.AddShaderChunk("Texture2D " + propertyName + ";", true);
var slotSampler2D = FindInputSlot<MaterialSlot>(0);
var slotSampler2D = FindOutputSlot<MaterialSlot>(1);
var edgesSampler2D = owner.GetEdges(slotTexture2D.slotReference).ToList();
var edgesSampler2D = owner.GetEdges(slotSampler2D.slotReference).ToList();
visitor.AddShaderChunk("Sampler2D " + propertyName + "_S2D;", true);
visitor.AddShaderChunk("sampler2D " + propertyName + ";", true);
}
}
}

正在加载...
取消
保存