浏览代码

Updated AlphaDiscard function to support offsets. Now using it from Particle* shaders.

/2018.1
Felipe Lira 7 年前
当前提交
4a869821
共有 2 个文件被更改,包括 3 次插入5 次删除
  1. 4
      ScriptableRenderPipeline/LightweightPipeline/LWRP/ShaderLibrary/Core.hlsl
  2. 4
      ScriptableRenderPipeline/LightweightPipeline/LWRP/ShaderLibrary/Particles.hlsl

4
ScriptableRenderPipeline/LightweightPipeline/LWRP/ShaderLibrary/Core.hlsl


#define UNITY_Z_0_FAR_FROM_CLIPSPACE(coord) (coord)
#endif
void AlphaDiscard(half alpha, half cutoff)
void AlphaDiscard(half alpha, half cutoff, half offset = 0.0h)
clip(alpha - cutoff);
clip(alpha - cutoff + offset);
#endif
}

4
ScriptableRenderPipeline/LightweightPipeline/LWRP/ShaderLibrary/Particles.hlsl


#else
half result = 1.0h;
#endif
AlphaDiscard(result, _Cutoff, 0.0001h);
#if defined(_ALPHATEST_ON)
clip(result - _Cutoff + 0.0001h);
#endif
return result;
}

正在加载...
取消
保存