HelixMod Feature List

From Bo3b's School for Shaderhackers
Revision as of 18:14, 8 September 2014 by DarkStarSword (Talk | contribs)

Jump to: navigation, search

Contents

Overview of DX9Settings.ini

  • Gotcha - it's a good to add comments to your DX9Settings.ini, but beware that comments must go on their own separate lines. If you add them to the end of a line the entire line will be ignored.
  • Gotcha - Pressing F7 in the game (to save custom separation and convergence settings to a preset) will remove all comments from the DX9Settings.ini

[General]

UseAlternateCRC

This is either true or false. It is unclear if this was a general feature or specific to a given game. It is believed that it was provided to get round the issue whereby a game will write the installation directory to the shaders, so the CRCs are different depending on where the game is installed.

Currently only know to be used in DarkSiders2.

DefModuleName

This is used in conjunction with the separate helix launcher tool to define the name of the game executable to hook to. It was introduced to get around issues some games had with Steam, Uplay etc.

InitMouse

This is either true or false.

Set to false if you find a game where the mouse stops working.

ProxyLib

Used to specify another d3d9 proxy dll to pass onto after "finishing" the helix dll operation. Often used to specifiy other post-process injectors like sweetfx etc.

UseRenderedShaders

UseRenderedShaders=true is nearly always useful, because it trims the list of shaders seen while hunting down to just those active in the current scene. Disable this only if you get crashes during hunting.

DumpAll

DumpAll will generate ASM text files for every shader seen by the game. This is usually worth doing once, but not useful for every run.

DefPSSampler

Defines which sampler register is used to retrieve the stereo settings from pixel shaders.

Defaults to s13

DefVSSampler

Defines which sampler register is used to retrieve the stereo settings from vertex shaders.

Defaults to s0

DefVSConst1

Defines which c register Const1 through Const4 will end up in in vertex shaders.

Note that all four constant values end up in the one register as x, y, z and w. There is no DefVSConst2 - to access Const2 you would use c200.y if DefVSConst1 is set to 200.

It's a good idea to search through the AllShaders dump to find a constant register that is not used by the game.

DefPSConst1

Same as DefVSConst1, but for pixel shaders.

PresetsKeysList

Defines which KEY sections are used by the DLL. Note that every number in this list needs to be followed by a semicolon, including the last number.

UseEndScene

This can be "true" or "false". If you have issues with the rendering of the red CRC text, so either you can't see it, or on occasion it gets rendered *in game*, projected on objects, or perhaps it might be rendered as really large text, cycle these values.

bCalcTexCRCatStart

Enables cycling of textures using PrexTexKey and NextTexKey

PrevTexKey

Defines which key cycles backwards through textures. Must have bCalcTexCRCatStart = true

Default Value: Down

NextTexKey

Defines which key cycles forwards through textures. Must have bCalcTexCRCatStart = true

Default Value: Up

DefPSViewSizeConst

This has a default value of 221. It is used to store screen size in the x and y values, and the inverse screen sizes in the z and w values. This is primarilly useful when you need to map from x-y coordinates passed into a PS via a the vPOS variable to "texture coordinates" for use in smaplers.

DefSquareSurfaceMode

Sets the default stereoization rendering mode for all square surfaces (render targets):

0 = render according to Nvidia automatic

1 = render forcing this surface to be stereoized

2 = render forcing this surface to be monoscopic

This can be overridden by individual surface declaration in the DX9Settings.ini file in sections labelled "[SFn]", where n is a number. This is most relevant for shadow maps, which are usually square, and which must be forced to mono.

DefDepthStencilSurfaceMode

Sets the default stereoization rendering mode for all depth surfaces (render targets): 0 = render according to Nvidia automatic 1 = render forcing this surface to be stereoized 2 = render forcing this surface to be monoscopic This can be overridden by individual surface declaration in the DX9Settings.ini file in sections labelled "[SFn]", where n is a number.

DefSurfaceCreationMode

Sets the default stereoization rendering mode for ALL surfaces (render targets): 0 = render according to Nvidia automatic 1 = render forcing this surface to be stereoized 2 = render forcing this surface to be monoscopic This can be overridden by individual surface declaration in the DX9Settings.ini file in sections labelled "[SFn]", where n is a number.

