8 static const int PARAM_ENABLE = 0;
9 static const int PARAM_FOCUS_DIST = 1;
10 static const int PARAM_FOCUS_LEN = 2;
11 static const int PARAM_FOCUS_LEN_NEAR = 3;
12 static const int PARAM_BLUR = 4;
13 static const int PARAM_FOCUS_DEPTH_OFFSET = 5;
15 static const int L_0_ADS = 100;
16 static const int L_1_ADS = 100;
17 static const int L_2_ADS = 100;
18 static const int L_3_ADS = 100;
19 static const int L_4_ADS = 100;
20 static const int L_5_ADS = 100;
22 override int GetPostProcessEffectID()
27 override void RegisterMaterialParameters()
30 RegisterParameterScalarBool(PARAM_ENABLE,
"Enable",
false);
32 RegisterParameterScalarFloat(PARAM_FOCUS_DIST,
"FocusDistance",2.0,0.0,1000.0);
33 RegisterParameterScalarFloat(PARAM_FOCUS_LEN,
"FocusLength",-1.0,-1.0,1000.0);
34 RegisterParameterScalarFloat(PARAM_FOCUS_LEN_NEAR,
"FocusLengthNear",-1.0,-1.0,1000.0);
35 RegisterParameterScalarFloat(PARAM_BLUR,
"Blur",1.0,0.0,1000.0);
36 RegisterParameterScalarFloat(PARAM_FOCUS_DEPTH_OFFSET,
"FocusDepthOffset",0.0,0.0,1000.0);
39 override void ApplyValueChanges()
41 if (m_UpdatedParameters.Count() > 0)
43 SetFinalParameterValue(-1);
46 m_UpdatedParameters.Clear();
50 override void SetFinalParameterValue(
int parameter_idx)
52 Param enabled_par = GetParameterCommandData(PARAM_ENABLE).GetCurrentValues();
53 bool is_enabled = Param1<bool>.Cast(enabled_par).param1;
59 for (
int i = 1; i < PARAM_FOCUS_DEPTH_OFFSET + 1; i++)
61 Param values = GetParameterCommandData(i).GetCurrentValues();
62 float value_var_float = Param1<float>.Cast(values).param1;
63 array_values.Insert(value_var_float);
66 g_Game.OverrideDOF(
true, array_values.Get(PARAM_FOCUS_DIST), array_values.Get(PARAM_FOCUS_LEN), array_values.Get(PARAM_FOCUS_LEN_NEAR), array_values.Get(PARAM_BLUR), array_values.Get(PARAM_FOCUS_DEPTH_OFFSET));
70 g_Game.OverrideDOF(
false,0.0,0.0,0.0,0.0,1.0);