標籤:
原文連結:http://www.cnblogs.com/cg_ghost/archive/2011/11/30/2268734.html
經過實驗,在VS2012有效。
1. 建立或編輯usertype.dat檔案(此檔案在VS安裝目錄下的Common7\IDE下面,比如我的就在D:\Program Files\Microsoft Visual Studio 8\Common7\IDE\usertype.dat),添加如下的關鍵字列表,每個單詞佔一行,如果你想添加你自己的關鍵字,也可以按照這種方式添加在usertype.dat檔案中
2. 在vs中開啟Tools->Options...->TextEditor->File Extension
填寫你想使用的著色器副檔名,如fx, hlsl, vs, ps等等,然後Editor選擇Microsoft Visual C++
3. 重新啟動VS2005
關鍵字列表:
__global__
__host__
__device__
__constant__
__shared__
gridDim
blockIdx
blockDim
threadIdx
int1
uint1
int2
uint2
int3
uint3
int4
uint4
float1
float2
float3
float4
char1
char2
char3
char4
uchar1
uchar2
uchar3
uchar4
short1
short2
short3
short4
dim1
dim2
dim3
dim4
int2float
float2int
asm
asm_fragment
BINORMAL
BLENDINDICES0
BLENDWEIGHT0
COLOR0
COLOR1
COLOR2
COLOR3
column_major
compile
compile_fragment
discard
decl1
float2
float3
float3x3
float3x4
float4
float4x4
float4x3
half
half2
half3
half4
in
inout
int
int2
int3
int4
matrix
out
pass1
pixelfragment
row_major
sampler
sampler1D
sampler2D
sampler3D
samplerCUBE
sampler_state
shared
stateblock
stateblock_state
TANGENT
technique
texture
texture1D
texture2D
texture3D
textureCUBE
TEXCOORD0
TEXCOORD1
TEXCOORD2
TEXCOORD3
TEXCOORD4
TEXCOORD5
TEXCOORD6
TEXCOORD7
uniform
vector
vertexfragment
VPOS
設定Shader關鍵字高亮(網上轉)