浏览代码

[ColorPyramid] Added debug mips for color pyramid

/feature-ScreenSpaceProjection
Frédéric Vauchelles 7 年前
当前提交
08ea5f15
共有 1 个文件被更改,包括 43 次插入6 次删除
  1. 49
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Debug/DebugDisplay.cs

49
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Debug/DebugDisplay.cs


kFullScreenDebugMip,
() =>
{
var depthSize = Shader.GetGlobalVector(HDShaderIDs._DepthPyramidMipSize);
var lodCount = Mathf.FloorToInt(Mathf.Log(Mathf.Min(depthSize.x, depthSize.y), 2f));
var id = 0;
switch (fullScreenDebugMode)
{
default:
case FullScreenDebugMode.DepthPyramid:
id = HDShaderIDs._DepthPyramidMipSize;
break;
case FullScreenDebugMode.FinalColorPyramid:
case FullScreenDebugMode.PreRefractionColorPyramid:
id = HDShaderIDs._GaussianPyramidColorMipSize;
break;
}
var size = Shader.GetGlobalVector(id);
var lodCount = Mathf.FloorToInt(Mathf.Log(Mathf.Min(size.x, size.y), 2f));
var depthSize = Shader.GetGlobalVector(HDShaderIDs._DepthPyramidMipSize);
var lodCount = Mathf.Floor(Mathf.Log(Mathf.Min(depthSize.x, depthSize.y), 2f));
var id = 0;
switch (fullScreenDebugMode)
{
default:
case FullScreenDebugMode.DepthPyramid:
id = HDShaderIDs._DepthPyramidMipSize;
break;
case FullScreenDebugMode.FinalColorPyramid:
case FullScreenDebugMode.PreRefractionColorPyramid:
id = HDShaderIDs._GaussianPyramidColorMipSize;
break;
}
var size = Shader.GetGlobalVector(id);
var lodCount = Mathf.Floor(Mathf.Log(Mathf.Min(size.x, size.y), 2f));
fullscreenDebugMip = (float)Convert.ChangeType(value, typeof(Single)) / lodCount;
},
DebugItemFlag.None,

var depthSize = Shader.GetGlobalVector(HDShaderIDs._DepthPyramidMipSize);
var lodCount = Mathf.FloorToInt(Mathf.Log(Mathf.Min(depthSize.x, depthSize.y), 2f));
var id = 0;
switch (fullScreenDebugMode)
{
default:
case FullScreenDebugMode.DepthPyramid:
id = HDShaderIDs._DepthPyramidMipSize;
break;
case FullScreenDebugMode.FinalColorPyramid:
case FullScreenDebugMode.PreRefractionColorPyramid:
id = HDShaderIDs._GaussianPyramidColorMipSize;
break;
}
var size = Shader.GetGlobalVector(id);
var lodCount = Mathf.FloorToInt(Mathf.Log(Mathf.Min(size.x, size.y), 2f));
return (uint)lodCount;
})
);

正在加载...
取消
保存