Project Description

NShader is an extension to Visual Studio 2008/2010/2012 that provides syntax highlighting for various shader languages including HLSL - GLSL - CG..

News

  • 19 June 2012, NShader 1.3 - VS2010 + VS2012. Add support for VS2012 and VS2010. Note for VS2012: in case highlighting is not working, follows the steps:
    • Remove the registry entry: HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\11.0\FontAndColors\Cache and HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\11.0_Config
    • Remove all lines using "fx" or "hlsl" in file C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\CommonExtensions\Microsoft\VC\VC_Pkg_Core_Registration.pkgdef .
  • 28 June 2011, Warning If NVidia Parallel NSight is installed, It will override fx, hlsl and glsl extensions to C++ syntax highlighting. In order to use NShader with those extensions, check How to use NShader syntax highlighting with NSight
  • 29 Jan 2011, NShader 1.2 - VS2010. This release is only working with VS2010 and includes the following bugfix/enhancement:
* Bugfix when using NShader from a user domain account
* Bugfix on preprocessor directive that were not highlighted correctly
* Bugfix for strings. Strings are now highlighted correctly
* Add new GLSL keywords 4.0
* Add new HLSL keywords (Interpolation Modifiers, register modifier)
* Add *.fxh files extension for HLSL files
* Add *.geom files extension for GLSL files
  • 16 May 2010, NShader 1.1 - VS2008. This release is introducing support for Visual Studio 2010 and includes some hlsl bugfixes (add new hlsl file extensions and keyword from Shader Model 5.0)
  • 1st Oct 2009, NShader 1.0 initial release!. This release supports basic highlighting for HLSL, GLSL and CG under Visual Studio 2008.

Features

  • Basic highlighting for HLSL, GLSL, CG languages (comment, number, floats, keywords, builtin functions)
  • Additional special highlighting per language : Semantics for HLSL, builin variables for GLSL.

NShader uses a specific shader language highlighting based on the following file extensions :
  • .fx, .fxh, .hlsl, .vsh, .psh files : HLSL syntax highlighter.
  • .glsl, .frag, .vert, .fp, .vp, .geom files : GLSL syntax highlighter.
  • .cg, .cgfx, files : CG syntax highlighter.

Requirement

  • Visual Studio 2008 or Visual Studio 2010 (at least tested on Pro version). Express editions are not supported as they don't allow community addins.
  • .NET Runtime 3.5 on Windows (and 4.0 for Visual Studio 2010) : Microsoft .NET 3.5 Runtime.

Limitations

  • The CG syntax highlighter is using the same HLSL syntax highlighter (they have similar keywords).
  • No syntax analyzing and checking. NShader only use a basic tokenizer to extract keywords.
  • No braces/bracket matching
  • No completion
  • No formatting

Contribute

You are welcome to contribute to this project.
A non exhaustive list of possible directions to extend this project could be:
  • Add braces/bracket matching
  • Add code formatting
  • Add compilation checking (using fxc...etc.).

Screenshots

SyntaxHighlightingSample.png

Contact

Go to NShader to have more information. Leave a message in the discussion tab.

Contact author: alexandre_mutel <at> yahoo <dot> fr
Contact on Gamedev Forum: AlexandreMutel
Blog : Code4k

Last edited Feb 7, 2013 at 2:09 AM by alexandre_mutel, version 13