浏览代码

Add a global option for turning off shadows on transparencies to match what builtin deferred does.

/classicDeferredMobile
Filip Iliescu 7 年前
当前提交
135f6d26
共有 3 个文件被更改,包括 7 次插入3 次删除
  1. 2
      Assets/ScriptableRenderPipeline/MobileRenderPipeline/ClassicDeferred/ClassicDeferredPipeline.cs
  2. 7
      Assets/ScriptableRenderPipeline/MobileRenderPipeline/ClassicDeferred/UnityStandardForwardMobile.cginc
  3. 1
      Assets/TestScenes/MobileDeferredTest/ClassicDeferredPipeline.asset

2
Assets/ScriptableRenderPipeline/MobileRenderPipeline/ClassicDeferred/ClassicDeferredPipeline.cs


[SerializeField]
TextureSettings m_TextureSettings = TextureSettings.Default;
public bool UseLegacyCookies;
public bool TransparencyShadows;
public Mesh m_PointLightMesh;
public float PointLightMeshScaleFactor = 2.0f;
public Mesh m_SpotLightMesh;

cmd.SetGlobalFloat("_reflRootHdrDecodeExp", defdecode.y);
cmd.SetGlobalFloat ("_useLegacyCookies", UseLegacyCookies?1.0f:0.0f);
cmd.SetGlobalFloat ("_transparencyShadows", TransparencyShadows ? 1.0f : 0.0f);
context.ExecuteCommandBuffer(cmd);
cmd.Dispose();

7
Assets/ScriptableRenderPipeline/MobileRenderPipeline/ClassicDeferred/UnityStandardForwardMobile.cginc


int g_numLights;
int g_numReflectionProbes;
int _useLegacyCookies;
int _transparencyShadows;
float4x4 g_mViewToWorld;
float4x4 g_mWorldToView; // used for reflection only

int shadowIdx = asint(gPerLightData[lightIndex].y);
[branch]
if (shadowIdx >= 0)
if (shadowIdx >= 0 && _transparencyShadows)
{
float shadow = GetDirectionalShadowAttenuation(shadowContext, vPw, 0.0.xxx, shadowIdx, 0.0.xxx);
atten *= shadow;

int shadowIdx = asint(gPerLightData[lightIndex].y);
[branch]
if (shadowIdx >= 0)
if (shadowIdx >= 0 && _transparencyShadows)
{
float shadow = GetPunctualShadowAttenuation(shadowContext, vPw, 0.0.xxx, shadowIdx, vLw);
atten *= shadow;

int shadowIdx = asint(gPerLightData[lightIndex].y);
[branch]
if (shadowIdx >= 0)
if (shadowIdx >= 0 && _transparencyShadows)
{
float shadow = GetPunctualShadowAttenuation(shadowContext, vPw, 0.0.xxx, shadowIdx, 0.0.xxx);
atten *= shadow;

1
Assets/TestScenes/MobileDeferredTest/ClassicDeferredPipeline.asset


pointCookieSize: 128
reflectionCubemapSize: 128
UseLegacyCookies: 1
TransparencyShadows: 0
m_PointLightMesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0}
PointLightMeshScaleFactor: 2
m_SpotLightMesh: {fileID: 4300000, guid: 93e85ba57f65145538a8ac97bd005d40, type: 3}

正在加载...
取消
保存