visual studio 中显示cg,hlsl语法高亮

这个对提升编程效率和感觉挺有帮助的,share下,hope it can help!

最开始是在gamedev上看到的,摘;录如下:

----------------------------

You have to download the CG Toolkit from the nVidia site. 
Then in the folder /NVIDIA Corporation/Cg/msdev_syntax_highlighting/ its gonna be a file called usertype.dat then you will have to do this..

1. Copy the usertype.dat file to

32位: /Microsoft Visual Studio 8/Common7/IDE

64位下是\Program Files (x86)\Microsoft Visual Studio 8\Common7\IDE\这里


2. Open up the registry editor and go to the following location -

32位: HKLM/SOFTWARE/Microsoft/VisualStudio/8.0/Languages/File Extensions

64位:HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\8.0\Languages\File Extensions


3. Copy the default value from the .cpp key.
4. Create a new key under the File Extensions with the name of .cg(.fx 或者其他什么名字)
5. Paste the value you just copied into the default value.
6. Restart Visual Studio and your shaders should now have syntax highlighting.

-----------------------------

后面部分不修改注册表也可以的,在tool->option->text editor->file extention添加fx,hlsl,cg解释为c++语法高亮就可以了。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值