Post processing.tbl

From FreeSpace Wiki
Revision as of 14:32, 4 November 2012 by The E (talk | contribs) (Adding a 3.6.15 tag here.)
Jump to: navigation, search
This feature requires FreeSpace Open

Revision information.....

FSO Revision: 5715
Note: Please update the version when the page is updated. If your edit had nothing to do with new code entries then please do not edit the version


The post_processing.tbl is a table file that controls the use of post-processing effects avaiable in FSO.


List of Tables

General Format

In order to use post-processing, the following prerequisites must be met:

  • FSO version 3.6.12 or higher
  • GPU capable of running Shaders written in GLSL 1.2 or higher
  • -post_process commandline flag must be enabled
  • post-processing shader files must be present and named post-f.sdr/post-v.sdr

Post_processing.tbl allows the modder to set default values for the effects supported effects. The table must begin with "#Effects" and must end with "#End". For each effect, the following options apply:

#Effects

$Name:

  • Name of the effect. This is used to refer to the effect with the post-processing sexps.
  • Syntax: String

$Uniform:

  • For every effect, a uniform variable is needed to pass data from the engine to the shader. This is the variables' name, and it has to match the name as used by the shader. All uniforms declared here are of type "float".
  • Syntax: String

$Define:

  • In the post-processing shader, each effects' code is encapsulated in a preprocessor define. Since the engine only uses one post-processing shader, the shader has to be recompiled every time an effect is activated or deactivated. To control which effects are in use, preprocessor defines are used. The name given here must match the name used in the shader.
  • Syntax: String

$AlwaysOn:

  • If set to true, the effect will be on by default.
  • Syntax: Boolean

$Default:

  • The default value of the passed uniform variable. This value is modified by the values given in $Div and $Add as follows: value = (default value / div) + add
  • Syntax: Float

$Div:

  • Syntax: Float

$Add:

  • Syntax: Float

#Ship Effects

This section is used to define effects for use with the ship-effect sexp or ship::addShipEffect() lua function.

$Name

  • Syntax: String
  • Defines a unique name for this effect, which is used as input for the sexp and lua function.

$Shader Effect:

  • Syntax: Integer
  • Defines a unique ID for this effect. This will be passed to the main shader as a uniform parameter. Note that IDs 0 and 1 are reserved for in-engine use.

$Disables Rendering:

  • Syntax: Boolean
  • If this is set to true, the ship will not be rendered after the effect is completed.
  • Note: In order to reenable rendering, use an effect with this option set to false.

$Invert Timer:

  • Syntax: Boolean
  • Controls the behaviour of the timer passed to the shader as a uniform variable. Timer values are always in the [0.0, 1.0] range, and are computed as follows:

(Current time in milliseconds - effect start time in milliseconds) / (effect duration in milliseconds) If this parameter is set to true, the computation is altered as follows: 1.0 - ((Current time in milliseconds - effect start time in milliseconds) / (effect duration in milliseconds))

#Light Shafts

FS2 Open, 3.6.16:

This section is used to define the parameters for the light shaft effect.

$AlwaysOn:

  • If set to true, the effect will be on by default.
  • Syntax: Boolean

$Density:

  • This changes the spacing between the individual samples taken by the shader. I smaller number means shorter lightshafts but less noticeable color banding.
  • Syntax: Float

$Falloff:

  • This allows for a exponential falloff of the light shaft intensity the farther it gets away from the sun.
  • Syntax: Float

$Weight:

  • This changes the amount of light every sample adds to the final brightness. Change this and $Intensity to vary contrast.
  • Syntax: Float

$Intensity:

  • This is the overall intensity of the effect after all other calculations are done.
  • Syntax: Float

$Sample Number:

  • This is the amount of texture samples used for every pixel on screen. Increasing this improves quality but also slows down the shader. Low end hardware should go with 25. High end can go up to or over 100.
  • Syntax: Integer

Sample

This is the default table used by FSO executables if no post_processing.tbl can be found.

#Effects										
												
$Name:			distort noise					
$Uniform:		noise_amount					
$Define:		FLAG_DISTORT_NOISE				
$AlwaysOn: 		false							
$Default:		0.0								
$Div:			20000							
$Add:			0								
												
$Name:			saturation						
$Uniform:		saturation						
$Define:		FLAG_SATURATION					
$AlwaysOn: 		false							
$Default:		0.9								
$Div:			50								
$Add:			0								
												
$Name:			contrast						
$Uniform:		contrast						
$Define:		FLAG_CONTRAST					
$AlwaysOn: 		false							
$Default:		1.1								
$Div:			50								
$Add:			0								
												
$Name:			film grain						
$Uniform:		film_grain						
$Define:		FLAG_GRAIN						
$AlwaysOn: 		false							
$Default:		0.1								
$Div:			50								
$Add:			0								
												
$Name:			stripes							
$Uniform:		tv_stripes						
$Define:		FLAG_STRIPES					
$AlwaysOn:		false							
$Default:		0.0								
$Div:			50								
$Add:			0								
												
$Name:			dithering						
$Uniform:		dither							
$Define:		FLAG_DITH						
$AlwaysOn:		false							
$Default:		0.0								
$Div:			50								
$Add:			0

#Ship Effects

$Name: 			Cloak
$Shader Effect:		2
$Disables Rendering:	YES
$Invert timer:		YES

$Name:			Decloak
$Shader Effect:		2
$Disables Rendering:	NO
$Invert timer:		NO								

#Light Shafts
$AlwaysOn:		NO
$Density:		0.5
$Falloff:		1.0
$Weight:		0.02
$Intensity:		0.5
$Sample Number:		50
												
#End