浏览代码

Moved back GetRenderPipelineMaterialList to HDUtils as it's HDRP specific

/stochastic_alpha_test
Thomas 7 年前
当前提交
9582c28d
共有 6 个文件被更改,包括 31 次插入34 次删除
  1. 28
      ScriptableRenderPipeline/Core/CoreUtils.cs
  2. 2
      ScriptableRenderPipeline/HDRenderPipeline/Debug/DebugDisplay.cs
  3. 2
      ScriptableRenderPipeline/HDRenderPipeline/HDRenderPipeline.cs
  4. 29
      ScriptableRenderPipeline/HDRenderPipeline/HDUtils.cs
  5. 2
      TestbedPipelines/Fptl/SkyboxHelper.cs
  6. 2
      TestbedPipelines/OnTileDeferredPipeline/OnTileDeferredRenderPipeline.cs

28
ScriptableRenderPipeline/Core/CoreUtils.cs


using System;
using System.Collections.Generic;
using System.Linq;
using UnityEngine.Experimental.Rendering.HDPipeline;
using UnityEngine.Rendering;
using UnityEngine.Rendering.PostProcessing;

public static class CoreUtils
{
public static List<RenderPipelineMaterial> GetRenderPipelineMaterialList()
{
var baseType = typeof(RenderPipelineMaterial);
var assembly = baseType.Assembly;
var types = assembly.GetTypes()
.Where(t => t.IsSubclassOf(baseType))
.Select(Activator.CreateInstance)
.Cast<RenderPipelineMaterial>()
.ToList();
// Note: If there is a need for an optimization in the future of this function, user can
// simply fill the materialList manually by commenting the code abode and returning a
// custom list of materials they use in their game.
//
// return new List<RenderPipelineMaterial>
// {
// new Lit(),
// new Unlit(),
// ...
// };
return types;
}
// Render Target Management.
public static void SetRenderTarget(CommandBuffer cmd, RenderTargetIdentifier buffer, ClearFlag clearFlag, Color clearColor, int miplevel = 0, CubemapFace cubemapFace = CubemapFace.Unknown)
{

2
ScriptableRenderPipeline/HDRenderPipeline/Debug/DebugDisplay.cs


{
if (!isDebugViewMaterialInit)
{
List<RenderPipelineMaterial> materialList = CoreUtils.GetRenderPipelineMaterialList();
List<RenderPipelineMaterial> materialList = HDUtils.GetRenderPipelineMaterialList();
// TODO: Share this code to retrieve deferred material with HDRenderPipeline
// Find first material that have non 0 Gbuffer count and assign it as deferredMaterial

2
ScriptableRenderPipeline/HDRenderPipeline/HDRenderPipeline.cs


m_GPUCopy = new GPUCopy(asset.renderPipelineResources.copyChannelCS);
// Scan material list and assign it
m_MaterialList = CoreUtils.GetRenderPipelineMaterialList();
m_MaterialList = HDUtils.GetRenderPipelineMaterialList();
// Find first material that have non 0 Gbuffer count and assign it as deferredMaterial
m_DeferredMaterial = null;
foreach (var material in m_MaterialList)

29
ScriptableRenderPipeline/HDRenderPipeline/HDUtils.cs


using System;
using System.Collections.Generic;
using System.Linq;
public static List<RenderPipelineMaterial> GetRenderPipelineMaterialList()
{
var baseType = typeof(RenderPipelineMaterial);
var assembly = baseType.Assembly;
var types = assembly.GetTypes()
.Where(t => t.IsSubclassOf(baseType))
.Select(Activator.CreateInstance)
.Cast<RenderPipelineMaterial>()
.ToList();
// Note: If there is a need for an optimization in the future of this function, user can
// simply fill the materialList manually by commenting the code abode and returning a
// custom list of materials they use in their game.
//
// return new List<RenderPipelineMaterial>
// {
// new Lit(),
// new Unlit(),
// ...
// };
return types;
}
public static Matrix4x4 GetViewProjectionMatrix(Matrix4x4 worldToViewMatrix, Matrix4x4 projectionMatrix)
{

2
TestbedPipelines/Fptl/SkyboxHelper.cs


using System.Collections.Generic;
using UnityEngine.Rendering;
using UnityEngine.Experimental.Rendering;
namespace UnityEngine.Experimental.Rendering
{

2
TestbedPipelines/OnTileDeferredPipeline/OnTileDeferredRenderPipeline.cs


using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Rendering;
using UnityEngine.Experimental.Rendering;
using UnityEngine.SceneManagement;
namespace UnityEngine.Experimental.Rendering.OnTileDeferredRenderPipeline
{

正在加载...
取消
保存