浏览代码

HDRenderPipeline: Add NaN support in DrawFloat dbug function

/main
sebastienlagarde 7 年前
当前提交
7c8c80ac
共有 1 个文件被更改,包括 14 次插入5 次删除
  1. 19
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Debug/DebugDisplay.hlsl

19
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Debug/DebugDisplay.hlsl


void DrawFloat(float floatValue, float3 fontColor, uint2 currentUnormCoord, inout uint2 fixedUnormCoord, bool flipY, inout float3 color)
{
int intValue = int(floatValue);
DrawInteger(intValue, fontColor, currentUnormCoord, fixedUnormCoord, flipY, color);
DrawCharacter('.', fontColor, currentUnormCoord, fixedUnormCoord, flipY, color);
int fracValue = int(frac(floatValue) * 1e6); // 6 digit
DrawInteger(fracValue, fontColor, currentUnormCoord, fixedUnormCoord, flipY, color);
if (IsNAN(floatValue))
{
DrawCharacter('N', fontColor, currentUnormCoord, fixedUnormCoord, flipY, color);
DrawCharacter('a', fontColor, currentUnormCoord, fixedUnormCoord, flipY, color);
DrawCharacter('N', fontColor, currentUnormCoord, fixedUnormCoord, flipY, color);
}
else
{
int intValue = int(floatValue);
DrawInteger(intValue, fontColor, currentUnormCoord, fixedUnormCoord, flipY, color);
DrawCharacter('.', fontColor, currentUnormCoord, fixedUnormCoord, flipY, color);
int fracValue = int(frac(floatValue) * 1e6); // 6 digit
DrawInteger(fracValue, fontColor, currentUnormCoord, fixedUnormCoord, flipY, color);
}
}
#endif
正在加载...
取消
保存