浏览代码

HDRP: PreIntegratedFDG material as resource

/main
sebastienlagarde 7 年前
当前提交
5e7735c5
共有 7 个文件被更改,包括 14 次插入17 次删除
  1. 8
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/HDAssetFactory.cs
  2. 11
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/PreIntegratedFGD/PreIntegratedFGD.cs
  3. 4
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/RenderPipelineResources/RenderPipelineResources.cs
  4. 8
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/PreIntegratedFGD/Resources.meta
  5. 0
      /ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/PreIntegratedFGD/PreIntegratedFGD.shader.meta
  6. 0
      /ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/PreIntegratedFGD/PreIntegratedFGD.shader

8
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/HDAssetFactory.cs


newAsset.opaqueAtmosphericScattering = Load<Shader>(HDRenderPipelinePath + "Sky/OpaqueAtmosphericScattering.shader");
newAsset.hdriSky = Load<Shader>(HDRenderPipelinePath + "Sky/HDRISky/HDRISky.shader");
newAsset.proceduralSky = Load<Shader>(HDRenderPipelinePath + "Sky/ProceduralSky/ProceduralSky.shader");
// Skybox/Cubemap is a builtin shader, must use Sahder.Find to access it. It is fine because we are in the editor
newAsset.skyboxCubemap = Shader.Find("Skybox/Cubemap");
// Material
newAsset.preIntegratedFGD = Load<Shader>(HDRenderPipelinePath + "Material/PreIntegratedFGD.shader");
// Skybox/Cubemap is a builtin shader, must use Sahder.Find to access it. It is fine because we are in the editor
newAsset.skyboxCubemap = Shader.Find("Skybox/Cubemap");
// Shadow
newAsset.shadowClearShader = Load<Shader>(CorePath + "Shadow/ShadowClear.shader");

11
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/PreIntegratedFGD/PreIntegratedFGD.cs


int m_refCounting;
// For image based lighting
Material m_InitPreFGD;
Material m_PreIntegratedFGDMaterial;
RenderTexture m_PreIntegratedFGD;
PreIntegratedFGD()

if (m_refCounting == 0)
{
m_InitPreFGD = CoreUtils.CreateEngineMaterial("Hidden/HDRenderPipeline/PreIntegratedFGD");
var hdrp = GraphicsSettings.renderPipelineAsset as HDRenderPipelineAsset;
m_PreIntegratedFGDMaterial = CoreUtils.CreateEngineMaterial(hdrp.renderPipelineResources.preIntegratedFGD);
m_PreIntegratedFGD = new RenderTexture(128, 128, 0, RenderTextureFormat.ARGB2101010, RenderTextureReadWrite.Linear);
m_PreIntegratedFGD.hideFlags = HideFlags.HideAndDontSave;

if (m_isInit)
return;
using (new ProfilingSample(cmd, "Init PreFGD"))
using (new ProfilingSample(cmd, "PreIntegratedFGD Material Generation"))
CoreUtils.DrawFullScreen(cmd, m_InitPreFGD, new RenderTargetIdentifier(m_PreIntegratedFGD));
CoreUtils.DrawFullScreen(cmd, m_PreIntegratedFGDMaterial, new RenderTargetIdentifier(m_PreIntegratedFGD));
}
m_isInit = true;

if (m_refCounting == 0)
{
CoreUtils.Destroy(m_InitPreFGD);
CoreUtils.Destroy(m_PreIntegratedFGDMaterial);
CoreUtils.Destroy(m_PreIntegratedFGD);
m_isInit = false;

4
ScriptableRenderPipeline/HDRenderPipeline/HDRP/RenderPipelineResources/RenderPipelineResources.cs


public Shader opaqueAtmosphericScattering;
public Shader hdriSky;
public Shader proceduralSky;
// Material
public Shader preIntegratedFGD;
// Utilities / Core
public ComputeShader encodeBC6HCS;

8
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/PreIntegratedFGD/Resources.meta


fileFormatVersion: 2
guid: ce581725fe970e14abbd599942a16779
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

/ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/PreIntegratedFGD/Resources/PreIntegratedFGD.shader.meta → /ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/PreIntegratedFGD/PreIntegratedFGD.shader.meta

/ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/PreIntegratedFGD/Resources/PreIntegratedFGD.shader → /ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/PreIntegratedFGD/PreIntegratedFGD.shader

正在加载...
取消
保存