forked from ray-cast/ray-mmd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ray.fx
971 lines (924 loc) · 44.5 KB
/
ray.fx
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
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
#include "ray.conf"
#include "ray_advanced.conf"
const float4 BackColor = 0.0;
const float4 WhiteColor = 1.0;
const float ClearDepth = 1.0;
const int ClearStencil = 0;
float mSunLightP : CONTROLOBJECT<string name="ray_controller.pmx"; string item = "SunLight+";>;
float mSunLightM : CONTROLOBJECT<string name="ray_controller.pmx"; string item = "SunLight-";>;
float mSunShadowRP : CONTROLOBJECT<string name="ray_controller.pmx"; string item = "SunShadowR+";>;
float mSunShadowGP : CONTROLOBJECT<string name="ray_controller.pmx"; string item = "SunShadowG+";>;
float mSunShadowBP : CONTROLOBJECT<string name="ray_controller.pmx"; string item = "SunShadowB+";>;
float mSunShadowVM : CONTROLOBJECT<string name="ray_controller.pmx"; string item = "SunShadowV-";>;
float mSSAOP : CONTROLOBJECT<string name="ray_controller.pmx"; string item = "SSAO+";>;
float mSSAOM : CONTROLOBJECT<string name="ray_controller.pmx"; string item = "SSAO-";>;
float mSSAORadiusP : CONTROLOBJECT<string name="ray_controller.pmx"; string item = "SSAORadius+";>;
float mSSAORadiusM : CONTROLOBJECT<string name="ray_controller.pmx"; string item = "SSAORadius-";>;
float mSSDOP : CONTROLOBJECT<string name="ray_controller.pmx"; string item = "SSDO+";>;
float mSSDOM : CONTROLOBJECT<string name="ray_controller.pmx"; string item = "SSDO-";>;
float mSSSSP : CONTROLOBJECT<string name="ray_controller.pmx"; string item = "SSSS+";>;
float mSSSSM : CONTROLOBJECT<string name="ray_controller.pmx"; string item = "SSSS-";>;
float mExposureP : CONTROLOBJECT<string name="ray_controller.pmx"; string item = "Exposure+";>;
float mExposureM : CONTROLOBJECT<string name="ray_controller.pmx"; string item = "Exposure-";>;
float mFstopP : CONTROLOBJECT<string name="ray_controller.pmx"; string item = "Fstop+";>;
float mFstopM : CONTROLOBJECT<string name="ray_controller.pmx"; string item = "Fstop-";>;
float mFocalLengthP : CONTROLOBJECT<string name="ray_controller.pmx"; string item = "FocalLength+";>;
float mFocalLengthM : CONTROLOBJECT<string name="ray_controller.pmx"; string item = "FocalLength-";>;
float mFocalDistanceP : CONTROLOBJECT<string name="ray_controller.pmx"; string item = "FocalDistance+";>;
float mFocalDistanceM : CONTROLOBJECT<string name="ray_controller.pmx"; string item = "FocalDistance-";>;
float mFocalRegionP : CONTROLOBJECT<string name="ray_controller.pmx"; string item = "FocalRegion+";>;
float mFocalRegionM : CONTROLOBJECT<string name="ray_controller.pmx"; string item = "FocalRegion-";>;
float mMeasureMode : CONTROLOBJECT<string name="ray_controller.pmx"; string item = "MeasureMode";>;
float mTestMode : CONTROLOBJECT<string name="ray_controller.pmx"; string item = "TestMode";>;
float mVignette : CONTROLOBJECT<string name="ray_controller.pmx"; string item = "Vignette";>;
float mDispersion : CONTROLOBJECT<string name="ray_controller.pmx"; string item = "Dispersion";>;
float mDispersionRadius : CONTROLOBJECT<string name="ray_controller.pmx"; string item = "DispersionRadius";>;
float mBloomThresholdP : CONTROLOBJECT<string name="ray_controller.pmx"; string item = "BloomThreshold";>;
float mBloomRadiusP : CONTROLOBJECT<string name="ray_controller.pmx"; string item = "BloomRadius+";>;
float mBloomRadiusM : CONTROLOBJECT<string name="ray_controller.pmx"; string item = "BloomRadius-";>;
float mBloomColorAllHP : CONTROLOBJECT<string name="ray_controller.pmx"; string item = "BloomColorAllH+";>;
float mBloomColorAllSP : CONTROLOBJECT<string name="ray_controller.pmx"; string item = "BloomColorAllS+";>;
float mBloomColorAllVP : CONTROLOBJECT<string name="ray_controller.pmx"; string item = "BloomColorAllV+";>;
float mBloomColorAllVM : CONTROLOBJECT<string name="ray_controller.pmx"; string item = "BloomColorAllV-";>;
float mBloomStarFade : CONTROLOBJECT<string name="ray_controller.pmx"; string item = "BloomStarFade";>;
float mContrastP : CONTROLOBJECT<string name="ray_controller.pmx"; string item = "Contrast+";>;
float mContrastM : CONTROLOBJECT<string name="ray_controller.pmx"; string item = "Contrast-";>;
float mSaturationP : CONTROLOBJECT<string name="ray_controller.pmx"; string item = "Saturation+";>;
float mSaturationM : CONTROLOBJECT<string name="ray_controller.pmx"; string item = "Saturation-";>;
float mGammaP : CONTROLOBJECT<string name="ray_controller.pmx"; string item = "Gamma+";>;
float mGammaM : CONTROLOBJECT<string name="ray_controller.pmx"; string item = "Gamma-";>;
float mColBalanceRP : CONTROLOBJECT<string name="ray_controller.pmx"; string item = "BalanceR+";>;
float mColBalanceGP : CONTROLOBJECT<string name="ray_controller.pmx"; string item = "BalanceG+";>;
float mColBalanceBP : CONTROLOBJECT<string name="ray_controller.pmx"; string item = "BalanceB+";>;
float mColBalanceRM : CONTROLOBJECT<string name="ray_controller.pmx"; string item = "BalanceR-";>;
float mColBalanceGM : CONTROLOBJECT<string name="ray_controller.pmx"; string item = "BalanceG-";>;
float mColBalanceBM : CONTROLOBJECT<string name="ray_controller.pmx"; string item = "BalanceB-";>;
float mTemperatureP : CONTROLOBJECT<string name="ray_controller.pmx"; string item = "Temperature+";>;
float mTemperatureM : CONTROLOBJECT<string name="ray_controller.pmx"; string item = "Temperature-";>;
static float mSSAOScale = lerp(lerp(mSSDOIntensityMin, mSSDOIntensityMax, mSSAOP), 0, mSSAOM);
static float mSSAORadius = lerp(lerp(1.0, 2.0, mSSAORadiusP), 0.5, mSSAORadiusM);
static float mSSDOScale = lerp(lerp(mSSDOIntensityMin, mSSDOIntensityMax, mSSDOP), 0, mSSDOM);
static float mSSSSScale = lerp(lerp(mSSSSIntensityMin, mSSSSIntensityMax, mSSSSP), 0.25, mSSSSM);
static float mSunIntensity = lerp(lerp(mLightIntensityMin, mLightIntensityMax, mSunLightP), 0, mSunLightM);
static float mExposure = lerp(lerp(mExposureMin, mExposureMax, mExposureP), 0, mExposureM);
static float mBloomRadius = lerp(lerp(2.2, 10, mBloomRadiusP), 0.1, mBloomRadiusM);
static float mBloomThreshold = (1.0 - mBloomThresholdP) / (mBloomThresholdP + 1e-5);
static float mColorContrast = lerp(lerp(1, 2, mContrastP), 0.5, mContrastM);
static float mColorSaturation = lerp(lerp(1, 2, mSaturationP), 0.0, mSaturationM);
static float mColorGamma = lerp(lerp(1.0, 0.45, mGammaP), 2.2, mGammaM);
static float mColorTemperature = lerp(lerp(mTemperature, 1000, mTemperatureP), 40000, mTemperatureM);
static float3 mColorShadowSunP = pow(float3(mSunShadowRP, mSunShadowGP, mSunShadowBP), 2);
static float3 mColorBalanceP = float3(mColBalanceRP, mColBalanceGP, mColBalanceBP);
static float3 mColorBalanceM = float3(mColBalanceRM, mColBalanceGM, mColBalanceBM);
#include "shader/math.fxsub"
#include "shader/common.fxsub"
#include "shader/textures.fxsub"
#include "shader/gbuffer.fxsub"
#include "shader/ibl.fxsub"
#include "shader/BRDF.fxsub"
#include "shader/ColorGrading.fxsub"
#include "shader/ShadingMaterials.fxsub"
#if SUN_SHADOW_QUALITY && SUN_LIGHT_ENABLE
# include "shader/ShadowMapCascaded.fxsub"
# include "shader/ShadowMap.fxsub"
#endif
#if SSDO_QUALITY && (IBL_QUALITY || SUN_LIGHT_ENABLE)
# include "shader/PostProcessOcclusion.fxsub"
#endif
#if SSSS_QUALITY
# include "shader/PostProcessScattering.fxsub"
#endif
#if OUTLINE_QUALITY == 2
# include "shader/EdgeLineAA.fxsub"
#endif
#if TOON_ENABLE == 2
# include "shader/PostProcessDiffusion.fxsub"
#endif
#if SSR_QUALITY
# include "shader/PostProcessSSR.fxsub"
#endif
#if BOKEH_QUALITY
# include "shader/PostProcessHexDOF.fxsub"
#endif
#if HDR_EYE_ADAPTATION
# include "shader/PostProcessEyeAdaptation.fxsub"
#endif
#if HDR_STAR_MODE
# include "shader/PostProcessLensflare.fxsub"
#endif
#if HDR_FLARE_MODE
# include "shader/PostProcessGhost.fxsub"
#endif
#if HDR_BLOOM_MODE
# include "shader/PostProcessBloom.fxsub"
#endif
#include "shader/PostProcessHDR.fxsub"
#if AA_QUALITY == 1
# include "shader/FXAA3.fxsub"
#endif
#if AA_QUALITY >= 2 && AA_QUALITY <= 5
# include "shader/SMAA.fxsub"
#endif
#if AA_QUALITY == 6
# include "shader/CameraMotion.fxsub"
#endif
#if AA_QUALITY == 6
# include "shader/TAA.fxsub"
#endif
float4 ScreenSpaceQuadVS(
in float4 Position : POSITION,
in float4 Texcoord : TEXCOORD,
out float4 oTexcoord0 : TEXCOORD0,
out float3 oTexcoord1 : TEXCOORD1) : POSITION
{
oTexcoord0 = Texcoord;
oTexcoord0.xy += ViewportOffset;
oTexcoord0.zw = oTexcoord0.xy * ViewportSize;
oTexcoord1 = -mul(Position, matProjectInverse).xyz;
return Position;
}
float4 ScreenSpaceQuadOffsetVS(
in float4 Position : POSITION,
in float2 Texcoord : TEXCOORD,
out float2 oTexcoord : TEXCOORD0,
uniform float2 offset) : POSITION
{
oTexcoord = Texcoord + offset * 0.5;
return Position;
}
float Script : STANDARDSGLOBAL<
string ScriptOutput = "color";
string ScriptClass = "scene";
string ScriptOrder = "postprocess";
> = 0.8;
technique DeferredLighting<
string Script =
"RenderColorTarget=ScnMap;"
"RenderDepthStencilTarget=DepthBuffer;"
"ClearSetColor=BackColor;"
"ClearSetDepth=ClearDepth;"
"ClearSetStencil=ClearStencil;"
"Clear=Color;"
"Clear=Depth;"
"ScriptExternal=Color;"
#if SUN_SHADOW_QUALITY && SUN_LIGHT_ENABLE
"RenderColorTarget=ShadowMap;"
"ClearSetColor=WhiteColor;"
"Clear=Color;"
"Pass=ShadowMapGen;"
"ClearSetColor=BackColor;"
#if SHADOW_BLUR_COUNT
"RenderColorTarget=ShadowMapTemp; Pass=ShadowBlurX;"
"RenderColorTarget=ShadowMap; Pass=ShadowBlurY;"
#endif
#endif
#if SSDO_QUALITY && (IBL_QUALITY || SUN_LIGHT_ENABLE)
"RenderColorTarget=SSDOMap; Pass=SSDO;"
#if SSDO_BLUR_RADIUS
"RenderColorTarget=SSDOMapTemp; Pass=SSDOBlurX;"
"RenderColorTarget=SSDOMap; Pass=SSDOBlurY;"
#endif
#endif
#if OUTLINE_QUALITY == 2
"RenderColorTarget=EdgeEdgeMap; Clear=Color; Pass=EdgeEdgeDetection;"
"RenderColorTarget=EdgeBlendMap; Clear=Color; Pass=EdgeBlendingWeightCalculation;"
"RenderColorTarget=OutlineTempMap; Pass=EdgeNeighborhoodBlending;"
#endif
#if SSSS_QUALITY
"RenderColorTarget0=ShadingMapTemp;"
"RenderColorTarget1=ShadingMapTempSpecular;"
"Pass=ShadingOpacity;"
"RenderColorTarget1=;"
"RenderDepthStencilTarget=DepthBuffer;"
"RenderColorTarget=;"
"Clear=Depth;"
"Pass=SSSSStencilTest;"
"RenderColorTarget=ShadingMap; Clear=Color; Pass=SSSSBlurX;"
"RenderColorTarget=ShadingMapTemp; Pass=SSSSBlurY;"
"RenderColorTarget=ShadingMapTemp; Pass=ShadingOpacityAlbedo;"
"RenderColorTarget=ShadingMapTemp; Pass=ShadingOpacitySpecular;"
"RenderColorTarget=ShadingMap; Pass=ShadingTransparent;"
#else
"RenderColorTarget=ShadingMapTemp; Pass=ShadingOpacity;"
"RenderColorTarget=ShadingMap; Pass=ShadingTransparent;"
#endif
#if TOON_ENABLE == 2
"RenderColorTarget=ShadingMapTemp; Pass=DiffusionBlurX;"
"RenderColorTarget=ShadingMap; Pass=DiffusionBlurY;"
#endif
#if SSR_QUALITY
"RenderColorTarget=SSRLightX1Map;"
"Clear=Color;"
"Pass=SSRConeTracing;"
"RenderColorTarget=SSRLightX1MapTemp; Pass=SSRGaussionBlurX1;"
"RenderColorTarget=SSRLightX1Map; Pass=SSRGaussionBlurY1;"
"RenderColorTarget=SSRLightX2MapTemp; Pass=SSRGaussionBlurX2;"
"RenderColorTarget=SSRLightX2Map; Pass=SSRGaussionBlurY2;"
"RenderColorTarget=SSRLightX3MapTemp; Pass=SSRGaussionBlurX3;"
"RenderColorTarget=SSRLightX3Map; Pass=SSRGaussionBlurY3;"
"RenderColorTarget=SSRLightX4MapTemp; Pass=SSRGaussionBlurX4;"
"RenderColorTarget=SSRLightX4Map; Pass=SSRGaussionBlurY4;"
"RenderColorTarget=ShadingMap; Pass=SSRFinalCombie;"
#endif
#if BOKEH_QUALITY
"RenderColorTarget0=AutoFocalMap; Pass=ComputeFocalDistance;"
"RenderColorTarget0=FocalBokehMap; Pass=ComputeDepthBokeh;"
"RenderColorTarget0=FocalBlur1Map;"
"RenderColorTarget1=FocalBlur2Map;"
"Clear=Color;"
"Pass=ComputeHexBlurFarX;"
"RenderColorTarget0=FocalBokehFarMap;"
"RenderColorTarget1=;"
"Clear=Color;"
"Pass=ComputeHexBlurFarY;"
"RenderColorTarget=FocalBokehTempMap; Pass=ComputeBokehFarGather;"
"RenderColorTarget=FocalBokehCoCNearMap; Pass=ComputeNearDown;"
"RenderColorTarget=FocalBokehTempMap; Clear=Color; Pass=ComputeSmoothingNearX;"
"RenderColorTarget=FocalBokehCoCNearMap; Clear=Color; Pass=ComputeSmoothingNearY;"
"RenderColorTarget=FocalBokehTempMap; Clear=Color; Pass=ComputeNearCoC;"
"RenderColorTarget=FocalBokehCoCNearMap; Clear=Color; Pass=ComputeNearSamllBlur;"
"RenderColorTarget=ShadingMap; Pass=ComputeBokehGatherFinal;"
#endif
#if HDR_EYE_ADAPTATION
"RenderColorTarget=EyeLumMap; Pass=EyeLum;"
"RenderColorTarget=EyeLumAveMap; Pass=EyeAdapation;"
#endif
#if HDR_BLOOM_MODE
"RenderColorTarget=DownsampleMap1st; Pass=GlareDetection;"
#if HDR_STAR_MODE || HDR_FLARE_MODE
"RenderColorTarget=DownsampleMap2nd; Pass=HDRDownsample2nd;"
#endif
"RenderColorTarget=BloomMap1stTemp; Pass=BloomBlurX1;"
"RenderColorTarget=BloomMap1st; Pass=BloomBlurY1;"
"RenderColorTarget=BloomMap2nd; Pass=BloomDownsampleX2;"
"RenderColorTarget=BloomMap2ndTemp; Pass=BloomBlurX2;"
"RenderColorTarget=BloomMap2nd; Pass=BloomBlurY2;"
"RenderColorTarget=BloomMap3rd; Pass=BloomDownsampleX3;"
"RenderColorTarget=BloomMap3rdTemp; Pass=BloomBlurX3;"
"RenderColorTarget=BloomMap3rd; Pass=BloomBlurY3;"
"RenderColorTarget=BloomMap4th; Pass=BloomDownsampleX4;"
"RenderColorTarget=BloomMap4thTemp; Pass=BloomBlurX4;"
"RenderColorTarget=BloomMap4th; Pass=BloomBlurY4;"
"RenderColorTarget=BloomMap5th; Pass=BloomDownsampleX5;"
"RenderColorTarget=BloomMap5thTemp; Pass=BloomBlurX5;"
"RenderColorTarget=BloomMap5th; Pass=BloomBlurY5;"
#if HDR_STAR_MODE == 1 || HDR_STAR_MODE == 2
"RenderColorTarget=StreakMap1stTemp; Pass=Star1stStreak1st;"
"RenderColorTarget=StreakMap1st; Pass=Star1stStreak2nd;"
"RenderColorTarget=StreakMap1stTemp; Pass=Star1stStreak3rd;"
"RenderColorTarget=StreakMap1st; Pass=Star1stStreak4th;"
"RenderColorTarget=StreakMap2ndTemp; Pass=Star2ndStreak1st;"
"RenderColorTarget=StreakMap2nd; Pass=Star2ndStreak2nd;"
"RenderColorTarget=StreakMap2ndTemp; Pass=Star2ndStreak3rd;"
"RenderColorTarget=StreakMap2nd; Pass=Star2ndStreak4th;"
#endif
#if HDR_STAR_MODE == 3 || HDR_STAR_MODE == 4
"RenderColorTarget=StreakMap1st; Pass=Star1stStreak1st;"
"RenderColorTarget=StreakMap1stTemp; Pass=Star1stStreak2nd;"
"RenderColorTarget=StreakMap1st; Pass=Star1stStreak3rd;"
"RenderColorTarget=StreakMap2nd; Pass=Star2ndStreak1st;"
"RenderColorTarget=StreakMap2ndTemp; Pass=Star2ndStreak2nd;"
"RenderColorTarget=StreakMap2nd; Pass=Star2ndStreak3rd;"
"RenderColorTarget=StreakMap3rd; Pass=Star3rdStreak1st;"
"RenderColorTarget=StreakMap3rdTemp; Pass=Star3rdStreak2nd;"
"RenderColorTarget=StreakMap3rd; Pass=Star3rdStreak3rd;"
"RenderColorTarget=StreakMap4th; Pass=Star4thStreak1st;"
"RenderColorTarget=StreakMap4thTemp; Pass=Star4thStreak2nd;"
"RenderColorTarget=StreakMap4th; Pass=Star4thStreak3rd;"
#endif
"RenderColorTarget=BloomMap1st; Pass=GlareLightComp;"
#if HDR_FLARE_MODE
"RenderColorTarget=BloomMap1stTemp; Pass=GhostImage1st;"
"RenderColorTarget=BloomMap1st; Pass=GhostImage2nd;"
#endif
#endif
#if AA_QUALITY == 0
"RenderColorTarget=;"
"RenderDepthStencilTarget=;"
"Pass=HDRTonemapping;"
#else
"RenderColorTarget=ShadingMapTemp;"
"Pass=HDRTonemapping;"
#endif
#if AA_QUALITY == 1
"RenderColorTarget=;"
"RenderDepthStencilTarget=;"
"Pass=FXAA;"
#endif
#if AA_QUALITY == 2 || AA_QUALITY == 3
"RenderColorTarget=SMAAEdgeMap; Clear=Color; Pass=SMAAEdgeDetection;"
"RenderColorTarget=SMAABlendMap; Clear=Color; Pass=SMAABlendingWeightCalculation;"
"RenderColorTarget=;"
"RenderDepthStencilTarget=;"
"Pass=SMAANeighborhoodBlending;"
#endif
#if AA_QUALITY == 4 || AA_QUALITY == 5
"RenderColorTarget=SMAAEdgeMap; Clear=Color; Pass=SMAAEdgeDetection1x;"
"RenderColorTarget=SMAABlendMap; Clear=Color; Pass=SMAABlendingWeightCalculation1x;"
"RenderColorTarget=ShadingMap; Pass=SMAANeighborhoodBlending;"
"RenderColorTarget=SMAAEdgeMap; Clear=Color; Pass=SMAAEdgeDetection2x;"
"RenderColorTarget=SMAABlendMap; Clear=Color; Pass=SMAABlendingWeightCalculation2x;"
"RenderColorTarget=;"
"RenderDepthStencilTarget=;"
"Pass=SMAANeighborhoodBlendingFinal;"
#endif
;>
{
#if SUN_LIGHT_ENABLE && SUN_SHADOW_QUALITY
pass ShadowMapGen<string Script= "Draw=Buffer;";>{
AlphaBlendEnable = false; AlphaTestEnable = false;
ZEnable = false; ZWriteEnable = false;
VertexShader = compile vs_3_0 ScreenSpaceQuadVS();
PixelShader = compile ps_3_0 ShadowMapGenPS();
}
#if SHADOW_BLUR_COUNT
pass ShadowBlurX<string Script= "Draw=Buffer;";>{
AlphaBlendEnable = false; AlphaTestEnable = false;
ZEnable = false; ZWriteEnable = false;
VertexShader = compile vs_3_0 ScreenSpaceQuadVS();
PixelShader = compile ps_3_0 ShadowMapBlurPS(ShadowMapSamp, float2(ViewportOffset2.x, 0.0f));
}
pass ShadowBlurY<string Script= "Draw=Buffer;";>{
AlphaBlendEnable = false; AlphaTestEnable = false;
ZEnable = false; ZWriteEnable = false;
VertexShader = compile vs_3_0 ScreenSpaceQuadVS();
PixelShader = compile ps_3_0 ShadowMapBlurPS(ShadowMapSampTemp, float2(0.0f, ViewportOffset2.y));
}
#endif
#endif
#if SSDO_QUALITY && (IBL_QUALITY || SUN_LIGHT_ENABLE)
pass SSDO<string Script= "Draw=Buffer;";>{
AlphaBlendEnable = false; AlphaTestEnable = false;
ZEnable = false; ZWriteEnable = false;
VertexShader = compile vs_3_0 ScreenSpaceDirOccPassVS();
PixelShader = compile ps_3_0 ScreenSpaceDirOccPassPS();
}
pass SSDOBlurX<string Script= "Draw=Buffer;";>{
AlphaBlendEnable = false; AlphaTestEnable = false;
ZEnable = false; ZWriteEnable = false;
VertexShader = compile vs_3_0 ScreenSpaceQuadVS();
PixelShader = compile ps_3_0 ScreenSpaceDirOccBlurPS(SSDOMapSamp, float2(ViewportOffset2.x, 0.0f));
}
pass SSDOBlurY<string Script= "Draw=Buffer;";>{
AlphaBlendEnable = false; AlphaTestEnable = false;
ZEnable = false; ZWriteEnable = false;
VertexShader = compile vs_3_0 ScreenSpaceQuadVS();
PixelShader = compile ps_3_0 ScreenSpaceDirOccBlurPS(SSDOMapSampTemp, float2(0.0f, ViewportOffset2.y));
}
#endif
pass ShadingOpacity<string Script= "Draw=Buffer;";>{
AlphaBlendEnable = false; AlphaTestEnable = false;
ZEnable = false; ZWriteEnable = false;
VertexShader = compile vs_3_0 ScreenSpaceQuadVS();
PixelShader = compile ps_3_0 ShadingOpacityPS();
}
pass ShadingTransparent<string Script= "Draw=Buffer;";>{
AlphaBlendEnable = false; AlphaTestEnable = false;
ZEnable = false; ZWriteEnable = false;
VertexShader = compile vs_3_0 ScreenSpaceQuadVS();
PixelShader = compile ps_3_0 ShadingTransparentPS();
}
#if SSSS_QUALITY
pass SSSSStencilTest<string Script= "Draw=Buffer;";>{
AlphaBlendEnable = false; AlphaTestEnable = false;
ZEnable = false; ZWriteEnable = false;
ColorWriteEnable = false;
StencilEnable = true;
StencilFunc = ALWAYS;
StencilRef = 1;
StencilPass = REPLACE;
StencilFail = KEEP;
StencilZFail = KEEP;
StencilWriteMask = 1;
VertexShader = compile vs_3_0 ScreenSpaceQuadVS();
PixelShader = compile ps_3_0 SSSSStencilTestPS();
}
pass SSSSBlurX<string Script= "Draw=Buffer;";>{
AlphaBlendEnable = false; AlphaTestEnable = false;
ZEnable = false; ZWriteEnable = false;
StencilEnable = true; StencilFunc = EQUAL; StencilRef = 1; StencilWriteMask = 0;
VertexShader = compile vs_3_0 SSSGaussBlurVS();
PixelShader = compile ps_3_0 SSSGaussBlurPS(ShadingMapTempPointSamp, ShadingMapTempPointSamp, float2(1.0, 0.0));
}
pass SSSSBlurY<string Script= "Draw=Buffer;";>{
AlphaBlendEnable = false; AlphaTestEnable = false;
ZEnable = false; ZWriteEnable = false;
StencilEnable = true; StencilFunc = EQUAL; StencilRef = 1; StencilWriteMask = 0;
VertexShader = compile vs_3_0 SSSGaussBlurVS();
PixelShader = compile ps_3_0 SSSGaussBlurPS(ShadingMapPointSamp, ShadingMapTempPointSamp,float2(0.0, 1.0));
}
pass ShadingOpacityAlbedo<string Script= "Draw=Buffer;";>{
AlphaBlendEnable = true; AlphaTestEnable = false;
ZEnable = false; ZWriteEnable = false;
SrcBlend = DESTCOLOR; DestBlend = ZERO;
VertexShader = compile vs_3_0 ScreenSpaceQuadVS();
PixelShader = compile ps_3_0 ShadingOpacityAlbedoPS();
}
pass ShadingOpacitySpecular<string Script= "Draw=Buffer;";>{
AlphaBlendEnable = true; AlphaTestEnable = false;
ZEnable = false; ZWriteEnable = false;
SrcBlend = ONE; DestBlend = ONE;
VertexShader = compile vs_3_0 ScreenSpaceQuadVS();
PixelShader = compile ps_3_0 ShadingOpacitySpecularPS();
}
#endif
#if OUTLINE_QUALITY == 2
pass EdgeEdgeDetection<string Script= "Draw=Buffer;";>{
AlphaBlendEnable = false; AlphaTestEnable = false;
ZEnable = false; ZWriteEnable = false;
VertexShader = compile vs_3_0 EdgeEdgeDetectionVS();
PixelShader = compile ps_3_0 EdgeLumaEdgeDetectionPS(OutlineMapSamp);
}
pass EdgeBlendingWeightCalculation<string Script= "Draw=Buffer;";>{
AlphaBlendEnable = false; AlphaTestEnable = false;
ZEnable = false; ZWriteEnable = false;
VertexShader = compile vs_3_0 EdgeBlendingWeightCalculationVS();
PixelShader = compile ps_3_0 EdgeBlendingWeightCalculationPS(0.0);
}
pass EdgeNeighborhoodBlending<string Script= "Draw=Buffer;";>{
AlphaBlendEnable = false; AlphaTestEnable = false;
ZEnable = false; ZWriteEnable = false;
VertexShader = compile vs_3_0 EdgeNeighborhoodBlendingVS();
PixelShader = compile ps_3_0 EdgeNeighborhoodBlendingPS(OutlineMapSamp, ViewportOffset2);
}
#endif
#if TOON_ENABLE == 2
pass DiffusionBlurX<string Script= "Draw=Buffer;";>{
AlphaBlendEnable = false; AlphaTestEnable = false;
ZEnable = false; ZWriteEnable = false;
VertexShader = compile vs_3_0 ScreenSpaceQuadVS();
PixelShader = compile ps_3_0 ScreenSpaceBilateralFilterPS(ShadingMapSamp, mDiffusionOffsetX);
}
pass DiffusionBlurY<string Script= "Draw=Buffer;";>{
AlphaBlendEnable = true; AlphaTestEnable = false;
ZEnable = false; ZWriteEnable = false;
SrcBlend = SRCALPHA; DestBlend = INVSRCALPHA;
VertexShader = compile vs_3_0 ScreenSpaceQuadVS();
PixelShader = compile ps_3_0 ScreenSpaceBilateralFilterPS(ShadingMapTempSamp, mDiffusionOffsetY);
}
#endif
#if SSR_QUALITY
pass SSRConeTracing<string Script= "Draw=Buffer;";>{
AlphaBlendEnable = false; AlphaTestEnable = false;
ZEnable = false; ZWriteEnable = false;
VertexShader = compile vs_3_0 ScreenSpaceQuadVS();
PixelShader = compile ps_3_0 SSRConeTracingPS();
}
pass SSRGaussionBlurX1<string Script= "Draw=Buffer;";>{
AlphaBlendEnable = false; AlphaTestEnable = false;
ZEnable = false; ZWriteEnable = false;
VertexShader = compile vs_3_0 ScreenSpaceQuadOffsetVS(ViewportOffset2);
PixelShader = compile ps_3_0 SSRGaussionBlurPS(SSRLightX1Samp, SSROffsetX1);
}
pass SSRGaussionBlurY1<string Script= "Draw=Buffer;";>{
AlphaBlendEnable = false; AlphaTestEnable = false;
ZEnable = false; ZWriteEnable = false;
VertexShader = compile vs_3_0 ScreenSpaceQuadOffsetVS(ViewportOffset2);
PixelShader = compile ps_3_0 SSRGaussionBlurPS(SSRLightX1SampTemp, SSROffsetY1);
}
pass SSRGaussionBlurX2<string Script= "Draw=Buffer;";>{
AlphaBlendEnable = false; AlphaTestEnable = false;
ZEnable = false; ZWriteEnable = false;
VertexShader = compile vs_3_0 ScreenSpaceQuadOffsetVS(ViewportOffset2);
PixelShader = compile ps_3_0 SSRGaussionBlurPS(SSRLightX1Samp, SSROffsetX2);
}
pass SSRGaussionBlurY2<string Script= "Draw=Buffer;";>{
AlphaBlendEnable = false; AlphaTestEnable = false;
ZEnable = false; ZWriteEnable = false;
VertexShader = compile vs_3_0 ScreenSpaceQuadOffsetVS(ViewportOffset2.x * 2);
PixelShader = compile ps_3_0 SSRGaussionBlurPS(SSRLightX2SampTemp, SSROffsetY2);
}
pass SSRGaussionBlurX3<string Script= "Draw=Buffer;";>{
AlphaBlendEnable = false; AlphaTestEnable = false;
ZEnable = false; ZWriteEnable = false;
VertexShader = compile vs_3_0 ScreenSpaceQuadOffsetVS(ViewportOffset2.x * 2);
PixelShader = compile ps_3_0 SSRGaussionBlurPS(SSRLightX2Samp, SSROffsetX3);
}
pass SSRGaussionBlurY3<string Script= "Draw=Buffer;";>{
AlphaBlendEnable = false; AlphaTestEnable = false;
ZEnable = false; ZWriteEnable = false;
VertexShader = compile vs_3_0 ScreenSpaceQuadOffsetVS(ViewportOffset2.x * 4);
PixelShader = compile ps_3_0 SSRGaussionBlurPS(SSRLightX3SampTemp, SSROffsetY3);
}
pass SSRGaussionBlurX4<string Script= "Draw=Buffer;";>{
AlphaBlendEnable = false; AlphaTestEnable = false;
ZEnable = false; ZWriteEnable = false;
VertexShader = compile vs_3_0 ScreenSpaceQuadOffsetVS(ViewportOffset2.x * 4);
PixelShader = compile ps_3_0 SSRGaussionBlurPS(SSRLightX3Samp, SSROffsetX4);
}
pass SSRGaussionBlurY4<string Script= "Draw=Buffer;";>{
AlphaBlendEnable = false; AlphaTestEnable = false;
ZEnable = false; ZWriteEnable = false;
VertexShader = compile vs_3_0 ScreenSpaceQuadOffsetVS(ViewportOffset2.x * 8);
PixelShader = compile ps_3_0 SSRGaussionBlurPS(SSRLightX4SampTemp, SSROffsetY4);
}
pass SSRFinalCombie<string Script= "Draw=Buffer;";>{
AlphaBlendEnable = true; AlphaTestEnable = false;
ZEnable = false; ZWriteEnable = false;
SrcBlend = ONE; DestBlend = INVSRCALPHA;
VertexShader = compile vs_3_0 ScreenSpaceQuadVS();
PixelShader = compile ps_3_0 SSRFinalCombiePS();
}
#endif
#if BOKEH_QUALITY
pass ComputeFocalDistance<string Script= "Draw=Buffer;";>{
AlphaBlendEnable = false; AlphaTestEnable = false;
ZEnable = false; ZWriteEnable = false;
VertexShader = compile vs_3_0 ScreenSpaceQuadVS();
PixelShader = compile ps_3_0 ComputeFocalDistancePS(ShadingMapPointSamp);
}
pass ComputeDepthBokeh<string Script= "Draw=Buffer;";>{
AlphaBlendEnable = false; AlphaTestEnable = false;
ZEnable = false; ZWriteEnable = false;
VertexShader = compile vs_3_0 ComputeDepthBokehVS();
PixelShader = compile ps_3_0 ComputeDepthBokeh4XPS(ShadingMapPointSamp);
}
pass ComputeHexBlurFarX<string Script= "Draw=Buffer;";>{
AlphaBlendEnable = false; AlphaTestEnable = false;
ZEnable = false; ZWriteEnable = false;
VertexShader = compile vs_3_0 ComputeHexBlurXVS();
PixelShader = compile ps_3_0 ComputeHexBlurXFarPS(FocalBokehMapPointSamp, FocalBokehMapSamp);
}
pass ComputeHexBlurFarY<string Script= "Draw=Buffer;";>{
AlphaBlendEnable = false; AlphaTestEnable = false;
ZEnable = false; ZWriteEnable = false;
VertexShader = compile vs_3_0 ComputeHexBlurYVS();
PixelShader = compile ps_3_0 ComputeHexBlurYFarPS(FocalBokehMapPointSamp, FocalBlur1MapSamp, FocalBlur2MapSamp);
}
pass ComputeBokehFarGather<string Script= "Draw=Buffer;";>{
AlphaBlendEnable = false; AlphaTestEnable = false;
ZEnable = false; ZWriteEnable = false;
VertexShader = compile vs_3_0 ComputeBokehGatherVS();
PixelShader = compile ps_3_0 ComputeBokehFarGatherPS(FocalBokehMapSamp, FocalBokehFarMapSamp);
}
pass ComputeNearDown<string Script= "Draw=Buffer;";>{
AlphaBlendEnable = false; AlphaTestEnable = false;
ZEnable = false; ZWriteEnable = false;
VertexShader = compile vs_3_0 ScreenSpaceQuadOffsetVS(1.0 / (ViewportSize * mFocalMapScale));
PixelShader = compile ps_3_0 ComputeNearDownPS(FocalBokehTempMapPointSamp, 1.0 / mFocalStepScale);
}
pass ComputeSmoothingNearX<string Script= "Draw=Buffer;";>{
AlphaBlendEnable = false; AlphaTestEnable = false;
ZEnable = false; ZWriteEnable = false;
VertexShader = compile vs_3_0 ScreenSpaceQuadOffsetVS(1.0 / (ViewportSize * mFocalMapScale));
PixelShader = compile ps_3_0 ComputeSmoothingNearPS(FocalBokehCoCNearMapSamp, float2(1.0 / mFocalStepScale.x, 0));
}
pass ComputeSmoothingNearY<string Script= "Draw=Buffer;";>{
AlphaBlendEnable = false; AlphaTestEnable = false;
ZEnable = false; ZWriteEnable = false;
VertexShader = compile vs_3_0 ScreenSpaceQuadOffsetVS(1.0 / (ViewportSize * mFocalMapScale));
PixelShader = compile ps_3_0 ComputeSmoothingNearPS(FocalBokehTempMapSamp, float2(0, 1.0 / mFocalStepScale.y));
}
pass ComputeNearCoC<string Script= "Draw=Buffer;";>{
AlphaBlendEnable = false; AlphaTestEnable = false;
ZEnable = false; ZWriteEnable = false;
VertexShader = compile vs_3_0 ScreenSpaceQuadOffsetVS(1.0 / (ViewportSize * mFocalMapScale));
PixelShader = compile ps_3_0 ComputeNearCoCPS(FocalBokehMapPointSamp, FocalBokehCoCNearMapSamp);
}
pass ComputeNearSamllBlur<string Script= "Draw=Buffer;";>{
AlphaBlendEnable = false; AlphaTestEnable = false;
ZEnable = false; ZWriteEnable = false;
VertexShader = compile vs_3_0 ScreenSpaceQuadOffsetVS(1.0 / (ViewportSize * mFocalMapScale));
PixelShader = compile ps_3_0 ComputeNearSamllBlurPS(FocalBokehTempMapSamp, float2(0, 1.0 / mFocalStepScale.y));
}
pass ComputeBokehGatherFinal<string Script= "Draw=Buffer;";>{
AlphaBlendEnable = true; AlphaTestEnable = false;
ZEnable = false; ZWriteEnable = false;
DestBlend = INVSRCALPHA; SrcBlend = SRCALPHA;
VertexShader = compile vs_3_0 ComputeBokehGatherVS();
PixelShader = compile ps_3_0 ComputeBokehGatherFinalPS(FocalBokehMapPointSamp, FocalBokehCoCNearMapSamp, 1.0 / mFocalStepScale);
}
#endif
#if HDR_EYE_ADAPTATION
pass EyeLum<string Script= "Draw=Buffer;";>{
AlphaBlendEnable = false; AlphaTestEnable = false;
ZEnable = false; ZWriteEnable = false;
VertexShader = compile vs_3_0 EyeDownsampleVS(ViewportOffset2);
PixelShader = compile ps_3_0 EyeDownsamplePS(ShadingMapPointSamp);
}
pass EyeAdapation<string Script= "Draw=Buffer;";>{
AlphaBlendEnable = false; AlphaTestEnable = false;
ZEnable = false; ZWriteEnable = false;
VertexShader = compile vs_3_0 ScreenSpaceQuadVS();
PixelShader = compile ps_3_0 EyeAdapationPS();
}
#endif
#if HDR_BLOOM_MODE
pass GlareDetection<string Script= "Draw=Buffer;";>{
AlphaBlendEnable = false; AlphaTestEnable = false;
ZEnable = false; ZWriteEnable = false;
VertexShader = compile vs_3_0 GlareDetectionVS();
PixelShader = compile ps_3_0 GlareDetectionPS(ShadingMapPointSamp);
}
#if HDR_STAR_MODE || HDR_FLARE_MODE
pass HDRDownsample2nd<string Script= "Draw=Buffer;";>{
AlphaBlendEnable = false; AlphaTestEnable = false;
ZEnable = false; ZWriteEnable = false;
VertexShader = compile vs_3_0 HDRDownsampleVS(ViewportOffset2 * 2);
PixelShader = compile ps_3_0 HDRDownsample4XPS(DownsampleSamp1st);
}
#endif
pass BloomBlurX1<string Script= "Draw=Buffer;";>{
AlphaBlendEnable = false; AlphaTestEnable = false;
ZEnable = false; ZWriteEnable = false;
VertexShader = compile vs_3_0 ScreenSpaceQuadOffsetVS(BloomOffset1);
PixelShader = compile ps_3_0 BloomBlurPS(DownsampleSamp1st, BloomOffsetX1);
}
pass BloomBlurY1<string Script= "Draw=Buffer;";>{
AlphaBlendEnable = false; AlphaTestEnable = false;
ZEnable = false; ZWriteEnable = false;
VertexShader = compile vs_3_0 ScreenSpaceQuadOffsetVS(BloomOffset1);
PixelShader = compile ps_3_0 BloomBlurPS(BloomSamp1stTemp, BloomOffsetY1);
}
pass BloomDownsampleX2<string Script= "Draw=Buffer;";>{
AlphaBlendEnable = false; AlphaTestEnable = false;
ZEnable = false; ZWriteEnable = false;
VertexShader = compile vs_3_0 HDRDownsampleVS(BloomOffset1);
PixelShader = compile ps_3_0 HDRDownsamplePS(BloomSamp1st);
}
pass BloomBlurX2<string Script= "Draw=Buffer;";>{
AlphaBlendEnable = false; AlphaTestEnable = false;
ZEnable = false; ZWriteEnable = false;
VertexShader = compile vs_3_0 ScreenSpaceQuadOffsetVS(BloomOffset2);
PixelShader = compile ps_3_0 BloomBlurPS(BloomSamp2nd, BloomOffsetX2);
}
pass BloomBlurY2<string Script= "Draw=Buffer;";>{
AlphaBlendEnable = false; AlphaTestEnable = false;
ZEnable = false; ZWriteEnable = false;
VertexShader = compile vs_3_0 ScreenSpaceQuadOffsetVS(BloomOffset2);
PixelShader = compile ps_3_0 BloomBlurPS(BloomSamp2ndTemp, BloomOffsetY2);
}
pass BloomDownsampleX3<string Script= "Draw=Buffer;";>{
AlphaBlendEnable = false; AlphaTestEnable = false;
ZEnable = false; ZWriteEnable = false;
VertexShader = compile vs_3_0 HDRDownsampleVS(BloomOffset2);
PixelShader = compile ps_3_0 HDRDownsamplePS(BloomSamp2nd);
}
pass BloomBlurX3<string Script= "Draw=Buffer;";>{
AlphaBlendEnable = false; AlphaTestEnable = false;
ZEnable = false; ZWriteEnable = false;
VertexShader = compile vs_3_0 ScreenSpaceQuadOffsetVS(BloomOffset3);
PixelShader = compile ps_3_0 BloomBlurPS(BloomSamp3rd, BloomOffsetX3);
}
pass BloomBlurY3<string Script= "Draw=Buffer;";>{
AlphaBlendEnable = false; AlphaTestEnable = false;
ZEnable = false; ZWriteEnable = false;
VertexShader = compile vs_3_0 ScreenSpaceQuadOffsetVS(BloomOffset3);
PixelShader = compile ps_3_0 BloomBlurPS(BloomSamp3rdTemp, BloomOffsetY3);
}
pass BloomDownsampleX4<string Script= "Draw=Buffer;";>{
AlphaBlendEnable = false; AlphaTestEnable = false;
ZEnable = false; ZWriteEnable = false;
VertexShader = compile vs_3_0 HDRDownsampleVS(BloomOffset3);
PixelShader = compile ps_3_0 HDRDownsamplePS(BloomSamp3rd);
}
pass BloomBlurX4<string Script= "Draw=Buffer;";>{
AlphaBlendEnable = false; AlphaTestEnable = false;
ZEnable = false; ZWriteEnable = false;
VertexShader = compile vs_3_0 ScreenSpaceQuadOffsetVS(BloomOffset4);
PixelShader = compile ps_3_0 BloomBlurPS(BloomSamp4th, BloomOffsetX4);
}
pass BloomBlurY4<string Script= "Draw=Buffer;";>{
AlphaBlendEnable = false; AlphaTestEnable = false;
ZEnable = false; ZWriteEnable = false;
VertexShader = compile vs_3_0 ScreenSpaceQuadOffsetVS(BloomOffset4);
PixelShader = compile ps_3_0 BloomBlurPS(BloomSamp4thTemp, BloomOffsetY4);
}
pass BloomDownsampleX5<string Script= "Draw=Buffer;";>{
AlphaBlendEnable = false; AlphaTestEnable = false;
ZEnable = false; ZWriteEnable = false;
VertexShader = compile vs_3_0 HDRDownsampleVS(BloomOffset4);
PixelShader = compile ps_3_0 HDRDownsamplePS(BloomSamp4th);
}
pass BloomBlurX5<string Script= "Draw=Buffer;";>{
AlphaBlendEnable = false; AlphaTestEnable = false;
ZEnable = false; ZWriteEnable = false;
VertexShader = compile vs_3_0 ScreenSpaceQuadOffsetVS(BloomOffset5);
PixelShader = compile ps_3_0 BloomBlurPS(BloomSamp5th, BloomOffsetX5);
}
pass BloomBlurY5<string Script= "Draw=Buffer;";>{
AlphaBlendEnable = false; AlphaTestEnable = false;
ZEnable = false; ZWriteEnable = false;
VertexShader = compile vs_3_0 ScreenSpaceQuadOffsetVS(BloomOffset5);
PixelShader = compile ps_3_0 BloomBlurPS(BloomSamp5thTemp, BloomOffsetY5);
}
#if HDR_STAR_MODE == 1 || HDR_STAR_MODE == 2
pass Star1stStreak1st<string Script= "Draw=Buffer;";>{
AlphaBlendEnable = false; AlphaTestEnable = false;
ZEnable = false; ZWriteEnable = false;
VertexShader = compile vs_3_0 StarStreakVS(float2(0.9, 0), 1);
PixelShader = compile ps_3_0 StarStreakPS(DownsampleSamp2nd, star_colorCoeff1st, mBloomStarFade);
}
pass Star1stStreak2nd<string Script= "Draw=Buffer;";>{
AlphaBlendEnable = false; AlphaTestEnable = false;
ZEnable = false; ZWriteEnable = false;
VertexShader = compile vs_3_0 StarStreakVS(float2(0.9, 0), 4);
PixelShader = compile ps_3_0 StarStreakPS(StreakSamp1stTemp, star_colorCoeff2nd, 0);
}
pass Star1stStreak3rd<string Script= "Draw=Buffer;";>{
AlphaBlendEnable = false; AlphaTestEnable = false;
ZEnable = false; ZWriteEnable = false;
VertexShader = compile vs_3_0 StarStreakVS(float2(0.9, 0), 16);
PixelShader = compile ps_3_0 StarStreakPS(StreakSamp1st, star_colorCoeff3rd, 0);
}
pass Star1stStreak4th<string Script= "Draw=Buffer;";>{
AlphaBlendEnable = false; AlphaTestEnable = false;
ZEnable = false; ZWriteEnable = false;
VertexShader = compile vs_3_0 StarStreakVS(float2(0.9, 0), 64);
PixelShader = compile ps_3_0 StarStreakPS(StreakSamp1stTemp, star_colorCoeff4th, 0);
}
pass Star2ndStreak1st<string Script= "Draw=Buffer;";>{
AlphaBlendEnable = false; AlphaTestEnable = false;
ZEnable = false; ZWriteEnable = false;
VertexShader = compile vs_3_0 StarStreakVS(float2(-0.9, 0), 1);
PixelShader = compile ps_3_0 StarStreakPS(DownsampleSamp2nd, star_colorCoeff1st, mBloomStarFade);
}
pass Star2ndStreak2nd<string Script= "Draw=Buffer;";>{
AlphaBlendEnable = false; AlphaTestEnable = false;
ZEnable = false; ZWriteEnable = false;
VertexShader = compile vs_3_0 StarStreakVS(float2(-0.9, 0), 4);
PixelShader = compile ps_3_0 StarStreakPS(StreakSamp2ndTemp, star_colorCoeff2nd, 0);
}
pass Star2ndStreak3rd<string Script= "Draw=Buffer;";>{
AlphaBlendEnable = false; AlphaTestEnable = false;
ZEnable = false; ZWriteEnable = false;
VertexShader = compile vs_3_0 StarStreakVS(float2(-0.9, 0), 16);
PixelShader = compile ps_3_0 StarStreakPS(StreakSamp2nd, star_colorCoeff3rd, 0);
}
pass Star2ndStreak4th<string Script= "Draw=Buffer;";>{
AlphaBlendEnable = false; AlphaTestEnable = false;
ZEnable = false; ZWriteEnable = false;
VertexShader = compile vs_3_0 StarStreakVS(float2(-0.9, 0), 64);
PixelShader = compile ps_3_0 StarStreakPS(StreakSamp2ndTemp, star_colorCoeff4th, 0);
}
#endif
#if HDR_STAR_MODE == 3 || HDR_STAR_MODE == 4
pass Star1stStreak1st<string Script= "Draw=Buffer;";>{
AlphaBlendEnable = false; AlphaTestEnable = false;
ZEnable = false; ZWriteEnable = false;
VertexShader = compile vs_3_0 StarStreakVS(float2(0.9, 0.9), 1);
PixelShader = compile ps_3_0 StarStreakPS(DownsampleSamp2nd, star_colorCoeff1st, mBloomStarFade);
}
pass Star1stStreak2nd<string Script= "Draw=Buffer;";>{
AlphaBlendEnable = false; AlphaTestEnable = false;
ZEnable = false; ZWriteEnable = false;
VertexShader = compile vs_3_0 StarStreakVS(float2(0.9, 0.9), 4);
PixelShader = compile ps_3_0 StarStreakPS(StreakSamp1st, star_colorCoeff2nd, 0);
}
pass Star1stStreak3rd<string Script= "Draw=Buffer;";>{
AlphaBlendEnable = false; AlphaTestEnable = false;
ZEnable = false; ZWriteEnable = false;
VertexShader = compile vs_3_0 StarStreakVS(float2(0.9, 0.9), 16);
PixelShader = compile ps_3_0 StarStreakPS(StreakSamp1stTemp, star_colorCoeff3rd, 0);
}
pass Star2ndStreak1st<string Script= "Draw=Buffer;";>{
AlphaBlendEnable = false; AlphaTestEnable = false;
ZEnable = false; ZWriteEnable = false;
VertexShader = compile vs_3_0 StarStreakVS(float2(-0.9, 0.9), 1);
PixelShader = compile ps_3_0 StarStreakPS(DownsampleSamp2nd, star_colorCoeff1st, mBloomStarFade);
}
pass Star2ndStreak2nd<string Script= "Draw=Buffer;";>{
AlphaBlendEnable = false; AlphaTestEnable = false;
ZEnable = false; ZWriteEnable = false;
VertexShader = compile vs_3_0 StarStreakVS(float2(-0.9, 0.9), 4);
PixelShader = compile ps_3_0 StarStreakPS(StreakSamp2nd, star_colorCoeff2nd, 0);
}
pass Star2ndStreak3rd<string Script= "Draw=Buffer;";>{
AlphaBlendEnable = false; AlphaTestEnable = false;
ZEnable = false; ZWriteEnable = false;
VertexShader = compile vs_3_0 StarStreakVS(float2(-0.9, 0.9), 16);
PixelShader = compile ps_3_0 StarStreakPS(StreakSamp2ndTemp, star_colorCoeff3rd, 0);
}
pass Star3rdStreak1st<string Script= "Draw=Buffer;";>{
AlphaBlendEnable = false; AlphaTestEnable = false;
ZEnable = false; ZWriteEnable = false;
VertexShader = compile vs_3_0 StarStreakVS(float2(0.9, -0.9), 1);
PixelShader = compile ps_3_0 StarStreakPS(DownsampleSamp2nd, star_colorCoeff1st, mBloomStarFade);
}
pass Star3rdStreak2nd<string Script= "Draw=Buffer;";>{
AlphaBlendEnable = false; AlphaTestEnable = false;
ZEnable = false; ZWriteEnable = false;
VertexShader = compile vs_3_0 StarStreakVS(float2(0.9, -0.9), 4);
PixelShader = compile ps_3_0 StarStreakPS(StreakSamp3rd, star_colorCoeff2nd, 0);
}
pass Star3rdStreak3rd<string Script= "Draw=Buffer;";>{
AlphaBlendEnable = false; AlphaTestEnable = false;
ZEnable = false; ZWriteEnable = false;
VertexShader = compile vs_3_0 StarStreakVS(float2(0.9, -0.9), 16);
PixelShader = compile ps_3_0 StarStreakPS(StreakSamp3rdTemp, star_colorCoeff3rd, 0);
}
pass Star4thStreak1st<string Script= "Draw=Buffer;";>{
AlphaBlendEnable = false; AlphaTestEnable = false;
ZEnable = false; ZWriteEnable = false;
VertexShader = compile vs_3_0 StarStreakVS(float2(-0.9, -0.9), 1);
PixelShader = compile ps_3_0 StarStreakPS(DownsampleSamp2nd, star_colorCoeff1st, mBloomStarFade);
}
pass Star4thStreak2nd<string Script= "Draw=Buffer;";>{
AlphaBlendEnable = false; AlphaTestEnable = false;
ZEnable = false; ZWriteEnable = false;
VertexShader = compile vs_3_0 StarStreakVS(float2(-0.9, -0.9), 4);
PixelShader = compile ps_3_0 StarStreakPS(StreakSamp4th, star_colorCoeff2nd, 0);
}
pass Star4thStreak3rd<string Script= "Draw=Buffer;";>{
AlphaBlendEnable = false; AlphaTestEnable = false;
ZEnable = false; ZWriteEnable = false;
VertexShader = compile vs_3_0 StarStreakVS(float2(-0.9, -0.9), 16);
PixelShader = compile ps_3_0 StarStreakPS(StreakSamp4thTemp, star_colorCoeff3rd, 0);
}
#endif
#if HDR_FLARE_MODE
pass GhostImage1st<string Script= "Draw=Buffer;";>{
AlphaBlendEnable = false; AlphaTestEnable = false;
ZEnable = false; ZWriteEnable = false;
VertexShader = compile vs_3_0 GhostImageVS(ghost_scalar1st);
PixelShader = compile ps_3_0 GhostImagePS(DownsampleSamp2nd, BloomSamp2nd, BloomSamp2nd, ghost_modulation1st, mBloomStarFade);
}
pass GhostImage2nd<string Script= "Draw=Buffer;";>{
AlphaBlendEnable = true; AlphaTestEnable = false;
ZEnable = false; ZWriteEnable = false;
SrcBlend = ONE; DestBlend = ONE;
VertexShader = compile vs_3_0 GhostImageVS(ghost_scalar2nd);
PixelShader = compile ps_3_0 GhostImagePS(BloomSamp1stTemp, BloomSamp1stTemp, BloomSamp2nd, ghost_modulation2nd, 0);
}
#endif
pass GlareLightComp<string Script= "Draw=Buffer;";>{
AlphaBlendEnable = true; AlphaTestEnable = false;
ZEnable = false; ZWriteEnable = false;
SrcBlend = ONE; DestBlend = SRCALPHA;
VertexShader = compile vs_3_0 GlareLightCompVS();
PixelShader = compile ps_3_0 GlareLightCompPS();
}
#endif
pass HDRTonemapping<string Script= "Draw=Buffer;";>{
AlphaBlendEnable = false; AlphaTestEnable = false;
ZEnable = false; ZWriteEnable = false;
VertexShader = compile vs_3_0 HDRTonemappingVS();
PixelShader = compile ps_3_0 HDRTonemappingPS(ShadingMapPointSamp);
}
#if AA_QUALITY == 1
pass FXAA<string Script= "Draw=Buffer;";>{
AlphaBlendEnable = false; AlphaTestEnable = false;
ZEnable = false; ZWriteEnable = false;
VertexShader = compile vs_3_0 ScreenSpaceQuadVS();
PixelShader = compile ps_3_0 FXAA3(ShadingMapTempSamp, ViewportOffset2);
}
#endif
#if AA_QUALITY == 2 || AA_QUALITY == 3
pass SMAAEdgeDetection<string Script= "Draw=Buffer;";>{
AlphaBlendEnable = false; AlphaTestEnable = false;
ZEnable = false; ZWriteEnable = false;
VertexShader = compile vs_3_0 SMAAEdgeDetectionVS();
PixelShader = compile ps_3_0 SMAALumaEdgeDetectionPS(ShadingMapTempSamp);
}
pass SMAABlendingWeightCalculation<string Script= "Draw=Buffer;";>{
AlphaBlendEnable = false; AlphaTestEnable = false;
ZEnable = false; ZWriteEnable = false;
VertexShader = compile vs_3_0 SMAABlendingWeightCalculationVS();
PixelShader = compile ps_3_0 SMAABlendingWeightCalculationPS(0.0);
}
pass SMAANeighborhoodBlending<string Script= "Draw=Buffer;";>{
AlphaBlendEnable = false; AlphaTestEnable = false;
ZEnable = false; ZWriteEnable = false;
VertexShader = compile vs_3_0 SMAANeighborhoodBlendingVS();
PixelShader = compile ps_3_0 SMAANeighborhoodBlendingPS(ShadingMapTempSamp, true);
}
#endif
#if AA_QUALITY == 4 || AA_QUALITY == 5
pass SMAAEdgeDetection1x<string Script= "Draw=Buffer;";>{
AlphaBlendEnable = false; AlphaTestEnable = false;
ZEnable = false; ZWriteEnable = false;
VertexShader = compile vs_3_0 SMAAEdgeDetectionVS();
PixelShader = compile ps_3_0 SMAALumaEdgeDetectionPS(ShadingMapTempSamp);
}
pass SMAABlendingWeightCalculation1x<string Script= "Draw=Buffer;";>{
AlphaBlendEnable = false; AlphaTestEnable = false;
ZEnable = false; ZWriteEnable = false;
VertexShader = compile vs_3_0 SMAABlendingWeightCalculationVS();
PixelShader = compile ps_3_0 SMAABlendingWeightCalculationPS(float4(1, 1, 1, 0));
}
pass SMAANeighborhoodBlending<string Script= "Draw=Buffer;";>{
AlphaBlendEnable = false; AlphaTestEnable = false;
ZEnable = false; ZWriteEnable = false;
VertexShader = compile vs_3_0 SMAANeighborhoodBlendingVS();
PixelShader = compile ps_3_0 SMAANeighborhoodBlendingPS(ShadingMapTempSamp, false);
}
pass SMAAEdgeDetection2x<string Script= "Draw=Buffer;";>{
AlphaBlendEnable = false; AlphaTestEnable = false;
ZEnable = false; ZWriteEnable = false;
VertexShader = compile vs_3_0 SMAAEdgeDetectionVS();
PixelShader = compile ps_3_0 SMAALumaEdgeDetectionPS(ShadingMapSamp);
}
pass SMAABlendingWeightCalculation2x<string Script= "Draw=Buffer;";>{
AlphaBlendEnable = false; AlphaTestEnable = false;
ZEnable = false; ZWriteEnable = false;
VertexShader = compile vs_3_0 SMAABlendingWeightCalculationVS();
PixelShader = compile ps_3_0 SMAABlendingWeightCalculationPS(float4(2, 2, 2, 0));
}
pass SMAANeighborhoodBlendingFinal<string Script= "Draw=Buffer;";>{
AlphaBlendEnable = false; AlphaTestEnable = false;
ZEnable = false; ZWriteEnable = false;
VertexShader = compile vs_3_0 SMAANeighborhoodBlendingVS();
PixelShader = compile ps_3_0 SMAANeighborhoodBlendingPS(ShadingMapSamp, true);
}
#endif
}