#if %OFFSET_BUMP_MAPPING
half ObmDisplacement
<
  register = REG_PM_PARAM_0.y;
  string UIWidget = "slider";
  string UIName = "OBM Displacement";
  float UIMin = 0.0;
  float UIMax = 0.025;
  float UIStep = 0.001;
> = 0.004;
#endif

Lets break down this code into manageable peices:

#if %OFFSET_BUMP_MAPPING
#endif

This is the pre-processor arguments for the compilation logic, "#if %OFFSET_BUMP_MAPPING" basically just tells the compiler that if the feature offset bump mapping is enabled, compile this code. The "#endif" part just tells the compiler that it is the end of the code that is to be compiled into the shader.


half ObmDisplacement

the "half ObmDisplacement" is the actual variable that will be exposed to your shader code. Name this something that means something in your shader. For instance if you have a shader that adds blue to your diffuse color, then your code should read:

half BlueAddAmount

Or something like that.
<
> = 0.004;

This code "<>" signifies the begin and end of the UI properties code block. And at the end of it there is a "=0.004", this is a default value for the slider that is created. Essentially the value that is placed there when the element is created by your shader feature being compiled.


  register = REG_PM_PARAM_0.y;

This is the register for your parameter, these are defined in the FXConstantDefs.cfi file around line 32. Unless you plan on re-using existing registers (risky) then you will need to create a new one. I suggest you copy and paste one of the existing Parameters and simply add 1 to the number at the end of the REG_PM_PARAM variable.

example of existing register: "REG_PM_PARAM_7 c49"
-
example of a new register: "REG_PM_PARAM_8 c50"
-

Here as an image of the registered params in the FXConstantDefs.cfi of CE5.4:

V50yvS.jpg

NOTE: each REG_PM_PARAMTER has an .xyzw capacity. You can store up to 4 parameters per RE_PM_PARAMETER.


  string UIWidget = "slider";
  string UIName = "OBM Displacement";
  float UIMin = 0.0;
  float UIMax = 0.025;
  float UIStep = 0.001;

These are the most self explanatory; "UIWidget" is the type of widget that will be added to the interface, as far as I can tell a "slider" is the only one that works.
-
"UIName" is the name that will show up in the material editor interface
-
"UIMin" is the minimum allowed value in the interface
-
"UIMax" is the maximum allowed value in the interface
-
"UIStep" is the accuracy / interpolation allowed in the slider, the lower the number, the more numbers you can "access" in the slider. In the example code it is very small because the UIMax is very small. If you have a slider that goes from -1 to 1, and UIStep that is = to 1, it will only have 3 valid positions.