Dayz
Build 1.29.163047, Scripts Rev. 123548
Dayz Code Explorer by Zeroy
Toggle main menu visibility
Loading...
Searching...
No Matches
ppedof.c
Go to the documentation of this file.
1
//---------------------------------------------------------
2
//Native exceptions - legacy methods for direct access to specific postprocesses. Each one is evaluated and handled separately, this just connects them to the system.
3
5
class
PPEDOF
:
PPEClassBase
6
{
7
//g_Game.OverrideDOF(bool enable, float focusDistance, float focusLength, float focusLengthNear, float blur, float focusDepthOffset);
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;
14
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;
21
22
override
int
GetPostProcessEffectID
()
23
{
24
return
PPEExceptions
.DOF;
25
}
26
27
override
void
RegisterMaterialParameters
()
28
{
29
//no known max. 1000 used as max
30
RegisterParameterScalarBool
(
PARAM_ENABLE
,
"Enable"
,
false
);
31
32
RegisterParameterScalarFloat
(
PARAM_FOCUS_DIST
,
"FocusDistance"
,2.0,0.0,1000.0);
//2.0f used in code with null camera interpolation
33
RegisterParameterScalarFloat
(
PARAM_FOCUS_LEN
,
"FocusLength"
,-1.0,-1.0,1000.0);
//-1.0f used as code default
34
RegisterParameterScalarFloat
(
PARAM_FOCUS_LEN_NEAR
,
"FocusLengthNear"
,-1.0,-1.0,1000.0);
//-1.0f used as code default
35
RegisterParameterScalarFloat
(
PARAM_BLUR
,
"Blur"
,1.0,0.0,1000.0);
//1.0f used in code with null camera interpolation
36
RegisterParameterScalarFloat
(
PARAM_FOCUS_DEPTH_OFFSET
,
"FocusDepthOffset"
,0.0,0.0,1000.0);
//0.0f used as code default
37
}
38
39
override
void
ApplyValueChanges
()
40
{
41
if
(
m_UpdatedParameters
.Count() > 0)
42
{
43
SetFinalParameterValue
(-1);
//unique handling
44
}
45
46
m_UpdatedParameters
.Clear();
47
}
48
50
override
void
SetFinalParameterValue
(
int
parameter_idx)
51
{
52
Param
enabled_par =
GetParameterCommandData
(
PARAM_ENABLE
).
GetCurrentValues
();
53
bool
is_enabled = Param1<bool>.Cast(enabled_par).
param1
;
54
55
if
(is_enabled)
56
{
57
array<float>
array_values = {-1.0};
58
59
for
(
int
i = 1; i <
PARAM_FOCUS_DEPTH_OFFSET
+ 1; i++)
60
{
61
Param
values =
GetParameterCommandData
(i).
GetCurrentValues
();
62
float
value_var_float = Param1<float>.Cast(values).
param1
;
63
array_values.Insert(value_var_float);
64
}
65
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
));
67
}
68
else
69
{
70
g_Game
.OverrideDOF(
false
,0.0,0.0,0.0,0.0,1.0);
71
}
72
}
73
}
PPEClassBase::m_UpdatedParameters
ref array< int > m_UpdatedParameters
Definition
ppematclassesbase.c:10
PPEClassBase::RegisterParameterScalarBool
void RegisterParameterScalarBool(int idx, string parameter_name, bool default_value)
Definition
ppematclassesbase.c:59
PPEClassBase::RegisterParameterScalarFloat
void RegisterParameterScalarFloat(int idx, string parameter_name, float default_value, float min, float max)
WARNING - min/max values are usually taken from Workbench defaults, may not be actual min/max values ...
Definition
ppematclassesbase.c:77
PPEClassBase::PPEClassBase
void PPEClassBase(string mat_path_override="")
Definition
ppematclassesbase.c:14
PPEClassBase::GetParameterCommandData
PPEMatClassParameterCommandData GetParameterCommandData(int parameter_idx)
Some PP effects are handled as hard-coded exceptions, outside of material system. Default == PPEExcep...
Definition
ppematclassesbase.c:350
PPEDOF
DOF postprocess, does not directly use materials.
Definition
ppedof.c:6
PPEDOF::L_5_ADS
static const int L_5_ADS
Definition
ppedof.c:20
PPEDOF::PARAM_FOCUS_DIST
static const int PARAM_FOCUS_DIST
Definition
ppedof.c:9
PPEDOF::RegisterMaterialParameters
override void RegisterMaterialParameters()
Definition
ppedof.c:27
PPEDOF::GetPostProcessEffectID
override int GetPostProcessEffectID()
Definition
ppedof.c:22
PPEDOF::PARAM_ENABLE
static const int PARAM_ENABLE
Definition
ppedof.c:8
PPEDOF::PARAM_FOCUS_LEN
static const int PARAM_FOCUS_LEN
Definition
ppedof.c:10
PPEDOF::L_4_ADS
static const int L_4_ADS
Definition
ppedof.c:19
PPEDOF::L_2_ADS
static const int L_2_ADS
Definition
ppedof.c:17
PPEDOF::PARAM_FOCUS_DEPTH_OFFSET
static const int PARAM_FOCUS_DEPTH_OFFSET
Definition
ppedof.c:13
PPEDOF::L_0_ADS
static const int L_0_ADS
Definition
ppedof.c:15
PPEDOF::PARAM_FOCUS_LEN_NEAR
static const int PARAM_FOCUS_LEN_NEAR
Definition
ppedof.c:11
PPEDOF::L_1_ADS
static const int L_1_ADS
Definition
ppedof.c:16
PPEDOF::L_3_ADS
static const int L_3_ADS
Definition
ppedof.c:18
PPEDOF::SetFinalParameterValue
override void SetFinalParameterValue(int parameter_idx)
Overriden to handle the specific exception.
Definition
ppedof.c:50
PPEDOF::PARAM_BLUR
static const int PARAM_BLUR
Definition
ppedof.c:12
PPEDOF::ApplyValueChanges
override void ApplyValueChanges()
Definition
ppedof.c:39
PPEMatClassParameterCommandData::GetCurrentValues
Param GetCurrentValues()
Careful, only actual values, WITHOUT string.
Definition
ppematclassparametercommanddata.c:122
Param
Base Param Class with no parameters.
Definition
param.c:12
Param::param1
T1 param1
Definition
param.c:34
array
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
Definition
isboxcollidinggeometryproxyclasses.c:28
g_Game
DayZGame g_Game
Definition
dayzgame.c:3942
PPEExceptions
PPEExceptions
/brief IDs of custom PPE classes /note Currently used for various native exceptions that used to be h...
Definition
ppeconstants.c:43
Games
Dayz
scripts
3_game
ppemanager
materials
matclasses
exceptions
ppedof.c
Generated by
1.17.0