浏览代码

Correct rounding

/main
sebastienlagarde 7 年前
当前提交
7323bbbc
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 2
      ScriptableRenderPipeline/Core/CoreRP/ShaderLibrary/Packing.hlsl

2
ScriptableRenderPipeline/Core/CoreRP/ShaderLibrary/Packing.hlsl


// Pack float2 (each of 12 bit) in 888
real3 PackFloat2To888(real2 f)
{
uint2 i = (uint2)(f * 4095.0);
uint2 i = (uint2)(f * 4095.5);
uint2 hi = i >> 8;
uint2 lo = i & 255;
// 8 bit in lo, 4 bit in hi

正在加载...
取消
保存