浏览代码

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

/main
Aleksandr Kirillov 7 年前
当前提交
d5a564b2
共有 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;
}

正在加载...
取消
保存