转: VS中 GLSL Shader 语法高亮

效果:
这里写图片描述

过程:
重点内容
1.
工具,选项 中,添加要高亮的文件后缀
这里写图片描述

2.
VS2017中
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE
目录添加 一个 usertype.dat 文件
文件中添加如下内容:

attribute
const
uniform
varying
break
continue
do
for
while
if
else
in
out
inout
float
int
void
bool
true
false
discard
return
mat2
mat3
mat4
mat2x2
mat3x3
mat4x4
mat2x3
mat3x2
mat2x4
mat4x2
mat3x4
mat4x3
vec2
vec3
vec4
ivec2
ivec3
ivec4
uvec2
uvec3
uvec4
bvec2
bvec3
bvec4
sampler1D
sampler2D
sampler3D
samplerCube
sampler1DShadow
sampler2DShadow
struct

asm
class
union
enum
typedef
template
this
packed
goto
switch
default
inline
noinline
volatile
public
static
extern
external
interface
long
short
double
half
fixed
unsigned
input
output
sampler2DRect
sampler3DRect
sampler2DRectShadow
sizeof
cast
namespace
using

layout
location
smooth
flat
noperspective
centroid
invariant
lowp
mediump
highp
precision
patch
sample
subroutine

hvec2
hvec3
hvec4
fvec2
fvec3
fvec4
dvec2
dvec3
dvec4

on

final
abstract
limited
access
self

uchar
schar
uint
sint

int8
int16
int32
int64

sint8
sint16
sint32
sint64

uint8
uint16
uint32
uint64

float16
float32
float64

quat
hquat
fquat
dquat

handle
handle8
handle16
handle32
handle64

flag
flag8
flag16
flag32
flag64

import
export

hmat2
hmat3
hmat4

fmat2
fmat3
fmat4

dmat2
dmat3
dmat4

hmat2x3
hmat3x2
hmat2x4
hmat4x2
hmat3x4
hmat4x3

fmat2x3
fmat3x2
fmat2x4
fmat4x2
fmat3x4
fmat4x3

dmat2x3
dmat3x2
dmat2x4
dmat4x2
dmat3x4
dmat4x3

null
pi
epsilon
infinite
self

byte
word
dword
qword

new_object
new_array
delete_object
delete_array

int8
int16
int32
int64

i8
i16
i32
i64

i8vec2
i8vec3
i8vec4

i16vec2
i16vec3
i16vec4

i32vec2
i32vec3
i32vec4

i64vec2
i64vec3
i64vec4

uint8
uint16
uint32
uint64

u8
u16
u32
u64

u8vec2
u8vec3
u8vec4

u16vec2
u16vec3
u16vec4

u32vec2
u32vec3
u32vec4

u64vec2
u64vec3
u64vec4

float16
float32
float64

f16
f32
f64

f16vec2
f16vec3
f16vec4

f32vec2
f32vec3
f32vec4

f64vec2
f64vec3
f64vec4

f16mat2
f16mat3
f16mat4

f16mat2x3
f16mat2x4
f16mat3x2
f16mat3x4
f16mat4x2
f16mat4x3

f32mat2
f32mat3
f32mat4

f32mat2x3
f32mat2x4
f32mat3x2
f32mat3x4
f32mat4x2
f32mat4x3

f64mat2
f64mat3
f64mat4

f64mat2x3
f64mat2x4
f64mat3x2
f64mat3x4
f64mat4x2
f64mat4x3

f16quat
f32quat
f64quat

bool1
bool2
bool3
bool4

bool1x1
bool2x2
bool3x3
bool4x4

bool2x3
bool2x4
bool3x2
bool3x4
bool4x2
bool4x3

int1
int2
int3
int4

int1x1
int2x2
int3x3
int4x4

int2x3
int2x4
int3x2
int3x4
int4x2
int4x3

half1
half2
half3
half4

half2x2
half3x3
half4x4

half2x3
half2x4
half3x2
half3x4
half4x2
half4x3

float1
float2
float3
float4

float1x1
float2x2
float3x3
float4x4

float2x3
float2x4
float3x2
float3x4
float4x2
float4x3

double1
double2
double3
double4

double1x1
double2x2
double3x3
double4x4

double2x3
double2x4
double3x2
double3x4
double4x2
double4x3