DefRtCreationMode

Sets the default stereoization rendering mode for all Rectangular (specifcially non-square) surfaces (render targets): 0 = render according to Nvidia automatic 1 = render forcing this surface to be stereoized 2 = render forcing this surface to be monoscopic

SurfaceCreationModeList

Defines a list of of which surface properties defined in the DX9Settings.ini to load in an use for override purposes in sections labelled [SFn], where n is one of the list values. Usage: SurfaceCreationModeList = 0;2;3; Note - you must use ";" and you must have a ";" at the end of the list.

RtCreationModeList

This is the same as "SurfaceCreationModeList" but just for the subset of surfaces that are non-square. Individual settings are defined in sections labelled [RTn], where n is one of the list values.

SkipSetScissorRect

This is set to either true or false. It is best to always default this to "true". It instructs the renderer to ignore (when it can) the application of a feature that tries to save memory by using a stencil cutout to limit the area that needs rendering. In 3D this leads to issues with parts of an object or effect being "cut-off" at the edges. It is not possible to always fix this in all games though.

OverrideMethod

Can have values of 0,1 or 2. It is unknown exactly what these are doing, and for most games it does not matter which one is used, but if any given game there seems to be an issue loading in shader fixes (e.g. if you press F10 and nothing happens), cycle through the options. The value of 2 seems to have been added to cater for preshaders. In this case you should be able to to just comment out the preshader sections in a shader. It is not clear if this always works.

GetCurDirAtLoad

Set to true if you want to force the dll to look in the game exe dir (where the dll is) for the settings file, shader folders etc. Set to false otherwise. Exists because some games get linked to the parent directory etc to look for shader folders. Mostly seems to work, and is a good default option.

UseExtInterfaceOnly

This can be either true or false. ExtInterface is an internal programmatic thing with an "extended" set of capabilities that some newer games require. It is unclear when you would know to use this option.

PSPREVKEY

DEBUG DLL ONLY - Defines which key cycles backwards through pixel shaders

Default Value: Numpad 1

PSNEXTKEY

DEBUG DLL ONLY - Defines which key cycles forwards through pixel shaders

Default Value: Numpad 2

PSSAVEKEY

DEBUG DLL ONLY - Defines which key dumps the currently disabled pixel shader to a file

Default Value: Numpad 3

VSPREVKEY

DEBUG DLL ONLY - Defines which key cycles backwards through vertex shaders

Default Value: Numpad 4

VSNEXTKEY

DEBUG DLL ONLY - Defines which key cycles forwards through vertex shaders

Default Value: Numpad 5

VSSAVEKEY

DEBUG DLL ONLY - Defines which key dumps the currently disabled vertex shader to a file

Default Value: Numpad 6

PSADDTOSKIPLSTKEY

DEBUG DLL ONLY - Add the currently disabled pixel shader to the skip list, to allow multiple shaders to be disabled simultaneously

Default Value: Numpad 7

PSRMFROMSKIPLSTKEY

DEBUG DLL ONLY - Remove the currently selected pixel shader from the skip list

Default Value: Numpad 8

PSCLRSKIPLSTKEY

DEBUG DLL ONLY - Remove all pixel shaders from the skip list

Default Value: Numpad 9

VSADDTOSKIPLSTKEY

DEBUG DLL ONLY - Add the currently disabled vertex shader to the skip list, to allow multiple shaders to be disabled simultaneously

Default Value: Home

VSRMFROMSKIPLSTKEY

DEBUG DLL ONLY - Remove the currently selected vertex shader from the skip list

Default Value: End

VSCLRSKIPLSTKEY

DEBUG DLL ONLY - Remove all vertex shaders from the skip list

Default Value: Insert

RELOADSHADERSKEY

DEBUG DLL ONLY - Defines which key reloads the shaders from the ShaderOverrides directory.

Note: Shaders must have been succesfully overridden at launch for the reload to work, therefore it is a good idea to start the game with known working shaders if you intend to edit them while the game is running

