Support for .shader file extension

Sep 7, 2012 at 11:49 AM

Hi

I am using Unity3D which is using the .shader file extension, but currently there are no plugin for VS that supports .shader syntax highlighting. I thought this would be the place for such a request. Hope to see it in the future 

Best Regards

Sep 19, 2012 at 6:32 PM

This would be very nice.

 

There are some suggestoins how to get it work, which won't work for me:

http://forum.unity3d.com/threads/108995-Tutorial-How-to-use-NShader-with-Unity-shaders

Coordinator
Sep 20, 2012 at 2:43 PM

1) Close your VS2012 (or VS2010)

2) Edit the NShader.pkgdef located in YOUR_DRIVE:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\Extensions\a_cryptic_subfolder (search for it in extensions directory). 10.0 for VS2010 version.

3) Add the following line to NShader.pkgdef (where other extensions are):

[$RootKey$\Languages\File Extensions\.shader]
@="{4c554917-0eb7-3742-9f6b-f2f529fc6729}"

4) Then to be sure that everything is going to be highlighted correctly, open a registry and remove the following registry (be careful!):

HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\11.0\FontAndColors\Cache

HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\11.0_Config

Launch VS and It should be ok.

 

Sep 20, 2012 at 8:57 PM

Thank you alexandre this works like a charm :)

Feb 10 at 2:48 PM
Hi guys. I got Nshader works with Visual Studio 2013 (this thread helps - https://nshader.codeplex.com/discussions/462583), but instructions for VS 2012 doesn't helps enable highlighting in .shader, .cginc and .compute files. I complete all steps with Visual Studio 12.0 directories.

Please help me enable it) Thanks in advance.
Feb 11 at 7:58 AM
I set 12.0 version in path before install, but it still doesn't works..
Mar 18 at 10:33 PM
alexandre_mutel wrote:
1) Close your VS2012 (or VS2010) 2) Edit the NShader.pkgdef located in YOUR_DRIVE:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\Extensions\a_cryptic_subfolder (search for it in extensions directory). 10.0 for VS2010 version. 3) Add the following line to NShader.pkgdef (where other extensions are): [$RootKey$\Languages\File Extensions.shader] @="{4c554917-0eb7-3742-9f6b-f2f529fc6729}" 4) Then to be sure that everything is going to be highlighted correctly, open a registry and remove the following registry (be careful!): HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\11.0\FontAndColors\Cache HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\11.0_Config Launch VS and It should be ok.  
I tried this to add syntax highlighting for my own file extension and it works, but it gives me hlsl coloring. I want glsl. I know the glsl highlighting works, because glsl files are properly colored.

Is there a way to get nshader to give me syntax highlighting for my file using the glsl syntax, instead of just defaulting to hlsl?
Coordinator
Mar 19 at 5:28 AM
owensr wrote:
Is there a way to get nshader to give me syntax highlighting for my file using the glsl syntax, instead of just defaulting to hlsl?
Unfortunately no. This is currently harcoded and cannot be modified without modifying the code (adding a field in NShaderSupportedExtensions GLSL_* )
Aug 14 at 3:08 PM
Edited Aug 14 at 4:33 PM
This all worked fine for me until today when Microsoft did an update that I just got today, something like 'Visual Studio update for Unity.' I'm working with compute shaders and since this update the syntax highlighting has stopped working. I followed the steps here again just now, including adding the reg file that mickyd posted, but the highlighting is not working. Anyone else having the same problem or know how to fix it? I was afraid this would happen if I downloaded that update. Grr...
Sep 12 at 10:25 AM
jtw62074 wrote:
This all worked fine for me until today when Microsoft did an update that I just got today, something like 'Visual Studio update for Unity.' I'm working with compute shaders and since this update the syntax highlighting has stopped working. I followed the steps here again just now, including adding the reg file that mickyd posted, but the highlighting is not working. Anyone else having the same problem or know how to fix it? I was afraid this would happen if I downloaded that update. Grr...
I have the same problem, no highlighting at all, but I'm not sure it's due to Visual Studio update for Unity: I've tried installing it, disabled Resharper for good mesure, re-reged everything: still no NShader.