浏览代码

fix indexing issue into cookie array causing some textures to not get loaded

/main
Filip Iliescu 7 年前
当前提交
6ab217be
共有 1 个文件被更改,包括 3 次插入3 次删除
  1. 6
      Assets/ScriptableRenderPipeline/MobileRenderPipeline/ClassicDeferred/UnityStandardForwardMobile.cginc

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


float4 cookieColor = float4(1,1,1,1);
// float4 uvCookie = mul (gLightMatrix[lightIndex], float4(vPw,1));
// float2 cookCoord = uvCookie.xy / uvCookie.w;
// const bool bHasCookie = gPerLightData[lightIndex].z > 0;
// const bool bHasCookie = gPerLightData[lightIndex].z >= 0;
// [branch]if(bHasCookie)
// {
// cookieColor *= UNITY_SAMPLE_TEX2DARRAY_LOD(_spotCookieTextures, float3(cookCoord, gPerLightData[lightIndex].z), 0.0);

float atten = tex2D (_LightTextureB0, att.rr).UNITY_ATTEN_CHANNEL;
float4 cookieColor = float4(1,1,1,1);
// const bool bHasCookie = gPerLightData[lightIndex].z > 0;
// const bool bHasCookie = gPerLightData[lightIndex].z >= 0;
// [branch]if(bHasCookie)
// {
// float3 cookieCoord = -float3(dot(vL, lgtDat.lightAxisX.xyz), dot(vL, lgtDat.lightAxisY.xyz), dot(vL, lgtDat.lightAxisZ.xyz)); // negate to make vL a fromLight vector

float d0 = 0.65;
float4 angularAtt = float4(1,1,1,smoothstep(0.0, 1.0-d0, 1.0-length(2*cookCoord-1)));
const bool bHasCookie = gPerLightData[lightIndex].z > 0;
const bool bHasCookie = gPerLightData[lightIndex].z >= 0;
[branch]if(bHasCookie)
{
angularAtt = UNITY_SAMPLE_TEX2DARRAY_LOD(_spotCookieTextures, float3(cookCoord, gPerLightData[lightIndex].z), 0.0);

正在加载...
取消
保存