-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvertexlit_anime_l4d2.vmt
811 lines (723 loc) · 27.1 KB
/
vertexlit_anime_l4d2.vmt
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
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
VertexLitGeneric
{
//////////////////////////////////////////////////////////////////////////////////
// Version 3.4
// Honkai Impact 3rd preset by Debiddo specially for Left 4 Dead 2
// Bille Effects and dynamic color modulation based at entity gaze.
// The purpose is avoid overexposure for Anime-like characters
//
// Note: this works only for entities! static props will make the game crash!
// Note: this is bundled with "IT" (Bile) effect, for "Burn" use vertexlit_anime_burn_l4d2.vmt!
//
//
// By: Davi (Debiddo) Gooz
// Steam: https://steamcommunity.com/id/Debiddo
//////////////////////////////////////////////////////////////////////////////////
// include this file with:
////
// path {
// include "materials/shared/vertexlit_anime_l4d2.vmt"
// insert {
// $BaseTexture "your_albedo_texture_here"
// $emissiveblendbasetexture "your_albedo_texture_here_gain"
// // rest of your desired vmt parameters
// }
// }
//
//////
//
// "Manual" here: https://github.com/LoveRenamon/Debiddos-Shared-Materials/blob/dev/materials/shared/vertexlit_anime_heavy_l4d2.vmt
//////////////////////////////////////////////////////////////////////////////////
$basetexture "vgui/white"
// We don't really need a normal map, use if you wish to...
//$bumpmap "dev/flat_normal"
// in case you have a $bumpmap and you have a Phong Mask or $EnvMap Mask at Alpha Channel remember to disable:
$basemapluminancephongmask "1"
// Here the magic of a lightwarp with some amount of red for some faked skin scattering
$lightwarptexture "shared/lightwarp_honkai3rd_l4d2"
// Or use this one which is the most common lightwarp used by most anime characters over workshop
//$lightwarptexture "shared/lightwarp_anime"
// many more lightwarps at: https://github.com/LoveRenamon/Debiddos-Shared-Materials/tree/dev/materials/shared
//////////////////////////////////////////////////////////////////////////////////
// Swtich values
//////////////////////////////////////////////////////////////////////////////////
// set "1" to disable cull and render both sides or allow cull for performace and avoid Z-Fighting
$nocull "1"
// allow decals for damage effects by bullets, If you'r model is expensive and unoptimized, you will need to set "1"
// NOTE: FOR ALL SOURCE ENGINE x86 BRANCHES: MODELS WITH >= 32768 VERTICES DO NEED THIS BE "1", NO EXCEPTIONS!
$nodecal "0"
// Set 0 to ignore my Proxie setup (bring back original behaviour)
$ColorProxie "1"
$PhongProxie "1"
$EnvMapProxie "1"
$DetailProxie "1"
$EmissiveProxie "1"
//////////////////////////////////////////////////////////////////////////////////
// Enable / Disable tilling
// It will expose your shitty made UVMap
//////////////////////////////////////////////////////////////////////////////////
$ClampS "1" // Clamp S/X texture coordinates by default
$ClampT "1" // Clamp T/Y texture coordinates by default
$ClampU "0" // Clamp U/Z texture coordinates by default
//////////////////////////////////////////////////////////////////////////////////
// Tweak diffuse
// Only have effect with $HalfLambert "0"
//////////////////////////////////////////////////////////////////////////////////
$halflambert "0" // When true, warp radiosity to be at {{ 0.5 .. 1 }} range.
$diffuseexp "" // create nice diffuse gradients by warp the entire lambertian radiosity,
//NOTE: $diffuseexp Empty value have a different effect than "0" and without the declared parameter.
//////////////////////////////////////////////////////////////////////////////////
// Phong
// Phong is an old specular method. Small amounts are good for a dry skin or opaque micro surface
// it computes exponent driven by a additive $phongboot and exponencial $phongexponent
// Fresnel is same as the every fresnel, that can be boosted by $phongfresnelranges
//////////////////////////////////////////////////////////////////////////////////
$phong "1" // We'll use phong specular render pass
$forcephong "1" // force phong for potato PCs
$phongdisablehalflambert "1" // flag phong as lambertian
// engine default white texture to enable phong tint
$phongexponenttexture "vgui/white"
// make phong weaker, required for most cases, use only one of th bellow recommended
//$phongboost ".02" // 2% effect. almost invisible
//$phongboost ".2" // 20% effect
$phongboost ".5" // 50% effect, seens rasionable if the texture is too bright
//$phongboost "1" // 100% effect, seens rasionable if you have a custom mask
$phongalbedotint "1" // use the $BaseTexture's RGB as tint value per textel
// Phong Fresnel Ranges are like "intensity modulator" as:
// X direct view ( 0 radian angle)
// Y indirect view ( 45 radian angle)
// Z indirect view (180 radian angle)
// As XYZ fresnel vectors, you can use any float values
// i.e: $phongfresnelranges " [ X Y Z ] "
// NOTE: bellow Phong Fresnel Ranges take effect only at HLMV since will be later modulated by Proxies
$phongfresnelranges " [ .3 .65 1.1 ] " // my recommended values
//$phongfresnelranges " [ .12 .5 1 ] " // my recommended values warped at Valve's default range
//$phongfresnelranges " [ 1 .1 .1 ] " // the most used values over the steam workshop
// Phong Exponent
// for override the default $phongexponenttexture's Red Channel (255 for this sample file)
// you can unset with: $phongexponent ""
// Exponent means how hard the surface is and higher values make phong gradient be sharper; 0 means smoother and 255 means a irrealistic hard surface
// rasionable values are {{ 0 .. 127 }}
//$phongexponent "" // NOTE: you can set empty to disable and let $phongexponenttexture Red Channel takes it place.
$phongexponent "1" // my recommended safe value, good for general HalfLambertian skin/surface
//$phongexponent "7" // starts to go more sharper phong gradients, "kinda" better for leather, and harder micro surface
//$phongexponent "14" // you may wanna use this one for pseudo metalic or when $bumpmap will spread the entire phong
//$phongexponent "40" // for metalic surfaces or $bumpmap which have aberrant bumps
//////////////////////////////////////////////////////////////////////////////////
// Tweak Phong
// WARNING: IT BREAK THE WHOLE EFFECT
//////////////////////////////////////////////////////////////////////////////////
$shinyblood "0" // Set as False as failsafe parameter
//$shinybloodexponent "8"
//////////////////////////////////////////////////////////////////////////////////
// Alpha
//////////////////////////////////////////////////////////////////////////////////
// require proxies to work better, modulate the transparency for the entire material
$alpha "1.0"
// set "1" to enable binary transparency
$alphatest "0"
// Translucent SHOULD NOT be used along $alphatest
$translucent "0" // set "1" to enable gradient transparency, This will potentialy add Z-Fighting if you don't know when and how to use it
// for $alphatest be antialiased, allow different "opaque" steps based on MSAA Amount
$allowalphatocoverage "1"
// YOU SHOULD NEVER USE THIS SHIT, DONT BE SO LAZY TO DISABLE THE COVERAGE EFFECT!!
//$alphatestreference "" // .7 is the default value
//////////////////////////////////////////////////////////////////////////////////
// Emissive Blend
// NOTE: Use with caution since it double the amount of tringles being draw
//////////////////////////////////////////////////////////////////////////////////
"GPU>=2" // necessary to avoid make the model even more expensive for no good reason
{
$emissiveblendenabled "1" // It was earlier disabled by default, but for this sample and onwards would be enabled by default
}
$emissiveblendstrength ".8" // This sets actual strength for Emissive effect, however, it'll be modulated by $EmissiveStrength at Proxie setups
$emissiveblendbasetexture "vgui/white" // The trick is use the $BaseTexture here
$emissiveblendtexture "vgui/white" // how much effect modulation. Note that by use $BaseTexture you may result into a effect strenght mismatch pulse, however, for a most cases archives a really good effect
$emissiveblendflowtexture "vgui/white" // unless you'll make animated effect leave as "vgui/white"
$emissiveblendtint " [ .4 .4 .4 ] " // how much of this effect should be tinted over $BaseTexture. Default: " [ .1 .1 .1 ] "
$emissiveblendscrollvector " [ 0 0 ] " // X Y animation scroll speed
//////////////////////////////////////////////////////////////////////////////////
// Color Modulation
//////////////////////////////////////////////////////////////////////////////////
// Prevents the model's material from being tinted by $color2 or rendercolor.
$allowdiffusemodulation "1"
// Sets the amount to replace with solid color. A value of '0' will be full tint while a value of '1.00' will replace the albedo in the mask area with the color defined with $color2.
$blendtintcoloroverbase "0"
// this is a reference color to be applyed along the $color parameter
//$color2 " [ .973 .973 .975 ] "
// we may have a too saturated color which allow use "greywish" color
//$color2 " [ .8479 .8479 .8479 ] "
// This Parameter will be modulated by proxies, used just for HLMV reference, incase you want edit, use $MinLighting and $MaxLighting
$color " [ .973 .973 .973 ] "
//////////////////////////////////////////////////////////////////////////////////
// IT effect
//////////////////////////////////////////////////////////////////////////////////
$detail "models/survivors/survivor_it"
$detailscale "2.222"
$detailblendmode "0"
$detailblendfactor "1.0" // DEBUG: HLMV ONLY! Proxies will modulate it
//////////////////////////////////////////////////////////////////////////////////
// Rim Light
//////////////////////////////////////////////////////////////////////////////////
// ShoutAFuckUp $RimLight, you don't have ANY visible effect in Left 4 Dead 2 due how light works for this game
$rimlight "0"
//////////////////////////////////////////////////////////////////////////////////
// Env Map
// Envmap / Reflections, recommended use a mask
//////////////////////////////////////////////////////////////////////////////////
//$envmap "env_cubemap" // The Envirovment texture. "env_cubemap" for auto. Empty disables
//$envmapcontrast "0" // how much is multply by color*color . 0 is the "natural" value ( not compatible with $Phong "1" )
$envmapfresnel ".8" // Multiply Fresnel Envirovment by this value
$envmaptint " [ .9 .9 .9 ] " // {RGB} or [vector] values to tune EnvMap
//$envmapfresnelminmaxexp " [ 0 1 2 ] " // Override the Min, Max and Exponent Fresnel values ( not compatible with $BumpMap )
//////////////////////////////////////////////////////////////////////////////////
// Proxie Parameters
//////////////////////////////////////////////////////////////////////////////////
// cache Bile effect
$ITAmount ".0"
// cache BBQ for "wetness" based on fresnel
$BBQAmount ".0"
$BBQMult ".99"
$BBQ ".0"
// additive boost character's ilumination by this ammount (default: 0)
$LightingBoost ".001"
// warp and constraint light for $color and NOT $color2 at this range. Also avoid let model be pitch black when $emissiveblendenabled "0"
$MinLighting ".891" // uses magic number
$MaxLighting ".972" // It uses median of the most "real world" albedo value, Snow. As (R+G+B)/3
// just store a simpler variable for pupil light modulation
// it behave like a ramp smoother for dark/light ambients
// appear that .073 is our Open/Brighter magic number and .4 our Close/Darkener magic number
$PupilOpenRate "1.1073" // referece values: 1.1 (fast) || .3 (slower)
$PupilCloseRate "1.14" // referece values: 1.1 (fast) || .3 (slower)
// Store some variables handled by Proxies, DO NOT TOUCH IT
$false "0"
$true "1"
$zero ".0"
$one "1.0001"
$clr ".0"
$dummy ".0"
$Half ".5"
$Quarter ".25"
$DetailFactor ".0"
$lighting ".5"
$LightingWarped ".0"
$LightingQuarter ".0"
$Modulator ".0" // this is $clr difference. equals to: $Modulator = 1 - $clr
$Emissive ".0" // where to store my whole emissive calcs
$MinEmissive ".0" // generated by proxies equals to: $MinEmissive = $emissiveblendstrength * 0.25
$MaxEmissive ".0" // generated by proxies equals to: $MaxEmissive = $emissiveblendstrength + $MinEmissive
$EmissiveThreshold ".08" // if $lighting is bellow this, $MinEmissive will not be added at end of computation
$EmissiveIsBellowThreshold ".0" // if $lighting >= $EmissiveThreshold then $EmissiveIsBellowThreshold == $clr else $lighting
$EmissiveStrength ".09" // the strength of $emissiveblendtexture ( clamped between 0.000 ~ 1.000 at shader level )
$EmissiveStrengthCached ".0" // prevent undesired ramp, also allow user disable the whole effect with $EmissiveProxie "0"
$EmissiveBlendTint_0 ".0" // reference fetch by $emissiveblendtint Red Channel
$EmissiveBlendTint_1 ".0" // reference fetch by $emissiveblendtint Green Channel
$EmissiveBlendTint_2 ".0" // reference fetch by $emissiveblendtint Blue Channel
$EmissiveBlendTintR ".0" // EmissiveBlend read-only $emissiveblendtint Red Channel
$EmissiveBlendTintG ".0" // EmissiveBlend read-only $emissiveblendtint Green Channel
$EmissiveBlendTintB ".0" // EmissiveBlend read-only $emissiveblendtint Blue Channel
$EnvMapReference ".99" // EnvMap reference used for modulate $envmaptint
$EnvMapModulator ".0"
$EnvMapTint_0 ".0" // reference fetch by $envmaptint Red Channel
$EnvMapTint_1 ".0" // reference fetch by $envmaptint Green Channel
$EnvMapTint_2 ".0" // reference fetch by $envmaptint Blue Channel
$EnvMapTintR ".0" // EnvMap read-only $envmaptint Red Channel
$EnvMapTintG ".0" // EnvMap read-only $envmaptint Green Channel
$EnvMapTintB ".0" // EnvMap read-only $envmaptint Blue Channel
$color_0 ".0" // reference fetch by $color Red Channel
$color_1 ".0" // reference fetch by $color Green Channel
$color_2 ".0" // reference fetch by $color Blue Channel
$colorR ".0" // Color read-only $color Red Channel
$colorG ".0" // Color read-only $color Green Channel
$colorB ".0" // Color read-only $color Blue Channel
$PhongFresnelRangeX ".0" // 0º fresnel value used by proxie
$PhongFresnelRangeY ".0" // 45º fresnel value used by proxie
$PhongFresnelRangeZ ".0" // 180º fresnel value used by proxie
$PhongFresnelRange_0 ".0" // 0º $phongfresnelranges read-only
$PhongFresnelRange_1 ".0" // 45º $phongfresnelranges read-only
$PhongFresnelRange_2 ".0" // 180º $phongfresnelranges read-only
//////////////////////////////////////////////////////////////////////////////////
// Proxies
// Proxies are like code the VMT for dynamic behaviours
//////////////////////////////////////////////////////////////////////////////////
Proxies {
Pupil { // grab $lighting amount based on entity PVS
TextureVar $basetexture
TextureFrameNumVar $dummy
PupilCloseRate $PupilOpenRate
PupilOpenRate $PupilCloseRate
}
// NOTE: avoid endless ramp $LightingBoost
// Allow user disable $color Proxie
LessOrEqual { // disable $LightingBoost if $ColorProxie is disabled
LessEqualVar $zero
greaterVar $LightingBoost
srcVar1 $ColorProxie
srcVar2 $false
resultVar $LightingBoost
}
// allow user increse this $lighting by any arbitrary value
Add { // We shouldn't ramp, stores $lighting at temp variable
srcVar1 $lighting
srcVar2 $LightingBoost
resultVar $dummy
}
// NOTE: ( $lighting - $zero ) * ( $MaxLighting - $MinLighting ) / ( $one - $zero ) + $MinLighting
// Simplify as: $clr = ( $MaxLighting - $MinLighting ) * $lighting + $MinLighting
Subtract {
srcVar1 $MaxLighting
srcVar2 $MinLighting
resultVar $LightingWarped
}
Multiply {
srcVar1 $dummy
srcVar2 $LightingWarped
resultVar $LightingWarped
}
Add {
srcVar1 $LightingWarped
srcVar2 $MinLighting
resultVar $clr
}
// Split $color vectors
Clamp {
min "$color[0]"
max "$color2[0]"
srcVar1 $zero
resultVar $color_0
}
Clamp {
min "$color[1]"
max "$color2[1]"
srcVar1 $zero
resultVar $color_1
}
Clamp {
min "$color[2]"
max "$color2[2]"
srcVar1 $zero
resultVar $color_2
}
// this makes static values for: $colorR, $colorG and $colorB
// if $colorR <= 0 then $colorR == $color_0 else $colorR == $colorR
LessOrEqual {
lessEqualVar $color_0
greaterVar $colorR
srcVar1 $colorR
srcVar2 $zero
resultVar $colorR
}
LessOrEqual {
lessEqualVar $color_1
greaterVar $colorG
srcVar1 $colorG
srcVar2 $zero
resultVar $colorG
}
LessOrEqual {
lessEqualVar $color_2
greaterVar $colorB
srcVar1 $colorB
srcVar2 $zero
resultVar $colorB
}
// NOTE: We need wait to apply $clr to $color, otherwise we break my $Modulator cveat
// Emissive is supposed to take a small, but important role by default
Subtract { // use $clr difference as modulator
srcVar1 $one
srcVar2 $clr
resultVar $Modulator
}
LessOrEqual { // in case user want disable this modulation, store $emissiveblendstrength to later hijack back
lessEqualVar $emissiveblendstrength
greaterVar $EmissiveStrengthCached
srcVar1 $EmissiveStrengthCached
srcVar2 $zero
resultVar $EmissiveStrengthCached
}
// NOTE: ( $Emissive - $zero ) * ( $MaxEmissive - $MinEmissive ) / ( $MaxEmissive - $zero ) + $MinEmissive
LessOrEqual { // raw
lessEqualVar $emissiveblendstrength
greaterVar $Emissive
srcVar1 $Emissive
srcVar2 $zero
resultVar $Emissive
}
Multiply { // min tmp
srcVar1 $Quarter
srcVar2 $Emissive
resultVar $MinEmissive
}
Add { // max
srcVar1 $EmissiveStrengthCached
srcVar2 $MinEmissive
resultVar $MaxEmissive
}
Multiply { // min
srcVar1 $Emissive
srcVar2 $Emissive
resultVar $MinEmissive
}
Subtract { // max - min
srcVar1 $MaxEmissive
srcVar2 $MinEmissive
resultVar $EmissiveStrength
}
Multiply { // modulate
srcVar1 $Emissive
srcVar2 $EmissiveStrength
resultVar $EmissiveStrength
}
Divide { // modulate
srcVar1 $EmissiveStrength
srcVar2 $MaxEmissive
resultVar $EmissiveStrength
}
Add { // avoid zero
srcVar1 $EmissiveStrength
srcVar2 $MinEmissive
resultVar $emissiveblendstrength
}
LessOrEqual { // if $lighting <= $EmissiveThreshold then $EmissiveIsBellowThreshold == $lighting else $EmissiveIsBellowThreshold == $clr
LessEqualVar $lighting
greaterVar $clr
srcVar1 $lighting
srcVar2 $EmissiveThreshold
resultVar $EmissiveIsBellowThreshold
}
Multiply { // modulate
srcVar1 $emissiveblendstrength
srcVar2 $EmissiveIsBellowThreshold
resultVar $emissiveblendstrength
}
// Allow user disable $EmissiveProxie Proxie
// if $EmissiveProxie > 0 then $emissiveblendstrength == $emissiveblendstrength else $emissiveblendstrength == $EmissiveStrengthCached
LessOrEqual {
LessEqualVar $EmissiveStrengthCached
greaterVar $emissiveblendstrength
srcVar1 $EmissiveProxie
srcVar2 $false
resultVar $emissiveblendstrength
}
// Split $emissiveblendtint vectors
Clamp {
min "$emissiveblendtint[0]"
max "$emissiveblendtint[0]"
srcVar1 $zero
resultVar $EmissiveBlendTint_0
}
Clamp {
min "$emissiveblendtint[1]"
max "$emissiveblendtint[1]"
srcVar1 $zero
resultVar $EmissiveBlendTint_1
}
Clamp {
min "$emissiveblendtint[2]"
max "$emissiveblendtint[2]"
srcVar1 $zero
resultVar $EmissiveBlendTint_2
}
// this makes static values for: $EmissiveBlendTintR, $EmissiveBlendTintG and $EmissiveBlendTintB
LessOrEqual {
lessEqualVar $EmissiveBlendTint_0
greaterVar $EmissiveBlendTintR
srcVar1 $EmissiveBlendTintR
srcVar2 $zero
resultVar $EmissiveBlendTintR
}
LessOrEqual {
lessEqualVar $EmissiveBlendTint_1
greaterVar $EmissiveBlendTintG
srcVar1 $EmissiveBlendTintG
srcVar2 $zero
resultVar $EmissiveBlendTintG
}
LessOrEqual {
lessEqualVar $EmissiveBlendTint_2
greaterVar $EmissiveBlendTintB
srcVar1 $EmissiveBlendTintB
srcVar2 $zero
resultVar $EmissiveBlendTintB
}
// modulate $emissiveblendtint with our tweaked $Modulator
Multiply {
srcVar1 $EmissiveBlendTintR
srcVar2 $Modulator
resultVar $EmissiveBlendTint_0
}
Multiply {
srcVar1 $EmissiveBlendTintG
srcVar2 $Modulator
resultVar $EmissiveBlendTint_1
}
Multiply {
srcVar1 $EmissiveBlendTintB
srcVar2 $Modulator
resultVar $EmissiveBlendTint_2
}
Add {
srcVar1 $EmissiveBlendTint_0
srcVar2 $MinEmissive
resultVar $EmissiveBlendTint_0
}
Add {
srcVar1 $EmissiveBlendTint_1
srcVar2 $MinEmissive
resultVar $EmissiveBlendTint_1
}
Add {
srcVar1 $EmissiveBlendTint_2
srcVar2 $MinEmissive
resultVar $EmissiveBlendTint_2
}
// NOTE: if $EmissiveProxie is false ensure static $emissiveblendtint
LessOrEqual {
LessEqualVar $EmissiveBlendTintR
greaterVar $EmissiveBlendTint_0
srcVar1 $EmissiveProxie
srcVar2 $false
resultVar "$emissiveblendtint[0]"
}
LessOrEqual {
LessEqualVar $EmissiveBlendTintG
greaterVar $EmissiveBlendTint_1
srcVar1 $EmissiveProxie
srcVar2 $false
resultVar "$emissiveblendtint[1]"
}
LessOrEqual {
LessEqualVar $EmissiveBlendTintB
greaterVar $EmissiveBlendTint_2
srcVar1 $EmissiveProxie
srcVar2 $false
resultVar "$emissiveblendtint[2]"
}
LessOrEqual {
LessEqualVar $EmissiveBlendTintB
greaterVar $EmissiveBlendTint_2
srcVar1 $EmissiveProxie
srcVar2 $false
resultVar "$emissiveblendtint[2]"
}
// NOTE: Now we can write $Modulator to $color
// Allow user disable $color Proxie
LessOrEqual {
LessEqualVar $one
greaterVar $clr
srcVar1 $ColorProxie
srcVar2 $false
resultVar $clr
}
// modulate $color with our tweaked $lighting
Multiply {
srcVar1 $colorR
srcVar2 $clr
resultVar "$color[0]"
}
Multiply {
srcVar1 $colorG
srcVar2 $clr
resultVar "$color[1]"
}
Multiply {
srcVar1 $colorB
srcVar2 $clr
resultVar "$color[2]"
}
// create quarter light to modulate EnvMapLight
Multiply {
srcVar1 $lighting
srcVar2 $Quarter
resultVar $LightingQuarter
}
// Split $envmaptint vectors
Clamp {
min "$envmaptint[0]"
max "$envmaptint[0]"
srcVar1 $zero
resultVar $EnvMapTintR
}
Clamp {
min "$envmaptint[1]"
max "$envmaptint[1]"
srcVar1 $zero
resultVar $EnvMapTintG
}
Clamp {
min "$envmaptint[2]"
max "$envmaptint[2]"
srcVar1 $zero
resultVar $EnvMapTintB
}
// store user defined $EnvMapTint vectors and use at Proxie setup
LessOrEqual {
lessEqualVar $EnvMapTintR
greaterVar $EnvMapTint_0
srcVar1 $EnvMapTint_0
srcVar2 $zero
resultVar $EnvMapTint_0
}
LessOrEqual {
lessEqualVar $EnvMapTintG
greaterVar $EnvMapTint_1
srcVar1 $EnvMapTint_1
srcVar2 $zero
resultVar $EnvMapTint_1
}
LessOrEqual {
lessEqualVar $EnvMapTintB
greaterVar $EnvMapTint_2
srcVar1 $EnvMapTint_2
srcVar2 $zero
resultVar $EnvMapTint_2
}
Multiply {
srcVar1 $EnvMapTint_0
srcVar2 $EnvMapTint_1
resultVar $EnvMapReference
}
Multiply {
srcVar1 $EnvMapReference
srcVar2 $EnvMapTint_2
resultVar $EnvMapReference
}
// EnvMap modulation
Subtract {
srcVar1 $one
srcVar2 $EnvMapReference
resultVar $EnvMapReference
}
Multiply {
srcVar1 $dummy
srcVar2 $EnvMapReference
resultVar $EnvMapModulator
}
Add {
srcVar1 $EnvMapModulator
srcVar2 $EnvMapReference
resultVar $EnvMapModulator
}
// Allow user disable EnvMap Proxie
LessOrEqual {
LessEqualVar $one
greaterVar $EnvMapModulator
srcVar1 $EnvMapProxie
srcVar2 $false
resultVar $EnvMapModulator
}
// Apply to $envmaptint
Multiply {
srcVar1 $EnvMapTint_0
srcVar2 $EnvMapModulator
resultVar "$envmaptint[0]"
}
Multiply {
srcVar1 $EnvMapTint_1
srcVar2 $EnvMapModulator
resultVar "$envmaptint[1]"
}
Multiply {
srcVar1 $EnvMapTint_2
srcVar2 $EnvMapModulator
resultVar "$envmaptint[2]"
}
// Add dynamic BBQ behaviour
BBQLevel {
resultVar $BBQAmount
}
Multiply {
srcVar1 $BBQAmount
srcVar2 $BBQMult
resultVar $BBQ
}
// Allow user disable PhongProxie / BBQ (wet)
LessOrEqual {
LessEqualVar $one
greaterVar $BBQ
srcVar1 $PhongProxie
srcVar2 $false
resultVar $BBQ
}
// Split $phongfresnelranges vectors
Clamp {
min "$PhongFresnelRanges[0]"
max "$PhongFresnelRanges[0]"
srcVar1 $zero
resultVar $PhongFresnelRangeX
}
Clamp {
min "$PhongFresnelRanges[1]"
max "$PhongFresnelRanges[1]"
srcVar1 $zero
resultVar $PhongFresnelRangeY
}
Clamp {
min "$PhongFresnelRanges[2]"
max "$PhongFresnelRanges[2]"
srcVar1 $zero
resultVar $PhongFresnelRangeZ
}
// store user defined $PhongFresnelRanges vectors and use at Proxie setup
LessOrEqual {
lessEqualVar $PhongFresnelRangeX
greaterVar $PhongFresnelRange_0
srcVar1 $PhongFresnelRange_0
srcVar2 $zero
resultVar $PhongFresnelRange_0
}
LessOrEqual {
lessEqualVar $PhongFresnelRangeY
greaterVar $PhongFresnelRange_1
srcVar1 $PhongFresnelRange_1
srcVar2 $zero
resultVar $PhongFresnelRange_1
}
LessOrEqual {
lessEqualVar $PhongFresnelRangeZ
greaterVar $PhongFresnelRange_2
srcVar1 $PhongFresnelRange_2
srcVar2 $zero
resultVar $PhongFresnelRange_2
}
// modulate $phongfresnelranges with BBQ
Multiply {
srcVar1 $PhongFresnelRange_0
srcVar2 $BBQ
resultVar "$PhongFresnelRanges[0]"
}
Multiply {
srcVar1 $PhongFresnelRange_1
srcVar2 $BBQ
resultVar "$PhongFresnelRanges[1]"
}
Multiply {
srcVar1 $PhongFresnelRange_2
srcVar2 $BBQ
resultVar "$PhongFresnelRanges[2]"
}
// store user defined $detailblendfactor vectors and use at Proxie setup
LessOrEqual {
lessEqualVar $detailblendfactor
greaterVar $DetailFactor
srcVar1 $DetailFactor
srcVar2 $zero
resultVar $DetailFactor
}
IT {
resultVar $ITAmount
}
Equals {
srcVar1 $ITAmount
resultVar $detailblendfactor
}
// Allow user disable $detail Proxie
LessOrEqual {
LessEqualVar $DetailFactor
greaterVar $detailblendfactor
srcVar1 $DetailProxie
srcVar2 $false
resultVar $detailblendfactor
}
}
}