STAR WARS™ Empire at War: Gold Pack

STAR WARS™ Empire at War: Gold Pack

Change the way you play
Upload and subscribe to user created mods for Star Wars: Empire at War™. Don’t forget to rate and review your favorite mods. User created mods are not officially supported by Disney.
Learn More
Fix for green models- compile shaders
Reposting here for better visibility/applicability.

I have discovered a fix for problems with green colored ships etc in mods. It is not an easy fix, so this needs to be done by workshop maintainers and mod makers, although users can attempt it as well if they want.

The cause of the problem is Shaders. Since the update, custom shaders have not been automatically compiled by the game, so ships show up green (the default shader). Uncompiled shaders have the file extension .fx and .fxh instead of .fxo.

Mod shaders are located in the Data/Art/Shaders directory of the mod. Workshop mods are located in steamapps/workshop/content/32470 and then are in numbered folders. Other mods are located in the game's local files.

To fix the problem, mod makers and workshop maintainers need to COMPILE their shaders.

1) Go to https://www.microsoft.com/en-us/download/confirmation.aspx?id=6812 and acquire the Microsoft DirectX Software Development Kit

2) Either install the SDK or open the installer with an archive reader like 7-Zip

3) Go to the Utilities/bin folder and find the program fxc.exe

4) Put fxc.exe where you have uncompiled shaders

5) Open Command Prompt and make sure it is set to the directory where your fxc.exe and shaders are (so if you run fxc.exe /? you get help text)

6) Run the command fxc.exe /Tfx_2_0 /LD /Fo"ShaderOutputName.fxo" "ShaderInputName.fx"

7) Your compiled .fxo shader should be in the same folder as fxc.exe. Now you can put it in your mod, Data/Art/Shaders folder and the game should read it in.

8) Run the mod and check that models look normal

To Petroglyph: it seems that you removed calls to D3DCompileFromFile when you updated the game executable. I'm not sure how realistic it is to put back in.
< >
Showing 16-28 of 28 comments
Captain Autismo Sep 5, 2017 @ 12:31am 
I got it working by using this, but he missed a few key points. Should have made the command to run from within the folder more obvious.

fxc.exe /Tfx_2_0 /LD /Fo"ShaderOutputName.fxo" "ShaderInputName.fx"


Shader input name would be whatever .fx file is already in your Shaders folder of the mod. Shader output name would be the same name, but will be a .fxo file.

For example, my original file was MeshBumpLight.fx so "MeshBumpLight.fx" would replace "ShaderInputName.fx" in the command posted above. Then for "ShaderOutputName.fxo", you would put "MeshBumpLight.fxo".

The command would be:
fxc.exe /Tfx_2_0 /LD /Fo"MeshBumpLight.fxo" "MeshBumpLight.fx"

Then either rename the original MeshBumpLight.fx file to something else or delete it entirely. If that makes sense.

That got it working for me. After having to deal with a few errors with the DirectX installation in the beginning.
Cam Sep 5, 2017 @ 8:29am 
Hi, I've tried doing what you said, I have followed the instructions carefully and when I try the command prompt it just says "is not recognized as an internal or external command, operable program or batch file." if someone could help that would be wonderful, the instructions are vague to me.
Last edited by Cam; Sep 5, 2017 @ 8:30am
evilbobthebob 6 Sep 5, 2017 @ 8:32am 
That means you didn't follow step 4, put fxc.exe where you have uncompiled shaders (.fxo files), which is probably in Data/Art/Shaders/ in whatever mod you're editing.
Cam Sep 5, 2017 @ 8:59am 
Originally posted by evilbobthebob:
That means you didn't follow step 4, put fxc.exe where you have uncompiled shaders (.fxo files), which is probably in Data/Art/Shaders/ in whatever mod you're editing.
They're in the Shaders folder
evilbobthebob 6 Sep 5, 2017 @ 9:04am 
If the executable is in the Shaders folder, you need to make sure the command prompt is pointing to the same directory (So Data/Art/Shaders should be in the command prompt window). You can shift right click in the Shaders directory and use "Open command window here" to make sure.
Cam Sep 5, 2017 @ 9:14am 
Originally posted by evilbobthebob:
If the executable is in the Shaders folder, you need to make sure the command prompt is pointing to the same directory (So Data/Art/Shaders should be in the command prompt window). You can shift right click in the Shaders directory and use "Open command window here" to make sure.
Command prompt is set to the exact directory, I have everything in place but when I try to run the command it says "Is not recognized...."

EDIT: Ok, originally I couldn't get command prompt to open when right-clicked on the folder. I had to change the registry to do that. I did it now using command prompt open here and got it working. Thanks a lot.
Last edited by Cam; Sep 5, 2017 @ 9:43am
Foxus Sep 5, 2017 @ 12:18pm 
i have done fix but small ships in yodenmod 2017 are still green the other are normal now what can i do pls help
evilbobthebob 6 Sep 5, 2017 @ 2:44pm 
There are possibly other shaders that need to be compiled for YodenMod, or you have shaders in the main game directory instead of just in the mod.
Foxus Sep 5, 2017 @ 3:14pm 
i have shaders which are not fxo
but for them it dont work
Shadow Sep 5, 2017 @ 4:16pm 
the shaders in yodenmod are .fxh what do i do?
evilbobthebob 6 Sep 5, 2017 @ 4:21pm 
.fxh is a shader header file. .fx is the shader. If all the files are .fxh you can't compile them.
Cheeze Feb 12, 2018 @ 2:43pm 
For Forces of Corruption I have uninstalled/reinstalled, checked that all shaders are already in compiled .fxo format and then tried deleting the shaders folder and nothing is fixing my green shading problem. I am hoping the developers can fix this.
Locutus 2 Mar 1, 2018 @ 10:11am 
One very important thing I'd like to add to this tutorial:
If you try to add _new_ shaders (aka using a custom name) they need to be loaded through a meg file of they won't be recognized by the game.
(Technically it's even valid to add a completely empty file with the new name to the meg and then add the actual shader to the default mod folder structure).
< >
Showing 16-28 of 28 comments
Per page: 1530 50

Date Posted: Sep 2, 2017 @ 4:10pm
Posts: 28