Tuesday, March 7, 2017

Converting shaders to SM3.0

This page is a replacement for one originally made by Mana84. He wrote an app that will convert a shader file from ShaderModel 1.0 or 2.0 into ShaderModel 3.0, which is the only one supported by HelixMod.
It has a small flaw where it may leave a . after the output like Texcoord1 o2[.] just make sure to check if it does that then remove it. Should save some time if doing an old game. Make sure to remove preshader lines if it has any before hand as well. Just drag and drop.

It's also possible to use DarkStarSword's shadertool.py, that will automatically convert any 1.0 or 2.0 shaders into Shader Model 3. 


Thanks to D-Man11 for finding and reporting the broken link, and thanks to masterotaku for uploading the original converter.


  1. Thanks a lot for this tools, I have fixed HUD and crosshair in "Half Life 2: Update" with them yet.

  2. Thanks for this update, bo3b. A few other issues regarding ShaderConverter.exe:

    - Only converts vertex shaders
    - "sincos" function doesn't get converted correctly.
    - Fog instructions aren't converted at all
    - The way declarations are converted can cause problems. For example, dcl_texcoord o0.xy (instead of dcl_texcoord o0 ) can cause issues with missing or distorted textures.

    For the above reasons, I only use ShaderConverter for no more than 2 files at a time. I really like it's drag & drop feature, though. It's particularly handy if you want to quickly timestamp any file or files.

    ShaderTool.py can convert Vertex & Pixel shaders and converts both shader types correctly (and more).

    Big thanks to mana84 and DarkStarSword for making such great programs!

    1. Is somewhere manual how to run and use shadertool.py (searching in nvidia forum is awfull) only to converting (not for autofixing Unity games)

      C:\Users\admin>python e:\shadertool.py -i e:\7BBB7B71.txt
      Traceback (most recent call last):
      File "e:\shadertool.py", line 8, in
      import shaderutil
      ModuleNotFoundError: No module named 'shaderutil'

      What might have gone wrong?

    2. As I understand "import" is the same as "include" in C-syntax languages. Where should I take "shaderutil.py" ?

  3. It's seems to be like that... Thanks to all

    C:\Users\admin>python e:\shadertool.py -o e:\_7BBB7B71.txt e:\7BBB7B71.txt
    parsing e:\7BBB7B71.txt...
    Converting to Shader Model 3...