-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathunityShader.stx
605 lines (599 loc) · 6.9 KB
/
unityShader.stx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
;Author Zou Wei(zwcloud.net | [email protected])
#TITLE=UnitySurfaceShader
#DELIMITER=,(){}[]-+*/=~!&|\<> :;.`%^#
#QUOTATION1='
#QUOTATION2="
#COMMENTON=/*
#COMMENTOFF=*/
#LINECOMMENT= //
#ESCAPE=\
#PREFIX1=#
#CONTINUE_QUOTE=n
#CASE=y
#NUMBER_PATTERN=cpp
#KEYWORD=Keyword
;Surface shader
Shader
Properties
SubShader
Tags
LOD
CGPROGRAM
ENDCG
FallBack
;Surface shader: property types
Color
Range
2D
Rect
Cube
Float
Vector
;CG pragma line
pragma
surface
Lambert
;CG types
AppendStructuredBuffer
bool
bool2
bool3
bool4
Buffer
ByteAddressBuffer
ConsumeStructuredBuffer
double
double2
double3
double4
float
float1x1
float1x2
float1x3
float1x4
float2
float2x1
float2x2
float2x3
float2x4
float3
float3x1
float3x2
float3x3
float3x4
float4
float4x1
float4x2
float4x3
float4x4
half
half2
half3
half4
InputPatch
int
int2
int3
int4
line
lineadj
LineStream
matrix
OutputPatch
point
PointStream
RWBuffer
RWByteAddressBuffer
RWStructuredBuffer
RWTexture1D
RWTexture1DArray
RWTexture2D
RWTexture2DArray
RWTexture3D
string
StructuredBuffer
Texture1D
Texture1DArray
Texture2D
Texture2DArray
Texture2DMS
Texture2DMSArray
Texture3D
triangle
triangleadj
TriangleStream
uint
uint2
uint3
uint4
vector
;CG
BlendState
break
Buffer
cbuffer
class
compile
const
continue
DepthStencilState
DepthStencilView
discard
do
else
extern
false
for
GeometryShader
if
in
inline
inout
interface
namespace
linear
centroid
nointerpolation
noperspective
sample
out
pass
PixelShader
precise
RasterizerState
RenderTargetView
return
register
Sampler
sampler
Sampler1D
sampler1D
Sampler2D
sampler2D
Sampler3D
sampler3D
SamplerCUBE
samplerCUBE
SamplerState
SamplerComparisonState
shared
Stateblock
StateblockState
static
struct
switch
tbuffer
technique
technique10
technique11
texture
Texture1D
Texture1DArray
Texture2D
Texture2DArray
Texture2DMS
Texture2DMSArray
Texture3D
TextureCube
TextureCubeArray
true
typedef
uniform
VertexShader
void
volatile
while
#KEYWORD=CG_INTRINSIC
abs
acos
all
AllMemoryBarrier
AllMemoryBarrierWithGroupSync
any
asdouble
asfloat
asin
asint
asuint
atan
atan2
ceil
clamp
clip
cos
cosh
countbits
cross
D3DCOLORtoUBYTE4
ddx
ddx_coarse
ddx_fine
ddy
ddy_coarse
ddy_fine
degrees
determinant
DeviceMemoryBarrier
DeviceMemoryBarrierWithGroupSync
distance
dot
dst
EvaluateAttributeAtCentroid
EvaluateAttributeAtSample
EvaluateAttributeSnapped
exp
exp2
f16tof32
f32tof16
faceforward
firstbithigh
firstbitlow
floor
fmod
frac
frexp
fwidth
GetRenderTargetSampleCount
GetRenderTargetSamplePosition
GroupMemoryBarrier
GroupMemoryBarrierWithGroupSync
InterlockedAdd
InterlockedAnd
InterlockedCompareExchange
InterlockedCompareStore
InterlockedExchange
InterlockedMax
InterlockedMin
InterlockedOr
InterlockedXor
isfinite
isinf
isnan
ldexp
length
lerp
lit
log
log10
log2
mad
max
min
modf
mul
noise
normalize
pow
Process2DQuadTessFactorsAvg
Process2DQuadTessFactorsMax
Process2DQuadTessFactorsMin
ProcessIsolineTessFactors
ProcessQuadTessFactorsAvg
ProcessQuadTessFactorsMax
ProcessQuadTessFactorsMin
ProcessTriTessFactorsAvg
ProcessTriTessFactorsMax
ProcessTriTessFactorsMin
radians
rcp
reflect
refract
reversebits
round
rsqrt
saturate
sign
sin
sincos
sinh
smoothstep
sqrt
step
tan
tanh
tex1D
tex1Dbias
tex1Dgrad
tex1Dlod
tex1Dproj
tex2D
tex2Dbias
tex2Dgrad
tex2Dlod
tex2Dproj
tex3D
tex3Dbias
tex3Dgrad
tex3Dlod
tex3Dproj
texCUBE
texCUBEbias
texCUBEgrad
texCUBElod
texCUBEproj
transpose
trunc
#KEYWORD=CG_KEYWORD_FX
SetBlendState
SetComputeShader
SetRenderTargets
SetDepthStencilState
SetDomainShader
SetGeometryShader
SetHullShader
SetPixelShader
SetRasterizerState
SetVertexShader
domain
earlydepthstencil
instance
maxtessfactor
numthreads
outputcontrolpoints
outputtopology
partitioning
patchconstantfunc
#KEYWORD=CG_SEMANTIC
:ALPHATOCOVERAGEENABLE
:BLENDENABLE
:SRCBLEND
:DESTBLEND
:BLENDOP
:SRCBLENDALPHA
:DESTBLENDALPHA
:BLENDOPALPHA
:RENDERTARGETWRITEMASK
:DEPTHENABLE
:DEPTHWRITEMASK
:DEPTHFUNC
:STENCILENABLE
:STENCILREADMASK
:STENCILWRITEMASK
:FRONTFACESTENCILFAIL
:FRONTFACESTENCILZFAIL
:FRONTFACESTENCILPASS
:FRONTFACESTENCILFUNC
:BACKFACESTENCILFAIL
:BACKFACESTENCILZFAIL
:BACKFACESTENCILPASS
:BACKFACESTENCILFUNC
:FILLMODE
:CULLMODE
:FRONTCOUNTERCLOCKWISE
:DEPTHBIAS
:DEPTHBIASCLAMP
:SLOPESCALEDDEPTHBIAS
:ZCLIPENABLE
:SCISSORENABLE
:MULTISAMPLEENABLE
:ANTIALIASEDLINEENABLE
:FILTER
:ADDRESSU
:ADDRESSV
:ADDRESSW
:MIPLODBIAS
:MAXANISOTROPY
:COMPARISONFUNC
:BORDERCOLOR
:MINLOD
:MAXLOD
:BINORMAL
:BINORMAL0
:BINORMAL1
:BINORMAL10
:BINORMAL11
:BINORMAL2
:BINORMAL3
:BINORMAL4
:BINORMAL5
:BINORMAL6
:BINORMAL7
:BINORMAL8
:BINORMAL9
:BLENDINDICES
:BLENDINDICES0
:BLENDINDICES1
:BLENDINDICES10
:BLENDINDICES11
:BLENDINDICES2
:BLENDINDICES3
:BLENDINDICES4
:BLENDINDICES5
:BLENDINDICES6
:BLENDINDICES7
:BLENDINDICES8
:BLENDINDICES9
:BLENDWEIGHTS
:BLENDWEIGHTS0
:BLENDWEIGHTS1
:BLENDWEIGHTS10
:BLENDWEIGHTS11
:BLENDWEIGHTS2
:BLENDWEIGHTS3
:BLENDWEIGHTS4
:BLENDWEIGHTS5
:BLENDWEIGHTS6
:BLENDWEIGHTS7
:BLENDWEIGHTS8
:BLENDWEIGHTS9
:COLOR0
:COLOR1
:COLOR10
:COLOR11
:COLOR12
:COLOR13
:COLOR14
:COLOR15
:COLOR2
:COLOR3
:COLOR4
:COLOR5
:COLOR6
:COLOR7
:COLOR8
:COLOR9
:DIFFUSE
:DIFFUSE0
:DIFFUSE1
:DIFFUSE10
:DIFFUSE11
:DIFFUSE2
:DIFFUSE3
:DIFFUSE4
:DIFFUSE5
:DIFFUSE6
:DIFFUSE7
:DIFFUSE8
:DIFFUSE9
:FOG
:NORMAL
:NORMAL0
:NORMAL1
:NORMAL10
:NORMAL11
:NORMAL2
:NORMAL3
:NORMAL4
:NORMAL5
:NORMAL6
:NORMAL7
:NORMAL8
:NORMAL9
:POSITION
:POSITION0
:POSITION1
:POSITION10
:POSITION11
:POSITION2
:POSITION3
:POSITION4
:POSITION5
:POSITION6
:POSITION7
:POSITION8
:POSITION9
:PSIZE
:PSIZE0
:PSIZE1
:PSIZE10
:PSIZE11
:PSIZE2
:PSIZE3
:PSIZE4
:PSIZE5
:PSIZE6
:PSIZE7
:PSIZE8
:PSIZE9
:SPECULAR
:SPECULAR0
:SPECULAR1
:SPECULAR10
:SPECULAR11
:SPECULAR2
:SPECULAR3
:SPECULAR4
:SPECULAR5
:SPECULAR6
:SPECULAR7
:SPECULAR8
:SPECULAR9
:SV_CLIPDISTANCE
:SV_CLIPDISTANCE1
:SV_CLIPDISTANCE10
:SV_CLIPDISTANCE11
:SV_CLIPDISTANCE2
:SV_CLIPDISTANCE3
:SV_CLIPDISTANCE4
:SV_CLIPDISTANCE5
:SV_CLIPDISTANCE6
:SV_CLIPDISTANCE7
:SV_CLIPDISTANCE8
:SV_CLIPDISTANCE9
:SV_COVERAGE
:SV_CULLDISTANCE
:SV_CULLDISTANCE1
:SV_CULLDISTANCE10
:SV_CULLDISTANCE11
:SV_CULLDISTANCE2
:SV_CULLDISTANCE3
:SV_CULLDISTANCE4
:SV_CULLDISTANCE5
:SV_CULLDISTANCE6
:SV_CULLDISTANCE7
:SV_CULLDISTANCE8
:SV_CULLDISTANCE9
:SV_DEPTH
:SV_DISPATCHTHREADID
:SV_DOMAINLOCATION
:SV_GROUPID
:SV_GROUPINDEX
:SV_GROUPTHREADID
:SV_GSINSTANCEID
:SV_INSIDETESSFACTOR
:SV_INSTANCEID
:SV_ISFRONTFACE
:SV_OUTPUTCONTROLPOINTID
:SV_POSITION
:SV_PRIMITIVEID
:SV_RENDERTARGETARRAYINDEX
:SV_SAMPLEINDEX
:SV_TARGET0
:SV_TARGET1
:SV_TARGET2
:SV_TARGET3
:SV_TARGET4
:SV_TARGET5
:SV_TARGET6
:SV_TARGET7
:SV_TESSFACTOR
:SV_VERTEXID
:SV_VIEWPORTARRAYINDEX
:TANGENT
:TANGENT0
:TANGENT1
:TANGENT10
:TANGENT11
:TANGENT2
:TANGENT3
:TANGENT4
:TANGENT5
:TANGENT6
:TANGENT7
:TANGENT8
:TANGENT9
:TESSFACTOR
:TESSFACTOR0
:TESSFACTOR1
:TESSFACTOR10
:TESSFACTOR11
:TESSFACTOR2
:TESSFACTOR3
:TESSFACTOR4
:TESSFACTOR5
:TESSFACTOR6
:TESSFACTOR7
:TESSFACTOR8
:TESSFACTOR9
:TEXCOORD
:TEXCOORD0
:TEXCOORD1
:TEXCOORD10
:TEXCOORD11
:TEXCOORD12
:TEXCOORD13
:TEXCOORD14
:TEXCOORD15
:TEXCOORD19
:TEXCOORD2
:TEXCOORD3
:TEXCOORD4
:TEXCOORD5
:TEXCOORD6
:TEXCOORD7
:TEXCOORD8
:TEXCOORD9
:VFACE
:VPOS
:REGISTER
#