Dayz Explorer 1.28.160049
Loading...
Searching...
No Matches
ppercameranv.c
Go to the documentation of this file.
1class PPERequester_CameraNV extends PPERequester_GameplayBase
2{
3 static const int NV_NO_BATTERY= 0; //darkness
4 static const int NV_DEFAULT_OPTICS = 1;
5 static const int NV_DEFAULT_GLASSES = 2;
6 static const int NV_PUMPKIN = 3;
7 static const int NV_TRANSITIVE = 4; //resets EV during camera transitions
8 static const int NV_DAYTIME_OPTICS = 5;
9
10 protected int m_CurrentMode;
11 protected float m_UGExposureCoef = 1.0;
12
13 protected void SetNVMode(int mode)
14 {
15 SetTargetValueFloat(PPEExceptions.EYEACCOM,PPEEyeAccomodationNative.PARAM_INTENSITY,false,1.0,PPEEyeAccomodationNative.L_0_NVG_GENERIC,PPOperators.SET);
16
17 switch (mode)
18 {
19 case NV_NO_BATTERY: //battery off
20 SetTargetValueColor(PostProcessEffectType.Glow,PPEGlow.PARAM_COLORIZATIONCOLOR,{0.0,0.0,0.0,0.0},PPEGlow.L_23_NVG,PPOperators.MULTIPLICATIVE);
26 break;
27
28 case NV_DEFAULT_OPTICS: //NV optic on
29 SetTargetValueColor(PostProcessEffectType.Glow,PPEGlow.PARAM_COLORIZATIONCOLOR,{0.0,1.0,0.0,0.0},PPEGlow.L_23_NVG,PPOperators.MULTIPLICATIVE);
30 SetTargetValueFloat(PPEExceptions.EXPOSURE,PPEExposureNative.PARAM_INTENSITY,false,7.0 * m_UGExposureCoef,PPEExposureNative.L_0_NVG_OPTIC,PPOperators.ADD);
31 SetTargetValueFloat(PostProcessEffectType.FilmGrain,PPEFilmGrain.PARAM_SHARPNESS,false,9.0,PPEFilmGrain.L_1_NVG,PPOperators.SET);
32 SetTargetValueFloat(PostProcessEffectType.FilmGrain,PPEFilmGrain.PARAM_GRAINSIZE,false,1.0,PPEFilmGrain.L_2_NVG,PPOperators.SET);
35 break;
36
37 case NV_DAYTIME_OPTICS: //NV optic in daytime mode
38 SetTargetValueColor(PostProcessEffectType.Glow,PPEGlow.PARAM_COLORIZATIONCOLOR,{0.0,1.0,0.0,0.0},PPEGlow.L_23_NVG,PPOperators.MULTIPLICATIVE);
39 SetTargetValueFloat(PPEExceptions.EXPOSURE,PPEExposureNative.PARAM_INTENSITY,false,2.0 * m_UGExposureCoef,PPEExposureNative.L_0_NVG_OPTIC,PPOperators.ADD);
40 SetTargetValueFloat(PostProcessEffectType.FilmGrain,PPEFilmGrain.PARAM_SHARPNESS,false,9.0,PPEFilmGrain.L_1_NVG,PPOperators.SET);
41 SetTargetValueFloat(PostProcessEffectType.FilmGrain,PPEFilmGrain.PARAM_GRAINSIZE,false,1.0,PPEFilmGrain.L_2_NVG,PPOperators.SET);
44 break;
45
46 case NV_DEFAULT_GLASSES: //goggles on
47 SetTargetValueColor(PostProcessEffectType.Glow,PPEGlow.PARAM_COLORIZATIONCOLOR,{0.0,1.0,0.0,0.0},PPEGlow.L_23_NVG,PPOperators.MULTIPLICATIVE);
48 SetTargetValueFloat(PPEExceptions.EXPOSURE,PPEExposureNative.PARAM_INTENSITY,false,7.0 * m_UGExposureCoef,PPEExposureNative.L_0_NVG_GOGGLES,PPOperators.ADD);
49 SetTargetValueFloat(PostProcessEffectType.FilmGrain,PPEFilmGrain.PARAM_SHARPNESS,false,10.0,PPEFilmGrain.L_1_NVG,PPOperators.SET);
50 SetTargetValueFloat(PostProcessEffectType.FilmGrain,PPEFilmGrain.PARAM_GRAINSIZE,false,1.0,PPEFilmGrain.L_2_NVG,PPOperators.SET);
53 break;
54
55 case NV_PUMPKIN: //pumpkin-o-vision
56 SetTargetValueColor(PostProcessEffectType.Glow,PPEGlow.PARAM_COLORIZATIONCOLOR,{1.0,0.2,0.0,0.0},PPEGlow.L_23_NVG,PPOperators.MULTIPLICATIVE);
57 SetTargetValueFloat(PPEExceptions.EXPOSURE,PPEExposureNative.PARAM_INTENSITY,false,5.5 * m_UGExposureCoef,PPEExposureNative.L_0_NVG_GOGGLES,PPOperators.ADD);
62 break;
63
64 case NV_TRANSITIVE: //camera transition
65 //SetTargetValueFloat(PPEExceptions.EXPOSURE,PPEExposureNative.PARAM_INTENSITY,false,0,PPEExposureNative.L_0_NVG_OFF,PPOperators.SET);
67 break;
68 }
69
70 m_CurrentMode = mode;
71 }
72
73 override protected void OnStart(Param par = null)
74 {
75 super.OnStart();
76
77 SetNVMode(Param1<int>.Cast(par).param1);
78 }
79
80 //other values reset automatically on stop
81 override protected void OnStop(Param par = null)
82 {
83 super.OnStop(par);
84 }
85
87 {
88 m_UGExposureCoef = coef;
89
90 if (m_IsRunning)
91 SetNVMode(m_CurrentMode); //TODO: improve (oof...)
92 }
93}
EV postprocess, does not directly use materials.
Eye Accomodation postprocess, does not directly use materials.
FilmGrain - PostProcessEffectType.FilmGrain.
Definition ppefilmgrain.c:7
Glow - PostProcessEffectType.Glow.
Definition ppeglow.c:8
g_Game.NightVissionLightParams, does not directly use materials. Controls light multiplication and fi...
base, not to be used directly, would lead to layering collisions!
void SetUndergroundExposureCoef(float coef)
void OnStart(Param par=null)
void OnStop(Param par=null)
Base Param Class with no parameters. Used as general purpose parameter overloaded with Param1 to Para...
Definition param.c:12
PostProcessEffectType
Post-process effect type.
Definition enworld.c:72
int m_CurrentMode
PPOperators
PP operators, specify operation between subsequent layers.
PPEExceptions
bool m_IsRunning
void SetTargetValueFloatDefault(int mat_id, int param_idx)
void SetTargetValueFloat(int mat_id, int param_idx, bool relative, float val, int priority_layer, int operator=PPOperators.ADD_RELATIVE)
void SetTargetValueColor(int mat_id, int param_idx, array< float > val, int priority_layer, int operator=PPOperators.ADD_RELATIVE)