Lesson 1 - using HelixMod

From Bo3b's School for Shaderhackers
Revision as of 23:51, 15 August 2014 by Bo3b admin (Talk | contribs)

Jump to: navigation, search

Summary

This lesson demonstrates how to use the HelixMod debugger to find shaders, and how to save shader ASM code.

Level of difficulty: Easy
Time required: 15 minutes


Objective

We'll run the HelixMod debugger and learn the commands to hunt shaders.
We'll create and learn about the dx9settings.ini file with good default settings.
We'll find a shader and save and look at the ASM file.

Quiz

Save and share an ASM shader file from the game.


Now that we have HelixMod installed with the red text, we are clearly running the debugger version. HelixMod operates using the NumberPad keys. The keys can be changed if necessary or desired. The default settings use Numpad 1,2,3 for Pixel Shader, NumPad 4,5,6 for Vertex Shader.

In general, Vertex Shader specifies position, including 3D position in space. And the Pixel Shader determines the color of the resulting on screen pixel. It gets more complicated than that, but that is all we need for now.

The basic strategy is navigate the list of shaders in a game, looking for the specific one that is causing problems. You can hold down the hunting key to have it cycle to the next. As you cycle through shaders, you will see parts of the game image blink off, then back on. When a shader blinks off, you've found the one you want, and can save it using another key.

Let's see how to navigate the HelixMod UI using the default keys.

  • Shader hunting keys
    1. Run The Ball, in 3D with HelixMod installed.
    2. Make sure we have red text. On left, VS and PS counts and CRC.
    3. In middle, convergence and separation settings.
    4. Hit NumPad 1, then NumPad 4 to cycle backwards one shader.
    5. Note the count of the shaders for each type. This simple game has 8000 shaders.
    6. Hold down both the NumPad 1 and NumPad 4 key watching for changes on screen.
    7. When you a change in the image, let go and then cycle up and down with 1,2 and 4,5 to get a feel for it.
    8. We aren't looking for a specific shader just yet, so let's move on. Quit the game.



It should be clear that hunting specific shaders can be fairly tedious, especially if there are a lot of them. Let's see how to create a dx9settings.ini file, to add some better defaults to HelixMod.

A particularly valuable feature is the UseRenderedShaders=true, which will limit the set of shaders to cycle to only those being actively used in the current scene, not every shader in the game.

  • Editing dx9settings.ini
    1. UseRenderedShaders

Original dx9settings discussion


Now that we have set up to use UseRenderedShaders=true, let's see how that improves our shader hunting, to only cycle shaders in the current frame.

  • Improved shader hunting



Let's choose any shader that you find interesting, and have HelixMod save the ASM text.

  • Shader saving



If you sucessfully saved the ASM text file, then congratulations! You now know how to use the HelixMod debugger to hunt shaders.

If you have any questions or suggestions, please use the Discussion tab, and start a new topic.