浏览代码

fixed light indexing

/main
Felipe Lira 6 年前
当前提交
7ce624ff
共有 1 个文件被更改,包括 2 次插入3 次删除
  1. 5
      ScriptableRenderPipeline/LightweightPipeline/LWRP/ShaderLibrary/Lighting.hlsl

5
ScriptableRenderPipeline/LightweightPipeline/LWRP/ShaderLibrary/Lighting.hlsl


#else
// The following code is more optimal than indexing unity_4LightIndices0.
// Conditional moves are branch free even on mali-400
// The compiler further optimizes the lessThan operation into a single vectorized op.
half i_rem = (i < 2.0h) ? i : i - 2;
int lightIndex = (i < 1.0h) ? lightIndex2.x : lightIndex2.y;
int lightIndex = (i_rem < 1.0h) ? lightIndex2.x : lightIndex2.y;
#endif
// The following code will turn into a branching madhouse on platforms that don't support

// TODO: we need to expose in SRP api an ability for the pipeline cap the amount of lights
// in the culling. This way we could do the loop branch with an uniform
// This would be helpful to support baking exceeding lights in SH as well
//return _AdditionalLightCount.x;
return min(_AdditionalLightCount.x, unity_LightIndicesOffsetAndCount.y);
}

正在加载...
取消
保存