Default Value: F10

SHOWTEXTKEY

DEBUG DLL ONLY - Toggles the red debug text on and off

Default Value: Pause

SaveTextureLogKey

Writes out TEXTURESLOG.txt.

Default Value: F12

ReloadTexturesListKey

Default Value: F8

SaveSettingsKey

Defines which key re-writes DX9Settings.ini with custom convergence and separation settings to the active preset.

Must have UseSepSettings = true and SaveSepSettings = true in a preset to be useful.

CAUTION: Comments are removed from the ini when this key is pressed!

Default Value: F7

[KEY*]

Replace * with a number. These sections are used to activate presets when pressing or holding various keys or mouse buttons.

Note that you must include all of these sections in the PresetsKeysList under [General] otherwise they will be ignored by HelixMod. For instance, if you have defined sections for [KEY1], [KEY3] and [KEY7], then you must set PresetsKeysList = 1;3;7;

Key

This specifies the keycode in decimal.

Microsoft virtual keycodes for Key= use. Especially helpful for those odd keys like Insert, or Pause or F-Keys or Numpad. Must be converted from Hexadecimal to Decimal: http://msdn.microsoft.com/en-us/library/ms927178.aspx

ASCII table for normal keyboard keys. Use the Dec column: http://www.asciitable.com/

501 is the right mouse button, which is useful to switch presets while holding aim in some games.

Type

Type=1 will activate when the key is pressed down.

Type=2 is momentary - it will activate the first preset when the key is pressed down, and the second preset when the key is released.

Presets

This specifies which PRES* sections are activated by this key.

Each number in this list should end with a semicolon, including the last one.

Note that the order in this list is unimportant, however the numerical value of each of the presets does!

For type 2 keys, there should be exactly two entries in the list - the lower numbered entry will be activated while the button is held and the higher numbered entry will be activated when the button is released.

For type 1 keys you can have one or more entries in this list. If you have more than one entry it will cycle through each of them in numerical order when the key is pressed, wrapping back to the first after the last one. A list of two presets would toggle between each of them.

Delay

Defines an optional delay in milliseconds before the next preset will be activated.

Only seems to affect the 'to' and not the 'from' when using Type=2

[PRES*]

Replace * with a number. These sections define various presets that can be activated with key presses.

These sections should be referenced from the Presets list in at least one KEY* section.

Const1, Const2, Const3 & Const4

Each of these can be used to set a value that can be accessed from shaders through the c register defined by DefVSConst1 and DefPSConst1. The four of these make up the x, y, z and w values of a single c register (there is no DefVSConst2, Const2 will be the y value of DefVSConst1).

These must be specified in hex (see below).

UseByDef

If true, this preset will be activated when the game is started.

If this preset can also be activated via a key press, it is recommended to make the numerically highest preset associated with that key the default. Otherwise the first time the key is pressed it may not appear to do anything as it activated the already active preset.

UseByDef can be set on multiple presets. This is useful if you have several independent preset groups - e.g. one group to control the convergence settings, and another to select different UI depths.

UseSepSettings

Set to true to allow this preset to change the separation and/or convergence settings.

SaveSepSettings

Set to true to allow custom separation & convergence settings to be saved in this preset.

To use it the preset must be activated in the game (UseByDef=true does not seem to be sufficient) while the user adjusts their settings via the normal keybindings for the driver. With the preset still active they then press F7 (not to be confused with Ctrl+F7) which will cause HelixMod to write the new settings to DX9Settings.ini

CAUTION: Pressing F7 will strip all comments from DX9Settings.ini!

Separation

Set a custom separation value between 0.0 and 100.0 when this preset is activated. You must also set UseSepSettings=true for this to work. The value must be specified in hex (see below).

Convergence

Set a custom convergence value when this preset is activated. You must also set UseSepSettings=true for this to work. The value must be specified in hex (see below).

[VSnnnnnnnn]

These sections define custom settings for specific vertex shaders. Replace nnnnnnnn with the 8 digit CRC32 of the vertex shader.

DefStage

CheckTexCRC

VBOffsetList

ValForDefined

ValNotDefined

