浏览代码

Refactor to match c++ engine for:

DrawRendererSettings -> DrawSettings
FilterRenderersSettings -> FilterSettings
DrawSortSettings -> SortSettings
/DrawSettings
Arnaud Carre 7 年前
当前提交
881e0ad2
共有 5 个文件被更改,包括 24 次插入24 次删除
  1. 8
      ScriptableRenderPipeline/HDRenderPipeline/HDRenderPipeline.cs
  2. 16
      ScriptableRenderPipeline/LightweightPipeline/LightweightPipeline.cs
  3. 4
      TestbedPipelines/BasicRenderPipeline/BasicRenderPipeline.cs
  4. 12
      TestbedPipelines/Fptl/FptlLighting.cs
  5. 8
      TestbedPipelines/OnTileDeferredPipeline/OnTileDeferredRenderPipeline.cs

8
ScriptableRenderPipeline/HDRenderPipeline/HDRenderPipeline.cs


renderContext.ExecuteCommandBuffer(cmd);
cmd.Clear();
var drawSettings = new DrawRendererSettings(camera, HDShaderPassNames.s_EmptyName)
var drawSettings = new DrawSettings (camera, HDShaderPassNames.s_EmptyName)
{
rendererConfiguration = rendererConfiguration,
sorting = { flags = SortFlags.CommonOpaque }

if (overrideMaterial != null)
drawSettings.SetOverrideMaterial(overrideMaterial, 0);
var filterSettings = new FilterRenderersSettings(true)
var filterSettings = new FilterSettings(true)
{
renderQueueRange = inRenderQueueRange == null ? RenderQueueRange.opaque : inRenderQueueRange.Value
};

renderContext.ExecuteCommandBuffer(cmd);
cmd.Clear();
var drawSettings = new DrawRendererSettings(camera, HDShaderPassNames.s_EmptyName)
var drawSettings = new DrawSettings (camera, HDShaderPassNames.s_EmptyName)
{
rendererConfiguration = rendererConfiguration,
sorting = { flags = SortFlags.CommonTransparent }

if (overrideMaterial != null)
drawSettings.SetOverrideMaterial(overrideMaterial, 0);
var filterSettings = new FilterRenderersSettings(true)
var filterSettings = new FilterSettings(true)
{
renderQueueRange = inRenderQueueRange == null ? k_RenderQueue_AllTransparent : inRenderQueueRange.Value
};

16
ScriptableRenderPipeline/LightweightPipeline/LightweightPipeline.cs


context.ExecuteCommandBuffer(cmd);
CommandBufferPool.Release(cmd);
var opaqueDrawSettings = new DrawRendererSettings(m_CurrCamera, m_DepthPrePass);
var opaqueDrawSettings = new DrawSettings (m_CurrCamera, m_DepthPrePass);
var opaqueFilterSettings = new FilterRenderersSettings(true)
var opaqueFilterSettings = new FilterSettings(true)
{
renderQueueRange = RenderQueueRange.opaque
};

private void RenderOpaques(ref ScriptableRenderContext context, RendererConfiguration settings)
{
var opaqueDrawSettings = new DrawRendererSettings(m_CurrCamera, m_LitPassName);
var opaqueDrawSettings = new DrawSettings (m_CurrCamera, m_LitPassName);
var opaqueFilterSettings = new FilterRenderersSettings(true)
var opaqueFilterSettings = new FilterSettings(true)
{
renderQueueRange = RenderQueueRange.opaque
};

private void RenderTransparents(ref ScriptableRenderContext context, RendererConfiguration config)
{
var transparentSettings = new DrawRendererSettings(m_CurrCamera, m_LitPassName);
var transparentSettings = new DrawSettings (m_CurrCamera, m_LitPassName);
var transparentFilterSettings = new FilterRenderersSettings(true)
var transparentFilterSettings = new FilterSettings(true)
{
renderQueueRange = RenderQueueRange.transparent
};

}
[Conditional("DEVELOPMENT_BUILD"), Conditional("UNITY_EDITOR")]
private void RenderObjectsWithError(ref ScriptableRenderContext context, FilterRenderersSettings filterSettings, SortFlags sortFlags)
private void RenderObjectsWithError(ref ScriptableRenderContext context, FilterSettings filterSettings, SortFlags sortFlags)
DrawRendererSettings errorSettings = new DrawRendererSettings(m_CurrCamera, s_LegacyPassNames[0]);
DrawSettings errorSettings = new DrawSettings (m_CurrCamera, s_LegacyPassNames[0]);
for (int i = 1; i < s_LegacyPassNames.Length; ++i)
errorSettings.SetShaderPassName(i, s_LegacyPassNames[i]);

4
TestbedPipelines/BasicRenderPipeline/BasicRenderPipeline.cs


SetupLightShaderVariables(cull.visibleLights, context);
// Draw opaque objects using BasicPass shader pass
var drawSettings = new DrawRendererSettings(camera, new ShaderPassName("BasicPass")) { sorting = { flags = SortFlags.CommonOpaque } };
var filterSettings = new FilterRenderersSettings(true) { renderQueueRange = RenderQueueRange.opaque };
var drawSettings = new DrawSettings (camera, new ShaderPassName("BasicPass")) { sorting = { flags = SortFlags.CommonOpaque } };
var filterSettings = new FilterSettings(true) { renderQueueRange = RenderQueueRange.opaque };
context.DrawRenderers(cull.visibleRenderers, ref drawSettings, filterSettings);
// Draw skybox

12
TestbedPipelines/Fptl/FptlLighting.cs


CommandBufferPool.Release(cmd);
// render opaque objects using Deferred pass
var drawSettings = new DrawRendererSettings(camera, new ShaderPassName("Deferred"))
var drawSettings = new DrawSettings (camera, new ShaderPassName("Deferred"))
var filterSettings = new FilterRenderersSettings(true){renderQueueRange = RenderQueueRange.opaque};
var filterSettings = new FilterSettings(true){renderQueueRange = RenderQueueRange.opaque};
loop.DrawRenderers(cull.visibleRenderers, ref drawSettings, filterSettings);
}

// render opaque objects using Deferred pass
var drawSettings = new DrawRendererSettings(camera, new ShaderPassName("ForwardSinglePass"))
var drawSettings = new DrawSettings (camera, new ShaderPassName("ForwardSinglePass"))
var filterSettings = new FilterRenderersSettings(true) { renderQueueRange = opaquesOnly ? RenderQueueRange.opaque : RenderQueueRange.transparent };
var filterSettings = new FilterSettings(true) { renderQueueRange = opaquesOnly ? RenderQueueRange.opaque : RenderQueueRange.transparent };
loop.DrawRenderers(cull.visibleRenderers, ref drawSettings, filterSettings);
}

CommandBufferPool.Release(cmd);
// render opaque objects using Deferred pass
var drawSettings = new DrawRendererSettings(camera, new ShaderPassName("DepthOnly"))
var drawSettings = new DrawSettings (camera, new ShaderPassName("DepthOnly"))
var filterSettings = new FilterRenderersSettings(true) {};
var filterSettings = new FilterSettings(true) {};
filterSettings.renderQueueRange = RenderQueueRange.opaque;
loop.DrawRenderers(cull.visibleRenderers, ref drawSettings, filterSettings);
}

