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!

8 thoughts on “HLSL User Defined Language for Notepad++

  1. 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.

  2. 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.

  3. 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.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s