浏览代码

fixed a lighting bug with point lights and shadows

/main
Filip Iliescu 7 年前
当前提交
e9c40e16
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 4
      Assets/ScriptableRenderPipeline/MobileRenderPipeline/ClassicDeferred/LightingTemplate.hlsl

4
Assets/ScriptableRenderPipeline/MobileRenderPipeline/ClassicDeferred/LightingTemplate.hlsl


float atten = tex2D (_LightTextureB0, att.rr).UNITY_ATTEN_CHANNEL;
// atten *= UnityDeferredComputeShadow (tolight, fadeDist, uv);
// atten *= SampleShadow(POINT_LIGHT, wpos, 0, 0);
atten *= SampleShadow(SPHERE_LIGHT, wpos, lightDir, 0);
#if defined (POINT_COOKIE)
atten *= texCUBEbias(_LightTexture0, float4(mul(unity_WorldToLight, half4(wpos,1)).xyz, -8)).w;

unity_v2f_deferred o;
// scaling quad by two becuase built-in unity quad ranges from -0.5 to 0.5
// scaling quad by two becuase built-in unity quad.fbx ranges from -0.5 to 0.5
o.pos = lightAsQuad ? float4(2.0*vertex.xy, 0.5, 1.0) : UnityObjectToClipPos(vertex);
o.uv = ComputeScreenPos(o.pos);

正在加载...
取消
保存