浏览代码

HDRenderloop: Add useForwardOnly option

/main
sebastienlagarde 8 年前
当前提交
cc40fcbe
共有 4 个文件被更改,包括 22 次插入2 次删除
  1. 2
      Assets/ScriptableRenderLoop/HDRenderLoop/HDRenderLoop.asset.meta
  2. 17
      Assets/ScriptableRenderLoop/HDRenderLoop/HDRenderLoop.cs
  3. 3
      Assets/ScriptableRenderLoop/HDRenderLoop/HDRenderLoopInspector.cs
  4. 2
      Assets/TestScenes/HDTest/HDRenderLoopTest.unity

2
Assets/ScriptableRenderLoop/HDRenderLoop/HDRenderLoop.asset.meta


fileFormatVersion: 2
guid: 2400b74f5ce370c4481e5dc417d03703
timeCreated: 1476658764
timeCreated: 1476718001
licenseType: Pro
NativeFormatImporter:
userData:

17
Assets/ScriptableRenderLoop/HDRenderLoop/HDRenderLoop.cs


public bool displayOpaqueObjects = true;
public bool displayTransparentObjects = true;
public bool useForwardRenderingOnly = false;
public bool enableTonemap = true;
public float exposure = 0;
}

void RenderGBuffer(CullResults cull, Camera camera, RenderLoop renderLoop)
{
if (debugParameters.useForwardRenderingOnly)
{
return ;
}
// setup GBuffer for rendering
var cmd = new CommandBuffer();
cmd.name = "GBuffer Pass";

void RenderDeferredLighting(Camera camera, RenderLoop renderLoop)
{
if (debugParameters.useForwardRenderingOnly)
{
return;
}
// Bind material data
m_litRenderLoop.Bind();

cmd.SetRenderTarget(new RenderTargetIdentifier(s_CameraColorBuffer), new RenderTargetIdentifier(s_CameraDepthBuffer));
renderLoop.ExecuteCommandBuffer(cmd);
cmd.Dispose();
if (debugParameters.useForwardRenderingOnly)
{
RenderOpaqueRenderList(cullResults, camera, renderLoop, "Forward");
}
RenderTransparentRenderList(cullResults, camera, renderLoop, "Forward");
}

3
Assets/ScriptableRenderLoop/HDRenderLoop/HDRenderLoopInspector.cs


public readonly GUIContent enableTonemap = new GUIContent("Enable Tonemap");
public readonly GUIContent exposure = new GUIContent("Exposure");
public readonly GUIContent useForwardRenderingOnly = new GUIContent("Use Forward Rendering Only");
public bool isDebugViewMaterialInit = false;
public GUIContent[] debugViewMaterialStrings = null;
public int[] debugViewMaterialValues = null;

EditorGUILayout.Space();
debugParameters.displayOpaqueObjects = EditorGUILayout.Toggle(styles.displayOpaqueObjects, debugParameters.displayOpaqueObjects);
debugParameters.displayTransparentObjects = EditorGUILayout.Toggle(styles.displayTransparentObjects, debugParameters.displayTransparentObjects);
debugParameters.useForwardRenderingOnly = EditorGUILayout.Toggle(styles.useForwardRenderingOnly, debugParameters.useForwardRenderingOnly);
if (EditorGUI.EndChangeCheck())
{

2
Assets/TestScenes/HDTest/HDRenderLoopTest.unity


m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1828470159}
m_Enabled: 0
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 92bb16b4ee20841929b24d6bd771738d, type: 3}
m_Name:

正在加载...
取消
保存