浏览代码

HDRenderPipeline: Relink enable shadow option + add test shadow scene

/Branch_Batching2
sebastienlagarde 7 年前
当前提交
36fbd6cc
共有 4 个文件被更改,包括 1028 次插入7 次删除
  1. 3
      Assets/ScriptableRenderPipeline/HDRenderPipeline/HDRenderPipeline.cs
  2. 23
      Assets/ScriptableRenderPipeline/common/Shadow/Shadow.cs
  3. 1001
      Assets/TestScenes/HDTest/MultipleShadowsTest.unity
  4. 8
      Assets/TestScenes/HDTest/MultipleShadowsTest.unity.meta

3
Assets/ScriptableRenderPipeline/HDRenderPipeline/HDRenderPipeline.cs


// Forward opaque with deferred/cluster tile require that we fill the depth buffer
// correctly to build the light list.
// TODO: avoid double lighting by tagging stencil or gbuffer that we must not lit.
RenderForwardOnlyOpaqueDepthPrepass(cullResults, camera, renderContext);
RenderGBuffer(cullResults, camera, renderContext);

{
if (m_LightLoop != null)
{
using (new Utilities.ProfilingSample("Build Light list", renderContext))
using (new Utilities.ProfilingSample("Build Light list and render shadows", renderContext))
{
m_LightLoop.PrepareLightsForGPU(m_Owner.shadowSettings, cullResults, camera);
m_LightLoop.RenderShadows(renderContext, cullResults);

23
Assets/ScriptableRenderPipeline/common/Shadow/Shadow.cs


GPUShadowType shadowType = GPUShadowType.Point;
AdditionalLightData ald = vl.light.GetComponent<AdditionalLightData>();
Vector3 lpos = new Vector3( vl.localToWorld.GetColumn( 3 ).x, vl.localToWorld.GetColumn( 3 ).y, vl.localToWorld.GetColumn( 3 ).z );
Vector3 lpos = vl.light.transform.position;
bool add = distToCam < ald.shadowFadeDistance;
// TODO: Directional light (not projector), should not test shadowFadeDistance
bool add = distToCam < ald.shadowFadeDistance && m_ShadowSettings.enabled;
case LightType.Directional : add = --m_MaxShadows[(int)GPUShadowType.Directional , 0] >= 0; shadowType = GPUShadowType.Directional; facecount = m_ShadowSettings.directionalLightCascadeCount; break;
case LightType.Point : add = --m_MaxShadows[(int)GPUShadowType.Point , 0] >= 0; shadowType = GPUShadowType.Point ; facecount = 6; break;
case LightType.Spot : add = --m_MaxShadows[(int)GPUShadowType.Spot , 0] >= 0; shadowType = GPUShadowType.Spot ; facecount = 1; break;
case LightType.Directional:
add = --m_MaxShadows[(int)GPUShadowType.Directional, 0] >= 0;
shadowType = GPUShadowType.Directional;
facecount = m_ShadowSettings.directionalLightCascadeCount;
break;
case LightType.Point:
add = --m_MaxShadows[(int)GPUShadowType.Point, 0] >= 0;
shadowType = GPUShadowType.Point;
facecount = 6;
break;
case LightType.Spot:
add = --m_MaxShadows[(int)GPUShadowType.Spot, 0] >= 0;
shadowType = GPUShadowType.Spot;
facecount = 1;
break;
}
}

1001
Assets/TestScenes/HDTest/MultipleShadowsTest.unity
文件差异内容过多而无法显示
查看文件

8
Assets/TestScenes/HDTest/MultipleShadowsTest.unity.meta


fileFormatVersion: 2
guid: 7d00c9cbd8cb54a4e86bd699995c8beb
timeCreated: 1483527925
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
正在加载...
取消
保存