浏览代码

Fixed game view debug for SSRT

/main
Frédéric Vauchelles 7 年前
当前提交
96917261
共有 2 个文件被更改,包括 15 次插入9 次删除
  1. 10
      ScriptableRenderPipeline/Core/CoreRP/Debugging/MousePositionDebug.cs
  2. 14
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Debug/DebugFullScreen.shader

10
ScriptableRenderPipeline/Core/CoreRP/Debugging/MousePositionDebug.cs


void Update()
{
Debug.Log(Input.mousePosition);
Debug.Log(Screen.width);
Debug.Log(Screen.height);
if (Input.mousePosition.x < 0
|| Input.mousePosition.y < 0
|| Input.mousePosition.x > Screen.width

instance.m_mousePosition = Input.mousePosition;
if (Input.GetMouseButtonDown(0))
instance.m_mousePosition.y = Screen.height - instance.m_mousePosition.y;
if (Input.GetMouseButtonDown(1))
if (Input.GetKeyDown(KeyCode.PageUp))
if (Input.GetKey(KeyCode.PageUp))
if (Input.GetKeyDown(KeyCode.PageDown))
if (Input.GetKey(KeyCode.PageDown))
instance.m_DebugStep = Mathf.Max(0, instance.m_DebugStep - 1);
if (Input.GetKey(KeyCode.End))
instance.m_MouseClickPosition = instance.m_mousePosition;

14
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Debug/DebugFullScreen.shader


// Common Pre Specific
// Fetch debug data
const uint2 loopStartPositionSS = uint2(debug.loopStartPositionSSX, debug.loopStartPositionSSY);
const uint2 endPositionSS = uint2(debug.endPositionSSX, debug.endPositionSSY);
uint2 loopStartPositionSS = uint2(debug.loopStartPositionSSX, debug.loopStartPositionSSY);
uint2 endPositionSS = uint2(debug.endPositionSSX, debug.endPositionSSY);
float3 iterationPositionSS = debug.iterationPositionSS;
if (_RequireToFlipInputTexture > 0)
{
loopStartPositionSS.y = uint(_ScreenSize.y) - loopStartPositionSS.y;
endPositionSS.y = uint(_ScreenSize.y) - endPositionSS.y;
iterationPositionSS.y = _ScreenSize.y - iterationPositionSS.y;
}
float distanceToPosition = FLT_MAX;
float positionSDF = 0;

const float hasData = iterationCellSize.x != 0 || iterationCellSize.y != 0;
// Position dot rendering
distanceToPosition = length(int2(posInput.positionSS) - int2(debug.iterationPositionSS.xy));
distanceToPosition = length(int2(posInput.positionSS) - int2(iterationPositionSS.xy));
positionSDF = clamp(circleRadius - distanceToPosition, 0, 1);
// Grid rendering

正在加载...
取消
保存