浏览代码

Fix fragment slots adding data to vertex description

/main
Peter Bay Bastian 7 年前
当前提交
94ce8db1
共有 3 个文件被更改,包括 33 次插入28 次删除
  1. 18
      ShaderGraph/com.unity.shadergraph/Editor/Data/MasterNodes/PBRMasterNode.cs
  2. 9
      ShaderGraph/com.unity.shadergraph/Editor/Data/MasterNodes/UnlitMasterNode.cs
  3. 34
      ShaderGraph/com.unity.shadergraph/Editor/Data/Nodes/MasterNode.cs

18
ShaderGraph/com.unity.shadergraph/Editor/Data/MasterNodes/PBRMasterNode.cs


{
List<MaterialSlot> slots = new List<MaterialSlot>();
GetSlots(slots);
List<MaterialSlot> validSlots = new List<MaterialSlot>();
slots.Remove(slots[i]);
continue;
validSlots.Add(slots[i]);
return slots.OfType<IMayRequireNormal>().Aggregate(NeededCoordinateSpace.None, (mask, node) => mask | node.RequiresNormal(stageCapability));
return validSlots.OfType<IMayRequireNormal>().Aggregate(NeededCoordinateSpace.None, (mask, node) => mask | node.RequiresNormal(stageCapability));
}
public NeededCoordinateSpace RequiresPosition(ShaderStageCapability stageCapability)

List<MaterialSlot> validSlots = new List<MaterialSlot>();
slots.Remove(slots[i]);
continue;
validSlots.Add(slots[i]);
return slots.OfType<IMayRequirePosition>().Aggregate(NeededCoordinateSpace.None, (mask, node) => mask | node.RequiresPosition(stageCapability));
return validSlots.OfType<IMayRequirePosition>().Aggregate(NeededCoordinateSpace.None, (mask, node) => mask | node.RequiresPosition(stageCapability));
}
}
}

9
ShaderGraph/com.unity.shadergraph/Editor/Data/MasterNodes/UnlitMasterNode.cs


{
List<MaterialSlot> slots = new List<MaterialSlot>();
GetSlots(slots);
List<MaterialSlot> validSlots = new List<MaterialSlot>();
slots.Remove(slots[i]);
continue;
validSlots.Add(slots[i]);
return slots.OfType<IMayRequirePosition>().Aggregate(NeededCoordinateSpace.None, (mask, node) => mask | node.RequiresPosition(stageCapability));
return validSlots.OfType<IMayRequirePosition>().Aggregate(NeededCoordinateSpace.None, (mask, node) => mask | node.RequiresPosition(stageCapability));
}
}
}

34
ShaderGraph/com.unity.shadergraph/Editor/Data/Nodes/MasterNode.cs


foreach (var activeNode in activeNodeList.OfType<AbstractMaterialNode>())
activeNode.CollectShaderProperties(shaderProperties, mode);
var finalShader = new ShaderGenerator();
finalShader.AddShaderChunk(string.Format(@"Shader ""{0}""", outputName), false);
finalShader.AddShaderChunk("{", false);
finalShader.Indent();
finalShader.AddShaderChunk("Properties", false);
finalShader.AddShaderChunk("{", false);
finalShader.Indent();
finalShader.AddShaderChunk(shaderProperties.GetPropertiesBlock(0), false);
finalShader.Deindent();
finalShader.AddShaderChunk("}", false);
foreach (var subShader in m_SubShaders)
finalShader.AddShaderChunk(subShader.GetSubshader(this, mode), true);
finalShader.AddShaderChunk(@"FallBack ""Hidden/InternalErrorShader""", false);
finalShader.Deindent();
finalShader.AddShaderChunk("}", false);
var finalShader = new ShaderStringBuilder();
finalShader.AppendLine(@"Shader ""{0}""", outputName);
using(finalShader.BlockScope())
{
finalShader.AppendLine("Properties");
using(finalShader.BlockScope())
{
finalShader.AppendLine(shaderProperties.GetPropertiesBlock(0));
}
foreach (var subShader in m_SubShaders)
finalShader.AppendLines(subShader.GetSubshader(this, mode));
finalShader.AppendLine(@"FallBack ""Hidden/InternalErrorShader""");
}
return finalShader.GetShaderString(0);
return finalShader.ToString();
}
public bool IsPipelineCompatible(IRenderPipeline renderPipeline)

正在加载...
取消
保存