浏览代码

Merge pull request #1260 from Unity-Technologies/PreIntegratedFDG-material-as-resource

Preintegratedfdg material as resource
/main
GitHub 7 年前
当前提交
2dabed04
共有 9 个文件被更改,包括 18 次插入20 次删除
  1. 8
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/HDAssetFactory.cs
  2. 11
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/PreIntegratedFGD/PreIntegratedFGD.cs
  3. 1
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/RenderPipelineResources/HDRenderPipelineResources.asset
  4. 4
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/RenderPipelineResources/RenderPipelineResources.cs
  5. 6
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/PreIntegratedFGD/PreIntegratedFGD.shader
  6. 8
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/PreIntegratedFGD/Resources.meta
  7. 0
      /ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/PreIntegratedFGD/PreIntegratedFGD.shader.meta
  8. 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;

1
ScriptableRenderPipeline/HDRenderPipeline/HDRP/RenderPipelineResources/HDRenderPipelineResources.asset


hdriSky: {fileID: 4800000, guid: 9bd32a6ece529fd4f9408b8d7e00c10d, type: 3}
proceduralSky: {fileID: 4800000, guid: ec63f47fd265df243a7b1d40f9ef7fe7, type: 3}
skyboxCubemap: {fileID: 103, guid: 0000000000000000f000000000000000, type: 0}
preIntegratedFGD: {fileID: 4800000, guid: 123f13d52852ef547b2962de4bd9eaad, type: 3}
encodeBC6HCS: {fileID: 7200000, guid: aa922d239de60304f964e24488559eeb, type: 3}
cubeToPanoShader: {fileID: 4800000, guid: 595434cc3b6405246b6cd3086d0b6f7d, type: 3}
blitCubeTextureFace: {fileID: 4800000, guid: d850d0a2481878d4bbf17e5126b04163, type: 3}

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;

6
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/PreIntegratedFGD/PreIntegratedFGD.shader


Shader "Hidden/HDRenderPipeline/PreIntegratedFGD"
{
SubShader
SubShader
Pass
Pass
{
ZTest Always Cull Off ZWrite Off

#include "CoreRP/ShaderLibrary/Common.hlsl"
#include "CoreRP/ShaderLibrary/ImageBasedLighting.hlsl"
#include "../../../ShaderVariables.hlsl"
#include "../../ShaderVariables.hlsl"
struct Attributes
{

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

正在加载...
取消
保存