浏览代码

Fixed compiler erros for some variants/platforms.

/RenderPassXR_Sandbox
Felipe Lira 8 年前
当前提交
287a7929
共有 2 个文件被更改,包括 24 次插入24 次删除
  1. 4
      Assets/ScriptableRenderPipeline/LowEndMobilePipeline/Shaders/LowEndMobilePipeline.shader
  2. 44
      Assets/ScriptableRenderPipeline/LowEndMobilePipeline/Shaders/LowEndMobilePipelineShadows.cginc

4
Assets/ScriptableRenderPipeline/LowEndMobilePipeline/Shaders/LowEndMobilePipeline.shader


ZWrite[_ZWrite]
CGPROGRAM
#pragma target 2.0
#pragma target 3.0
#pragma vertex vert
#pragma fragment frag
#pragma shader_feature _ _ALPHATEST_ON _ALPHABLEND_ON

LightInput lightData;
half NdotL;
INITIALIZE_LIGHT(lightData, lightIndex);
color += EvaluateOneLight(lightData, diffuse, specularGloss, normal, i.posWS, viewDir, NdotL);
color += EvaluateOneLight(lightData, diffuse, specularGloss, normal, i.posWS, viewDir, NdotL);
#ifdef _SHADOWS
if (lightIndex == 0)
{

44
Assets/ScriptableRenderPipeline/LowEndMobilePipeline/Shaders/LowEndMobilePipelineShadows.cginc


#endif
}
inline half ComputeShadowAttenuation(v2f i, float3 offset)
{
float3 posWorldOffsetNormal = i.posWS + offset;
int cascadeIndex = 0;
#ifdef _SHADOW_CASCADES
cascadeIndex = ComputeCascadeIndex(i.posWS);
if (cascadeIndex >= MAX_SHADOW_CASCADES)
return 1.0;
#endif
float4 shadowCoord = mul(_WorldToShadow[cascadeIndex], float4(posWorldOffsetNormal, 1.0));
shadowCoord.xyz /= shadowCoord.w;
shadowCoord.z = saturate(shadowCoord.z);
#if defined(_SOFT_SHADOWS) || defined(_SOFT_SHADOWS_CASCADES)
return ShadowPCF(shadowCoord.xyz);
#else
return ShadowAttenuation(shadowCoord.xyz);
#endif
}
inline half ComputeCascadeIndex(float3 wpos)
{
float3 fromCenter0 = wpos.xyz - _DirShadowSplitSpheres[0].xyz;

ShadowAttenuation(half3(shadowCoord.xy + half2(_PCFKernel[4], _PCFKernel[5]) + offset, shadowCoord.z)) +
ShadowAttenuation(half3(shadowCoord.xy + half2(_PCFKernel[6], _PCFKernel[7]) + offset, shadowCoord.z));
return attenuation * 0.25;
}
}
inline half ComputeShadowAttenuation(v2f i, float3 offset)
{
float3 posWorldOffsetNormal = i.posWS + offset;
int cascadeIndex = 0;
#ifdef _SHADOW_CASCADES
cascadeIndex = ComputeCascadeIndex(i.posWS);
if (cascadeIndex >= MAX_SHADOW_CASCADES)
return 1.0;
#endif
float4 shadowCoord = mul(_WorldToShadow[cascadeIndex], float4(posWorldOffsetNormal, 1.0));
shadowCoord.xyz /= shadowCoord.w;
shadowCoord.z = saturate(shadowCoord.z);
#if defined(_SOFT_SHADOWS) || defined(_SOFT_SHADOWS_CASCADES)
return ShadowPCF(shadowCoord.xyz);
#else
return ShadowAttenuation(shadowCoord.xyz);
#endif
}
正在加载...
取消
保存