浏览代码

Fix bug caused by using LogWarningFormat instead of LogWarning

Put output id uniform first in MaterialPropertyBlock, so that it's hit early when setting it for every node
/main
Peter Bay Bastian 7 年前
当前提交
2cf7a518
共有 1 个文件被更改,包括 3 次插入2 次删除
  1. 5
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/PreviewManager.cs

5
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/PreviewManager.cs


// Fill MaterialPropertyBlock
m_PreviewPropertyBlock.Clear();
var outputIdName = m_OutputIdProperty != null ? m_OutputIdProperty.referenceName : null;
m_PreviewPropertyBlock.SetFloat(outputIdName, -1);
foreach (var nodeGuid in m_PropertyNodeGuids)
{
var node = m_Graph.GetNodeFromGuid<AbstractMaterialNode>(nodeGuid);

m_PreviewProperties.Clear();
}
var outputIdName = m_OutputIdProperty != null ? m_OutputIdProperty.referenceName : null;
foreach (var nodeGuid in m_DirtyPreviews)
{

// Debug output
var message = "RecreateShader: " + node.GetVariableNameForNode() + Environment.NewLine + previewData.shaderString;
if (MaterialGraphAsset.ShaderHasError(previewData.shader))
Debug.LogWarningFormat(message);
Debug.LogWarning(message);
else
Debug.Log(message);
}

正在加载...
取消
保存