Search Unity

Resolved What set of tools do the SRP devs use to write and debug shaders

Discussion in 'SRP Dev Blitz Day 2022 - Q&A' started by YuriyPopov, Sep 29, 2022.

  1. YuriyPopov

    YuriyPopov

    Joined:
    Sep 5, 2017
    Posts:
    237
    I have been trying to come up with a robust set of tools for writing and debuging unity shaders for a while. I'm very curious what IDE and extensions the srp devs use. Do you prefer RenderDoc or something else? If you use visual studio what extensions do you use for hlsl support?
     
  2. TomasZi

    TomasZi

    Unity Technologies

    Joined:
    Jul 21, 2016
    Posts:
    4
    Hi!
    I believe every developer uses what they find most comfortable and that usually comes with familiarity. I personally (URP team) write shaders in Rider, although I have seen people using VS Code and XCode. For debugging I usually prefer using Unity's built in Frame Debugger. Very rare occasions I start RenderDoc, but it makes life a lot easier when it comes to scene or editor rendering debugging. XCode's frame debugger is also quite powerful with their pixel debugging feature. And of course there are number of tools for mobile debugging given by their developers, which these days come as plugins for IDEs rather than standalone apps.

    When it comes to plugins and extensions specifically for shaders, Rider has builtin intellisense that helps writing them, you just need to add rider package to Unity through Package Manager. As for the Visual Studio, I have seen some HLSL helping packages available in their marketplaces, have you tried any of those?
     
  3. cholleme

    cholleme

    Unity Technologies

    Joined:
    Apr 23, 2019
    Posts:
    31
    Yes form me personally the Unity frame debugger is generally also the first thing I check out as it gives a good view on how Unity itself sees the render state. Often you can catch easy mistakes early there (like say the wrong textures or shader parameters being set). Then going a level deeper RenderDoc is also the first tool I go to.

    When doing performance testing or if you need to dig really deep I prefer to use the tools made available by the console platform holders. They are generally remarkably efficient to use even if they are so low level.
     
  4. optimise

    optimise

    Joined:
    Jan 22, 2014
    Posts:
    2,129
    Not sure whether official realize that sometimes unity frame debugger will give u incorrect info. o_O
     
  5. TomasZi

    TomasZi

    Unity Technologies

    Joined:
    Jul 21, 2016
    Posts:
    4
    As much as I had to work with it, information it has given was correct, and it helped me, and many other developers fix number of bugs. If it's the case that it sometimes gives incorrect information, that sounds like a serious bug. Maybe you have a reproducible project and/or filled a bug report?
     
  6. YuriyPopov

    YuriyPopov

    Joined:
    Sep 5, 2017
    Posts:
    237
    I have but all of them seem to havr quirks that hinder productivity. For example navigate to definition does not seem to work with any of them and that feature I really miss when looking at the built in srp shaders to figure out what is going on and where the functions and macros are coming from.
     
  7. sabojako

    sabojako

    Joined:
    Jul 7, 2017
    Posts:
    48
    I noticed that 2023 has an overhauled Frame Debugger. I'm wondering if it will be able to display/debug stencil buffer? Any chance the Frame Debugger will be able to debug the SceneView someday?
     
  8. adrien-de-tocqueville

    adrien-de-tocqueville

    Unity Technologies

    Joined:
    Mar 16, 2020
    Posts:
    270
    If you know how to use vim, ctags does a pretty good job to navigate to definitions, especially in HDRP where we have the same functions defined multiple times for all material types
     
  9. Elvar_Orn

    Elvar_Orn

    Unity Technologies

    Joined:
    Dec 9, 2019
    Posts:
    162
    Hey!
    What version of Unity are you using where you see this issue?

    That's very high on my list of features to implement for the Frame Debugger. I can't promise it will make it in 2023 but will try.
     
  10. YuriyPopov

    YuriyPopov

    Joined:
    Sep 5, 2017
    Posts:
    237
    I will give vim a spin then. Can it somehow handle autocomplete too ?
     
  11. adrien-de-tocqueville

    adrien-de-tocqueville

    Unity Technologies

    Joined:
    Mar 16, 2020
    Posts:
    270
    yes, but it has very steep learning curve, you need to take some time to configure it to work efficiently, i prefer to warn beforehand
     
    arttu_p likes this.
  12. sabojako

    sabojako

    Joined:
    Jul 7, 2017
    Posts:
    48
    Both SceneView and stencil, or just one of them?
     
  13. Elvar_Orn

    Elvar_Orn

    Unity Technologies

    Joined:
    Dec 9, 2019
    Posts:
    162
    Ahh sorry, wasn't very clear there. I was referring to the Stencil feature.

    The Scene View is quite likely a difficult problem but that's my assumption, I need to investigate to get a better idea of the work needed to support this.
     
    sabojako likes this.