Debugging
We can't use breakpoints or print strings in deformer graphs, so we need to use other methods to debug compute kernels. Thankfully, there are a few ways to do this.
One way is to write vertex colors to the Color pin. For example, say you had a resource buffer containing vertex indices that you want to apply an effect to. If you wanted to check which vertex indices are in the buffer, you could write a kernel to output the color red.
The above code would check the vertex buffer for indices that do not contain a value of 0, and output the color red for those indices. In this case you can assume the buffer has already been populated with values somewhere else (ex. in the setup graph, or elsewhere in the update graph).
We could then create a material to access the vertex color data and apply it to our skinned mesh (the same one that the deformer graph is also applied to).
This would give us a visual indication of which vertices the deformer graph is acting on.
Last updated