16 Init(mat_path_override);
22 protected void Init(
string mat_path_override =
"")
24 if (mat_path_override !=
"")
63 parameter_data.RegisterDefaults(p);
72 parameter_data.RegisterDefaults(p);
82 parameter_data.RegisterDefaults(p);
92 bool boo =
Class.
CastTo(parameter_data,type.Spawn());
94 parameter_data.RegisterDefaults(p);
96 parameter_data.SetParameterIndex(idx);
97 parameter_data.SetParent(
this);
106 parameter_data.RegisterDefaults(p);
115 bool boo =
Class.
CastTo(parameter_data,type.Spawn());
117 parameter_data.RegisterDefaults(p);
119 parameter_data.SetParameterIndex(idx);
120 parameter_data.SetParent(
this);
127 PPEMatClassParameterVector parameter_data =
new PPEMatClassParameterVector(
GetPostProcessEffectID(),idx,
this);
128 parameter_data.RegisterDefaults(p);
136 PPEMatClassParameterTexture parameter_data =
new PPEMatClassParameterTexture(
GetPostProcessEffectID(),idx,
this);
137 parameter_data.RegisterDefaults(p);
144 PPEMatClassParameterResource parameter_data =
new PPEMatClassParameterResource(
GetPostProcessEffectID(),idx,
this);
145 parameter_data.RegisterDefaults(p);
203 int parameter_idx = -1;
213 bool setting_defaults =
false;
235 case PPEConstants.VAR_TYPE_BOOL:
236 bool value_var_bool = Param1<bool>.Cast(values).
param1;
242 case PPEConstants.VAR_TYPE_INT:
243 int value_var_int = Param1<int>.Cast(values).param1;
249 case PPEConstants.VAR_TYPE_FLOAT:
250 float value_var_float = Param1<float>.Cast(values).param1;
256 case PPEConstants.VAR_TYPE_COLOR:
257 float color[4] = {0,0,0,0};
258 color[0] = Param4<float,float,float,float>.Cast(values).param1;
259 color[1] = Param4<float,float,float,float>.Cast(values).param2;
260 color[2] = Param4<float,float,float,float>.Cast(values).param3;
261 color[3] = Param4<float,float,float,float>.Cast(values).param4;
Param5< string, float, float, float, float > PPETemplateDefColor
Param4< string, int, int, int > PPETemplateDefInt
Param4< string, float, float, float > PPETemplateDefFloat
Param2 PPETemplateDefBool
Param2< string, string > PPETemplateDefTexture
Param2< string, string > PPETemplateDefResource
Param2< string, ref array< float > > PPETemplateDefVector
void PPEMatClassParameterFloat(int mat_idx, int parameter_idx, PPEClassBase parent)
proto native World GetWorld()
Super root of all classes in Enforce script.
proto void SetParamByIndex(int paramIndex, void value)
Created once, on manager init. Script-side representation of C++ material class, separate handling.
protected void RegisterParameterColorEx(int idx, string parameter_name, float r, float g, float b, float a, typename type)
WARNING - min/max values are usually taken from Workbench defaults, may not be actual min/max values ...
protected void RegisterParameterVector(int idx, string parameter_name, array< float > default_values)
void DbgPrnt(string text)
protected 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 ...
protected void RegisterParameterResource(int idx, string parameter_name, string default_path)
protected ref map< int, ref array< int > > m_ParameterUpdateQueueMap
protected void RegisterParameterScalarFloatEx(int idx, string parameter_name, float default_value, float min, float max, typename type)
WARNING - min/max values are usually taken from Workbench defaults, may not be actual min/max values ...
int GetPostProcessEffectID()
Overriden in all material classes!
protected PPEManager m_Manager
protected void RegisterMaterialParameters()
inserted into associative array by parameter int value, parameter registration order does not matter ...
protected string m_MaterialPath
protected void Init(string mat_path_override="")
void InsertParamValueData(PPERequestParamDataBase request_data)
Distributes requester data to the material class structure and links them to appropriate parameter.
protected void RegisterParameterColor(int idx, string parameter_name, float r, float g, float b, float a)
WARNING - min/max values are usually taken from Workbench defaults, may not be actual min/max values ...
protected void RegisterParameterTexture(int idx, string parameter_name, string default_path)
protected ref map< int, ref PPEMatClassParameterCommandData > m_MaterialParamMapStructure
string GetCurrentMaterialPath()
void SetParameterUpdating(int order, int parameter_id)
Queue specific parameter of this material to update.
void ParamUpdateRemove(int parameter_idx)
Queue selected parameter for removal from the update queue.
protected void RegisterParameterScalarInt(int idx, string parameter_name, int default_value, int min, int max)
void PPEClassBase(string mat_path_override="")
protected void RegisterParameterScalarBool(int idx, string parameter_name, bool default_value)
protected ref array< int > m_ParameterRemovalQueue
string GetDefaultMaterialPath()
override this if you want to use different path by default; '.emat' is appended automatically
protected Material m_Material
protected void ParamUpdateQueueCleanup(int order)
void SetFinalParameterValue(int parameter_idx)
Clamps the values being set to defaults, if there is no request setting non-zero values on the parame...
protected void CreateDataStructure()
protected void InsertUpdatedParameter(int mat_id)
void ChangeMaterialPathUsed(string path)
PPEMatClassParameterCommandData GetParameterCommandData(int parameter_idx)
Some PP effects are handled as hard-coded exceptions, outside of material system. Default == PPEExcep...
void RemoveRequest(int req_idx)
unused, see 'RemoveActiveRequestFromMaterials' for more info
protected ref array< int > m_UpdatedParameters
void OnUpdate(float timeslice, int order)
generic update method, take care when overriding!
protected void CreateMaterial()
Static component of PPE manager, used to hold the instance.
static PPEManager GetPPEManager()
Returns the manager instance singleton.
Param GetCurrentValues()
Careful, only actual values, WITHOUT string.
override int GetParameterVarType()
void InsertRequestData(PPERequestParamDataBase request_data)
Data for one material parameter, requester side.
void SetUpdatingDataValues(bool state)
void SetDataActive(bool state)
Base Param Class with no parameters. Used as general purpose parameter overloaded with Param1 to Para...
proto native Material GetMaterial(string materialName)
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
proto native CGame GetGame()
PostProcessEffectType
Post-process effect type.
void Error(string err)
Messagebox with error message.
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.