TexCounterReg

UseDefinedOnly

DefinedTexturesVS

FirstVertexPosReg

GetVertex

UseMatrix

Either "true" or "False".

Specifies whether this VS will re-use a matrix from another shader.

MatrixReg

Usage MatrixReg = nnn

where nnn is the register for a matrix that was specified in another shader subsection using the "GetMatrixFromReg" field. Note that this "get" statement can be in the same shader, it does not have to be a different shader - this is required if you want the inverse of a matrix.

GetMatrixFromReg

Usage: GetMatrixFromReg = nnn

Sets the matrix with register nnn in *this* shader to be a re-usable constant register in all other shaders (including itself).

InverseMatrix

This is either true or false.

If true then the matrix specified in "MatrixReg" will actually be the inverse of the matrix that was re-used.

DoubleInverseMatrix

This is either true or false.

If true then a *Second* register is created 4 values higher than the first one defined in "MatrixReg" which stores the Inverse of the Inverse i.e. gets back to the original matrix that was shared in the first place. This might seem odd but it provides significantly better numerical stability. An example would be that a shader "shares' its matrix that was in register 8. This is then set to register 200 in the shader that is reusing it. If both matrix inverse settings are true, the registers will be as follows: 200, 201, 202, 203 will have the inverse matrix; 204, 205, 206, 207 will have the original matrix.

SetSamplerNToReg

This allows a sampler that has been shared in another shader to be reused in this shader.

"N" is an integer that identifies the specific sampler that has been shared in another shader. The starting value for N is "1", but it is not known what the max value of "N" is.

Usage: SetSampler1ToReg = 10

This will mean that in this shader, there will be accessible a sampler "s10" that can be used as if it was defined in the shader itself.

SetConstNToReg

This allows a Constant (4-component) register that has been shared in another shader to be reused in this shader.

"N" is an integer that identifies the specific register that has been shared in another shader. The starting value for N is "1", but it is not known what the max value of "N" is.

Usage: SetConst1ToReg = 10

This will mean that in this shader, there will be accessible a constant "c10" that can be used as if it was defined in the shader itself.

GetConstNFromReg

This allows a constant register defined in this shader to be re-used in other shaders.

"N" is an integer that identifies the specific constant register that is to be shared. The starting value for N is "1", but it is not known what the max value of "N" is.

Usage: GetConst1FromReg = 123

This means that the register c123 will be made available to other shaders, and identified as accessed using the "SetConst1ToReg" field.

ResetConst1AfterSet

[VBnnnnnnnn.m]

This is of the form [VBnnnnnnnn.m], where the "m" relates to the value set in the "VBOffsetList" field of the related [VSnnnnnnnn] section. The way textures are stored and accessed is through Vertex Buffers, which are lists. No one really knows how this works, but it is the syntax that is necessary for it to work.

PointsList

Set to a numeric value. Currently believed only to be a way to identify this override operation in the LOG and/or textures.log files.

Usage: "PointsList = 554" OR "PointsList = 3E8B0000"

Offset

IsDisabledList

StartResW

StartResH

EndResW

EndResH

[TEXnnnnnnnn]

Used to identify one of the textures by the 8-digit CRC specified in the "DefinedTexturesVS" list for a vertex shader.

PresIndex

Usage: PresIndex = 8

Used to specify a particular preset index that is to be activated when the given texture is active. Its used for things like setting automatic convergence in different games scenes.

Index

Usage: Index = n

VBOffsetList

Usage: VBOffsetList = 0;

[PTnnnnnnnn]

Used to identify one of the points lists (?) by the 8-digit CRC. It is unknown where this information comes from.

PresIndex

Usage: PresIndex = 8

Used to specify a particular preset index that is to be activated when the given point list is active. Its used for things like setting automatic convergence in different games scenes.

[PSnnnnnnnn]

These sections define custom settings for specific pixel shaders. Replace nnnnnnnn with the 8 digit CRC32 of the pixel shader.

UseMatrix

Either "true" or "False".

Specifies whether this VS will re-use a matrix from another shader.

MatrixReg

Usage MatrixReg = nnn

