浏览代码

Fix tangent vector unpacking

/main
Evgenii Golubev 7 年前
当前提交
5e4b9186
共有 1 个文件被更改,包括 6 次插入2 次删除
  1. 8
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/Lit/Lit.hlsl

8
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/Lit/Lit.hlsl


{
anisotropy = inGBuffer2.r * 2.0 - 1.0;
float unused;
uint tangentFlags;
UnpackFloatInt8bit(inGBuffer2.b, 8, unused, tangentFlags);
uint quadrant = UnpackByte(inGBuffer2.b);
uint storeSin = UnpackByte(inGBuffer2.b) & 4;
uint quadrant = tangentFlags;
uint storeSin = tangentFlags & 4;
float sinOrCos = inGBuffer2.g * rsqrt(2);
float cosOrSin = sqrt(1 - sinOrCos * sinOrCos);
float sinFrame = storeSin ? sinOrCos : cosOrSin;

正在加载...
取消
保存