Decompile Cg shaders?

Started by
2 comments, last by Prozak 18 years, 8 months ago
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
Advertisement
Actually, .fx is the file name extension for Nvidia's FX Composer Cg authoring software.
Quote:Original post by Optus
Actually, .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.
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.

This topic is closed to new replies.

Advertisement