# Decompile Cg shaders?

This topic is 4854 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hey everbody, I have some shaders here, their file extension is fx so I tried to open them with the shader editor from the DX SDK. Didn't work as the file content was binary. They all start with:
235B 0702 6367   #[..cg
So I think this could be a cg shader. Is this right? Now my question: Is there are way to decompile / modify this shaders? I have no illegal aims, I just want to mod the game (Battlefield 2) that uses this shaders. Thanks in advance, Yarin

##### Share on other sites
Actually, .fx is the file name extension for Nvidia's FX Composer Cg authoring software.

##### Share on other sites
Quote:
 Original post by OptusActually, .fx is the file name extension for Nvidia's FX Composer Cg authoring software.

Correction: FX Composer isn't Cg authoring software, it's Microsoft's FX (effect)- file authoring software. I think it still could be used to author CgFX files.

I don't know what shaders Battlefield 2 uses, but solely judging by the file extension, those could be either Microsoft's effects, CgFX files, or even BF2's custom format. Either way, they are compiled, and I don't know if there's any way to decompile them.

Btw, if you are just modding BF2, you shouldn't have any need to modify shaders. I haven't used BF2 SDK, but if they allow custom shaders, there should be some documentation about making them.

##### Share on other sites
Back-engineering shaders is bad for a multiplayer game's security, because a savvy player could then trick the engine rendering pipeline, and take advantage of it (by making the walls transparent, for example)...

So I wouldnt be surprised if they took extra steps to secure it.

1. 1
Rutin
42
2. 2
3. 3
4. 4
5. 5

• 9
• 27
• 20
• 14
• 14
• ### Forum Statistics

• Total Topics
633388
• Total Posts
3011620
• ### Who's Online (See full list)

There are no registered users currently online

×