浏览代码

- Renamed InfluenceLayeredLitXXX classes back to LayeredLit

- Changing the number of layers no longer synchronize them all.
/RenderPassXR_Sandbox
Julien Ignace 7 年前
当前提交
4957c390
共有 6 个文件被更改,包括 15 次插入16 次删除
  1. 14
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Editor/HDRenderPipelineMenuItems.cs
  2. 5
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/LayeredLit/Editor/LayeredLitUI.cs
  3. 4
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/LayeredLit/LayeredLit.shader
  4. 4
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/LayeredLit/LayeredLitTessellation.shader
  5. 2
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/Editor/BaseLitUI.cs
  6. 2
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/LitTessellation.hlsl

14
Assets/ScriptableRenderPipeline/HDRenderPipeline/Editor/HDRenderPipelineMenuItems.cs


foreach (Object obj in materials)
{
Material mat = obj as Material;
if (mat.shader.name == "HDRenderPipeline/InfluenceLayeredLit" || mat.shader.name == "HDRenderPipeline/InfluenceLayeredLitTessellation")
if (mat.shader.name == "HDRenderPipeline/LayeredLit" || mat.shader.name == "HDRenderPipeline/LayeredLitTessellation")
InfluenceLayeredLitGUI.SynchronizeAllLayers(mat);
LayeredLitGUI.SynchronizeAllLayers(mat);
EditorUtility.SetDirty(mat);
}
}

string.Format("{0} / {1} materials cleaned.", i, length),
i / (float)(length - 1));
if (mat.shader.name == "HDRenderPipeline/InfluenceLayeredLit" || mat.shader.name == "HDRenderPipeline/InfluenceLayeredLitTessellation")
if (mat.shader.name == "HDRenderPipeline/LayeredLit" || mat.shader.name == "HDRenderPipeline/LayeredLitTessellation")
InfluenceLayeredLitGUI.SetupMaterialKeywordsAndPass(mat);
LayeredLitGUI.SetupMaterialKeywordsAndPass(mat);
EditorUtility.SetDirty(mat);
}
else if (mat.shader.name == "HDRenderPipeline/Lit" || mat.shader.name == "HDRenderPipeline/LitTessellation")

Object[] materials = Resources.FindObjectsOfTypeAll<Material>();
Shader litShader = Shader.Find("HDRenderPipeline/Lit");
Shader layeredLitShader = Shader.Find("HDRenderPipeline/InfluenceLayeredLit");
Shader layeredLitShader = Shader.Find("HDRenderPipeline/LayeredLit");
foreach (Object obj in materials)
{

LitGUI.SetupMaterialKeywordsAndPass(mat);
EditorUtility.SetDirty(mat);
}
else if (mat.shader.name == "HDRenderPipeline/InfluenceLayeredLitTessellation")
else if (mat.shader.name == "HDRenderPipeline/LayeredLitTessellation")
InfluenceLayeredLitGUI.SetupMaterialKeywordsAndPass(mat);
LayeredLitGUI.SetupMaterialKeywordsAndPass(mat);
EditorUtility.SetDirty(mat);
}
}

5
Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/LayeredLit/Editor/LayeredLitUI.cs


namespace UnityEditor.Experimental.Rendering.HDPipeline
{
internal class InfluenceLayeredLitGUI : LitGUI
internal class LayeredLitGUI : LitGUI
{
public enum LayerUVBaseMapping
{

const int kMaxLayerCount = 4;
const int kSyncButtonWidth = 58;
public InfluenceLayeredLitGUI()
public LayeredLitGUI()
{
m_LayerCount = 4;
m_PropertySuffixes[0] = "0";

{
Undo.RecordObject(material, "Change layer count");
layerCount.floatValue = (float)newLayerCount;
SynchronizeAllLayersProperties();
layerChanged = true;
}

4
Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/LayeredLit/LayeredLit.shader


Shader "HDRenderPipeline/InfluenceLayeredLit"
Shader "HDRenderPipeline/LayeredLit"
{
Properties
{

}
}
CustomEditor "Experimental.Rendering.HDPipeline.InfluenceLayeredLitGUI"
CustomEditor "Experimental.Rendering.HDPipeline.LayeredLitGUI"
}

4
Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/LayeredLit/LayeredLitTessellation.shader


Shader "HDRenderPipeline/InfluenceLayeredLitTessellation"
Shader "HDRenderPipeline/LayeredLitTessellation"
{
Properties
{

}
}
CustomEditor "Experimental.Rendering.HDPipeline.InfluenceLayeredLitGUI"
CustomEditor "Experimental.Rendering.HDPipeline.LayeredLitGUI"
}

2
Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/Editor/BaseLitUI.cs


depthOffsetEnable = FindProperty(kDepthOffsetEnable, props);
// MaterialID
materialID = FindProperty(kMaterialID, props, false); // InfluenceLayeredLit is force to be standard for now, so materialID could not exist
materialID = FindProperty(kMaterialID, props, false); // LayeredLit is force to be standard for now, so materialID could not exist
horizonFade = FindProperty(kHorizonFade, props);

2
Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/LitTessellation.hlsl


// w - inside tessellation factor
float3 GetTessellationDisplacement(VaryingsMeshToDS input)
{
// This call will work for both InfluenceLayeredLit and Lit shader
// This call will work for both LayeredLit and Lit shader
LayerTexCoord layerTexCoord;
ZERO_INITIALIZE(LayerTexCoord, layerTexCoord);
GetLayerTexCoord(

正在加载...
取消
保存