DayZ 1.30
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено
PPERCameraNV.c
См. документацию.
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 // ---- New OPTICS condition variants -----------------------------------------
11 static const int NV_UNDERGROUND_OPTICS = 6;
12 static const int NV_SANDSTORM_OPTICS = 7;
13 static const int NV_UNDERGROUND_SANDSTORM_OPTICS = 8;
14
15 // ---- New GLASSES condition variants ----------------------------------------
16 static const int NV_DAYTIME_GLASSES = 9;
17 static const int NV_UNDERGROUND_GLASSES = 10;
18 static const int NV_SANDSTORM_GLASSES = 11;
19 static const int NV_UNDERGROUND_SANDSTORM_GLASSES = 12;
20
21 // ---- New PUMPKIN condition variants ----------------------------------------
22 static const int NV_DAYTIME_PUMPKIN = 13;
23 static const int NV_UNDERGROUND_PUMPKIN = 14;
24 static const int NV_SANDSTORM_PUMPKIN = 15;
25 static const int NV_UNDERGROUND_SANDSTORM_PUMPKIN = 16;
26 // ----------------------------------------------------------------------------
27
28 // ---- Exposure safety tuning ------------------------------------------------
29 // Hard cap for the additive exposure so no mode can blow out the frame
30 // (the "solid green screen" underground-during-daytime-sandstorm bug).
31 protected const float NV_EXPOSURE_MAX = 7.0;
32 // ----------------------------------------------------------------------------
33
34 protected int m_CurrentMode;
35 protected float m_UGExposureCoef = 1.0;
36
37 // Scales the requested additive exposure by the underground coefficient and clamps
38 // the result so it can never saturate the frame, regardless of m_UGExposureCoef.
39 protected float ComputeSafeExposure(float baseExposure)
40 {
41 float exposure = baseExposure * m_UGExposureCoef;
42 return Math.Clamp(exposure, 0.0, NV_EXPOSURE_MAX);
43 }
44
45 // Shared filmgrain + light setup for the OPTICS family, parameterised by exposure/noise.
55
56 // Shared filmgrain + light setup for the GLASSES family.
66
67 // Shared setup for the PUMPKIN family (orange colorization, no filmgrain).
77
78 protected void SetNVMode(int mode)
79 {
81
82 switch (mode)
83 {
84 case NV_NO_BATTERY: //battery off
91 break;
92
93 // ============================ OPTICS ============================
94 case NV_DEFAULT_OPTICS: ApplyOpticsProfile(7.0, 2.0); break; //night, surface
95 case NV_DAYTIME_OPTICS: ApplyOpticsProfile(2.0, 1.0); break; //daytime, surface
96 case NV_UNDERGROUND_OPTICS: ApplyOpticsProfile(7.0, 2.0); break; //enclosed/dark, daytime/nighttime
97 case NV_SANDSTORM_OPTICS: ApplyOpticsProfile(3.5, 2.0); break; //surface, sandstorm + nighttime
98 case NV_UNDERGROUND_SANDSTORM_OPTICS: ApplyOpticsProfile(1.0, 2.0); break; //tunnel + daytime/nighttime + sandstorm
99
100 // ============================ GLASSES ===========================
101 case NV_DEFAULT_GLASSES: ApplyGlassesProfile(7.0, 1.0); break; //night, surface
102 case NV_DAYTIME_GLASSES: ApplyGlassesProfile(2.0, 1.0); break; //daytime, surface
103 case NV_UNDERGROUND_GLASSES: ApplyGlassesProfile(7.0, 1.0); break; //enclosed/dark, daytime/nighttime
104 case NV_SANDSTORM_GLASSES: ApplyGlassesProfile(3.5, 1.0); break; //surface, sandstorm + nighttime
105 case NV_UNDERGROUND_SANDSTORM_GLASSES: ApplyGlassesProfile(7.0, 1.0); break; //tunnel + daytime/nighttime + sandstorm
106
107 // ============================ PUMPKIN ===========================
108 case NV_PUMPKIN: ApplyPumpkinProfile(5.5, 0.0); break; //night, surface
109 case NV_DAYTIME_PUMPKIN: ApplyPumpkinProfile(2.0, 0.0); break; //daytime, surface
110 case NV_UNDERGROUND_PUMPKIN: ApplyPumpkinProfile(5.5, 0.0); break; //enclosed/dark, daytime/nighttime
111 case NV_SANDSTORM_PUMPKIN: ApplyPumpkinProfile(4.5, 0.0); break; //surface, sandstorm + nighttime
112 case NV_UNDERGROUND_SANDSTORM_PUMPKIN: ApplyPumpkinProfile(5.5, 0.0); break; //tunnel + daytime/nighttime + sandstorm
113
114 case NV_TRANSITIVE: //camera transition
116 break;
117 }
118
119 m_CurrentMode = mode;
120 }
121
122 override protected void OnStart(Param par = null)
123 {
124 super.OnStart();
125 SetNVMode(Param1<int>.Cast(par).param1);
126 }
127
128 //other values reset automatically on stop
129 override protected void OnStop(Param par = null)
130 {
131 super.OnStop(par);
132 }
133
135 {
136 m_UGExposureCoef = coef;
137
138 if (m_IsRunning)
139 SetNVMode(m_CurrentMode); //TODO: improve (oof...)
140 }
141}
PPOperators
PP operators, specify operation between subsequent layers.
Определения PPEConstants.c:53
PPEExceptions
Определения PPEConstants.c:43
bool m_IsRunning
Определения PPERequestPlatformsBase.c:437
void SetTargetValueFloatDefault(int mat_id, int param_idx)
Определения PPERequestPlatformsBase.c:611
void SetTargetValueFloat(int mat_id, int param_idx, bool relative, float val, int priority_layer, int operator=PPOperators.ADD_RELATIVE)
Определения PPERequestPlatformsBase.c:588
void SetTargetValueColor(int mat_id, int param_idx, array< float > val, int priority_layer, int operator=PPOperators.ADD_RELATIVE)
Определения PPERequestPlatformsBase.c:630
Определения EnMath.c:7
static const int L_0_NVG_GOGGLES
Определения PPEExposureNative.c:11
static const int PARAM_INTENSITY
Определения PPEExposureNative.c:8
static const int L_0_NVG_OPTIC
Определения PPEExposureNative.c:10
EV postprocess, does not directly use materials.
Определения PPEExposureNative.c:6
static const int L_0_NVG_GENERIC
Определения PPEEyeAccomodationNative.c:11
static const int PARAM_INTENSITY
Определения PPEEyeAccomodationNative.c:8
Eye Accomodation postprocess, does not directly use materials.
Определения PPEEyeAccomodationNative.c:6
static const int PARAM_SHARPNESS
Определения PPEFilmGrain.c:9
static const int L_2_NVG
Определения PPEFilmGrain.c:21
static const int L_1_NVG
Определения PPEFilmGrain.c:19
static const int PARAM_GRAINSIZE
Определения PPEFilmGrain.c:10
FilmGrain - PostProcessEffectType.FilmGrain.
Определения PPEFilmGrain.c:7
static const int L_23_NVG
Определения PPEGlow.c:58
static const int PARAM_COLORIZATIONCOLOR
Определения PPEGlow.c:32
Glow - PostProcessEffectType.Glow.
Определения PPEGlow.c:8
static const int PARAM_NOISE_MULT
Определения PPELightIntensityParamsNative.c:9
static const int PARAM_LIGHT_MULT
Определения PPELightIntensityParamsNative.c:8
g_Game.NightVissionLightParams, does not directly use materials. Controls light multiplication and fi...
Определения PPELightIntensityParamsNative.c:6
static const int NV_UNDERGROUND_OPTICS
Определения PPERCameraNV.c:11
float ComputeSafeExposure(float baseExposure)
Определения PPERCameraNV.c:39
void SetUndergroundExposureCoef(float coef)
Определения PPERCameraNV.c:134
void SetNVMode(int mode)
Определения PPERCameraNV.c:78
static const int NV_SANDSTORM_GLASSES
Определения PPERCameraNV.c:18
void OnStart(Param par=null)
Определения PPERCameraNV.c:122
float m_UGExposureCoef
Определения PPERCameraNV.c:35
const float NV_EXPOSURE_MAX
Определения PPERCameraNV.c:31
static const int NV_NO_BATTERY
Определения PPERCameraNV.c:3
static const int NV_UNDERGROUND_SANDSTORM_GLASSES
Определения PPERCameraNV.c:19
static const int NV_DAYTIME_PUMPKIN
Определения PPERCameraNV.c:22
static const int NV_DEFAULT_GLASSES
Определения PPERCameraNV.c:5
void ApplyOpticsProfile(float exposure, float noiseMult)
Определения PPERCameraNV.c:46
int m_CurrentMode
Определения PPERCameraNV.c:34
static const int NV_UNDERGROUND_GLASSES
Определения PPERCameraNV.c:17
static const int NV_DAYTIME_OPTICS
Определения PPERCameraNV.c:8
static const int NV_DAYTIME_GLASSES
Определения PPERCameraNV.c:16
static const int NV_SANDSTORM_PUMPKIN
Определения PPERCameraNV.c:24
static const int NV_UNDERGROUND_SANDSTORM_PUMPKIN
Определения PPERCameraNV.c:25
static const int NV_SANDSTORM_OPTICS
Определения PPERCameraNV.c:12
static const int NV_PUMPKIN
Определения PPERCameraNV.c:6
static const int NV_DEFAULT_OPTICS
Определения PPERCameraNV.c:4
void ApplyPumpkinProfile(float exposure, float noiseMult)
Определения PPERCameraNV.c:68
void ApplyGlassesProfile(float exposure, float noiseMult)
Определения PPERCameraNV.c:57
static const int NV_UNDERGROUND_PUMPKIN
Определения PPERCameraNV.c:23
void OnStop(Param par=null)
Определения PPERCameraNV.c:129
static const int NV_TRANSITIVE
Определения PPERCameraNV.c:7
static const int NV_UNDERGROUND_SANDSTORM_OPTICS
Определения PPERCameraNV.c:13
base, not to be used directly, would lead to layering collisions!
Определения PPERBloodLoss.c:2
Base Param Class with no parameters. Used as general purpose parameter overloaded with Param1 to Para...
Определения param.c:12
PostProcessEffectType
Post-process effect type.
Определения EnWorld.c:72
static proto float Clamp(float value, float min, float max)
Clamps 'value' to 'min' if it is lower than 'min', or to 'max' if it is higher than 'max'.