abs
acos
all
any
asin
atan
ceil
clamp
cos
cross
degrees
dFdx
dFdy
distance
dot
equal
exp
exp2
faceforward
floor
fract
ftransform
fwidth
greaterThan
greaterThanEqual
inversesqrt
length
lessThan
lessThanEqual
log
log2
matrixcompmult
max
min
mix
mod
noise1
noise2
noise3
noise4
normalize
not
notEqual
pow
radians
reflect
refract
shadow1D
shadow1DLod
shadow1DProj
shadow1DProjLod
shadow2D
shadow2DLod
shadow2DProj
shadow2DProjLod
sign
sin
smoothstep
sqrt
step
tan
texelFetch
texelFetchOffset
texture
texture1D
texture1DLod
texture1DProj
texture1DProjLod
texture2D
texture2DLod
texture2DProj
texture2DProjLod
texture3D
texture3DLod
texture3DProj
texture3DProjLod
textureCube
textureCubeLod
textureGrad
textureGradOffset
textureLod
textureLodOffset
textureOffset
textureProj
textureProjGrad
textureProjGradOffset
textureProjLod
textureProjLodOffset
textureProjOffset
textureSize
active
asm
attribute
break
case
cast
centroid
class
common
const
continue
default
discard
do
else
enum
extern
external
false
filter
fixed
flat
for
foreach
goto
highp
if
in
inline
inout
input
interface
invariant
layout
lowp
mediump
namespace
noinline
noperspective
out
output
packed
partition
patch
precision
public
return
row_major
sample
sizeof
smooth
static
struct
subroutine
superp
switch
template
this
true
typedef
uniform
union
using
varying
volatile
while
false
true
gl_BackColor
gl_BackLightModelProduct
gl_BackLightProduct
gl_BackMaterial
gl_BackSecondaryColor
gl_ClipPlane
gl_ClipVertex
gl_Color
gl_DepthRange
gl_DepthRangeParameters
gl_EyePlaneQ
gl_EyePlaneR
gl_EyePlaneS
gl_EyePlaneT
gl_Fog
gl_FogCoord
gl_FogFragCoord
gl_FogParameters
gl_FragColor
gl_FragCoord
gl_FragData
gl_FragDepth
gl_FrontColor
gl_FrontFacing
gl_FrontLightModelProduct
gl_FrontLightProduct
gl_FrontMaterial
gl_FrontSecondaryColor
gl_LightModel
gl_LightModelParameters
gl_LightModelProducts
gl_LightProducts
gl_LightSource
gl_LightSourceParameters
gl_MaterialParameters
gl_MaxClipPlanes
gl_MaxCombinedTextureImageUnits
gl_MaxDrawBuffers
gl_MaxFragmentUniformComponents
gl_MaxLights
gl_MaxTextureCoords
gl_MaxTextureImageUnits
gl_MaxTextureUnits
gl_MaxVaryingFloats
gl_MaxVertexAttribs
gl_MaxVertexTextureImageUnits
gl_MaxVertexUniformComponents
gl_ModelViewMatrix
gl_ModelViewMatrixInverse
gl_ModelViewMatrixInverseTranspose
gl_ModelViewMatrixTranspose
gl_ModelViewProjectionMatrix
gl_ModelViewProjectionMatrixInverse
gl_ModelViewProjectionMatrixInverseTranspose
gl_ModelViewProjectionMatrixTranspose
gl_MultiTexCoord0
gl_MultiTexCoord1
gl_MultiTexCoord10
gl_MultiTexCoord11
gl_MultiTexCoord2
gl_MultiTexCoord3
gl_MultiTexCoord4
gl_MultiTexCoord5
gl_MultiTexCoord6
gl_MultiTexCoord7
gl_MultiTexCoord8
gl_MultiTexCoord9
gl_Normal
gl_NormalMatrix
gl_NormalScale
gl_ObjectPlaneQ
gl_ObjectPlaneR
gl_ObjectPlaneS
gl_ObjectPlaneT
gl_Point
gl_PointParameters
gl_PointSize
gl_Position
gl_ProjectionMatrix
gl_ProjectionMatrixInverse
gl_ProjectionMatrixInverseTranspose
gl_ProjectionMatrixTranspose
gl_SecondaryColor
gl_TexCoord
gl_TextureEnvColor
gl_TextureMatrix
gl_TextureMatrixInverse
gl_TextureMatrixInverseTranspose
gl_TextureMatrixTranspose
gl_Vertex
bool
bvec2
bvec3
bvec4
dmat2
dmat2x2
dmat2x3
dmat2x4
dmat3
dmat3x2
dmat3x3
dmat3x4
dmat4
dmat4x2
dmat4x3
dmat4x4
double
dvec2
dvec3
dvec4
float
fvec2
fvec3
fvec4
half
hvec2
hvec3
hvec4
int
isampler1D
isampler1DArray
isampler2D
isampler2DArray
isampler2DMS
isampler2DMSArray
isampler2DRect
isampler3D
isamplerBuffer
isamplerCube
isamplerCubeArray
ivec2
ivec3
ivec4
long
mat2
mat2x2
mat2x3
mat2x4
mat3
mat3x2
mat3x3
mat3x4
mat4
mat4x2
mat4x3
mat4x4
sampler1D
sampler1DArray
sampler1DArrayShadow
sampler1DShadow
sampler2D
sampler2DArray
sampler2DArrayShadow
sampler2DMS
sampler2DMSArray
sampler2DRect
sampler2DRectShadow
sampler2DShadow
sampler3D
sampler3DRect
samplerBuffer
samplerCube
samplerCubeArray
samplerCubeArrayShadow
samplerCubeShadow
short
uint
unsigned
usampler1D
usampler1DArray
usampler2D
usampler2DArray
usampler2DMS
usampler2DMSArray
usampler2DRect
usampler3D
usamplerBuffer
usamplerCube
usamplerCubeArray
uvec2
uvec3
uvec4
vec2
vec3
vec4
void

展开阅读全文

没有更多推荐了,返回首页