HLSL User Defined Language for Notepad++

When it comes to writing shaders, Notepad++ is currently my editor of choice. The most recent release of Notepad++ added version 2.0 of their User Defined Language (UDL) system, which adds quite a few improvements. I’ve been using an HLSL UDL file that I downloaded from somewhere else for a while now, and I decided to upgrade it to the 2.0 format and also make it work better for SM5.0 profiles. I added all of the operators, keywords, types attributes, system-value semantics, intrinsics, and methods, so they all get syntax highlighting now. I also stripped out all of the old pre-SM4.0 intrinsics and semantics, as well as the effect-specifics keywords. I’ve exported it as an XML file and uploaded it to my Google Drive so that others can make use of it as well. To use it, you can either import the XML file from the UDL dialog (Language->Define your language), or you can replace your userDefineLang.xml file in the AppData\Notepad++ folder. Enjoy!

Update 7/29/2019: I have long since moved on to Sublime Text as my editor of choice, using Matt Sutherlin’s excellent HLSL Syntax Package. You’re still of course welcome to download my UDL for Notepad++, but I have not updaated it since 2012 so it’s missing numerous keywords that were added to HLSL over the years.


guishade -

vvvv is a super grate platform for dx shader experimenting, no compiling, just runtime

#### [JC](http://www.google.com "no@thanks.forme") -

y u no http://nshader.codeplex.com/ ?

#### [defaultex]( "default_ex@live.com") -

Since Notepad++ allows for regex. May want to look at some of the regex in: http://fxarchitect.codeplex.com The regex is kinda complex, splitting up HLSL syntax into categories as well as creating hierarchies from scope blocks. Sadly much of the regex has went unused and I have loads more for even more in-depth analysis of HLSL sitting in a monstrous text file (complete with comments) waiting to be put to use when I have more time and interest to work on that editor.

#### [Tiago Costa]( "") -

Thanks for sharing! I was tired of writing shaders without syntax highlighting in Nodepad.

#### [SteveM]( "steve.marton@gmail.com") -

My favorite IDE for shaders is Visual Studio + Visual Assist. Having “go to definition”, autocomplete, and everything else work is huge! My shaders are in my game solution, so everything’s easy to search together with my c++ code, and within reach without switching editors. The only bug I haven’t been able to fix is that typing swizzles like v.x and similar will always autocomplete to v->x and is a pain to fix manually. Anyone have a solution? I’m not willing to give up the feature for my c++ coding, so I live with it. Here’s how I set it up: In Visual Studio Tools/Options/Text Editor/File Extensions select Visual C++ as the editor and add fx, cgfx, etc as extensions. Close Visual Studio. Put a usertype.dat in C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE, something like this (there might be better ones): http://www.gamedev.net/topic/472205-hlsl-fx-file-syntax-colors/ To get VAssist to work, add the extensions “.fx;.cgfx;” to the registry entry HKEY_CURRENT_USER\Software\Whole Tomato\Visual Assist X\VANet10\ExtSource Restart Visual Studio. Enjoy.

#### [MJP](http://mynameismjp.wordpress.com/ "mpettineo@gmail.com") -

I prefer to edit shaders in Notepad++. It’s more lightweight, plus I have some plugins that I like to use.

#### [Rybets]( "rybetsg@gmail.com") -

FX Composer 2.5 + GPU Shader Analyzer + VisualStudio. I never code HLSL from scratch, but study ideas, using Excel (in developer mode, cause it uses sliders) and use Rhino for data visualization. There is a complex math stuff, so it is impossible to iterate in application to find a right formalization of math. ideas.

#### [Luc Bloom]( "") -