8
TestbedPipelines/OnTileDeferredPipeline/OnTileDeferredRenderPipeline.cs


loop.ExecuteCommandBuffer (cmd);
// render opaque objects using Deferred pass
var drawSettings = new DrawRendererSettings (camera, new ShaderPassName ("Deferred")) {
var drawSettings = new DrawSettings (camera, new ShaderPassName ("Deferred")) {
var filterSettings = new FilterRenderersSettings(true) {renderQueueRange = RenderQueueRange.opaque};
var filterSettings = new FilterSettings(true) {renderQueueRange = RenderQueueRange.opaque};
loop.DrawRenderers (cullResults.visibleRenderers, ref drawSettings, filterSettings);
}

SetupLightShaderVariables (cullResults, camera, loop, cmd);
loop.ExecuteCommandBuffer(cmd);
var settings = new DrawRendererSettings(camera, new ShaderPassName("ForwardSinglePass"))
var settings = new DrawSettings (camera, new ShaderPassName("ForwardSinglePass"))
var filterSettings = new FilterRenderersSettings(true) {renderQueueRange = RenderQueueRange.transparent};
var filterSettings = new FilterSettings(true) {renderQueueRange = RenderQueueRange.transparent};
loop.DrawRenderers (cullResults.visibleRenderers, ref settings, filterSettings);
}
}

正在加载...
取消
保存