浏览代码

Few more correction

/feature-ReflectionProbeFit
sebastienlagarde 7 年前
当前提交
c2868ec3
共有 2 个文件被更改,包括 7 次插入7 次删除
  1. 2
      ScriptableRenderPipeline/Core/CoreRP/ShaderLibrary/GeometricTools.hlsl
  2. 12
      ScriptableRenderPipeline/Core/CoreRP/ShaderLibrary/Packing.hlsl

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


// Plane equation: {(a, b, c) = N, d = -dot(N, P)}.
// Returns the distance from the plane to the point 'p' along the normal.
// Positive -> in front (above), negative -> behind (below).
float DistanceFromPlane(float3 p, float3 plane)
float DistanceFromPlane(float3 p, float4 plane)
{
return dot(float4(p, 1.0), plane);
}

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


}
// The standard 32-bit HDR color format
uint PackToR11G11B10f(real3 rgb)
uint PackToR11G11B10f(float3 rgb)
{
uint r = (f32tof16(rgb.x) << 17) & 0xFFE00000;
uint g = (f32tof16(rgb.y) << 6) & 0x001FFC00;

real3 UnpackFromR11G11B10f(uint rgb)
float3 UnpackFromR11G11B10f(uint rgb)
real r = f16tof32((rgb >> 17) & 0x7FF0);
real g = f16tof32((rgb >> 6) & 0x7FF0);
real b = f16tof32((rgb << 5) & 0x7FE0);
return real3(r, g, b);
float r = f16tof32((rgb >> 17) & 0x7FF0);
float g = f16tof32((rgb >> 6) & 0x7FF0);
float b = f16tof32((rgb << 5) & 0x7FE0);
return float3(r, g, b);
}
#endif // SHADER_API_GLES

正在加载...
取消
保存