Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debug Block for NME #14496

Open
PatrickRyanMS opened this issue Nov 6, 2023 · 1 comment
Open

Debug Block for NME #14496

PatrickRyanMS opened this issue Nov 6, 2023 · 1 comment
Assignees
Labels
new feature nme Node Material Editor stale
Milestone

Comments

@PatrickRyanMS
Copy link
Member

We could use a debug block in NME to show the current state of the graph from any point within the graph. This would be a block that can take any vector (float, vec2, vec3, vec4) and will use the preview window to render what the values would be at that point. Here are the requirements:

  • There can be many debug blocks wired into a graph for testing, but they are all null-op unless one is selected. When a debug is selected the preview window is taken over and displays the output up to that debug block.
  • There is no real need to pass through the debug block. In NGE, we place a debug block on a wire because the block after can affect the data reported by the debug block such as the case of placing a debug before a setXXX block. The data will be driven by what the following block asks for. In the case of NME, the graph is a waterfall, so nothing after a block will affect the render at the point of that block, so we can just make the debug block input only, which will help with removing them later as no wires will need to be reconnected when deleting the block.
  • When a debug block is selected, the preview window shows the data at that point as the FragmentOut would do, but also allows the user to hover the preview and get a value from the pixel hovered. This would need to be the full float data (likely from a secondary texture rendered from raw float data) displayed to the preview window either as an overlay on the frame or in the footer bar of the window. We could also render it in the properties panel, but if the preview window is popped out, it may be more convenient to render it on the window.
  • If no debug block is selected, there is no need to render the second texture or to allow hover on the preview window to save on perf. If this means there is a slight lag to render the secondary texture when a debug node is selected, that is likely an acceptable tradeoff.
  • If rendering a vec2 (x, y), assume vec4 (x, y, 0.0, 1.0) in the render, but only display the vec2 on hover.
  • If rendering a float x in debug, assume vec4 (x, x, x, 1.0) on render, but only display float x on hover.
  • Camera manipulation of preview when in debug mode needs to stay the same, so the user can zoom, pan, and rotate camera and we continue to show debug values on hovered pixel. If this is too much computation, we can disable the hover debug value while a mouse button is down when manipulating the camera.
  • We only show a debug value when hovering the mesh. If the cursor is hovering the clear color, we don't display a value.
@PatrickRyanMS PatrickRyanMS added new feature nme Node Material Editor labels Nov 6, 2023
@PatrickRyanMS PatrickRyanMS added this to the Future milestone Nov 6, 2023
@thomlucc thomlucc modified the milestones: Future, 8.0 Mar 12, 2024
Copy link

This issue has been automatically staled because it has been inactive for more than 14 days. Please update to "unstale".

@github-actions github-actions bot added the stale label Mar 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new feature nme Node Material Editor stale
Projects
None yet
Development

No branches or pull requests

3 participants