where nnn is the register for a matrix that was specified in another shader subsection using the "GetMatrixFromReg" field. Note that this "get" statement can be in the same shader, it does not have to be a different shader - this is required if you want the inverse of a matrix.

GetMatrixFromReg

Usage: GetMatrixFromReg = nnn

Sets the matrix with register nnn in *this* shader to be a re-usable constant register in all other shaders (including itself).

InverseMatrix

This is either true or false.

If true then the matrix specified in "MatrixReg" will actually be the inverse of the matrix that was re-used.

DoubleInverseMatrix

This is either true or false.

If true then a *Second* register is created 4 values higher than the first one defined in "MatrixReg" which stores the Inverse of the Inverse i.e. gets back to the original matrix that was shared in the first place. This might seem odd but it provides significantly better numerical stability. An example would be that a shader "shares' its matrix that was in register 8. This is then set to register 200 in the shader that is reusing it. If both matrix inverse settings are true, the registers will be as follows: 200, 201, 202, 203 will have the inverse matrix; 204, 205, 206, 207 will have the original matrix.

GetSamplerNFromReg

This allows a sampler register defined in this shader to be re-used in other shaders.

"N" is an integer that identifies the specific sample register that is to be shared. The starting value for N is "1", but it is not known what the max value of "N" is.

Usage: GetSampler1FromReg = 12

This means that the sampler s12 will be made available to other shaders, and identified as accessed using the "SetSampler1ToReg" field.

SetSamplerNToReg

This allows a sampler that has been shared in another shader to be reused in this shader.

"N" is an integer that identifies the specific sampler that has been shared in another shader. The starting value for N is "1", but it is not known what the max value of "N" is.

Usage: SetSampler1ToReg = 10

This will mean that in this shader, there will be accessible a sampler "s10" that can be used as if it was defined in the shader itself.

SetConstNToReg

This allows a Constant (4-component) register that has been shared in another shader to be reused in this shader.

"N" is an integer that identifies the specific register that has been shared in another shader. The starting value for N is "1", but it is not known what the max value of "N" is.

Usage: SetConst1ToReg = 10

This will mean that in this shader, there will be accessible a constant "c10" that can be used as if it was defined in the shader itself.

GetConstNFromReg

This allows a constant register defined in this shader to be re-used in other shaders.

"N" is an integer that identifies the specific constant register that is to be shared. The starting value for N is "1", but it is not known what the max value of "N" is.

Usage: GetConst1FromReg = 123

This means that the register c123 will be made available to other shaders, and identified as accessed using the "SetConst1ToReg" field.

[SFn]

These are individual sections that define a set of characteristics for different surfaces (render targets) which thus specifies a subset of all of the currently created surfaces, and then defines the stereo render mode for this subset of surfaces. There are a number of fields that can be set, and the more that are set, the more tightly defined and specific (and smaller) the subset of surfaces will be that are affected by the stereo setting. The information for these surfaces comes from the LOG.txt file. The value of "n" is an integer from 0 - 9. The question immediately arises as to how on earth you know what surfaces are doing what. Bascially you don't, so you usually just need to systematically go through all (unique) surfaces listed in the LOG.txt file, setting the DefMode parameter to 0 and 1 and see what happens. That being said, if you read up on MSDN, the "Format" field can be used to work out what type of effect/operation is being done i.e. some formats are used for depth surfaces, some for lights, some for water etc. There is also information on the resolutions that are common for different effects (though games with multiple quality levels may have different resolutions, and also if you change the game resolution you may need to cover more etc). On the whole though this is a bit of a grind with some guesswork.

DefMode

This is the stereoization mode to apply to all surfaces that meet the criteria specified for this surface:

0 = render according to Nvidia automatic

1 = render forcing this surface to be stereoized

2 = render forcing this surface to be monoscopic

Format

This refers to the format of the render target and how the different components are encoded. You don't need to know this, the LOG.txt file will specify what the format is for each surface created. You can find out what the different codes mean by looking on MSDN. Usege: "Format = 21"

Usage

This parameter is also identified for a given surface in the LOG.txt file. It refers to whether a given surface is used as a depth buffer or not.

