浏览代码

[Fix]Move all LW resources into the resources asset.

/main
Tim Cooper 7 年前
当前提交
20f2f82e
共有 3 个文件被更改,包括 31 次插入11 次删除
  1. 36
      ScriptableRenderPipeline/LightweightPipeline/LWRP/Data/LightweightPipelineAsset.cs
  2. 2
      ScriptableRenderPipeline/LightweightPipeline/LWRP/Data/LightweightPipelineResource.asset
  3. 4
      ScriptableRenderPipeline/LightweightPipeline/LWRP/Data/LightweightPipelineResource.cs

36
ScriptableRenderPipeline/LightweightPipeline/LWRP/Data/LightweightPipelineAsset.cs


#if UNITY_EDITOR
using System;
using UnityEditor;
using UnityEditor.ProjectWindowCallback;
#endif

[SerializeField] private ShadowCascades m_ShadowCascades = ShadowCascades.FOUR_CASCADES;
[SerializeField] private float m_Cascade2Split = 0.25f;
[SerializeField] private Vector3 m_Cascade4Split = new Vector3(0.067f, 0.2f, 0.467f);
// Resources
[SerializeField] private Shader m_BlitShader;
[SerializeField] private Shader m_CopyDepthShader;
[SerializeField]
private LightweightPipelineResource m_ResourceAsset;
private LightweightPipelineResource m_ResourceAsset;
[MenuItem("Assets/Create/Render Pipeline/Lightweight/Pipeline Asset", priority = CoreUtils.assetCreateMenuPriority1)]
static void CreateLightweightPipeline()
{

public override void Action(int instanceId, string pathName, string resourceFile)
{
var instance = CreateInstance<LightweightPipelineAsset>();
instance.m_BlitShader = Shader.Find(LightweightShaderUtils.GetShaderPath(ShaderPathID.HIDDEN_BLIT));
instance.m_CopyDepthShader = Shader.Find(LightweightShaderUtils.GetShaderPath(ShaderPathID.HIDDEN_DEPTH_COPY));
instance.LoadResourceFile();
AssetDatabase.CreateAsset(instance, pathName);
}
}

public Shader BlitShader
{
get { return m_BlitShader; }
get
{
#if UNITY_EDITOR
if (m_ResourceAsset == null)
LoadResourceFile();
#endif
if (m_ResourceAsset)
return m_ResourceAsset.BlitShader;
return null;
}
get { return m_CopyDepthShader; }
get
{
#if UNITY_EDITOR
if (m_ResourceAsset == null)
LoadResourceFile();
#endif
if (m_ResourceAsset)
return m_ResourceAsset.CopyDepthShader;
return null;
}
}
}
}

2
ScriptableRenderPipeline/LightweightPipeline/LWRP/Data/LightweightPipelineResource.asset


type: 2}
DefaultTerrainMaterial: {fileID: 2100000, guid: 594ea882c5a793440b60ff72d896021e,
type: 2}
BlitShader: {fileID: 4800000, guid: c17132b1f77d20942aa75f8429c0f8bc, type: 3}
CopyDepthShader: {fileID: 4800000, guid: d6dae50ee9e1bfa4db75f19f99355220, type: 3}

4
ScriptableRenderPipeline/LightweightPipeline/LWRP/Data/LightweightPipelineResource.cs


public class LightweightPipelineResource : ScriptableObject
{
public Shader BlitShader;
public Shader CopyDepthShader;
#if UNITY_EDITOR
#endif
}
正在加载...
取消
保存