Search Unity

upgraded NShader to work with vs2013 and unity

Discussion in 'Shaders' started by kris rok, Feb 12, 2014.

  1. kris rok

    kris rok

    Joined:
    Dec 11, 2012
    Posts:
    2
    hi there,

    i didn't know in which subforum to put this. shader/scripting?

    well, you probably know about the syntax highlighting tool for visual studio, NShader.
    it's a great tool which supports custom colors etc, but it wasn't updated a while and didn't support .shader file extensions.

    so i just grabbed the source and added the missing pieces. you can download it here.

    $nshader.png

    note: only makes sense if you use cg. if anyone is interested i might look into shaderlab support ;)

    cheers
     
    EvilTak and Ethereal_Sky like this.
  2. BigStink

    BigStink

    Joined:
    Sep 10, 2012
    Posts:
    11
    Thank you. Worked for me.
     
  3. mayorc1978

    mayorc1978

    Joined:
    Dec 30, 2013
    Posts:
    36
    Yes add shaderlab support too.

    Anyway it doesn't Highlight my code inside VS2013...the addin looks like installed though ?
    Here is a piece of the code of a sample shader named ColorizeMe.shader

     
    Last edited: Mar 9, 2014
  4. 1elfdragon1

    1elfdragon1

    Joined:
    Apr 13, 2012
    Posts:
    3
    if it doesn't work. go to the folder where it is installed.
    C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\Extensions\some random numbers
    now copy the downloaded files into that folder.


    now go to regedit and search for
    HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\12.0\FontAndColors\Cache
    and delete it.

    start up vs.

    tnx kris rok.
     
    Ethereal_Sky likes this.
  5. Nims

    Nims

    Joined:
    Nov 11, 2013
    Posts:
    86
    Thanks kris, it works.
    I wish I could change the colors so they are suited better for the dark theme VS.
    Shaderlab support would be appreciated. :D
     
  6. debugboy

    debugboy

    Joined:
    Jul 6, 2013
    Posts:
    1
    Thank you.
     
  7. oehm

    oehm

    Joined:
    Mar 15, 2014
    Posts:
    1
    This is awesome. Thank you very much for your work!
    But I assume it is not possible to customise the colours? This would be a key feature, as the colours used do not work well with the dark theme.
     
  8. Chman

    Chman

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    721
    You can customize the colors. Go to Tools -> Options -> Fonts and Colors and look for "Shader Language...".
     
  9. samizzo

    samizzo

    Joined:
    Sep 7, 2011
    Posts:
    487
    I've forked the VS2013 build of NShader and added a couple of new features. More info and a download here!
     
    Bamboo-Panda, JasonAtUnity and Chman like this.
  10. Bamboo-Panda

    Bamboo-Panda

    Joined:
    Apr 6, 2016
    Posts:
    3
    I read your page, it is awesome!
     
    samizzo likes this.