Height

The height of the particular render target in pixels.

Width

The width of the particular render target in pixels.

UseBackBufRes

This is either true or false and refers to setting the width and height to be that of the current back buffer.

Levels

Usage: Levels = 1

This parameter is also identified for a given surface in the LOG.txt file.

Pool

Usage: Pool = 0

This parameter is also identified for a given surface in the LOG.txt file.

[RTn]

This is very similar to [SFn], but is pre-subsetted for non-square surfaces. These are individual sections that define a set of characteristics for different surfaces (render targets) which thus specifies a subset of all of the currently created surfaces, and then defines the stereo render mode for this subset of surfaces. There are a number of fields that can be set, and the more that are set, the more tightly defined and specific (and smaller) the subset of surfaces will be that are affected by the stereo setting. The information for these surfaces comes from the LOG.txt file. The value of "n" is an integer from 0 - 9. All fields are the same as for [SFn].

Hex to Float conversion

Several values in the ini file are floating point values that must be specified in hex. These include Separation, Convergence, Const1, Const2, Const3 and Const4.

You can use this online converter to convert between float and hex: http://gregstoll.dyndns.org/~gregstoll/floattohex/

Alternatively, if you prefer working in a command line environment, you might considder this Python script: https://raw.githubusercontent.com/DarkStarSword/3d-fixes/master/float_to_hex.py

List of features supported by HelixMod, and all versions available.

Horizontally across the top, we've got versions of the DLL, based on the mod-date found in the zip file. We are using the YYMMDD format.

Going down vertically, we have the different features that are available. Not all features are available or work in all DLLs.


Entries in the table are:

  • blank if untested or unknown to work.
  • OK if tested and known to work.
  • X if tested and known to fail.



140302 130906 130305 120401 120304
[General]
DumpAll OK OK OK OK X
UseRenderedShaders OK OK X X X
DefVSConst1 OK OK
DefPSConst1 OK OK
UseEndScene OK OK OK OK OK
DefPSSampler OK OK OK OK OK
DefVSSampler OK OK OK OK OK
bCalcTexCRCatStart OK OK OK X X
PresetsKeysList OK OK
Preset1Key X X OK OK
DefPSViewSizeConst OK
DefSquareSurfaceMode OK
DefDepthStencilSurfaceMode
DefSurfaceCreationMode OK
SkipSetScissorRect OK
DefRtCreationMode OK
RtCreationModeList
SurfaceCreationModeList OK
OverrideMethod OK
UseAlternateCRC
DefModuleName
InitMouse
ProxyLib
GetCurDirAtLoad
UseExtInterfaceOnly
[Preset1]
Convergence X X X OK OK
Separation X X X OK OK
UseSepSettings X X X OK OK
[KEY*]
Key OK OK
Presets OK OK
Type OK OK
Delay OK OK
[PRES*]
Const1 OK OK
UseByDef OK
Convergence OK
Separation OK
UseSepSettings OK
SaveSepSettings OK
[VSnnnnnnnn]
CheckTexCRC OK
VBOffsetList
ValForDefined OK
ValNotDefined OK
TexCounterReg OK
UseDefinedOnly OK
DefinedTexturesVS OK
SetSampler1ToReg
SetConst1ToReg
GetConst1FromReg
ResetConst1AfterSet
DefStage
FirstVertexPosReg
GetVertex
UseMatrix
MatrixReg
GetMatrixFromReg
InverseMatrix
DoubleInverseMatrix
[VSnnnnnnnn.m]
PointsList
Offset
IsDisabledList
StartResW
StartResH
EndResW
EndResH
[TEXnnnnnnnn]
PresIndex
Index
VBOffsetList
[PSnnnnnnnn]
UseMatrix
MatrixReg
GetMatrixFromReg
InverseMatrix
DoubleInverseMatrix
GetSampler1FromReg
SetSampler1ToReg
GetConst1FromReg
[SFn]
DefMode
Format
Usage
Height
Width
UseBackBufRes
Levels
Pool
[RTn]
DefMode
Format
Usage
Height
Width
UseBackBufRes
Levels
Pool